text:
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {Subject, takeUntil} from 'rxjs';

import {AddDataUrlType} from './types/url.type';
import {AddDataUrlValues} from './add-data-url-values';
import {HsAddDataCommonService} from '../common/common.service';
import {HsAddDataOwsService} from './add-data-ows.service';
import {HsAddDataUrlService} from './add-data-url.service';
import {HsConfig} from '../../../config.service';
import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service';
import {HsGetCapabilitiesErrorComponent} from '../common/capabilities-error-dialog/capabilities-error-dialog.component';
import {HsLanguageService} from '../../language/language.service';
import {HsLayoutService} from '../../layout/layout.service';
import {HsLogService} from '../../../common/log/log.service';
import {HsShareUrlService} from '../../permalink/share-url.service';
import {servicesSupportedByUrl} from './services-supported.const';

@Component({
  selector: 'hs-add-data-url',
  templateUrl: './add-data-url.component.html',
})
export class HsAddDataUrlComponent implements OnInit, OnDestroy {
  types: {id: AddDataUrlType; text: string}[];
  @Input() app = 'default';
  appRef;
  private end = new Subject<void>();

  constructor(
    public hsConfig: HsConfig,
    public hsLanguageService: HsLanguageService,
    public hsShareUrlService: HsShareUrlService,
    public hsLog: HsLogService,
    public hsLayoutService: HsLayoutService,
    public hsAddDataCommonService: HsAddDataCommonService,
    public hsAddDataOwsService: HsAddDataOwsService,
    public hsAddDataUrlService: HsAddDataUrlService,
    public hsDialogContainerService: HsDialogContainerService
  ) {}

  ngOnInit() {
    this.appRef = this.hsAddDataUrlService.get(this.app);
    if (Array.isArray(this.hsConfig.get(this.app).connectTypes)) {
      this.types = this.hsConfig
        .get(this.app)
        .connectTypes.filter((type) => servicesSupportedByUrl.includes(type))
        .map((type) => AddDataUrlValues.find((v) => v.id == type));
    } else {
      this.types = AddDataUrlValues;
    }
    if (this.hsAddDataUrlService.get(this.app).typeSelected) {
      this.connectServiceFromUrlParam(
        this.hsAddDataUrlService.get(this.app).typeSelected
      );
    }
    this.hsAddDataUrlService
      .get(this.app)
      .addDataCapsParsingError.pipe(takeUntil(this.end))
      .subscribe((e) => {
        this.hsLog.warn(this.app);
        let error = e.toString();
        if (error?.includes('Unsuccessful OAuth2')) {
          error = this.hsLanguageService.getTranslationIgnoreNonExisting(
            'COMMON',
            'Authentication failed. Login to the catalogue.',
            undefined,
            this.app
          );
        } else if (error.includes('property')) {
          error = this.hsLanguageService.getTranslationIgnoreNonExisting(
            'ADDLAYERS',
            'serviceTypeNotMatching',
            undefined,
            this.app
          );
        } else {
          error = this.hsLanguageService.getTranslationIgnoreNonExisting(
            'ADDLAYERS',
            error,
            undefined,
            this.app
          );
        }
        this.hsDialogContainerService.create(
          HsGetCapabilitiesErrorComponent,
          {error: error},
          this.app
        );
      });
  }

  ngOnDestroy(): void {
    this.end.next();
    this.end.complete();
  }

  selectType(type: AddDataUrlType, app: string): void {
    this.hsAddDataCommonService.clearParams(app);
    this.hsAddDataUrlService.get(this.app).typeSelected = type;
  }

