text:
package org.jhove2.app.util.documenter;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.jhove2.app.util.documenter.displayer.DocumentationDisplayer;
import org.jhove2.app.util.documenter.displayer.DocumentationDisplayerFactory;
import org.jhove2.app.util.traverser.ReportableTypeTraverser;
import org.jhove2.config.ConfigInfo;
import org.jhove2.config.spring.SpringConfigInfo;
import org.jhove2.core.Document;
import org.jhove2.core.I8R;
import org.jhove2.core.JHOVE2Exception;
import org.jhove2.core.format.Format;
import org.jhove2.core.reportable.Reportable;
import org.jhove2.module.Module;
import org.jhove2.module.format.FormatModule;
import org.jhove2.module.format.FormatProfile;
import org.jhove2.persist.PersistenceManager;
import org.jhove2.persist.PersistenceManagerUtil;

/**
 * Intended to collection information about FormatModule, its Format, any Profiles and Profile Formats,
 * any specifications associated with the format, and the Reportable properties of the FormatModule.
 * The latter comes from static analysis of the Java class; other information comes for the Spring
 * Bean in the JHOVE2 configuration files
 *
 * @author smorrissey
 */
public class FormatModuleDocumenter implements ModuleDocumenter {

        public static final String DEFAULT_DISPLAY =
                "org.jhove2.app.util.documenter.displayer.FormatModuleTabDelimDisplayer";
        /** Usage string */
        public static final String USAGE =
                "USAGE:  java -cp CLASSPATH" + FormatModuleDocumenter.class.getName()
                + " fully-qualified-format-module-class-name output-dir-path"
                + " {optional} fully-qualified-display-class-name (default "
                + DEFAULT_DISPLAY + ")}";
        /** Fully-qualified class name for which properties file is to be generated */
        /** Error return code for erroneous command line invocation */
        public static final int EUSAGE = 1;
        /** Error return code if any exception is thrown while executing program */
        public static final int EEXCEPTION = 2;
        /** Return code for successful execution */
        public static final int SUCCESS = 0;

        /** FormatModule instance to be documented */
        protected FormatModule formatModule;
        /** FormatProfiles associated with module */
        protected List<FormatProfile> formatProfiles;
        /** Format associated with module */
        protected Format format;
        /** Formats associated with module profiles */
        protected List<Format> formatProfileFormats;
        /** container for Format info*/
        protected FormatIdDoc formatDoc;
        /** list of containers for profile formats info */
        protected List<FormatIdDoc> formatProfilesDocs;
        /** container for information about format module */
        protected FormatModuleIdDoc formatModuleIdDoc;
        /** list of containers for information about FormatProfiles */
        protected List<FormatModuleIdDoc> formatProfilesIdDocs;
        /** traverser that collections reportable properties documentation information */
        protected ReportableTypeTraverser properties;
        /** displayer that serializes documentation information*/
        protected DocumentationDisplayer displayer;

        /**
         * main method
         * Extracts information and displays it
         * Requires Spring bean to have been configured for the FormatModule being documented
         * @param args arguments
         *                 fully-qualified-format-module-class-name
         *             output-dir-path
         *             {optional} fully-qualified-display-class-name
         */
        public static void main(String[]args) {
                if (args.length < 2){
                        System.out.println(USAGE);
                        System.exit(EUSAGE);
                }
                FormatModuleDocumenter fdoc = new FormatModuleDocumenter();
                String classname = args[0];
                String outputDirName = args[1];
                File outputDir = new File(outputDirName);
                FormatModule module = null;
                ConfigInfo config = new SpringConfigInfo();
                if (!outputDir.exists()){
                        System.out.println("Output directory " + outputDirName + " does not exist");
                        System.exit(EEXCEPTION);
                }
                try {
            PersistenceManagerUtil.createPersistenceManagerFactory(config);
            PersistenceManager persistenceManager = PersistenceManagerUtil.getPersistenceManagerFactory().getInstance();
            persistenceManager.initialize();
                }
                catch (JHOVE2Exception e) {
                    System.out.println("Unable to initialize a persistence manageer");
                    System.exit(EEXCEPTION);
                }
                try {
                        Class modClass = Class.forName(classname);
                        module = (FormatModule) config.getReportable(modClass);
                } catch (Exception e) {
                        System.out.println("Unable to get bean for class " + classname);
                        e.printStackTrace();
                        System.exit(EEXCEPTION);
                }
                String displayClass = DEFAULT_DISPLAY;
                if (args.length > 2){
                        displayClass = args[2];
                }
                try {
                        fdoc.displayer = new DocumentationDisplayerFactory().getDocumentationDisplayer(displayClass);
                        fdoc.displayer.setOutputDir(outputDir);
                } catch (JHOVE2Exception e) {
                        System.out.println("Exception thrown while creating documentation displayer "
                                        + displayClass + ": " + e.getMessage());
                        e.printStackTrace();
                        System.exit(EEXCEPTION);
                }
                try {
                        fdoc.documentModule(module);
                } catch (JHOVE2Exception e) {
                        System.out.println("Exception thrown while documenting module " + classname
                                        + ": " + e.getMessage());
                        System.exit(EEXCEPTION);
                }
                try {
                        fdoc.displayer.displayDocumentation(fdoc);
                } catch (JHOVE2Exception e) {
                        System.out.println("Exception thrown while displaying documention: " + e.getMessage());
                        e.printStackTrace();
                        System.exit(EEXCEPTION);
                }
                System.out.println("FormatModuleDocumenter successfully completed:");
                System.out.println("\t generated files can be found in directory " + outputDirName);
                System.exit(SUCCESS);
        }

        public FormatModuleDocumenter (){
                super();
                this.formatProfiles = new ArrayList<FormatProfile>();
                this.formatProfileFormats = new ArrayList<Format>();
                this.formatProfilesDocs = new ArrayList<FormatIdDoc>();
                this.formatProfilesIdDocs = new ArrayList<FormatModuleIdDoc>();

        }
        /**
         * Entry point for extraction of documentation information about module
         * @param Module to be documented
         */
        public void documentModule(Reportable reportable)
            throws JHOVE2Exception
        {
                this.formatModule = (FormatModule)reportable;
                this.format = this.formatModule.getFormat();
                this.formatProfiles = this.formatModule.getProfiles();
                this.formatModuleIdDoc = this.documentFormatModuleIdInfo(this.formatModule);
                for (FormatProfile profile:this.formatProfiles){
                        this.getFormatProfileFormats().add(profile.getFormat());
                        this.getFormatProfilesIdDocs().add(this.documentFormatModuleIdInfo(profile));
                }
                this.formatDoc = this.documentFormatIdInfo(this.format);
                for (Format format:this.getFormatProfileFormats()){
                        this.getFormatProfilesDocs().add(this.documentFormatIdInfo(format));
                }
                this.properties = new ReportableTypeTraverser(reportable.getClass().getCanonicalName(),true);
                this.properties.extractDocInfo();
                return;
        }

        /**
         * Extracts basic identifying information about format module or profile
         * Intended for Section 2 (Identification) in Format Module Specification Document
         * @param formatModule
         * @return FormatModuleIdDoc  basic identifying information about format module
         * @throws JHOVE2Exception
         */
        public FormatModuleIdDoc documentFormatModuleIdInfo(Module formatModule)
            throws JHOVE2Exception
        {
                FormatModuleIdDoc formatIdDoc = new FormatModuleIdDoc();
                formatIdDoc.moduleName = formatModule.getReportableName();
                formatIdDoc.moduleId = formatModule.getReportableIdentifier().toString();
                formatIdDoc.moduleClassName = formatModule.getClass().getCanonicalName();
                return formatIdDoc;
        }

        /**
         * Extracts basic identifying information about format or profile format
         * Intended for Section 2 (Identification) in Format Module Specification Document
         * @param format Format to be documented
         * @return FormatIdDoc with basic identifying information about format or profile format
         * @throws JHOVE2Exception
         */
        public FormatIdDoc documentFormatIdInfo(Format format)
        throws JHOVE2Exception {
                FormatIdDoc formatIdDoc = new FormatIdDoc();
                formatIdDoc.canonicalFormatName = format.getName();
                formatIdDoc.canonicalFormatIdentifier = format.getIdentifier().toString();
                if (format.getAliasNames()!= null){
                        formatIdDoc.aliasFormatNames.addAll(format.getAliasNames());
                }
                if (format.getAliasIdentifiers()!= null){
                        for (I8R id:format.getAliasIdentifiers()){
                                String idString = id.toString();
                                formatIdDoc.aliasFormatIdentifiers.add(idString);
                        }
                }
                if (format.getSpecifications()!= null){
                        for (Document doc:format.getSpecifications()){
                                Document.Intention intent = doc.getIntention();
                                if (!formatIdDoc.references.containsKey(intent)){
                                        List<ReferenceDoc> refDocs = new ArrayList<ReferenceDoc>();
                                        formatIdDoc.references.put(intent, refDocs);
                                }
                                List<ReferenceDoc> refDocs = formatIdDoc.references.get(intent);
                                ReferenceDoc refDoc = new ReferenceDoc();
                                refDoc.refName = doc.getTitle();
                                refDoc.biblioInfo = this.createBiblioInfo(doc);
                                for (I8R id:doc.getIdentifiers()){
                                        String idString = id.toString();
                                        refDoc.identifiers.add(idString);
                                }
                                refDocs.add(refDoc);
                        }
                }
                return formatIdDoc;
        }
        /**
         * Create bibliographic string with information about a Format reference
         * Intended for section 3 (References) of format module specification
         * @param doc Document object for a reference associated with a Format
         * @return bibliographic string with information about a Format reference
         */
        public String createBiblioInfo(Document doc) {
                String authors = doc.getAuthor();
                String date = doc.getDate();
                String edition = doc.getEdition();
                String publisher = doc.getPublisher();
                String title = doc.getTitle();
                StringBuffer sbBib = new StringBuffer();
                if (authors != null && authors.length()>0){
                        sbBib.append(authors);
                        sbBib.append(". ");
                }
                if (title != null && title.length()>0){
                        sbBib.append(title);
                        if (edition != null && edition.length()>0){
                                sbBib.append(" ");
                                sbBib.append(edition);
                        }
                        sbBib.append(". ");
                }
                if (!(date==null && publisher==null)){
                        sbBib.append("(");
                        if (publisher !=null){
                                sbBib.append(publisher);
                                if (date != null){
                                        sbBib.append(", ");
                                        sbBib.append(date);
                                }
                        }
                        else {
                                sbBib.append(date);
                        }
                        sbBib.append(")");
                }
                return sbBib.toString();
        }

