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

<title>B-Index</title>
<meta name="date" content="2020-02-25">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I J K L M N O P R S T U V W X Y Z

B

beforeClass() - Method in class bichromate.testNG.sTestBaseTestNGDeclaration

beforeClass - no action taken here

beforeMethod() - Method in class bichromate.testNG.sTestBaseTestNGDeclaration

beforeMethod - No actions Taken

beforeSuite() - Method in class bichromate.testNG.sTestBaseTestNGDeclaration

beforeSuite - Set org apache system logging.

bichromate.baseObjectTypes - package bichromate.baseObjectTypes

bichromate.bugTracking - package bichromate.bugTracking

bichromate.clients - package bichromate.clients

bichromate.core - package bichromate.core

bichromate.dataStore - package bichromate.dataStore

bichromate.DBAccess - package bichromate.DBAccess

bichromate.factories - package bichromate.factories

bichromate.graphs - package bichromate.graphs

bichromate.httpListner - package bichromate.httpListner

bichromate.logFiles - package bichromate.logFiles

bichromate.newRelic - package bichromate.newRelic

bichromate.screens - package bichromate.screens

bichromate.sealights - package bichromate.sealights

bichromate.servers - package bichromate.servers

bichromate.system - package bichromate.system

bichromate.testNG - package bichromate.testNG

bichromate.tools - package bichromate.tools

bichromate.video - package bichromate.video

bichromateAppiumServerFactory - Class in bichromate.mobile

This class demonstrates bichromateAppiumServerFactory()
 This class creates and starts the Appium server for mobile testing

bichromateAppiumServerFactory() - Constructor for class bichromate.mobile.bichromateAppiumServerFactory

bichromateAppiumServerFactory.Test - Class in bichromate.mobile

This inner class demonstrates Test()
 Inner class to test bichromateAppiumServerFactory

bichromateConstants - Class in bichromate.core

Shared constants used by the Bichromate engine

bichromateConstants() - Constructor for class bichromate.core.bichromateConstants

blackHilite - Static variable in class bichromate.core.bichromateConstants

browserStackWebDriver - Static variable in class bichromate.core.bichromateConstants

buildConnection() - Method in class bichromate.clients.sTestLoadClientManager

buildExecutionHistoryReport() - Method in class bichromate.logFiles.testExecutionLogFactory

buildExecutionHistoryReport() - builds the execution report

buildNewChromeLocalDriver(ChromeOptions) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewChromeLocalDriver() - method, This function setsup the local chrome web driver, with ChromeOptions passsed in

buildNewEdgeLocalDriver() - Method in class bichromate.factories.sTestWebDriverFactory

buildNewEdgeLocalDriver() - method, This function setsup local Safari webdriver

buildNewEdgeLocalDriver(EdgeOptions) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewEdgeLocalDriver() - method, builds a new Edge local driver

buildNewFireFoxLocalDriver(FirefoxOptions) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewFireFoxLocalDriver() - method, This function setsup local firefox webdriver

buildNewIELocalDriver(DesiredCapabilities) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewIELocalDriver() - This function sets up the IE local webDriver.

buildNewMobileLocalAndroidAppWebDriver(DesiredCapabilities, String) - Method in class bichromate.factories.sTestWebDriverFactory

method buildNewMobileLocalAndroidAppWebDriver() - Main method to create a AndroidDriver using local http://127.0.0.1:4723/wd/hub

buildNewMobileLocalIOSAppWebDriver(DesiredCapabilities, String) - Method in class bichromate.factories.sTestWebDriverFactory

method buildNewMobileLocalIOSAppWebDriver() - Main method to create a AndroidDriver using local http://127.0.0.1:4723/wd/hub

buildNewOperaLocalDriver(DesiredCapabilities) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewOperaLocalDriver() - method, This function setsup local Safari webdriver

buildNewOperaLocalDriver() - Method in class bichromate.factories.sTestWebDriverFactory

buildNewOperaLocalDriver() - method, This function setsup local Opera webdriver

buildNewOperaLocalDriver(OperaDriverService) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewOperaLocalDriver() - method, This function setsup local Opera webdriver

buildNewSafariLocalDriver(SafariOptions) - Method in class bichromate.factories.sTestWebDriverFactory

buildNewSafariLocalDriver() - method, This function setsup local Safari webdriver

buildWorkingDirectoryPath(String) - Method in class bichromate.factories.osInformationFactory

This function Demonstrates buildWorkingDirectoryPath().

buildWorkingDirectoryPath(String) - Method in class bichromate.factories.sTestOSInformationFactory

bundleIdentifier - Variable in class bichromate.dataStore.sTestSeeTestAppCloudInfoStore

BUTTON - Static variable in class bichromate.dataStore.sTestDOMObjects

A B C D E F G H I J K L M N O P R S T U V W X Y Z

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

redpajama_set_name: RedPajamaGithub


text:
package org.wso2.carbon.device.mgt.input.adapter.extension;

import java.util.Map;

/**
 * Content Transformer will be triggered through input adapters
 */
public interface ContentTransformer {

    /**
     * This returns the type of ContentTransformer.
     */
    String getType();

    /**
     * This is used to transform the receiver content
     * @param message message to be format
     * @param dynamicProperties related to transport.
     * @return transformed message
     */
    Object transform(Object message, Map<String, Object> dynamicProperties);
}


text:
<?php

final class PhabricatorAuthProvidersGuidanceEngineExtension
  extends PhabricatorGuidanceEngineExtension {

  const GUIDANCEKEY = 'core.auth.providers';

  public function canGenerateGuidance(PhabricatorGuidanceContext $context) {
    return ($context instanceof PhabricatorAuthProvidersGuidanceContext);
  }

  public function generateGuidance(PhabricatorGuidanceContext $context) {
    $configs = id(new PhabricatorAuthProviderConfigQuery())
      ->setViewer(PhabricatorUser::getOmnipotentUser())
      ->withIsEnabled(true)
      ->execute();

    $allows_registration = false;
    foreach ($configs as $config) {
      $provider = $config->getProvider();
      if ($provider->shouldAllowRegistration()) {
        $allows_registration = true;
        break;
      }
    }

    // If no provider allows registration, we don't need provide any warnings
    // about registration being too open.
    if (!$allows_registration) {
      return array();
    }

    $domains_key = 'auth.email-domains';
    $domains_link = $this->renderConfigLink($domains_key);
    $domains_value = PhabricatorEnv::getEnvConfig($domains_key);

    $approval_key = 'auth.require-approval';
    $approval_link = $this->renderConfigLink($approval_key);
    $approval_value = PhabricatorEnv::getEnvConfig($approval_key);

    $results = array();

    if ($domains_value) {
      $message = pht(
        'Phabricator is configured with an email domain whitelist (in %s), so '.
        'only users with a verified email address at one of these %s '.
        'allowed domain(s) will be able to register an account: %s',
        $domains_link,
        phutil_count($domains_value),
        phutil_tag('strong', array(), implode(', ', $domains_value)));

      $results[] = $this->newGuidance('core.auth.email-domains.on')
        ->setMessage($message);
    } else {
      $message = pht(
        'Anyone who can browse to this Phabricator install will be able to '.
        'register an account. To add email domain restrictions, configure '.
        '%s.',
        $domains_link);

      $results[] = $this->newGuidance('core.auth.email-domains.off')
        ->setMessage($message);
    }

    if ($approval_value) {
      $message = pht(
        'Administrative approvals are enabled (in %s), so all new users must '.
        'have their accounts approved by an administrator.',
        $approval_link);

      $results[] = $this->newGuidance('core.auth.require-approval.on')
        ->setMessage($message);
    } else {
      $message = pht(
        'Administrative approvals are disabled, so users who register will '.
        'be able to use their accounts immediately. To enable approvals, '.
        'configure %s.',
        $approval_link);

      $results[] = $this->newGuidance('core.auth.require-approval.off')
        ->setMessage($message);
    }

    if (!$domains_value && !$approval_value) {
      $message = pht(
        'You can safely ignore these warnings if the install itself has '.
        'access controls (for example, it is deployed on a VPN) or if all of '.
        'the configured providers have access controls (for example, they are '.
        'all private LDAP or OAuth servers).');

      $results[] = $this->newWarning('core.auth.warning')
        ->setMessage($message);
    }

    return $results;
  }

  private function renderConfigLink($key) {
    return phutil_tag(
      'a',
      array(
        'href' => '/config/edit/'.$key.'/',
        'target' => '_blank',
      ),
      $key);
  }

}


text:
module.exports = function() {

    // LOGIN/LOGOUT API
    /////////////////////////////////////////////////

    // /login GET show form to post
    vu.server.route({
        method: 'GET',
        path: '/login',
        handler: function( request , reply ){
            //SHOW FORM
            reply( 'login' ).redirect( '/' );
        }
    });

    // /login POST Form( email )
    vu.server.route({
        method: 'POST',
        path: '/login',
        handler: function( request, reply ){
            //GET USER
            vu.models.User.get( request.payload.email , function( err , user ){
                //NO USER
                if( user == null ){
                    reply( 'login' ).redirect( '/' );
                    return;
                }else{
                    //CREATE TOKEN
                    vu.models.Token.create({
                            email: request.payload.email
                        },
                        function (err, token) {
                            //SEND EMAIL
                            vu.methods.sendEmail({
                                from: 'admin@vestu.com',
                                replyTo: [ 'admin@vestu.com' ],
                                to: [ request.payload.email ],
                                subject: 'Vestu Login',
                                text: 'Open the link below to login.\n\nhttps://logintest.vestu.com/login/' + token.get('token') + ' \n\nOnce opened this link will expire.'
                            });
                            reply( 'login' ).redirect( '/login/check_email' );
                        }
                    );
                }
            });
        }
    });

    // /login/check_email --> Show notice to check email
    vu.server.route({
        method: 'GET',
        path: '/login/check_email',
        handler: function( request , reply ){
            reply.view( 'login_check_email' );
        }
    });

    // /login/{token} --> Log user in and expire token
    vu.server.route({
        method: 'GET',
        path: '/login/{token}',
        handler: function( request , reply ){
            // GET TOKEN
            vu.models.Token.get( encodeURIComponent( request.params.token ) , function( err , token ){
                //NO TOKEN
                if( token == null ){
                    //no result
                    reply( 'login' ).redirect( '/' );

                // TOKEN
                }else{
                    //GET USER VIA EMAIL IN TOKEN
                    vu.models.User.get( token.get( 'email' ) , function( err , user ){
                    //result
                        //INVALID USER
                        if( user == null ){
                            reply( 'login' ).unstate( 'service' ).unstate( 'session' ).redirect( '/' );
                        }else{
                            reply( 'login' ).state( 'service' , vu.methods.cookieFromUser( user ) ).state( 'session' , new Date().getTime() ).redirect( '/' );
                        }
                    });
                    //DELETE TOKEN
                    vu.models.Token.destroy( encodeURIComponent( request.params.token ) );
                }
            });
        }
    });

    // /logout REMOVE COOKIE GOTO /
    vu.server.route({
        method: 'POST',
        path: '/logout',
        handler: function( request , reply ){
            reply( 'logout' ).unstate( 'service' ).unstate( 'session' ).redirect( '/' );
        }
    });
}