  connectServiceFromUrlParam(type: AddDataUrlType): void {
    if (!this.hsAddDataUrlService.get(this.app).connectFromParams) {
      return;
    }
    const layers = this.hsShareUrlService.getParamValue(`hs-${type}-layers`);
    const url = this.hsShareUrlService.getParamValue(`hs-${type}-to-connect`);

    // const serviceName = `hsAddLayersWmsService`;
    if (layers) {
      for (const layer of layers.split(';')) {
        this.hsAddDataOwsService.connectToOWS(
          {
            type,
            uri: url,
            layer,
            style: undefined,
          },
          this.app
        );
      }
    } else {
      this.hsAddDataOwsService.connectToOWS({type, uri: url}, this.app);
    }
    this.hsAddDataUrlService.get(this.app).connectFromParams = false;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.solr.internal.csv.writer;

/**
 *
 */
public class CSVField {

    private String name;
    private int size;
    private int fill;
    private boolean overrideFill;

    /**
     *
     */
    public CSVField() {
    }

    /**
     * @param name the name of the field
     */
    public CSVField(String name) {
        setName(name);
    }

    /**
     * @param name the name of the field
     * @param size the size of the field
     */
    public CSVField(String name, int size) {
        setName(name);
        setSize(size);
    }

    /**
     * @return the name of the field
     */
    public String getName() {
        return name;
    }

    /**
     * Set the name of the field
     * @param name the name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     *
     * @return the size of the field
     */
    public int getSize() {
        return size;
    }

    /**
     * Set the size of the field.
     * The size will be ignored when fixedwidth is set to false in the CSVConfig
     * @param size the size of the field.
     */
    public void setSize(int size) {
        this.size = size;
    }

    /**
     * @return the fill pattern.
     */
    public int getFill() {
        return fill;
    }

    /**
     * Sets overrideFill to true.
     * @param fill the file pattern
     */
    public void setFill(int fill) {
        overrideFill = true;
        this.fill = fill;
    }

    /**
     * Does this field override fill ?
     *
     */
    public boolean overrideFill() {
        return overrideFill;
    }

}


text:
package org.eclipse.php.internal.core.ast.rewrite;

import java_cup.runtime.Symbol;

import org.eclipse.php.internal.core.PHPVersion;
import org.eclipse.php.internal.core.ast.nodes.AST;

/**
 * A class that holds all the relevant PHP4/PHP5 Symbols that are in use in the
 * {@link ASTRewriteAnalyzer}.
 *
 * @author shalom
 */
public class SymbolsProvider {

	// Symbols ids.
	public static final int DOT_SYMBOL_ID = 0;
	public static final int LESS_ID = 1;
	public static final int GREATER_ID = 2;
	public static final int RBRACKET_ID = 3;
	public static final int LBRACKET_ID = 4;
	public static final int RBRACE_ID = 5;
	public static final int LBRACE_ID = 6;
	public static final int RPAREN_ID = 7;
	public static final int LPAREN_ID = 8;
	public static final int INTERFACE_ID = 9; // PHP 5 only
	public static final int CLASS_ID = 10;
	public static final int RETURN_ID = 11;
	public static final int BREAK_ID = 12;
	public static final int CONTINUE_ID = 13;
	public static final int DO_ID = 14;
	public static final int WHILE_ID = 15;
	public static final int SEMICOLON_ID = 16;
	public static final int THROW_ID = 17; // PHP 5 only
	public static final int NEW_ID = 18;
	public static final int ELSE_ID = 19;
	public static final int IMPLEMENTS_ID = 20;
	public static final int END_IF_ID = 21;
	public static final int END_FOR_ID = 22;
	public static final int END_WHILE_ID = 23;
	public static final int END_FOREACH_ID = 24;
	public static final int END_SWITCH_ID = 25;
	public static final int OBJECT_OP_SYMBOL_ID = 26;

	public static final Symbol ERROR_SYMBOL = new Symbol(Integer.MIN_VALUE);

	// Pre-defined PHP 54 Symbols.
	private static final Symbol OBJECT_OP_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_OBJECT_OPERATOR);

	private static final Symbol LESS_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_RGREATER);
	private static final Symbol GREATER_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_LGREATER);
	private static final Symbol RBRACKET_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CLOSE_RECT);
	private static final Symbol LBRACKET_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_OPEN_RECT);
	private static final Symbol RBRACE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CURLY_CLOSE);
	private static final Symbol LBRACE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CURLY_OPEN);
	private static final Symbol LPAREN_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_OPEN_PARENTHESE);
	private static final Symbol RPAREN_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CLOSE_PARENTHESE);
	// private static final Symbol INTERFACE_SYMBOL_PHP54 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_INTERFACE);
	private static final Symbol CLASS_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CLASS);
	private static final Symbol RETURN_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_RETURN);
	private static final Symbol BREAK_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_BREAK);
	private static final Symbol CONTINUE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_CONTINUE);
	private static final Symbol DO_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_DO);
	private static final Symbol WHILE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_WHILE);
	private static final Symbol SEMICOLON_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_SEMICOLON);
	private static final Symbol THROW_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_THROW);
	private static final Symbol NEW_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_NEW);
	private static final Symbol ELSE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ELSE);
	// private static final Symbol IMPLEMENTS_SYMBOL_PHP54 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_IMPLEMENTS);
	private static final Symbol END_IF_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ENDIF);
	private static final Symbol END_FOR_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ENDFOR);
	private static final Symbol END_WHILE_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ENDWHILE);
	// private static final Symbol END_FOREACH_SYMBOL_PHP54 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ENDFOREACH);
	private static final Symbol END_SWITCH_SYMBOL_PHP54 = new Symbol(
			org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ENDSWITCH);

	// Pre-defined PHP 53 Symbols.
	// private static final Symbol OBJECT_OP_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_OBJECT_OPERATOR);
	// private static final Symbol DOT_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_NEKUDA);
	// private static final Symbol LESS_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_RGREATER);
	// private static final Symbol GREATER_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_LGREATER);
	// private static final Symbol RBRACKET_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CLOSE_RECT);
	// private static final Symbol LBRACKET_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_OPEN_RECT);
	// private static final Symbol RBRACE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CURLY_CLOSE);
	// private static final Symbol LBRACE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CURLY_OPEN);
	// private static final Symbol LPAREN_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_OPEN_PARENTHESE);
	// private static final Symbol RPAREN_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CLOSE_PARENTHESE);
	// // private static final Symbol INTERFACE_SYMBOL_PHP53 = new Symbol(
	// //
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_INTERFACE);
	// private static final Symbol CLASS_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CLASS);
	// private static final Symbol RETURN_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_RETURN);
	// private static final Symbol BREAK_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_BREAK);
	// private static final Symbol CONTINUE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_CONTINUE);
	// private static final Symbol DO_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_DO);
	// private static final Symbol WHILE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_WHILE);
	// private static final Symbol SEMICOLON_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_SEMICOLON);
	// private static final Symbol THROW_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_THROW);
	// private static final Symbol NEW_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_NEW);
	// private static final Symbol ELSE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ELSE);
	// // private static final Symbol IMPLEMENTS_SYMBOL_PHP53 = new Symbol(
	// //
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_IMPLEMENTS);
	// private static final Symbol END_IF_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ENDIF);
	// private static final Symbol END_FOR_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ENDFOR);
	// private static final Symbol END_WHILE_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ENDWHILE);
	// private static final Symbol END_FOREACH_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ENDFOREACH);
	// private static final Symbol END_SWITCH_SYMBOL_PHP53 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php53.ParserConstants.T_ENDSWITCH);

	// Pre-defined PHP 5 Symbols.
	// private static final Symbol OBJECT_OP_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_OBJECT_OPERATOR);
	// private static final Symbol DOT_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_NEKUDA);
	// private static final Symbol LESS_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_RGREATER);
	// private static final Symbol GREATER_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_LGREATER);
	// private static final Symbol RBRACKET_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CLOSE_RECT);
	// private static final Symbol LBRACKET_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_OPEN_RECT);
	// private static final Symbol RBRACE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CURLY_CLOSE);
	// private static final Symbol LBRACE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CURLY_OPEN);
	// private static final Symbol LPAREN_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_OPEN_PARENTHESE);
	// private static final Symbol RPAREN_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CLOSE_PARENTHESE);
	// // private static final Symbol INTERFACE_SYMBOL_PHP5 = new Symbol(
	// //
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_INTERFACE);
	// private static final Symbol CLASS_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CLASS);
	// private static final Symbol RETURN_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_RETURN);
	// private static final Symbol BREAK_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_BREAK);
	// private static final Symbol CONTINUE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_CONTINUE);
	// private static final Symbol DO_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_DO);
	// private static final Symbol WHILE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_WHILE);
	// private static final Symbol SEMICOLON_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_SEMICOLON);
	// private static final Symbol THROW_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_THROW);
	// private static final Symbol NEW_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_NEW);
	// private static final Symbol ELSE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ELSE);
	// // private static final Symbol IMPLEMENTS_SYMBOL_PHP5 = new Symbol(
	// //
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_IMPLEMENTS);
	// private static final Symbol END_IF_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ENDIF);
	// private static final Symbol END_FOR_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ENDFOR);
	// private static final Symbol END_WHILE_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ENDWHILE);
	// private static final Symbol END_FOREACH_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ENDFOREACH);
	// private static final Symbol END_SWITCH_SYMBOL_PHP5 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php5.ParserConstants.T_ENDSWITCH);

	// Pre-defined PHP 4 Symbols.
	// private static final Symbol DOT_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_NEKUDA);
	// private static final Symbol LESS_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_RGREATER);
	// private static final Symbol GREATER_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_LGREATER);
	// private static final Symbol RBRACKET_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CLOSE_RECT);
	// private static final Symbol LBRACKET_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_OPEN_RECT);
	// private static final Symbol RBRACE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CURLY_CLOSE);
	// private static final Symbol LBRACE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CURLY_OPEN);
	// private static final Symbol LPAREN_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_OPEN_PARENTHESE);
	// private static final Symbol RPAREN_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CLOSE_PARENTHESE);
	// private static final Symbol CLASS_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CLASS);
	// private static final Symbol RETURN_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_RETURN);
	// private static final Symbol BREAK_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_BREAK);
	// private static final Symbol CONTINUE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_CONTINUE);
	// private static final Symbol DO_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_DO);
	// private static final Symbol WHILE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_WHILE);
	// private static final Symbol SEMICOLON_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_SEMICOLON);
	// private static final Symbol NEW_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_NEW);
	// private static final Symbol ELSE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ELSE);
	// // private static final Symbol END_IF_SYMBOL_PHP4 = new Symbol(
	// //
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ENDIF);
	// private static final Symbol END_FOR_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ENDFOR);
	// private static final Symbol END_WHILE_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ENDWHILE);
	// private static final Symbol END_FOREACH_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ENDFOREACH);
	// private static final Symbol END_SWITCH_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_ENDSWITCH);
	// private static final Symbol OBJECT_OP_SYMBOL_PHP4 = new Symbol(
	// org.eclipse.php.internal.core.ast.scanner.php4.ParserConstants.T_OBJECT_OPERATOR);

	/**
	 * Returns a {@link Symbol} that holds a sym id that is computed by
	 * identifying the correct id for the given php version. The given symID
	 * should be one of this class ID constants, and the PHP version String
	 * should be one of the {@link AST} defined PHP constants. The returned
	 * Symbol will always be a non-null Symbol. In case the Symbol was not
	 * recognized, an {@link SymbolsProvider#ERROR_SYMBOL} will be returned.
	 *
	 * @param symID
	 *            Symbol ID - One of this class constants.
	 * @param phpVersion
	 *            PHP version String.
	 * @return A Symbol reference for the given id and php version.
	 */
	public static Symbol getSymbol(int symID, PHPVersion phpVersion) {
		// if (PHPVersion.PHP5 == phpVersion) {
		// switch (symID) {
		// case DOT_SYMBOL_ID:
		// return DOT_SYMBOL_PHP5;
		// case LESS_ID:
		// return LESS_SYMBOL_PHP5;
		// case GREATER_ID:
		// return GREATER_SYMBOL_PHP5;
		// case RBRACKET_ID:
		// return RBRACKET_SYMBOL_PHP5;
		// case LBRACKET_ID:
		// return LBRACKET_SYMBOL_PHP5;
		// case RBRACE_ID:
		// return RBRACE_SYMBOL_PHP5;
		// case LBRACE_ID:
		// return LBRACE_SYMBOL_PHP5;
		// case RPAREN_ID:
		// return RPAREN_SYMBOL_PHP5;
		// case LPAREN_ID:
		// return LPAREN_SYMBOL_PHP5;
		// // case INTERFACE_ID:
		// // return INTERFACE_SYMBOL_PHP5;
		// case CLASS_ID:
		// return CLASS_SYMBOL_PHP5;
		// case RETURN_ID:
		// return RETURN_SYMBOL_PHP5;
		// case BREAK_ID:
		// return BREAK_SYMBOL_PHP5;
		// case CONTINUE_ID:
		// return CONTINUE_SYMBOL_PHP5;
		// case DO_ID:
		// return DO_SYMBOL_PHP5;
		// case WHILE_ID:
		// return WHILE_SYMBOL_PHP5;
		// case SEMICOLON_ID:
		// return SEMICOLON_SYMBOL_PHP5;
		// case THROW_ID:
		// return THROW_SYMBOL_PHP5;
		// case NEW_ID:
		// return NEW_SYMBOL_PHP5;
		// case ELSE_ID:
		// return ELSE_SYMBOL_PHP5;
		// // case IMPLEMENTS_ID:
		// // return IMPLEMENTS_SYMBOL_PHP5;
		// case END_FOR_ID:
		// return END_FOR_SYMBOL_PHP5;
		// case END_FOREACH_ID:
		// return END_FOREACH_SYMBOL_PHP5;
		// case END_IF_ID:
		// return END_IF_SYMBOL_PHP5;
		// case END_WHILE_ID:
		// return END_WHILE_SYMBOL_PHP5;
		// case END_SWITCH_ID:
		// return END_SWITCH_SYMBOL_PHP5;
		// case OBJECT_OP_SYMBOL_ID:
		// return OBJECT_OP_SYMBOL_PHP5;
		// default:
		// break;
		// }
		// } else if (PHPVersion.PHP4 == phpVersion) {
		// switch (symID) {
		// case DOT_SYMBOL_ID:
		// return DOT_SYMBOL_PHP4;
		// case LESS_ID:
		// return LESS_SYMBOL_PHP4;
		// case GREATER_ID:
		// return GREATER_SYMBOL_PHP4;
		// case RBRACKET_ID:
		// return RBRACKET_SYMBOL_PHP4;
		// case LBRACKET_ID:
		// return LBRACKET_SYMBOL_PHP4;
		// case RBRACE_ID:
		// return RBRACE_SYMBOL_PHP4;
		// case LBRACE_ID:
		// return LBRACE_SYMBOL_PHP4;
		// case RPAREN_ID:
		// return RPAREN_SYMBOL_PHP4;
		// case LPAREN_ID:
		// return LPAREN_SYMBOL_PHP4;
		// case CLASS_ID:
		// return CLASS_SYMBOL_PHP4;
		// case RETURN_ID:
		// return RETURN_SYMBOL_PHP4;
		// case BREAK_ID:
		// return BREAK_SYMBOL_PHP4;
		// case CONTINUE_ID:
		// return CONTINUE_SYMBOL_PHP4;
		// case DO_ID:
		// return DO_SYMBOL_PHP4;
		// case WHILE_ID:
		// return WHILE_SYMBOL_PHP4;
		// case SEMICOLON_ID:
		// return SEMICOLON_SYMBOL_PHP4;
		// case NEW_ID:
		// return NEW_SYMBOL_PHP4;
		// case ELSE_ID:
		// return ELSE_SYMBOL_PHP4;
		// case END_FOR_ID:
		// return END_FOR_SYMBOL_PHP4;
		// case END_FOREACH_ID:
		// return END_FOREACH_SYMBOL_PHP4;
		// // case END_IF_ID:
		// // return END_IF_SYMBOL_PHP4;
		// case END_WHILE_ID:
		// return END_WHILE_SYMBOL_PHP4;
		// case END_SWITCH_ID:
		// return END_SWITCH_SYMBOL_PHP4;
		// case OBJECT_OP_SYMBOL_ID:
		// return OBJECT_OP_SYMBOL_PHP4;
		// default:
		// break;
		// }
		// }
		// if (PHPVersion.PHP5_3 == phpVersion) {
		// switch (symID) {
		// case DOT_SYMBOL_ID:
		// return DOT_SYMBOL_PHP53;
		// case LESS_ID:
		// return LESS_SYMBOL_PHP53;
		// case GREATER_ID:
		// return GREATER_SYMBOL_PHP53;
		// case RBRACKET_ID:
		// return RBRACKET_SYMBOL_PHP53;
		// case LBRACKET_ID:
		// return LBRACKET_SYMBOL_PHP53;
		// case RBRACE_ID:
		// return RBRACE_SYMBOL_PHP53;
		// case LBRACE_ID:
		// return LBRACE_SYMBOL_PHP53;
		// case RPAREN_ID:
		// return RPAREN_SYMBOL_PHP53;
		// case LPAREN_ID:
		// return LPAREN_SYMBOL_PHP53;
		// // case INTERFACE_ID:
		// // return INTERFACE_SYMBOL_PHP53;
		// case CLASS_ID:
		// return CLASS_SYMBOL_PHP53;
		// case RETURN_ID:
		// return RETURN_SYMBOL_PHP53;
		// case BREAK_ID:
		// return BREAK_SYMBOL_PHP53;
		// case CONTINUE_ID:
		// return CONTINUE_SYMBOL_PHP53;
		// case DO_ID:
		// return DO_SYMBOL_PHP53;
		// case WHILE_ID:
		// return WHILE_SYMBOL_PHP53;
		// case SEMICOLON_ID:
		// return SEMICOLON_SYMBOL_PHP53;
		// case THROW_ID:
		// return THROW_SYMBOL_PHP53;
		// case NEW_ID:
		// return NEW_SYMBOL_PHP53;
		// case ELSE_ID:
		// return ELSE_SYMBOL_PHP53;
		// // case IMPLEMENTS_ID:
		// // return IMPLEMENTS_SYMBOL_PHP53;
		// case END_FOR_ID:
		// return END_FOR_SYMBOL_PHP53;
		// case END_FOREACH_ID:
		// return END_FOREACH_SYMBOL_PHP53;
		// case END_IF_ID:
		// return END_IF_SYMBOL_PHP53;
		// case END_WHILE_ID:
		// return END_WHILE_SYMBOL_PHP53;
		// case END_SWITCH_ID:
		// return END_SWITCH_SYMBOL_PHP53;
		// case OBJECT_OP_SYMBOL_ID:
		// return OBJECT_OP_SYMBOL_PHP53;
		// default:
		// break;
		// }
		// }

		if (PHPVersion.PHP5_4 == phpVersion) {
			switch (symID) {

			case LESS_ID:
				return LESS_SYMBOL_PHP54;
			case GREATER_ID:
				return GREATER_SYMBOL_PHP54;
			case RBRACKET_ID:
				return RBRACKET_SYMBOL_PHP54;
			case LBRACKET_ID:
				return LBRACKET_SYMBOL_PHP54;
			case RBRACE_ID:
				return RBRACE_SYMBOL_PHP54;
			case LBRACE_ID:
				return LBRACE_SYMBOL_PHP54;
			case RPAREN_ID:
				return RPAREN_SYMBOL_PHP54;
			case LPAREN_ID:
				return LPAREN_SYMBOL_PHP54;
				// case INTERFACE_ID:
				// return INTERFACE_SYMBOL_PHP54;
			case CLASS_ID:
				return CLASS_SYMBOL_PHP54;
			case RETURN_ID:
				return RETURN_SYMBOL_PHP54;
			case BREAK_ID:
				return BREAK_SYMBOL_PHP54;
			case CONTINUE_ID:
				return CONTINUE_SYMBOL_PHP54;
			case DO_ID:
				return DO_SYMBOL_PHP54;
			case WHILE_ID:
				return WHILE_SYMBOL_PHP54;
			case SEMICOLON_ID:
				return SEMICOLON_SYMBOL_PHP54;
			case THROW_ID:
				return THROW_SYMBOL_PHP54;
			case NEW_ID:
				return NEW_SYMBOL_PHP54;
			case ELSE_ID:
				return ELSE_SYMBOL_PHP54;
				// case IMPLEMENTS_ID:
				// return IMPLEMENTS_SYMBOL_PHP54;
			case END_FOR_ID:
				return END_FOR_SYMBOL_PHP54;
				// case END_FOREACH_ID:
				// return END_FOREACH_SYMBOL_PHP54;
			case END_IF_ID:
				return END_IF_SYMBOL_PHP54;
			case END_WHILE_ID:
				return END_WHILE_SYMBOL_PHP54;
			case END_SWITCH_ID:
				return END_SWITCH_SYMBOL_PHP54;
			case OBJECT_OP_SYMBOL_ID:
				return OBJECT_OP_SYMBOL_PHP54;
			default:
				break;
			}
		}
		return ERROR_SYMBOL;
	}

	/**
	 * Returns the sym integer for the given modifier ('public', 'final',
	 * 'protected' etc.).
	 *
	 * @param modifier
	 *            The modifier string
	 * @param phpVersion
	 *            The relevant PHP version.
	 * @return The sym id or the ERROR_SYMBOL.sym in case of an error.
	 */
	public static int getModifierSym(String modifier, PHPVersion phpVersion) {
		// if (PHPVersion.PHP5_4 == phpVersion) {
		//			if (modifier.equals("public")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_PUBLIC;
		//			} else if (modifier.equals("private")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_PRIVATE;
		//			} else if (modifier.equals("protected")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_PROTECTED;
		//			} else if (modifier.equals("static")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_STATIC;
		//			} else if (modifier.equals("abstract")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_ABSTRACT;
		//			} else if (modifier.equals("final")) { //$NON-NLS-1$
		// return
		// org.eclipse.php.internal.core.ast.scanner.php54.ParserConstants.T_FINAL;
		// }
		// }
		return ERROR_SYMBOL.sym;
	}
}


