text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
 <drawable name="white">#FFFFFF</drawable>
 <drawable name="yellow">#FFFF00</drawable>
 <drawable name="fuchsia">#FF00FF</drawable>
 <drawable name="red">#FF0000</drawable>
 <drawable name="silver">#C0C0C0</drawable>
 <drawable name="gray">#808080</drawable>
 <drawable name="olive">#808000</drawable>
 <drawable name="purple">#800080</drawable>
 <drawable name="maroon">#800000</drawable>
 <drawable name="aqua">#00FFFF</drawable>
 <drawable name="lime">#00FF00</drawable>
 <drawable name="teal">#008080</drawable>
 <drawable name="green">#008000</drawable>
 <drawable name="blue">#0000FF</drawable>
 <drawable name="navy">#000080</drawable>
 <drawable name="black">#000000</drawable>

 <drawable name="White">#FFFFFF</drawable>
 <drawable name="Ivory">#FFFFF0</drawable>
 <drawable name="LightYellow">#FFFFE0</drawable>
 <drawable name="Yellow">#FFFF00</drawable>
 <drawable name="Snow">#FFFAFA</drawable>
 <drawable name="FloralWhite">#FFFAF0</drawable>
 <drawable name="LemonChiffon">#FFFACD</drawable>
 <drawable name="Cornsilk">#FFF8DC</drawable>
 <drawable name="Seashell">#FFF5EE</drawable>
 <drawable name="LavenderBlush">#FFF0F5</drawable>
 <drawable name="PapayaWhip">#FFEFD5</drawable>
 <drawable name="BlanchedAlmond">#FFEBCD</drawable>
 <drawable name="MistyRose">#FFE4E1</drawable>
 <drawable name="Bisque">#FFE4C4</drawable>
 <drawable name="Moccasin">#FFE4B5</drawable>
 <drawable name="NavajoWhite">#FFDEAD</drawable>
 <drawable name="PeachPuff">#FFDAB9</drawable>
 <drawable name="Gold">#FFD700</drawable>
 <drawable name="Pink">#FFC0CB</drawable>
 <drawable name="LightPink">#FFB6C1</drawable>
 <drawable name="Orange">#FFA500</drawable>
 <drawable name="LightSalmon">#FFA07A</drawable>
 <drawable name="DarkOrange">#FF8C00</drawable>
 <drawable name="Coral">#FF7F50</drawable>
 <drawable name="HotPink">#FF69B4</drawable>
 <drawable name="Tomato">#FF6347</drawable>
 <drawable name="OrangeRed">#FF4500</drawable>
 <drawable name="DeepPink">#FF1493</drawable>
 <drawable name="Fuchsia">#FF00FF</drawable>
 <drawable name="Magenta">#FF00FF</drawable>
 <drawable name="Red">#FF0000</drawable>
 <drawable name="OldLace">#FDF5E6</drawable>
 <drawable name="LightGoldenrodYellow">#FAFAD2</drawable>
 <drawable name="Linen">#FAF0E6</drawable>
 <drawable name="AntiqueWhite">#FAEBD7</drawable>
 <drawable name="Salmon">#FA8072</drawable>
 <drawable name="GhostWhite">#F8F8FF</drawable>
 <drawable name="MintCream">#F5FFFA</drawable>
 <drawable name="WhiteSmoke">#F5F5F5</drawable>
 <drawable name="Beige">#F5F5DC</drawable>
 <drawable name="Wheat">#F5DEB3</drawable>
 <drawable name="SandyBrown">#F4A460</drawable>
 <drawable name="Azure">#F0FFFF</drawable>
 <drawable name="Honeydew">#F0FFF0</drawable>
 <drawable name="AliceBlue">#F0F8FF</drawable>
 <drawable name="Khaki">#F0E68C</drawable>
 <drawable name="LightCoral">#F08080</drawable>
 <drawable name="PaleGoldenrod">#EEE8AA</drawable>
 <drawable name="Violet">#EE82EE</drawable>
 <drawable name="DarkSalmon">#E9967A</drawable>
 <drawable name="Lavender">#E6E6FA</drawable>
 <drawable name="LightCyan">#E0FFFF</drawable>
 <drawable name="BurlyWood">#DEB887</drawable>
 <drawable name="Plum">#DDA0DD</drawable>
 <drawable name="Gainsboro">#DCDCDC</drawable>
 <drawable name="Crimson">#DC143C</drawable>
 <drawable name="PaleVioletRed">#DB7093</drawable>
 <drawable name="Goldenrod">#DAA520</drawable>
 <drawable name="Orchid">#DA70D6</drawable>
 <drawable name="Thistle">#D8BFD8</drawable>
 <drawable name="LightGrey">#D3D3D3</drawable>
 <drawable name="Tan">#D2B48C</drawable>
 <drawable name="Chocolate">#D2691E</drawable>
 <drawable name="Peru">#CD853F</drawable>
 <drawable name="IndianRed">#CD5C5C</drawable>
 <drawable name="MediumVioletRed">#C71585</drawable>
 <drawable name="Silver">#C0C0C0</drawable>
 <drawable name="DarkKhaki">#BDB76B</drawable>
 <drawable name="RosyBrown">#BC8F8F</drawable>
 <drawable name="MediumOrchid">#BA55D3</drawable>
 <drawable name="DarkGoldenrod">#B8860B</drawable>
 <drawable name="FireBrick">#B22222</drawable>
 <drawable name="PowderBlue">#B0E0E6</drawable>
 <drawable name="LightSteelBlue">#B0C4DE</drawable>
 <drawable name="PaleTurquoise">#AFEEEE</drawable>
 <drawable name="GreenYellow">#ADFF2F</drawable>
 <drawable name="LightBlue">#ADD8E6</drawable>
 <drawable name="DarkGray">#A9A9A9</drawable>
 <drawable name="Brown">#A52A2A</drawable>
 <drawable name="Sienna">#A0522D</drawable>
 <drawable name="YellowGreen">#9ACD32</drawable>
 <drawable name="DarkOrchid">#9932CC</drawable>
 <drawable name="PaleGreen">#98FB98</drawable>
 <drawable name="DarkViolet">#9400D3</drawable>
 <drawable name="MediumPurple">#9370DB</drawable>
 <drawable name="LightGreen">#90EE90</drawable>
 <drawable name="DarkSeaGreen">#8FBC8F</drawable>
 <drawable name="SaddleBrown">#8B4513</drawable>
 <drawable name="DarkMagenta">#8B008B</drawable>
 <drawable name="DarkRed">#8B0000</drawable>
 <drawable name="BlueViolet">#8A2BE2</drawable>
 <drawable name="LightSkyBlue">#87CEFA</drawable>
 <drawable name="SkyBlue">#87CEEB</drawable>
 <drawable name="Gray">#808080</drawable>
 <drawable name="Olive">#808000</drawable>
 <drawable name="Purple">#800080</drawable>
 <drawable name="Maroon">#800000</drawable>
 <drawable name="Aquamarine">#7FFFD4</drawable>
 <drawable name="Chartreuse">#7FFF00</drawable>
 <drawable name="LawnGreen">#7CFC00</drawable>
 <drawable name="MediumSlateBlue">#7B68EE</drawable>
 <drawable name="LightSlateGray">#778899</drawable>
 <drawable name="SlateGray">#708090</drawable>
 <drawable name="OliveDrab">#6B8E23</drawable>
 <drawable name="SlateBlue">#6A5ACD</drawable>
 <drawable name="DimGray">#696969</drawable>
 <drawable name="MediumAquamarine">#66CDAA</drawable>
 <drawable name="CornflowerBlue">#6495ED</drawable>
 <drawable name="CadetBlue">#5F9EA0</drawable>
 <drawable name="DarkOliveGreen">#556B2F</drawable>
 <drawable name="Indigo">#4B0082</drawable>
 <drawable name="MediumTurquoise">#48D1CC</drawable>
 <drawable name="DarkSlateBlue">#483D8B</drawable>
 <drawable name="SteelBlue">#4682B4</drawable>
 <drawable name="RoyalBlue">#4169E1</drawable>
 <drawable name="Turquoise">#40E0D0</drawable>
 <drawable name="MediumSeaGreen">#3CB371</drawable>
 <drawable name="LimeGreen">#32CD32</drawable>
 <drawable name="DarkSlateGray">#2F4F4F</drawable>
 <drawable name="SeaGreen">#2E8B57</drawable>
 <drawable name="ForestGreen">#228B22</drawable>
 <drawable name="LightSeaGreen">#20B2AA</drawable>
 <drawable name="DodgerBlue">#1E90FF</drawable>
 <drawable name="MidnightBlue">#191970</drawable>
 <drawable name="Aqua">#00FFFF</drawable>
 <drawable name="Cyan">#00FFFF</drawable>
 <drawable name="SpringGreen">#00FF7F</drawable>
 <drawable name="Lime">#00FF00</drawable>
 <drawable name="MediumSpringGreen">#00FA9A</drawable>
 <drawable name="DarkTurquoise">#00CED1</drawable>
 <drawable name="DeepSkyBlue">#00BFFF</drawable>
 <drawable name="DarkCyan">#008B8B</drawable>
 <drawable name="Teal">#008080</drawable>
 <drawable name="Green">#008000</drawable>
 <drawable name="DarkGreen">#006400</drawable>
 <drawable name="Blue">#0000FF</drawable>
 <drawable name="MediumBlue">#0000CD</drawable>
 <drawable name="DarkBlue">#00008B</drawable>
 <drawable name="Navy">#000080</drawable>
 <drawable name="Black">#000000</drawable>
</resources>


text:
package eu.binjr.core.data.dirtyable;

import eu.binjr.common.javafx.bindings.BindingManager;
import eu.binjr.common.logging.Logger;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.Property;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;

import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import java.io.Closeable;
import java.lang.annotation.Annotation;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * A class that embeds the logic required to discover and track modification on object implementing {@link Dirtyable}
 *
 * @author Frederic Thevenet
 */
@XmlAccessorType(XmlAccessType.NONE)
public class ChangeWatcher implements Dirtyable, Closeable {
    private static final Logger logger = Logger.create(ChangeWatcher.class);
    private final BooleanProperty dirty = new SimpleBooleanProperty(false);
    private final List<WeakReference<ObservableList<? extends Dirtyable>>> watchedLists;
    private final BindingManager bindingManager = new BindingManager();

    private final ChangeListener<Boolean> dirtyableChangeListener = (observable, oldValue, newValue) -> {
        if (newValue) {
            forceDirty();
        }
    };