text:
package com.vip.saturn.job.console.service.impl;

import com.vip.saturn.job.console.domain.NamespaceDomainInfo;
import com.vip.saturn.job.console.exception.SaturnJobConsoleException;
import com.vip.saturn.job.console.exception.SaturnJobConsoleHttpException;
import com.vip.saturn.job.console.mybatis.entity.NamespaceZkClusterMapping;
import com.vip.saturn.job.console.mybatis.repository.NamespaceZkClusterMappingRepository;
import com.vip.saturn.job.console.service.NamespaceAndJobService;
import com.vip.saturn.job.console.service.NamespaceService;
import com.vip.saturn.job.console.service.RegistryCenterService;
import com.vip.saturn.job.console.utils.SaturnThreadFactory;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static com.vip.saturn.job.console.service.impl.RegistryCenterServiceImpl.ERR_MSG_NS_ALREADY_EXIST;

/**
 * @author Ray Leung
 */
public class NamespaceAndJobServiceImpl implements NamespaceAndJobService {

	private static final Logger logger = LoggerFactory.getLogger(NamespaceAndJobServiceImpl.class);

	@Autowired
	private RegistryCenterService registryCenterService;

	@Autowired
	private NamespaceZkClusterMappingRepository namespaceZkClusterMappingRepository;

	@Autowired
	private NamespaceService namespaceService;

	private ExecutorService executorService;

	@PostConstruct
	public void init() {
		if (executorService == null) {
			executorService = Executors.newFixedThreadPool(5, new SaturnThreadFactory("Saturn-NamespaceAndJob-Thread"));
		}
	}

	@PreDestroy
	public void destroy() {
		if (executorService != null) {
			executorService.shutdownNow();
		}
	}

	@Override
	public void createNamespaceAndCloneJobs(String srcNamespace, String namespace, String zkClusterName,
			String createBy) throws SaturnJobConsoleException {
		logger.info("start createNamespaceAndCloneJobs, srcNamespace: {}, namespace: {}, zkClusterName: {}",
				srcNamespace,
				namespace, zkClusterName);
		NamespaceZkClusterMapping mapping = namespaceZkClusterMappingRepository.selectByNamespace(srcNamespace);
		if (mapping == null) {
			throw new SaturnJobConsoleException("no zkCluster mapping is not found");
		}

		NamespaceDomainInfo namespaceInfo = new NamespaceDomainInfo();
		namespaceInfo.setNamespace(namespace);
		namespaceInfo.setZkCluster(zkClusterName);
		namespaceInfo.setContent("");
		try {
			registryCenterService.createNamespace(namespaceInfo);
			registryCenterService.refreshRegistryCenterForNamespace(zkClusterName, srcNamespace);
		} catch (SaturnJobConsoleHttpException e) {
			if (StringUtils.equals(String.format(ERR_MSG_NS_ALREADY_EXIST, namespace), e.getMessage())) {
				logger.warn("namespace already exists, ignore this exception and move on");
			} else {
				throw e;
			}
		}
		namespaceService.importJobsFromNamespaceToNamespace(srcNamespace, namespace, createBy);
		logger.info("finish createNamespaceAndCloneJobs, srcNamespace: {}, namespace: {}, zkClusterName: {}",
				srcNamespace,
				namespace, zkClusterName);
	}

	@Override
	public void asyncCreateNamespaceAndCloneJobs(final String srcNamespace, final String namespace,
			final String zkClusterName, final String createBy) {
		executorService.submit(new Runnable() {
			@Override
			public void run() {
				try {
					createNamespaceAndCloneJobs(srcNamespace, namespace, zkClusterName, createBy);
				} catch (SaturnJobConsoleException e) {
					logger.warn("fail to create and clone jobs, srcNamespace: {}, namespace: {}, zkClusterName: {}",
							srcNamespace, namespace, zkClusterName, e);
				}
			}
		});
	}
}


text:
function reverseString(str) {
  var strReverse = str.split('').reverse().join('');
  str = strReverse;
  return str;
}


text:
var CommonDOM = {
	getAttributesStartsWith: function(el, startsWith) {
		var allElements = el.querySelectorAll('*');
		var list = [];
		for (var j = 0; j < allElements.length; j++) {
			for (var i = 0, atts = allElements[j].attributes, n = atts.length; i < n; i++) {
				if (atts[i].nodeName.indexOf(startsWith) === 0) {
					list.push(allElements[j]);
					break;
				}
			}
		}
		return list;
	}
};

export default CommonDOM;


text:
{include template: "include/header"}

Page Not Found

Sorry, the page you are looking for could not be found.

{include template: "include/footer"}


text:
@implementation CPTPlotSpaceTests

@synthesize graph;

-(void)setUp
{
    self.graph               = [[(CPTXYGraph *)[CPTXYGraph alloc] initWithFrame : CGRectMake(0.0, 0.0, 100.0, 50.0)] autorelease];
    self.graph.paddingLeft   = 0.0;
    self.graph.paddingRight  = 0.0;
    self.graph.paddingTop    = 0.0;
    self.graph.paddingBottom = 0.0;

    [self.graph layoutIfNeeded];
}

-(void)tearDown
{
    self.graph = nil;
}

#pragma mark -
#pragma mark NSCoding Methods

-(void)testKeyedArchivingRoundTrip
{
    CPTPlotSpace *plotSpace = self.graph.defaultPlotSpace;

    plotSpace.identifier = @"test plot space";

    CPTPlotSpace *newPlotSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:plotSpace]];

    STAssertEqualObjects(plotSpace.identifier, newPlotSpace.identifier, @"identifier not equal");
    STAssertEquals(plotSpace.allowsUserInteraction, newPlotSpace.allowsUserInteraction, @"allowsUserInteraction not equal");
}

@end


text:
<?php

namespace PHPExiftool\Driver\Tag\Lytro;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class LensTemperature extends AbstractTag
{

    protected $Id = 'DevicesLensTemperature';

    protected $Name = 'LensTemperature';

    protected $FullName = 'Lytro::Main';

    protected $GroupName = 'Lytro';

    protected $g0 = 'Lytro';

    protected $g1 = 'Lytro';

    protected $g2 = 'Camera';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Lens Temperature';
}


text:
using namespace std;

class Personne {
private:
    string nom;
    string society;
    int bite;
public:
    Personne(const string &nom, const string &society, int bite);

    Personne(const string &nom);
};

#endif //POO_PERSONNE_H


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

001
025package org.slf4j.helpers;
026
027import java.util.concurrent.ConcurrentHashMap;
028import java.util.concurrent.ConcurrentMap;
029
030import org.slf4j.IMarkerFactory;
031import org.slf4j.Marker;
032
033/**
034 * An almost trivial implementation of the {@link IMarkerFactory}
035 * interface which creates {@link BasicMarker} instances.
036 *
037 * <p>Simple logging systems can conform to the SLF4J API by binding
038 * {@link org.slf4j.MarkerFactory} with an instance of this class.
039 *
040 * @author Ceki G&uuml;lc&uuml;
041 */
042public class BasicMarkerFactory implements IMarkerFactory {
043
044    private final ConcurrentMap<String, Marker> markerMap = new ConcurrentHashMap<String, Marker>();
045
046    /**
047     * Regular users should <em>not</em> create
048     * <code>BasicMarkerFactory</code> instances. <code>Marker</code>
049     * instances can be obtained using the static {@link
050     * org.slf4j.MarkerFactory#getMarker} method.
051     */
052    public BasicMarkerFactory() {
053    }
054
055    /**
056     * Manufacture a {@link BasicMarker} instance by name. If the instance has been
057     * created earlier, return the previously created instance.
058     *
059     * @param name the name of the marker to be created
060     * @return a Marker instance
061     */
062    public Marker getMarker(String name) {
063        if (name == null) {
064            throw new IllegalArgumentException("Marker name cannot be null");
065        }
066
067        Marker marker = markerMap.get(name);
068        if (marker == null) {
069            marker = new BasicMarker(name);
070            Marker oldMarker = markerMap.putIfAbsent(name, marker);
071            if (oldMarker != null) {
072                marker = oldMarker;
073            }
074        }
075        return marker;
076    }
077
078    /**
079     * Does the name marked already exist?
080     */
081    public boolean exists(String name) {
082        if (name == null) {
083            return false;
084        }
085        return markerMap.containsKey(name);
086    }
087
088    public boolean detachMarker(String name) {
089        if (name == null) {
090            return false;
091        }
092        return (markerMap.remove(name) != null);
093    }
094
095    public Marker getDetachedMarker(String name) {
096        return new BasicMarker(name);
097    }
098
099}


text:
@implementation NSObject (AutoDescription)

- (NSString *) autoDescriptionForClassType:(Class)classType
                         excludeProperties:(NSArray *) properties {

	NSMutableString * result = [NSMutableString string];

	// Find Out something about super Classes
	Class superClass  = class_getSuperclass(classType);
	if  ( superClass != nil && ![superClass isEqual:[NSObject class]])
	{
		// Append all the super class's properties to the result (Reqursive, until NSObject)
		[result appendString:[self autoDescriptionForClassType:superClass excludeProperties: properties]];
	}

	// Add Information about Current Properties
	unsigned int      property_count;
	objc_property_t * property_list = class_copyPropertyList(classType, &property_count); // Must Free, later

	for (int i = property_count - 1; i >= 0; --i) { // Reverse order, to get Properties in order they were defined
		objc_property_t property = property_list[i];

		// For each property we are loading its name
		const char * property_name = property_getName(property);
		NSString * propertyName = [NSString stringWithCString:property_name encoding:NSASCIIStringEncoding];

        BOOL respondsToProperty = [classType instancesRespondToSelector:NSSelectorFromString(propertyName)];

        // And if name is ok, we are getting value using KVC
        if (propertyName
        && respondsToProperty
        && ![properties containsObject: propertyName]
        && ![propertyName isEqualToString:@"debugDescription"]
        && ![propertyName isEqualToString:@"autoDescription"]
        && ![propertyName isEqualToString:@"description"]) {

			id value = [self valueForKey:propertyName];

			// Format of result items: p1 = v1; p2 = v2; ...
			[result appendFormat:@"%@ = %@;\r      ", propertyName, value];
		}
	}
	free(property_list);//Clean up

	return result;
}