        /**
         * @return the formatModule
         */
        public FormatModule getFormatModule() {
                return formatModule;
        }

        /**
         * @return the formatProfiles
         */
        public List<FormatProfile> getFormatProfiles() {
                return formatProfiles;
        }

        /**
         * @return the format
         */
        public Format getFormat() {
                return format;
        }

        /**
         * @return the formatProfileFormats
         */
        public List<Format> getFormatProfileFormats() {
                return formatProfileFormats;
        }

        /**
         * @return the formatDoc
         */
        public FormatIdDoc getFormatDoc() {
                return formatDoc;
        }

        /**
         * @return the formatProfilesDocs
         */
        public List<FormatIdDoc> getFormatProfilesDocs() {
                return formatProfilesDocs;
        }

        /**
         * @return the formatModuleIdDoc
         */
        public FormatModuleIdDoc getFormatModuleIdDoc() {
                return formatModuleIdDoc;
        }

        /**
         * @return the formatProfilesIdDocs
         */
        public List<FormatModuleIdDoc> getFormatProfilesIdDocs() {
                return formatProfilesIdDocs;
        }

        /**
         * @return the properties
         */
        public ReportableTypeTraverser getProperties() {
                return properties;
        }

        /**
         * @param formatModule the formatModule to set
         */
        public void setFormatModule(FormatModule formatModule) {
                this.formatModule = formatModule;
        }

        /**
         * @param formatProfiles the formatProfiles to set
         */
        public void setFormatProfiles(List<FormatProfile> formatProfiles) {
                this.formatProfiles = formatProfiles;
        }

        /**
         * @param format the format to set
         */
        public void setFormat(Format format) {
                this.format = format;
        }

        /**
         * @param formatProfileFormats the formatProfileFormats to set
         */
        public void setFormatProfileFormats(List<Format> formatProfileFormats) {
                this.formatProfileFormats = formatProfileFormats;
        }

        /**
         * @param formatDoc the formatDoc to set
         */
        public void setFormatDoc(FormatIdDoc formatDoc) {
                this.formatDoc = formatDoc;
        }

        /**
         * @param formatProfilesDocs the formatProfilesDocs to set
         */
        public void setFormatProfilesDocs(List<FormatIdDoc> formatProfilesDocs) {
                this.formatProfilesDocs = formatProfilesDocs;
        }

        /**
         * @param formatModuleIdDoc the formatModuleIdDoc to set
         */
        public void setFormatModuleIdDoc(FormatModuleIdDoc formatModuleIdDoc) {
                this.formatModuleIdDoc = formatModuleIdDoc;
        }

        /**
         * @param formatProfilesIdDocs the formatProfilesIdDocs to set
         */
        public void setFormatProfilesIdDocs(List<FormatModuleIdDoc> formatProfilesIdDocs) {
                this.formatProfilesIdDocs = formatProfilesIdDocs;
        }

        /**
         * @param properties the properties to set
         */
        public void setProperties(ReportableTypeTraverser properties) {
                this.properties = properties;
        }
}


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

namespace UniRx.Tests
{
    public static class TestUtil
    {
        public static T[] ToArrayWait<T>(this IObservable<T> source)
        {
            return source.ToArray().Wait();
        }

        public static RecordObserver<T> Record<T>(this IObservable<T> source)
        {
            var d = new SingleAssignmentDisposable();
            var observer = new RecordObserver<T>(d);
            d.Disposable = source.Subscribe(observer);

            return observer;
        }

        public static void SetScehdulerForImport()
        {
            Scheduler.DefaultSchedulers.ConstantTimeOperations = Scheduler.Immediate;
            Scheduler.DefaultSchedulers.TailRecursion = Scheduler.Immediate;
            Scheduler.DefaultSchedulers.Iteration = Scheduler.CurrentThread;
            Scheduler.DefaultSchedulers.TimeBasedOperations = Scheduler.ThreadPool;
            Scheduler.DefaultSchedulers.AsyncConversions = Scheduler.ThreadPool;
        }
    }

    public class RecordObserver<T> : IObserver<T>
    {
        readonly object gate = new object();
        readonly IDisposable subscription;

        public List<T> Values { get; set; }
        public List<Notification<T>> Notifications { get; set; }

        public RecordObserver(IDisposable subscription)
        {
            this.subscription = subscription;
            this.Values = new List<T>();
            this.Notifications = new List<Notification<T>>();
        }

        public void DisposeSubscription()
        {
            subscription.Dispose();
        }

        void IObserver<T>.OnNext(T value)
        {
            lock (gate)
            {
                Values.Add(value);
                Notifications.Add(Notification.CreateOnNext<T>(value));
            }
        }