    /**
     * Initializes a new instance of the {@link ChangeWatcher} class for the specified source object
     *
     * @param source the object to watch for changes
     */
    public ChangeWatcher(Object source) {
        this.watchedLists = new ArrayList<>();
        List<Field> toWatch = getFieldsListWithAnnotation(source.getClass(), IsDirtyable.class);
        for (Field field : toWatch) {
            try {
                Object fieldValue = readField(field, source);
                if (fieldValue instanceof Property property) {
                    bindingManager.attachListener(property, (observable, oldValue, newValue) -> forceDirty());
                }
                if (fieldValue instanceof ObservableList) {
                    ParameterizedType pType = (ParameterizedType) field.getGenericType();
                    Type[] types = pType.getActualTypeArguments();
                    if (types != null) {
                        for (Type type : types) {
                            if (type instanceof ParameterizedType) {
                                type = ((ParameterizedType) type).getRawType();
                            }
                            if (Dirtyable.class.isAssignableFrom((Class<?>) type)) {
                                @SuppressWarnings("unchecked")
                                ObservableList<? extends Dirtyable> ol = (ObservableList<? extends Dirtyable>) fieldValue;
                                watchedLists.add(new WeakReference<>(ol));
                                ListChangeListener<Dirtyable> listChangeListener = (c -> {
                                    while (c.next()) {
                                        if (c.wasAdded()) {
                                            if (c.getAddedSize() > 0) {
                                                forceDirty();
                                            }
                                            for (Dirtyable dirtyable : c.getAddedSubList()) {
                                                evaluateDirty(dirtyable.isDirty());
                                                bindingManager.attachListener(dirtyable.dirtyProperty(), dirtyableChangeListener);
                                            }
                                        }
                                        if (c.wasRemoved()) {
                                            if (c.getRemovedSize() > 0) {
                                                forceDirty();
                                            }
                                            for (Dirtyable dirtyable : c.getRemoved()) {
                                                bindingManager.detachListener(dirtyable.dirtyProperty(), dirtyableChangeListener);
                                            }
                                        }
                                    }
                                });
                                bindingManager.attachListener(ol, listChangeListener);
                                break;
                            }
                        }
                    }
                }
            } catch (IllegalAccessException | ClassCastException e) {
                logger.error("Error reflecting dirtyable properties", e);
            }
        }
    }

    @Override
    public BooleanProperty dirtyProperty() {
        return dirty;
    }

    @Override
    public Boolean isDirty() {
        return dirty.getValue();
    }

    @Override
    public void cleanUp() {
        dirty.setValue(false);
        watchedLists.forEach(reference -> {
            var dirtyables = reference.get();
            if (dirtyables != null) {
                dirtyables.forEach(d -> {
                    if (d != null) {
                        d.cleanUp();
                    }
                });
            }
        });
    }

    private void evaluateDirty(Boolean isDirty) {
        this.dirty.setValue(dirty.getValue() | isDirty);
    }

    private void forceDirty() {
        dirty.setValue(true);
    }

    private Object readField(final Field field, final Object target) throws IllegalAccessException {
        if (field == null) {
            throw new IllegalArgumentException("The field must not be null");
        }
        field.trySetAccessible();
        return field.get(target);
    }

    private List<Field> getFieldsListWithAnnotation(final Class<?> cls, final Class<? extends Annotation> annotationCls) {
        if (annotationCls == null) {
            throw new IllegalArgumentException("The annotation class must not be null");
        }
        final List<Field> allFields = getAllFieldsList(cls);
        final List<Field> annotatedFields = new ArrayList<>();
        for (final Field field : allFields) {
            if (field.getAnnotation(annotationCls) != null) {
                annotatedFields.add(field);
            }
        }
        return annotatedFields;
    }

    private List<Field> getAllFieldsList(final Class<?> cls) {
        if (cls == null) {
            throw new IllegalArgumentException("The class must not be null");
        }
        final List<Field> allFields = new ArrayList<>();
        Class<?> currentClass = cls;
        while (currentClass != null) {
            final Field[] declaredFields = currentClass.getDeclaredFields();
            allFields.addAll(Arrays.asList(declaredFields));
            currentClass = currentClass.getSuperclass();
        }
        return allFields;
    }

    @Override
    public void close() {
        try {
            bindingManager.close();
        } catch (Exception e) {
            logger.warn("An error occurred while ChangeWatcher instance", e);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Codex\Addon\Auth\Socialite;

class SocialiteManager extends \Laravel\Socialite\SocialiteManager
{

    /**
     * Create an instance of the specified driver.
     *
     * @return \Laravel\Socialite\Two\AbstractProvider
     */
    protected function createGithubDriver()
    {
        return $this->buildProvider(
            'Codex\Addon\Auth\Socialite\GithubProvider', $this->getDriverConfig('github')
        );
    }
    /**
     * Create an instance of the specified driver.
     *
     * @return \Laravel\Socialite\One\AbstractProvider
     */
    protected function createBitbucketDriver()
    {
        return $this->buildProvider(BitbucketProvider::class, $this->getDriverConfig('bitbucket'));
    }

    protected function getDriverConfig($driver)
    {
        $config = $this->app[ 'config' ][ "codex-auth.providers.{$driver}" ];
        $uri    = $this->getCallbackUri($driver);
        if ( $driver === 'bitbucket' )
        {
            $config[ 'redirect' ] = $uri;
            $config               = $this->formatConfig($config);
        }
        else
        {
            $config[ 'redirect' ] = $uri;
        }
        return $config;
    }

    protected function getCallbackUri($driver)
    {
        return route("codex.auth.login.callback", compact('driver'));
    }

    /**
     * Format the server configuration.
     *
     * @param  array $config
     *
     * @return array
     */
    public function formatConfig(array $config)
    {
        return array_merge([
            'identifier'   => $config[ 'client_id' ],
            'secret'       => $config[ 'client_secret' ],
            'callback_uri' => $config[ 'redirect' ],
        ], $config);
    }

}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'toh-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
  constructor() { }

  ngOnInit(): void { }
}


text:
import warnings as _warnings
_warnings.resetwarnings()
_warnings.filterwarnings('error')

from tdi import html

template = html.from_string("""
<node tdi="item">
    <znode tdi="nested" tdi:overlay="foo">
        <ynode tdi="subnested"></ynode>
    </znode>
    <xnode tdi="a"></xnode>
</node>
""".lstrip()).overlay(html.from_string("""
<anode tdi="grumpf" tdi:overlay="-foo">
    <bnode tdi="gna"></bnode>
</anode>
""".lstrip()))

class Model(object):
    def render_nested(self, node):
        node['been'] = u'here'

    def render_gna(self, node):
        node.content = u"whoa!"

model = Model()
template.render(model)


text:
.class Lcom/android/server/am/UriPermission;
.super Ljava/lang/Object;
.source "UriPermission.java"

# instance fields
.field globalModeFlags:I

.field modeFlags:I

.field final readOwners:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet",
            "<",
            "Lcom/android/server/am/UriPermissionOwner;",
            ">;"
        }
    .end annotation
.end field

.field stringName:Ljava/lang/String;

.field final uid:I

.field final uri:Landroid/net/Uri;

.field final writeOwners:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet",
            "<",
            "Lcom/android/server/am/UriPermissionOwner;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method constructor <init>(ILandroid/net/Uri;)V
    .locals 1
    .parameter "_uid"
    .parameter "_uri"

    .prologue
    const/4 v0, 0x0

    .line 43
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 36
    iput v0, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    .line 37
    iput v0, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    .line 38
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    .line 39
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/android/server/am/UriPermission;->writeOwners:Ljava/util/HashSet;

    .line 44
    iput p1, p0, Lcom/android/server/am/UriPermission;->uid:I

    .line 45
    iput-object p2, p0, Lcom/android/server/am/UriPermission;->uri:Landroid/net/Uri;

    .line 46
    return-void
.end method

# virtual methods
.method clearModes(I)V
    .locals 3
    .parameter "modeFlagsToClear"

    .prologue
    .line 49
    and-int/lit8 v2, p1, 0x1

    if-eqz v2, :cond_1

    .line 50
    iget v2, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    and-int/lit8 v2, v2, -0x2

    iput v2, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    .line 51
    iget v2, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    and-int/lit8 v2, v2, -0x2

    iput v2, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    .line 52
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->size()I

    move-result v2

    if-lez v2, :cond_1

    .line 53
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/server/am/UriPermissionOwner;

    .line 54
    .local v1, r:Lcom/android/server/am/UriPermissionOwner;
    invoke-virtual {v1, p0}, Lcom/android/server/am/UriPermissionOwner;->removeReadPermission(Lcom/android/server/am/UriPermission;)V

    goto :goto_0

    .line 56
    .end local v1           #r:Lcom/android/server/am/UriPermissionOwner;
    :cond_0
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->clear()V

    .line 59
    .end local v0           #i$:Ljava/util/Iterator;
    :cond_1
    and-int/lit8 v2, p1, 0x2

    if-eqz v2, :cond_3

    .line 60
    iget v2, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    and-int/lit8 v2, v2, -0x3

    iput v2, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    .line 61
    iget v2, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    and-int/lit8 v2, v2, -0x3

    iput v2, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    .line 62
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->size()I

    move-result v2

    if-lez v2, :cond_3

    .line 63
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->writeOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .restart local v0       #i$:Ljava/util/Iterator;
    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_2

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/server/am/UriPermissionOwner;

    .line 64
    .restart local v1       #r:Lcom/android/server/am/UriPermissionOwner;
    invoke-virtual {v1, p0}, Lcom/android/server/am/UriPermissionOwner;->removeWritePermission(Lcom/android/server/am/UriPermission;)V

    goto :goto_1

    .line 66
    .end local v1           #r:Lcom/android/server/am/UriPermissionOwner;
    :cond_2
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->clear()V

    .line 69
    .end local v0           #i$:Ljava/util/Iterator;
    :cond_3
    return-void
.end method

.method dump(Ljava/io/PrintWriter;Ljava/lang/String;)V
    .locals 3
    .parameter "pw"
    .parameter "prefix"