- (NSString *) autoDescriptionForClassType:(Class)classType {
    return [self autoDescriptionForClassType: classType excludeProperties: nil];
}

// Reflects about self.
- (NSString *) autoDescription {
	return [NSString stringWithFormat:@"{\r      %@\r      %@}", NSStringFromClass([self class]), [self autoDescriptionForClassType:[self class] excludeProperties: nil]];
}

- (NSString *) autoDescriptionExcluding:(NSArray *) properties {
	return [NSString stringWithFormat:@"{\r      %@\r      %@}", NSStringFromClass([self class]), [self autoDescriptionForClassType:[self class] excludeProperties: properties]];
}

@end


text:
using PublicJournal.Bll.Contracts;
using PublicJournal.Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PublicJournal.Controllers
{
    public class HomeController : Controller
    {
        private IUserBus _iUserBus;
        private ICategoryBus _iCategoryBus;
        private IEventBus _iEventBus;

        public HomeController(IUserBus iUserBus, ICategoryBus iCategoryBus, IEventBus iEventBus)
        {
            _iUserBus = iUserBus;
            _iCategoryBus = iCategoryBus;
            _iEventBus = iEventBus;
        }
        private LoginModel loginModel;

        public HomeController(LoginModel login)
        {
            loginModel = login;
        }

        public ActionResult Index()
        {
            HomeViewModel model = new HomeViewModel()
            {
                ListCategories = new List<CategoryModel>(_iCategoryBus.GetListCategories()),
                ListEvents = new List<EventModel>(_iEventBus.GetAllEvents())
            };

            return View("Index", model);
        }
    }
}


text:
Setup for a Node/ES6 app with Babel, Jasmine, Webpack, Gulp

## Usage
```
git clone https://github.com/Pirolf/es6-tooling-starter.git

npm i
```
###Lint

  `gulp lint`
###Clean

  `gulp clean`
###Build

  `gulp build`
###Specs

  `gulp spec`

  or `npm test`

  All assets and specs will be rebuilt

  Webpack will watch all changes

  Jasmine specs will be run on `localhost:8888`


text:
I created www.yasiv.com as a monolyth website couple years ago. Now I'm trying to decoulpe it into small isolated components. This repository will represent http://www.yasiv.com/graphs visualization.

# license

MIT


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/backgroud_bg_white_color"
    android:orientation="vertical">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="@dimen/dm025"
        android:layout_marginTop="@dimen/dm030"
        android:text="付款成功"
        android:textColor="@color/titleText"
        android:textSize="@dimen/dm034"/>
    <TextView
        android:id="@+id/tv_pay_ok_dialog_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/dm035"
        android:layout_marginRight="@dimen/dm035"
        android:text="您的问题已经成功提交,我们的分析师团队会尽快解答。您可以在 我的—我的问答 中查看。"
        android:textColor="@color/titleText"
        android:textSize="@dimen/dm026"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_marginTop="@dimen/dm025"
        android:background="@color/gray"/>
    <LinearLayout android:layout_width="match_parent"
                  android:layout_height="@dimen/dm100"
                  android:orientation="horizontal">
        <TextView
            android:id="@+id/tv_pay_ok_dialog_confirm"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:text="确定"
            android:textColor="@color/colorTitle"
            android:textSize="@dimen/dm034"/>
    </LinearLayout>
</LinearLayout>


text:
package org.maeno.example.domain;

public enum ProjectType {

    /**
     * The "PRIVATE" means a closed project.
     */
    PRIVATE {
        @Override
        public String getProjectType() {
            return "PRIVATE";
        }
    },
    /**
     * The "PUBLIC" means a open project.
     */
    PUBLIC {
        @Override
        public String getProjectType() {
            return "PUBLIC";
        }
    },
    /**
     * The "PROTECTED" means a limited project.
     */
    PROTECTED {
        @Override
        public String getProjectType() {
            return "PROTECTED";
        }
    };

    /**
     * Gets project type as String.
     *
     * @return project type.
     */
    public abstract String getProjectType();
}


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.actions;

import javax.annotation.Nullable;

/**
 * An action graph.
 *
 *
Provides lookups of generating actions for artifacts.
 */
public interface ActionGraph {

  /**
   * Returns the Action that, when executed, gives rise to this file.
   *
   *
If this Artifact is a source file, null is returned. (We don't try to return a "no-op
   * action" because that would require creating a new no-op Action for every source file, since
   * each Action knows its outputs, so sharing all the no-ops is not an option.)
   *
   *
It's also possible for derived Artifacts to have null generating Actions when these actions
   * are unknown.
   */
  @Nullable
  Action getGeneratingAction(Artifact artifact);
}


text:
namespace NuGetVSExtension
{
    static class PkgCmdIDList
    {
        public const int cmdidPowerConsole = 0x0100;
        public const int cmdidAddPackageDialog = 0x100;
        public const int cmdidAddPackageDialogForSolution = 0x200;
        public const int cmdidSourceSettings = 0x0200;
        public const int cmdIdGeneralSettings = 0x0300;
        public const int cmdIdVisualizer = 0x0310;
        public const int cmdidDebugConsole = 0x0900;
    }
}


text:
package main

import (
	"log"

	datadog "github.com/DataDog/datadog-go/statsd"
	"github.com/urfave/cli"
	"gopkg.in/alexcesaro/statsd.v2"
	"time"
)

func initializeStatsdConnection(c *cli.Context) *statsdConnection {
	// Debug information
	debug := c.Bool("debug")

	// DataDog enabled?
	datadogEnabled := c.Bool("datadog")
	if datadogEnabled {
		log.Println("DataDog enabled.")
	}

	// StatsD host
	host := c.String("statsd")
	if len(host) < 1 {
		log.Fatalln("StatsD host not defined!")
	}
	if debug {
		log.Printf("StatsD host: %s", host)
	}

	// StatsD prefix
	prefix := c.String("prefix")
	if len(prefix) < 1 {
		prefix = "s3b"
		log.Printf("StatsD prefix not defined!  Using standard [%s] prefix", prefix)
	} else {
		if debug {
			log.Printf("StatsD prefix: [%s]", prefix)
		}
	}

	// Client
	var statsDClient interface{}
	var err error
	if datadogEnabled {
		statsDClient, err = datadog.New(host)
		if err != nil {
			log.Fatal(err)
		}
		statsDClient.(*datadog.Client).Namespace = prefix + "."
	} else {
		statsDClient, err = statsd.New(statsd.Address(host),
			statsd.Prefix(prefix), statsd.ErrorHandler(func(err error) {
				log.Fatalf("StatsD Error: %v", err)
			}))
		if err != nil {
			log.Fatal(err)
		}
	}

	// Return the new structure
	return &statsdConnection{
		host:    host,
		prefix:  prefix,
		client:  statsDClient,
		datadog: datadogEnabled,
	}
}

func (s statsdConnection) Increment(name string, tags []string, rate float64) error {
	if s.datadog {
		return s.client.(*datadog.Client).Incr(name, tags, rate)
	}
	s.client.(*statsd.Client).Increment(name)
	return nil
}

func (s statsdConnection) Timing(name string, value time.Duration, tags []string, rate float64) error {
	if s.datadog {
		return s.client.(*datadog.Client).Timing(name, value, tags, rate)
	}
	s.client.(*statsd.Client).Timing(name, value)
	return nil
}


text:
template <typename ContainerT>
std::string printContainer(const ContainerT& values) {
    std::stringstream ss;
    typename ContainerT::const_iterator it;
    for (it=values.begin(); it!=values.end(); ++it) {
        ss << " " << *it;
    }
    return ss.str();
}

template <typename ValueContainerT, typename ExpectedContainerT>
void ensureContainsExpected(const ValueContainerT& values, const ExpectedContainerT& expectedValues) {
    if (values.size() != expectedValues.size()) {
        std::stringstream ss;
        ss << "Container size missmatch: " << values.size() << " != " << expectedValues.size() << std::endl;
        ss << "Actual  : " << printContainer(values) << std::endl;
        ss << "Expected: " << printContainer(expectedValues) << std::endl;
        FAIL(ss.str().c_str());

    }
    typename ExpectedContainerT::const_iterator it;
    for (it=expectedValues.begin(); it!=expectedValues.end(); ++it) {
        bool foundExpected = values.find(*it)!=values.end();
        if (!foundExpected) {
            std::stringstream ss;
            ss << "Did not find expected value: ";
            ss << *it;
            ss << " among: " << printContainer(values);
            FAIL(ss.str().c_str());
        }
    }
}

// Local variable storage wrapper class
// local means local variables in this application,
// they are seen as external variables inside libnumhop
class ApplicationVariables : public numhop::ExternalVariableStorage
{
public:
  // Overloaded -----
  double externalValue(std::string name, bool &rFound) const
  {
    std::map<std::string, double>::const_iterator it = mVars.find(name);
    if (it != mVars.end()) {
      rFound = true;
      return mVars.at(name);
    }
    rFound = false;
    return 0;
  }

  bool setExternalValue(std::string name, double value)
  {
    std::map<std::string, double>::iterator it = mVars.find(name);
    if (it != mVars.end()) {
      it->second = value;
      return true;
    }
    return false;
  }
  // -----

  void addVariable(std::string name, double value)
  {
      mVars.insert(std::pair<std::string,double>(name, value));
  }

  double& operator[](const std::string& name)
  {
      return mVars[name];
  }

private:
  std::map<std::string, double> mVars;
};

void test_allok(const std::string &exprs, const double expected_result, numhop::VariableStorage &variableStorage){

  std::list<std::string> exprlist;
  numhop::extractExpressionRows(exprs, '#', exprlist);

  INFO("Full expression: " << exprs)
  double value_first_time, value_second_time, value_third_time;
  std::list<std::string>::iterator it;
  for (it=exprlist.begin(); it!=exprlist.end(); ++it) {
    INFO("Current sub expression: " << *it)
    numhop::Expression e;
    bool interpretOK = numhop::interpretExpressionStringRecursive(*it, e);
    REQUIRE(interpretOK == true);

    bool first_eval_ok, second_eval_ok, third_eval_ok;
    value_first_time = e.evaluate(variableStorage, first_eval_ok);
    REQUIRE(first_eval_ok == true);
    // evaluate again, should give same result
    value_second_time = e.evaluate(variableStorage, second_eval_ok);
    REQUIRE(second_eval_ok == true);

    REQUIRE(value_first_time == Approx(value_second_time));

    // Test re-evaluating printed expression, it should be the same
    std::string printed_expression = e.print();
    interpretOK = numhop::interpretExpressionStringRecursive(*it, e);
    REQUIRE(interpretOK == true);
    value_third_time = e.evaluate(variableStorage, third_eval_ok);
    REQUIRE(third_eval_ok == true);
    REQUIRE(value_second_time == Approx(value_third_time));

    // Print comparisson
    //WARN(*it);
    //WARN(printed_expression);
  }

  REQUIRE(value_first_time == Approx(expected_result));
}