        void IObserver<T>.OnError(Exception error)
        {
            lock (gate)
            {
                Notifications.Add(Notification.CreateOnError<T>(error));
            }
        }
        void IObserver<T>.OnCompleted()
        {
            lock (gate)
            {
                Notifications.Add(Notification.CreateOnCompleted<T>());
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


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

  <title>Description of calcAOISacSequenceDist</title>
  <meta name="keywords" content="calcAOISacSequenceDist">
  <meta name="description" content="calculate matrix representing the sequence of AOIs saccaded to">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 © 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">

Home >  src > calcAOISacSequenceDist.m

calcAOISacSequenceDist

PURPOSE

calculate matrix representing the sequence of AOIs saccaded to

SYNOPSIS

function [ AOISequence ] =calcAOISacSequenceDist( sacStruct, aoiCenter, maxDist, maxSaccades )

DESCRIPTION

 calculate matrix representing the sequence of AOIs saccaded to

 Syntax: [ AOISequence ] =calcAOISacSequence( eyePos, aoiCenter, maxDist, maxSaccades)

 Inputs:
  sacStruct: returned from codeSaccadesDist
  aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m'
  maxDist: maximum distance to a nearest AOI, anything further
   considered not part of any AOI, returned by 'returnAOICenters.m'
  maxSaccades: number of saccades in the sequence to keep

 Outputs:
  AOISequence: matrix (numAOI x numFix) with an indicator (1) for
       in each column corresponding to the AOI of interest.  If no
       AOI, it will be an all 0;

CROSS-REFERENCE INFORMATION

This function calls:

calc2Dist	Notes: calculates 2-norm distance from target vector to all query vectors

This function is called by:

extractVarsDist	extract all variables from a cell of eye tracks

SOURCE CODE

0001 % calculate matrix representing the sequence of AOIs saccaded to
0002 %
0003 % Syntax: [ AOISequence ] =calcAOISacSequence( eyePos, aoiCenter, maxDist, maxSaccades)
0004 %
0005 % Inputs:
0006 %  sacStruct: returned from codeSaccadesDist
0007 %  aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m'
0008 %  maxDist: maximum distance to a nearest AOI, anything further
0009 %   considered not part of any AOI, returned by 'returnAOICenters.m'
0010 %  maxSaccades: number of saccades in the sequence to keep
0011 %
0012 % Outputs:
0013 %  AOISequence: matrix (numAOI x numFix) with an indicator (1) for
0014 %       in each column corresponding to the AOI of interest.  If no
0015 %       AOI, it will be an all 0;
0016
0017
0018 function [ AOISequence ] =calcAOISacSequenceDist( sacStruct, aoiCenter, maxDist, maxSaccades )
0019
0020 % initialize some paramters
0021 if nargin < 4 || isempty( maxSaccades )
0022     maxSaccades = 3;
0023 end
0024
0025 % initialize some variables
0026 endSacPos = sacStruct.endSacPos;
0027 numAOI = size(aoiCenter,2);
0028 numSaccades = size( endSacPos,2);
0029 AOIOrderList = zeros(numSaccades,1);
0030 effectivNumSaccades = 0;
0031
0032 % find AOI fixation sequence
0033 for i1 = 1:numSaccades
0034     dist = calc2Dist( endSacPos(:,i1), aoiCenter); % 2-norm
0035     [minDist minIdx] = min( dist);
0036     if minDist < maxDist
0037         effectivNumSaccades = effectivNumSaccades+1;
0038         AOIOrderList(effectivNumSaccades) = minIdx;
0039     end
0040 end
0041
0042 % code as a matrix of indicator variables
0043 if effectivNumSaccades >0
0044     AOISequence = zeros( numAOI, maxSaccades);
0045     for i1 = 1:min(effectivNumSaccades, maxSaccades)
0046         AOISequence(AOIOrderList(i1),i1) = 1; % indicator for AOI (1)
0047     end
0048
0049 else % all 0 if no relevant AOI
0050     AOISequence = zeros( numAOI,maxSaccades);
0051 end
0052
0053
0054
0055

<address>Generated on Wed 20-Jan-2016 11:50:43 by m2html © 2005</address>


text:
#!/usr/bin/env python
# Copyright 2020 DeepMind Technologies Limited. 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.
# ==============================================================================
"""Install script."""

import glob
import os
import pathlib
import setuptools

stub_files = (glob.glob('tensor_annotations/*.pyi') +
              glob.glob('tensor_annotations/library_stubs/**/*.pyi',
                        recursive=True))
# package_data expects paths to be relative to the package directory, so strip
# 'tensor_annotations/' from start of paths
stub_files = [
    os.path.join(*pathlib.Path(path).parts[1:])
    for path in stub_files
]

with open('README.md', 'r') as f:
    long_description = f.read()

setuptools.setup(
    name='tensor_annotations',
    version='2.0.2',
    description=('Enables annotations of tensor shapes in numerical computing '
                 'libraries. Includes type stubs for TensorFlow and JAX '
                 'describing how library functions change shapes.'),
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://github.com/deepmind/tensor_annotations',
    # Copybara takes care of moving files to 'tensor_annotations/'
    packages=[
        'tensor_annotations',
        'tensor_annotations/tests',
    ],
    package_data={'tensor_annotations': stub_files + ['py.typed']},
    install_requires=['dm-tree'],
    extras_require={'dev': [
        'absl-py',
        'pytype',
    ]})


text:
[Home](./index.md) > [sip.js](./sip.js.md) > [SimpleUser](./sip.js.simpleuser.md) > [unregister](./sip.js.simpleuser.unregister.md)

## SimpleUser.unregister() method

Stop receiving incoming calls.

Signature:

```typescript
unregister(registererUnregisterOptions?: RegistererUnregisterOptions): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  registererUnregisterOptions | RegistererUnregisterOptions |  |

Returns:

Promise<void>

## Remarks

Send an un-REGISTER request for the UserAgent's AOR. Resolves when the un-REGISTER request is sent, otherwise rejects.


text:
void CGeppetto::LoadMeshInstanceIntoToyPhysics(CConversionScene* pScene, CConversionMeshInstance* pMeshInstance, const Matrix4x4& mParentTransformations, CToyUtil* pToy)
{
	if (!pMeshInstance->IsVisible())
		return;

	CConversionMesh* pMesh = pMeshInstance->GetMesh();

	size_t iVertsSize = pToy->GetNumPhysVerts();

	for (size_t v = 0; v < pMesh->GetNumVertices(); v++)
		pToy->AddPhysVertex(mParentTransformations * pMesh->GetVertex(v));

	for (size_t j = 0; j < pMesh->GetNumFaces(); j++)
	{
		size_t k;
		CConversionFace* pFace = pMesh->GetFace(j);

		CConversionVertex* pVertex0 = pFace->GetVertex(0);

		for (k = 2; k < pFace->GetNumVertices(); k++)
		{
			CConversionVertex* pVertex1 = pFace->GetVertex(k-1);
			CConversionVertex* pVertex2 = pFace->GetVertex(k);

			pToy->AddPhysTriangle(iVertsSize + pVertex0->v, iVertsSize + pVertex1->v, iVertsSize + pVertex2->v);
		}
	}
}

void CGeppetto::LoadSceneNodeIntoToyPhysics(CConversionScene* pScene, CConversionSceneNode* pNode, const Matrix4x4& mParentTransformations, CToyUtil* pToy)
{
	if (!pNode)
		return;

	if (!pNode->IsVisible())
		return;

	Matrix4x4 mTransformations = mParentTransformations;

	if (!pToy->IsUsingLocalTransformations())
		mTransformations = mParentTransformations * pNode->m_mTransformations;

	for (size_t i = 0; i < pNode->GetNumChildren(); i++)
		LoadSceneNodeIntoToyPhysics(pScene, pNode->GetChild(i), mTransformations, pToy);

	for (size_t m = 0; m < pNode->GetNumMeshInstances(); m++)
		LoadMeshInstanceIntoToyPhysics(pScene, pNode->GetMeshInstance(m), mTransformations, pToy);
}

void CGeppetto::LoadSceneIntoToyPhysics(CConversionScene* pScene, CToyUtil* pToy)
{
	Matrix4x4 mUpLeftSwap(Vector(1, 0, 0), Vector(0, 0, 1), Vector(0, -1, 0));

	for (size_t i = 0; i < pScene->GetNumScenes(); i++)
		LoadSceneNodeIntoToyPhysics(pScene, pScene->GetScene(i), mUpLeftSwap, pToy);
}


text:
package com.ait.toolkit.soundmanager.client;

public interface SoundLoadHandler {
	public void onLoad(Sound sound, boolean isSuccess);
}


text:
//  Copyright 2018 Google Inc. 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.

// NOTE: This file is a modified version of SymbolResolver.cs from OleViewDotNet
// https://github.com/tyranid/oleviewdotnet. It's been relicensed from GPLv3 by
// the original author James Forshaw to be used under the Apache License for this
// project.

using System;
using System.Collections.Generic;

namespace NtApiDotNet.Win32
{
    /// <summary>
    /// Interface for a symbol resolver.
    /// </summary>
    public interface ISymbolResolver : IDisposable
    {
        /// <summary>
        /// Get list of loaded modules.
        /// </summary>
        /// <returns>The list of loaded modules</returns>
        /// <remarks>Note this will cache the results so subsequent calls won't necessarily see new modules.</remarks>
        IEnumerable<SymbolLoadedModule> GetLoadedModules();
        /// <summary>
        /// Get list of loaded modules and optionally refresh the list.
        /// </summary>
        /// <param name="refresh">True to refresh the current cached list of modules.</param>
        /// <returns>The list of loaded modules</returns>
        IEnumerable<SymbolLoadedModule> GetLoadedModules(bool refresh);
        /// <summary>
        /// Get module at an address.
        /// </summary>
        /// <param name="address">The address for the module.</param>
        /// <returns>The module, or null if not found.</returns>
        /// <remarks>Note this will cache the results so subsequent calls won't necessarily see new modules.</remarks>
        SymbolLoadedModule GetModuleForAddress(IntPtr address);
        /// <summary>
        /// Get module at an address.
        /// </summary>
        /// <param name="address">The address for the module.</param>
        /// <param name="refresh">True to refresh the current cached list of modules.</param>
        /// <returns>The module, or null if not found.</returns>
        SymbolLoadedModule GetModuleForAddress(IntPtr address, bool refresh);
        /// <summary>
        /// Get a string representation of a relative address to a module.
        /// </summary>
        /// <param name="address">The address to get the string for,</param>
        /// <returns>The string form of the address, e.g. modulename+0x100</returns>
        /// <remarks>Note this will cache the results so subsequent calls won't necessarily see new modules.</remarks>
        string GetModuleRelativeAddress(IntPtr address);
        /// <summary>
        /// Get a string representation of a relative address to a module.
        /// </summary>
        /// <param name="address">The address to get the string for,</param>
        /// <param name="refresh">True to refresh the current cached list of modules.</param>
        /// <returns>The string form of the address, e.g. modulename+0x100</returns>
        string GetModuleRelativeAddress(IntPtr address, bool refresh);
        /// <summary>
        /// Get the address of a symbol.
        /// </summary>
        /// <param name="name">The name of the symbol, should include the module name, e.g. modulename!MySymbol.</param>
        /// <returns>The address of the symbol</returns>
        IntPtr GetAddressOfSymbol(string name);
        /// <summary>
        /// Get the symbol name for an address.
        /// </summary>
        /// <param name="address">The address of the symbol.</param>
        /// <returns>The symbol name.</returns>
        string GetSymbolForAddress(IntPtr address);
        /// <summary>
        /// Get the symbol name for an address, with no fallback.
        /// </summary>
        /// <param name="address">The address of the symbol.</param>
        /// <param name="generate_fake_symbol">If true then generate a fake symbol.</param>
        /// <returns>The symbol name. If |generate_fake_symbol| is true and the symbol doesn't exist one is generated based on module name.</returns>
        string GetSymbolForAddress(IntPtr address, bool generate_fake_symbol);
        /// <summary>
        /// Get the symbol name for an address, with no fallback.
        /// </summary>
        /// <param name="address">The address of the symbol.</param>
        /// <param name="generate_fake_symbol">If true then generate a fake symbol.</param>
        /// <param name="return_name_only">If true then return only the name of the symbols (such as C++ symbol name) rather than full symbol.</param>
        /// <returns>The symbol name. If |generate_fake_symbol| is true and the symbol doesn't exist one is generated based on module name.</returns>
        string GetSymbolForAddress(IntPtr address, bool generate_fake_symbol, bool return_name_only);
        /// <summary>
        /// Reload the list of modules for this symbol resolver.
        /// </summary>
        void ReloadModuleList();
        /// <summary>
        /// Load a specific module into the symbol resolver.
        /// </summary>
        /// <param name="module_path">The path to the module.</param>
        /// <param name="base_address">The base address of the loaded module.</param>
        void LoadModule(string module_path, IntPtr base_address);
    }
}


text:
**For additional reference, please review the [source](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Module/WebDriver.php)**

New generation Selenium2 module.
*Included in Codeception 1.7.0*

## Installation

Download [Selenium2 WebDriver](http://code.google.com/p/selenium/downloads/list?q=selenium-server-standalone-2)
Launch the daemon: `java -jar selenium-server-standalone-2.xx.xxx.jar`

## Migration Guide (Selenium2 -> WebDriver)

* `wait` method accepts seconds instead of milliseconds. All waits use second as parameter.

## Status

* Maintainer: **davert**
* Stability: **beta**
* Contact: davert.codecept@mailican.com
* Based on [facebook php-webdriver](https://github.com/facebook/php-webdriver)

## Configuration

* url *required* - start url for your app
* browser *required* - browser that would be launched
* host  - Selenium server host (localhost by default)
* port - Selenium server port (4444 by default)
* restart - set to false to share browser sesssion between tests, or set to true (by default) to create a session per test
* window_size - initial window size. Values `maximize` or dimensions in format `640x480` are accepted.
* clear_cookies - set to false to keep cookies (not default), or set to true to delete all cookies between cases.
* wait - set the implicit wait (5 secs) by default.
* capabilities - sets Selenium2 [desired capabilities](http://code.google.com/p/selenium/wiki/DesiredCapabilities). Should be a key-value array.

### Example (`acceptance.suite.yml`)

    modules:
       enabled: [WebDriver]
       config:
          WebDriver:
             url: 'http://localhost/'
             browser: firefox
             window_size: 1024x768
             wait: 10
             capabilities:
                 unexpectedAlertBehaviour: 'accept'

Class WebDriver
@package Codeception\Module

### acceptPopup

Accepts JavaScript native popup window created by `window.alert`|`window.confirm`|`window.prompt`.
Don't confuse it with modal windows, created by [various libraries](http://jster.net/category/windows-modals-popups).

### amOnPage

Opens the page.
Requires relative uri as parameter

Example:

``` php
<?php
// opens front page
$I->amOnPage('/');
// opens /register page
$I->amOnPage('/register');
?>
```

 * `param`  $page

### amOnSubdomain

Sets 'url' configuration parameter to hosts subdomain.
It does not open a page on subdomain. Use `amOnPage` for that

``` php
<?php
// If config is: 'http://mysite.com'
// or config is: 'http://www.mysite.com'
// or config is: 'http://company.mysite.com'

$I->amOnSubdomain('user');
$I->amOnPage('/');
// moves to http://user.mysite.com/
?>
```

 * `param`  $subdomain

 * `return`  mixed

### appendField

Append text to an element
Can add another selection to a select box

``` php
<?php
$I->appendField('#mySelectbox', 'SelectValue');
$I->appendField('#myTextField', 'appended');
?>
```

 * `param`  string $field
 * `param`  string $value
 * `throws`  \Codeception\Exception\ElementNotFound

### attachFile

Attaches file from Codeception data directory to upload field.

Example:

``` php
<?php
// file is stored in 'tests/_data/prices.xls'
$I->attachFile('input[ * `type="file"]',`  'prices.xls');
?>
```

 * `param`  $field
 * `param`  $filename

### cancelPopup

Dismisses active JavaScript popup created by `window.alert`|`window.confirm`|`window.prompt`.

### checkOption

Ticks a checkbox.
For radio buttons use `selectOption` method.

Example:

``` php
<?php
$I->checkOption('#agree');
?>
```

 * `param`  $option

### click

Perform a click on link or button.
Link or button are found by their names or CSS selector.
Submits a form if button is a submit type.

If link is an image it's found by alt attribute value of image.
If button is image button is found by it's value
If link or button can't be found by name they are searched by CSS selector.

The second parameter is a context: CSS or XPath locator to narrow the search.

Examples:

``` php
<?php
// simple link
$I->click('Logout');
// button of form
$I->click('Submit');
// CSS button
$I->click('#form input[type=submit]');
// XPath
$I->click('//form/*[ * `type=submit]');`
// link in context
$I->click('Logout', '#nav');
// using strict locator
$I->click(['link' => 'Login'])'
?>
```

 * `param`  $link
 * `param`  $context

### clickWithRightButton

Performs contextual click with right mouse button on element matched by CSS or XPath.

 * `param`  $cssOrXPath
 * `throws`  \Codeception\Exception\ElementNotFound

### dontSee

Check if current page doesn't contain the text specified.
Specify the css selector to match only specific region.

Examples:

```php
<?php
$I->dontSee('Login'); // I can suppose user is already logged in
$I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
$I->dontSee('Sign Up','//body/h1'); // with XPath
?>
```

 * `param`       $text
 * `param`  null $selector

### dontSeeCheckboxIsChecked

Assert if the specified checkbox is unchecked.
Use css selector or xpath to match.

Example:

``` php
<?php
$I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
$I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
?>
```

 * `param`  $checkbox

### dontSeeCookie

Checks that cookie doesn't exist

 * `param`  $cookie

 * `return`  mixed

### dontSeeCurrentUrlEquals

Checks that current url is not equal to value.
Unlike `dontSeeInCurrentUrl` performs a strict check.

``` php
<?php
// current url is not root
$I->dontSeeCurrentUrlEquals('/');
?>
```

 * `param`  $uri

### dontSeeCurrentUrlMatches

Checks that current url does not match a RegEx value

``` php
<?php
// to match root url
$I->dontSeeCurrentUrlMatches('~$/users/(\d+)~');
?>
```

 * `param`  $uri

### dontSeeElement

Checks that element is invisible or not present on page.

``` php
<?php
$I->dontSeeElement('.error');
$I->dontSeeElement('//form/input[1]');
?>
```

 * `param`  $selector
 * `param`  array $attributes

### dontSeeElementInDOM

Opposite to `seeElementInDOM`.

 * `param`  $selector

### dontSeeInCurrentUrl

Checks that current uri does not contain a value

``` php
<?php
$I->dontSeeInCurrentUrl('/users/');
?>
```

 * `param`  $uri

### dontSeeInField

Checks that an input field or textarea doesn't contain value.
Field is matched either by label or CSS or Xpath
Example:

``` php
<?php
$I->dontSeeInField('Body','Type your comment here');
$I->dontSeeInField('form textarea[name=body]','Type your comment here');
$I->dontSeeInField('form input[type=hidden]','hidden_value');
$I->dontSeeInField('#searchform input','Search');
$I->dontSeeInField('//form/*[ * `name=search]','Search');`
$I->seeInField(['name' => 'search'], 'Search');
?>
```

 * `param`  $field
 * `param`  $value

### dontSeeInTitle

Checks that page title does not contain text.

 * `param`  $title

 * `return`  mixed

### dontSeeLink

Checks if page doesn't contain the link with text specified.
Specify url to narrow the results.

Examples:

``` php
<?php
$I->dontSeeLink('Logout'); // I suppose user is not logged in
?>
```

 * `param`       $text
 * `param`  null $url

### dontSeeOptionIsSelected

Checks if option is not selected in select field.

``` php
<?php
$I->dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
?>
```

 * `param`  $selector
 * `param`  $optionText

 * `return`  mixed

### doubleClick

Performs a double click on element matched by CSS or XPath.

 * `param`  $cssOrXPath
 * `throws`  \Codeception\Exception\ElementNotFound

### dragAndDrop

Performs a simple mouse drag and drop operation.

``` php
<?php
$I->dragAndDrop('#drag', '#drop');
?>
```

 * `param`  string $source (CSS ID or XPath)
 * `param`  string $target (CSS ID or XPath)

### executeInSelenium

Low-level API method.
If Codeception commands are not enough, use Selenium WebDriver methods directly

``` php
$I->executeInSelenium(function(\WebDriver $webdriver) {
  $webdriver->get('http://google.com');
});
```

Use [WebDriver Session API](https://github.com/facebook/php-webdriver)
Not recommended this command too be used on regular basis.
If Codeception lacks important Selenium methods implement then and submit patches.

 * `param`  callable $function

### executeJS

Executes custom JavaScript

 * `param`  $script
 * `return`  mixed

### fillField

Fills a text field or textarea with value.

Example:

``` php
<?php
$I->fillField("//input[ * `type='text']",`  "Hello World!");
$I->fillField(['name' => 'email'], 'jon * `mail.com');`
?>
```

 * `param`  $field
 * `param`  $value

### grabAttributeFrom

Grabs attribute value from an element.
Fails if element is not found.

``` php
<?php
$I->grabAttributeFrom('#tooltip', 'title');
?>
```

 * `param`  $cssOrXpath
 * `param`  $attribute
 * `internal`  param $element
 * `return`  mixed

### grabCookie

Grabs a cookie value.

 * `param`  $cookie

 * `return`  mixed

### grabFromCurrentUrl

Takes a parameters from current URI by RegEx.
If no url provided returns full URI.

``` php
<?php
$user_id = $I->grabFromCurrentUrl('~$/user/(\d+)/~');
$uri = $I->grabFromCurrentUrl();
?>
```

 * `param`  null $uri

 * `internal`  param $url
 * `return`  mixed

### grabTextFrom

Finds and returns text contents of element.
Element is searched by CSS selector, XPath or matcher by regex.

Example:

``` php
<?php
$heading = $I->grabTextFrom('h1');
$heading = $I->grabTextFrom('descendant-or-self::h1');
$value = $I->grabTextFrom('~<input value=(.*?)]~sgi');
?>
```

 * `param`  $cssOrXPathOrRegex

 * `return`  mixed

### grabValueFrom

Finds and returns field and returns it's value.
Searches by field name, then by CSS, then by XPath

Example:

``` php
<?php
$name = $I->grabValueFrom('Name');
$name = $I->grabValueFrom('input[name=username]');
$name = $I->grabValueFrom('descendant-or-self::form/descendant::input[ * `name`  = 'username']');
$name = $I->grabValueFrom(['name' => 'username']);
?>
```

 * `param`  $field

 * `return`  mixed

### makeScreenshot

Makes a screenshot of current window and saves it to `tests/_log/debug`.

``` php
<?php
$I->amOnPage('/user/edit');
$I->makeScreenshot('edit_page');
// saved to: tests/_log/debug/edit_page.png
?>
```

 * `param`  $name

### maximizeWindow

Maximizes current window

### moveBack

Moves back in history

### moveForward

Moves forward in history

### moveMouseOver

Move mouse over the first element matched by css or xPath on page

https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/moveto

 * `param`  string $cssOrXPath css or xpath of the web element
 * `param`  int $offsetX
 * `param`  int $offsetY

 * `throws`  \Codeception\Exception\ElementNotFound
 * `return`  null

### pauseExecution

Pauses test execution in debug mode.
To proceed test press "ENTER" in console.

This method is recommended to use in test development, for additional page analysis, locator searing, etc.

### pressKey

Presses key on element found by css, xpath is focused
A char and modifier (ctrl, alt, shift, meta) can be provided.
For special keys use key constants from \WebDriverKeys class.

Example:

``` php
<?php
// <input id="page" value="old" />
$I->pressKey('#page','a'); // => olda
$I->pressKey('#page',array('ctrl','a'),'new'); //=> new
$I->pressKey('#page',array('shift','111'),'1','x'); //=> old!!!1x
$I->pressKey('descendant-or-self::*[ * `id='page']','u');`  //=> oldu
$I->pressKey('#name', array('ctrl', 'a'), WebDriverKeys::DELETE); //=>''
?>
```

 * `param`  $element
 * `param`  $char can be char or array with modifier. You can provide several chars.
 * `throws`  \Codeception\Exception\ElementNotFound

### reloadPage

Reloads current page

### resetCookie

Unsets cookie

 * `param`  $cookie

 * `return`  mixed

### resizeWindow

Resize current window

Example:
``` php
<?php
$I->resizeWindow(800, 600);

```

 * `param`  int $width
 * `param`  int $height

### see

Check if current page contains the text specified.
Specify the css selector to match only specific region.

Examples:

``` php
<?php
$I->see('Logout'); // I can suppose user is logged in
$I->see('Sign Up','h1'); // I can suppose it's a signup page
$I->see('Sign Up','//body/h1'); // with XPath
?>
```

 * `param`       $text
 * `param`  null $selector

### seeCheckboxIsChecked

Assert if the specified checkbox is checked.
Use css selector or xpath to match.

Example:

``` php
<?php
$I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
$I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
$I->seeCheckboxIsChecked('//form/input[ * `type=checkbox`  and  * `name=agree]');`
?>
```

 * `param`  $checkbox

### seeCookie

Checks that cookie is set.

 * `param`  $cookie

 * `return`  mixed

### seeCurrentUrlEquals

Checks that current url is equal to value.
Unlike `seeInCurrentUrl` performs a strict check.

``` php
<?php
// to match root url
$I->seeCurrentUrlEquals('/');
?>
```

 * `param`  $uri

### seeCurrentUrlMatches

Checks that current url is matches a RegEx value

``` php
<?php
// to match root url
$I->seeCurrentUrlMatches('~$/users/(\d+)~');
?>
```

 * `param`  $uri

### seeElement

Checks for a visible element on a page, matching it by CSS or XPath

``` php
<?php
$I->seeElement('.error');
$I->seeElement('//form/input[1]');
?>
```
 * `param`  $selector
 * `param`  array $attributes

### seeElementInDOM

Checks if element exists on a page even it is invisible.

``` php
<?php
$I->seeElementInDOM('//form/input[type=hidden]');
?>
```

 * `param`  $selector

### seeInCurrentUrl

Checks that current uri contains a value

``` php
<?php
// to match: /home/dashboard
$I->seeInCurrentUrl('home');
// to match: /users/1
$I->seeInCurrentUrl('/users/');
?>
```

 * `param`  $uri

### seeInField

Checks that an input field or textarea contains value.
Field is matched either by label or CSS or Xpath

Example:

``` php
<?php
$I->seeInField('Body','Type your comment here');
$I->seeInField('form textarea[name=body]','Type your comment here');
$I->seeInField('form input[type=hidden]','hidden_value');
$I->seeInField('#searchform input','Search');
$I->seeInField('//form/*[ * `name=search]','Search');`
$I->seeInField(['name' => 'search'], 'Search');
?>
```

 * `param`  $field
 * `param`  $value

### seeInPopup

Checks that active JavaScript popup created by `window.alert`|`window.confirm`|`window.prompt` contain text.

 * `param`  $text

### seeInTitle

Checks that page title contains text.

``` php
<?php
$I->seeInTitle('Blog - Post #1');
?>
```

 * `param`  $title

 * `return`  mixed

### seeLink

Checks if there is a link with text specified.
Specify url to match link with exact this url.

Examples:

``` php
<?php
$I->seeLink('Logout'); // matches <a href="#">Logout</a>
$I->seeLink('Logout','/logout'); // matches <a href="/logout">Logout</a>
?>
```

 * `param`       $text
 * `param`  null $url

### seeOptionIsSelected

Checks if option is selected in select field.

``` php
<?php
$I->seeOptionIsSelected('#form input[name=payment]', 'Visa');
?>
```

 * `param`  $selector
 * `param`  $optionText

 * `return`  mixed

### selectOption

Selects an option in select tag or in radio button group.

Example:

``` php
<?php
$I->selectOption('form select[name=account]', 'Premium');
$I->selectOption('form input[name=payment]', 'Monthly');
$I->selectOption('//form/select[ * `name=account]',`  'Monthly');
?>
```

Can select multiple options if second argument is array:

``` php
<?php
$I->selectOption('Which OS do you use?', array('Windows','Linux'));
?>
```

 * `param`  $select
 * `param`  $option

### setCookie

Sets a cookie.

 * `param`  $cookie
 * `param`  $value

 * `return`  mixed

### submitForm

Submits a form located on page.
Specify the form by it's css or xpath selector.
Fill the form fields values as array. Hidden fields can't be accessed.

This command itself triggers the request to form's action.

Examples:

``` php
<?php
$I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));

```

For sample Sign Up form:

``` html
<form action="/sign_up">
    Login: <input type="text" name="user[login]" /><br/>
    Password: <input type="password" name="user[password]" /><br/>
    Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/>
    Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select>
    <input type="submit" value="Submit" />
</form>
```
You can write this:

``` php
<?php
$I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));

```

 * `param`  $selector
 * `param`  $params
 * `throws`  \Codeception\Exception\ElementNotFound

### switchToIFrame

Switch to another frame

Example:
``` html
<iframe name="another_frame" src="http://example.com">

```

``` php
<?php
# switch to iframe
$I->switchToIFrame("another_frame");
# switch to parent page
$I->switchToIFrame();

```

 * `param`  string|null $name

### switchToWindow

Switch to another window identified by its name.

The window can only be identified by its name. If the $name parameter is blank it will switch to the parent window.

Example:
``` html
<input type="button" value="Open window" onclick="window.open('http://example.com', 'another_window')">
```

``` php
<?php
$I->click("Open window");
# switch to another window
$I->switchToWindow("another_window");
# switch to parent window
$I->switchToWindow();
?>
```

If the window has no name, the only way to access it is via the `executeInSelenium()` method like so:

``` php
<?php
$I->executeInSelenium(function (\Webdriver $webdriver) {
     $handles=$webdriver->getWindowHandles();
     $last_window = end($handles);
     $webdriver->switchTo()->window($last_window);
});
?>
```

 * `param`  string|null $name

### typeInPopup

Enters text into native JavaScript prompt popup created by `window.prompt`.

 * `param`  $keys

### uncheckOption

Unticks a checkbox.

Example:

``` php
<?php
$I->uncheckOption('#notify');
?>
```

 * `param`  $option

### unselectOption
__not documented__

### wait

Explicit wait.

 * `param`  int $timeout secs
 * `throws`  \Codeception\Exception\TestRuntime

### waitForElement

Waits for element to appear on page for $timeout seconds to pass.
If element not appears, timeout exception is thrown.

``` php
<?php
$I->waitForElement('#agree_button', 30); // secs
$I->click('#agree_button');
?>
```

 * `param`  $element
 * `param`  int $timeout seconds
 * `throws`  \Exception

### waitForElementChange

Waits for element to change or for $timeout seconds to pass. Element "change" is determined
by a callback function which is called repeatedly until the return value evaluates to true.

``` php
<?php
$I->waitForElementChange('#menu', function(\WebDriverElement $el) {
    return $el->isDisplayed();
}, 100);
?>
```

 * `param`  $element
 * `param`  \Closure $callback
 * `param`  int $timeout seconds
 * `throws`  \Codeception\Exception\ElementNotFound

### waitForElementNotVisible

Waits for element to not be visible on the page for $timeout seconds to pass.
If element stays visible, timeout exception is thrown.

``` php
<?php
$I->waitForElementNotVisible('#agree_button', 30); // secs
?>
```

 * `param`  $element
 * `param`  int $timeout seconds
 * `throws`  \Exception

### waitForElementVisible

Waits for element to be visible on the page for $timeout seconds to pass.
If element doesn't appear, timeout exception is thrown.

``` php
<?php
$I->waitForElementVisible('#agree_button', 30); // secs
$I->click('#agree_button');
?>
```

 * `param`  $element
 * `param`  int $timeout seconds
 * `throws`  \Exception

### waitForJS

Executes JavaScript and waits for it to return true or for the timeout.

In this example we will wait for all jQuery ajax requests are finished or 60 secs otherwise.

``` php
<?php
$I->waitForJS("return $.active == 0;", 60);
?>
```

 * `param`  string $script
 * `param`  int $timeout seconds

### waitForText

Waits for text to appear on the page for a specific amount of time.
Can also be passed a selector to search in.
If text does not appear, timeout exception is thrown.

``` php
<?php
$I->waitForText('foo', 30); // secs
$I->waitForText('foo', 30, '.title'); // secs
?>
```

 * `param`  string $text
 * `param`  int $timeout seconds
 * `param`  null $selector
 * `throws`  \Exception
 * `internal`  param string $element


text:
module Spree
  class OrderContents
    attr_accessor :order, :currency

    def initialize(order)
      @order = order
    end

    def add(variant, quantity = 1, currency = nil, shipment = nil)
      line_item = add_to_line_item(variant, quantity, currency, shipment)
      reload_totals
      shipment.present? ? shipment.update_amounts : order.ensure_updated_shipments
      PromotionHandler::Cart.new(order, line_item).activate
      ItemAdjustments.new(line_item).update
      reload_totals
      line_item
    end

    def remove(variant, quantity = 1, shipment = nil)
      line_item = remove_from_line_item(variant, quantity, shipment)
      reload_totals
      shipment.present? ? shipment.update_amounts : order.ensure_updated_shipments
      PromotionHandler::Cart.new(order, line_item).activate
      ItemAdjustments.new(line_item).update
      reload_totals
      line_item
    end

    def update_cart(params)
      if order.update_attributes(params)
        order.line_items = order.line_items.select {|li| li.quantity > 0 }
        # Update totals, then check if the order is eligible for any cart promotions.
        # If we do not update first, then the item total will be wrong and ItemTotal
        # promotion rules would not be triggered.
        reload_totals
        PromotionHandler::Cart.new(order).activate
        order.ensure_updated_shipments
        reload_totals
        true
      else
        false
      end
    end

    private
      def order_updater
        @updater ||= OrderUpdater.new(order)
      end

      def reload_totals
        order_updater.update_item_count
        order_updater.update
        order.reload
      end

      def add_to_line_item(variant, quantity, currency=nil, shipment=nil)
        line_item = grab_line_item_by_variant(variant)

        if line_item
          line_item.target_shipment = shipment
          line_item.quantity += quantity.to_i
          line_item.currency = currency unless currency.nil?
        else
          line_item = order.line_items.new(quantity: quantity, variant: variant)
          line_item.target_shipment = shipment
          if currency
            line_item.currency = currency
            line_item.price    = variant.price_in(currency).amount
          else
            line_item.price    = variant.price
          end
        end

        line_item.save
        line_item
      end

      def remove_from_line_item(variant, quantity, shipment=nil)
        line_item = grab_line_item_by_variant(variant, true)
        line_item.quantity -= quantity
        line_item.target_shipment= shipment

        if line_item.quantity == 0
          line_item.destroy
        else
          line_item.save!
        end

        line_item
      end

      def grab_line_item_by_variant(variant, raise_error = false)
        line_item = order.find_line_item_by_variant(variant)

        if !line_item.present? && raise_error
          raise ActiveRecord::RecordNotFound, "Line item not found for variant #{variant.sku}"
        end

        line_item
      end
  end
end


text:
package org.burroloco.butcher.fixture.http;

import au.net.netstorm.boost.bullet.primordial.Primordial;

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

public final class HttpRequest extends Primordial {
    Map<String, Object> params = new HashMap<String, Object>();
    String payload;

    public HttpRequest(Map<String, Object> params, String payload) {
        this.params = params;
        this.payload = payload;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public String getPayload() {
        return payload;
    }
}


text:
==============================
# Questionário profissionais
==============================

==========
## Não feito
==========

* LIMITAÇÃO - Versão em Português está com nome do questionário em espanhol. Justificativa: Ferramenta não permite.
* LIMITAÇÃO - Em que contexto você realiza triagem e intervenção breve? No desdobramento dessa questão as opções de saúde, educação não foram modificadas para respostas múltiplas.

==========
## Feito
==========

* FEITO - * A pergunta quais são os instrumentos utilizados continua depois das perguntas de referenciamento. Continua fora de ordem.
   * A FAZER: 1. Repetir a questão "Quais os instrumentos de triagem que são utilizados nas suas abordagens?" logo após a pergunta "Você utiliza algum questionário de triagem (AUDIT, ASSIST, CAGE, DUSI, FAGERSTROM) para perguntar sobre o consumo de drogas?"
* FEITO - Quais os instrumentos de triagem que são utilizados nas suas abordagens? Essa pergunta está aparecendo duas vezes para quem faz IB e triagem na rotina de trabalho.
* FEITO - Você realiza triagem e intervenção breve para o consumo de drogas no seu dia a dia de trabalho? Quando não, as 3 perguntas abaixo não deveriam aparecer na sequência: *Você utiliza cartilhas ou folders informativo como material de apoio à intervenção breve? *Você faz algum tipo de acompanhamento de usuários que receberam intervenção breve? *Qual a população-alvo que você realiza triagem e Intervenção Breve?
* FEITO - Quais são as substâncias abordadas? Uma das respostas Cocaína fumável (Ex: crack, cocaína e basuco). Está correto desta forma?
* FEITO - Mudar definição do DUSI: Inventário de triagem do uso de drogas - Inventário de triagem do uso de drogas para adolescentes.
* FEITO -A palavra canto está estranha...rsrs...Mudar cabeçalho - Canto superior direito - parte superior da pagina
* FEITO - Setor que realiza triagem e IB (Ex, educação, saúde...) não pode ser respostas múltiplas?
* FEITO - Questão "qual a população que você realizada triagem e IB" Mudar para: Em qual população você realiza triagem e IB? Mudar também a opção de resposta usuários em ambiente de trabalho para Ambiente de trabalho.
* FEITO Mudar definição do AUDIT. Retirar a palavra distúrbio e colocar Teste de Identificação de Problemas Associados ao Uso de Álcool.
* FEITO - Cocaína fumada: Talvez seria melhor retirar "e" basuco e colocar (Ex: crack, cocaína, basuco). Por que o respondente pode achar que estamos perguntando só sobre essas 3 opções. E pode ser que ele use merla, por exemplo. Ou utilize algum nome com variações regionais para se referir a mesma substância...
* FEITO - Você faz algum tipo de acompanhamento dos usuários que passaram por triagem...?....Substituir passaram por receberam.
* FEITO - Quais são os procedimentos adotados para casos de baixo risco? Padronizar nas opções e resposta a palavra SEM. Uma pergunta está SEM folder e na pergunta seguinte *sem* folder.
* FEITO - Pensar melhor sobre as opções de resposta sobre a frequência do acompanhamento
* FEITO - Qual a carga horária da capacitação? Acrescentar: ou do total das capacitações realizadas quando mais de uma.
* FEITO - Inserir nota no início do questionário: Este questionário está disponível em dois idiomas. Confira as opções na base superior da página.

==============================
# Questionário dos centros
==============================

==========
## Não feito
==========

- Fundir os questionários usando uma questão x.

==========
## Feito
==========

* FEITO - No questionário dos centros vamos manter os dados pessoais como "required"? Tenho receio das pessoas que não quiserem se identificar não responderem. - Resposta - Não.
* FEITO - Os dados pessoais estão como preenchimento obrigatório. Não seria melhor colocar como opcional? Fico com receio das pessoas não responderam pq são obrigadas para passar tel, por exemplo.
* FEITO - Mudar definição do DUSI: Inventário de triagem do uso de drogas -
* FEITO - Durante a capacitação, os alunos treinaram o uso de instrumentos de triagem como (AUDIT, ASSIST, CAGE, DUSI, FAGERSTROM)
* FEITO - Na pergunta Qué tipo de recursos son utilizados? a primeira opção está em branco
* FEITO - A palavra canto está estranha...rsrs...Mudar cabeçalho - Canto superior direito - parte superior da pagina
* FEITO - Cabeçalho - destacar frase II e III. Retirar ponto final extra na última frase.
* FEITO - Quando a capacitação foi desenvolvida? As setas nesta questão estão passando de um a um. Não seria melhor tirar? Ou mostrar os anos em não números individuais?
	       COMENTÁRIO: Não é possível. No entanto, a pessoa pode digitar livremente o ano.
* FEITO - Qual é a carga horária da capacitação? Adicionar a palavra total = Qual a carga horária total da capacitação?
* FEITO - Qual (is) é/são .... está estranho. Sugiro deixar só no singular
* FEITO - O centro de formação conta com o aval ...? sugiro substituir aval por apoio.
* FEITO - O centro de formação oferece formação continuada? Adicionar opções de resposta sim/não. Se sim, como?
* FEITO - Qual setor o centro de formação pertence? Tb está estranho temos que mudar.
* FEITO - Antes dos dados de identificação inserir mensagem explicando o porquê desses dados.
* FEITO - Sugestão para conversarmos depois: adicionar perguntas sobre quais os módulos da capacitação e se teve um especifico sobre IB
* FEITO - Defina aproximadamente quantas pessoas foram categorizadas por categoria?? As opções de resposta não batem. Está confuso. Acho que seria melhor desmembrar em duas questões. Mudar também nas opções de resposta docência por docente. RESPOSTA: Não encontramos forma melhor de criar as categorias. :(


text:
// notice_start

// notice_end

import * as esp from '../../src';

describe('Router', () => {

    let _router;

    beforeEach(() => {
        _router = new esp.Router();
        _router.addModel('modelId1', {});
        _router.getEventObservable('modelId1', 'startEvent').subscribe(() => {
        });
        _router.getModelObservable('modelId1').subscribe(m => {
        });
    });

    describe('diagnostics', () => {

        it('when enableDiagnostics called getDispatchLoopDiagnostics returns diagnostics', ()=> {
            _router.enableDiagnosticLogging = true;
            _router.publishEvent('modelId1', 'startEvent', {});
            let dispatchLoopDiagnostics = _router.getDispatchLoopDiagnostics();
            expect(dispatchLoopDiagnostics).toBeDefined();
        });

        it('when enableDiagnostics called getDispatchLoopDiagnostics returns diagnostics', ()=> {
            _router.enableDiagnosticLogging = true;
            _router.publishEvent('modelId1', 'startEvent', {});
            _router.enableDiagnosticLogging = false;
            _router.publishEvent('modelId1', 'startEvent', {});
            expect(_router.getDispatchLoopDiagnostics()).toEqual('Call router.enableDiagnostics() to enable diagnostics. If in a browser use esp-js-devtools.');
        });
    });
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Riv. Patol. veg. , Pavia, sér. 3 4: 424 (1964)

#### Original name
Benedekiella oxycocci Negru & Verona

### Remarks
null


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler

try:
    from ansible.modules.network.fortios import fortios_wireless_controller_timers
except ImportError:
    pytest.skip("Could not load required modules for testing", allow_module_level=True)

@pytest.fixture(autouse=True)
def connection_mock(mocker):
    connection_class_mock = mocker.patch('ansible.modules.network.fortios.fortios_wireless_controller_timers.Connection')
    return connection_class_mock

fos_instance = FortiOSHandler(connection_mock)

def test_wireless_controller_timers_creation(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'wireless_controller_timers': {
            'ble_scan_report_intv': '3',
            'client_idle_timeout': '4',
            'darrp_day': 'sunday',
            'darrp_optimize': '6',
            'discovery_interval': '7',
            'echo_interval': '8',
            'fake_ap_log': '9',
            'ipsec_intf_cleanup': '10',
            'radio_stats_interval': '11',
            'rogue_ap_log': '12',
            'sta_capability_interval': '13',
            'sta_locate_timer': '14',
            'sta_stats_interval': '15',
            'vap_stats_interval': '16'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_wireless_controller_timers.fortios_wireless_controller(input_data, fos_instance)

    expected_data = {
        'ble-scan-report-intv': '3',
        'client-idle-timeout': '4',
        'darrp-day': 'sunday',
        'darrp-optimize': '6',
        'discovery-interval': '7',
        'echo-interval': '8',
        'fake-ap-log': '9',
        'ipsec-intf-cleanup': '10',
        'radio-stats-interval': '11',
        'rogue-ap-log': '12',
        'sta-capability-interval': '13',
        'sta-locate-timer': '14',
        'sta-stats-interval': '15',
        'vap-stats-interval': '16'
    }

    set_method_mock.assert_called_with('wireless-controller', 'timers', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert changed
    assert response['status'] == 'success'
    assert response['http_status'] == 200

def test_wireless_controller_timers_creation_fails(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'wireless_controller_timers': {
            'ble_scan_report_intv': '3',
            'client_idle_timeout': '4',
            'darrp_day': 'sunday',
            'darrp_optimize': '6',
            'discovery_interval': '7',
            'echo_interval': '8',
            'fake_ap_log': '9',
            'ipsec_intf_cleanup': '10',
            'radio_stats_interval': '11',
            'rogue_ap_log': '12',
            'sta_capability_interval': '13',
            'sta_locate_timer': '14',
            'sta_stats_interval': '15',
            'vap_stats_interval': '16'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_wireless_controller_timers.fortios_wireless_controller(input_data, fos_instance)

    expected_data = {
        'ble-scan-report-intv': '3',
        'client-idle-timeout': '4',
        'darrp-day': 'sunday',
        'darrp-optimize': '6',
        'discovery-interval': '7',
        'echo-interval': '8',
        'fake-ap-log': '9',
        'ipsec-intf-cleanup': '10',
        'radio-stats-interval': '11',
        'rogue-ap-log': '12',
        'sta-capability-interval': '13',
        'sta-locate-timer': '14',
        'sta-stats-interval': '15',
        'vap-stats-interval': '16'
    }

    set_method_mock.assert_called_with('wireless-controller', 'timers', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert is_error
    assert not changed
    assert response['status'] == 'error'
    assert response['http_status'] == 500

def test_wireless_controller_timers_idempotent(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'wireless_controller_timers': {
            'ble_scan_report_intv': '3',
            'client_idle_timeout': '4',
            'darrp_day': 'sunday',
            'darrp_optimize': '6',
            'discovery_interval': '7',
            'echo_interval': '8',
            'fake_ap_log': '9',
            'ipsec_intf_cleanup': '10',
            'radio_stats_interval': '11',
            'rogue_ap_log': '12',
            'sta_capability_interval': '13',
            'sta_locate_timer': '14',
            'sta_stats_interval': '15',
            'vap_stats_interval': '16'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_wireless_controller_timers.fortios_wireless_controller(input_data, fos_instance)

    expected_data = {
        'ble-scan-report-intv': '3',
        'client-idle-timeout': '4',
        'darrp-day': 'sunday',
        'darrp-optimize': '6',
        'discovery-interval': '7',
        'echo-interval': '8',
        'fake-ap-log': '9',
        'ipsec-intf-cleanup': '10',
        'radio-stats-interval': '11',
        'rogue-ap-log': '12',
        'sta-capability-interval': '13',
        'sta-locate-timer': '14',
        'sta-stats-interval': '15',
        'vap-stats-interval': '16'
    }

    set_method_mock.assert_called_with('wireless-controller', 'timers', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert not changed
    assert response['status'] == 'error'
    assert response['http_status'] == 404

def test_wireless_controller_timers_filter_foreign_attributes(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'wireless_controller_timers': {
            'random_attribute_not_valid': 'tag',
            'ble_scan_report_intv': '3',
            'client_idle_timeout': '4',
            'darrp_day': 'sunday',
            'darrp_optimize': '6',
            'discovery_interval': '7',
            'echo_interval': '8',
            'fake_ap_log': '9',
            'ipsec_intf_cleanup': '10',
            'radio_stats_interval': '11',
            'rogue_ap_log': '12',
            'sta_capability_interval': '13',
            'sta_locate_timer': '14',
            'sta_stats_interval': '15',
            'vap_stats_interval': '16'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_wireless_controller_timers.fortios_wireless_controller(input_data, fos_instance)

    expected_data = {
        'ble-scan-report-intv': '3',
        'client-idle-timeout': '4',
        'darrp-day': 'sunday',
        'darrp-optimize': '6',
        'discovery-interval': '7',
        'echo-interval': '8',
        'fake-ap-log': '9',
        'ipsec-intf-cleanup': '10',
        'radio-stats-interval': '11',
        'rogue-ap-log': '12',
        'sta-capability-interval': '13',
        'sta-locate-timer': '14',
        'sta-stats-interval': '15',
        'vap-stats-interval': '16'
    }

    set_method_mock.assert_called_with('wireless-controller', 'timers', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert changed
    assert response['status'] == 'success'
    assert response['http_status'] == 200


text:
#ifndef __GTK_LIST_BOX_H__
#define __GTK_LIST_BOX_H__

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkbin.h>

G_BEGIN_DECLS

#define GTK_TYPE_LIST_BOX (gtk_list_box_get_type ())
#define GTK_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX, GtkListBox))
#define GTK_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_BOX, GtkListBoxClass))
#define GTK_IS_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX))
#define GTK_IS_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_BOX))
#define GTK_LIST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_BOX, GtkListBoxClass))

typedef struct _GtkListBox        GtkListBox;
typedef struct _GtkListBoxClass   GtkListBoxClass;

typedef struct _GtkListBoxRow        GtkListBoxRow;
typedef struct _GtkListBoxRowClass   GtkListBoxRowClass;

struct _GtkListBox
{
  GtkContainer parent_instance;
};

/**
 * GtkListBoxClass:
 * @parent_class: The parent class.
 * @row_selected: Class handler for the #GtkListBox::row-selected signal
 * @row_activated: Class handler for the #GtkListBox::row-activated signal
 * @activate_cursor_row: Class handler for the #GtkListBox::activate-cursor-row signal
 * @toggle_cursor_row: Class handler for the #GtkListBox::activate-cursor-row signal
 * @move_cursor: Class handler for the #GtkListBox::move-cursor signal
 * @selected_rows_changed: Class handler for the #GtkListBox::selected-rows-changed signal
 * @select_all: Class handler for the #GtkListBox::select-all signal
 * @unselect_all: Class handler for the #GtkListBox::unselect-all signal
 */
struct _GtkListBoxClass
{
  GtkContainerClass parent_class;

  /*< public >*/

  void (*row_selected)        (GtkListBox      *box,
                               GtkListBoxRow   *row);
  void (*row_activated)       (GtkListBox      *box,
                               GtkListBoxRow   *row);
  void (*activate_cursor_row) (GtkListBox      *box);
  void (*toggle_cursor_row)   (GtkListBox      *box);
  void (*move_cursor)         (GtkListBox      *box,
                               GtkMovementStep  step,
                               gint             count);
  void (*selected_rows_changed) (GtkListBox    *box);
  void (*select_all)            (GtkListBox    *box);
  void (*unselect_all)          (GtkListBox    *box);

  /*< private >*/

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
};

#define GTK_TYPE_LIST_BOX_ROW            (gtk_list_box_row_get_type ())
#define GTK_LIST_BOX_ROW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRow))
#define GTK_LIST_BOX_ROW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRowClass))
#define GTK_IS_LIST_BOX_ROW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_BOX_ROW))
#define GTK_IS_LIST_BOX_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_BOX_ROW))
#define GTK_LIST_BOX_ROW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_BOX_ROW, GtkListBoxRowClass))

struct _GtkListBoxRow
{
  GtkBin parent_instance;
};

/**
 * GtkListBoxRowClass:
 * @parent_class: The parent class.
 * @activate:
 */
struct _GtkListBoxRowClass
{
  GtkBinClass parent_class;

  /*< public >*/

  void (* activate) (GtkListBoxRow *row);

  /*< private >*/

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
};

/**
 * GtkListBoxFilterFunc:
 * @row: the row that may be filtered
 * @user_data: (closure): user data
 *
 * Will be called whenever the row changes or is added and lets you control
 * if the row should be visible or not.
 *
 * Returns: %TRUE if the row should be visible, %FALSE otherwise
 *
 * Since: 3.10
 */
typedef gboolean (*GtkListBoxFilterFunc) (GtkListBoxRow *row,
                                          gpointer       user_data);

/**
 * GtkListBoxSortFunc:
 * @row1: the first row
 * @row2: the second row
 * @user_data: (closure): user data
 *
 * Compare two rows to determine which should be first.
 *
 * Returns: < 0 if @row1 should be before @row2, 0 if they are
 *     equal and > 0 otherwise
 *
 * Since: 3.10
 */
typedef gint (*GtkListBoxSortFunc) (GtkListBoxRow *row1,
                                    GtkListBoxRow *row2,
                                    gpointer       user_data);

/**
 * GtkListBoxUpdateHeaderFunc:
 * @row: the row to update
 * @before: (allow-none): the row before @row, or %NULL if it is first
 * @user_data: (closure): user data
 *
 * Whenever @row changes or which row is before @row changes this
 * is called, which lets you update the header on @row. You may
 * remove or set a new one via gtk_list_box_row_set_header() or
 * just change the state of the current header widget.
 *
 * Since: 3.10
 */
typedef void (*GtkListBoxUpdateHeaderFunc) (GtkListBoxRow *row,
                                            GtkListBoxRow *before,
                                            gpointer       user_data);

/**
 * GtkListBoxCreateWidgetFunc:
 * @item: (type GObject): the item from the model for which to create a widget for
 * @user_data: (closure): user data
 *
 * Called for list boxes that are bound to a #GListModel with
 * gtk_list_box_bind_model() for each item that gets added to the model.
 *
 * Returns: (transfer full): a #GtkWidget that represents @item
 *
 * Since: 3.16
 */
typedef GtkWidget * (*GtkListBoxCreateWidgetFunc) (gpointer item,
                                                   gpointer user_data);

GDK_AVAILABLE_IN_3_10
GType      gtk_list_box_row_get_type      (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_10
GtkWidget* gtk_list_box_row_new           (void);
GDK_AVAILABLE_IN_3_10
GtkWidget* gtk_list_box_row_get_header    (GtkListBoxRow *row);
GDK_AVAILABLE_IN_3_10
void       gtk_list_box_row_set_header    (GtkListBoxRow *row,
                                           GtkWidget     *header);
GDK_AVAILABLE_IN_3_10
gint       gtk_list_box_row_get_index     (GtkListBoxRow *row);
GDK_AVAILABLE_IN_3_10
void       gtk_list_box_row_changed       (GtkListBoxRow *row);

GDK_AVAILABLE_IN_3_14
gboolean   gtk_list_box_row_is_selected   (GtkListBoxRow *row);

GDK_AVAILABLE_IN_3_14
void       gtk_list_box_row_set_selectable (GtkListBoxRow *row,
                                            gboolean       selectable);
GDK_AVAILABLE_IN_3_14
gboolean   gtk_list_box_row_get_selectable (GtkListBoxRow *row);

GDK_AVAILABLE_IN_3_14
void       gtk_list_box_row_set_activatable (GtkListBoxRow *row,
                                             gboolean       activatable);
GDK_AVAILABLE_IN_3_14
gboolean   gtk_list_box_row_get_activatable (GtkListBoxRow *row);

GDK_AVAILABLE_IN_3_10
GType          gtk_list_box_get_type                     (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_prepend                      (GtkListBox                    *box,
                                                          GtkWidget                     *child);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_insert                       (GtkListBox                    *box,
                                                          GtkWidget                     *child,
                                                          gint                           position);
GDK_AVAILABLE_IN_3_10
GtkListBoxRow* gtk_list_box_get_selected_row             (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
GtkListBoxRow* gtk_list_box_get_row_at_index             (GtkListBox                    *box,
                                                          gint                           index_);
GDK_AVAILABLE_IN_3_10
GtkListBoxRow* gtk_list_box_get_row_at_y                 (GtkListBox                    *box,
                                                          gint                           y);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_select_row                   (GtkListBox                    *box,
                                                          GtkListBoxRow                 *row);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_placeholder              (GtkListBox                    *box,
                                                          GtkWidget                     *placeholder);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_adjustment               (GtkListBox                    *box,
                                                          GtkAdjustment                 *adjustment);
GDK_AVAILABLE_IN_3_10
GtkAdjustment *gtk_list_box_get_adjustment               (GtkListBox                    *box);

typedef void (* GtkListBoxForeachFunc) (GtkListBox      *box,
                                        GtkListBoxRow   *row,
                                        gpointer         user_data);

GDK_AVAILABLE_IN_3_14
void           gtk_list_box_selected_foreach             (GtkListBox                    *box,
                                                          GtkListBoxForeachFunc          func,
                                                          gpointer                       data);
GDK_AVAILABLE_IN_3_14
GList         *gtk_list_box_get_selected_rows            (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_14
void           gtk_list_box_unselect_row                 (GtkListBox                    *box,
                                                          GtkListBoxRow                 *row);
GDK_AVAILABLE_IN_3_14
void           gtk_list_box_select_all                   (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_14
void           gtk_list_box_unselect_all                 (GtkListBox                    *box);

GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_selection_mode           (GtkListBox                    *box,
                                                          GtkSelectionMode               mode);
GDK_AVAILABLE_IN_3_10
GtkSelectionMode gtk_list_box_get_selection_mode         (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_filter_func              (GtkListBox                    *box,
                                                          GtkListBoxFilterFunc           filter_func,
                                                          gpointer                       user_data,
                                                          GDestroyNotify                 destroy);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_header_func              (GtkListBox                    *box,
                                                          GtkListBoxUpdateHeaderFunc     update_header,
                                                          gpointer                       user_data,
                                                          GDestroyNotify                 destroy);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_invalidate_filter            (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_invalidate_sort              (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_invalidate_headers           (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_sort_func                (GtkListBox                    *box,
                                                          GtkListBoxSortFunc             sort_func,
                                                          gpointer                       user_data,
                                                          GDestroyNotify                 destroy);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_set_activate_on_single_click (GtkListBox                    *box,
                                                          gboolean                       single);
GDK_AVAILABLE_IN_3_10
gboolean       gtk_list_box_get_activate_on_single_click (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_drag_unhighlight_row         (GtkListBox                    *box);
GDK_AVAILABLE_IN_3_10
void           gtk_list_box_drag_highlight_row           (GtkListBox                    *box,
                                                          GtkListBoxRow                 *row);
GDK_AVAILABLE_IN_3_10
GtkWidget*     gtk_list_box_new                          (void);

GDK_AVAILABLE_IN_3_16
void           gtk_list_box_bind_model                   (GtkListBox                   *box,
                                                          GListModel                   *model,
                                                          GtkListBoxCreateWidgetFunc    create_widget_func,
                                                          gpointer                      user_data,
                                                          GDestroyNotify                user_data_free_func);

G_END_DECLS

#endif


text:
package com.saraighatsoftware.flexicalculator;

import java.util.HashMap;

class OperatorFinder {

    // map of operator symbols vs operators
    private final HashMap<String, Operator> mOperators;

    OperatorFinder() {
        Operator operators[] = Operator.values();
        mOperators = new HashMap<>();
        for (Operator operator : operators) {
            mOperators.put(operator.Symbol(), operator);
        }
    }

    Operator Get(final String symbol) {
        return mOperators.get(symbol);
    }

    static Operator[] GetAll() {
        return Operator.values();
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class basic_parsed_options<wchar_t></title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../program_options/reference.html#header.boost.program_options.parsers_hpp" title="Header <boost/program_options/parsers.hpp>">
<link rel="prev" href="basic_parsed_options.html" title="Class template basic_parsed_options">
<link rel="next" href="collect_unrecognized_mode.html" title="Type collect_unrecognized_mode">

Home
Libraries
People
FAQ
More

Class basic_parsed_options<wchar_t>

boost::program_options::basic_parsed_options<wchar_t>

Synopsis

// In header: <boost/program_options/parsers.hpp>

class basic_parsed_options<wchar_t> {
public:
  // construct/copy/destruct
  explicit basic_parsed_options(const basic_parsed_options< char > &);

  // public data members
  std::vector< basic_option< wchar_t > > options;
  const options_description * description;
  basic_parsed_options< char > utf8_encoded_options;
  int m_options_prefix;
};

Description

Specialization of basic_parsed_options which:

provides convenient conversion from basic_parsed_options<char>

stores the passed char-based options for later use.

basic_parsed_options
        public
       construct/copy/destruct

explicit basic_parsed_options(const basic_parsed_options< char > & po);

Constructs wrapped options from options in UTF8 encoding.

basic_parsed_options
        public
       public data members

basic_parsed_options< char > utf8_encoded_options;

Stores UTF8 encoded options that were passed to constructor, to avoid reverse conversion in some cases.

int m_options_prefix;

Mainly used for the diagnostic messages in exceptions. The canonical option prefix for the parser which generated these results, depending on the settings for basic_command_line_parser::style() or cmdline::style(). In order of precedence of command_line_style enums: allow_long allow_long_disguise allow_dash_for_short allow_slash_for_short

Copyright © 2002-2004 Vladimir Prus
Distributed under the Boost Software License, Version 1.0.
      (See accompanying file LICENSE_1_0.txt or copy at
      http://www.boost.org/LICENSE_1_0.txt)


text:
package controllers

import play.api._
import play.api.mvc._

object Application extends Controller {

  def index(hora: Int) = Action {
    var msg = ""
    if(hora >= 0 && hora < 12) msg = "manhã"
    else if(hora < 18) msg = "tarde"
    else if(hora < 24) msg = "noite"
    else msg = "hora inválida"

    Ok(views.html.index(hora, msg))
  }

}


text:
Witaj w panelu admina

Jeżeli chcesz zresetować grę wciśnij poniższy link.

Wszystkie dane graczy zostaną usunięte, pozostaną tylko konta administratorów.

<?php
if(isset($_GET['resetuj'])){
	call("delete from driver_gracze where rola = 0");
	call("truncate table czat");
	call("truncate table auta_gracze");
	call("truncate table wiadomosci");
	call("update driver_gracze set pozycja = 0");
	echo "zresetowano grę";
}
?>

RESET