    .prologue
    .line 85
    invoke-virtual {p1, p2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string v2, "modeFlags=0x"

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 86
    iget v2, p0, Lcom/android/server/am/UriPermission;->modeFlags:I

    invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 87
    const-string v2, " uid="

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget v2, p0, Lcom/android/server/am/UriPermission;->uid:I

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(I)V

    .line 88
    const-string v2, " globalModeFlags=0x"

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 89
    iget v2, p0, Lcom/android/server/am/UriPermission;->globalModeFlags:I

    invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 90
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->size()I

    move-result v2

    if-eqz v2, :cond_0

    .line 91
    invoke-virtual {p1, p2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string v2, "readOwners:"

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 92
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->readOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/server/am/UriPermissionOwner;

    .line 93
    .local v1, owner:Lcom/android/server/am/UriPermissionOwner;
    invoke-virtual {p1, p2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string v2, "  * "

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    invoke-virtual {p1, v1}, Ljava/io/PrintWriter;->println(Ljava/lang/Object;)V

    goto :goto_0

    .line 96
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v1           #owner:Lcom/android/server/am/UriPermissionOwner;
    :cond_0
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->writeOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->size()I

    move-result v2

    if-eqz v2, :cond_1

    .line 97
    invoke-virtual {p1, p2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string v2, "writeOwners:"

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 98
    iget-object v2, p0, Lcom/android/server/am/UriPermission;->writeOwners:Ljava/util/HashSet;

    invoke-virtual {v2}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .restart local v0       #i$:Ljava/util/Iterator;
    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/server/am/UriPermissionOwner;

    .line 99
    .restart local v1       #owner:Lcom/android/server/am/UriPermissionOwner;
    invoke-virtual {p1, p2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string v2, "  * "

    invoke-virtual {p1, v2}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    invoke-virtual {p1, v1}, Ljava/io/PrintWriter;->println(Ljava/lang/Object;)V

    goto :goto_1

    .line 102
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v1           #owner:Lcom/android/server/am/UriPermissionOwner;
    :cond_1
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 72
    iget-object v1, p0, Lcom/android/server/am/UriPermission;->stringName:Ljava/lang/String;

    if-eqz v1, :cond_0

    .line 73
    iget-object v1, p0, Lcom/android/server/am/UriPermission;->stringName:Ljava/lang/String;

    .line 81
    :goto_0
    return-object v1

    .line 75
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    const/16 v1, 0x80

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(I)V

    .line 76
    .local v0, sb:Ljava/lang/StringBuilder;
    const-string v1, "UriPermission{"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 77
    invoke-static {p0}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 78
    const/16 v1, 0x20

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 79
    iget-object v1, p0, Lcom/android/server/am/UriPermission;->uri:Landroid/net/Uri;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    .line 80
    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 81
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/android/server/am/UriPermission;->stringName:Ljava/lang/String;

    goto :goto_0
.end method


text:
\hypertarget{classMyTrinomialTree_1_1TrinomialTree}{}\section{My\+Trinomial\+Tree\+:\+:Trinomial\+Tree Class Reference}
\label{classMyTrinomialTree_1_1TrinomialTree}\index{My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}}

{\ttfamily \#include $<$Trinomial\+Tree.\+h$>$}

Collaboration diagram for My\+Trinomial\+Tree\+:\+:Trinomial\+Tree\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=235pt]{classMyTrinomialTree_1_1TrinomialTree__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{classMyTrinomialTree_1_1TrinomialTree_ae83aba0816cc8988e8c1842cc41590b2}{Trinomial\+Tree} (double Spot\+\_\+, const \hyperlink{classParameters}{Parameters} \&r\+\_\+, const \hyperlink{classParameters}{Parameters} \&d\+\_\+, double Volatility\+\_\+, unsigned long Steps, double Time)
\item
double \hyperlink{classMyTrinomialTree_1_1TrinomialTree_a2627d85fdca2354085193486755b81e2}{Get\+The\+Price} (const \hyperlink{classTreeProduct}{Tree\+Product} \&The\+Product)
\item
void \hyperlink{classMyTrinomialTree_1_1TrinomialTree_a47dd32274bada6fbd59fe0e048d92b58}{Build\+Tree} ()
\end{DoxyCompactItemize}

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classMyTrinomialTree_1_1TrinomialTree_ae83aba0816cc8988e8c1842cc41590b2}{}\label{classMyTrinomialTree_1_1TrinomialTree_ae83aba0816cc8988e8c1842cc41590b2}
\index{My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}!Trinomial\+Tree@{Trinomial\+Tree}}
\index{Trinomial\+Tree@{Trinomial\+Tree}!My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}}
\subsubsection{\texorpdfstring{Trinomial\+Tree()}{TrinomialTree()}}
{\footnotesize\ttfamily My\+Trinomial\+Tree\+::\+Trinomial\+Tree\+::\+Trinomial\+Tree (\begin{DoxyParamCaption}\item[{double}]{Spot\+\_\+,  }\item[{const \hyperlink{classParameters}{Parameters} \&}]{r\+\_\+,  }\item[{const \hyperlink{classParameters}{Parameters} \&}]{d\+\_\+,  }\item[{double}]{Volatility\+\_\+,  }\item[{unsigned long}]{Steps,  }\item[{double}]{Time }\end{DoxyParamCaption})}

\subsection{Member Function Documentation}
\hypertarget{classMyTrinomialTree_1_1TrinomialTree_a47dd32274bada6fbd59fe0e048d92b58}{}\label{classMyTrinomialTree_1_1TrinomialTree_a47dd32274bada6fbd59fe0e048d92b58}
\index{My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}!Build\+Tree@{Build\+Tree}}
\index{Build\+Tree@{Build\+Tree}!My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}}
\subsubsection{\texorpdfstring{Build\+Tree()}{BuildTree()}}
{\footnotesize\ttfamily void My\+Trinomial\+Tree\+::\+Trinomial\+Tree\+::\+Build\+Tree (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\hypertarget{classMyTrinomialTree_1_1TrinomialTree_a2627d85fdca2354085193486755b81e2}{}\label{classMyTrinomialTree_1_1TrinomialTree_a2627d85fdca2354085193486755b81e2}
\index{My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}!Get\+The\+Price@{Get\+The\+Price}}
\index{Get\+The\+Price@{Get\+The\+Price}!My\+Trinomial\+Tree\+::\+Trinomial\+Tree@{My\+Trinomial\+Tree\+::\+Trinomial\+Tree}}
\subsubsection{\texorpdfstring{Get\+The\+Price()}{GetThePrice()}}
{\footnotesize\ttfamily double My\+Trinomial\+Tree\+::\+Trinomial\+Tree\+::\+Get\+The\+Price (\begin{DoxyParamCaption}\item[{const \hyperlink{classTreeProduct}{Tree\+Product} \&}]{The\+Product }\end{DoxyParamCaption})}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
\hyperlink{TrinomialTree_8h}{Trinomial\+Tree.\+h}\end{DoxyCompactItemize}


text:
using content::WebContents;

class ContentSettingBlockedImageModel : public ContentSettingImageModel {
 public:
  explicit ContentSettingBlockedImageModel(
      ContentSettingsType content_settings_type);

  void UpdateFromWebContents(WebContents* web_contents) override;
};

class ContentSettingGeolocationImageModel : public ContentSettingImageModel {
 public:
  ContentSettingGeolocationImageModel();

  void UpdateFromWebContents(WebContents* web_contents) override;
};

// Image model for displaying media icons in the location bar.
class ContentSettingMediaImageModel : public ContentSettingImageModel {
 public:
  explicit ContentSettingMediaImageModel(ContentSettingsType type);

  void UpdateFromWebContents(WebContents* web_contents) override;
};

class ContentSettingRPHImageModel : public ContentSettingImageModel {
 public:
  ContentSettingRPHImageModel();

  void UpdateFromWebContents(WebContents* web_contents) override;
};

class ContentSettingNotificationsImageModel : public ContentSettingImageModel {
 public:
  ContentSettingNotificationsImageModel();

  void UpdateFromWebContents(WebContents* web_contents) override;
};

class ContentSettingMIDISysExImageModel : public ContentSettingImageModel {
 public:
  ContentSettingMIDISysExImageModel();

  void UpdateFromWebContents(WebContents* web_contents) override;
};

namespace {

struct ContentSettingsTypeIdEntry {
  ContentSettingsType type;
  int id;
};

int GetIdForContentType(const ContentSettingsTypeIdEntry* entries,
                        size_t num_entries,
                        ContentSettingsType type) {
  for (size_t i = 0; i < num_entries; ++i) {
    if (entries[i].type == type)
      return entries[i].id;
  }
  return 0;
}

}  // namespace

ContentSettingBlockedImageModel::ContentSettingBlockedImageModel(
    ContentSettingsType content_settings_type)
    : ContentSettingImageModel(content_settings_type) {
}

void ContentSettingBlockedImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  set_visible(false);
  if (!web_contents)
    return;

  static const ContentSettingsTypeIdEntry kBlockedIconIDs[] = {
    {CONTENT_SETTINGS_TYPE_COOKIES, IDR_BLOCKED_COOKIES},
    {CONTENT_SETTINGS_TYPE_IMAGES, IDR_BLOCKED_IMAGES},
    {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDR_BLOCKED_JAVASCRIPT},
    {CONTENT_SETTINGS_TYPE_PLUGINS, IDR_BLOCKED_PLUGINS},
    {CONTENT_SETTINGS_TYPE_POPUPS, IDR_BLOCKED_POPUPS},
    {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDR_BLOCKED_MIXED_CONTENT},
    {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDR_BLOCKED_PPAPI_BROKER},
    {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDR_BLOCKED_DOWNLOADS},
  };
  static const ContentSettingsTypeIdEntry kBlockedTooltipIDs[] = {
    {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_TITLE},
    {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_TITLE},
    {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_TITLE},
    {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_MESSAGE},
    {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_TOOLTIP},
    {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT,
        IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT},
    {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_TITLE},
    {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_TITLE},
  };
  static const ContentSettingsTypeIdEntry kBlockedExplanatoryTextIDs[] = {
    {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_EXPLANATORY_TEXT},
    {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGIN_EXPLANATORY_TEXT},
    {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS,
        IDS_BLOCKED_DOWNLOADS_EXPLANATION},
  };

  ContentSettingsType type = get_content_settings_type();
  int icon_id = GetIdForContentType(
      kBlockedIconIDs, arraysize(kBlockedIconIDs), type);
  int tooltip_id = GetIdForContentType(
      kBlockedTooltipIDs, arraysize(kBlockedTooltipIDs), type);
  int explanation_id = GetIdForContentType(
      kBlockedExplanatoryTextIDs, arraysize(kBlockedExplanatoryTextIDs), type);

  // For plugins, don't show the animated explanation unless the plugin was
  // blocked despite the user's content settings being set to allow it (e.g.
  // due to auto-blocking NPAPI plugins).
  Profile* profile =
      Profile::FromBrowserContext(web_contents->GetBrowserContext());
  HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
  if (type == CONTENT_SETTINGS_TYPE_PLUGINS) {
    GURL url = web_contents->GetURL();
    if (map->GetContentSetting(url, url, type, std::string()) !=
        CONTENT_SETTING_ALLOW)
      explanation_id = 0;
  }

  // If a content type is blocked by default and was accessed, display the
  // content blocked page action.
  TabSpecificContentSettings* content_settings =
      TabSpecificContentSettings::FromWebContents(web_contents);
  if (!content_settings)
    return;
  if (!content_settings->IsContentBlocked(type)) {
    if (!content_settings->IsContentAllowed(type))
      return;

    // For cookies, only show the cookie blocked page action if cookies are
    // blocked by default.
    if (type == CONTENT_SETTINGS_TYPE_COOKIES &&
        (map->GetDefaultContentSetting(type, NULL) != CONTENT_SETTING_BLOCK))
      return;

    static const ContentSettingsTypeIdEntry kAccessedIconIDs[] = {
      {CONTENT_SETTINGS_TYPE_COOKIES, IDR_ACCESSED_COOKIES},
      {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDR_BLOCKED_PPAPI_BROKER},
      {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDR_ALLOWED_DOWNLOADS},
    };
    static const ContentSettingsTypeIdEntry kAccessedTooltipIDs[] = {
      {CONTENT_SETTINGS_TYPE_COOKIES, IDS_ACCESSED_COOKIES_TITLE},
      {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_TITLE},
      {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_ALLOWED_DOWNLOAD_TITLE},
    };
    icon_id = GetIdForContentType(
        kAccessedIconIDs, arraysize(kAccessedIconIDs), type);
    tooltip_id = GetIdForContentType(
        kAccessedTooltipIDs, arraysize(kAccessedTooltipIDs), type);
    explanation_id = 0;
  }
  set_visible(true);
  DCHECK(icon_id);
  set_icon(icon_id);
  set_explanatory_string_id(explanation_id);
  DCHECK(tooltip_id);
  set_tooltip(l10n_util::GetStringUTF8(tooltip_id));
}

ContentSettingGeolocationImageModel::ContentSettingGeolocationImageModel()
    : ContentSettingImageModel(CONTENT_SETTINGS_TYPE_GEOLOCATION) {
}

void ContentSettingGeolocationImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  set_visible(false);
  if (!web_contents)
    return;
  TabSpecificContentSettings* content_settings =
      TabSpecificContentSettings::FromWebContents(web_contents);
  if (!content_settings)
    return;
  const ContentSettingsUsagesState& usages_state = content_settings->
      geolocation_usages_state();
  if (usages_state.state_map().empty())
    return;
  set_visible(true);