void test_interpret_fail(const std::string &expr)
{
  INFO("Full expression: " << expr)
  numhop::Expression e;
  bool interpretOK = numhop::interpretExpressionStringRecursive(expr, e);
  REQUIRE(interpretOK == false);
  //todo what happens if e is evaluated ?
}

void test_eval_fail(const std::string &expr, numhop::VariableStorage &variableStorage)
{
  INFO("Full expression: " << expr)
  numhop::Expression e;
  bool interpretOK = numhop::interpretExpressionStringRecursive(expr, e);
  REQUIRE(interpretOK == true);
  bool first_eval_ok;
  double value_first_time = e.evaluate(variableStorage, first_eval_ok);
  REQUIRE(first_eval_ok == false);
}

void test_extract_variablenames(const std::string &expr, numhop::VariableStorage &variableStorage, std::list<std::string> expectednames, std::list<std::string> expectedvalidvars)
{
    std::set<std::string> valuenames, validvarnames;
    numhop::Expression e;
    bool interpretOK = numhop::interpretExpressionStringRecursive(expr, e);
    REQUIRE(interpretOK == true);
    e.extractNamedValues(valuenames);
    ensureContainsExpected(valuenames, expectednames);

    e.extractValidVariableNames(variableStorage, validvarnames);
    ensureContainsExpected(validvarnames, expectedvalidvars);
}

void printRegisteredFunctionNames()
{
    std::string allnames;
    std::vector<std::string> names = numhop::getRegisteredFunctionNames();
    for(size_t i=0; i<names.size(); ++i) {
        allnames.append(names[i]+' ');
    }
    WARN(allnames.c_str());
}

TEST_CASE("Variable Assignment") {
  numhop::VariableStorage vs;
  test_allok("a=5;a=8;a;", 8, vs);
  test_allok("a=6;\n a=7.14\n a;", 7.14, vs);
}

TEST_CASE("External Variables") {
  numhop::VariableStorage vs;

  ApplicationVariables av;
  av.addVariable("dog", 55);
  av.addVariable("cat", 66);
  vs.setExternalStorage(&av);

  test_allok("dog", 55, vs);
  test_allok("cat", 66, vs);

  test_allok("dog=4; 1-(-2-3-(-dog-5.1))", -3.1, vs);
  test_allok("-dog", -4, vs);
  REQUIRE(av["dog"] == Approx(4));

  test_allok("cat \n dog \r dog=5;cat=2.1;a=3;b=dog*cat*a;b", 31.5, vs);
  REQUIRE(av["cat"] == Approx(2.1));
}

TEST_CASE("Reserved Variable") {
  numhop::VariableStorage vs;
  vs.reserveNamedValue("pi", 3.1415);
  ApplicationVariables av;
  vs.setExternalStorage(&av);

  // Add external pi variable
  av.addVariable("pi", 10000);

  // Here the reserved pi should be used, not the external one
  test_allok("pi", 3.1415, vs);
  test_allok("a=pi*2", 6.283, vs);

  // It should not be possible to change the external pi, or the reserved value
  test_eval_fail("pi=123", vs);
  test_allok("pi", 3.1415, vs);
  REQUIRE(av["pi"] == Approx(10000) );
}

TEST_CASE("Expression Parsing") {
  numhop::VariableStorage vs;
  std::string expr = " \t #   \n    a=5;\n #   a=8\n a+1; \r\n a+2 \r a+3 \r\n #Some comment ";

  // Extract individual expression rows, treat # as comment
  // ; \r \n breaks lines
  // The expression above contains 4 actual valid sub expressions
  std::list<std::string> exprlist;
  numhop::extractExpressionRows(expr, '#', exprlist);
  REQUIRE(exprlist.size() == 4);

  // Result should be a+3 with a = 5
  test_allok(expr, 8, vs);
}

TEST_CASE("Various Math") {
  numhop::VariableStorage vs;

  test_allok("2^2", 4, vs);
  test_allok("2^(1+1)", 4, vs);
  test_allok("7/3/4/5", 0.11666667, vs);
  test_allok("7/(3/(4/5))", 1.8666667, vs);
  test_allok("(4/3*14*7/3/4/5*5/(4*3/2))", 1.8148148148148147, vs);
  test_allok("1-2*3-3*4-4*5;", -37, vs);
  test_allok("1-(-2-3-(-4-5))", -3, vs);
  test_allok("-1-2-3*4-4-3", -22, vs);
  test_allok("-1-(2-3)*4-4-3", -4, vs);
  test_allok("-(((-2-2)-3)*4)", 28, vs);

  // Test use of multiple + -
  test_allok("2--3;", 5, vs);
  test_allok("1+-3", -2, vs);
  test_allok("1-+3", -2, vs);
  test_allok("1++3", 4, vs);
  test_allok("1---3", -2, vs);

  test_allok("a=1;b=2;c=3;d=a+b*c;d",7, vs);
  // Reuse b and a from last expression (stored in vs)
  test_allok("b^b;", 4, vs);
  test_allok("b^(a+a)", 4, vs);
  test_allok("a-b;", -1, vs);
  test_allok("a-b+a", 0, vs);
  test_allok("-a+b", 1, vs);
  test_allok("b-a;", 1, vs);
  test_allok("(-a)+b", 1, vs);
  test_allok("b+(-a);", 1, vs);
  test_allok("b+(+a)", 3, vs);
  test_allok("b+a", 3, vs);
  test_allok("+a", 1, vs);
  test_allok("0-(a-b)+b", 3, vs);

  test_allok("a=1;b=2;c=3;d=4; a-b+c-d+a", -1, vs);
  test_allok("a=1;b=2;c=3;d=4; a-b-c-d+a", -7, vs);
  test_allok("a=1;b=2;c=3;d=4;a=(3+b)+4^2*c^(2+d)-7*(d-1)", 11648, vs);
  // Reuse resulting a from last expression
  test_allok("b=2;c=3;d=4;a=(3+b)+4^2*c^(2+d)-7/6/5*(d-1)", 11668.299999999999, vs);

  test_allok("value=5;", 5, vs);
  test_allok("value+2;", 7, vs);
  test_allok("value-2", 3, vs);
  test_allok("value*1e+2", 500, vs);
}

TEST_CASE("Exponential Notation") {
  numhop::VariableStorage vs;
  test_allok("2e-2-1E-2", 0.01, vs);
  test_allok("1e+2+3E+2", 400, vs);
  test_allok("1e2+1E2", 200, vs);
}

TEST_CASE("Boolean Expressions") {
  numhop::VariableStorage vs;

  test_allok("2<3", 1, vs);
  test_allok("2<2", 0, vs);
  test_allok("4.2>2.5", 1, vs);

  // Note the difference on how the minus sign is interpreted
  test_allok("(-4.2)>3", 0, vs);
  // In this second case, the expression is treated as -(4.2>3)
  test_allok("-4.2>3", -1, vs);

  test_allok("1|0", 1, vs);
  test_allok("0|0", 0, vs);
  test_allok("0|0|0|1", 1, vs);
  test_allok("1|1|1|1|1", 1, vs);
  test_allok("2|3|0", 1, vs);
  test_allok("(-2)|3", 1, vs);
  test_allok("(-1)|(-2)", 0, vs);

  test_allok("1&0", 0, vs);
  test_allok("0&0", 0, vs);
  test_allok("(-1)&1.5", 0, vs);
  test_allok("1&1", 1, vs);
  test_allok("1&1&1&0.4", 0, vs);
  test_allok("1&0&1", 0, vs);

  test_allok("2<3 | 4<2", 1, vs);
  test_allok("2<3 & 4<2", 0, vs);
  test_allok("2<3 & 4>2", 1, vs);
  test_allok("x=2.5; (x>2&x<3)*1+(x>3&x<4)*2", 1, vs);
  test_allok("x=3.6; (x>2&x<3)*1+(x>3&x<4)*2", 2, vs);
}

TEST_CASE("Disallowed Characters") {
    numhop::VariableStorage vs;
    vs.setDisallowedInternalNameCharacters("cg");
    test_allok("ape=5;", 5, vs);
    test_eval_fail("cat=1", vs);
    test_eval_fail("dog=1", vs);
    test_allok("a.b=5;", 5, vs);
    vs.setDisallowedInternalNameCharacters(".");
    test_allok("cat=1", 1, vs);
    test_allok("dog=1", 1, vs);
    test_eval_fail("a.b=5;", vs);
}

TEST_CASE("Extract variable names") {

  numhop::VariableStorage vs;
  vs.reserveNamedValue("pi", 3.1415);
  bool setOK;
  vs.setVariable("ivar1", 1, setOK);
  vs.setVariable("ivar2", 2, setOK);
  ApplicationVariables av;
  av.addVariable("evar1", 1);
  av.addVariable("evar2", 2);
  vs.setExternalStorage(&av);

  std::list<std::string> expectedNamedValues, expectedValidVariableNames;
  expectedNamedValues.push_back("ivar1");
  expectedValidVariableNames = expectedNamedValues;
  test_extract_variablenames("ivar1", vs, expectedNamedValues, expectedValidVariableNames);
  test_extract_variablenames("-ivar1", vs, expectedNamedValues, expectedValidVariableNames);

  expectedNamedValues.push_back("ivar2");
  expectedNamedValues.push_back("evar1");
  expectedNamedValues.push_back("evar2");
  expectedNamedValues.push_back("pi");
  expectedNamedValues.push_back("invalid");
  expectedValidVariableNames = expectedNamedValues;
  // remove pi and invalid
  expectedValidVariableNames.pop_back();
  expectedValidVariableNames.pop_back();
  const char* expr = "ivar2 = (ivar1 + evar1 + evar2 -3*ivar1)*pi^invalid";
  test_extract_variablenames(expr, vs, expectedNamedValues, expectedValidVariableNames);
}