text:
import { css, Global } from "@emotion/core";
import forEach from "lodash/forEach";
import * as React from "react";
import { Font, Fonts } from "../../schema/Theme";

interface GlobalStylesProps {
  fonts: Fonts;
}

function GlobalStyles({ fonts }: GlobalStylesProps) {
  React.useEffect(() => {
    forEach(fonts.variants, (variant) => {
      if (variant.href) {
        generateFontReference(variant.href);
      }
    });
  }, []);

  return (
    <Global
      styles={css`
        ${generateFontDeclarations(fonts.variants)}

        * {
          box-sizing: border-box;

          /* Force accurate printing in Chrome */
          /* https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust */
          -webkit-print-color-adjust: exact;
        }

        body {
          font-family: "${fonts.primary}", sans-serif;
          background: "white";
        }

        h1,
        h2,
        h3,
        h4,
        html,
        body {
          padding: 0;
          margin: 0;
        }
      `}
    />
  );
}

function generateFontReference(href: Font["href"]) {
  if (!href) {
    return;
  }

  const fontLink = document.createElement("link");

  fontLink.href = href;

  fontLink.rel = "stylesheet";
  fontLink.type = "text/css";
  fontLink.crossOrigin = "anonymous";

  document.body.appendChild(fontLink);
}

function generateFontDeclarations(fonts: Font[]) {
  return fonts.map(generateFontDeclaration).join("\n");
}

function generateFontDeclaration(font: Font) {
  if (font.href) {
    return "";
  }

  return `
@font-face {
  font-family: "${font.family}";
  font-weight: ${font.weight};
  font-style: ${font.style};
  src: ${generateFontSrc(font.fileName, font.formats)}
}`;
}

function generateFontSrc(
  fileName: Font["fileName"],
  formats: Font["formats"]
): string {
  if (!fileName || !formats) {
    return "";
  }

  return formats.map(generateFontUrl(fileName)).join(",\n");
}

function generateFontUrl(fileName: string) {
  return (format: string): string =>
    `url("${fileName}.${format}") format("${generateFormat(format)}")`;
}

function generateFormat(format: string): string {
  if (format === "ttf") {
    return "truetype";
  }

  if (format === "otf") {
    return "opentype";
  }

  return format;
}

export default GlobalStyles;


text:
namespace CONFIG4CPP_NAMESPACE {

void
SchemaTypeFloat::checkRule(
	const SchemaValidator *		sv,
	const Configuration *		cfg,
	const char *				typeName,
	const StringVector &		typeArgs,
	const char *				rule) const throw(ConfigurationException)
{
    (void) sv;

	StringBuffer				msg;
	int							len;
	float						min;
	float						max;

	len = typeArgs.length();
	if (len == 0) {
		return;
	}
	if (len != 2) {
		msg << "the '" << typeName << "' type should take either no arguments "
			<< "or 2 arguments (denoting " << "min and max values) in rule '"
			<< rule << "'";
		throw ConfigurationException(msg.c_str());
	}
	try {
		min = cfg->stringToFloat("", "", typeArgs[0]);
	} catch (const ConfigurationException & ex) {
		msg << "non-float value for the first ('min') argument in rule '"
			<< rule << "'";
		throw ConfigurationException(msg.c_str());
	}
	try {
		max = cfg->stringToFloat("", "", typeArgs[1]);
	} catch (const ConfigurationException & ex) {
		msg << "non-float value for the second ('max') argument in rule '"
			<< rule << "'";
		throw ConfigurationException(msg.c_str());
	}
	if (min > max) {
		msg << "the first ('min') value is larger than the second ('max') "
			<< "argument in " << "rule '" << rule << "'";
		throw ConfigurationException(msg.c_str());
	}
}

bool
SchemaTypeFloat::isA(
	const SchemaValidator *		sv,
	const Configuration *		cfg,
	const char *				value,
	const char *				typeName,
	const StringVector &		typeArgs,
	int							indentLevel,
	StringBuffer &				errSuffix) const
{
    (void) sv;
    (void) typeName;
    (void) indentLevel;

	float						val;
	float						min;
	float						max;

	try {
		val = cfg->stringToFloat("", "", value);
	} catch (const ConfigurationException & ex) {
		return false;
	}
	if (typeArgs.length() == 0) {
		return true;
	}
	min = cfg->stringToFloat("", "", typeArgs[0]);
	max = cfg->stringToFloat("", "", typeArgs[1]);
	if (val < min || val > max) {
		errSuffix << "the value is outside the permitted range ["
				  << typeArgs[0] << ", " << typeArgs[1] << "]";
		return false;
	}
	return true;
}

} // namespace CONFIG4CPP_NAMESPACE