  // If any embedded site has access the allowed icon takes priority over the
  // blocked icon.
  unsigned int state_flags = 0;
  usages_state.GetDetailedInfo(NULL, &state_flags);
  bool allowed =
      !!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED);
  set_icon(allowed ? IDR_ALLOWED_LOCATION : IDR_BLOCKED_LOCATION);
  set_tooltip(l10n_util::GetStringUTF8(allowed ?
      IDS_GEOLOCATION_ALLOWED_TOOLTIP : IDS_GEOLOCATION_BLOCKED_TOOLTIP));
}

ContentSettingMediaImageModel::ContentSettingMediaImageModel(
    ContentSettingsType type)
    : ContentSettingImageModel(type) {
}

void ContentSettingMediaImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  set_visible(false);

  // As long as a single icon is used to display the status of the camera and
  // microphone usage only display an icon for the
  // CONTENT_SETTINGS_TYPE_MEDIASTREAM. Don't display anything for
  // CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
  // CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA.
  // FIXME: Remove this hack and either display a two omnibox icons (one for
  // camera and one for microphone), or don't create one image model per
  // content type but per icon to display. The later is probably the right
  // thing to do, bebacuse this also allows to add more content settings type
  // for which no omnibox icon exists.
  if (get_content_settings_type() == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
      get_content_settings_type() == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
    return;
  }

  // The ContentSettingMediaImageModel must not be used with a content type
  // other then: CONTENT_SETTINGS_TYPE_MEDIASTREAM,
  // CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
  // CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA.
  DCHECK_EQ(get_content_settings_type(), CONTENT_SETTINGS_TYPE_MEDIASTREAM);

  if (!web_contents)
    return;

  TabSpecificContentSettings* content_settings =
      TabSpecificContentSettings::FromWebContents(web_contents);
  if (!content_settings)
    return;
  TabSpecificContentSettings::MicrophoneCameraState state =
      content_settings->GetMicrophoneCameraState();

  // If neither the microphone nor the camera stream was accessed then no icon
  // is displayed in the omnibox.
  if (state == TabSpecificContentSettings::MICROPHONE_CAMERA_NOT_ACCESSED)
    return;

  bool is_mic = (state & TabSpecificContentSettings::MICROPHONE_ACCESSED) != 0;
  bool is_cam = (state & TabSpecificContentSettings::CAMERA_ACCESSED) != 0;
  DCHECK(is_mic || is_cam);

  int id = IDS_CAMERA_BLOCKED;
  if (state & (TabSpecificContentSettings::MICROPHONE_BLOCKED |
               TabSpecificContentSettings::CAMERA_BLOCKED)) {
    set_icon(IDR_BLOCKED_MEDIA);
    if (is_mic)
      id = is_cam ? IDS_MICROPHONE_CAMERA_BLOCKED : IDS_MICROPHONE_BLOCKED;
  } else {
    set_icon(IDR_ASK_MEDIA);
    id = IDS_CAMERA_ACCESSED;
    if (is_mic)
      id = is_cam ? IDS_MICROPHONE_CAMERA_ALLOWED : IDS_MICROPHONE_ACCESSED;
  }
  set_tooltip(l10n_util::GetStringUTF8(id));
  set_visible(true);
}

ContentSettingRPHImageModel::ContentSettingRPHImageModel()
    : ContentSettingImageModel(
        CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) {
  set_icon(IDR_REGISTER_PROTOCOL_HANDLER);
  set_tooltip(l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_TOOLTIP));
}

void ContentSettingRPHImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  set_visible(false);
  if (!web_contents)
    return;

  TabSpecificContentSettings* content_settings =
      TabSpecificContentSettings::FromWebContents(web_contents);
  if (!content_settings)
    return;
  if (content_settings->pending_protocol_handler().IsEmpty())
    return;

  set_visible(true);
}

ContentSettingNotificationsImageModel::ContentSettingNotificationsImageModel()
    : ContentSettingImageModel(CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
}

void ContentSettingNotificationsImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  // Notifications do not have a bubble.
  set_visible(false);
}

ContentSettingMIDISysExImageModel::ContentSettingMIDISysExImageModel()
    : ContentSettingImageModel(CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
}

void ContentSettingMIDISysExImageModel::UpdateFromWebContents(
    WebContents* web_contents) {
  set_visible(false);
  if (!web_contents)
    return;
  TabSpecificContentSettings* content_settings =
      TabSpecificContentSettings::FromWebContents(web_contents);
  if (!content_settings)
    return;
  const ContentSettingsUsagesState& usages_state =
      content_settings->midi_usages_state();
  if (usages_state.state_map().empty())
    return;
  set_visible(true);

  // If any embedded site has access the allowed icon takes priority over the
  // blocked icon.
  unsigned int state_flags = 0;
  usages_state.GetDetailedInfo(NULL, &state_flags);
  bool allowed =
      !!(state_flags & ContentSettingsUsagesState::TABSTATE_HAS_ANY_ALLOWED);
  set_icon(allowed ? IDR_ALLOWED_MIDI_SYSEX : IDR_BLOCKED_MIDI_SYSEX);
  set_tooltip(l10n_util::GetStringUTF8(allowed ?
      IDS_MIDI_SYSEX_ALLOWED_TOOLTIP : IDS_MIDI_SYSEX_BLOCKED_TOOLTIP));
}

ContentSettingImageModel::ContentSettingImageModel(
    ContentSettingsType content_settings_type)
    : content_settings_type_(content_settings_type),
      is_visible_(false),
      icon_(0),
      explanatory_string_id_(0) {
}

// static
ContentSettingImageModel*
    ContentSettingImageModel::CreateContentSettingImageModel(
    ContentSettingsType content_settings_type) {
  switch (content_settings_type) {
    case CONTENT_SETTINGS_TYPE_GEOLOCATION:
      return new ContentSettingGeolocationImageModel();
    case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
      return new ContentSettingNotificationsImageModel();
    case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS:
      return new ContentSettingRPHImageModel();
    case CONTENT_SETTINGS_TYPE_MEDIASTREAM:
    case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
    case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
      return new ContentSettingMediaImageModel(content_settings_type);
    case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
      return new ContentSettingMIDISysExImageModel();
    default:
      return new ContentSettingBlockedImageModel(content_settings_type);
  }
}


text:
package cherry.fundamental.mail;

import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;

public class MailDataHandlerImpl implements MailDataHandler {

	private TemplateStore templateStore;

	private Configuration configuration;