TEST_CASE("Rename named values") {

  std::vector<std::string> expectedNamedValues;
  expectedNamedValues.push_back("ivar1");
  expectedNamedValues.push_back("ivar2");
  expectedNamedValues.push_back("evar1");
  expectedNamedValues.push_back("evar2");
  expectedNamedValues.push_back("pi");
  const char* expr = "ivar2 = (ivar1 + evar1 + 2 + evar2 -3*ivar1)*pi";

  numhop::Expression e;
  bool interpretOK = numhop::interpretExpressionStringRecursive(expr, e);
  REQUIRE(interpretOK == true);

  std::set<std::string> namedValues;
  e.extractNamedValues(namedValues);
  ensureContainsExpected(namedValues, expectedNamedValues);

  namedValues.clear();
  e.replaceNamedValue("ivar1", "replace1");
  e.extractNamedValues(namedValues);
  expectedNamedValues[0] = "replace1";
  ensureContainsExpected(namedValues, expectedNamedValues);

  namedValues.clear();
  e.replaceNamedValue("ivar2", "replace2");
  e.extractNamedValues(namedValues);
  expectedNamedValues[1] = "replace2";
  ensureContainsExpected(namedValues, expectedNamedValues);

  namedValues.clear();
  e.replaceNamedValue("pi", "replace3");
  e.extractNamedValues(namedValues);
  expectedNamedValues[4] = "replace3";
  ensureContainsExpected(namedValues, expectedNamedValues);
}

TEST_CASE("Math functions") {
  numhop::VariableStorage vs;
  vs.reserveNamedValue("pi", 3.1415);

  test_allok("cos(0)", 1, vs);
  test_allok("(cos((0)))", 1, vs);
  test_allok("cos(0)+cos(0)", 2, vs);
  test_allok("cos( 0 * 100)", 1, vs);
  test_allok("cos(sin(0))", 1, vs);
  test_allok("sin(pi/2*cos(0))", 1, vs);
  test_allok("atan2(0,1)", 0, vs);
  test_allok("atan2( (1+1)/2 , 2^0 )", 0.785398163397, vs);
  test_allok("floor(6.7)", 6, vs);
  test_allok("ceil(6.2)", 7, vs);
  test_allok("abs(-6.7)", 6.7, vs);
  test_allok("min(6,7)", 6, vs);
  test_allok("max(6,7)", 7, vs);

}

TEST_CASE("Expressions that should fail") {
  numhop::VariableStorage vs;

  test_interpret_fail("2*-2");
  test_interpret_fail("a += 5");
  test_interpret_fail("1+1-");
  test_interpret_fail(" = 5");
  test_interpret_fail("flooor(6.7)");
  test_interpret_fail("floor(6,7)");
  test_interpret_fail("atan2(1)");

  test_eval_fail("floor6.7)", vs);  //!< @todo should fail interpret
  test_eval_fail("floor(6.7", vs);  //!< @todo should fail interpret
  test_eval_fail(" cos((0+1) ", vs); //!< @todo should fail interpret
  test_eval_fail("0.5huj", vs);
}


text:
package org.wso2.iot.integration.device.operation;

import com.google.gson.JsonObject;
import junit.framework.Assert;
import org.apache.commons.httpclient.HttpStatus;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.engine.context.TestUserMode;
import org.wso2.carbon.automation.test.utils.http.client.HttpResponse;
import org.wso2.iot.integration.common.*;

/**
 * This contain tests to check operations supported by Android. Test are executed against a previously enrolled device
 */
public class AndroidOperation extends TestBase {
    private RestClient client;

    @BeforeTest(alwaysRun = true, groups = { Constants.AndroidOperations.OPERATIONS_GROUP})
    public void initTest() throws Exception {
        super.init(TestUserMode.SUPER_TENANT_ADMIN);
        String accessTokenString = "Bearer " + OAuthUtil.getOAuthToken(backendHTTPURL, backendHTTPSURL);
        this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
        //Enroll a device
        JsonObject enrollmentData = PayloadGenerator.getJsonPayload(
                Constants.AndroidEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME,
                Constants.HTTP_METHOD_POST);
        client.post(Constants.AndroidEnrollment.ENROLLMENT_ENDPOINT, enrollmentData.toString());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android device lock operation.")
    public void testLock() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.LOCK_ENDPOINT,
                                            Constants.AndroidOperations.LOCK_OPERATION_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

/*
    @Test(groups = Constants.AndroidOperations.OPERATIONS_GROUP, description = "Test Android getPendingOperations.")
    public void testGetPendingOperations() throws Exception {
        HttpResponse response = client.put(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.DEVICE_ID,
                                           "[]");
        Assert.assertEquals(response.getResponseCode(), HttpStatus.SC_CREATED);
    }*/

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android device location "
            + "operation.")
    public void testLocation() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.LOCATION_ENDPOINT,
                                            Constants.AndroidOperations.LOCATION_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android device clear password " +
                                                                               "operation.")
    public void testClearPassword() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.CLEAR_PASSWORD_ENDPOINT,
                                            Constants.AndroidOperations.CLEAR_PASSWORD_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android device camera "
            + "operation.")
    public void testCamera() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.CAMERA_OPERATION,
                                            Constants.AndroidOperations.CAMERA_OPERATION_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

//    //404
//    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android device information "
//            + "operation.")
//    public void testDeviceInfo() throws Exception {
//
//        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
//                                            Constants.AndroidOperations.DEVICE_INFO_ENDPOINT,
//                                            Constants.AndroidOperations.DEVICE_INFO_PAYLOAD);
//        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
//    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android enterprise-wipe "
            + "operation.")
    public void testEnterpriseWipe() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.ENTERPRISE_WIPE_ENDPOINT,
                                            Constants.AndroidOperations.ENTERPRISE_WIPE_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android wipe data operation.")
    public void testWipeData() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.WIPE_DATA_ENDPOINT,
                                            Constants.AndroidOperations.WIPE_DATA_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

//    //400
//    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android application list "
//            + "operation.")
//    public void testApplicationList() throws Exception {
//        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
//                                            Constants.AndroidOperations.APPLICATION_LIST_ENDPOINT,
//                                            Constants.AndroidOperations.APPLICATION_LIST_PAYLOAD);
//        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
//    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android ring operation.")
    public void testRing() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.RING_ENDPOINT,
                                            Constants.AndroidOperations.RING_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android mute operation.")
    public void testMute() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.MUTE_ENDPOINT,
                                            Constants.AndroidOperations.MUTE_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

//    //400
//    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android install apps operation.")
//    public void testInstallApps() throws Exception {
//        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
//                                            Constants.AndroidOperations.INSTALL_APPS_ENDPOINT,
//                                            Constants.AndroidOperations.INSTALL_APPS_PAYLOAD);
//        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
//    }

//    //400
//    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android uninstall apps "
//            + "operation.")
//    public void testUninstallApps() throws Exception {
//        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
//                                            Constants.AndroidOperations.UNINSTALL_APPS_ENDPOINT,
//                Constants.AndroidOperations.UNINSTALL_APPS_PAYLOAD);
//        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
//    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android notification operation.")
    public void testNotification() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.NOTIFICATION_ENDPOINT,
                                            Constants.AndroidOperations.NOTIFICATION_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android WiFi operation.")
    public void testWiFi() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.WIFI_ENDPOINT,
                                            Constants.AndroidOperations.WIFI_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android encrypt operation.")
    public void testEncrypt() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.ENCRYPT_ENDPOINT,
                                            Constants.AndroidOperations.ENCRYPT_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android change lock operation.")
    public void testChangeLock() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.CHANGE_LOCK_ENDPOINT,
                                            Constants.AndroidOperations.CHANGE_LOCK_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android password policy operation.")
    public void testPasswordPolicy() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.PASSWORD_POLICY_ENDPOINT,
                                            Constants.AndroidOperations.PASSWORD_POLICY_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }

    @Test(groups = {Constants.AndroidOperations.OPERATIONS_GROUP}, description = "Test Android web clip operation.")
    public void testWebClip() throws Exception {
        HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT +
                                            Constants.AndroidOperations.WEB_CLIP_ENDPOINT,
                                            Constants.AndroidOperations.WEB_CLIP_PAYLOAD);
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }
}


text:
package model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import com.sun.corba.se.impl.orbutil.graph.NodeData;

public class Chesser {
	private ArrayList<Queen> qs=new ArrayList<>();
	private ArrayList<ArrayList<Queen>> plans=new ArrayList<>();
	public ArrayList<ArrayList<Queen>> getPlans() {
		return plans;
	}

	public void add(Queen queen){
		qs.add(queen);
		queen.setChesser(this);
	}
	public boolean isAllChessed(){
		for(Queen q:qs){
			if(q.getLocal()==null){
				return false;
			}
		}
		return true;
	}
	public ArrayList<Queen> cloneQs(){
		ArrayList<Queen> qs_clone=new ArrayList<Queen>();
		for(Queen q:qs){
			Queen cQ=new Queen();
			cQ.setLocal(q.getLocal());
			qs_clone.add(cQ);
		}
		return qs_clone;
	}
	public void doNext(Queen q) {
		int index=0;
			if(q!=null){
				index=qs.indexOf(q)+1;
			}
			if(index>=qs.size()&&isAllChessed()){
				if(isAllChessed()){
					plans.add(cloneQs());
				}
				return;
			}
			Set<Integer> ps=new HashSet<>();
			for(int j=0;j<index;j++){
				if(qs.get(j).getLocal()!=null){
					for(Integer i:qs.get(j).getScope(index+1)){
						ps.add(i);
					}
				}
			}
			if(ps.size()!=0){
				Iterator<Integer> element=ps.iterator();
				List<Integer> list=new ArrayList<>();
				while(element.hasNext()){
					Integer e=element.next();
					if(e<0||e>qs.size()){
						list.add(e);
					}
				}
				ps.removeAll(list);
				Integer[] _ps=new Integer[ps.size()];

				_ps=ps.toArray(_ps);
				Arrays.sort(_ps);

				for(int i:_ps){
					System.out.print(i+" ");
				}
				System.out.println();
				qs.get(index).step(_ps,qs.size(),index+1);

			}else{
				qs.get(index).step(null,qs.size(),index+1);

			}

		}

}


text:
=head1 sLICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

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.

=cut

package EnsEMBL::Web::NewTable::NewTable;

use strict;
use warnings;

use parent qw(EnsEMBL::Web::NewTable::Endpoint);

use JSON qw(from_json to_json);
use Scalar::Util qw(looks_like_number);

use EnsEMBL::Draw::Utils::ColourMap;

use HTML::Entities qw(encode_entities);

use EnsEMBL::Web::NewTable::Callback;
use EnsEMBL::Web::NewTable::Column;
use EnsEMBL::Web::NewTable::NewTableConfig;

