text:
package parser

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"regexp"
	"strings"
	"unicode"

	"github.com/docker/docker/builder/dockerfile/command"
)

// Node is a structure used to represent a parse tree.
//
// In the node there are three fields, Value, Next, and Children. Value is the
// current token's string value. Next is always the next non-child token, and
// children contains all the children. Here's an example:
//
// (value next (child child-next child-next-next) next-next)
//
// This data structure is frankly pretty lousy for handling complex languages,
// but lucky for us the Dockerfile isn't very complicated. This structure
// works a little more effectively than a "proper" parse tree for our needs.
//
type Node struct {
	Value      string          // actual content
	Next       *Node           // the next item in the current sexp
	Children   []*Node         // the children of this sexp
	Attributes map[string]bool // special attributes for this node
	Original   string          // original line used before parsing
	Flags      []string        // only top Node should have this set
	StartLine  int             // the line in the original dockerfile where the node begins
	EndLine    int             // the line in the original dockerfile where the node ends
}

// Directive is the structure used during a build run to hold the state of
// parsing directives.
type Directive struct {
	EscapeToken           rune           // Current escape token
	LineContinuationRegex *regexp.Regexp // Current line contination regex
	LookingForDirectives  bool           // Whether we are currently looking for directives
	EscapeSeen            bool           // Whether the escape directive has been seen
}

var (
	dispatch           map[string]func(string, *Directive) (*Node, map[string]bool, error)
	tokenWhitespace    = regexp.MustCompile(`[\t\v\f\r ]+`)
	tokenEscapeCommand = regexp.MustCompile(`^#[ \t]*escape[ \t]*=[ \t]*(?P<escapechar>.).*$`)
	tokenComment       = regexp.MustCompile(`^#.*$`)
)

// DefaultEscapeToken is the default escape token
const DefaultEscapeToken = "\\"