	public void setTemplateStore(TemplateStore templateStore) {
		this.templateStore = templateStore;
	}

	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}

	@Transactional(readOnly = true)
	@Override
	public MailData createMailData(String templateName, String to, MailModel mailModel) {

		MailData template = templateStore.getTemplate(templateName);

		List<String> toAddr = new ArrayList<>();
		toAddr.add(to);
		if (template.getToAddr() != null) {
			toAddr.addAll(template.getToAddr());
		}

		return createMailData(template.getFromAddr(), toAddr, template.getCcAddr(), template.getBccAddr(),
				template.getReplyToAddr(), template.getSubject(), template.getBody(), mailModel);
	}

	@Override
	public MailData createMailData(String fromAddr, List<String> toAddr, List<String> ccAddr, List<String> bccAddr,
			String replyToAddr, String subject, String body, MailModel mailModel) {

		MailData message = new MailData();
		message.setFromAddr(fromAddr);
		message.setToAddr(toAddr);
		message.setCcAddr(ccAddr);
		message.setBccAddr(bccAddr);
		message.setReplyToAddr(replyToAddr);

		message.setSubject(evaluate(subject, mailModel));
		message.setBody(evaluate(body, mailModel));

		return message;
	}

	private String evaluate(String content, MailModel mailModel) {
		try (StringWriter writer = new StringWriter()) {
			Template template = new Template(null, content, configuration);
			template.process(mailModel, writer);
			return writer.toString();
		} catch (TemplateException | IOException ex) {
			throw new IllegalStateException(ex);
		}
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
	http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-3.0.xsd">

	<context:component-scan base-package="com.hirisun.*" />

	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />

		<!-- 此时使用扫描 -->
		<property name="packagesToScan">
			<list>
				<value>com.hirisun.components.systemcode.model</value>
				<value>com.hirisun.${projectName}.model</value>
			</list>

		</property>

		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">true</prop>
                <prop key="hibernate.hbm2ddl.auto">none</prop>
                <prop key="hibernate.generate_statistics">true</prop>
                <prop key="hibernate.autoReconnect">true</prop>
                <prop key="hibernate.jdbc.batch_size">500</prop>
                <prop key="hibernate.connection.release_mode">auto</prop>
                <prop key="hibernate.cache.use_second_level_cache">false</prop>
                <prop key="hibernate.dialect">${hibernateDialect}</prop>
                <prop key="hibernate.query.substitutions">true 1,false 0,yes 'Y', no 'N'</prop>
			</props>
		</property>
	</bean>

	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

</beans>


text:
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"

COLLECTD_CONFIG="/etc/collectd/collectd.conf"
COLLECTD_CRON_FILE="/etc/cron.d/adsb-receiver-performance-graphs"
DUMP1090_MAX_RANGE_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd"
DUMP1090_MESSAGES_LOCAL_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_messages-local_accepted.rrd"

### INCLUDE EXTERNAL SCRIPTS

source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh

if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
    source ${RECEIVER_CONFIGURATION_FILE}
fi

### BEGIN SETUP

echo -e ""
echo -e "\e[95m  Setting up collectd performance graphs...\e[97m"
echo -e ""

## CONFIRM INSTALLED PACKAGES

if [[ -z "${DUMP1090_INSTALLED}" ]] || [[ -z "${DUMP1090_FORK}" ]] ; then
    echo -e "\e[94m  Checking which dump1090 fork is installed...\e[97m"
    if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
        DUMP1090_FORK="mutability"
        DUMP1090_INSTALLED="true"
    fi
    if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
        DUMP1090_FORK="fa"
        DUMP1090_INSTALLED="true"
    fi
fi
if [[ -f "/etc/init.d/rtlsdr-ogn" ]] ; then
    RTLSDROGN_INSTALLED="true"
fi

## CONFIRM HARDWARE PLATFORM

if [[ -z "${HARDWARE_PLATFORM}" ]] ; then
    Check_Platform
    echo -e ""
fi

## MODIFY THE DUMP1090-MUTABILITY INIT SCRIPT TO MEASURE AND RETAIN NOISE DATA

if [[ "${DUMP1090_INSTALLED}" = "true" ]] && [[ "${DUMP1090_FORK}" = "mutability" ]] ; then
    echo -e "\e[94m  Modifying the dump1090-mutability configuration file to add noise measurements...\e[97m"
    EXTRA_ARGS=`GetConfig "EXTRA_ARGS" "/etc/default/dump1090-mutability"`
    EXTRA_ARGS=$(sed -e 's/^[[:space:]]*//' <<<"EXTRA_ARGS --measure-noise")
    ChangeConfig "EXTRA_ARGS" "${RECEIVER_LONGITUDE}" "/etc/default/dump1090-mutability"

    echo -e "\e[94m  Reloading the systemd manager configuration...\e[97m"
    sudo systemctl daemon-reload

    echo -e "\e[94m  Reloading dump1090-mutability...\e[97m"
    sudo service dump1090-mutability force-reload
fi

## BACKUP AND REPLACE COLLECTD.CONF

# Check if the collectd config file exists and if so back it up.
if [[ -f "${COLLECTD_CONFIG}" ]] ; then
    echo -e "\e[94m  Backing up the current collectd.conf file...\e[97m"
    sudo cp ${COLLECTD_CONFIG} ${COLLECTD_CONFIG}.bak
fi

# Generate new collectd config.
echo -e "\e[94m  Replacing the current collectd.conf file...\e[97m"
sudo tee ${COLLECTD_CONFIG} > /dev/null <<EOF
# Config file for collectd(1).

##############################################################################
# Global                                                                     #
##############################################################################
Hostname "localhost"

#----------------------------------------------------------------------------#
# Interval at which to query values. This may be overwritten on a per-plugin #
# base by using the 'Interval' option of the LoadPlugin block:               #
#   <LoadPlugin foo>                                                         #
#       Interval 60                                                          #
#   </LoadPlugin>                                                            #
#----------------------------------------------------------------------------#
Interval 60
Timeout 2
ReadThreads 5
WriteThreads 1

EOF

# Dump1090 specific values.
if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then
    sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# Added types for dump1090.                                                  #
# Make sure the path to dump1090.db is correct.                              #
#----------------------------------------------------------------------------#
TypesDB "${PORTAL_BUILD_DIRECTORY}/graphs/dump1090.db" "/usr/share/collectd/types.db"

EOF
fi

# Config for all installations.
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
##############################################################################
# Logging                                                                    #
##############################################################################
LoadPlugin syslog

<Plugin syslog>
	LogLevel info
</Plugin>

##############################################################################
# LoadPlugin section                                                         #
#----------------------------------------------------------------------------#
# Specify what features to activate.                                         #
##############################################################################
LoadPlugin rrdtool
LoadPlugin table
LoadPlugin interface
LoadPlugin memory
LoadPlugin cpu
LoadPlugin aggregation
LoadPlugin match_regex
LoadPlugin df
LoadPlugin disk
LoadPlugin curl
<LoadPlugin python>
	Globals true
</LoadPlugin>

##############################################################################
# Plugin configuration                                                       #
##############################################################################
<Plugin rrdtool>
	DataDir "/var/lib/collectd/rrd"
</Plugin>

<Plugin "aggregation">
        <Aggregation>
                Plugin "cpu"
                Type "cpu"
                GroupBy "Host"
                GroupBy "TypeInstance"
                CalculateAverage true
        </Aggregation>
</Plugin>

<Plugin "df">
        MountPoint "/"
        IgnoreSelected false
        ReportReserved true
        ReportInodes true
</Plugin>

<Plugin "interface">
        Interface "eth0"
        Interface "wlan0"
</Plugin>

EOF

# Raspberry Pi specific values.
if [[ "${HARDWARE_PLATFORM}" = "RPI" ]] ; then
    sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
<Plugin table>

		Instance localhost
		Separator " "
		<Result>
			Type gauge
			InstancePrefix "cpu_temp"
			ValuesFrom 0
		</Result>

</Plugin>

<Plugin "disk">
	Disk "mmcblk0"
	IgnoreSelected false
</Plugin>

EOF
# CHIP specific values.
elif [[ "${HARDWARE_PLATFORM}" = "CHIP" ]] ; then
    sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
<Plugin table>

                Instance localhost
                Separator " "
                <Result>
                        Type gauge
                        InstancePrefix "cpu_temp"
                        ValuesFrom 0
                </Result>

</Plugin>

<Plugin "disk">
        Disk "ubi0:rootfs"
        IgnoreSelected false
</Plugin>

EOF
fi

# Dump1090 specific values.
if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then
    sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# Configure the dump1090 python module.                                      #
#                                                                            #
# Each Instance block collects statistics from a separate named dump1090.    #
# The URL should be the base URL of the webmap, i.e. in the examples below,  #
# statistics will be loaded from http://localhost/dump1090/data/stats.json   #
#----------------------------------------------------------------------------#
<Plugin python>
        ModulePath "${PORTAL_BUILD_DIRECTORY}/graphs"
        LogTraces true
        Import "dump1090"
        <Module dump1090>
                <Instance localhost>
                        URL "http://localhost/dump1090"
                </Instance>
        </Module>
</Plugin>

EOF
fi

# RTLSDR-OGN specific values.
if [[ "${RTLSDROGN_INSTALLED}" = "true" ]] ; then
    sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# RTLSDR-OGN Graphs                                                          #
#----------------------------------------------------------------------------#
<Plugin curl>
  <Page "rtlsdr-ogn">
    URL "http://localhost:8080/"
    # OGN center Frequency
    <Match>
      Regex "
RF.OGN.CenterFreq	([0-9]*\\.[0-9]+) MHz
"
      DSType "GaugeLast"
      Type "frequency"
      Instance "Center-Frequency-OGN"
    </Match>
    # GSM  center Frequency
    <Match>
      Regex "
RF.GSM.CenterFreq	([0-9]*\\.[0-9]+) MHz
"
      DSType "GaugeLast"
      Type "frequency"
      Instance "Center-Frequency-GSM"
    </Match>
    # OGN Frequency Correction
    <Match>
      Regex "
Frequency correction	([\+\-][0-9]*\\.[0-9]+) ppm
"
      DSType "GaugeLast"
      Type "frequency_offset"
      Instance "Frequency-Correction-OGN"
    </Match>
    # NTP Frequency Correction
    <Match>
      Regex "
NTP freq. corr.	([\+\-][0-9]*\\.[0-9]+) ppm
"
      DSType "GaugeLast"
      Type "frequency_offset"
      Instance "Frequency-Correction-NTP"
    </Match>
    # OGN Gain
    <Match>
      Regex "
RF.OGN.Gain	([0-9]*\\.[0-9]+) dB
"
      DSType "GaugeLast"
      Type "gauge"
      Instance "Gain-OGN"
    </Match>
    # GSM Gain
    <Match>
      Regex "
RF.GSM.Gain	([0-9]*\\.[0-9]+) dB
"
      DSType "GaugeLast"
      Type "gauge"
      Instance "Gain-GSM"
    </Match>
  </Page>
</Plugin>
EOF
fi

# Remaining config for all installations.
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
<Chain "PostCache">
	<Rule>
		<Match regex>
		Plugin "^cpu\$"
			PluginInstance "^[0-9]+\$"
		</Match>
		<Target write>
			Plugin "aggregation"
		</Target>
		Target stop
	</Rule>
	Target "write"
</Chain>
EOF

## RELOAD COLLECTD

echo -e "\e[94m  Reloading collectd so the new configuration is used...\e[97m"
sudo service collectd force-reload

## EDIT CRONTAB

if [[ ! -x "${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh" ]] ; then
    echo -e "\e[94m  Making the make-collectd-graphs.sh script executable...\e[97m"
    chmod +x ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh
fi

# The next block is temporary in order to insure this file is
# deleted on older installation before the project renaming.
if [[ -f "/etc/cron.d/adsb-feeder-performance-graphs" ]] ; then
    echo -e "\e[94m  Removing outdated performance graphs cron file...\e[97m"
    sudo rm -f /etc/cron.d/adsb-feeder-performance-graphs
fi

if [[ -f "${COLLECTD_CRON_FILE}" ]] ; then
    echo -e "\e[94m  Removing previously installed performance graphs cron file...\e[97m"
    sudo rm -f ${COLLECTD_CRON_FILE}
fi

echo -e "\e[94m  Adding performance graphs cron file...\e[97m"
sudo tee ${COLLECTD_CRON_FILE} > /dev/null <<EOF
# Updates the portal's performance graphs.
#
# Every 5 minutes new hourly graphs are generated.
# Every 10 minutes new six hour graphs are generated.
# At 2, 12, 22, 32, 42, and 52 minutes past the hour new 24 hour graphs are generated.
# At 4, 24, and 44 minuites past the hour new 7 day graphs are generated.
# At 6 minutes past the hour new 30 day graphs are generated.
# At 8 minutes past every 12th hour new 365 day graphs are generated.

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

*/5 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 1h >/dev/null 2>&1
*/10 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 6h >/dev/null 2>&1
2,12,22,32,42,52 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 24h >/dev/null 2>&1
4,24,44 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 7d >/dev/null 2>&1
6 * * *	* root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 30d >/dev/null 2>&1
8 */12 * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 365d >/dev/null 2>&1
EOF

# Update max_range.rrd to remove the 500 km / ~270 nmi limit.
if [ -f "/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd" ]; then
    if [[ `rrdinfo ${DUMP1090_MAX_RANGE_RRD} | grep -c "ds\[value\].max = 1.0000000000e+06"` -eq 0 ]] ; then
        echo -e "\e[94m  Removing 500km/270mi limit from max_range.rrd...\e[97m"
        sudo rrdtool tune ${DUMP1090_MAX_RANGE_RRD} --maximum "value:1000000"
    fi
fi

# Increase size of weekly messages table to 8 days
if [ -f ${DUMP1090_MESSAGES_LOCAL_RRD} ]; then
    if [[ `rrdinfo ${DUMP1090_MESSAGES_LOCAL_RRD} | grep -c "rra\[6\]\.rows = 1260"` -eq 1 ]] ; then
        echo -e "\e[94m  Increasing weekly table size to 8 days in messages-local_accepted.rrd...\e[97m"
        sudo rrdtool tune ${DUMP1090_MESSAGES_LOCAL_RRD} 'RRA#6:=1440' 'RRA#7:=1440' 'RRA#8:=1440'
    fi
fi

### SETUP COMPLETE

# Return to the project root directory.
echo -e "\e[94m  Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ISourceControlProvider.h"
#include "PerforceSourceControlCommand.h"

/** A map containing result of running Perforce command */
class FP4Record : public TMap<FString, FString >
{
public:

	virtual ~FP4Record() {}

	FString operator () (const FString& Key) const
	{
		const FString* Found = Find(Key);
		return Found ? *Found : TEXT("");
	}
};

typedef TArray<FP4Record> FP4RecordSet;

class FPerforceConnection
{
public:
	//This constructor is strictly for internal questions to perforce (get client spec list, etc)
	FPerforceConnection(const FPerforceConnectionInfo& InConnectionInfo);
	/** API Specific close of source control project*/
	~FPerforceConnection();

	/**
	 * Attempts to automatically detect the workspace to use based on the working directory
	 */
	static bool AutoDetectWorkspace(const FPerforceConnectionInfo& InConnectionInfo, FString& OutWorkspaceName);

	/**
	 * Static function in charge of making sure the specified connection is valid or requests that data from the user via dialog
	 * @param InOutPortName			Port name in the inifile.  Out value is the port name from the connection dialog
	 * @param InOutUserName			User name in the inifile.  Out value is the user name from the connection dialog
	 * @param InOutWorkspaceName	Workspace name in the inifile.  Out value is the client spec from the connection dialog
	 * @param InConnectionInfo		Connection credentials
	 * @return - true if the connection, whether via dialog or otherwise, is valid.  False if source control should be disabled
	 */
	static bool EnsureValidConnection(FString& InOutServerName, FString& InOutUserName, FString& InOutWorkspaceName, const FPerforceConnectionInfo& InConnectionInfo);

	/**
	 * Get List of ClientSpecs
	 * @param InConnectionInfo	Connection credentials
	 * @param InOnIsCancelled	Delegate called to check for operation cancellation.
	 * @param OutWorkspaceList	The workspace list output.
	 * @param OutErrorMessages	Any error messages output.
	 * @return - True if successful
	 */
	bool GetWorkspaceList(const FPerforceConnectionInfo& InConnectionInfo, FOnIsCancelled InOnIsCancelled, TArray<FString>& OutWorkspaceList, TArray<FText>& OutErrorMessages);

	/** Returns true if connection is currently active */
	bool IsValidConnection();

	/** If the connection is valid, disconnect from the server */
	void Disconnect();

	/**
	 * Runs internal perforce command, catches exceptions, returns results
	 */
	bool RunCommand(const FString& InCommand, const TArray<FString>& InParameters, FP4RecordSet& OutRecordSet, TArray<FText>&  OutErrorMessage, FOnIsCancelled InIsCancelled, bool& OutConnectionDropped)
	{
		const bool bStandardDebugOutput=true;
		const bool bAllowRetry=true;
		return RunCommand(InCommand, InParameters, OutRecordSet, OutErrorMessage, InIsCancelled, OutConnectionDropped, bStandardDebugOutput, bAllowRetry);
	}

	/**
	 * Runs internal perforce command, catches exceptions, returns results
	 */
	bool RunCommand(const FString& InCommand, const TArray<FString>& InParameters, FP4RecordSet& OutRecordSet, TArray<FText>& OutErrorMessage, FOnIsCancelled InIsCancelled, bool& OutConnectionDropped, const bool bInStandardDebugOutput, const bool bInAllowRetry);

	/**
	 * Creates a changelist with the specified description
	 */
	int32 CreatePendingChangelist(const FText &Description, FOnIsCancelled InIsCancelled, TArray<FText>& OutErrorMessages);

	/**
	 * Attempt to login - some servers will require this
	 * @param	InConnectionInfo		Credentials to use
	 * @return true if successful
	 */
	bool Login(const FPerforceConnectionInfo& InConnectionInfo);

	/**
	 * Make a valid connection if possible
	 * @param InConnectionInfo		Connection credentials
	 */
	void EstablishConnection(const FPerforceConnectionInfo& InConnectionInfo);

public:
	/** Perforce API client object */
	ClientApi P4Client;

	/** The current root for the client workspace */
	FString ClientRoot;

	/** true if connection was successfully established */
	bool bEstablishedConnection;

	/** Is this a connection to a unicode server? */
	bool bIsUnicode;
};

/**
 * Connection that is used within specific scope
 */
class FScopedPerforceConnection
{
public:
	/**
	 * Constructor - establish a connection.
	 * The concurrency of the passed in command determines whether the persistent connection is
	 * used or another connection is established (connections cannot safely be used across different
	 * threads).
	 */
	FScopedPerforceConnection( const class FPerforceSourceControlCommand& InCommand );

	/**
	 * Constructor - establish a connection.
	 * The concurrency passed in determines whether the persistent connection is used or another
	 * connection is established (connections cannot safely be used across different threads).
	 */
	FScopedPerforceConnection( EConcurrency::Type InConcurrency, const FPerforceConnectionInfo& InConnectionInfo );

	/**
	 * Destructor - disconnect if this is a temporary connection
	 */
	~FScopedPerforceConnection();

	/** Get the connection wrapped by this class */
	FPerforceConnection& GetConnection() const
	{
		return *Connection;
	}

	/** Check if this connection is valid */
	bool IsValid() const
	{
		return Connection != NULL;
	}

private:
	/** Set up the connection */
	void Initialize( const FPerforceConnectionInfo& InConnectionInfo );

private:
	/** The perforce connection we are using */
	FPerforceConnection* Connection;

	/** The concurrency of this connection */
	EConcurrency::Type Concurrency;
};


text:
using System;

namespace MatterHackers.Agg.Platform
{
	public class SelectFolderDialogParams
	{
		public enum RootFolderTypes { MyComputer };

		public string Description { get; set; }

		public RootFolderTypes RootFolder { get; set; }

		public string FolderPath { get; set; }

		public bool ShowNewFolderButton { get; set; }

		/// <summary>
		/// The title of the dialog window. If not set will show 'Open' or 'Save' as appropriate
		/// </summary>
		public string Title { get; set; }

		/// <summary>
		/// This does not show on Windows (but does on mac.
		/// </summary>
		public string ActionButtonLabel { get; set; }

		public SelectFolderDialogParams(string description, RootFolderTypes rootFolder = RootFolderTypes.MyComputer, bool showNewFolderButton = true, string title = "", string actionButtonLabel = "")
		{
			this.Description = description;
			this.RootFolder = rootFolder;
			this.ShowNewFolderButton = showNewFolderButton;
			this.Title = title;
			this.ActionButtonLabel = actionButtonLabel;
		}
	}
}


text:
(function () {
  'use strict';

  angular
    .module('services')
    .config(routeConfig);

  routeConfig.$inject = ['$stateProvider'];

  function routeConfig($stateProvider) {
    $stateProvider
      .state('services', {
        abstract: true,
        url: '/services',
        template: '<ui-view/>'
      })
      .state('services.list', {
        url: '',
        templateUrl: 'modules/services/client/views/list-services.client.view.html',
        controller: 'ServicesListController',
        controllerAs: 'vm',
        data: {
          pageTitle: 'Services List'
        }
      })
      .state('services.create', {
        url: '/create',
        templateUrl: 'modules/services/client/views/form-service.client.view.html',
        controller: 'ServicesController',
        controllerAs: 'vm',
        resolve: {
          serviceResolve: newService
        },
        data: {
          roles: ['user', 'admin'],
          pageTitle: 'Services Create'
        }
      })
      .state('services.edit', {
        url: '/:serviceId/edit',
        templateUrl: 'modules/services/client/views/form-service.client.view.html',
        controller: 'ServicesController',
        controllerAs: 'vm',
        resolve: {
          serviceResolve: getService
        },
        data: {
          roles: ['user', 'admin'],
          pageTitle: 'Edit Service {{ serviceResolve.name }}'
        }
      })
      .state('services.view', {
        url: '/:serviceId',
        templateUrl: 'modules/services/client/views/view-service.client.view.html',
        controller: 'ServicesController',
        controllerAs: 'vm',
        resolve: {
          serviceResolve: getService
        },
        data: {
          pageTitle: 'Service {{ serviceResolve.name }}'
        }
      });
  }

  getService.$inject = ['$stateParams', 'ServicesService'];

  function getService($stateParams, ServicesService) {
    return ServicesService.get({
      serviceId: $stateParams.serviceId
    }).$promise;
  }

  newService.$inject = ['ServicesService'];

  function newService(ServicesService) {
    return new ServicesService();
  }
}());


text:
//
//  YYFeedBackController.h
//  RowRabbit
//
//  Created by 恽雨晨 on 2016/12/19.
//  Copyright © 2016年 常州云阳驱动. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "YYPublishBaseViewController.h"

@interface YYFeedBackController : YYPublishBaseViewController
/**
 *  取消按钮+监听方法
 */
@property (weak, nonatomic) IBOutlet UIButton *cancelBtn;
- (IBAction)cancelClick:(UIButton *)sender;
/**
 *  title文字  默认分享新鲜事可在xib修改
 */
@property (weak, nonatomic) IBOutlet UILabel *titleLB;

//背景
@property(nonatomic,strong) UIView *noteTextBackgroudView;

//备注
@property(nonatomic,strong) QMUITextView *noteTextView;

//文字个数提示label
@property(nonatomic,strong) UILabel *textNumberLabel;

//文字说明
@property(nonatomic,strong) UILabel *explainLabel;

//发布按钮
@property(nonatomic,strong) UIButton *submitBtn;

//换车点
@property (nonatomic,assign) NSInteger rsid;

@property (nonatomic,assign) CGFloat lat;

@property (nonatomic,assign) CGFloat lon;

@end


text:
namespace UsbApp
{
    partial class Sniffer
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.lb_recieved = new System.Windows.Forms.Label();
            this.btn_send = new System.Windows.Forms.Button();
            this.tb_send = new System.Windows.Forms.TextBox();
            this.lb_vendor = new System.Windows.Forms.Label();
            this.btn_ok = new System.Windows.Forms.Button();
            this.lb_product = new System.Windows.Forms.Label();
            this.lb_senddata = new System.Windows.Forms.Label();
            this.lb_messages = new System.Windows.Forms.Label();
            this.tb_vendor = new System.Windows.Forms.TextBox();
            this.tb_product = new System.Windows.Forms.TextBox();
            this.gb_filter = new System.Windows.Forms.GroupBox();
            this.lb_message = new System.Windows.Forms.ListBox();
            this.gb_details = new System.Windows.Forms.GroupBox();
            this.lb_read = new System.Windows.Forms.ListBox();
            this.usb = new UsbLibrary.UsbHidPort(this.components);
            this.gb_filter.SuspendLayout();
            this.gb_details.SuspendLayout();
            this.SuspendLayout();
            //
            // lb_recieved
            //
            this.lb_recieved.AutoSize = true;
            this.lb_recieved.Location = new System.Drawing.Point(229, 16);
            this.lb_recieved.Name = "lb_recieved";
            this.lb_recieved.Size = new System.Drawing.Size(82, 13);
            this.lb_recieved.TabIndex = 4;
            this.lb_recieved.Text = "Recieved Data:";
            //
            // btn_send
            //
            this.btn_send.Location = new System.Drawing.Point(364, 263);
            this.btn_send.Name = "btn_send";
            this.btn_send.Size = new System.Drawing.Size(48, 23);
            this.btn_send.TabIndex = 3;
            this.btn_send.Text = "Send";
            this.btn_send.UseVisualStyleBackColor = true;
            this.btn_send.Click += new System.EventHandler(this.btn_send_Click);
            //
            // tb_send
            //
            this.tb_send.Location = new System.Drawing.Point(229, 263);
            this.tb_send.Name = "tb_send";
            this.tb_send.Size = new System.Drawing.Size(132, 20);
            this.tb_send.TabIndex = 2;
            //
            // lb_vendor
            //
            this.lb_vendor.AutoSize = true;
            this.lb_vendor.Location = new System.Drawing.Point(9, 22);
            this.lb_vendor.Name = "lb_vendor";
            this.lb_vendor.Size = new System.Drawing.Size(95, 13);
            this.lb_vendor.TabIndex = 5;
            this.lb_vendor.Text = "Device Vendor ID:";
            //
            // btn_ok
            //
            this.btn_ok.Location = new System.Drawing.Point(322, 43);
            this.btn_ok.Name = "btn_ok";
            this.btn_ok.Size = new System.Drawing.Size(75, 23);
            this.btn_ok.TabIndex = 7;
            this.btn_ok.Text = "OK";
            this.btn_ok.UseVisualStyleBackColor = true;
            this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
            //
            // lb_product
            //
            this.lb_product.AutoSize = true;
            this.lb_product.Location = new System.Drawing.Point(9, 48);
            this.lb_product.Name = "lb_product";
            this.lb_product.Size = new System.Drawing.Size(98, 13);
            this.lb_product.TabIndex = 6;
            this.lb_product.Text = "Device Product ID:";
            //
            // lb_senddata
            //
            this.lb_senddata.AutoSize = true;
            this.lb_senddata.Location = new System.Drawing.Point(229, 247);
            this.lb_senddata.Name = "lb_senddata";
            this.lb_senddata.Size = new System.Drawing.Size(61, 13);
            this.lb_senddata.TabIndex = 5;
            this.lb_senddata.Text = "Send Data:";
            //
            // lb_messages
            //
            this.lb_messages.AutoSize = true;
            this.lb_messages.Location = new System.Drawing.Point(8, 16);
            this.lb_messages.Name = "lb_messages";
            this.lb_messages.Size = new System.Drawing.Size(80, 13);
            this.lb_messages.TabIndex = 7;
            this.lb_messages.Text = "Usb Messages:";
            //
            // tb_vendor
            //
            this.tb_vendor.Location = new System.Drawing.Point(114, 19);
            this.tb_vendor.Name = "tb_vendor";
            this.tb_vendor.Size = new System.Drawing.Size(189, 20);
            this.tb_vendor.TabIndex = 1;
            this.tb_vendor.Text = "0451";
            //
            // tb_product
            //
            this.tb_product.Location = new System.Drawing.Point(114, 45);
            this.tb_product.Name = "tb_product";
            this.tb_product.Size = new System.Drawing.Size(189, 20);
            this.tb_product.TabIndex = 2;
            this.tb_product.Text = "0051";
            //
            // gb_filter
            //
            this.gb_filter.Controls.Add(this.btn_ok);
            this.gb_filter.Controls.Add(this.lb_product);
            this.gb_filter.Controls.Add(this.lb_vendor);
            this.gb_filter.Controls.Add(this.tb_vendor);
            this.gb_filter.Controls.Add(this.tb_product);
            this.gb_filter.ForeColor = System.Drawing.Color.White;
            this.gb_filter.Location = new System.Drawing.Point(12, 12);
            this.gb_filter.Name = "gb_filter";
            this.gb_filter.Size = new System.Drawing.Size(428, 80);
            this.gb_filter.TabIndex = 5;
            this.gb_filter.TabStop = false;
            this.gb_filter.Text = "Filter for Device:";
            //
            // lb_message
            //
            this.lb_message.FormattingEnabled = true;
            this.lb_message.Location = new System.Drawing.Point(11, 32);
            this.lb_message.Name = "lb_message";
            this.lb_message.Size = new System.Drawing.Size(212, 251);
            this.lb_message.TabIndex = 6;
            //
            // gb_details
            //
            this.gb_details.Controls.Add(this.lb_read);
            this.gb_details.Controls.Add(this.lb_messages);
            this.gb_details.Controls.Add(this.lb_message);
            this.gb_details.Controls.Add(this.lb_senddata);
            this.gb_details.Controls.Add(this.lb_recieved);
            this.gb_details.Controls.Add(this.btn_send);
            this.gb_details.Controls.Add(this.tb_send);
            this.gb_details.ForeColor = System.Drawing.Color.White;
            this.gb_details.Location = new System.Drawing.Point(12, 98);
            this.gb_details.Name = "gb_details";
            this.gb_details.Size = new System.Drawing.Size(428, 291);
            this.gb_details.TabIndex = 6;
            this.gb_details.TabStop = false;
            this.gb_details.Text = "Device Details:";
            //
            // lb_read
            //
            this.lb_read.FormattingEnabled = true;
            this.lb_read.Location = new System.Drawing.Point(232, 32);
            this.lb_read.Name = "lb_read";
            this.lb_read.Size = new System.Drawing.Size(180, 212);
            this.lb_read.TabIndex = 8;
            //
            // usb
            //
            this.usb.ProductId = 81;
            this.usb.VendorId = 1105;
            this.usb.OnSpecifiedDeviceRemoved += new System.EventHandler(this.usb_OnSpecifiedDeviceRemoved);
            this.usb.OnDeviceArrived += new System.EventHandler(this.usb_OnDeviceArrived);
            this.usb.OnDeviceRemoved += new System.EventHandler(this.usb_OnDeviceRemoved);
            this.usb.OnDataRecieved += new UsbLibrary.DataRecievedEventHandler(this.usb_OnDataRecieved);
            this.usb.OnDataSend += new System.EventHandler(this.usb_OnDataSend);
            this.usb.OnSpecifiedDeviceArrived += new System.EventHandler(this.usb_OnSpecifiedDeviceArrived);
            //
            // Sniffer
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.Desktop;
            this.ClientSize = new System.Drawing.Size(453, 401);
            this.Controls.Add(this.gb_filter);
            this.Controls.Add(this.gb_details);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Name = "Sniffer";
            this.Text = "Sniffer";
            this.gb_filter.ResumeLayout(false);
            this.gb_filter.PerformLayout();
            this.gb_details.ResumeLayout(false);
            this.gb_details.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label lb_recieved;
        private System.Windows.Forms.Button btn_send;
        private System.Windows.Forms.TextBox tb_send;
        private System.Windows.Forms.Label lb_vendor;
        private System.Windows.Forms.Button btn_ok;
        private System.Windows.Forms.Label lb_product;
        private System.Windows.Forms.Label lb_senddata;
        private System.Windows.Forms.Label lb_messages;
        private System.Windows.Forms.TextBox tb_vendor;
        private System.Windows.Forms.TextBox tb_product;
        private System.Windows.Forms.GroupBox gb_filter;
        private System.Windows.Forms.ListBox lb_message;
        private System.Windows.Forms.GroupBox gb_details;
        private UsbLibrary.UsbHidPort usb;
        private System.Windows.Forms.ListBox lb_read;

    }
}