sub new {
  my ($class, $component,$type) = @_;

  my $self = $class->SUPER::new($component->hub,$component);
  $self = { %$self, (
    component => $component,
    hub => $component->hub,
    phases    => [],
  )};

  bless $self, $class;

  $type  ||= ref($component);
  my $config = EnsEMBL::Web::NewTable::NewTableConfig->new($component->hub,undef,$type);
  $self->{'config'} = $config;

  # XXX these should be optional. That's why they're plugins! :-)
  $config->add_plugin('Core',{});
  $config->add_plugin('Frame',{});
  $config->add_plugin('Decorate',{});
  $config->add_plugin('Filter',{});
  $config->add_plugin('Misc',{});
#  $config->add_plugin('Paging',{});
  $config->add_plugin('Styles',{});
  $config->add_plugin('Sort',{});
  $config->add_plugin('State',{});

  return $self;
}

sub component { return $_[0]->{'component'}; }
sub has_rows { return !!@{$_[0]{'rows'}}; }
sub column { return $_[0]->{'config'}->column($_[1]); }

sub config { return $_[0]->{'config'}; }

sub get_plugin {
  my ($self,$plugin) = @_;

  return $self->{'plugins'}{$plugin};
}

sub add_phase {
  my ($self,$name,$era,$rows,$cols) = @_;

  $self->{'config'}->add_phase($name,$era,$rows,$cols);
}

sub render {
  my ($self,$hub,$component) = @_;

  my $data = $self->{'config'}->config;

  my $callback = EnsEMBL::Web::NewTable::Callback->new($hub,$component);
  $data->{'payload_one'} = $callback->preload($self,$data);

  $data = encode_entities(to_json($data));
  my $url = $component->ajax_url(undef,{},'ComponentAjax');
  return qq(
    $data
  );
}

sub add_columns {
  my ($self,$columns,$exclude) = @_;

  my %exclude;
  $exclude{$_}=1 for @$exclude;
  foreach my $col (@$columns) {
    next if $exclude{$col->{'_key'}};
    my %args = %$col;
    delete $args{'_key'};
    delete $args{'_type'};
    $self->{'config'}->add_column($col->{'_key'},$col->{'_type'},\%args);
  }
}

1;


text:
// 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
//
//      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 com.google.location.suplclient.asn1.supl2.lpp;

// Copyright 2008 Google Inc. All Rights Reserved.
/*
 * This class is AUTOMATICALLY GENERATED. Do NOT EDIT.
 */

//
//
import com.google.location.suplclient.asn1.base.Asn1Object;
import com.google.location.suplclient.asn1.base.Asn1Sequence;
import com.google.location.suplclient.asn1.base.Asn1Tag;
import com.google.location.suplclient.asn1.base.BitStream;
import com.google.location.suplclient.asn1.base.BitStreamReader;
import com.google.location.suplclient.asn1.base.SequenceComponent;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import javax.annotation.Nullable;

/**
*
*/
public  class Error_r9_IEs extends Asn1Sequence {
  //

  private static final Asn1Tag TAG_Error_r9_IEs
      = Asn1Tag.fromClassAndNumber(-1, -1);

  public Error_r9_IEs() {
    super();
  }

  @Override
  @Nullable
  protected Asn1Tag getTag() {
    return TAG_Error_r9_IEs;
  }

  @Override
  protected boolean isTagImplicit() {
    return true;
  }

  public static Collection<Asn1Tag> getPossibleFirstTags() {
    if (TAG_Error_r9_IEs != null) {
      return ImmutableList.of(TAG_Error_r9_IEs);
    } else {
      return Asn1Sequence.getPossibleFirstTags();
    }
  }

  /**
   * Creates a new Error_r9_IEs from encoded stream.
   */
  public static Error_r9_IEs fromPerUnaligned(byte[] encodedBytes) {
    Error_r9_IEs result = new Error_r9_IEs();
    result.decodePerUnaligned(new BitStreamReader(encodedBytes));
    return result;
  }

  /**
   * Creates a new Error_r9_IEs from encoded stream.
   */
  public static Error_r9_IEs fromPerAligned(byte[] encodedBytes) {
    Error_r9_IEs result = new Error_r9_IEs();
    result.decodePerAligned(new BitStreamReader(encodedBytes));
    return result;
  }

  @Override protected boolean isExtensible() {
    return true;
  }

  @Override public boolean containsExtensionValues() {
    for (SequenceComponent extensionComponent : getExtensionComponents()) {
      if (extensionComponent.isExplicitlySet()) return true;
    }
    return false;
  }

  private CommonIEsError commonIEsError_;
  public CommonIEsError getCommonIEsError() {
    return commonIEsError_;
  }
  /**
   * @throws ClassCastException if value is not a CommonIEsError
   */
  public void setCommonIEsError(Asn1Object value) {
    this.commonIEsError_ = (CommonIEsError) value;
  }
  public CommonIEsError setCommonIEsErrorToNewInstance() {
    commonIEsError_ = new CommonIEsError();
    return commonIEsError_;
  }

  private EPDU_Sequence  extensionEpdu_Error;
  public EPDU_Sequence getExtensionEpdu_Error() {
    return extensionEpdu_Error;
  }
  /**
   * @throws ClassCastException if value is not a EPDU_Sequence
   */
  public void setExtensionEpdu_Error(Asn1Object value) {
    extensionEpdu_Error = (EPDU_Sequence) value;
  }
  public void setExtensionEpdu_ErrorToNewInstance() {
    extensionEpdu_Error = new EPDU_Sequence();
  }

  @Override public Iterable<? extends SequenceComponent> getComponents() {
    ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();

    builder.add(new SequenceComponent() {
          Asn1Tag tag = Asn1Tag.fromClassAndNumber(2, 0);

          @Override public boolean isExplicitlySet() {
            return getCommonIEsError() != null;
          }

          @Override public boolean hasDefaultValue() {
            return false;
          }

          @Override public boolean isOptional() {
            return true;
          }

          @Override public Asn1Object getComponentValue() {
            return getCommonIEsError();
          }

          @Override public void setToNewInstance() {
            setCommonIEsErrorToNewInstance();
          }

          @Override public Collection<Asn1Tag> getPossibleFirstTags() {
            return tag == null ? CommonIEsError.getPossibleFirstTags() : ImmutableList.of(tag);
          }

          @Override
          public Asn1Tag getTag() {
            return tag;
          }

          @Override
          public boolean isImplicitTagging() {
            return true;
          }

          @Override public String toIndentedString(String indent) {
                return "commonIEsError : "
                    + getCommonIEsError().toIndentedString(indent);
              }
        });

    return builder.build();
  }

  @Override public Iterable<? extends SequenceComponent>
                                                    getExtensionComponents() {
    ImmutableList.Builder<SequenceComponent> builder = ImmutableList.builder();

      builder.add(new SequenceComponent() {
            @Override public boolean isExplicitlySet() {
              return getExtensionEpdu_Error() != null;
            }

            @Override public boolean hasDefaultValue() {
              return false;
            }

            @Override public boolean isOptional() {
              return true;
            }

            @Override public Asn1Object getComponentValue() {
              return getExtensionEpdu_Error();
            }

            @Override public void setToNewInstance() {
              setExtensionEpdu_ErrorToNewInstance();
            }

            @Override public Collection<Asn1Tag> getPossibleFirstTags() {
              throw new UnsupportedOperationException(
                  "BER decoding not supported for extension elements");
            }

            @Override
            public Asn1Tag getTag() {
              throw new UnsupportedOperationException(
                  "BER is not supported for extension elements");
            }

            @Override
            public boolean isImplicitTagging() {
              throw new UnsupportedOperationException(
                  "BER is not supported for extension elements");
            }

            @Override public String toIndentedString(String indent) {
              return "epdu_Error : "
                  + getExtensionEpdu_Error().toIndentedString(indent);
            }
      });

      return builder.build();
    }

  @Override public Iterable<BitStream> encodePerUnaligned() {
    return super.encodePerUnaligned();
  }

  @Override public Iterable<BitStream> encodePerAligned() {
    return super.encodePerAligned();
  }

  @Override public void decodePerUnaligned(BitStreamReader reader) {
    super.decodePerUnaligned(reader);
  }

  @Override public void decodePerAligned(BitStreamReader reader) {
    super.decodePerAligned(reader);
  }

  @Override public String toString() {
    return toIndentedString("");
  }

  public String toIndentedString(String indent) {
    StringBuilder builder = new StringBuilder();
    builder.append("Error_r9_IEs = {\n");
    final String internalIndent = indent + "  ";
    for (SequenceComponent component : getComponents()) {
      if (component.isExplicitlySet()) {
        builder.append(internalIndent)
            .append(component.toIndentedString(internalIndent));
      }
    }
    if (isExtensible()) {
      builder.append(internalIndent).append("...\n");
      for (SequenceComponent component : getExtensionComponents()) {
        if (component.isExplicitlySet()) {
          builder.append(internalIndent)
              .append(component.toIndentedString(internalIndent));
        }
      }
    }
    builder.append(indent).append("};\n");
    return builder.toString();
  }
}


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ZohoPeopleClient.Response;

namespace ZohoPeopleClient.FetchRecordApi
{
    public class FetchRecordApi : ApiBase, IFetchRecordApi
    {
        public FetchRecordApi(string token, Func<IRestClient> restClientFactory) : base(token, restClientFactory)
        {
        }

        private const string GetRecordsByViewRequestUri =
            "https://people.zoho.com/people/api/forms/{1}/records" +
            "?authtoken={0}";

        private const string GetRecordsByViewWithSearchRequestUri =
            GetRecordsByViewRequestUri +
            "&searchColumn={2}&searchValue={3}";

        private const string GetRecordsByFormRequestUri =
            "https://people.zoho.com/people/api/forms/{1}/getRecords" +
            "?authtoken={0}";

        private const string GetRecordsByFormWithSearchRequestUri =
            GetRecordsByFormRequestUri +
            "&searchColumn={2}&searchValue={3}";

        public async Task<List<dynamic>> GetByViewAsync(string viewName)
        {
            var requestUrl = string.Format(
                    GetRecordsByViewRequestUri,
                    Token,
                    viewName);
            return await GetByViewFromUrlAsync(requestUrl);
        }

        public async Task<List<dynamic>> GetByViewAsync(string viewName, SearchColumn searchColumn, string searchValue)
        {
            var requestUrl = string.Format(
                     GetRecordsByViewWithSearchRequestUri,
                     Token,
                     viewName,
                     searchColumn,
                     searchValue);
            return await GetByViewFromUrlAsync(requestUrl);
        }

        private async Task<List<dynamic>> GetByViewFromUrlAsync(string requestUrl)
        {
            using (var client = RestClient())
            {

                var response = await client.GetAsync(requestUrl);

                var listOfRecords = JsonConvert.DeserializeObject<List<dynamic>>(response);

                return listOfRecords;
            }
        }

        public async Task<List<dynamic>> GetByFormAsync(string formName)
        {
            var requestUrl = string.Format(
                    GetRecordsByFormRequestUri,
                    Token,
                    formName);
            return await GetByFormAsyncFromUrl(requestUrl);
        }