// SetEscapeToken sets the default token for escaping characters in a Dockerfile.
func SetEscapeToken(s string, d *Directive) error {
	if s != "`" && s != "\\" {
		return fmt.Errorf("invalid ESCAPE '%s'. Must be ` or \\", s)
	}
	d.EscapeToken = rune(s[0])
	d.LineContinuationRegex = regexp.MustCompile(`\` + s + `[ \t]*$`)
	return nil
}

func init() {
	// Dispatch Table. see line_parsers.go for the parse functions.
	// The command is parsed and mapped to the line parser. The line parser
	// receives the arguments but not the command, and returns an AST after
	// reformulating the arguments according to the rules in the parser
	// functions. Errors are propagated up by Parse() and the resulting AST can
	// be incorporated directly into the existing AST as a next.
	dispatch = map[string]func(string, *Directive) (*Node, map[string]bool, error){
		command.Add:         parseMaybeJSONToList,
		command.Arg:         parseNameOrNameVal,
		command.Cmd:         parseMaybeJSON,
		command.Copy:        parseMaybeJSONToList,
		command.Entrypoint:  parseMaybeJSON,
		command.Env:         parseEnv,
		command.Expose:      parseStringsWhitespaceDelimited,
		command.From:        parseString,
		command.Healthcheck: parseHealthConfig,
		command.Label:       parseLabel,
		command.Maintainer:  parseString,
		command.Onbuild:     parseSubCommand,
		command.Run:         parseMaybeJSON,
		command.Shell:       parseMaybeJSON,
		command.StopSignal:  parseString,
		command.User:        parseString,
		command.Volume:      parseMaybeJSONToList,
		command.Workdir:     parseString,
	}
}

// ParseLine parses a line and returns the remainder.
func ParseLine(line string, d *Directive) (string, *Node, error) {
	// Handle the parser directive '# escape=<char>. Parser directives must precede
	// any builder instruction or other comments, and cannot be repeated.
	if d.LookingForDirectives {
		tecMatch := tokenEscapeCommand.FindStringSubmatch(strings.ToLower(line))
		if len(tecMatch) > 0 {
			if d.EscapeSeen == true {
				return "", nil, fmt.Errorf("only one escape parser directive can be used")
			}
			for i, n := range tokenEscapeCommand.SubexpNames() {
				if n == "escapechar" {
					if err := SetEscapeToken(tecMatch[i], d); err != nil {
						return "", nil, err
					}
					d.EscapeSeen = true
					return "", nil, nil
				}
			}
		}
	}

	d.LookingForDirectives = false

	if line = stripComments(line); line == "" {
		return "", nil, nil
	}

	if d.LineContinuationRegex.MatchString(line) {
		line = d.LineContinuationRegex.ReplaceAllString(line, "")
		return line, nil, nil
	}

	cmd, flags, args, err := splitCommand(line)
	if err != nil {
		return "", nil, err
	}

	node := &Node{}
	node.Value = cmd

	sexp, attrs, err := fullDispatch(cmd, args, d)
	if err != nil {
		return "", nil, err
	}

	node.Next = sexp
	node.Attributes = attrs
	node.Original = line
	node.Flags = flags

	return "", node, nil
}

// Parse is the main parse routine.
// It handles an io.ReadWriteCloser and returns the root of the AST.
func Parse(rwc io.Reader, d *Directive) (*Node, error) {
	currentLine := 0
	root := &Node{}
	root.StartLine = -1
	scanner := bufio.NewScanner(rwc)

	utf8bom := []byte{0xEF, 0xBB, 0xBF}
	for scanner.Scan() {
		scannedBytes := scanner.Bytes()
		// We trim UTF8 BOM
		if currentLine == 0 {
			scannedBytes = bytes.TrimPrefix(scannedBytes, utf8bom)
		}
		scannedLine := strings.TrimLeftFunc(string(scannedBytes), unicode.IsSpace)
		currentLine++
		line, child, err := ParseLine(scannedLine, d)
		if err != nil {
			return nil, err
		}
		startLine := currentLine

		if line != "" && child == nil {
			for scanner.Scan() {
				newline := scanner.Text()
				currentLine++

				if stripComments(strings.TrimSpace(newline)) == "" {
					continue
				}

				line, child, err = ParseLine(line+newline, d)
				if err != nil {
					return nil, err
				}

				if child != nil {
					break
				}
			}
			if child == nil && line != "" {
				_, child, err = ParseLine(line, d)
				if err != nil {
					return nil, err
				}
			}
		}

		if child != nil {
			// Update the line information for the current child.
			child.StartLine = startLine
			child.EndLine = currentLine
			// Update the line information for the root. The starting line of the root is always the
			// starting line of the first child and the ending line is the ending line of the last child.
			if root.StartLine < 0 {
				root.StartLine = currentLine
			}
			root.EndLine = currentLine
			root.Children = append(root.Children, child)
		}
	}

	return root, nil
}


text:
# YARD ActiveRecord Plugin

[![Version](http://img.shields.io/gem/v/yard-activerecord.svg?style=flat-square)](https://rubygems.org/gems/yard-activerecord)
[![Downloads](http://img.shields.io/gem/dt/yard-activerecord.svg?style=flat-square)](https://rubygems.org/gems/yard-activerecord)
[![Open Github issues](http://img.shields.io/github/issues/theodorton/yard-activerecord.svg?style=flat-square)](https://github.com/theodorton/yard-activerecord/issues)

A YARD extension that handles and interprets methods used when developing
applications with ActiveRecord. The extension handles attributes,
associations, delegates and scopes. A must for any Rails app using YARD as
documentation plugin.

## Installation

Run the following command in order to load YARD plugins:

```
$ yard config load_plugins true
```

## Attributes

In order for this plugin to document any database attributes you need to add
`schema.rb` to your list of files. This is preferably done with in `.yardopts`
within your app project folder:

```
# .yardopts
'app/**/*.rb'
'db/schema.rb'
```

It's important that the `schema.rb`-file is added at the end as it needs all
classes loaded before it can add the attributes.

The plugin will then document all attributes in your documentation.

All attributes will be marked as writable. I will update the plugin to include
handling of `attr_accessible` at a later point.

Please note that any reference-fields that ends with `_id` will not be handled
as an attribute. Please see Associations.

There is an issue with namespaced classes. Currently this plugin will try and
fetch a class with a namespace if it does not find one at the first try.

Example:

    Table name        Class name
    sales_people      SalesPeople # does not exist
    sales_people      Sales::People # does exist

A problem then emerges if you have namespaces with two names.

Example:

    Table name          Class name
    sales_force_people  SalesForcePeople # does not exist
    sales_force_people  Sales::ForcePeople # does not exist

The documentation will then be skipped for this table/class.

## Associations

The plugin handles `has_one`, `belongs_to`, `has_many` and
`has_and_belongs_to_many` associations. The annotation for each association
includes a link to the referred model. For associations with a list of objects
the documentation will simply be marked as `Array<ModelName>`.

## Delegates

The plugin handles `delegate`-methods and marks these delegated instance
methods simply as aliases for the associated object.

## Scopes

The plugin will add class methods for any scopes you have defined in your
models.

## Validations ##

The plugin will add information about validations onto each field.  It only handles
the new style validations in the form of:

    validates :foo, :presence=>true, :length=>{ is: 6 }

Validations in the older form of:

    validates_presence_of :foo

are not supported.

## Other useful plugins

Check out:

  * [https://github.com/ogeidix/yard-rails-plugin](https://github.com/ogeidix/yard-rails-plugin)

## Contributing to yard-activerecord

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
* Fork the project.
* Start a feature/bugfix branch.
* Commit and push until you are happy with your contribution.
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

## Copyright

Copyright (c) 2014 Theodor Tonum. See LICENSE.txt for
further details.

redpajama_set_name: RedPajamaGithub


text:
title: How to use the Feathers ToggleSwitch component
author: Josh Tynjala

---
# How to use the Feathers `ToggleSwitch` component

The [`ToggleSwitch`](../api-reference/feathers/controls/ToggleSwitch.html) component switches between on and off states. It can be considered a stylized alternative to a [`Check`](check.html) control that is especially relevant when targeting touch screens. The thumb may be dragged from side to side, or it may be tapped to change selection.

## The Basics

First, let's create a toggle switch, select it, and add it to the display list.

``` code
var toggle:ToggleSwitch = new ToggleSwitch();
toggle.isSelected = true;
this.addChild( toggle );
```

The [`isSelected`](../api-reference/feathers/controls/ToggleSwitch.html#isSelected) property indicates if the toggle switch is on (`true`) or off (`false`). Add a listener to [`Event.CHANGE`](../api-reference/feathers/controls/ToggleSwitch.html#event:change) to know when the `isSelected` property changes:

``` code
toggle.addEventListener( Event.CHANGE, toggle_changeHandler );
```

The listener might look something like this:

``` code
function toggle_changeHandler( event:Event ):void
{
    var toggle:ToggleSwitch = ToggleSwitch( event.currentTarget );
    trace( "toggle.isSelected changed:", toggle.isSelected );
}
```

## Skinning a `ToggleSwitch`

The skins for a `ToggleSwitch` control are divided into the thumb, labels for off and on text, and one or two tracks. For full details about what skin and style properties are available, see the [`ToggleSwitch` API reference](../api-reference/feathers/controls/ToggleSwitch.html). We'll look at a few of the most common properties below.

### Targeting a `ToggleSwitch` in a theme

If you are creating a [theme](themes.html), you can set a function for the default styles like this:

``` code
getStyleProviderForClass( ToggleSwitch ).defaultStyleFunction = setToggleSwitchStyles;
```

If you want to customize a specific toggle switch to look different than the default, you may use a custom style name to call a different function:

``` code
toggle.styleNameList.add( "custom-toggle-switch" );
```

You can set the function for the custom style name like this:

``` code
getStyleProviderForClass( ToggleSwitch )
    .setFunctionForStyleName( "custom-toggle-switch", setCustomToggleSwitchStyles );
```

Trying to change the toggle switch's styles and skins outside of the theme may result in the theme overriding the properties, if you set them before the toggle switch was added to the stage and initialized. Learn to [extend an existing theme](extending-themes.html) to add custom skins.

If you aren't using a theme, then you may set any of the toggle switch's properties directly.

### Skinning the Labels

The on and off skins are text renderers that may be skinned separately or using default properties for both.

``` code
toggle.defaultLabelProperties.textFormat = new BitmapFontTextFormat( myBitmapFont );
```

If you wanted the on label to be different, you could use different properties for each label:

``` code
toggle.defaultLabelProperties.textFormat = new BitmapFontTextFormat( myBitmapFont );
toggle.onLabelProperties.textFormat = new BitmapFontTextFormat( myBitmapFont, myBitmapFont.size, 0xff9900 );
```

### Skinning the Thumb

This section only explains how to access the thumb sub-component. Please read [How to use the Feathers `Button` component](button.html) for full details about the skinning properties that are available on `Button` components.

#### With a Theme

If you're creating a [theme](themes.html), you can target the [`ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB`](../api-reference/feathers/controls/ToggleSwitch.html#DEFAULT_CHILD_STYLE_NAME_THUMB) style name.

``` code
getStyleProviderForClass( Button )
    .setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, setToggleSwitchThumbStyles );
```

You can override the default style name to use a different one in your theme, if you prefer:

``` code
toggle.customThumbStyleName = "custom-thumb";
```

You can set the function for the [`customThumbStyleName`](../api-reference/feathers/controls/ToggleSwitch.html#customThumbStyleName) like this:

``` code
getStyleProviderForClass( Button )
    .setFunctionForStyleName("custom-thumb", setToggleSwitchCustomThumbStyles );
```

#### Without a Theme

If you are not using a theme, you can use [`thumbFactory`](../api-reference/feathers/controls/ToggleSwitch.html#thumbFactory) to provide skins for the toggle switch's thumb:

``` code
toggle.thumbFactory = function():Button
{
    var button:Button = new Button();
    //skin the thumb here
    button.defaultSkin = new Image( upTexture );
    button.downSkin = new Image( downTexture );
    return button;
}
```

Alternatively, or in addition to the `thumbFactory`, you may use the [`thumbProperties`](../api-reference/feathers/controls/ToggleSwitch.html#thumbProperties) to pass skins to the thumb.

``` code
toggle.thumbProperties.defaultSkin = new Image( upTexture );
toggle.thumbProperties.downSkin = new Image( downTexture );
```

In general, you should only skins to the toggle switch's thumb through `thumbProperties` if you need to change skins after the thumb is created. Using `thumbFactory` will provide slightly better performance, and your development environment will be able to provide code hinting thanks to stronger typing.

### Track(s) and Layout

The toggle switch's track is made from either one or two buttons, depending on the value of the [`trackLayoutMode`](../api-reference/feathers/controls/ToggleSwitch.html#trackLayoutMode) property. The default value of this property is [`ToggleSwitch.TRACK_LAYOUT_MODE_SINGLE`](../api-reference/feathers/controls/ToggleSwitch.html#TRACK_LAYOUT_MODE_SINGLE), which creates a single track that fills the entire width and height of the toggle switch.

If we'd like to have separate buttons for both sides of the track (one for the on side and another for the off side), we can set `trackLayoutMode` to [`ToggleSwitch.TRACK_LAYOUT_MODE_ON_OFF`](../api-reference/feathers/controls/ToggleSwitch.html#TRACK_LAYOUT_MODE_ON_OFF). In this mode, the width or height of each track (depending on the direction of the toggle switch) is adjusted as the thumb moves to ensure that the two tracks always meet at the center of the thumb.

`ToggleSwitch.TRACK_LAYOUT_MODE_SINGLE` is often best for cases where the track's appearance is mostly static. When you want down or hover states for the track, `ToggleSwitch.TRACK_LAYOUT_MODE_ON_OFF` works better because the state will only change on one side of the thumb, making it more visually clear to the user what is happening.

When the value of `trackLayoutMode` is `ToggleSwitch.TRACK_LAYOUT_MODE_SINGLE`, the toggle switch will have a on track, but it will not have a off track. The on track will fill the entire region that is draggable.

### Skinning the On Track

This section only explains how to access the on track sub-component. Please read [How to use the Feathers `Button` component](button.html) for full details about the skinning properties that are available on `Button` components.

#### With a Theme

If you're creating a [theme](themes.html), you can target the [`ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK`](../api-reference/feathers/controls/ToggleSwitch.html#DEFAULT_CHILD_STYLE_NAME_ON_TRACK) style name.

``` code
getStyleProviderForClass( Button )
    .setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, setToggleSwitchOnTrackStyles );