text:
@interface CCSViewController () {
}

@end

@implementation CCSViewController
@synthesize tableView = _tableView;

- (void)dealloc {
    [_tableView release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.tableView = [[[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
                                                  style:UITableViewStylePlain]autorelease];
    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin
            | UIViewAutoresizingFlexibleTopMargin
            | UIViewAutoresizingFlexibleRightMargin
            | UIViewAutoresizingFlexibleBottomMargin
            | UIViewAutoresizingFlexibleHeight
            | UIViewAutoresizingFlexibleWidth;
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [self.view addSubview:self.tableView];

}

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

    self.title = @"Cocoa-Charts v0.21";
    self.navigationController.navigationBarHidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 0) {
        return 1;
    } else if (section == 1) {
        return 21;
    }

    return 0;

}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        UILabel *lblTitle = [[[UILabel alloc] init]autorelease];
        lblTitle.backgroundColor = [UIColor grayColor];
        lblTitle.textColor = [UIColor whiteColor];
        lblTitle.text = @"Charts Demo";
        return lblTitle;
    } else if (section == 1) {
        UILabel *lblTitle = [[[UILabel alloc] init]autorelease];
        lblTitle.backgroundColor = [UIColor grayColor];
        lblTitle.textColor = [UIColor whiteColor];
        lblTitle.text = @"Single Chart Demo";
        return lblTitle;
    } else {
        return nil;
    }
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return nil;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 22.0f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.0f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 44.0f;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }

    if (indexPath.section == 0) {
        cell.textLabel.text = @"Simple Demo";
    } else {
        NSUInteger row = indexPath.row;
        //    NSLog(@"%d",row);

        if (CCSChartTypeGridChart == row) {
            cell.textLabel.text = @"GridChart";
        }
        else if (CCSChartTypeLineChart == row) {
            cell.textLabel.text = @"LineChart";
        }
        else if (CCSChartTypeStickChart == row) {
            cell.textLabel.text = @"StickChart";
        }
        else if (CCSChartTypeMAStickChart == row) {
            cell.textLabel.text = @"MAStickChart";
        }
        else if (CCSChartTypeCandleStickChart == row) {
            cell.textLabel.text = @"CandleStickChart";
        }
        else if (CCSChartTypeMACandleStickChart == row) {
            cell.textLabel.text = @"MACandleStickChart";
        }
        else if (CCSChartTypePieChart == row) {
            cell.textLabel.text = @"PieChart";
        }
        else if (CCSChartTypePizzaChart == row) {
            cell.textLabel.text = @"PizzaChart";
        }
        else if (CCSChartTypeSpiderWebChart == row) {
            cell.textLabel.text = @"SpiderWebChart";
        }
        else if (CCSChartTypeMinusStickChart == row) {
            cell.textLabel.text = @"MinusStickChart";
        }
        else if (CCSChartTypeMACDChart == row) {
            cell.textLabel.text = @"MACDChart";
        }
        else if (CCSChartTypeAreaChart == row) {
            cell.textLabel.text = @"AreaChart";
        }
        else if (CCSChartTypeStackedAreaChart == row) {
            cell.textLabel.text = @"StackedAreaChart";
        }
        else if (CCSChartTypeBandAreaChart == row) {
            cell.textLabel.text = @"BandAreaChart";
        }
        else if (CCSChartTypeRadarChart == row) {
            cell.textLabel.text = @"RadarChart";
        }
        else if (CCSChartTypeSlipStickChart == row) {
            cell.textLabel.text = @"SlipStickChart";
        }
        else if (CCSChartTypeColoredSlipStickChart == row) {
            cell.textLabel.text = @"ColoredSlipStickChart";
        }
        else if (CCSChartTypeSlipCandleStickChart == row) {
            cell.textLabel.text = @"SlipCandleStickChart";
        }
        else if (CCSChartTypeMASlipCandleStickChart == row) {
            cell.textLabel.text = @"MASlipCandleStickChart";
        }
        else if (CCSChartTypeBOLLMASlipCandleStickChart == row) {
            cell.textLabel.text = @"BOLLMASlipCandleStickChart";
        }
        else if (CCSChartTypeSlipLineChart == row) {
            cell.textLabel.text = @"SlipLineChart";
        }
        else {
        }

    }

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    UIViewController *viewController = nil;

    if (indexPath.section == 0) {
        NSUInteger row = indexPath.row;
        if (row == 0) {
            viewController = [[[CCSSimpleDemoViewController alloc] init] autorelease];
        }
    } else if (indexPath.section == 1) {
        NSUInteger row = indexPath.row;
        if (CCSChartTypeGridChart == row) {
            viewController = [[[CCSGridChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeLineChart == row) {
            viewController = [[[CCSLineChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeStickChart == row) {
            viewController = [[[CCSStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeMAStickChart == row) {
            viewController = [[[CCSMAStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeCandleStickChart == row) {
            viewController = [[[CCSCandleStickViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeMACandleStickChart == row) {
            viewController = [[[CCSMACandleStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypePieChart == row) {
            viewController = [[[CCSPieChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypePizzaChart == row) {
            viewController = [[[CCSPizzaChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeSpiderWebChart == row) {
            viewController = [[[CCSSpiderWebChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeMinusStickChart == row) {
            viewController = [[[CCSMinusStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeMACDChart == row) {
            viewController = [[[CCSMACDChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeAreaChart == row) {
            viewController = [[[CCSAreaChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeStackedAreaChart == row) {
            viewController = [[[CCSStackedAreaChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeBandAreaChart == row) {
            viewController = [[[CCSBandAreaChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeRadarChart == row) {
            viewController = [[[CCSRadarChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeSlipStickChart == row) {
            viewController = [[[CCSSlipStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeColoredSlipStickChart == row) {
            viewController = [[[CCSColoredStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeSlipCandleStickChart == row) {
            viewController = [[[CCSSlipCandleStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeMASlipCandleStickChart == row) {
            viewController = [[[CCSMASlipCandleStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeBOLLMASlipCandleStickChart == row) {
            viewController = [[[CCSBOLLMASlipCandleStickChartViewController alloc] init] autorelease];
        }
        else if (CCSChartTypeSlipLineChart == row) {
            viewController = [[[CCSSlipLineChartViewController alloc] init] autorelease];
        }
        else {

        }
    } else {
        return;
    }
    CCSAppDelegate *appDelegate = (CCSAppDelegate *) [UIApplication sharedApplication].delegate;
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
        UINavigationController *navigationController = (UINavigationController *) appDelegate.viewController;
        [navigationController pushViewController:viewController animated:YES];
    } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        UISplitViewController *splitViewController = (UISplitViewController *) appDelegate.viewController;
        UINavigationController *navigationController = [splitViewController.viewControllers objectAtIndex:1];
        [navigationController popToRootViewControllerAnimated:NO];
        [navigationController pushViewController:viewController animated:YES];
    }
}

@end


text:
An endpoint is a semi-internal data structure that Moya uses to reason about
the network request that will ultimately be made. An endpoint stores the
following data:

- The url.
- The HTTP method (`GET`, `POST`, etc).
- The HTTP request header fields.
- `Task` to differentiate `upload`, `download` or `request`.
- The sample response (for unit testing).

[Providers](Providers.md) map [Targets](Targets.md) to Endpoints, then map
Endpoints to actual network requests.

There are two ways that you interact with Endpoints.

1. When creating a provider, you may specify a mapping from `Target` to `Endpoint`.
1. When creating a provider, you may specify a mapping from `Endpoint` to `URLRequest`.

The first might resemble the following:

```swift
let endpointClosure = { (target: MyTarget) -> Endpoint in
    let url = URL(target: target).absoluteString
    return Endpoint(url: url, sampleResponseClosure: {.networkResponse(200, target.sampleData)}, method: target.method, task: target.task, httpHeaderFields: target.headers)
}
```

This is actually the default implementation Moya provides. If you need something
custom, or if you're creating a test provider that returns non-200 HTTP statuses in unit tests,
this is where you would do it.

Notice the `URL(target:)` initializer, Moya provides a convenient extension to create a `URL` from any `TargetType`.

The second use is very uncommon. Moya tries to prevent you from having to worry
about low-level details. But it's there if you need it. Its use is covered
further below.

Let's take a look at an example of the flexibility mapping from a Target to
an Endpoint can provide.

## From Target to Endpoint

In this closure you have absolute power over converting from `Target` to `Endpoint`.
You can change the `task`, `method`, `url`, `headers` or `sampleResponse`.
For example, we may wish to set our application name in the HTTP header fields for server-side
analytics.

```swift
let endpointClosure = { (target: MyTarget) -> Endpoint in
    let defaultEndpoint = MoyaProvider.defaultEndpointMapping(for: target)
    return defaultEndpoint.adding(newHTTPHeaderFields: ["APP_NAME": "MY_AWESOME_APP"])
}
let provider = MoyaProvider<GitHub>(endpointClosure: endpointClosure)
```

*Note that header fields can also be added as part of the [Target](Targets.md) definition.*

This also means that you can provide additional parameters to some or all of
your endpoints. For example, say that there is an authentication token we need
for all values of the hypothetical `MyTarget` target, with the exception of the
target that actually does the authentication. We could construct an
`endpointClosure` resembling the following.

```swift
let endpointClosure = { (target: MyTarget) -> Endpoint in
    let defaultEndpoint = MoyaProvider.defaultEndpointMapping(for: target)

    // Sign all non-authenticating requests
    switch target {
    case .authenticate:
        return defaultEndpoint
    default:
        return defaultEndpoint.adding(newHTTPHeaderFields: ["AUTHENTICATION_TOKEN": GlobalAppStorage.authToken])
    }
}
let provider = MoyaProvider<GitHub>(endpointClosure: endpointClosure)
```

Awesome.

Note that we can rely on the existing behavior of Moya and extend – instead
of replace – it. The `adding(newHttpHeaderFields:)` function allows you to
rely on the existing Moya code and add your own custom values.

Sample responses are a requirement of the `TargetType` protocol. However, they
only specify the data returned. The Target-to-Endpoint mapping closure is where
you can specify more details, which is useful for unit testing.

Sample responses have one of these values:

- `.networkError(NSError)` when network failed to send the request, or failed to retrieve a response (eg a timeout).
- `.networkResponse(Int, Data)` where `Int` is a status code and `Data` is the returned data.
- `.response(HTTPURLResponse, Data)` where `HTTPURLResponse` is the response and `Data` is the returned data. This one can be used to fully stub a response.

## Request Mapping

As we mentioned earlier, the purpose of this library is not really to provide a
coding framework with which to access the network – that's Alamofire's job.
Instead, Moya is about a way to frame your thoughts about network access and
provide compile-time checking of well-defined network targets. You've already
seen how to map targets into endpoints using the `endpointClosure` parameter
of the `MoyaProvider` initializer. That lets you create an `Endpoint` instance
that Moya will use to reason about the network API call. At some point, that
`Endpoint` must be resolved into an actual `URLRequest` to give to Alamofire.
That's what the `requestClosure` parameter is for.

The `requestClosure` is an optional, last-minute way to modify the request
that hits the network. It has a default value of `MoyaProvider.defaultRequestMapping`,
which uses the `urlRequest()` method of the `Endpoint` instance. This `urlRequest()`
method throws three possible errors:
- `MoyaError.requestMapping(String)` when `URLRequest` could not be created for given path
- `MoyaError.parameterEncoding(Swift.Error)` when parameters couldn't be encoded
- `MoyaError.encodableMapping(Swift.Error)` when `Encodable` object couldn't be encoded into `Data`

This closure receives an `Endpoint` instance and is responsible for invoking
its argument of `RequestResultClosure` (shorthand for `Result<URLRequest, MoyaError> -> Void`) with a request that represents the Endpoint.
It's here that you'd do your OAuth signing or whatever. Since you may invoke the
closure asynchronously, you can use whatever authentication library you like ([example](https://github.com/rheinfabrik/Heimdallr.swift)).
Instead of modifying the request, you could simply log it, instead.

```swift
let requestClosure = { (endpoint: Endpoint, done: MoyaProvider.RequestResultClosure) in
    do {
        var request = try endpoint.urlRequest()
        // Modify the request however you like.
        done(.success(request))
    } catch {
        done(.failure(MoyaError.underlying(error)))
    }

}
let provider = MoyaProvider<GitHub>(requestClosure: requestClosure)
```

This `requestClosure` is useful for modifying properties specific to the `URLRequest` or providing information to the request that cannot be known until that request is created, like cookies settings. Note that the `endpointClosure` mentioned above is not intended for this purpose or any request-specific application-level mapping.

This parameter is actually very useful for modifying the request object.
`URLRequest` has many properties you can customize. Say you want to disable
all cookies on requests:

```swift
{ (endpoint: Endpoint, done: MoyaProvider.RequestResultClosure) in
    do {
        var request: URLRequest = try endpoint.urlRequest()
        request.httpShouldHandleCookies = false
        done(.success(request))
    } catch {
        done(.failure(MoyaError.underlying(error)))
    }
}
```

You could also perform logging of network requests, since this closure is
invoked just before the request is sent to the network.