        public async Task<List<dynamic>> GetByFormAsync(string formName, SearchColumn searchColumn, string searchValue)
        {
            var requestUrl = string.Format(
                    GetRecordsByFormWithSearchRequestUri,
                    Token,
                    formName,
                    searchColumn,
                    searchValue);
            return await GetByFormAsyncFromUrl(requestUrl);
        }

        private async Task<List<dynamic>> GetByFormAsyncFromUrl(string requestUrl)
        {
            using (var client = RestClient())
            {

                var response = await client.GetAsync(requestUrl);

                var listOfRecords = JsonConvert.DeserializeObject<ResponseWrapper<dynamic>>(response);

                return listOfRecords.Response.Result;
            }
        }
    }
}


text:
package com.yeepay.g3.sdk.yop.client.router;

import com.yeepay.g3.sdk.yop.utils.CharacterConstants;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;

public class ServerRootSpace implements Serializable {

    private static final long serialVersionUID = -3149208992494791001L;

    private final String serverRoot;

    private final URL serverRootURL;

    private final String yosServerRoot;

    private final URL yosServerRootURL;

    private final String sandboxServerRoot;

    private final URL sandboxServerRootURL;

    public ServerRootSpace(String serverRoot, String yosServerRoot, String sandboxServerRoot) throws MalformedURLException {
        this.serverRoot = normalize(serverRoot);
        this.yosServerRoot = normalize(yosServerRoot);
        this.sandboxServerRoot = normalize(sandboxServerRoot);

        this.serverRootURL = new URL(this.serverRoot);
        this.yosServerRootURL = new URL(this.yosServerRoot);
        this.sandboxServerRootURL = new URL(this.sandboxServerRoot);
    }

    private String normalize(String serverRoot) {
        if (StringUtils.endsWith(serverRoot, CharacterConstants.SLASH)) {
            return StringUtils.substring(serverRoot, 0, serverRoot.length() - 1);
        }
        return serverRoot;
    }

    public String getServerRoot() {
        return serverRoot;
    }

    public URL getServerRootURL() {
        return serverRootURL;
    }

    public String getYosServerRoot() {
        return yosServerRoot;
    }

    public URL getYosServerRootURL() {
        return yosServerRootURL;
    }

    public String getSandboxServerRoot() {
        return sandboxServerRoot;
    }

    public URL getSandboxServerRootURL() {
        return sandboxServerRootURL;
    }
}


text:
using System.Activities;
using System.Collections.Generic;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using UltimateWorkflowToolkit.CoreOperations.Base;

namespace UltimateWorkflowToolkit.CoreOperations.RequestBuilder
{
    public class SetOptionSetField: SetFieldWorkflowBase
    {
        #region Inputs

        [Input("Field Value")]
        public InArgument<int> FieldValue { get; set; }

        #endregion Inputs

        protected override void AddField(ref Dictionary<string, object> dictionary, string fieldName)
        {
            dictionary.Add(fieldName, new OptionSetValue(FieldValue.Get(Context.ExecutionContext)));
        }
    }
}


text:
package oracle.ateam.sample.mobile.util;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import oracle.adf.model.datacontrols.device.DeviceManager;
import oracle.adf.model.datacontrols.device.DeviceManagerFactory;
import oracle.adf.model.datacontrols.device.Location;

import oracle.adfmf.framework.api.AdfmfContainerUtilities;
import oracle.adfmf.framework.api.JSONBeanSerializationHelper;

import oracle.ateam.sample.mobile.Version;
import oracle.ateam.sample.mobile.controller.bean.ConnectivityBean;
import oracle.ateam.sample.mobile.v2.persistence.metadata.PersistenceConfig;

import oracle.maf.api.dc.ws.rest.RestServiceAdapter;

/**
 * Class used to track the mobile app usage. In mobile-persistence-config, two endpoints can be configured: one to register
 * the start of an application, and one to register when an error occurs while incoking some REST service.
 * A-Team uses this internally to track Oracle internal apps, but customers can use the same facility by simply
 * changing the endpoints in persistence config.
 * Tracking is switched on/off through propety tracking.enabled=true/false in mobile-persistence-config.
 */
public class UsageTracker
{

  private static ADFMobileLogger sLog = ADFMobileLogger.createLogger(UsageTracker.class);
  private static Location location;
  private boolean locationInit = true;
  private final static String CONNECTION_END_POINT = "https://adc-ofm0187-gse.oracledemos.com/store";
  private final static String START_URI = "/applications/starts";
  private final static String ERROR_URI = "/applications/errors";

  public UsageTracker()
  {
    super();
  }

  protected boolean isOffline()
  {
    return new ConnectivityBean().isOffline();
  }

  protected String getCurrentDateTime()
  {
    String pattern = "yyyy-MM-dd HH:mm:ss Z";
    Date now = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    String sdate = sdf.format(now);
    return sdate;
  }

  protected String getCurrentTimeZone()
  {
    String pattern = "zzzz";
    Date now = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    String sdate = sdf.format(now);
    return sdate;
  }

  protected Location getLocation()
  {
    if (locationInit)
    {
      locationInit = false;
      DeviceManager dmgr = DeviceManagerFactory.getDeviceManager();
      //        if (dmgr.getOs().equalsIgnoreCase("ios")){
      try
      {
        // increase max age and disable high accuracy so position gets computed much faster
        // for example, in buildings with large wifi networks (like oracle offices)
        //           this.currentLocation = dmgr.getCurrentPosition(6000, true);
        location = dmgr.getCurrentPosition(600000, false);
      }
      catch (Exception e)
      {
        // cur pos not available, van happen in Android simulator
        sLog.severe("Cannot determine current location: " + e.getLocalizedMessage());
      }
    }
    return location;
  }

  protected boolean isUseLocation()
  {
    String useLoc = PersistenceConfig.getPropertyValue("tracking.use.location");
    return "true".equalsIgnoreCase(useLoc);
//    if (useLoc!=null)
//    {
//      return "true".equalsIgnoreCase(useLoc);
//    }
//    return true;
  }

  protected Map<String,Object> getBasePayload()
  {
    // device info
    String networkStatus = DeviceManagerFactory.getDeviceManager().getNetworkStatus();
    String model = DeviceManagerFactory.getDeviceManager().getModel(); // iPad Simulator x86_64
    String os = DeviceManagerFactory.getDeviceManager().getOs(); // iOS
    String version = DeviceManagerFactory.getDeviceManager().getVersion(); // 7.1
    String platform = DeviceManagerFactory.getDeviceManager().getPlatform(); // iPad Simulator

    // app info
    String appId = AdfmfContainerUtilities.getApplicationInformation().getId();
    String appVendor = AdfmfContainerUtilities.getApplicationInformation().getVendor();
    String appVersion = AdfmfContainerUtilities.getApplicationInformation().getVersion();

    Map<String,Object> payload = new HashMap<String,Object>();
    payload.put("appId", appId);
    payload.put("appVersion", appVersion);
    String appstoreAppId = PersistenceConfig.getPropertyValue("tracking.appstore.appid");
    if (appstoreAppId != null)
    {
      payload.put("appStoreAppId", appstoreAppId);
    }
    payload.put("os", os);
    payload.put("osVersion", version);
    payload.put("model", model);
    payload.put("network", networkStatus);
    payload.put("ampaVersion", Version.VERSION);
    payload.put("timeZone", getCurrentTimeZone());
    if (isUseLocation())
    {
      Location loc = getLocation();
      if (loc != null)
      {
        Map<String,String> locMap = new HashMap<String,String>();
        payload.put("location", locMap);
        locMap.put("lat", loc.getLatitude() + "");
        locMap.put("lng", loc.getLongitude() + "");
      }
    }
    return payload;
  }

  protected void sendMessage(String connectionEndPoint, String uri,Map payload)
  {
    try
    {
      String json = JSONBeanSerializationHelper.toJSON(payload).toString();
      RestServiceAdapter rsa = new NoConnRestServiceAdapterImpl(connectionEndPoint);
      rsa.clearRequestProperties();
      rsa.addRequestProperty("Content-Type", "application/json");
      rsa.setRequestMethod(RestServiceAdapter.REQUEST_TYPE_POST);
      rsa.setRequestURI(uri);
      rsa.send(json);
    }
    catch (Exception e)
    {
      sLog.severe("Error invoking tracking start resource: " + e.getLocalizedMessage());
    }

  }

  protected String getConnectionEndPoint()
  {
    String trackingConnection = PersistenceConfig.getPropertyValue("tracking.connection.endpoint");
    return trackingConnection!=null ? trackingConnection : CONNECTION_END_POINT;
  }

  protected String getStartUri()
  {
    String startUri = PersistenceConfig.getPropertyValue("tracking.start.uri");
    return startUri!=null ? startUri : START_URI;
  }

  protected String getErrorUri()
  {
    String errorUri = PersistenceConfig.getPropertyValue("tracking.error.uri");
    return errorUri!=null ? errorUri : ERROR_URI;
  }

  protected boolean isTrackingEnabled()
  {
    String trackingEnabled = PersistenceConfig.getPropertyValue("tracking.enabled");
    return "true".equalsIgnoreCase(trackingEnabled);
  }

  public void registerStartAppMessage()
  {
    if (!isTrackingEnabled())
    {
      return;
    }
    final String connectionEndPoint = getConnectionEndPoint();
    final String trackingStartUri = getStartUri();
    if (connectionEndPoint == null || trackingStartUri == null || isOffline())
    {
      return;
    }
    // send message in background thread so we don't delay app start-up
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        Map payload = getBasePayload();
        payload.put("startTime", getCurrentDateTime());
        sendMessage(connectionEndPoint, trackingStartUri,payload);
      }
    };
    Thread thread = new Thread(runnable);
    thread.start();
  }

  public void registerErrorMessage(final String message)
  {
    if (!isTrackingEnabled())
    {
      return;
    }
    final String connectionEndPoint = getConnectionEndPoint();
    final String trackingErrorUri = getErrorUri();
    if (connectionEndPoint == null || trackingErrorUri == null || isOffline())
    {
      return;
    }
    // send message in background thread so we don't delay app start-up
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        Map payload = getBasePayload();
        payload.put("errorTime", getCurrentDateTime());
        payload.put("errorMessage", message);
        sendMessage(connectionEndPoint, trackingErrorUri,payload);
      }
    };
    Thread thread = new Thread(runnable);
    thread.start();
  }

}


text:
<?php

namespace Psalm\Plugin\EventHandler;

use Psalm\Plugin\EventHandler\Event\PropertyExistenceProviderEvent;

interface PropertyExistenceProviderInterface
{
    /**
     * @return array<string>
     */
    public static function getClassLikeNames(): array;