text:
package py4j.examples;

import py4j.GatewayServer;

public class StackEntryPoint {

  private Stack stack;

  public StackEntryPoint() {
    stack = new Stack();
  }

  public Stack getStack() {
    return stack;
  }

  public static void main(String[] args) {
    GatewayServer gatewayServer = new GatewayServer(new StackEntryPoint());
    gatewayServer.start();
    System.out.println("Gateway Server Started");
  }
}


text:
@class eLongPopupTitleView;

typedef NS_ENUM(NSInteger, eLongPopupTitleViewActionType) {
    eLongPopupTitleViewActionTypeLeftButtonClick,
    eLongPopupTitleViewActionTypeRightButtonClick
};

@protocol eLongPopupTitleViewDelegate<NSObject>

- (void)eLongPopupTitleView:(eLongPopupTitleView *)titleView actionWithType:(eLongPopupTitleViewActionType)type;

@end

@interface eLongPopupTitleView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *leftButton;
@property (nonatomic, strong) UIButton *rightButton;
@property (nonatomic, weak) id<eLongPopupTitleViewDelegate> delegate;

@end


text:
import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, Subscription } from 'rxjs';

import { IUser } from '../../../business-entities';
import { AuthService }  from './../../services';

@Component({
	selector: 'main-header',
	templateUrl: 'header.component.html',
	styles: [require('./header.component.scss')],
	providers: [],
	encapsulation: ViewEncapsulation.None,
	changeDetection: ChangeDetectionStrategy.OnPush
})
export class HeaderComponent implements OnInit, OnDestroy {
	public _userInfo: string;

	userInfo: Observable<IUser>;
	isAuthenticated: Observable<boolean>;

	private sub: Subscription;

	constructor(
		public authService: AuthService,
		private router: Router
	) {
		this.isAuthenticated = this.authService.isAuthenticated$;
		this.userInfo = this.authService.userInfo$;
	}

	ngOnInit() {

	}

	ngOnDestroy() {
		if (this.sub) {
			this.sub.unsubscribe();
		}
	}

	logout($event) {
		if ($event) {
			$event.preventDefault();
		}
		this.sub = this.authService.logout().subscribe(
			(resp) => {
				console.log('mark logout');
				this.router.navigate(['login']);
            },
            (error) => {
                console.error('error', error);
            }
		);
	}
}


text:
//
//  CJWHello.m
//  CJWUtilsS
//
//  Created by Frank on 6/30/16.
//  Copyright © 2016 cen. All rights reserved.
//

#import "CJWHello.h"

@implementation CJWHello

//-tes

//-t

-(void)tesing{
    NSLog(@"helo");
}

@end

@implementation NSDate (CJWDate)

-(void)testing{
    NSLog(@"fucking testing");
}

@end

@implementation UIImage (fixOrientation)

- (UIImage *)fixOrientation {

    // No-op if the orientation is already correct
    if (self.imageOrientation == UIImageOrientationUp) return self;

    // We need to calculate the proper transformation to make the image upright.
    // We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored.
    CGAffineTransform transform = CGAffineTransformIdentity;

    switch (self.imageOrientation) {
        case UIImageOrientationDown:
        case UIImageOrientationDownMirrored:
            transform = CGAffineTransformTranslate(transform, self.size.width, self.size.height);
            transform = CGAffineTransformRotate(transform, M_PI);
            break;

        case UIImageOrientationLeft:
        case UIImageOrientationLeftMirrored:
            transform = CGAffineTransformTranslate(transform, self.size.width, 0);
            transform = CGAffineTransformRotate(transform, M_PI_2);
            break;

        case UIImageOrientationRight:
        case UIImageOrientationRightMirrored:
            transform = CGAffineTransformTranslate(transform, 0, self.size.height);
            transform = CGAffineTransformRotate(transform, -M_PI_2);
            break;
        case UIImageOrientationUp:
        case UIImageOrientationUpMirrored:
            break;
    }

    switch (self.imageOrientation) {
        case UIImageOrientationUpMirrored:
        case UIImageOrientationDownMirrored:
            transform = CGAffineTransformTranslate(transform, self.size.width, 0);
            transform = CGAffineTransformScale(transform, -1, 1);
            break;

        case UIImageOrientationLeftMirrored:
        case UIImageOrientationRightMirrored:
            transform = CGAffineTransformTranslate(transform, self.size.height, 0);
            transform = CGAffineTransformScale(transform, -1, 1);
            break;
        case UIImageOrientationUp:
        case UIImageOrientationDown:
        case UIImageOrientationLeft:
        case UIImageOrientationRight:
            break;
    }

    // Now we draw the underlying CGImage into a new context, applying the transform
    // calculated above.
    CGContextRef ctx = CGBitmapContextCreate(NULL, self.size.width, self.size.height,
                                             CGImageGetBitsPerComponent(self.CGImage), 0,
                                             CGImageGetColorSpace(self.CGImage),
                                             CGImageGetBitmapInfo(self.CGImage));
    CGContextConcatCTM(ctx, transform);
    switch (self.imageOrientation) {
        case UIImageOrientationLeft:
        case UIImageOrientationLeftMirrored:
        case UIImageOrientationRight:
        case UIImageOrientationRightMirrored:
            // Grr...
            CGContextDrawImage(ctx, CGRectMake(0,0,self.size.height,self.size.width), self.CGImage);
            break;

        default:
            CGContextDrawImage(ctx, CGRectMake(0,0,self.size.width,self.size.height), self.CGImage);
            break;
    }

    // And now we just create a new UIImage from the drawing context
    CGImageRef cgimg = CGBitmapContextCreateImage(ctx);
    UIImage *img = [UIImage imageWithCGImage:cgimg];
    CGContextRelease(ctx);
    CGImageRelease(cgimg);
    return img;
}

@end

@implementation NSString (Validate)

/*邮箱验证 MODIFIED BY HELENSONG*/
-(BOOL)isValidateEmail:(NSString *)email
{
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
    return [emailTest evaluateWithObject:email];
}

/*手机号码验证 MODIFIED BY HELENSONG*/
-(BOOL) isValidateMobile:(NSString *)mobile
{
    //手机号以13, 15,18开头,八个 \d 数字字符
    NSString *phoneRegex = @"^((13[0-9])|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";
    NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",phoneRegex];
    //    NSLog(@"phoneTest is %@",phoneTest);
    return [phoneTest evaluateWithObject:mobile];
}

/*车牌号验证 MODIFIED BY HELENSONG*/
-(BOOL)validateCarNo:(NSString *)carNo
{
    NSString *carRegex = @"^[A-Za-z]{1}[A-Za-z_0-9]{5}$";
    NSPredicate *carTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",carRegex];
    NSLog(@"carTest is %@",carTest);
    return [carTest evaluateWithObject:carNo];
}
@end


text:
Concept
=======

.. toctree::

   concept/authentication
   concept/value_object


text:
<?php

namespace Exception;

use Arbor\Core\Exception;

/**
 * @package Exception
 * @author Slawomir Nowak (s.nowak@coderdojo.org.pl)
 * @author Michal Tomczak (m.tomczak@coderdojo.org.pl)
 */
class DeviceStateNotFoundException extends Exception{

	public function __construct(){
		parent::__construct(1,'Device state not found.');
	}

}


text:
create class hash_char (id int, test_char char(2))
partition by hash(test_char) partitions 8;

insert into hash_char values (1,'11');
insert into hash_char values (2,'22');
insert into hash_char values (3,'33');
insert into hash_char values (4,'AA');
insert into hash_char values (5,'bb');
select * from hash_char where test_char = trim(substring('123AA  ' from 4));

drop class hash_char;


text:
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.intersphinx',
    'sphinx.ext.viewcode',
    'sphinx.ext.coverage'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'environment_tools'
copyright = u'Yelp Inc'

from environment_tools import version
release = version

exclude_patterns = []

pygments_style = 'sphinx'

# -- Options for HTML output ---------------------------------------------------

html_theme = 'sphinxdoc'

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}


text:
`MdSnackBar` is a service for displaying snack-bar notifications.

<!-- example(snack-bar-overview) -->

### Opening a snack-bar
A snack-bar can contain either a string message or a given component.
```ts
// Simple message.
let snackBarRef = snackBar.open('Message archived');

// Simple message with an action.
let snackBarRef = snackBar.open('Message archived', 'Undo');

// Load the given component into the snack-bar.
let snackBarRef = snackbar.openFromComponent(MessageArchivedComponent);
```

In either case, a `MdSnackBarRef` is returned. This can be used to dismiss the snack-bar or to
receive notification of when the snack-bar is dismissed. For simple messages with an action, the
`MdSnackBarRef` exposes an observable for when the action is triggered.
If you want to close a custom snack-bar that was opened via `openFromComponent`, from within the
component itself, you can inject the `MdSnackBarRef`.

```ts
snackBarRef.afterDismissed().subscribe(() => {
  console.log('The snack-bar was dismissed');
});

snackBarRef.onAction().subscribe(() => {
  console.log('The snack-bar action was triggered!');
});

snackBarRef.dismiss();
```

### Dismissal
A snack-bar can be dismissed manually by calling the `dismiss` method on the `MdSnackBarRef`
returned from the call to `open`.

Only one snack-bar can ever be opened at one time. If a new snackbar is opened while a previous
message is still showing, the older message will be automatically dismissed.

A snack-bar can also be given a duration via the optional configuration object:
```ts
snackbar.open('Message archived', 'Undo', {
  duration: 3000
});
```

### Sharing data with a custom snack-bar
You can share data with the custom snack-bar, that you opened via the `openFromComponent` method,
by passing it through the `data` property.

```ts
snackbar.openFromComponent(MessageArchivedComponent, {
  data: 'some data'
});
```

To access the data in your component, you have to use the `MD_SNACK_BAR_DATA` injection token:

```ts
import {Component, Inject} from '@angular/core';
import {MD_SNACK_BAR_DATA} from '@angular/material';

@Component({
  selector: 'your-snack-bar',
  template: 'passed in {{ data }}',
})
export class MessageArchivedComponent {
  constructor(@Inject(MD_SNACK_BAR_DATA) public data: any) { }
}
```
### Accessibility
Snack-bar messages are announced via an `aria-live` region. Focus is not moved to
the snack-bar element, as this would be disruptive to a user in the middle of a
workflow. For any action offered in the snack-bar, the application should offer the
user an alternative way to perform the action (typically via keyboard shortcut).