```

You can override the default style name to use a different one in your theme, if you prefer:

``` code
toggle.customOnTrackStyleName = "custom-on-track";
```

You can set the function for the [`customOnTrackStyleName`](../api-reference/feathers/controls/ToggleSwitch.html#customOnTrackStyleName) like this:

``` code
getStyleProviderForClass( Button )
    .setFunctionForStyleName( "custom-on-track", setToggleSwitchCustomOnTrackStyles );
```

#### Without a Theme

If you are not using a theme, you can use [`onTrackFactory`](../api-reference/feathers/controls/ToggleSwitch.html#onTrackFactory) to provide skins for the toggle switch's on track:

``` code
toggle.onTrackFactory = function():Button
{
    var button:Button = new Button();
    //skin the on track here
    button.defaultSkin = new Image( upTexture );
    button.downSkin = new Image( downTexture );
    return button;
}
```

Alternatively, or in addition to the `onTrackFactory`, you may use the [`onTrackProperties`](../api-reference/feathers/controls/ToggleSwitch.html#onTrackProperties) to pass skins to the on track.

``` code
toggle.onTrackProperties.defaultSkin = new Image( upTexture );
toggle.onTrackProperties.downSkin = new Image( downTexture );
```

In general, you should only pass properties to the toggle switch's on track through `onTrackProperties` if you need to change these values after the on track is created. Using `onTrackFactory` will provide slightly better performance, and your development environment will be able to provide code hinting thanks to stronger typing.

### Skinning the Off Track

This section only explains how to access the off track sub-component. Please read [How to use the Feathers `Button` component](button.html) for full details about the skinning properties that are available on `Button` components.

The toggle switch's off track may be skinned similarly to the on track. The style name to use with [themes](themes.html) is [`ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_OFF_TRACK`](../api-reference/feathers/controls/ToggleSwitch.html#DEFAULT_CHILD_STYLE_NAME_OFF_TRACK) or you can customize the style name with [`customOffTrackStyleName`](../api-reference/feathers/controls/ToggleSwitch.html#customOffTrackStyleName). If you aren't using a theme, then you can use [`offTrackFactory`](../api-reference/feathers/controls/ToggleSwitch.html#offTrackFactory) and [`offTrackProperties`](../api-reference/feathers/controls/ToggleSwitch.html#offTrackProperties).

## Related Links

-   [`feathers.controls.ToggleSwitch` API Documentation](../api-reference/feathers/controls/ToggleSwitch.html)


text:
/*    */ package com.wshop.web.entity;
/*    */
/*    */ import java.io.Serializable;
/*    */ import javax.persistence.Column;
/*    */ import javax.persistence.Entity;
/*    */ import javax.persistence.Id;
/*    */ import javax.persistence.Table;
/*    */
/*    */ @Entity
/*    */ @Table(name="T_ATTRIBUTE_VALUE")
/*    */ public class AttributeValueEntity
/*    */   implements Serializable
/*    */ {
/*    */   private static final long serialVersionUID = 6720035914221627100L;
/*    */   @Id
/*    */   @Column(name="OPTIONID", unique=true, nullable=false, length=10)
/*    */   private Integer optionid;
/*    */   @Column(name="ATTRIBUTEID", nullable=true, length=10)
/*    */   private Integer attributeid;
/*    */   @Column(name="OPTIONNAME", nullable=true, length=100)
/*    */   private String optionname;
/*    */
/*    */   public Integer getOptionid()
/*    */   {
/* 50 */     return this.optionid;
/*    */   }
/*    */
/*    */   public void setOptionid(Integer optionid)
/*    */   {
/* 59 */     this.optionid = optionid;
/*    */   }
/*    */
/*    */   public Integer getAttributeid()
/*    */   {
/* 68 */     return this.attributeid;
/*    */   }
/*    */
/*    */   public void setAttributeid(Integer attributeid)
/*    */   {
/* 77 */     this.attributeid = attributeid;
/*    */   }
/*    */
/*    */   public String getOptionname()
/*    */   {
/* 86 */     return this.optionname;
/*    */   }
/*    */
/*    */   public void setOptionname(String optionname)
/*    */   {
/* 95 */     this.optionname = optionname;
/*    */   }
/*    */ }

/* Location:           H:\Java\SpringBoot\wshop-0.0.1-SNAPSHOT\BOOT-INF\classes\
 * Qualified Name:     com.wshop.web.entity.AttributeValueEntity
 * JD-Core Version:    0.7.0.1
 */


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <artifactId>kie-server</artifactId>
    <groupId>org.kie.docker</groupId>
    <version>1.0.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>kie-server-base</artifactId>
  <packaging>pom</packaging>
  <name>KIE Execution Server (Base Distribution) - Docker integration</name>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-base-distribution</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>${project.basedir}/src/main/assembly/base-assembly.xml</descriptor>
          </descriptors>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
          </archive>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>


text:
var adapter = require('../adapters/localforage.js')
var localforage = require('localforage')
var driver = localforage.WEBSQL

module.exports = function(name) {
    return new adapter(driver, name)
}


text:
package com.amazonaws.services.elasticloadbalancing.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.elasticloadbalancing.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * DetachLoadBalancerFromSubnetsRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DetachLoadBalancerFromSubnetsRequestMarshaller implements
        Marshaller<Request<DetachLoadBalancerFromSubnetsRequest>, DetachLoadBalancerFromSubnetsRequest> {

    public Request<DetachLoadBalancerFromSubnetsRequest> marshall(DetachLoadBalancerFromSubnetsRequest detachLoadBalancerFromSubnetsRequest) {

        if (detachLoadBalancerFromSubnetsRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<DetachLoadBalancerFromSubnetsRequest> request = new DefaultRequest<DetachLoadBalancerFromSubnetsRequest>(detachLoadBalancerFromSubnetsRequest,
                "AmazonElasticLoadBalancing");
        request.addParameter("Action", "DetachLoadBalancerFromSubnets");
        request.addParameter("Version", "2012-06-01");
        request.setHttpMethod(HttpMethodName.POST);

        if (detachLoadBalancerFromSubnetsRequest.getLoadBalancerName() != null) {
            request.addParameter("LoadBalancerName", StringUtils.fromString(detachLoadBalancerFromSubnetsRequest.getLoadBalancerName()));
        }

        if (!detachLoadBalancerFromSubnetsRequest.getSubnets().isEmpty()
                || !((com.amazonaws.internal.SdkInternalList<String>) detachLoadBalancerFromSubnetsRequest.getSubnets()).isAutoConstruct()) {
            com.amazonaws.internal.SdkInternalList<String> subnetsList = (com.amazonaws.internal.SdkInternalList<String>) detachLoadBalancerFromSubnetsRequest
                    .getSubnets();
            int subnetsListIndex = 1;

            for (String subnetsListValue : subnetsList) {
                if (subnetsListValue != null) {
                    request.addParameter("Subnets.member." + subnetsListIndex, StringUtils.fromString(subnetsListValue));
                }
                subnetsListIndex++;
            }
        }

        return request;
    }

}


text:
@interface UserCenterViewController ()<UIScrollViewDelegate>

@property (nonatomic, strong) UIView *topBarView;

@property (nonatomic,strong) UILabel *nickNamelabel;        //昵称

@property (nonatomic,strong) UIView *infoBgView;        //头像区域的背景view
@property (nonatomic, strong) UIView *cornerView;

@property (nonatomic,strong) UIView *dotView;

@property (nonatomic,strong) UIView *infoView;
@property (nonatomic,strong) UILabel *briefLabel;       //简介
@property (nonatomic,strong) UIButton *headBtn;     //头像背景
@property (nonatomic,strong) UIButton *avatarBtn;     //头像
@property (nonatomic, strong) UIButton *rightBtn;

@property (nonatomic,strong) UIView *contentView;

@end

@implementation UserCenterViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
//    [self.navigationController.navigationBar setHidden:YES];        //此条语句可控制tabbar透明

    if([[CXLocalUser instance] isLogin]){
        _nickNamelabel.text = [CXLocalUser instance].nickname;
        if([CXLocalUser instance].signature != nil && [[CXLocalUser instance].signature length] != 0){
            _briefLabel.text = [CXLocalUser instance].signature;
        }else{
            _briefLabel.text = @"(^-^) 介绍一下自己吧";
        }
        NSString *avatarUrl = [NSString getAvatarUrl:[CXLocalUser instance].avatar];
        [_avatarBtn yy_setImageWithURL:[NSURL URLWithString:avatarUrl] forState:UIControlStateNormal placeholder:[UIImage imageNamed:@"defaultUserPhoto"]];

    }else{
        NSString *avatarUrl = [NSString getAvatarUrl:[CXLocalUser instance].avatar];
        [_avatarBtn yy_setImageWithURL:[NSURL URLWithString:avatarUrl] forState:UIControlStateNormal placeholder:[UIImage imageNamed:@"defaultUserPhoto"]];
        _nickNamelabel.text = @"请登录";
        _briefLabel.text = @"(^-^) 介绍一下自己吧";
    }
    [self updateInfoViewHeight];

    //改变主题
    NSInteger themeType = [CXUserDefaults instance].themeType;
    _infoView.backgroundColor = [CXUserDefaults instance].centerColor;
    _cornerView.backgroundColor = [CXUserDefaults instance].centerColor;
    _topBarView.backgroundColor = [CXUserDefaults instance].centerColor;
    _infoBgView.backgroundColor = [CXUserDefaults instance].centerColor;

    if(themeType == 2){
         [_rightBtn setImage:[UIImage imageNamed:@"right_arrow_black"] forState:UIControlStateNormal];
    }else{
        [_rightBtn setImage:[UIImage imageNamed:@"right_arrow_white"] forState:UIControlStateNormal];
    }

}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self createUI];

}

- (void)createUI{

    _topBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CXScreenWidth, CX_PHONE_NAVIGATIONBAR_HEIGHT)];
    _topBarView.backgroundColor = [CXUserDefaults instance].centerColor;
    [self.view addSubview:_topBarView];

    //创建导航栏
    [self.view addSubview:self.nickNamelabel];
    [_nickNamelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(16);
        make.top.mas_equalTo(self.view.mas_top).mas_offset(CX_PHONE_STATUSBAR_HEIGHT+14);
        make.centerX.mas_equalTo(self.view.mas_centerX);
    }];

    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftBtn setImage:[UIImage imageNamed:@"mine_message"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(clickMessage) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:leftBtn];
    [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.and.height.mas_equalTo(20);
        make.left.mas_equalTo(self.view).mas_offset(15);
        make.top.mas_equalTo(self.view).mas_offset(CX_PHONE_STATUSBAR_HEIGHT+12);
    }];

    _dotView = [[UIView alloc] init];
    _dotView.backgroundColor = CXHexColor(0xff4b4b);
    [_dotView cornerRadius:3 borderWidth:0.f borderColor:nil];
    [self.view addSubview:_dotView];
    [_dotView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(6);
        make.left.mas_equalTo(leftBtn.mas_right);
        make.bottom.mas_equalTo(leftBtn.mas_top);
    }];

    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setImage:[UIImage imageNamed:@"mine_settings"] forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(clickSet) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:rightBtn];
    [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.and.height.mas_equalTo(40);
        make.right.mas_equalTo(self.view).mas_offset(-5);
        make.top.mas_equalTo(self.view).mas_offset(CX_PHONE_STATUSBAR_HEIGHT);
    }];

    //创建用户头像与个性签名
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, CX_PHONE_NAVIGATIONBAR_HEIGHT, CXScreenWidth, CXScreenHeight-CX_PHONE_NAVIGATIONBAR_HEIGHT-CX_PHONE_TABBAR_HEIGHT)];
    scrollView.backgroundColor = CXBackGroundColor;
    scrollView.showsVerticalScrollIndicator = NO;
    scrollView.alwaysBounceVertical = YES;
    scrollView.contentSize = CGSizeMake(CXScreenWidth, 64.f);
    scrollView.delegate = self;
    [self.view addSubview:scrollView];

     _infoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CXScreenWidth, 145)];
    _infoView.backgroundColor = [CXUserDefaults instance].centerColor;

    _infoBgView = [[UIView alloc] init];
    _infoBgView.backgroundColor = [CXUserDefaults instance].centerColor;
    [_infoView addSubview:_infoBgView];
    [_infoBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.mas_equalTo(_infoView);
        make.width.mas_equalTo(CXScreenWidth);
        make.height.mas_equalTo(0);
    }];

    [_infoView addSubview:self.headBtn];
    [_headBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(_infoView.mas_centerX);
        make.width.and.height.mas_equalTo(90);
        make.top.mas_equalTo(_infoView.mas_top).mas_offset(10);
    }];

    [_infoView addSubview:self.avatarBtn];
    [_avatarBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.centerY.mas_equalTo(_headBtn);
        make.width.and.height.mas_equalTo(58);
    }];

    [_infoView addSubview:self.briefLabel];
    [_briefLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_infoView.mas_left).mas_offset(40);
        make.right.mas_equalTo(_infoView.mas_right).mas_offset(-40);
        make.height.mas_equalTo(15);
        make.centerX.mas_equalTo(_infoView.mas_centerX);
        make.centerY.mas_equalTo(_infoView.mas_bottom).mas_offset(-22.5);
    }];

    [self updateInfoViewHeight];

    [_infoView layoutIfNeeded];          //通过在父亲视图中调用layoutIfNeeded立即更新约束

    _rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_rightBtn setImage:[UIImage imageNamed:@"right_arrow_black"] forState:UIControlStateNormal];
    [_rightBtn addTarget:self action:@selector(clickInfo) forControlEvents:UIControlEventTouchUpInside];
    [_infoView addSubview:_rightBtn];
    [_rightBtn mas_updateConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(_infoView.mas_right).mas_offset(-10);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30);
//        make.edges.mas_equalTo();
        make.centerY.mas_equalTo(_headBtn.mas_centerY);
    }];

    [scrollView addSubview:_infoView];

    _cornerView = [[UIView alloc] init];       //内容区域圆角的背景
    _cornerView.backgroundColor = [CXUserDefaults instance].centerColor;;
    [scrollView addSubview:_cornerView];
    [_cornerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_infoView.mas_bottom);
        make.width.mas_equalTo(CXScreenWidth);
        make.height.mas_equalTo(CXTopCornerRadius);
    }];

    CGFloat itemWidth = CXScreenWidth/4;
    [scrollView addSubview:self.contentView];
    [_contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_infoView.mas_bottom);
        make.width.mas_equalTo(CXScreenWidth);
        make.height.mas_equalTo(SectionHeaderHeight*2+itemWidth*4+20);
        make.bottom.mas_equalTo(scrollView.mas_bottom);
    }];

    [scrollView layoutIfNeeded];               //通过在父亲视图中调用layoutIfNeeded立即更新约束  否则frame属性获取为0

    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, CXScreenWidth, _contentView.height) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(CXTopCornerRadius, CXTopCornerRadius)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = CGRectMake(0, 0, CXScreenWidth, _contentView.height);
    maskLayer.path = maskPath.CGPath;
    _contentView.layer.mask = maskLayer;

    scrollView.contentSize = CGSizeMake(CXScreenWidth, _infoView.height+_contentView.height);

    [self.view addSubview:scrollView];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

//getter  setter
- (UILabel *)nickNamelabel{
    if(!_nickNamelabel){
        _nickNamelabel = [[UILabel alloc] init];
        _nickNamelabel.text = @"请登录";
        _nickNamelabel.font = CXSystemFont(16);
        _nickNamelabel.textAlignment = NSTextAlignmentCenter;
    }
    return _nickNamelabel;
}

- (UIButton *)headBtn{
    if(!_headBtn){
        _headBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_headBtn setImage:[UIImage imageNamed:@"mine_bg_avatar"] forState:UIControlStateNormal];
        _headBtn.layer.cornerRadius = 45;
        _headBtn.clipsToBounds = YES;
        [_headBtn addTarget:self action:@selector(clickLogin) forControlEvents:UIControlEventTouchUpInside];
    }
    return _headBtn;
}

- (UIButton *)avatarBtn{
    if(!_avatarBtn){
        _avatarBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_avatarBtn setImage:[UIImage imageNamed:@"defaultUserPhoto"] forState:UIControlStateNormal];
        _avatarBtn.layer.cornerRadius = 29;
        _avatarBtn.clipsToBounds = YES;
        [_avatarBtn addTarget:self action:@selector(clickLogin) forControlEvents:UIControlEventTouchUpInside];
    }
    return _avatarBtn;
}

- (UILabel *)briefLabel{
    if(!_briefLabel){
        _briefLabel = [[UILabel alloc] init];
        _briefLabel.font = CXSystemFont(12);
        _briefLabel.textColor = CXTextGrayColor;
        _briefLabel.numberOfLines = 2;
        _briefLabel.text = @"(^-^) 介绍一下自己吧";
        _briefLabel.alpha = 0.5;
        _briefLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _briefLabel;
}

- (UIView *)contentView{
    if(!_contentView){
        _contentView = [[UIView alloc] init];
        _contentView.backgroundColor = CXWhiteColor;

        CGFloat offsetY = 0;
        CGFloat width = CXScreenWidth/4;
        CGFloat height = width;

        #pragma mark - 创建我的应用栏

        UILabel *mySetionlabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CXScreenWidth, 15)];
        mySetionlabel.text = @"我的应用";
        mySetionlabel.font = CXSystemFont(14);
        mySetionlabel.textAlignment = NSTextAlignmentLeft;

        [_contentView addSubview:mySetionlabel];
        [mySetionlabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_contentView).mas_offset(15);
            make.top.mas_offset(_contentView.top).mas_offset(15);
            make.height.mas_equalTo(15);
        }];

        offsetY += 45;
        CGFloat startY = offsetY;

        UIView *hLine1 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine1.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine1];

        CXSectionButton *btn1 = [[CXSectionButton alloc] init:CGRectMake(0, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine1"]
                                                     andTitle:@"我的课表"];
        [btn1 addTarget:self action:@selector(gotoMyCourseTable) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn1];

        CXSectionButton *btn2 = [[CXSectionButton alloc] init:CGRectMake(width, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine2"]
                                                     andTitle:@"考试安排"];
        [btn2 addTarget:self action:@selector(gotoMyExam) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn2];

        CXSectionButton *btn3 = [[CXSectionButton alloc] init:CGRectMake(width*2, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine3"]
                                                     andTitle:@"成绩查询"];
        [btn3 addTarget:self action:@selector(gotoMyScore) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn3];

        CXSectionButton *btn4 = [[CXSectionButton alloc] init:CGRectMake(width*3, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine4"]
                                                     andTitle:@"绩点查询"];
        [btn4 addTarget:self action:@selector(gotoMyScorePoint) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn4];

        offsetY += height;
        UIView *hLine2 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine2.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine2];

        CXSectionButton *btn5 = [[CXSectionButton alloc] init:CGRectMake(0, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine5"]
                                                     andTitle:@"借书查询"];
        [btn5 addTarget:self action:@selector(gotoMyBookInfo) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn5];

        CXSectionButton *btn6 = [[CXSectionButton alloc] init:CGRectMake(width, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine6"]
                                                     andTitle:@"个人日程"];
        [_contentView addSubview:btn6];
        [btn6 addTarget:self action:@selector(gotoMySchedule) forControlEvents:UIControlEventTouchUpInside];

        CXSectionButton *btn7 = [[CXSectionButton alloc] init:CGRectMake(width*2, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine7"]
                                                     andTitle:@"学工服务"];
        [btn7 addTarget:self action:@selector(gotoStudentService) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn7];

        CXSectionButton *btn8 = [[CXSectionButton alloc] init:CGRectMake(width*3, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"mine8"]
                                                     andTitle:@"学费查询"];
        [btn8 addTarget:self action:@selector(gotoMyTuition) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn8];

        offsetY += height;
        UIView *hLine3 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine3.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine3];

        UIView *vLine1 = [[UIView alloc] initWithFrame:CGRectMake(width, startY , 1/CXMainScale , offsetY-startY)];
        vLine1.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine1];

        UIView *vLine2 = [[UIView alloc] initWithFrame:CGRectMake(width*2, startY , 1/CXMainScale , offsetY-startY)];
        vLine2.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine2];

        UIView *vLine3 = [[UIView alloc] initWithFrame:CGRectMake(width*3, startY , 1/CXMainScale ,  offsetY-startY)];
        vLine3.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine3];

#pragma mark - 创建校园应用栏

        UIView *separateView = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY, CXScreenWidth, 20)];
        separateView.backgroundColor = CXBackGroundColor;
        [_contentView addSubview:separateView];

        offsetY += 20;

        UILabel *mySetionlabe2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CXScreenWidth, 15)];
        mySetionlabe2.text = @"校园应用";
        mySetionlabe2.font = CXSystemFont(14);
        mySetionlabe2.textAlignment = NSTextAlignmentLeft;

        [_contentView addSubview:mySetionlabe2];
        [mySetionlabe2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_contentView).mas_offset(15);
            make.top.mas_equalTo(separateView.mas_bottom).mas_offset(15);
            make.height.mas_equalTo(15);
        }];

        offsetY += 45;
        startY = offsetY;

        UIView *hLine4 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine4.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine4];

        CXSectionButton *btn9 = [[CXSectionButton alloc] init:CGRectMake(0, offsetY, width, height)
                                                      andImage:[UIImage imageNamed:@"school2"]
                                                      andTitle:@"校园讲座"];
        [_contentView addSubview:btn9];
        [btn9 addTarget:self action:@selector(gotoSchoolLecture) forControlEvents:UIControlEventTouchUpInside];

        CXSectionButton *btn10 = [[CXSectionButton alloc] init:CGRectMake(width, offsetY, width, height)
                                                      andImage:[UIImage imageNamed:@"school3"]
                                                      andTitle:@"校园风光"];
        [btn10 addTarget:self action:@selector(gotoSchoolScenery) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn10];

        CXSectionButton *btn11 = [[CXSectionButton alloc] init:CGRectMake(width*2, offsetY, width, height)
                                                      andImage:[UIImage imageNamed:@"school4"]
                                                      andTitle:@"电话黄页"];
        [btn11 addTarget:self action:@selector(gotoYellowPages) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn11];

        CXSectionButton *btn12 = [[CXSectionButton alloc] init:CGRectMake(width * 3, offsetY, width, height)
                                                     andImage:[UIImage imageNamed:@"school5"]
                                                     andTitle:@"空余教室"];
        [btn12 addTarget:self action:@selector(gotoFreeClassroom) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn12];

        offsetY += height;
        UIView *hLine5 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine5.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine5];

        CXSectionButton *btn13 = [[CXSectionButton alloc] init:CGRectMake(0, offsetY, width, height)
                                                      andImage:[UIImage imageNamed:@"school6"]
                                                      andTitle:@"书目检索"];
        [btn13 addTarget:self action:@selector(gotoBookFind) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn13];

        CXSectionButton *btn14 = [[CXSectionButton alloc] init:CGRectMake(width, offsetY, width, height)
                                                      andImage:[UIImage imageNamed:@"school7"]
                                                      andTitle:@"就业服务"];
        [btn14 addTarget:self action:@selector(gotoEmployment) forControlEvents:UIControlEventTouchUpInside];
        [_contentView addSubview:btn14];

        offsetY += height;
        UIView *hLine6 = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY-1/CXMainScale, CXScreenWidth, 1/CXMainScale)];
        hLine6.backgroundColor = CXLineColor;
        [_contentView addSubview:hLine6];

        UIView *vLine4 = [[UIView alloc] initWithFrame:CGRectMake(width, startY , 1/CXMainScale , offsetY-startY)];
        vLine4.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine4];

        UIView *vLine5 = [[UIView alloc] initWithFrame:CGRectMake(width*2, startY , 1/CXMainScale , offsetY-startY)];
        vLine5.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine5];

        UIView *vLine6 = [[UIView alloc] initWithFrame:CGRectMake(width*3, startY , 1/CXMainScale ,  offsetY-startY)];
        vLine6.backgroundColor = CXLineColor;
        [_contentView addSubview:vLine6];
    }
    return _contentView;
}

#pragma mark - private method

- (void)updateInfoViewHeight{
    CGSize size = CGSizeMake(CXScreenWidth-40-40, CGFLOAT_MAX);
    CGRect labelRect = [_briefLabel.text boundingRectWithSize:size
                                          options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin
                                       attributes:@{NSFontAttributeName:CXSystemFont(12)} context:nil];

    CGFloat labelHeight = CGRectGetHeight(labelRect);
    CGFloat count = labelHeight / _briefLabel.font.lineHeight;
    if(count > 1.1){
        _infoView.frame = CGRectMake(0, 0, CXScreenWidth, 160);
        [_briefLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.height.mas_equalTo(30);
            make.centerY.mas_equalTo(_infoView.mas_bottom).mas_offset(-30);
        }];
    }
}

- (void)clickMessage{
    [self.navigationController pushViewController:[InformViewController controller] animated:YES];
}

- (void)clickLogin{
    if([[CXLocalUser instance] isLogin]){
        [self.navigationController pushViewController:[UserInfoViewController controller] animated:YES];
    }else{
        [self presentViewController:[[CXNavigationController alloc] initWithRootViewController:[LoginViewController controller]] animated:YES completion:nil];
    }
}

- (void)clickInfo{
    if([[CXLocalUser instance] isLogin]){
        [self.navigationController pushViewController:[UserInfoViewController controller] animated:YES];
    }else{
        [self presentViewController:[[CXNavigationController alloc] initWithRootViewController:[LoginViewController controller]] animated:YES completion:nil];
    }
}

- (void)clickSet{

    SetViewController *set = [SetViewController controller];
    [self.navigationController pushViewController:set animated:YES];
}

#pragma mark - UIScrollView Delegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGPoint offset = scrollView.contentOffset;
    if(offset.y<0){

        [_infoBgView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(scrollView.contentOffset.y);
            make.height.mas_equalTo(-scrollView.contentOffset.y);
        }];
    }
}

#pragma  mark - private method

- (void)gotoCommonView:(NSString *)title  url:(NSString *)url{
    CXBaseWebViewController *webViewController = [CXBaseWebViewController controller];
    webViewController.title = title;
    webViewController.url = url;
    [self.navigationController pushViewController:webViewController animated:YES];
}

- (void)gotoAuthCommonView:(NSString *)title  url:(NSString *)url{
    if(![[JWLocalUser instance] isAuthorized]){
        [ToastView showErrorWithStaus:@"请先在个人中心授权教务网登陆"];
        return;
    }
    CXBaseWebViewController *webViewController = [CXBaseWebViewController controller];
    webViewController.title = title;
    webViewController.url = url;
    [self.navigationController pushViewController:webViewController animated:YES];
}

- (void)gotoMyCourseTable{
    [self gotoAuthCommonView:@"我的课表" url:JWURLMyCourseTable];
}

- (void)gotoMyExam{
    [self gotoAuthCommonView:@"考试安排" url:JWURLMyExamQuery];
}

- (void)gotoMyScore{
    [self gotoAuthCommonView:@"我的成绩" url:JWURLMyScore];
}

- (void)gotoMyScorePoint{
    [self gotoAuthCommonView:@"我的绩点" url:JWURLMyScorePoint];
}

- (void)gotoMyBookInfo{
    [self gotoAuthCommonView:@"借书查询" url:JWURLMyBookInfo];
}

- (void)gotoMySchedule{
    [self gotoAuthCommonView:@"个人日程" url:JWURLMySchedule];
}

- (void)gotoMyTuition{
    [self gotoAuthCommonView:@"学费查询" url:JWURLMyTuition];
}

- (void)gotoStudentService{
    if(![[JWLocalUser instance] isAuthorized]){
        [ToastView showErrorWithStaus:@"请先在个人中心授权教务网登陆"];
        return;
    }
    NSString *url = [JWURLStudentService stringByReplacingOccurrencesOfString:@"131340126" withString:[JWLocalUser instance].JWUsername];
    [self gotoCommonView:@"学工服务" url:url];
}

- (void)gotoDHUCalendar{
    [self gotoCommonView:@"校历" url:JWURLDHUCalendar];
}

- (void)gotoSchoolLecture{
    [self gotoCommonView:@"校园讲座" url:JWURLSchoolLecture];
}

- (void)gotoYellowPages{
    [self gotoCommonView:@"电话黄页" url:JWURLPhoneYellowPages];
}

- (void)gotoFreeClassroom{
    [self gotoCommonView:@"空余教室" url:JWURLFreeClassroom];
}

- (void)gotoBookFind{
    [self gotoCommonView:@"书籍查询" url:JWURLBookFind];
}

- (void)gotoEmployment{
     [self gotoCommonView:@"就业服务" url:JWURLEmployment];
}

- (void)gotoAlumniAssociation{
    [self gotoCommonView:@"校友会" url:JWURLAlumniAssociation];
}

- (void)gotoSchoolScenery{
    SchoolSceneryViewController *school = [SchoolSceneryViewController controller];
    school.url = JWURLSchoolScenery;
    [self.navigationController pushViewController:school animated:YES];
}

@end


text:
#pragma once

#include "external_memory/wavelet_structure_external.hpp"

template <typename AlphabetType, bool is_tree, typename InputType>
void ps_out_external(
    const InputType& text,
    wavelet_structure_external& result) {
  auto levels = result.levels();
  auto size = result.text_size();

  auto& bvs = wavelet_structure_external_writer::bvs(result);
  auto& zeros = wavelet_structure_external_writer::zeros(result);
  auto& hist = wavelet_structure_external_writer::histograms(result);
  auto const& level_offsets = result.level_offsets();

  std::vector<uint64_t> borders(1ULL << levels, 0);
  auto rho = rho_dispatch<is_tree>::create(levels);

  auto sorted_text_vec = std::vector<AlphabetType>(size);
  AlphabetType* sorted_text = sorted_text_vec.data();

  uint64_t cur_max_char = (1 << levels);

  using result_type = typename std::remove_reference<decltype(bvs)>::type;
  using result_writer_type = typename result_type::bufwriter_type;

  // While initializing the histogram, we also compute the first level
  uint64_t cur_pos = 0;
  {
    result_writer_type writer(bvs);
    for (; cur_pos + 64 <= size; cur_pos += 64) {
      uint64_t word = 0ULL;
      for (uint64_t i = 0; i < 64; ++i) {
        ++hist[levels][text[cur_pos + i]];
        word <<= 1;
        word |= ((text[cur_pos + i] >> (levels - 1)) & 1ULL);
      }
      writer << word;
    }
    if (size & 63ULL) {
      uint64_t word = 0ULL;
      for (uint64_t i = 0; i < size - cur_pos; ++i) {
        ++hist[levels][text[cur_pos + i]];
        word <<= 1;
        word |= ((text[cur_pos + i] >> (levels - 1)) & 1ULL);
      }
      word <<= (64 - (size & 63ULL));
      writer << word;
    }
  }

  // The number of 0s at the last level is the number of "even" characters
  if constexpr (!is_tree) {
    for (uint64_t i = 0; i < cur_max_char; i += 2) {
      zeros[levels - 1] += hist[levels][i];
    }
  }

  // Now we compute the WM bottom-up, i.e., the last level first
  for (uint64_t level = levels - 1; level > 0; --level) {
    // Update the maximum value of a feasible a bit prefix and update the
    // histogram of the bit prefixes
    cur_max_char >>= 1;
    for (uint64_t i = 0; i < cur_max_char; ++i) {
      hist[level][i] =
          hist[level + 1][i << 1] + hist[level + 1][(i << 1) + 1];
    }

    // Compute the starting positions of characters with respect to their
    // bit prefixes and the bit-reversal permutation
    borders[0] = 0;
    for (uint64_t i = 1; i < cur_max_char; ++i) {
      auto const prev_rho = rho(level, i - 1);

      borders[rho(level, i)] =
          borders[prev_rho] + hist[level][prev_rho];
    }

    // The number of 0s is the position of the first 1 in the previous level
    if constexpr (!is_tree) {
      zeros[level - 1] = borders[1];
    }

    // Now we sort the text utilizing counting sort and the starting positions
    // that we have computed before
    for (uint64_t i = 0; i < size; ++i) {
      const auto cur_char = text[i];
      sorted_text[borders[cur_char >> (levels - level)]++] = cur_char;
    }

    {
      result_writer_type writer(bvs.begin() + level_offsets[level]);
      // Since we have sorted the text, we can simply scan it from left to right
      // and for the character at position $i$ we set the $i$-th bit in the
      // bit vector accordingly
      for (cur_pos = 0; cur_pos + 63 < size; cur_pos += 64) {
        uint64_t word = 0ULL;
        for (uint64_t i = 0; i < 64; ++i) {
          word <<= 1;
          word |= ((sorted_text[cur_pos + i] >> ((levels - 1) - level)) & 1ULL);
        }
        writer << word;
      }
      if (size & 63ULL) {
        uint64_t word = 0ULL;
        for (uint64_t i = 0; i < size - cur_pos; ++i) {
          word <<= 1;
          word |= ((sorted_text[cur_pos + i] >> ((levels - 1) - level)) & 1ULL);
        }
        word <<= (64 - (size & 63ULL));
        writer << word;
      }
    }
  }
}

/******************************************************************************/


text:
<md-dialog class="fullscreen-dialog">

    <form name="nuevoUsuarioForm" ng-submit="vm.crearNuevoUsuario()">
        <md-toolbar>

Nuevo usuario

                <md-button class="md-icon-button" ng-click="vm.cancelar()" aria-label="cancelar">
                    <ng-md-icon icon="close"></ng-md-icon>
                </md-button>

        </md-toolbar>
        <md-dialog-content>

                    <md-input-container class="md-block" flex-gt-md>
                        Imagen de perfil
                        <md-select ng-model="vm.usuario.avatarUrl" name="avatar" required>
                            <md-option ng-repeat="url in vm.avatarUrls" ng-value="url">

                            </md-option>
                        </md-select>

Debe elegir una imagen de perfil.

                    </md-input-container>

                    <md-input-container class="md-block" flex-gt-md>
                        Usuario
                        <input ng-model="vm.usuario.nombreDeUsuario" name="nombreDeUsuario" required />

Debe elegir un nombre de usuario

                    </md-input-container>

                    <md-progress-circular md-mode="indeterminate"
                                          ng-disabled="vm.claimsLoaded"></md-progress-circular>

   Recuperando roles y permisos

                    <md-input-container class="md-block" flex-gt-md ng-cloak>
                        Roles y permisos
                        <md-select ng-model="vm.claimSelected" name="claims" required>
                            <md-option ng-repeat="claim in vm.claims" ng-value="claim" ng-click="vm.agregarClaim(claim)">
                                {{claim.display}} <ng-md-icon title="{{claim.info}}" icon="help_outline"></ng-md-icon>
                            </md-option>
                        </md-select>

Debe elegir al menos un rol.

                    </md-input-container>

                    <md-chips ng-hide="vm.claimsSeleccionados.length < 1">
                        <md-chip ng-repeat="claim in vm.claimsSeleccionados">
                            {{claim.display}} <ng-md-icon icon="clear" ng-click="vm.quitarClaim(claim)" style="font-size: 10px; cursor:pointer"></ng-md-icon>
                        </md-chip>
                    </md-chips>

                    <md-input-container class="md-block" flex-gt-md>
                        Nombre para mostrar
                        <input ng-model="vm.usuario.nombreParaMostrar" name="nombreParaMostrar" required />

Debe especificar el nombre para mostrar

                    </md-input-container>

                    <md-input-container class="md-block" flex-gt-md>
                        Contraseña
                        <input ng-model="vm.usuario.password" name="password" required type="password" />

Debe elegir una contraseña

                    </md-input-container>

                    <md-input-container class="md-block" flex-gt-md>
                        Teléfono
                        <input ng-model="vm.usuario.telefono" name="telefono" />
                    </md-input-container>

                    <md-input-container class="md-block" flex-gt-md>
                        Correo electrónico
                        <input ng-model="vm.usuario.email" name="email" />
                    </md-input-container>

        </md-dialog-content>

        <md-dialog-actions layout="row">

                <md-button ng-cloak type="submit" class="md-primary md-raised" ng-disabled="nuevoUsuarioForm.$invalid || vm.bloquearSubmit">
                    {{vm.submitLabel}}
                </md-button>
                <md-button ng-click="vm.cancelar()">Cancelar</md-button>

        </md-dialog-actions>
    </form>
</md-dialog>


text:
var mongoose = require('mongoose');
var ObjectId = mongoose.Types.ObjectId;
var tags = require('./tags');

var makeMetadata = function (req) {
    if (!req) throw new Error('req undefined');

    function newId(){
        var id = new ObjectId();
        return id.toHexString();
    }

    return {
        id: req.params['id'] ? req.params['id'] : newId(),
        versionId: req.headers['content-location'] ? req.headers['content-location'].split('/_history/')[1] : '0',
        lastUpdated: new Date(),
        user: req.user || 'anonymous'
    };
};

var makeTagList = function(req) {
    if (!req) throw new Error('req undefined');

    return tags.parseCategoryHeader(req.headers['category']);
};

var makePojo = function (req) {
    if (!req) throw new Error('req undefined');
    if (!req.body) throw new Error('req.body undefined');

    return {
        meta: makeMetadata(req),
        tags: makeTagList(req).category,
        resource: req.body             //assumes that body has been parsed
    };
};

var makeContentLocationForNewResource = function(req, doc){
    if (!req) throw new Error('req undefined');
    if (!doc) throw new Error('doc undefined');

    var protocol = req.headers['x-forwarded-proto'] || req.protocol;
    var uri = req.headers['x-forwarded-uri'] || req.originalUrl;

    return protocol + '://' + req.headers.host + uri + '/' + doc._id + '/_history/' + doc._version;
};

var makeContentLocationForExistingResource = function(req, doc){
    if (!req) throw new Error('req undefined');
    if (!doc) throw new Error('doc undefined');

    var protocol = req.headers['x-forwarded-proto'] || req.protocol;
    var uri = req.headers['x-forwarded-uri'] || req.originalUrl;

    if (uri.indexOf('/_history/') < 0) {
        return protocol + '://' + req.headers.host + uri + '/_history/' + doc._version;
    }
    else {
        return protocol + '://' + req.headers.host + uri;
    }
};

module.exports.makePojo = makePojo;
module.exports.makeMetadata = makeMetadata;
module.exports.makeContentLocationForNewResource = makeContentLocationForNewResource;
module.exports.makeContentLocationForExistingResource = makeContentLocationForExistingResource;
module.exports.makeLocationForExistingResource = makeContentLocationForExistingResource;


text:
package mail

import (
	"bytes"
	"strings"
	"testing"
)

func TestRenderRecipient(t *testing.T) {
	message := &Message{From: "foo@bar.com", To: []string{"bar@foo.com", "abc@test.com"}, ReplyTo: "none@arkxu.com",
		Subject: "from message1, single connection", PlainBody: bytes.NewBufferString("
你好 from message1, should show in plain text
")}

	var b bytes.Buffer
	message.writeRecipient(&b)
	recipient := b.String()

	if !strings.Contains(recipient, "From: foo@bar.com") {
		t.Error("Recipient should contains From")
	}

	if !strings.Contains(recipient, "Reply-To: none@arkxu.com") {
		t.Error("Recipient should contains Reply-To")
	}

	if !strings.Contains(recipient, "To: bar@foo.com, abc@test.com") {
		t.Error("Recipient should contains To")
	}

	if !strings.Contains(recipient, "Subject: from message1") {
		t.Error("Recipient should contains Subject")
	}
}

func TestRenderRecipientNoReply(t *testing.T) {
	message := &Message{From: "foo@bar.com", To: []string{"bar@foo.com", "abc@test.com"},
		Subject: "这个是第11封from message1, single connection", PlainBody: bytes.NewBufferString("
你好 from message1, should show in plain text
")}

	var b bytes.Buffer
	message.writeRecipient(&b)
	recipient := b.String()

	if strings.Contains(recipient, "Reply-To") {
		t.Error("Recipient should not contains Reply-To")
	}

	if strings.Contains(recipient, "这个是第11封from message1, single connection") {
		t.Error("Subject should be encoded")
	}
}

func TestRenderPlainAndHtmlText(t *testing.T) {
	plainBody := "你好 from message1, should show in plain text"
	htmlBody := "
你好 from message1, should show in html text
"
	message := &Message{From: "foo@bar.com", To: []string{"bar@foo.com", "abc@test.com"},
		Subject: "这个是第11封from message1, single connection", PlainBody: bytes.NewBufferString(plainBody), HtmlBody: bytes.NewBufferString(htmlBody)}

	b, _ := message.RenderData()
	recipient := string(b)

	if !strings.Contains(recipient, plainBody) {
		t.Errorf("should have plain body: %s \n", plainBody)
	}

	if !strings.Contains(recipient, htmlBody) {
		t.Errorf("should have html body: %s \n", htmlBody)
	}
}


text:
package io.datarouter.storage.test.node.basic.map.databean;

import java.util.List;
import java.util.function.Supplier;

import io.datarouter.model.databean.BaseDatabean;
import io.datarouter.model.field.Field;
import io.datarouter.model.field.imp.StringField;
import io.datarouter.model.field.imp.StringFieldKey;
import io.datarouter.model.serialize.fielder.BaseDatabeanFielder;

public class MapStorageBean extends BaseDatabean<MapStorageBeanKey,MapStorageBean>{

	private String data;

	public static class FieldKeys{
		public static final StringFieldKey data = new StringFieldKey("data");
	}

	public static class MapStorageBeanFielder extends BaseDatabeanFielder<MapStorageBeanKey,MapStorageBean>{

		public MapStorageBeanFielder(){
			super(MapStorageBeanKey::new);
		}

		@Override
		public List<Field<?>> getNonKeyFields(MapStorageBean databean){
			return List.of(new StringField(FieldKeys.data, databean.data));
		}

	}

	public MapStorageBean(){
		this(null);
	}

	public MapStorageBean(String data){
		super(new MapStorageBeanKey());
		this.data = data;
	}

	@Override
	public Supplier<MapStorageBeanKey> getKeySupplier(){
		return MapStorageBeanKey::new;
	}

	public String getData(){
		return data;
	}

	public void setData(String data){
		this.data = data;
	}

}


text:
//
//  KiiCloudEntryArgument.h
//  KiiSDK-Private
//
//  Created by Riza Alaudin Syah on 6/25/13.
//  Copyright (c) 2013 Kii Corporation. All rights reserved.
//

#import <Foundation/Foundation.h>
/** Class for argument passed to the KiiServerCodeEntry.
 This class can not be instantiated by using init method.
 Calling [[KiiServerCodeEntryArgument alloc] init] directly will throw NSInternalInconsistencyException.
 */
@interface KiiServerCodeEntryArgument : NSObject

/** Instantiate new argument passed to the KiiServerCodeEntry.
 @param objectArgument NSDictionary instance to represent JSON object argument, can not be nil.
 @return KiiServerCodeEntryArgument instance.
 @exception NSInvalidArgumentException Thrown if objectArgument is not valid.
 */
+(nonnull KiiServerCodeEntryArgument*) argumentWithDictionary:(nonnull NSDictionary*) objectArgument;
@end


text:
'use strict';

import {BaseGulpTask} from '../BaseGulpTask';
import * as gulp from 'gulp';
import {Utils} from '../utils';
import * as yargs from 'yargs';
let $: any = require('gulp-load-plugins')({ lazy: true });

/**
 * Transpiles all TypeScript as JavaScript as the gulp task 'transpile-ts'.
 *
 * @class
 */
export class GulpTask extends BaseGulpTask {

  /**
   * @property  {string}  description   - Help description for the task.
   */
  public static description: string = 'Builds all TypeScript as JavaScript';

  /**
   * @property  {string[]}  aliases   - Different options to run the task.
   */
  public static aliases: string[] = ['tts'];

  /**
   * @property  {string[]}  dependencies  - Array of all tasks that should be run before this one.
   */
  public static dependencies: string[] = [];

  /**
   * @property  {Object}  options   - Any command line flags that can be passed to the task.
   */
  public static options: any = {
    'verbose': 'Output all TypeScript files being built'
  };

  /**
   * @property  {ICommandLineArgs}  args  - Command line arguments;
   */
  private _args: ICommandLineArgs = yargs.argv;

  /** @constructor */
  constructor() {
    super();
    Utils.log('Transpiling app TypeScript files to JavaScript');

    // use the TypeScript project config file for all settings
    let tsProject: any = $.typescript.createProject('tsconfig.json');

    // compile all TypeScript files, including sourcemaps inline in the generated JavaScript
    let result: any = tsProject.src()
      .pipe($.plumber())
      .pipe($.if(this._args.verbose, $.print()))
      .pipe($.sourcemaps.init())
      .pipe($.typescript(tsProject));

    return result.js
      .pipe($.sourcemaps.write())
      .pipe(gulp.dest(''));
  }
}


text:
require 'guard/compat/plugin'
require 'colorize'

module Guard
  class SlimLint < Plugin
    attr_accessor :notify_on, :all_on_start

    def initialize(options = {})
      @notify_on    = options.fetch(:notify_on, :failure)
      @all_on_start = options.fetch(:all_on_start, true)
      super
    end

    def start
      run_all if all_on_start
    end

    def run_all
      run
    end

    def run_on_modifications(paths)
      run(paths)
    end

    def run_on_additions(paths)
      run(paths)
    end

    private

    def run(paths = ['.'])
      result = system "slim-lint #{paths.join(' ')}"
      if result
        UI.info 'No Slim offences detected'.green
      else
        UI.info 'Slim offences has been detected'.red
      end
      check_and_notify(result)
    end

    def notification_allowed?(result)
      case notify_on
      when :failure then !result
      when :success then result
      when :both then true
      when :none then false
      end
    end

    def check_and_notify(result)
      notify(result) if notification_allowed?(result)
    end

    def image(result)
      result ? :success : :failed
    end

    def message(result)
      result ? 'No slim offences' : 'Slim offences detected'
    end

    def notify(result)
      Notifier.notify(message(result), title: 'Slim-lint results', image: image(result))
    end
  end
end


text:
extern "C" {
typedef char * va_list;
}

void test_no_arguments(int i, ...) {
  __va_start(); // expected-error{{too few arguments to function call, expected at least 3, have 0}}
}

void test_one_argument(int i, ...) {
  va_list ap;
  __va_start(&ap); // expected-error{{too few arguments to function call, expected at least 3, have 1}}
}

void test_two_arguments(int i, ...) {
  va_list ap;
  __va_start(&ap, &i); // expected-error{{too few arguments to function call, expected at least 3, have 2}}
}

void test_non_last_argument(int i, int j, ...) {
  va_list ap;
  __va_start(&ap, &i, 4);
  // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}}
  // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}
}

void test_stack_allocated(int i, ...) {
  va_list ap;
  int j;
  __va_start(&ap, &j, 4);
  // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}}
  // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}
}

void test_non_pointer_addressof(int i, ...) {
  va_list ap;
  __va_start(&ap, 1, 4);
  // expected-error@-1{{passing 'int' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int' vs 'const char *')}}
  // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}
}


text:
/**  A one line description of the class.
 *
 * #include "BrakePedalTest.hpp"
 * Created 3-12-18 By: Smitty
 *
 * A longer description.
 */

#ifndef BRAKEPEDALTEST_HPP
#define BRAKEPEDALTEST_HPP

#include "../BaseModelTest/BaseModelTest.hpp"

//Maybe have states the pedal can be in, since it has the chance
//of causing an error if there's an implausibility or a short in
//the wires

class BrakePedalTest : public BaseModelTest
{
public:
    BrakePedalTest();
    ~BrakePedalTest(void);

    void update(void);

    uint16_t getLinValue(void);

private:
    uint16_t _linValue;
};

#endif  //BRAKEPEDALTEST_HPP