    /**
     * Use this hook for informing whether or not a property exists on a given object. If you know the property does
     * not exist, return false. If you aren't sure if it exists or not, return null and the default analysis will
     * continue to determine if the property actually exists.
     *
     */
    public static function doesPropertyExist(PropertyExistenceProviderEvent $event): ?bool;
}


text:
package com.microsoft.alm.plugin.idea.common.ui.checkout.mocks;

import com.microsoft.alm.plugin.idea.common.ui.checkout.CheckoutPage;
import com.microsoft.alm.plugin.idea.common.ui.common.ServerContextTableModel;

import javax.swing.JComponent;
import javax.swing.ListSelectionModel;
import java.awt.event.ActionListener;

public class MockCheckoutPage implements CheckoutPage {
    private String repositoryFilter;

    @Override
    public void addActionListener(ActionListener listener) {
    }

    @Override
    public void setLoginShowing(boolean showLogin) {
    }

    @Override
    public void setLoading(boolean loading) {
    }

    @Override
    public void setAuthenticating(final boolean authenticating) {
    }

    @Override
    public void setAdvanced(boolean advanced) {
    }

    @Override
    public boolean getAdvanced() {
        return false;
    }

    @Override
    public boolean isTfvcServerCheckout() {
        return false;
    }

    @Override
    public void setRepositoryFilter(String filter) {
        repositoryFilter = filter;
    }

    @Override
    public String getRepositoryFilter() {
        return repositoryFilter;
    }

    @Override
    public void setRepositoryTable(ServerContextTableModel tableModel, ListSelectionModel selectionModel) {

    }

    @Override
    public void setParentDirectory(String path) {

    }

    @Override
    public String getParentDirectory() {
        return null;
    }

    @Override
    public JComponent getComponent(String name) {
        return null;
    }

    @Override
    public void setDirectoryName(String name) {

    }

    @Override
    public String getDirectoryName() {
        return null;
    }

    @Override
    public void setUserName(String name) {

    }

    @Override
    public void setServerName(String name) {

    }

    @Override
    public String getServerName() {
        return null;
    }

    @Override
    public JComponent getPreferredFocusedComponent() {
        return null;
    }
}


text:
@implementation ICLoadingPlaceholder

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

@end

@implementation ICNoResultsPlaceholder

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

@end


text:
package path

import (
	"testing"

	"github.com/andycondon/pathfinder/pkg/ir"
	"github.com/andycondon/pathfinder/pkg/motor"
	"github.com/golang/geo/s1"
	"github.com/golang/geo/s2"
	"github.com/stretchr/testify/assert"
)

func TestFinder_Avoidance(t *testing.T) {
	tests := []struct {
		name      string
		irReading ir.Reading
		driveCmd  motor.Command
	}{
		{
			name:      "move fast if all clear",
			irReading: ir.Reading{L: ir.ProximityClear, F: ir.ProximityClear, R: ir.ProximityClear},
			driveCmd:  motor.Command{M: motor.Forward, S: motor.Fast},
		},
		{
			name:      "move forward if all far",
			irReading: ir.Reading{L: ir.ProximityFar, F: ir.ProximityFar, R: ir.ProximityFar},
			driveCmd:  motor.Command{M: motor.Forward, S: motor.Slow},
		},
		{
			name:      "rotate right if possible and obstacle to left",
			irReading: ir.Reading{L: ir.ProximityNear, F: ir.ProximityFar, R: ir.ProximityFar},
			driveCmd:  motor.Command{M: motor.RotateRight, S: motor.Medium},
		},
		{
			name:      "rotate left if possible and obstacle to right",
			irReading: ir.Reading{L: ir.ProximityFar, F: ir.ProximityFar, R: ir.ProximityNear},
			driveCmd:  motor.Command{M: motor.RotateLeft, S: motor.Medium},
		},
		{
			name:      "rotate left if front and right blocked",
			irReading: ir.Reading{L: ir.ProximityFar, F: ir.ProximityNear, R: ir.ProximityNear},
			driveCmd:  motor.Command{M: motor.RotateLeft, S: motor.Medium},
		},
		{
			name:      "rotate right if everything blocked",
			irReading: ir.Reading{L: ir.ProximityNear, F: ir.ProximityNear, R: ir.ProximityNear},
			driveCmd:  motor.Command{M: motor.RotateRight, S: motor.Medium},
		},
	}
	for _, tc := range tests {
		t.Run(tc.name, func(t *testing.T) {
			_, cmd := avoid(tc.irReading)
			assert.Equal(t, tc.driveCmd, cmd)
		})
	}
}

func TestFind(t *testing.T) {
	before := func(waypoints ...s2.LatLng) (chan bool, chan s2.LatLng, chan s1.Angle, chan motor.Command, Finder) {
		var (
			fix      = make(chan bool)
			position = make(chan s2.LatLng)
			heading  = make(chan s1.Angle)
			drive    = make(chan motor.Command, 3)
			f        = Finder{
				GPSfix:   fix,
				Position: position, Heading: heading, Drive: drive,
				Waypoints:        waypoints,
				BearingTolerance: 1 * s1.Degree,
			}
		)
		return fix, position, heading, drive, f
	}
	t.Run("changes heading to match bearing and heads to waypoint", func(t *testing.T) {
		fix, position, heading, drive, f := before(
			s2.LatLngFromDegrees(41.18567113019101, -104.80852907096639),
		)
		go f.Find()

		//assert.Equal(t, motor.Command{M: motor.Park, S: motor.Stop}, <-drive) // waiting for fix
		fix <- true
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		position <- s2.LatLngFromDegrees(41.18567319147294, -104.80829286889617)
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive)

		heading <- 269 * s1.Degree
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)
	})
	t.Run("stops at waypoint", func(t *testing.T) {
		fix, position, heading, drive, f := before(
			s2.LatLngFromDegrees(41.18567113019101, -104.80852907096639),
		)
		go f.Find()

		fix <- true
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		position <- s2.LatLngFromDegrees(41.185579119692925, -104.80847684264579)
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive)

		heading <- 336 * s1.Degree
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		position <- s2.LatLngFromDegrees(41.18567113019101, -104.80852907096639)
		assert.Equal(t, motor.Command{M: motor.Park, S: motor.Stop}, <-drive)
	})
	t.Run("stops if loses fix", func(t *testing.T) {
		fix, position, heading, drive, f := before(
			s2.LatLngFromDegrees(41.18567113019101, -104.80852907096639),
		)
		go f.Find()

		fix <- true
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		position <- s2.LatLngFromDegrees(41.185579119692925, -104.80847684264579)
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive)

		heading <- 336 * s1.Degree
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		fix <- false
		assert.Equal(t, motor.Command{M: motor.Park, S: motor.Stop}, <-drive)
	})
	t.Run("follows a mission", func(t *testing.T) {
		/*
			// start
			41.185579119692925, -104.80847684264579
			// midpoint 1
			41.18553067368046, -104.80847416049401
			// waypoint 1
			41.185493329876394, -104.80846343169397
			// midpoint 2
			41.18550645031859, -104.80825556017193
			// waypoint 2
			41.18551556476105, -104.80804562107231
		*/
		fix, position, heading, drive, f := before(
			// waypoint 1
			s2.LatLngFromDegrees(41.185493329876394, -104.80846343169397),
			// waypoint 2
			s2.LatLngFromDegrees(41.18551556476105, -104.80804562107231),
		)
		go f.Find()

		fix <- true
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		// start
		position <- s2.LatLngFromDegrees(41.185579119692925, -104.80847684264579)
		assert.Equal(t, motor.Command{M: motor.RotateRight, S: motor.Medium}, <-drive) // correcting heading

		heading <- s1.Degree * 229                                                    // first heading reading, but in wrong direction
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive) // correcting heading

		heading <- s1.Degree * 173 // heading now corrected to match bearing
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		// midpoint 1
		position <- s2.LatLngFromDegrees(41.18553067368046, -104.80847416049401)
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive) // correcting heading

		heading <- s1.Degree * 168 // heading now corrected to match bearing
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		// waypoint 1
		position <- s2.LatLngFromDegrees(41.185493329876394, -104.80846343169397)
		assert.Equal(t, motor.Command{M: motor.RotateLeft, S: motor.Medium}, <-drive) // correcting heading

		heading <- s1.Degree * 86 // heading now corrected to match bearing
		assert.Equal(t, motor.Command{M: motor.Forward, S: motor.Fast}, <-drive)

		// midpoint 2
		position <- s2.LatLngFromDegrees(41.18550645031859, -104.80825556017193)

		// No heading correction needed, pretty straight shot

		// waypoint 2
		position <- s2.LatLngFromDegrees(41.18551556476105, -104.80804562107231)
		assert.Equal(t, motor.Command{M: motor.Park, S: motor.Stop}, <-drive) // mission complete
	})
}


text:
<?php

namespace Hubzero\Html\Toolbar;

use Hubzero\Base\Obj;

/**
 * Button base class
 * The Button is the base class for all Button types
 *
 * Inspired by Joomla's JButton class
 */
abstract class Button extends Obj
{
	/**
	 * Element name
	 *
	 * @var  string
	 */
	protected $_name = null;

	/**
	 * Reference to the object that instantiated the element
	 *
	 * @var  object  Button
	 */
	protected $_parent = null;

	/**
	 * Constructor
	 *
	 * @param   object  $parent  The parent
	 * @return  void
	 */
	public function __construct($parent = null)
	{
		$this->_parent = $parent;
	}

	/**
	 * Get the element name
	 *
	 * @return  string  type of the parameter
	 */
	public function getName()
	{
		return $this->_name;
	}

	/**
	 * Get the HTML to render the button
	 *
	 * @param   array  &$definition  Parameters to be passed
	 * @return  string
	 */
	public function render(&$definition)
	{
		// Initialise some variables
		$html   = null;
		$cls    = array();
		if (isset($definition[9]))
		{
			$cls = array_pop($definition);
		}
		$id     = call_user_func_array(array(&$this, 'fetchId'), $definition);
		$action = call_user_func_array(array(&$this, 'fetchButton'), $definition);

		// Build id attribute
		if ($id)
		{
			$id = 'id="' . $id . '"';
		}

		// Build the HTML Button
		$html .= '
\n";
		$html .= $action;
		$html .= "
\n";

		return $html;
	}

	/**
	 * Method to get the CSS class name for an icon identifier
	 *
	 * @param   string  $identifier  Icon identification string
	 * @return  string  CSS class name
	 */
	public function fetchIconClass($identifier)
	{
		return "icon-$identifier icon-32-$identifier";
	}

	/**
	 * Get the button
	 *
	 * @return  string
	 */
	abstract public function fetchButton();
}