text:
const styled = require('styled-components').default;
const { keyframes, css } = require('styled-components');
import { Status } from './types';
import colorMap from '../theming/colorMap';

const backgroundColor = (status: Status) => css`
  background-color: ${colorMap[status] || colorMap.offwhite};
`;

const unmount = keyframes`
  0% { transform: translateY(0%); }
  100% { transform: translateY(-100%); }
`;

const mount = keyframes`
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0%); }
`;

export const Button = styled.button`
  background-color: transparent;
  border: 0px;
  color: #333;
  cursor: pointer;
  font-size: 2rem;
`;

export default styled.div`
  position: fixed;
  font-size: 1.3rem;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: row;
  ${(props) => backgroundColor(props.status)};
  animation: ${(props) => props.isUnmounting ? unmount : mount} 1s;
`;


text:
rm -Rfv ~/Library/Application\ Support/io.wwdc.app*
defaults delete io.wwdc.app


text:
Open With Atom
===
Open files or a folders in [Atom](http://atom.io) by using a Keyword `atom` or by file/folder action.

When using the keyword, the currently selected items in Finder will be openend, if you currently have no selection, the frontmost folder will open in Atom. If you have neither a selection nor an open Finder window to be opened, your user home directory will be openend as a default (This can easily be reconfigured to default to your desktop folder by commenting one line and uncommenting another in the Applescript source of the workflow).

Optionally enter a (POSIX) path to a directory or file to open in Atom, `~/` will be expanded.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="robots" content="index, follow">
    <meta name="googlebot" content="index, follow">
    {% seo %}
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    {% if page.css %}<link rel="stylesheet" type="text/css" href="{{ BASE_PATH }}/assets/css/{{ page.css }}" />{% endif %}

	  <link rel="icon" href="{{ BASE_PATH }}/assets/images/fav2.png" type="image/x-icon">
		<link rel="stylesheet" href="{{ BASE_PATH }}/assets/css/startup/bootstrap.min.css" />
		<link rel="stylesheet" href="{{ BASE_PATH }}/assets/css/startup/style.css" />
		<link rel="stylesheet" href="{{ BASE_PATH }}/assets/css/aerial/font-awesome.min.css" />
		<link href="{{ BASE_PATH }}/assets/fonts/charissil/charissil.css" rel="stylesheet">
		<link href="{{ BASE_PATH }}/assets/fonts/fira/fira.css" rel="stylesheet">
		<link href="{{ BASE_PATH }}/assets/fonts/openiconic/css/open-iconic.css" rel="stylesheet">

    	  {% include JB/analytics %}

    <link href="{{ BASE_PATH }}{{ site.JB.atom_path }}" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
    <link href="{{ BASE_PATH }}{{ site.JB.rss_path }}" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">

    {% if site.google_ad_client %}

    {% endif %}

    <link type="text/css" rel="stylesheet" href="{{ BASE_PATH }}/css/pandalocker.2.0.0.min.css">

      {% include themes/bootstrap/nav-bar.html %}

      {{ content }}
      {% include themes/bootstrap/footer-page.html %}

	{% if page.js %}{% endif %}


text:
package org.jbpm.casemgmt.impl.event;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.jbpm.casemgmt.api.event.CaseEventListener;
import org.jbpm.casemgmt.impl.audit.CaseInstanceAuditLoggerFactory;
import org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener;
import org.jbpm.runtime.manager.impl.PerCaseRuntimeManager;
import org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment;
import org.jbpm.runtime.manager.impl.jpa.EntityManagerFactoryManager;
import org.jbpm.services.api.DeploymentEvent;
import org.jbpm.services.api.DeploymentEventListener;
import org.jbpm.shared.services.impl.TransactionalCommandService;
import org.kie.api.runtime.EnvironmentName;
import org.kie.internal.identity.IdentityProvider;
import org.kie.internal.runtime.Cacheable;
import org.kie.internal.runtime.Closeable;
import org.kie.internal.runtime.conf.AuditMode;
import org.kie.internal.runtime.conf.DeploymentDescriptor;
import org.kie.internal.runtime.conf.ObjectModel;
import org.kie.internal.runtime.conf.ObjectModelResolver;
import org.kie.internal.runtime.conf.ObjectModelResolverProvider;
import org.kie.internal.runtime.manager.InternalRuntimeManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Configuration listener that must be attached to DeploymentService so it can react
 * to deployed units so it can register case event listeners per deployment unit.
 *
 */
public class CaseConfigurationDeploymentListener implements DeploymentEventListener {

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

    private IdentityProvider identityProvider;
    private TransactionalCommandService transactionalCommandService;

    public CaseConfigurationDeploymentListener(IdentityProvider identityProvider) {
        this(identityProvider, null);
    }

    public CaseConfigurationDeploymentListener(IdentityProvider identityProvider, TransactionalCommandService transactionalCommandService) {
        this.identityProvider = identityProvider;
        this.transactionalCommandService = transactionalCommandService;
    }

    @Override
    public void onDeploy(DeploymentEvent event) {
        InternalRuntimeManager runtimeManager = (InternalRuntimeManager) event.getDeployedUnit().getRuntimeManager();
        if (runtimeManager instanceof PerCaseRuntimeManager) {
            List<CaseEventListener> caseEventListeners = getEventListenerFromDescriptor(runtimeManager);

            logger.debug("Adding following case event listeners {} for deployment {}", caseEventListeners, event.getDeploymentId());

            TransactionalCommandService commandService = transactionalCommandService;
            if (commandService == null) {
                commandService = new TransactionalCommandService(((SimpleRuntimeEnvironment) runtimeManager.getEnvironment()).getEmf());
            }

            CaseEventListener auditEventListener = getCaseAuditEventListener(runtimeManager, commandService);
            caseEventListeners.add(auditEventListener);
            caseEventListeners.add(new NotifyParentCaseEventListener(identityProvider, runtimeManager));
            CaseEventSupport caseEventSupport = new CaseEventSupport(identityProvider, caseEventListeners);
            ((PerCaseRuntimeManager) runtimeManager).setCaseEventSupport(caseEventSupport);
            logger.debug("CaseEventSupport configured for deployment {}", event.getDeploymentId());
        }
    }

    @Override
    public void onUnDeploy(DeploymentEvent event) {
        InternalRuntimeManager runtimeManager = (InternalRuntimeManager) event.getDeployedUnit().getRuntimeManager();
        if (runtimeManager instanceof PerCaseRuntimeManager) {

            CaseEventSupport caseEventSupport = (CaseEventSupport) ((PerCaseRuntimeManager) runtimeManager).getCaseEventSupport();
            if (caseEventSupport != null) {
                caseEventSupport.reset();
                logger.debug("CaseEventSupport disposed for deployment {}", event.getDeploymentId());
            }
        }
    }

    @Override
    public void onActivate(DeploymentEvent event) {
        // no-op
    }

    @Override
    public void onDeactivate(DeploymentEvent event) {
        // no-op
    }

    protected List<CaseEventListener>  getEventListenerFromDescriptor(InternalRuntimeManager runtimeManager) {
        List<CaseEventListener> listeners = new ArrayList<CaseEventListener>();
        DeploymentDescriptor descriptor = runtimeManager.getDeploymentDescriptor();
        if (descriptor != null) {
            Map<String, Object> params = getParametersMap(runtimeManager);
            for (ObjectModel model : descriptor.getEventListeners()) {
                ObjectModelResolver resolver = ObjectModelResolverProvider.get(model.getResolver());
                if (resolver == null) {
                    logger.warn("Unable to find ObjectModelResolver for {}", model.getResolver());
                    continue;
                }
                try {
                    Object listenerInstance = resolver.getInstance(model, runtimeManager.getEnvironment().getClassLoader(), params);
                    if (listenerInstance != null && CaseEventListener.class.isAssignableFrom(listenerInstance.getClass())) {
                        listeners.add((CaseEventListener) listenerInstance);
                    } else {
                        // close/cleanup instance as it is not going to be used at the moment, except these that are cacheable
                        if (listenerInstance instanceof Closeable && !(listenerInstance instanceof Cacheable)) {
                            ((Closeable) listenerInstance).close();
                        }
                    }
                } catch (Exception e) {
                    logger.debug("Unable to build listener {}", model);
                }
            }
        }

        return listeners;
    }

    protected Map<String, Object> getParametersMap(InternalRuntimeManager runtimeManager) {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("runtimeManager", runtimeManager);
        parameters.put("classLoader", runtimeManager.getEnvironment().getClassLoader());
        parameters.put("entityManagerFactory", ((SimpleRuntimeEnvironment)runtimeManager.getEnvironment()).getEmf());
        parameters.put("kieContainer", runtimeManager.getKieContainer());
        parameters.put("identityProvider", ((SimpleRuntimeEnvironment)runtimeManager.getEnvironment()).getEnvironmentTemplate().get(EnvironmentName.IDENTITY_PROVIDER));

        return parameters;
    }

    @SuppressWarnings({"unchecked", "rawtypes"})
    protected CaseEventListener getCaseAuditEventListener(InternalRuntimeManager manager, TransactionalCommandService commandService) {
        DeploymentDescriptor descriptor = manager.getDeploymentDescriptor();
        if (descriptor == null) {
            return CaseInstanceAuditLoggerFactory.newJPAInstance(commandService);
        } else if (descriptor.getAuditMode() == AuditMode.JPA) {
            if (descriptor.getPersistenceUnit().equals(descriptor.getAuditPersistenceUnit())) {
                return CaseInstanceAuditLoggerFactory.newJPAInstance(commandService);
            } else {
                return CaseInstanceAuditLoggerFactory.newJPAInstance(EntityManagerFactoryManager.get().getOrCreate(descriptor.getAuditPersistenceUnit()));
            }
        } else if (descriptor.getAuditMode() == AuditMode.JMS) {

            try {
                Properties properties = new Properties();
                InputStream input = manager.getEnvironment().getClassLoader().getResourceAsStream("/jbpm.audit.jms.properties");
                if (input == null) {
                    input = manager.getEnvironment().getClassLoader().getResourceAsStream("jbpm.audit.jms.properties");
                }
                properties.load(input);

                return CaseInstanceAuditLoggerFactory.newJMSInstance((Map)properties);
            } catch (Exception e) {
                throw new RuntimeException("Unable to create JMS audit logger", e);
            }

        } else {
            logger.warn("Audit mode {} is not supported for CaseInstance audit logs", descriptor.getAuditMode());
        }

        // in case no other matched, return JPA based one
        return CaseInstanceAuditLoggerFactory.newJPAInstance(commandService);
    }
}


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
 * pkix_pl_nsscontext.h
 *
 * NSSContext Object Type Definition
 *
 */

#ifndef _PKIX_PL_NSSCONTEXT_H
#define _PKIX_PL_NSSCONTEXT_H

#include "pkix_pl_common.h"

#ifdef __cplusplus
extern "C" {
#endif

struct PKIX_PL_NssContextStruct {
        SECCertificateUsage certificateUsage;
        PRArenaPool *arena;
        void *wincx;
        PKIX_UInt32 timeoutSeconds;
        PKIX_UInt32 maxResponseLength;
        PRTime crlReloadDelay;
        PRTime badDerCrlReloadDelay;
        CERTChainVerifyCallback chainVerifyCallback;
};

PKIX_Error *
pkix_pl_NssContext_GetCertUsage
        (PKIX_PL_NssContext *nssContext, SECCertificateUsage *pCertUsage);

/* XXX move the setter into the public header. */
PKIX_Error *
pkix_pl_NssContext_SetCertUsage
        (SECCertificateUsage certUsage, PKIX_PL_NssContext *nssContext);

PKIX_Error *
pkix_pl_NssContext_GetWincx(PKIX_PL_NssContext *nssContext, void **pWincx);

/* XXX move the setter into the public header. */
PKIX_Error *
pkix_pl_NssContext_SetWincx(void *wincx, PKIX_PL_NssContext *nssContext);

#ifdef __cplusplus
}
#endif

#endif /* _PKIX_PL_NSSCONTEXT_H */


text:
<?xml version="1.0" encoding="UTF-8"?>
<sponge xmlns="https://sponge.openksavi.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://sponge.openksavi.org https://sponge.openksavi.org/schema/config.xsd">

    <engine>
        <mainProcessingUnitThreadCount>20</mainProcessingUnitThreadCount>
    </engine>

    <knowledgeBases>
        <knowledgeBase name="kb">
            <file>rules_events.py</file>
        </knowledgeBase>
    </knowledgeBases>
</sponge>


text:
static const int kMallocHistogramSize = 64;

// One day, we could support other types of writers (perhaps for C?)
typedef std::string MallocExtensionWriter;

namespace base {
struct MallocRange;
}

// The default implementations of the following routines do nothing.
// All implementations should be thread-safe; the current one
// (TCMallocImplementation) is.
class PERFTOOLS_DLL_DECL MallocExtension {
 public:
  virtual ~MallocExtension();

  // Call this very early in the program execution -- say, in a global
  // constructor -- to set up parameters and state needed by all
  // instrumented malloc implemenatations.  One example: this routine
  // sets environemnt variables to tell STL to use libc's malloc()
  // instead of doing its own memory management.  This is safe to call
  // multiple times, as long as each time is before threads start up.
  static void Initialize();

  // See "verify_memory.h" to see what these routines do
  virtual bool VerifyAllMemory();
  virtual bool VerifyNewMemory(void* p);
  virtual bool VerifyArrayNewMemory(void* p);
  virtual bool VerifyMallocMemory(void* p);
  virtual bool MallocMemoryStats(int* blocks, size_t* total,
                                 int histogram[kMallocHistogramSize]);

  // Get a human readable description of the current state of the malloc
  // data structures.  The state is stored as a null-terminated string
  // in a prefix of "buffer[0,buffer_length-1]".
  // REQUIRES: buffer_length > 0.
  virtual void GetStats(char* buffer, int buffer_length);

  // Outputs to "writer" a sample of live objects and the stack traces
  // that allocated these objects.  The format of the returned output
  // is equivalent to the output of the heap profiler and can
  // therefore be passed to "pprof".
  virtual void GetHeapSample(MallocExtensionWriter* writer);

  // Outputs to "writer" the stack traces that caused growth in the
  // address space size.  The format of the returned output is
  // equivalent to the output of the heap profiler and can therefore
  // be passed to "pprof".
  virtual void GetHeapGrowthStacks(MallocExtensionWriter* writer);

  // Invokes func(arg, range) for every controlled memory
  // range.  *range is filled in with information about the range.
  //
  // This is a best-effort interface useful only for performance
  // analysis.  The implementation may not call func at all.
  typedef void (RangeFunction)(void*, const base::MallocRange*);
  virtual void Ranges(void* arg, RangeFunction func);

  // -------------------------------------------------------------------
  // Control operations for getting and setting malloc implementation
  // specific parameters.  Some currently useful properties:
  //
  // generic
  // -------
  // "generic.current_allocated_bytes"
  //      Number of bytes currently allocated by application
  //      This property is not writable.
  //
  // "generic.heap_size"
  //      Number of bytes in the heap ==
  //            current_allocated_bytes +
  //            fragmentation +
  //            freed memory regions
  //      This property is not writable.
  //
  // tcmalloc
  // --------
  // "tcmalloc.max_total_thread_cache_bytes"
  //      Upper limit on total number of bytes stored across all
  //      per-thread caches.  Default: 16MB.
  //
  // "tcmalloc.current_total_thread_cache_bytes"
  //      Number of bytes used across all thread caches.
  //      This property is not writable.
  //
  // "tcmalloc.slack_bytes"
  //      Number of bytes allocated from system, but not currently in
  //      use by malloced objects.  I.e., bytes available for
  //      allocation without needing more bytes from system.  It is
  //      the sum of pageheap_free_bytes and pageheap_unmapped_bytes.
  //      This property is not writable.
  //
  // "tcmalloc.pageheap_free_bytes"
  //      Number of bytes in free, mapped pages in pageheap
  //      This property is not writable.
  //
  // "tcmalloc.pageheap_unmapped_bytes"
  //      Number of bytes in free, unmapped pages in pageheap
  //      This property is not writable.
  //
  // -------------------------------------------------------------------

  // Get the named "property"'s value.  Returns true if the property
  // is known.  Returns false if the property is not a valid property
  // name for the current malloc implementation.
  // REQUIRES: property != NULL; value != NULL
  virtual bool GetNumericProperty(const char* property, size_t* value);

  // Set the named "property"'s value.  Returns true if the property
  // is known and writable.  Returns false if the property is not a
  // valid property name for the current malloc implementation, or
  // is not writable.
  // REQUIRES: property != NULL
  virtual bool SetNumericProperty(const char* property, size_t value);

  // Mark the current thread as "idle".  This routine may optionally
  // be called by threads as a hint to the malloc implementation that
  // any thread-specific resources should be released.  Note: this may
  // be an expensive routine, so it should not be called too often.
  //
  // Also, if the code that calls this routine will go to sleep for
  // a while, it should take care to not allocate anything between
  // the call to this routine and the beginning of the sleep.
  //
  // Most malloc implementations ignore this routine.
  virtual void MarkThreadIdle();

  // Mark the current thread as "busy".  This routine should be
  // called after MarkThreadIdle() if the thread will now do more
  // work.  If this method is not called, performance may suffer.
  //
  // Most malloc implementations ignore this routine.
  virtual void MarkThreadBusy();

  // Try to release num_bytes of free memory back to the operating
  // system for reuse.  Use this extension with caution -- to get this
  // memory back may require faulting pages back in by the OS, and
  // that may be slow.  (Currently only implemented in tcmalloc.)
  virtual void ReleaseToSystem(size_t num_bytes);

  // Same as ReleaseToSystem() but release as much memory as possible.
  virtual void ReleaseFreeMemory();

  // Sets the rate at which we release unused memory to the system.
  // Zero means we never release memory back to the system.  Increase
  // this flag to return memory faster; decrease it to return memory
  // slower.  Reasonable rates are in the range [0,10].  (Currently
  // only implemented in tcmalloc).
  virtual void SetMemoryReleaseRate(double rate);

  // Gets the release rate.  Returns a value < 0 if unknown.
  virtual double GetMemoryReleaseRate();

  // Returns the estimated number of bytes that will be allocated for
  // a request of "size" bytes.  This is an estimate: an allocation of
  // SIZE bytes may reserve more bytes, but will never reserve less.
  // (Currently only implemented in tcmalloc, other implementations
  // always return SIZE.)
  virtual size_t GetEstimatedAllocatedSize(size_t size);

  // Returns the actual number N of bytes reserved by tcmalloc for the
  // pointer p.  The client is allowed to use the range of bytes
  // [p, p+N) in any way it wishes (i.e. N is the "usable size" of this
  // allocation).  This number may be equal to or greater than the number
  // of bytes requested when p was allocated.
  // p must have been allocated by this malloc implementation,
  // must not be an interior pointer -- that is, must be exactly
  // the pointer returned to by malloc() et al., not some offset
  // from that -- and should not have been freed yet.  p may be NULL.
  // (Currently only implemented in tcmalloc; other implementations
  // will return 0.)
  virtual size_t GetAllocatedSize(void* p);

  // The current malloc implementation.  Always non-NULL.
  static MallocExtension* instance();

  // Change the malloc implementation.  Typically called by the
  // malloc implementation during initialization.
  static void Register(MallocExtension* implementation);

 protected:
  // Get a list of stack traces of sampled allocation points.  Returns
  // a pointer to a "new[]-ed" result array, and stores the sample
  // period in "sample_period".
  //
  // The state is stored as a sequence of adjacent entries
  // in the returned array.  Each entry has the following form:
  //    uintptr_t count;        // Number of objects with following trace
  //    uintptr_t size;         // Total size of objects with following trace
  //    uintptr_t depth;        // Number of PC values in stack trace
  //    void*     stack[depth]; // PC values that form the stack trace
  //
  // The list of entries is terminated by a "count" of 0.
  //
  // It is the responsibility of the caller to "delete[]" the returned array.
  //
  // May return NULL to indicate no results.
  //
  // This is an internal extension.  Callers should use the more
  // convenient "GetHeapSample(string*)" method defined above.
  virtual void** ReadStackTraces(int* sample_period);

  // Like ReadStackTraces(), but returns stack traces that caused growth
  // in the address space size.
  virtual void** ReadHeapGrowthStackTraces();
};

namespace base {

// Information passed per range.  More fields may be added later.
struct MallocRange {
  enum Type {
    INUSE,                // Application is using this range
    FREE,                 // Range is currently free
    UNMAPPED,             // Backing physical memory has been returned to the OS
    UNKNOWN,
    // More enum values may be added in the future
  };

  uintptr_t address;    // Address of range
  size_t length;        // Byte length of range
  Type type;            // Type of this range
  double fraction;      // Fraction of range that is being used (0 if !INUSE)

  // Perhaps add the following:
  // - stack trace if this range was sampled
  // - heap growth stack trace if applicable to this range
  // - age when allocated (for inuse) or freed (if not in use)
};

} // namespace base

#endif  // BASE_MALLOC_EXTENSION_H_


text:
__author__ = 'Konstantin Dmitriev'

import os, shutil, errno
import random
import time
import threading
import io
import shutil

if os.name == 'nt':
    import ctypes
    kdll = ctypes.windll.LoadLibrary("kernel32.dll")

def which(program):
    def is_exe(fpath):
        if os.name=='nt':
            return os.path.isfile(fpath) or os.path.isfile(fpath+".exe") or os.path.isfile(fpath+".bat")
        else:
            return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

    fpath, fname = os.path.split(program)
    if fpath:
        program=os.path.realpath(program)
        if is_exe(program):
            return program
    else:
        path = shutil.which(program)
        if path:
            return os.path.realpath(path)

    return None

def copytree(src, dst, symlinks=False, hardlinks=False, ignore=None):
    names = os.listdir(src)
    if ignore is not None:
        ignored_names = ignore(src, names)
    else:
        ignored_names = set()

    mkdirs(dst)

    errors = []
    for name in names:
        if name in ignored_names:
            continue
        srcname = os.path.join(src, name)
        dstname = os.path.join(dst, name)
        try:
            if symlinks and os.path.islink(srcname):
                linkto = os.readlink(srcname)
                os.symlink(linkto, dstname)
            elif os.path.isdir(srcname):
                copytree(srcname, dstname, symlinks, hardlinks, ignore)
            elif hardlinks:
                os.link(srcname, dstname)
            else:
                shutil.copy2(srcname, dstname)
            # XXX What about devices, sockets etc.?
        except (IOError, os.error) as why:
            errors.append((srcname, dstname, str(why)))
        # catch the Error from the recursive copytree so that we can
        # continue with other files
        except shutil.Error as err:
            errors.extend(err.args[0])

    if errors:
        raise shutil.Error(errors)

def mkdirs(path):
    try:
        os.makedirs(path)
    except OSError as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise

def touch(path, timevalue=None):
    if timevalue==None:
        timevalue=time.time()
    basedir = os.path.dirname(path)
    if not os.path.exists(basedir):
        os.makedirs(basedir)
    if not os.path.exists(path):
        with open(path, 'a'):
            os.utime(path, (timevalue, timevalue))
    else:
        os.utime(path, (timevalue, timevalue))

def file_is_older_than(path, seconds):
    return (time.time()-os.path.getmtime(path))>seconds

def float_trunc(f, n):
    '''Truncates/pads a float f to n decimal places without rounding'''
    slen = len('%.*f' % (n, f))
    return float(str(f)[:slen])

def sync(profile_output, output, compareTime=None):

    if os.path.exists(profile_output):

        needSync=True

        if compareTime!=None:
            if os.path.exists(profile_output+".sync") and os.path.exists(output):
                if float_trunc(os.path.getmtime(profile_output+".sync"),1) >= compareTime:
                    needSync=False

        if needSync:

            if compareTime!=None:
                output_str=output
                if len(output_str)>60:
                    output_str="..."+output_str[-60:]
                print(". . Syncing profile data for %s" % output_str)

            if not os.path.exists(os.path.dirname(output)):
                    mkdirs(os.path.dirname(output))

            if os.path.isdir(profile_output):
                # Copy to temporary path to ensure quick switching
                output_tmp= output+"%08d" % (random.randint(0,99999999))
                copytree(profile_output, output_tmp, hardlinks=True)
                if os.path.exists(output):
                    if os.path.isdir(output):
                        shutil.rmtree(output)
                    else:
                        os.remove(output)
                os.rename(output_tmp, output)
            else:
                if os.path.exists(output):
                    try:
                        if os.path.isdir(output):
                            shutil.rmtree(output)
                        else:
                            os.remove(output)
                    except:
                        pass

                if os.name == 'nt':
                    try:
                        shutil.copyfile(profile_output, output)
                    except:
                            raise Exception('ERROR: Cannot sync profile data.')
                else:
                    try:
                        os.link(profile_output, output)
                    except:
                        print("Warning: Cannot create a symlink.")
                        try:
                            shutil.copyfile(profile_output, output)
                        except:
                            raise Exception('ERROR: Cannot sync profile data.')

                if not os.path.exists(output):
                    raise Exception('ERROR: Failed to sync profile data.')

                # Remember the time of the last sync
                touch(profile_output + ".sync", time.time())

    elif os.path.exists(output):
        if os.path.isdir(output):
            shutil.rmtree(output)
        else:
            os.remove(output)

class LockThread(threading.Thread):
    def __init__(self, filename):
        super(LockThread, self).__init__()
        self.filename = filename
        self.active = True
    def run(self):
        while self.active:
            touch(self.filename, time.time())
            for i in (1,2,3,4,5):
                if self.active:
                    time.sleep(1)
    def unlock(self):
        self.active = False

def ini_wrapper(filename):
    with open(filename, 'r') as f:
        ini_str = '[default]\n' + f.read()
    return io.StringIO(ini_str)

def is_true_string(string):
    string = string.lower()
    return string == "1" or string == "true" or string == "yes"

def sanitize_path(path):
    assert isinstance(path, str)
    if os.name == 'nt':
        path = path.replace('/', os.sep)
    else:
        path = path.replace('\\', os.sep)
    return path


text:
package com.all.ultrapeer.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.all.messengine.MessEngine;
import com.all.messengine.MessageMethod;
import com.all.peer.commons.messages.ForwardMessage;
import com.all.shared.messages.MessEngineConstants;
import com.all.shared.model.AllMessage;
import com.all.shared.model.ChatMessage;

@Service
@Deprecated
public class ChatService {

	@Autowired
	private MessEngine messEngine;

	@MessageMethod(MessEngineConstants.CHAT_MESSAGE_REQUEST)
	@Deprecated
	public void handleChatRequest(AllMessage<ChatMessage> message) {
		ChatMessage chatMessage = message.getBody();
		String forwardTo = chatMessage.getRecipient().getEmail();
		AllMessage<ChatMessage> response = new AllMessage<ChatMessage>(MessEngineConstants.CHAT_MESSAGE_RESPONSE,
				chatMessage);
		messEngine.send(new ForwardMessage(response, forwardTo));
	}

}


text:
#include "library/constants.h"
#include "kernel/instantiate.h"
#include "library/reducible.h"
#include "library/tactic/intros_tactic.h"
#include "library/tactic/expr_to_tactic.h"

namespace lean {
tactic intros_tactic(list<name> _ns) {
    auto fn = [=](environment const & env, io_state const &, proof_state const & s) {
        list<name> ns    = _ns;
        goals const & gs = s.get_goals();
        if (empty(gs)) {
            throw_no_goal_if_enabled(s);
            return optional<proof_state>();
        }
        goal const & g      = head(gs);
        name_generator ngen = s.get_ngen();
        auto tc             = mk_type_checker(env, ngen.mk_child());
        expr t              = g.get_type();
        expr m              = g.get_meta();
        bool gen_names      = empty(ns);
        try {
            while (true) {
                if (!gen_names && is_nil(ns))
                    break;
                if (!is_pi(t)) {
                    if (!is_nil(ns)) {
                        t = tc->ensure_pi(t).first;
                    } else {
                        expr new_t = tc->whnf(t).first;
                        if (!is_pi(new_t))
                            break;
                        t = new_t;
                    }
                }
                name new_name;
                if (!is_nil(ns)) {
                    new_name = head(ns);
                    ns       = tail(ns);
                } else {
                    new_name = get_unused_name(binding_name(t), m);
                }
                expr new_local = mk_local(ngen.next(), new_name, binding_domain(t), binding_info(t));
                t              = instantiate(binding_body(t), new_local);
                m              = mk_app(m, new_local);
            }
            goal new_g(m, t);
            return some(proof_state(s, goals(new_g, tail(gs)), ngen));
        } catch (exception &) {
            return optional<proof_state>();
        }
    };
    return tactic01(fn);
}

void initialize_intros_tactic() {
    auto fn = [](type_checker &, elaborate_fn const &, expr const & e, pos_info_provider const *) {
        buffer<name> ns;
        get_tactic_id_list_elements(app_arg(e), ns, "invalid 'intro' tactic, arguments must be identifiers");
        return intros_tactic(to_list(ns.begin(), ns.end()));
    };
    register_tac(get_tactic_intro_name(), fn);
    register_tac(get_tactic_intros_name(), fn);
}

void finalize_intros_tactic() {
}
}


text:
import nengo
from nengo.neurons import LIF

import matplotlib.pyplot as plt

model = nengo.Network(label="Scalar Representation")

with model:
  s = nengo.Ensemble(100, dimensions=1, radius=1, neuron_type=LIF())

  i = nengo.Node(output=0.6)

  nengo.Connection(i, s)

  i_probe = nengo.Probe(s, synapse=0.01)
  s_probe = nengo.Probe(i, synapse=0.01)

sim = nengo.Simulator(model)
sim.run(10)

t = sim.trange()
plt.plot(sim.trange(), sim.data[i_probe], label="Scalar Input")
plt.plot(sim.trange(), sim.data[s_probe], label="Decoded output")
plt.legend()
plt.ylim(0,3)
plt.show()


text:
    <button type="button" class="btn btn-outline-primary" (click)="isCollapsed = !isCollapsed" [attr.aria-expanded]="!isCollapsed" aria-controls="collapseExample">
          Toggle
        </button>

                        <app-code-input (codeChange)="updateCode($event)"></app-code-input>

                        <app-code-output [code]="result"></app-code-output>


text:
package com.edd.chat.channel;

import com.edd.chat.account.Account;
import com.edd.chat.account.AccountService;
import com.edd.chat.channel.comment.Comment;
import com.edd.chat.exception.ChatException;
import com.edd.chat.test.AccountFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.dao.DuplicateKeyException;

import java.util.Collections;
import java.util.List;

import static org.assertj.core.api.Java6Assertions.assertThat;
import static org.assertj.core.api.Java6Assertions.assertThatThrownBy;
import static org.mockito.AdditionalAnswers.returnsFirstArg;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
public class ChannelServiceTest {

    private static final String MAIN_CHANNEL_ID = "1";
    private static final String MAIN_CHANNEL = "MAIN";
    private static final int MAX_COMMENTS = 2;

    @Mock
    private ChannelRepository channelRepository;

    @Mock
    private AccountService accountService;

    private Account account = AccountFactory.create();
    private ChannelService service;
    private Comment comment;
    private Channel channel;

    @Before
    public void setUp() {
        service = new ChannelService(channelRepository,
                accountService,
                MAIN_CHANNEL,
                MAX_COMMENTS);

        comment = new Comment(account, "test");
        channel = new Channel(MAIN_CHANNEL);

        when(channelRepository.findOne(MAIN_CHANNEL_ID))
                .thenReturn(channel);

        when(channelRepository.save(any(Channel.class)))
                .then(returnsFirstArg());

        when(accountService.getAccount())
                .thenReturn(account);
    }

    @Test
    public void getChannel() {
        assertThat(service.getChannel(MAIN_CHANNEL_ID)).isEqualTo(channel);
    }

    @Test(expected = ChatException.class)
    public void getChannelNotFound() {
        service.getChannel(MAIN_CHANNEL_ID + "a");
    }

    @Test
    public void createChannel() {
        String name = "test";

        Channel channel = service.createChannel(name);
        assertThat(channel.getName()).isEqualTo(name);
    }

    @Test(expected = ChatException.class)
    public void createChannelInvalidName() {
        service.createChannel("");
    }

    @Test(expected = ChatException.class)
    public void createChannelAlreadyExists() {
        when(channelRepository.save(any(Channel.class)))
                .thenThrow(new DuplicateKeyException(""));

        service.createChannel(MAIN_CHANNEL);
    }

    @Test
    public void getChannels() {
        when(channelRepository.findAll())
                .thenReturn(Collections.singletonList(channel));

        assertThat(service.getChannels()).contains(channel);
    }

    @Test
    public void comment() {
        service.comment(MAIN_CHANNEL_ID, comment);

        List<Comment> comments = channel.getComments();
        assertThat(comments).extracting(Comment::getMessage).containsExactly(comment.getMessage());
        assertThat(comments).extracting(Comment::getAccount).containsExactly(account);
        assertThat(comments).extracting(Comment::getSentOn).isNotNull();
    }

    @Test
    public void commentExceedMax() {
        for (int i = 0; i < MAX_COMMENTS + 1; i++) {
            service.comment(MAIN_CHANNEL_ID, comment);
        }

        assertThat(channel.getComments().size())
                .isEqualTo(MAX_COMMENTS);
    }

    @Test(expected = ChatException.class)
    public void commentInvalidMessage() {
        service.comment(MAIN_CHANNEL_ID, new Comment(account, ""));
    }

    @Test
    public void getComments() {
        for (int i = 0; i < MAX_COMMENTS; i++) {
            service.comment(MAIN_CHANNEL_ID, comment);
        }

        int count = MAX_COMMENTS - 1;
        List<Comment> comments = service.getComments(MAIN_CHANNEL_ID, count);

        assertThat(comments.size()).isEqualTo(count);
    }

    @Test
    public void getCommentsInvalidCounts() {
        assertThatThrownBy(() -> service.getComments(MAIN_CHANNEL_ID, 0))
                .isExactlyInstanceOf(ChatException.class);

        assertThatThrownBy(() -> service.getComments(MAIN_CHANNEL_ID, MAX_COMMENTS + 1))
                .isExactlyInstanceOf(ChatException.class);
    }

    @Test
    public void deleteChannel() {
        String id = MAIN_CHANNEL_ID + "other";

        when(channelRepository.findOne(id))
                .thenReturn(new Channel(""));

        service.deleteChannel(id);
        verify(channelRepository, times(1)).delete(id);
    }

    @Test
    public void deleteMainChannel() {
        assertThatThrownBy(() -> service.deleteChannel(MAIN_CHANNEL_ID))
                .isExactlyInstanceOf(ChatException.class);
    }
}


text:
ACCEPTED

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

#### Published in
Anais Soc. Biol. Pernambuco 13(1): 225 (1955)

#### Original name
Dennisiomyces glabrescentipes Singer, 1955

### Remarks
null


text:
"""
Created on Sun Jul 23 15:04:19 2017

@author: zqwu
"""

from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from sklearn.kernel_ridge import KernelRidge

import numpy as np
import deepchem as dc
import tempfile

# Only for debug!
np.random.seed(123)

# Load Delaney dataset
n_features = 1024
delaney_tasks, delaney_datasets, transformers = dc.molnet.load_delaney()
train_dataset, valid_dataset, test_dataset = delaney_datasets

metric = dc.metrics.Metric(dc.metrics.pearson_r2_score, np.mean)

def model_builder(model_dir):
  sklearn_model = KernelRidge(kernel="rbf", alpha=1e-3, gamma=0.05)
  return dc.models.SklearnModel(sklearn_model, model_dir)

model_dir = tempfile.mkdtemp()
model = dc.models.SingletaskToMultitask(delaney_tasks, model_builder, model_dir)

model.fit(train_dataset)
model.save()

print("Evaluating model")
train_scores = model.evaluate(train_dataset, [metric], transformers)
valid_scores = model.evaluate(valid_dataset, [metric], transformers)

print("Train scores")
print(train_scores)

print("Validation scores")
print(valid_scores)


text:
module VortonSpecs {

  var expect = chai.expect;
  jasmine.getFixtures().fixturesPath = 'base/spec/fixtures';

  describe('getRangeTextNodes', () => {

    var fixture: HTMLElement,
      fixtureUrl: string,
      selectionRange: Range,
      originalText: string,
      originalLength: number;

    beforeEach(() => {
      loadFixtures(fixtureUrl);

      fixture = $('#test')[0];
      selectionRange = document.createRange();
      originalText = fixture.textContent;
      originalLength = originalText.length;
    });

    afterEach(() =>
      fixture.textContent
        .should.equal(originalText));

    describe('on single text node', () => {

      beforeAll(() =>
        fixtureUrl = 'singleTextNode.html');

      it('should return all text nodes', () => {

        selectionRange.setStart(fixture.firstChild, 0);
        selectionRange.setEnd(fixture.firstChild, fixture.firstChild.textContent.length);

        var textNodes = Vorton.getRangeTextNodes(selectionRange);

        textNodes.length
          .should.equal(1);
        textNodes[0].nodeType
          .should.equal(Node.TEXT_NODE);
        textNodes[0].length
          .should.equal(originalLength);
      });

      it('should return splitted text node still in DOM', () => {

        selectionRange.setStart(fixture.firstChild, 10);
        selectionRange.setEnd(fixture.firstChild, fixture.firstChild.textContent.length - 10);

        var textNodes = Vorton.getRangeTextNodes(selectionRange);

        textNodes.length
          .should.equal(1);
        textNodes[0].nodeType
          .should.equal(Node.TEXT_NODE);

        textNodes[0].parentNode
          .should.equal(fixture);

      });

    });
  });
}


text:
package com.jyc.designpatterns._01_state.candymachine.impl;

import com.jyc.designpatterns._01_state.candymachine.CandyMachineContext;
import com.jyc.designpatterns._01_state.candymachine.CandyMachineState;

/**
 * <p> 无币状态类
 * @author jyc
 *
 */
public class NoCoinState implements CandyMachineState {

	@Override
	public void inputCoin(CandyMachineContext context) {
		System.out.println("投币成功,请摇杆取糖~");
		context.setCurrentState(context.getHasCoinState());

	}

	@Override
	public void turnJoystick(CandyMachineContext context) {
		System.out.println("对不起,请先投币再摇杆~");

	}

	@Override
	public void returnCoin(CandyMachineContext context) {
		System.out.println("对不起,无币可退~");

	}

	@Override
	public void dispenseCandy(CandyMachineContext context) {
		System.out.println("对不起,想吃糖请先投币");

	}

}


text:
/*jslint node: true */
'use strict';

var _ = require('underscore');
var rdk = require('../../rdk/rdk');
var userUtil = require('../user/userUtil');

var apiDocs = {
    spec: {
        summary: 'Refreshes the current user session',
        notes: 'Expects a session to already occur or it returns a blank object.',
        parameters: [],
        responseMessages: [
            {
                code: 200,
                message: 'Session successfully refreshed'
            },
            {
                code: 401,
                message: 'No session to refresh'
            }
        ]
    }
};

function refreshToken(req, res) {

    if (_.isObject(req.session.user) === true) {
        req.logger.info('Token refreshed');
        res.status(rdk.httpstatus.ok).json(userUtil.sanitizeUser(req.session.user));
        return;
    }

    req.logger.warn('No session present for refresh');
    res.status(rdk.httpstatus.unauthorized).json();

}

module.exports = refreshToken;
module.exports.apiDocs = apiDocs;


text:
arch=i386
#arch=amd64
v=10.1
name="FreeBSD $v $arch"
VBoxManage modifyvdi "$HOME/VirtualBox VMs/$name/$name.vdi" compact
vagrant package --base "$name" --output freebsd-$v-$arch.box --vagrantfile Vagrantfile