text:
function hIniFile = subsasgn(hIniFile, S, V)
% xini::subsasgn  - write settings to an ini-file
%
% FORMAT:       IniFileObject.STRUCT = inistruct;
%        or     IniFileObject.Section  = section;
%        or     IniFileObject.Section.Setting = value;
%
%    For multi-dimensional object arrays, the typical indexing is valid.
%    However, only singular objects may be used for write access.

% Version:  v0.9c
% Build:    11050319
% Date:     May-02 2011, 6:17 PM EST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://neuroelf.net/
%
% Copyright (c) 2010, 2011, Jochen Weber
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%     * Redistributions of source code must retain the above copyright
%       notice, this list of conditions and the following disclaimer.
%     * Redistributions in binary form must reproduce the above copyright
%       notice, this list of conditions and the following disclaimer in the
%       documentation and/or other materials provided with the distribution.
%     * Neither the name of Columbia University nor the
%       names of its contributors may be used to endorse or promote products
%       derived from this software without specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
% ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
% DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

% class check
if nargin > 2 && ...
    ~isa(hIniFile, 'xini')
    try
        hIniFile = builtin('subsasgn', hIniFile, S, V);
    catch ne_eo;
        rethrow(ne_eo);
    end
    return;
end

% argument check
if isempty(S)
    error( ...
        'xini:BadSubsAsgn', ...
        'S struct may not be empty.' ...
    );
end
slen= length(S);
stype = S(1).type;
ssubs = S(1).subs;

% decide on kind of subscripting, first struct-like notation
switch stype, case {'.'}

    % allow cell with one char call type
    if iscell(ssubs) && ...
        numel(ssubs) == 1
        ssubs = ssubs{1};
    end

    % check for subscript type
    if ~ischar(ssubs) || ...
        isempty(ssubs)
        error( ...
            'xini:BadSubsAsgn', ...
            'Struct notation needs a non-empty char subscript.' ...
        );
    end

    % only works for singular object
    if numel(hIniFile) ~= 1 || ...
       ~hIniFile.L
        error( ...
            'xini:InvalidFileID', ...
            'Struct notation only works for valid, singular objects.' ...
        );
    end

    % make content linear
    ssubs = ssubs(:)';

    % complete or section ?
    if slen == 1

        % only valid for struct values
        if ~isstruct(V)
            error( ...
                'xini:BadSubsAsgnValue', ...
                'A struct value is needed for an only struct subscript.' ...
            );
        end

        % complete requested
        if strcmp(ssubs, 'STRUCT')
            try
                xini(hIniFile, 'setinicomplete', V);
            catch ne_eo;
                rethrow(ne_eo);
            end

        % section requested
        else
            try
                xini(hIniFile, 'setinisection', S(1).subs, V);
            catch ne_eo;
                rethrow(ne_eo);
            end
        end

    % setting or subsetting
    else

        % require second subscript to also be CHAR
        if ~strcmp(S(2).type, '.') || ...
           ~ischar(S(2).subs) || ...
            isempty(S(2).subs)
            error( ...
                'xini:BadSubsAsgn', ...
                'At least two CHAR struct subscripts are needed.' ...
            );
        end

        % subsetting requested
        if length(S) > 2
            try
                % get setting
                rvalue = xini( ...
                    hIniFile, 'getinisetting', S(1).subs, S(2).subs);

                % assign changes
                rvalue = subsasgn(rvalue, S(3:end), V);

                % store changes setting
                xini( ...
                    hIniFile, 'setinisetting', S(1).subs, S(2).subs, rvalue);
            catch ne_eo;
                neuroelf_lasterr(ne_eo);
                error( ...
                    'xini:IllegalSubsAsgn', ...
                    'Couldn''t pass subsasgn to %s.%s.', ...
                    S(1).subs, ...
                    S(2).subs ...
                );
            end

        % set value directly
        else
            try
                xini( ...
                    hIniFile, 'setinisetting', S(1).subs, S(2).subs, V);
            catch ne_eo;
                rethrow(ne_eo);
            end
        end
    end

% indexing requested
case {'()'}

    % we need non-empty cell subscript
    if ~iscell(ssubs) || ...
        isempty(ssubs)
        error( ...
            'xini:BadSubsRef', ...
            'Can''t index into xini matrix.' ...
        );
    end

    % convert hIniFile to struct
    sIniFile = struct(hIniFile);

    % try to retrieve subscripted matrix
    try
        subset = subsref(sIniFile, S(1));
    catch ne_eo;
        error( ...
            'xini:BadSubsRef', ...
            'Invalid subscript (%s).', ...
            ne_eo.message ...
        );
    end

    % no further subsasgn requested
    if slen == 1
        if ~isa(V, 'xini')
            error( ...
                'xini:BadSubsAsgnValue', ...
                'Class mismatch error.' ...
            );
        end

        % try to assign new objects into matrix
        try
            sIniFile = subsasgn(sIniFile, S(1), struct(V));
            hIniFile = class(sIniFile, 'xini');
        catch ne_eo;
            error( ...
                'xini:BadSubsAsgnIndex', ...
                'Couldn''t assign partial object matrix (%s).', ...
                ne_eo.message ...
            );
        end
        return;
    end

    if numel(subset) ~= 1 || ...
       ~subset.L
        error( ...
            'xini:InvalidFileID', ...
            'Further subscripting only works for valid, singular objects.' ...
        );
    end

    try
        subsasgn(class(subset, 'xini'), S(2:end), V);
    catch ne_eo;
        rethrow(ne_eo);
    end

otherwise
    error( ...
        'xini:BadSubsAsgn', ...
        'Only struct notation allowed to set values.' ...
    );
end


text:
package com.ait.toolkit.sencha.touch.client.events.map;

import com.ait.toolkit.sencha.touch.client.ui.GoogleMap;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.dom.client.DomEvent.Type;

public class ZoomChangeEvent {

	public static String EVENT_NAME = "zoomchange";

	private GoogleMap source;
	private JavaScriptObject nativeMap;
	private int zoomLevel;

	/**
	 * UiBinder implementations
	 */
	private static Type<ZoomChangeHandler> TYPE = new Type<ZoomChangeHandler>(EVENT_NAME, null);

	public static Type<ZoomChangeHandler> getType() {
		return TYPE;
	}

	public static Type<ZoomChangeHandler> getAssociatedType() {
		return TYPE;
	}

	public ZoomChangeEvent(GoogleMap source, JavaScriptObject nativeMap, int zoomLevel) {
		super();
		this.source = source;
		this.nativeMap = nativeMap;
		this.zoomLevel = zoomLevel;
	}

	/**
	 * @return the source
	 */
	public GoogleMap getSource() {
		return source;
	}

	public JavaScriptObject getNativeMap() {
		return nativeMap;
	}

	public int getZoomLevel() {
		return zoomLevel;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.microsoft.bingads.bulk.entities;

import com.microsoft.bingads.internal.StringTable;
import com.microsoft.bingads.internal.bulk.entities.MultiRecordBulkEntity;
import static com.microsoft.bingads.internal.utilities.Comparer.compareNullable;

/**
 * Reserved for internal use.
 */
class BulkAdGroupTargetIdentifier extends BulkTargetIdentifier {

    /**
     * Initializes a new instanced of the BulkAdGroupTargetIdentifier class.
     */
    public BulkAdGroupTargetIdentifier(Class targetBidType) {
        super(targetBidType);
    }

    @Override
    public MultiRecordBulkEntity createEntityWithThisIdentifier() {
        return new BulkAdGroupTarget(this);
    }

    /**
     * Reserved for internal use.
     */
    @Override
    String getEntityColumnName() {
        return StringTable.AdGroup;
    }

    @Override
    public boolean equals(Object other) {
        if (!(other instanceof BulkAdGroupTargetIdentifier)) {
            return false;
        }

        BulkAdGroupTargetIdentifier otherIdentifier = (BulkAdGroupTargetIdentifier) other;

        boolean isNameNotEmpty = getEntityName() != null &&
                getEntityName().length() != 0 &&
                getParentEntityName() != null &&
                getParentEntityName().length() != 0;

        return compareNullable(getEntityId(), otherIdentifier.getEntityId()) ||
                (
                        isNameNotEmpty &&
                                compareNullable(getEntityName(), otherIdentifier.getEntityName()) &&
                                compareNullable(getParentEntityName(), otherIdentifier.getParentEntityName())
                );
    }
}


text:
package org.kelvinst.psf_def;

public enum WorkingSetItemType {

	JAVA("org.eclipse.jdt.ui.PersistableJavaElementFactory"),
	RESOURCE("org.eclipse.ui.internal.model.ResourceFactory");

	private String factoryId;

	private WorkingSetItemType(String factoryId) {
		this.factoryId = factoryId;
	}

	public String getFactoryId() {
		return factoryId;
	}

}


text:
package utils.buffer;

public interface InputBuffer<E extends Object>{

	public boolean addMessageIntoInput(E input);

	public E getMessageFromOutput();

}


text:
<?php

// get db connection
$db = Pimcore_Resource::get();

$db->query("ALTER TABLE `classificationstore_keys` ADD COLUMN `sorter` INT(10) NULL DEFAULT '0' AFTER `enabled`;");
$db->query("ALTER TABLE `classificationstore_groups` ADD COLUMN `sorter` INT(10) NULL DEFAULT '0' AFTER `modificationDate`;");


text:
import {Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {AppPageParent} from '../app/app-page-parent';
import {AppPage4Table} from './app-page4-table.component';
import {AppModal} from '../app/app-modal.component';
import {getArrayFromJsonGraph, getValueFromJsonGraph} from '../app/falcor-utils';
import lodash from 'lodash';
// import falcor from 'falcor'; // const falcor = require('falcor');
import {serializeQueryObjectForFalcor} from '../../src-middle/falcor-json-serializer';
declare var jQuery: JQueryStatic; // HTMLファイルでロード済み
declare var Materialize: any; // HTMLファイルでロード済み

import {Action, NextNow, NextDocumentsFromFalcorPage4} from '../flux/flux-action';
import {Container} from '../flux/flux-container';
import {Dispatcher} from '../flux/flux-di';

const COMPONENT_SELECTOR = 'my-page4';
@Component({
  selector: COMPONENT_SELECTOR,
  template: `

Falcor sample Page4

        <input id="condition" [(ngModel)]="condition" type="text" class="validate">
        Condition Path

        <input id="searchWord" [(ngModel)]="searchWord" type="text" class="validate">
        Search Word

    <my-complicated-table [fields]="fields" [aliases]="aliases" [aligns]="aligns" [documents]="documentsByPush"
      [totalItems]="totalItemsByPush" [itemsPerPage]="itemsPerPage" [currentPage]="currentPageByObservable"></my-complicated-table>

    <my-modal [texts]="modalTexts" [now]="nowByPush | async"></my-modal>
  `,
  directives: [AppPage4Table, AppModal],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppPage4 extends AppPageParent implements OnInit {
  // 以下2つのstatic変数(及びgetter/setter)はページ遷移しても値が失われない。
  static _condition: string = 'name.first';
  get condition() { return AppPage4._condition; }
  set condition(condition: string) { AppPage4._condition = condition; }
  static _searchWord: string = '';
  get searchWord() { return AppPage4._searchWord; }
  set searchWord(word: string) { AppPage4._searchWord = word; }

  // nowByPush: number; // Observableイベントハンドラによって値が代入される。
  get nowByPush() {
    return this.container.state$.map(appState => {
      return appState.now;
    });
  }
  private documentsByPush: {}[];
  private totalItemsByPush: number;
  subscribeState() {
    // mapの戻り値がObservable<Promise<any>>の場合はsubscribeでPromiseを展開してdetectChangesを書かないとViewが更新されない。
    this.container.state$
      .map(appState => appState.page4)
      .filter(page => page instanceof Promise)
      .subscribe(page => {
        page.then(state => {
          this.documentsByPush = state.documents;
          this.totalItemsByPush = state.totalItems;
          this.cd.detectChanges(); // これを書かないとViewが更新されない。理由はよくわからない。
        });
      });
  }

  // ページ遷移で入る度に呼び出される。
  constructor(
    private dispatcher$: Dispatcher<Action>,
    private container: Container,
    private cd: ChangeDetectorRef
  ) {
    super(COMPONENT_SELECTOR);
  }
  ngOnInit() {
    super.ngOnInit();
    this.subscribeState();
    this.loadJsonGraph();
    document.getElementById('condition').focus();
  }

  // 以下2つのinitializable関数は親クラスから呼び出される初期化専用の関数。
  initializableJQueryPlugins(): void {
    jQuery(`${COMPONENT_SELECTOR} .modal-trigger`).leanModal();
  }
  initializableEventObservables(): void {
    // 2つのinputエレメントの入力を束ねて(mergeして)listenしています。
    this.disposableSubscription = Observable.fromEvent<KeyboardEvent>(document.getElementById('searchWord'), 'keyup')
      .merge(Observable.fromEvent<KeyboardEvent>(document.getElementById('condition'), 'keyup'))
      // .debounce(() => Observable.timer(1000)) // イベントストリームが1秒間途切れるのを待つ。
      .subscribe(() => {
        this.currentPageByObservable = 1;
        this.loadJsonGraph(); // eventからvalueを取り出さなくても既にthis.searchWordの値は変わっている。
        // Materialize.toast(`Falcor query with word '${this.searchWord}' in '${this.condition}' is triggered`, 2000);
      });

    // app-page4-table.component.ts で定義されたカスタムイベントの発火をこのObservableがlistenする。
    this.disposableSubscription = Observable.fromEvent<CustomEvent>(document.getElementsByTagName('my-complicated-table'), 'emitTargetPage')
      .do(event => event.stopPropagation()) // CustomEventの伝播をここで止める。cancelableをtrueにしなくても止められる。
      .map(event => event.detail as number)
      .subscribe(targetPage => {
        this.currentPageByObservable = targetPage;
        this.loadJsonGraph();
      });

    this.disposableSubscription = Observable.fromEvent<MouseEvent>(document.getElementsByTagName(COMPONENT_SELECTOR), 'click')
      .map(event => event.target.textContent)
      .filter(text => text.trim().length > 0)
      .subscribe(text => {
        Materialize.toast(`You clicked "${text}"`, 300);
      });

    this.disposableSubscription = Observable.timer(1, 1000 * 60) // 開始1ms後にスタートして、その後1000ms毎にストリームを発行する。
      .subscribe(() => {
        // this.nowByPush = lodash.now();
        this.dispatcher$.next(new NextNow(lodash.now()));
      });
  }

  // 以下7つのプロパティは<my-complicated-table>に渡す。
  fields: string[] = ['name.first, name.last', 'gender', 'birthday', 'contact.phone.0', 'contact.email.0', 'contact.address.street, contact.address.city, contact.address.state'];
  aliases: string[] = ['name', null, null, 'phone', 'email', 'address'];
  aligns: string[] = [null, 'center', null, null, null, 'right'];
  // documentsByFalcor: any[]; // loadJsonGraph()のクエリ結果を格納する。
  // totalItemsByFalcor: number = 0; // loadJsonGraph()のクエリ結果を格納する。
  currentPageByObservable: number = 1; // Observableイベントハンドラによって値が代入される。
  itemsPerPage: number = 10;

  // ここからFalcorのコード。
  //model = new falcor.Model({ source: new falcor.HttpDataSource('/model.json') });
  loadJsonGraph() {
    this.getJsonGraph(this.condition, this.searchWord, (this.currentPageByObservable - 1) * this.itemsPerPage, this.itemsPerPage);
  }
  getJsonGraph(condition: string, keyword: string, from: number = 0, length: number = 10) {
    const queryName = 'query4';
    const queryJson = serializeQueryObjectForFalcor<QueryParamsForQuery4>({
      collection: 'names',
      condition: condition,
      keyword: keyword
    });

    // this.model // this.modelは親クラスで定義されている。
    //   .get([queryName, queryJson, { from: from, length: length }, [...this.fields, 'totalItems']])
    //   .then(jsonGraph => {
    //     console.log(JSON.stringify(jsonGraph, null, 2)); // Falcorから返却されるJSON Graphを確認。
    //     this.documentsByFalcor = getArrayFromJsonGraph(jsonGraph, ['json', queryName, queryJson], []);
    //     this.totalItemsByFalcor = getValueFromJsonGraph(jsonGraph, ['json', queryName, queryJson, from, 'totalItems'], 0);
    //     console.log(this.documentsByFalcor); // tableに描画するための配列を確認。

    //     // 次のページがある場合はプリロードしてキャッシュしておく。これにより次のページに遷移したときはキャッシュから読み込まれる。
    //     // この例ではわかりやすくするため敢えて1ページ目を表示したときだけ2ページ目のプリロードをする。(from === 0を外せば2ページ目以降もプリロードが動く)
    //     if (from === 0 && this.totalItemsByFalcor > from + length) {
    //       this.model
    //         .get([queryName, queryJson, { from: from + length, length: length }, [...this.fields, 'totalItems']])
    //         .then(() => { });
    //     }
    //   });
    this.dispatcher$.next(new NextDocumentsFromFalcorPage4(
      [queryName, queryJson, { from: from, length: length }, [...this.fields, 'totalItems']],
      [queryName, queryJson],
      [queryName, queryJson, from, 'totalItems']
    ));
  }

  // ここからモーダルウインドウのテキスト。
  modalTexts = [
    'Search Word欄に文字を入力するとFalcorの検索クエリが発行されます。正規表現で入力できます。',
    'Condition Path欄に入力されたパスが検索対象となります。',
    '例えばCondition Pathを "name.last" にしてみてください。 "name.first" のときとは結果が違いますね?',
    '例えば ニューヨーク州 に住んでいる人だけを検索したい場合、どうすればいいかわかりますか?',
    '(ブラウザのコンソールとサーバーサイドのコンソールをよく観察すればきっと答えがわかります)',
    '例えば 1月生まれ の人だけを検索したい場合、どうすればいいかわかりますか?',
    '例えば 男性 だけを検索したい場合、どうすればいいかわかりますか?',
    '(正規表現で入力できるということを思い出してください)',
    'ブラウザの表示は更新されているのにサーバーサイドのコンソールは更新されないときがありますね。どういうときですか?',
    'テーブルとページネーションのコンポーネント定義は app-page4-table.component.ts に書いてあります。',
    'my-complicated-tableタグのコードは理解が難しいかもしれませんが、一度わかると実に合理的な処理をしていることが読み取れると思います。',
    '1ページに表示される件数を100件や1000件に増やすことはできますか?',
    'aliases という変数が app-page4.component.ts の中にあります。これは何のためにありますか?これが全てnullだと表示結果はどう変わりますか?',
    'aligns という変数が app-page4.component.ts の中にあります。これは何のためにありますか?これが全てnullだと表示結果はどう変わりますか?',
    '例えば テーブルに"趣味の列"を追加したいとき、ソースコードのどこを変更すれば良いかわかりますか?',
  ];
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securityinsights.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.securityinsights.models.EntityQueriesKind;

/** Samples for EntityQueries List. */
public final class EntityQueriesListSamples {
    /*
     * x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-09-01-preview/examples/entityQueries/GetEntityQueries.json
     */
    /**
     * Sample code: Get all entity queries.
     *
     * @param manager Entry point to SecurityInsightsManager.
     */
    public static void getAllEntityQueries(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) {
        manager.entityQueries().list("myRg", "myWorkspace", EntityQueriesKind.EXPANSION, Context.NONE);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Angular JS | Bootstrap | Template</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="google-site-verification" content="" />
    <meta name="msvalidate.01" content="" />
    <meta name="robots" content="index, follow">
    <meta name="GOOGLEBOT" content="index follow"/>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/globals.css">

Flatlander Crafted Gems

– an Angular store –

        {{product.name}}
        {{product.price | currency}}

            Description

            Specs

            Reviews

Description

{{product.description}}

Specs

Shine: {{product.shine}}

Reviews


text:
Uniform style is important for maintainability.
This document contains the style guide for maintaining CS SI handouts.

Section Convention
---

Each section is separated by a header.
To create a header, put the title on one line, and 3 dashes on the next. (see below)

Every header should have 3 blank lines before its title, and one blank line after its dashes.
The only exception is if the file starts with a header.

```
<!-- other stuff -->

Header Title
---

<!-- more stuff -->
```

Text Convention
---

Each sentence goes on its own line.

Inline code is denoted by single backticks.

```
The `string` datatype can hold multiple characters.
To access individual characters in the string, use the `at` member function.
```

Fill-in-the-blank exercises are often useful to review reading concepts.
To achieve this, it is necessary to add a bit of HDML into the markdown document.

Because HTML can be quite messy, the blank with the answer should be put on its own line.
Only punctuation can join blanks on their line.
This is to reduce overall line count, and because lone punctuation is weird.

```
Mitochondria is the
<a style="color:white;border:solid black;border-width:1px">powerhouse</a>
of the cell
```

To reveal the answer, students must highlight the blank.

Content Convention
---

The following rules are suggestions based on what has worked well in the past.
If better ideas come along, the format can be changed.

`cs10`, `cs12`, and `cs14` consist of two parts: a lab and a discussion section.
The lab portion is 2 hours long and the discussion portion is 1 hour long.

TODO: play with mkdocs.yml heirarchy.
Mimick the CS14 page by adding different categories to a single week.


text:
<?php

namespace Knp\Menu\Renderer;

use Knp\Menu\ItemInterface;
use Knp\Menu\Renderer\RendererProviderInterface;
use Knp\Menu\Provider\MenuProviderInterface;

class TwigRenderer implements RendererInterface
{
    /**
     * @var \Twig_Environment
     */
    private $environment;
    private $defaultOptions;

    /**
     * @param \Twig_Environment $environment
     * @param string $template
     * @param array $defaultOptions
     */
    public function __construct(\Twig_Environment $environment, $template, array $defaultOptions = array())
    {
        $this->environment = $environment;
        $this->defaultOptions = array_merge(array(
            'depth' => null,
            'currentAsLink' => true,
            'currentClass' => 'current',
            'ancestorClass' => 'current_ancestor',
            'firstClass' => 'first',
            'lastClass' => 'last',
            'template' => $template,
            'compressed' => false,
        ), $defaultOptions);
    }

    /**
     * Renders a menu with the specified renderer.
     *
     * @param \Knp\Menu\ItemInterface $item
     * @param array $options
     * @return string
     */
    public function render(ItemInterface $item, array $options = array())
    {
        $options = array_merge($this->defaultOptions, $options);

        $template = $options['template'];
        if (!$template instanceof \Twig_Template) {
            $template = $this->environment->loadTemplate($template);
        }

        $block = $options['compressed'] ? 'compressed_root' : 'root';

        return $template->renderBlock($block, array('item' => $item, 'options' => $options));
    }
}


text:
'use strict';

const models = require('./index');

/**
 * Request parameters for creating a new work or school account user.
 *
 * @extends models['UserBase']
 */
class UserCreateParameters extends models['UserBase'] {
  /**
   * Create a UserCreateParameters.
   * @member {boolean} accountEnabled Whether the account is enabled.
   * @member {string} displayName The display name of the user.
   * @member {object} passwordProfile Password Profile
   * @member {string} [passwordProfile.password] Password
   * @member {boolean} [passwordProfile.forceChangePasswordNextLogin] Whether
   * to force a password change on next login.
   * @member {string} userPrincipalName The user principal name
   * (someuser@contoso.com). It must contain one of the verified domains for
   * the tenant.
   * @member {string} mailNickname The mail alias for the user.
   * @member {string} [mail] The primary email address of the user.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of UserCreateParameters
   *
   * @returns {object} metadata of UserCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'UserCreateParameters',
      type: {
        name: 'Composite',
        className: 'UserCreateParameters',
        modelProperties: {
          immutableId: {
            required: false,
            serializedName: 'immutableId',
            type: {
              name: 'String'
            }
          },
          usageLocation: {
            required: false,
            serializedName: 'usageLocation',
            type: {
              name: 'String'
            }
          },
          givenName: {
            required: false,
            serializedName: 'givenName',
            type: {
              name: 'String'
            }
          },
          surname: {
            required: false,
            serializedName: 'surname',
            type: {
              name: 'String'
            }
          },
          userType: {
            required: false,
            serializedName: 'userType',
            type: {
              name: 'String'
            }
          },
          accountEnabled: {
            required: true,
            serializedName: 'accountEnabled',
            type: {
              name: 'Boolean'
            }
          },
          displayName: {
            required: true,
            serializedName: 'displayName',
            type: {
              name: 'String'
            }
          },
          passwordProfile: {
            required: true,
            serializedName: 'passwordProfile',
            type: {
              name: 'Composite',
              additionalProperties: {
                type: {
                  name: 'Dictionary',
                  value: {
                      required: false,
                      serializedName: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              className: 'PasswordProfile'
            }
          },
          userPrincipalName: {
            required: true,
            serializedName: 'userPrincipalName',
            type: {
              name: 'String'
            }
          },
          mailNickname: {
            required: true,
            serializedName: 'mailNickname',
            type: {
              name: 'String'
            }
          },
          mail: {
            required: false,
            serializedName: 'mail',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = UserCreateParameters;


text:
------CREANDO RELACIONES-----
ALTER TABLE RPTBANCO
ADD CONSTRAINT FK_RPTBANCO_PLANILLA
FOREIGN KEY (CODPLANILLA)
REFERENCES PLANILLA(CODPLANILLA);

ALTER TABLE PLANILLA
ADD CONSTRAINT FK_PLANILLA_TRABAJADORES
FOREIGN KEY (CODTRABAJADOR)
REFERENCES TRABAJADORES(CODTRABAJADOR);

ALTER TABLE PRESTAMOS
ADD CONSTRAINT KF_PRESTAMOS_TRABAJADORES
FOREIGN KEY (CODTRABAJADOR)
REFERENCES TRABAJADORES(CODTRABAJADOR);

ALTER TABLE TRABAJADORES
ADD CONSTRAINT FK_TRABAJADORES_AREA
FOREIGN KEY(CODAREA)
REFERENCES AREA(CODAREA);

ALTER TABLE TRABAJADORES
ADD CONSTRAINT FK_TRABAJADORES_AFP
FOREIGN KEY(CODAFP)
REFERENCES AFP(CODAFP);

ALTER TABLE REG_HRS_LABORADAS
ADD CONSTRAINT FK_REGHL_TRABAJADOR
FOREIGN KEY (CODTRABAJADOR)
REFERENCES TRABAJADORES(CODTRABAJADOR);


text:
class CreateUserAssignments < ActiveRecord::Migration
  def change
    create_table :user_assignments do |t|
      t.boolean :completed
      t.belongs_to :user
      t.belongs_to :assignment
      t.timestamps
    end
  end
end


text:
from setuptools import setup, find_packages

version = __import__('background_task').__version__

setup(
    name='django-background-task',
    version=version,
    description='Database backed asynchronous task queue',
    long_description=open('README.rst').read(),
    author='John Montgomery',
    author_email='john@littlespikeyland.com',
    url='http://github.com/lilspikey/django-background-task',
    license='BSD',
    packages=find_packages(exclude=['ez_setup']),
    include_package_data=True,
    zip_safe=True,
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)


text:
id: 34
title: "Can't construct a query for the property \"formHost\" of \"ParentDynamicFormComponent\""
date: 2018-06-23T08:00:00+00:00
author: admin
layout: post
guid: http://www.darkedges.com/blog/?p=34
permalink: /2018/06/23/cant-construct-a-query/
categories:
  - angular

---
Last night I started to get the following error in my project

```
Can't construct a query for the property "formHost" of "ParentDynamicFormComponent"
```

<!-- more -->

All I had changed was in another module was adding my own Cutom HTTP Client, so I went back to it and put it back and it started working again. That is when I started going down the rabbithole to determine what I had done.

Turns out it was a Circular dependency in another class that

The original code was

```
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { Observable } from 'rxjs';
import { Store } from '@ngrx/store';
import { ActionAuthLogin, AuthTokenTypes, ActionAuthAccessToken } from './auth.reducer';
import { Authenticated } from 'models/authentication';
import { OpenAMHTTPService } from '../http.service';

@Injectable()
export class AuthService {
  private loggedIn = new BehaviorSubject<boolean>(false);

  constructor(
    private store: Store<any>,
    private httpService: OpenAMHTTPService
  ) {

  }

  get isLoggedIn() {
    return this.loggedIn.asObservable();
  }

  login(event: Authenticated) {
    this.store.dispatch(new ActionAuthLogin(event));
  }

  loggedin() {
    this.loggedIn.next(true);
    this.store.dispatch(new ActionAuthAccessToken());
  }

  logout() {
    this.httpService.logout().subscribe(
      action => {
        this.loggedIn.next(false);
      }
    );
  }
}
```

The circular dependency was the following line

```
 private httpService: OpenAMHTTPService
```

So off I went on a hunt to fix this issue and I found this discussion [https://github.com/angular/angular/issues/18224](https://github.com/angular/angular/issues/18224) and reading through it I found I should try

```
constructor(inj: Injector) {
    this.httpService = inj.get(OpenAMHTTPService)
  }
```

Aha It should be fixed, but no I then got the following

```
ERROR Error: Uncaught (in promise): RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at _createProviderInstance$1 (core.es5.js:9480)
    ...
```

Turns out I should have read some more as the solution was to not assign in the constructor, but in the call where I wanted to use it.

```
 logout() {
    this.httpService = this.injector.get(OpenAMHTTPService);
    this.httpService.logout().subscribe(
      action => {
        this.loggedIn.next(false);
      }
    );
  }
```

This solved my problem and I can continue on with my project.


text:
package org.powlab.jeye.tests.exception;

public class ExceptionTestFinally10c {

    int test1(int x) {
        bob : {
            try {
                return 2;
            } finally {
                break bob;
            }
        }
        System.out.println("TEST!");
        return 1;
    }

}


text:
require 'spec_helper'

describe Arscraper do
  it 'has a version number' do
    expect(Arscraper::VERSION).not_to be nil
  end
end


text:
<?php
namespace Hyperspan\Formatter;
use Hyperspan\Response;

/**
 * Formatter for Siren Hypermedia Format
 */
class Siren extends Base
{
    /**
     * Output response as array
     */
    public function toArray()
    {
        $res = array();

        if($props = $this->_response->getProperties()) {
            $res['properties'] = $props;
        }

        if($keys = $this->_response->getItems()) {
            $res['entities'] = array();
            foreach($keys as $key => $items) {
                foreach($items as $item) {
                    if($item instanceof Response) {
                        $itemRes = new self($item);
                        $item = $itemRes->toArray();
                    } elseif(is_array($item)) {
                        // Assume entity properties if raw array with no 'properties' key
                        if(!isset($item['properties'])) {
                            $item = array('properties' => $item);
                        }
                    } else {
                        throw new \InvalidArgumentException("Argument 1 passed to " . __METHOD__ . " must be of the type array or " . __CLASS__ . ", " . gettype($item) . " given");
                    }
                    $res['entities'][] = $item;
                }
            }
        }

        if($actions = $this->_response->getForms()) {
            $res['actions'] = array();
            foreach($actions as $name => $action) {
                $res['actions'][] = array_merge(array('name' => $name), $action);
            }
        }

        if($links = $this->_response->getLinks()) {
            $res['links'] = array();
            foreach($links as $rel => $link) {
                if(is_array($link)) {
                    $res['links'][] = array_merge(array('rel' => array($rel)), $link);
                } else {
                    $res['links'][] = array('rel' => array($rel), 'href' => $link);
                }
            }
        }

        if($data = $this->_response->getData()) {
            $res = array_merge($res, $data);
        }

        return $res;
    }
}


text:
export { default as SvgFixer } from './svg-fixer'
export { default as renderRoute } from './render-route'
export { default as loadComponent } from './load-component'
export { default as renderDevTools } from './render-dev-tools'
export { default as OutsideClicked } from './outside-clicked'


text:
<!DOCTYPE html>

    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
    <link rel="stylesheet" href="bower_components/fontawesome/css/font-awesome.css">

    <link rel="stylesheet" href="styles/main.css">

    @@include('./tmpls/faker.html')


text:
from clients import installed_games, steamapi

if __name__ == '__main__':
    api = steamapi.SteamApiClient()
    games = api.get_player_owned_games()
    for game in games:
        game['installed'] = installed_games.is_game_in_installed_games_list(game)

    for game in sorted(games, key=lambda game: game['name']):
        installed = 'Yes' if game['installed'] else 'No'
        print (game['name'])
        print('    Installed: ' + installed)
        print('    Playtime in Minutes: ' + str(game['playtime_forever']))
        print('')


text:
class ApplicationHelper::Button::OrchestrationTemplateCopyOrderable < ApplicationHelper::Button::Basic
  def calculate_properties
    super
    self[:title] = N_("This Template is already orderable") if disabled?
  end

  def disabled?
    @record.orchestration_template.orderable?
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Parmelia panniformis var. pulvinata Hillmann

### Remarks
null


text:
from product_details import product_details

ENGLISH_LANGUAGE_CHOICES = sorted(
    [(key.lower(), u'{0} ({1})'.format(key, value['English']))
     for key, value in product_details.languages.items()]
)
LANGUAGE_VALUES = [choice[0] for choice in ENGLISH_LANGUAGE_CHOICES]

ENGLISH_COUNTRY_CHOICES = sorted(
    [(code, u'{0} ({1})'.format(name, code)) for code, name in
     product_details.get_regions('en-US').items()],
    cmp=lambda x, y: cmp(x[1], y[1])
)

ENGLISH_COUNTRIES = product_details.get_regions('en-US')


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: java.util.TreeSet
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_TREESET_HPP_DECL
#define J2CPP_JAVA_UTIL_TREESET_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class Cloneable; } } }
namespace j2cpp { namespace java { namespace lang { class Iterable; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace util { class SortedSet; } } }
namespace j2cpp { namespace java { namespace util { class Iterator; } } }
namespace j2cpp { namespace java { namespace util { class NavigableSet; } } }
namespace j2cpp { namespace java { namespace util { class Collection; } } }
namespace j2cpp { namespace java { namespace util { class Comparator; } } }
namespace j2cpp { namespace java { namespace util { class AbstractCollection; } } }
namespace j2cpp { namespace java { namespace util { class AbstractSet; } } }
namespace j2cpp { namespace java { namespace util { class Set; } } }
namespace j2cpp { namespace java { namespace io { class Serializable; } } }

#include <java/io/Serializable.hpp>
#include <java/lang/Cloneable.hpp>
#include <java/lang/Iterable.hpp>
#include <java/lang/Object.hpp>
#include <java/util/AbstractCollection.hpp>
#include <java/util/AbstractSet.hpp>
#include <java/util/Collection.hpp>
#include <java/util/Comparator.hpp>
#include <java/util/Iterator.hpp>
#include <java/util/NavigableSet.hpp>
#include <java/util/Set.hpp>
#include <java/util/SortedSet.hpp>

namespace j2cpp {

namespace java { namespace util {

	class TreeSet;
	class TreeSet
		: public object<TreeSet>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)
		J2CPP_DECLARE_METHOD(8)
		J2CPP_DECLARE_METHOD(9)
		J2CPP_DECLARE_METHOD(10)
		J2CPP_DECLARE_METHOD(11)
		J2CPP_DECLARE_METHOD(12)
		J2CPP_DECLARE_METHOD(13)
		J2CPP_DECLARE_METHOD(14)
		J2CPP_DECLARE_METHOD(15)
		J2CPP_DECLARE_METHOD(16)
		J2CPP_DECLARE_METHOD(17)
		J2CPP_DECLARE_METHOD(18)
		J2CPP_DECLARE_METHOD(19)
		J2CPP_DECLARE_METHOD(20)
		J2CPP_DECLARE_METHOD(21)
		J2CPP_DECLARE_METHOD(22)
		J2CPP_DECLARE_METHOD(23)
		J2CPP_DECLARE_METHOD(24)
		J2CPP_DECLARE_METHOD(25)
		J2CPP_DECLARE_METHOD(26)
		J2CPP_DECLARE_METHOD(27)
		J2CPP_DECLARE_METHOD(28)
		J2CPP_DECLARE_METHOD(29)

		explicit TreeSet(jobject jobj)
		: object<TreeSet>(jobj)
		{
		}

		operator local_ref<java::lang::Cloneable>() const;
		operator local_ref<java::lang::Iterable>() const;
		operator local_ref<java::lang::Object>() const;
		operator local_ref<java::util::SortedSet>() const;
		operator local_ref<java::util::NavigableSet>() const;
		operator local_ref<java::util::Collection>() const;
		operator local_ref<java::util::AbstractCollection>() const;
		operator local_ref<java::util::AbstractSet>() const;
		operator local_ref<java::util::Set>() const;
		operator local_ref<java::io::Serializable>() const;

		TreeSet();
		TreeSet(local_ref< java::util::Collection > const&);
		TreeSet(local_ref< java::util::Comparator > const&);
		TreeSet(local_ref< java::util::SortedSet > const&);
		jboolean add(local_ref< java::lang::Object >  const&);
		jboolean addAll(local_ref< java::util::Collection >  const&);
		void clear();
		local_ref< java::lang::Object > clone();
		local_ref< java::util::Comparator > comparator();
		jboolean contains(local_ref< java::lang::Object >  const&);
		jboolean isEmpty();
		local_ref< java::util::Iterator > iterator();
		local_ref< java::util::Iterator > descendingIterator();
		jboolean remove(local_ref< java::lang::Object >  const&);
		jint size();
		local_ref< java::lang::Object > first();
		local_ref< java::lang::Object > last();
		local_ref< java::lang::Object > pollFirst();
		local_ref< java::lang::Object > pollLast();
		local_ref< java::lang::Object > higher(local_ref< java::lang::Object >  const&);
		local_ref< java::lang::Object > lower(local_ref< java::lang::Object >  const&);
		local_ref< java::lang::Object > ceiling(local_ref< java::lang::Object >  const&);
		local_ref< java::lang::Object > floor(local_ref< java::lang::Object >  const&);
		local_ref< java::util::NavigableSet > descendingSet();
		local_ref< java::util::NavigableSet > subSet(local_ref< java::lang::Object >  const&, jboolean, local_ref< java::lang::Object >  const&, jboolean);
		local_ref< java::util::NavigableSet > headSet(local_ref< java::lang::Object >  const&, jboolean);
		local_ref< java::util::NavigableSet > tailSet(local_ref< java::lang::Object >  const&, jboolean);
		local_ref< java::util::SortedSet > subSet(local_ref< java::lang::Object >  const&, local_ref< java::lang::Object >  const&);
		local_ref< java::util::SortedSet > headSet(local_ref< java::lang::Object >  const&);
		local_ref< java::util::SortedSet > tailSet(local_ref< java::lang::Object >  const&);
	}; //class TreeSet

} //namespace util
} //namespace java

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_TREESET_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_TREESET_HPP_IMPL
#define J2CPP_JAVA_UTIL_TREESET_HPP_IMPL

namespace j2cpp {

java::util::TreeSet::operator local_ref<java::lang::Cloneable>() const
{
	return local_ref<java::lang::Cloneable>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::lang::Iterable>() const
{
	return local_ref<java::lang::Iterable>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::SortedSet>() const
{
	return local_ref<java::util::SortedSet>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::NavigableSet>() const
{
	return local_ref<java::util::NavigableSet>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::Collection>() const
{
	return local_ref<java::util::Collection>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::AbstractCollection>() const
{
	return local_ref<java::util::AbstractCollection>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::AbstractSet>() const
{
	return local_ref<java::util::AbstractSet>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::util::Set>() const
{
	return local_ref<java::util::Set>(get_jobject());
}

java::util::TreeSet::operator local_ref<java::io::Serializable>() const
{
	return local_ref<java::io::Serializable>(get_jobject());
}

java::util::TreeSet::TreeSet()
: object<java::util::TreeSet>(
	call_new_object<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(0),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(0)
	>()
)
{
}

java::util::TreeSet::TreeSet(local_ref< java::util::Collection > const &a0)
: object<java::util::TreeSet>(
	call_new_object<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(1),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(1)
	>(a0)
)
{
}

java::util::TreeSet::TreeSet(local_ref< java::util::Comparator > const &a0)
: object<java::util::TreeSet>(
	call_new_object<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(2),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(2)
	>(a0)
)
{
}

java::util::TreeSet::TreeSet(local_ref< java::util::SortedSet > const &a0)
: object<java::util::TreeSet>(
	call_new_object<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(3),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(3)
	>(a0)
)
{
}

jboolean java::util::TreeSet::add(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(4),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(4),
		jboolean
	>(get_jobject(), a0);
}

jboolean java::util::TreeSet::addAll(local_ref< java::util::Collection > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(5),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(5),
		jboolean
	>(get_jobject(), a0);
}

void java::util::TreeSet::clear()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(6),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(6),
		void
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::clone()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(7),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(7),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::util::Comparator > java::util::TreeSet::comparator()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(8),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(8),
		local_ref< java::util::Comparator >
	>(get_jobject());
}

jboolean java::util::TreeSet::contains(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(9),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(9),
		jboolean
	>(get_jobject(), a0);
}

jboolean java::util::TreeSet::isEmpty()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(10),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(10),
		jboolean
	>(get_jobject());
}

local_ref< java::util::Iterator > java::util::TreeSet::iterator()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(11),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(11),
		local_ref< java::util::Iterator >
	>(get_jobject());
}

local_ref< java::util::Iterator > java::util::TreeSet::descendingIterator()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(12),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(12),
		local_ref< java::util::Iterator >
	>(get_jobject());
}

jboolean java::util::TreeSet::remove(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(13),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(13),
		jboolean
	>(get_jobject(), a0);
}

jint java::util::TreeSet::size()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(14),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(14),
		jint
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::first()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(15),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(15),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::last()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(16),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(16),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::pollFirst()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(17),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(17),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::pollLast()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(18),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(18),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::TreeSet::higher(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(19),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(19),
		local_ref< java::lang::Object >
	>(get_jobject(), a0);
}

local_ref< java::lang::Object > java::util::TreeSet::lower(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(20),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(20),
		local_ref< java::lang::Object >
	>(get_jobject(), a0);
}

local_ref< java::lang::Object > java::util::TreeSet::ceiling(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(21),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(21),
		local_ref< java::lang::Object >
	>(get_jobject(), a0);
}

local_ref< java::lang::Object > java::util::TreeSet::floor(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(22),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(22),
		local_ref< java::lang::Object >
	>(get_jobject(), a0);
}

local_ref< java::util::NavigableSet > java::util::TreeSet::descendingSet()
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(23),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(23),
		local_ref< java::util::NavigableSet >
	>(get_jobject());
}

local_ref< java::util::NavigableSet > java::util::TreeSet::subSet(local_ref< java::lang::Object > const &a0, jboolean a1, local_ref< java::lang::Object > const &a2, jboolean a3)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(24),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(24),
		local_ref< java::util::NavigableSet >
	>(get_jobject(), a0, a1, a2, a3);
}

local_ref< java::util::NavigableSet > java::util::TreeSet::headSet(local_ref< java::lang::Object > const &a0, jboolean a1)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(25),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(25),
		local_ref< java::util::NavigableSet >
	>(get_jobject(), a0, a1);
}

local_ref< java::util::NavigableSet > java::util::TreeSet::tailSet(local_ref< java::lang::Object > const &a0, jboolean a1)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(26),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(26),
		local_ref< java::util::NavigableSet >
	>(get_jobject(), a0, a1);
}

local_ref< java::util::SortedSet > java::util::TreeSet::subSet(local_ref< java::lang::Object > const &a0, local_ref< java::lang::Object > const &a1)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(27),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(27),
		local_ref< java::util::SortedSet >
	>(get_jobject(), a0, a1);
}

local_ref< java::util::SortedSet > java::util::TreeSet::headSet(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(28),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(28),
		local_ref< java::util::SortedSet >
	>(get_jobject(), a0);
}

local_ref< java::util::SortedSet > java::util::TreeSet::tailSet(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::TreeSet::J2CPP_CLASS_NAME,
		java::util::TreeSet::J2CPP_METHOD_NAME(29),
		java::util::TreeSet::J2CPP_METHOD_SIGNATURE(29),
		local_ref< java::util::SortedSet >
	>(get_jobject(), a0);
}

J2CPP_DEFINE_CLASS(java::util::TreeSet,"java/util/TreeSet")
J2CPP_DEFINE_METHOD(java::util::TreeSet,0,"<init>","()V")
J2CPP_DEFINE_METHOD(java::util::TreeSet,1,"<init>","(Ljava/util/Collection;)V")
J2CPP_DEFINE_METHOD(java::util::TreeSet,2,"<init>","(Ljava/util/Comparator;)V")
J2CPP_DEFINE_METHOD(java::util::TreeSet,3,"<init>","(Ljava/util/SortedSet;)V")
J2CPP_DEFINE_METHOD(java::util::TreeSet,4,"add","(Ljava/lang/Object;)Z")
J2CPP_DEFINE_METHOD(java::util::TreeSet,5,"addAll","(Ljava/util/Collection;)Z")
J2CPP_DEFINE_METHOD(java::util::TreeSet,6,"clear","()V")
J2CPP_DEFINE_METHOD(java::util::TreeSet,7,"clone","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,8,"comparator","()Ljava/util/Comparator;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,9,"contains","(Ljava/lang/Object;)Z")
J2CPP_DEFINE_METHOD(java::util::TreeSet,10,"isEmpty","()Z")
J2CPP_DEFINE_METHOD(java::util::TreeSet,11,"iterator","()Ljava/util/Iterator;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,12,"descendingIterator","()Ljava/util/Iterator;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,13,"remove","(Ljava/lang/Object;)Z")
J2CPP_DEFINE_METHOD(java::util::TreeSet,14,"size","()I")
J2CPP_DEFINE_METHOD(java::util::TreeSet,15,"first","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,16,"last","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,17,"pollFirst","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,18,"pollLast","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,19,"higher","(Ljava/lang/Object;)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,20,"lower","(Ljava/lang/Object;)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,21,"ceiling","(Ljava/lang/Object;)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,22,"floor","(Ljava/lang/Object;)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,23,"descendingSet","()Ljava/util/NavigableSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,24,"subSet","(Ljava/lang/Object;ZLjava/lang/Object;Z)Ljava/util/NavigableSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,25,"headSet","(Ljava/lang/Object;Z)Ljava/util/NavigableSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,26,"tailSet","(Ljava/lang/Object;Z)Ljava/util/NavigableSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,27,"subSet","(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/SortedSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,28,"headSet","(Ljava/lang/Object;)Ljava/util/SortedSet;")
J2CPP_DEFINE_METHOD(java::util::TreeSet,29,"tailSet","(Ljava/lang/Object;)Ljava/util/SortedSet;")

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_TREESET_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
package com.skubit.comics;

import java.util.ArrayList;

public interface ICatalogAdapter<T> {

    void add(ArrayList<T> dtos);

    void notifyDataSetChanged();
}


text:
package org.redisson.spring.data.connection;

import org.redisson.reactive.CommandReactiveExecutor;
import org.springframework.data.redis.connection.ReactiveClusterZSetCommands;

/**
 *
 * @author Nikita Koksharov
 *
 */
public class RedissonReactiveClusterZSetCommands extends RedissonReactiveZSetCommands implements ReactiveClusterZSetCommands {

    RedissonReactiveClusterZSetCommands(CommandReactiveExecutor executorService) {
        super(executorService);
    }

}


text:
from collections import namedtuple
from unittest import TestCase

from redash.utils import (build_url, collect_parameters_from_request,
                          filter_none, json_dumps, generate_token)

DummyRequest = namedtuple('DummyRequest', ['host', 'scheme'])

class TestBuildUrl(TestCase):
    def test_simple_case(self):
        self.assertEqual("http://example.com/test", build_url(DummyRequest("", "http"), "example.com", "/test"))

    def test_uses_current_request_port(self):
        self.assertEqual("http://example.com:5000/test", build_url(DummyRequest("example.com:5000", "http"), "example.com", "/test"))

    def test_uses_current_request_schema(self):
        self.assertEqual("https://example.com/test", build_url(DummyRequest("example.com", "https"), "example.com", "/test"))

    def test_skips_port_for_default_ports(self):
        self.assertEqual("https://example.com/test", build_url(DummyRequest("example.com:443", "https"), "example.com", "/test"))
        self.assertEqual("http://example.com/test", build_url(DummyRequest("example.com:80", "http"), "example.com", "/test"))
        self.assertEqual("https://example.com:80/test", build_url(DummyRequest("example.com:80", "https"), "example.com", "/test"))
        self.assertEqual("http://example.com:443/test", build_url(DummyRequest("example.com:443", "http"), "example.com", "/test"))

class TestCollectParametersFromRequest(TestCase):
    def test_ignores_non_prefixed_values(self):
        self.assertEqual({}, collect_parameters_from_request({'test': 1}))

    def test_takes_prefixed_values(self):
        self.assertDictEqual({'test': 1, 'something_else': 'test'}, collect_parameters_from_request({'p_test': 1, 'p_something_else': 'test'}))

class TestSkipNones(TestCase):
    def test_skips_nones(self):
        d = {
            'a': 1,
            'b': None
        }

        self.assertDictEqual(filter_none(d), {'a': 1})

class TestJsonDumps(TestCase):
    def test_handles_binary(self):
        self.assertEqual(json_dumps(buffer("test")), '"74657374"')

class TestGenerateToken(TestCase):
    def test_format(self):
        token = generate_token(40)
        self.assertRegexpMatches(token, r"[a-zA-Z0-9]{40}")


text:
export > /etc/envvars
/usr/sbin/runsvdir-start


text:
package dominio;

import dominio.GestionAdd;

public class Gestion {

	private GestionAdd gesAdd;

	public Gestion(){
	}

	public boolean CrearContacto(String dni, String nombre, String apellidos, String telefono, String email, boolean cargado) throws Exception{
		gesAdd = new GestionAdd(cargado);
		return gesAdd.CrearContacto(dni, nombre, apellidos, telefono, email);
	}

	public boolean Cerrar(){
		return gesAdd.Cerrar();
	}

}


text:
using System;

namespace Dibware.StoredProcedureFramework.Examples.Dtos
{
    /// <summary>
    /// Encapsulates Account data
    /// </summary>
    internal class AccountDto
    {
        public int AccountId { get; set; }
        public int CompanyId { get; set; }
        public bool IsActive { get; set; }
        public string AccountName { get; set; }
        public DateTime RecordCreatedDateTime { get; set; }
        public DateTime LastUpdatedDateTime { get; set; }
    }
}


text:
package tests;

import data.ContactData;
import data.Contacts;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactModificationTests extends TestBase {

    @BeforeMethod
    private void testDataCheckout() {
        if (app.db().contacts().size() == 0) {
            app.contact().create(new ContactData()
                    .withName("name").withMidName("mid").withSurname("surname").withNickname("vahvah").withTitle("director")
                    .withCompany("New Company").withAddress("spb").withHomePhone("8915196819").withEmail("name.mid.surname@newcompany.ru"));
        }
    }

    @Test
    public void testContactModification() {
        Contacts before = app.db().contacts();
        ContactData modifiedContact = before.iterator().next();
        ContactData contact = new ContactData()
                .withId(modifiedContact.getId()).withName("name11").withMidName("modified midname").withSurname("surname99")
                .withNickname("modified nickname").withTitle("modified title").withCompany("modified company").withAddress("modified address")
                .withHomePhone("11111111").withMobilePhone("1231313").withWorkPhone("1248283423").withEmail("modified.mail@mail.ru")
                .withEmail2("123123@fddsf").withEmail3("213@asasd.www");

        app.contact().modify(contact);
        Contacts after = app.db().contacts();

        assertThat(before.without(modifiedContact).withAdded(contact), equalTo(after));
    }

}


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package wicket.contrib.groovy.builder.impl.wicket;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import wicket.contrib.groovy.builder.WicketComponentBuilderException;
import wicket.contrib.groovy.builder.util.AttributeUtils;
import wicket.model.IModel;
import wicket.model.Model;

/**
 *
 * @author Kevin Galligan
 *
 */
public class LoopComponentBuilder extends GenericComponentBuilder
{
	static final String[] INTERATIONS_NAMES = new String[]{"iterations", "times", "loops"};
	public LoopComponentBuilder(Class componentClass)
	{
		super(componentClass);
	}

	public List getConstructorParameters(String key, Map attributes)
	{
		List args = new ArrayList(2);
		args.add(key);
		Object iterations = AttributeUtils.multiName(attributes, INTERATIONS_NAMES);
		if(iterations != null)
		{
			if(iterations instanceof Number)
				args.add(new Model((Serializable) iterations));
			else if(iterations instanceof String)
				args.add(new Model(new Integer((String)iterations)));
			else if(iterations instanceof IModel)
				args.add((IModel)iterations);
			else
				throw new WicketComponentBuilderException("iterations type not known");
		}

		throw new WicketComponentBuilderException("iterations param required for Loop");
	}

}


text:
require 'minitest/spec'
require 'minitest/autorun'
require_relative "../lib/deck"

describe Deck do
  it "can not be created with no arguments" do
    proc {Deck.new}.must_raise ArgumentError
  end

  it "can not be created with anything other than an array" do
    err = proc { Deck.new("test") }.must_raise RuntimeError
    err.message.must_equal "Deck requires an array of cards"
  end

  it "can be created with an array" do
    Deck.new([1,2,3]).must_be_instance_of Deck
  end

  it "can deal the top card" do
    deck = Deck.new([1,2,3])
    deck.deal.must_equal 3
  end

  it "can shuffle the cards" do
    deck = Deck.new([1,2,3])
    deck.shuffle
  end

  it "can reveal how many cards are left" do
    deck = Deck.new([1,2,3])
    deck.deal
    deck.size.must_equal 2
  end
end


text:
echo "WARNING: This binary has been renamed from vdsgetsystemstate to "
echo "         vdsgetclusterstate. Currently, this script calls the other. "
echo "         as a convinience. This script will be removed later."

vdsgetclusterstate $@


text:
HoEffectResTexture::HoEffectResTexture()
{
}

HoEffectResTexture::~HoEffectResTexture()
{
}

bool HoEffectResTexture::LoadingRes(const std::string &fileName)
{
    char tempBuffer[128];
    strcpy(tempBuffer, fileName.c_str());

    m_iMatNum = CreateTextureMaterial(tempBuffer, 0, 0, 0, 0, SMMAT_BLEND_LAMP);
    smMaterialGroup->ReadTextures();

    return true;
}

int HoEffectResTexture::GetRes()
{
    return m_iMatNum;
}

HoEffectResMesh::HoEffectResMesh():m_Mesh(NULL),
                                   m_Bone(NULL)
{
}

HoEffectResMesh::~HoEffectResMesh()
{
    if(m_Mesh != NULL)
    {
        delete m_Mesh;
        m_Mesh = NULL;
    }

    if(m_Bone != NULL)
    {
        delete m_Bone;
        m_Bone = NULL;
    }
}

bool HoEffectResMesh::LoadingRes(const std::string &meshName)
{
    char tempBuffer[128];
    strcpy(tempBuffer, meshName.c_str());

    smASE_SetPhysique(NULL);
    m_Mesh = smASE_Read(tempBuffer);
    if(m_Mesh == NULL)
        return false;

    m_Mesh->ZeroNormals();
    m_Mesh->smMaterialGroup->ReadTextures();

    if(m_Mesh->smMaterialGroup)
    {
        int matCount = m_Mesh->smMaterialGroup->MaterialCount;
        for(int i = 0; i < matCount; i++)
        {
            m_Mesh->smMaterialGroup->smMaterial[i].BlendType = SMMAT_BLEND_LAMP;
        }
    }
    return true;
}

smPAT3D *HoEffectResMesh::GetRes()
{
    if(m_Mesh == NULL)
        return NULL;

    return m_Mesh;
}

smPAT3D *HoEffectResMesh::GetBoneRes()
{
	if(m_Bone == NULL)
		return NULL;

	return m_Bone;
}

bool HoEffectResMesh::LoadingRes(const std::string &meshName, const std::string &boneName)
{
    char tempBuffer1[128];
    char tempBuffer2[128];
    strcpy(tempBuffer1, meshName.c_str());
    strcpy(tempBuffer2, boneName.c_str());
    m_Bone = smASE_ReadBone(tempBuffer1);
	smASE_SetPhysique(m_Bone);

    m_Mesh = smASE_Read(tempBuffer1);
    m_Mesh->ZeroNormals();
    m_Mesh->smMaterialGroup->ReadTextures();

    if(m_Mesh->smMaterialGroup)
    {
        int matCount = m_Mesh->smMaterialGroup->MaterialCount;
        for(int i = 0; i < matCount; i++)
        {
            m_Mesh->smMaterialGroup->smMaterial[i].BlendType = SMMAT_BLEND_LAMP;
        }
    }

    return true;
}

HoEffectResManager::HoEffectResManager()
{
}

HoEffectResManager::~HoEffectResManager()
{
    ResTextureMapIT M_stIT	= m_ResTextureMap.begin();
	ResTextureMapIT	M_endIT	= m_ResTextureMap.end();

	for(;M_stIT != M_endIT;)
	{
		delete M_stIT->second;
		++M_stIT;
	}

    ResMeshMapIT B_stIT	 = m_ResMeshMap.begin();
	ResMeshMapIT B_endIT = m_ResMeshMap.end();

	for(;B_stIT != B_endIT;)
	{
		delete B_stIT->second;
		++B_stIT;
	}

	m_ResTextureMap.clear();
	m_ResMeshMap.clear();
}

HoEffectResManager* HoEffectResManager::m_Instance = 0;
HoEffectResManager* HoEffectResManager::GetInstance()
{
    if(m_Instance == 0)
        m_Instance = new HoEffectResManager;
    return m_Instance;
}

smPAT3D *HoEffectResManager::GetResMesh(const std::string &meshName, const std::string &boneName)
{
    if(m_ResMeshMap.find(meshName) == m_ResMeshMap.end())
    {
        HoEffectResMesh *resMesh = new HoEffectResMesh;
        if(boneName.size() == 0)
            resMesh->LoadingRes(meshName);
        else
            resMesh->LoadingRes(meshName, boneName);
        m_ResMeshMap[meshName]	= resMesh;
        return resMesh->GetRes();
    }
    else
        return m_ResMeshMap[meshName]->GetRes();

    return NULL;
}

smPAT3D *HoEffectResManager::GetResBone(const std::string &meshName)
{
	if(m_ResMeshMap.find(meshName) != m_ResMeshMap.end())
		return m_ResMeshMap[meshName]->GetBoneRes();

	return NULL;
}

int HoEffectResManager::GetResTexture(const std::string &fileName)
{
    if(m_ResTextureMap.find(fileName) == m_ResTextureMap.end())
    {
        HoEffectResTexture *resTexture = new HoEffectResTexture;
        resTexture->LoadingRes(fileName);
        m_ResTextureMap[fileName] = resTexture;
        return resTexture->GetRes();
    }
    else
        return m_ResTextureMap[fileName]->GetRes();
    return -1;
}

void HoEffectResManager::Clear()
{
    ResTextureMapIT M_stIT	= m_ResTextureMap.begin();
	ResTextureMapIT	M_endIT	= m_ResTextureMap.end();

	for(;M_stIT != M_endIT;)
	{
		delete M_stIT->second;
		++M_stIT;
	}

    ResMeshMapIT B_stIT	 = m_ResMeshMap.begin();
	ResMeshMapIT B_endIT = m_ResMeshMap.end();

	for(;B_stIT != B_endIT;)
	{
		delete B_stIT->second;
		++B_stIT;
	}

	m_ResTextureMap.clear();
	m_ResMeshMap.clear();
}


text:
package org.devgateway.toolkit.forms;

import org.devgateway.toolkit.forms.wicket.FormsWebApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

/**
 * Allows the app to deployed as Servlet 3.0 WAR
 *
 * @author mpostelnicu
 *
 */
public class WarInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
        return application.sources(FormsWebApplication.class);
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Hedwigia 75: 212 (1935)

#### Original name
Botrytis cinerea f. erythronii Savul. & Sandu

### Remarks
null


text:
#include <stdlib.h>
#include <unistd.h>

#include "gamegear.h"
#include "logging.h"
#include "util.h"

/* Clock speed in Hz was taken from the official Sega GG documentation */
#define CPU_CLOCK_SPEED (3579545.)
#define CYCLES_PER_FRAME (CPU_CLOCK_SPEED / GG_FPS)
#define CYCLES_PER_LINE (CYCLES_PER_FRAME / VDP_LINES_PER_FRAME)
#define NS_PER_FRAME (1000 * 1000 * 1000 / GG_FPS)

#define SET_EXC(...) snprintf(gg->exc_buffer, GG_EXC_BUFF_SIZE, __VA_ARGS__);

/*
    Create and return a pointer to a new GameGear object.

    The GameGear operates in headless mode by default (i.e., without any
    noticeable output). You'll probably want to attach a frame-completion
    callback with gamegear_attach_callback() and a display with
    gamegear_attach_display().
*/
GameGear* gamegear_create()
{
    GameGear *gg = cr_malloc(sizeof(GameGear));
    mmu_init(&gg->mmu);
    vdp_init(&gg->vdp);
    psg_init(&gg->psg);
    io_init(&gg->io, &gg->mmu, &gg->vdp, &gg->psg);
    z80_init(&gg->cpu, &gg->mmu, &gg->io);

    gg->powered = false;
    gg->callback = NULL;
    gg->exc_buffer[0] = '\0';
    return gg;
}

/*
    Destroy a previously-allocated GameGear object.

    Does *not* destroy any loaded ROM objects.
*/
void gamegear_destroy(GameGear *gg)
{
    mmu_free(&gg->mmu);
    vdp_free(&gg->vdp);
    psg_free(&gg->psg);
    free(gg);
}

/*
    Load a ROM image into the GameGear object.

    Does *not* steal a reference to the ROM object, so it must be kept alive
    until another ROM is loaded or the GameGear is destroyed. Calling this
    function while the GameGear is powered on has no effect.
*/
void gamegear_load_rom(GameGear *gg, const ROM *rom)
{
    if (gg->powered)
        return;
    mmu_load_rom(&gg->mmu, rom->data, rom->size);
}

/*
    Load BIOS into the GameGear object.

    The same rules with gamegear_load_rom() apply here.
*/
void gamegear_load_bios(GameGear *gg, const BIOS *bios)
{
    if (gg->powered)
        return;
    mmu_load_bios(&gg->mmu, bios->data);
}

/*
    Load a game save into the GameGear object.

    The same rules with gamegear_load_rom() apply here.
*/
void gamegear_load_save(GameGear *gg, Save *save)
{
    if (gg->powered)
        return;
    mmu_load_save(&gg->mmu, save);
}

/*
    Update the GameGear's button/joystick state.

    'state' should be true when the button is pressed, and false when it is
    released.
*/
void gamegear_input(GameGear *gg, GGButton button, bool state)
{
    if (button == BUTTON_START)
        io_set_start(&gg->io, state);
    else
        io_set_button(&gg->io, button, state);
}

/*
    Power on the GameGear.

    This clears the exception buffer and executes boot code (e.g. clearing
    memory and setting initial register values).
*/
static void power_on(GameGear *gg)
{
    gg->exc_buffer[0] = '\0';
    gg->powered = true;

    mmu_power(&gg->mmu);
    vdp_power(&gg->vdp);
    io_power(&gg->io);
    z80_power(&gg->cpu);
}

/*
    Power off the GameGear.

    This function *may* be used while the GameGear is running to trigger a safe
    shutdown at the next opportunity. It is also reentrant. If the GameGear is
    already off, it will do nothing.
*/
void gamegear_power_off(GameGear *gg)
{
    gg->powered = false;
}

/*
    Set a callback to be triggered whenever the GameGear completes a frame.

    The callback is passed a reference to the GameGear object.
*/
void gamegear_attach_callback(GameGear *gg, GGFrameCallback callback)
{
    gg->callback = callback;
}

/*
    Set a display to written to whenever the GameGear draws a pixel.

    The array must be (GG_SCREEN_WIDTH * GG_SCREEN_HEIGHT) pixels large, where
    each pixel is a 32-bit integer in ARGB order (i.e., A is the top 8 bits).
*/
void gamegear_attach_display(GameGear *gg, uint32_t *pixels)
{
    gg->vdp.pixels = pixels;
}

/*
    Reset any callbacks or displays attached to the GameGear.

    This returns the GameGear to headless mode.
*/
void gamegear_detach(GameGear *gg)
{
    gg->callback = NULL;
    gg->vdp.pixels = NULL;
}

/*
    Simulate the GameGear for one frame.

    This function simulates the number of clock cycles corresponding to 1/60th
    of a second. The return value indicates whether an exception flag has been
    set somewhere. If true, emulation must be stopped.
*/
static bool simulate_frame(GameGear *gg)
{
    size_t line;
    bool except;

    for (line = 0; line < VDP_LINES_PER_FRAME; line++) {
        except = z80_do_cycles(&gg->cpu, CYCLES_PER_LINE);
        if (except)
            return true;
        vdp_simulate_line(&gg->vdp);
    }
    return false;
}

/*
    Simulate the GameGear.

    The GameGear must start out in an unpowered state; it will be powered only
    during the simulation. This function blocks until the simulation ends,
    either by an exception occurring or someone calling gamegear_power_off().

    If a callback has been set with gamegear_set_callback(), then we'll trigger
    it after every frame has been simulated (sixty times per second).

    Exceptions can be retrieved after this call with gamegear_get_exception().
    If the simulation ended normally, then that function will return NULL.
*/
void gamegear_simulate(GameGear *gg)
{
    if (gg->powered)
        return;

    DEBUG("GameGear: powering on")
    power_on(gg);

    while (gg->powered) {
        uint64_t start = get_time_ns(), delta;

        if (simulate_frame(gg) || !gg->powered)
            break;
        if (gg->callback)
            gg->callback(gg);

        delta = get_time_ns() - start;
        if (delta < NS_PER_FRAME)
            usleep((NS_PER_FRAME - delta) / 1000);
    }

    DEBUG("GameGear: powering off")
    gamegear_power_off(gg);
}

/*
    If an exception flag has been set in the GameGear, return the reason.

    This function returns a const pointer to a buffer holding a human-readable
    exception string (although it may be cryptic to an end-user). The buffer is
    owned by the GameGear object and should not be freed - its contents last
    until the GameGear is powered on. If no exception flag is set, this
    function returns NULL.
*/
const char* gamegear_get_exception(GameGear *gg)
{
    if (!gg->exc_buffer[0]) {
        if (gg->cpu.except) {
            switch (gg->cpu.exc_code) {
                case Z80_EXC_NOT_POWERED:
                    SET_EXC("CPU not powered")
                    break;
                case Z80_EXC_UNIMPLEMENTED_OPCODE:
                    SET_EXC("unimplemented opcode: 0x%02X", gg->cpu.exc_data)
                    break;
                default:
                    SET_EXC("unknown exception")
                    break;
            }
        } else {
            return NULL;
        }
    }
    return gg->exc_buffer;
}

/*
    @DEBUG_LEVEL
    Print out some state info to stdout: Z80 and VDP register values, etc.
*/
void gamegear_print_state(const GameGear *gg)
{
    z80_dump_registers(&gg->cpu);
    vdp_dump_registers(&gg->vdp);
}


text:
/**
 * Created by dllo on 17/9/6.
 */
import React, {Component} from 'react'
import Nav from '../../../components/web-nav/nav'
import MaizuoLogin from '../../../components/MaizuoLogged/maizuologin/maizuologin'
import Footer from '../../../components/Footer/Footer'

class App extends Component {
  render() {
    return (
      <div>
        <Nav />
        <MaizuoLogin />
        <Footer />
      </div>
    )
  }
}

export default App


text:
import time
from engineio import packet, payload

def test():
    p = payload.Payload(
        packets=[packet.Packet(packet.MESSAGE, b'hello world')] * 10)
    start = time.time()
    count = 0
    while True:
        p = payload.Payload(encoded_payload=p.encode())
        count += 1
        if time.time() - start >= 5:
            break
    return count

if __name__ == '__main__':
    count = test()
    print('payload:', count, 'payloads processed.')


text:
package com.marklogic.client.functionaltest;

import com.marklogic.client.pojo.annotation.Id;
import com.marklogic.client.pojo.annotation.PathIndexProperty;
import com.marklogic.client.pojo.annotation.PathIndexProperty.ScalarType;

/*
 * This class is similar to the Artifact class. It is used to test path range index
 * using the inventory field with Integer type.
 * Property name been annotated with @Id.
 */
public class ArtifactIndexedOnInteger {
	@Id
	public String name;
	public long id;
	private Company manufacturer;

	@PathIndexProperty(scalarType = ScalarType.INT)
	private Integer inventory;
	private int inventory1;

	public int getInventory1() {
		return inventory1;
	}

	public ArtifactIndexedOnInteger setInventory1(int inventory1) {
		this.inventory1 = inventory1;
		return this;
	}

	public long getId() {
		return id;
	}

	public ArtifactIndexedOnInteger setId(long id) {
		this.id = id;
		return this;
	}

	public String getName() {
		return name;
	}

	public ArtifactIndexedOnInteger setName(String name) {
		this.name = name;
		return this;
	}

	public Company getManufacturer() {
		return manufacturer;
	}

	public ArtifactIndexedOnInteger setManufacturer(Company manufacturer) {
		this.manufacturer = manufacturer;
		return this;
	}

	public Integer getInventory() {
		return inventory;
	}

	public ArtifactIndexedOnInteger setInventory(Integer inventory) {
		this.inventory = inventory;
		return this;
	}
}


text:
from testtools import TestCase

from kmip.core import attributes
from kmip.core import misc
from kmip.core import objects
from kmip.core import utils

from kmip.core.messages.payloads import rekey_key_pair

class TestRekeyKeyPairRequestPayload(TestCase):

    def setUp(self):
        super(TestRekeyKeyPairRequestPayload, self).setUp()

        self.uuid = '00000000-0000-0000-0000-000000000000'
        self.private_key_uuid = attributes.PrivateKeyUniqueIdentifier(
            self.uuid)
        self.offset = misc.Offset(0)
        self.common_template_attribute = objects.CommonTemplateAttribute()
        self.private_key_template_attribute = \
            objects.PrivateKeyTemplateAttribute()
        self.public_key_template_attribute = \
            objects.PublicKeyTemplateAttribute()

        self.encoding_empty = utils.BytearrayStream((
            b'\x42\x00\x79\x01\x00\x00\x00\x00'))
        self.encoding_full = utils.BytearrayStream((
            b'\x42\x00\x79\x01\x00\x00\x00\x58\x42\x00\x66\x07\x00\x00\x00\x24'
            b'\x30\x30\x30\x30\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30'
            b'\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x30\x30\x30\x30'
            b'\x30\x30\x30\x30\x00\x00\x00\x00\x42\x00\x58\x0A\x00\x00\x00\x04'
            b'\x00\x00\x00\x00\x00\x00\x00\x00\x42\x00\x1F\x01\x00\x00\x00\x00'
            b'\x42\x00\x65\x01\x00\x00\x00\x00\x42\x00\x6E\x01\x00\x00\x00\x00'
            ))

    def tearDown(self):
        super(TestRekeyKeyPairRequestPayload, self).tearDown()

    def test_init_with_none(self):
        rekey_key_pair.RekeyKeyPairRequestPayload()

    def test_init_with_args(self):
        rekey_key_pair.RekeyKeyPairRequestPayload(
            self.private_key_uuid, self.offset, self.common_template_attribute,
            self.private_key_template_attribute,
            self.public_key_template_attribute)

    def test_validate_with_invalid_private_key_unique_identifier(self):
        kwargs = {'private_key_uuid': 'invalid', 'offset': None,
                  'common_template_attribute': None,
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid private key unique identifier",
            rekey_key_pair.RekeyKeyPairRequestPayload, **kwargs)

    def test_validate_with_invalid_offset(self):
        kwargs = {'private_key_uuid': None, 'offset': 'invalid',
                  'common_template_attribute': None,
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid offset",
            rekey_key_pair.RekeyKeyPairRequestPayload, **kwargs)

    def test_validate_with_invalid_common_template_attribute(self):
        kwargs = {'private_key_uuid': None, 'offset': None,
                  'common_template_attribute': 'invalid',
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid common template attribute",
            rekey_key_pair.RekeyKeyPairRequestPayload, **kwargs)

    def test_validate_with_invalid_private_key_template_attribute(self):
        kwargs = {'private_key_uuid': None, 'offset': None,
                  'common_template_attribute': None,
                  'private_key_template_attribute': 'invalid',
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid private key template attribute",
            rekey_key_pair.RekeyKeyPairRequestPayload, **kwargs)

    def test_validate_with_invalid_public_key_template_attribute(self):
        kwargs = {'private_key_uuid': None, 'offset': None,
                  'common_template_attribute': None,
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': 'invalid'}
        self.assertRaisesRegexp(
            TypeError, "invalid public key template attribute",
            rekey_key_pair.RekeyKeyPairRequestPayload, **kwargs)

    def _test_read(self, stream, payload, private_key_uuid, offset,
                   common_template_attribute, private_key_template_attribute,
                   public_key_template_attribute):
        payload.read(stream)

        msg = "private_key_uuid decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            private_key_uuid, payload.private_key_uuid)
        self.assertEqual(private_key_uuid, payload.private_key_uuid, msg)

        msg = "offset decoding mismatch"
        msg += "; expected {0}, received {1}".format(offset, payload.offset)
        self.assertEqual(offset, payload.offset, msg)

        msg = "common_template_attribute decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            common_template_attribute, payload.common_template_attribute)
        self.assertEqual(common_template_attribute,
                         payload.common_template_attribute, msg)

        msg = "private_key_template_attribute decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            private_key_template_attribute,
            payload.private_key_template_attribute)
        self.assertEqual(private_key_template_attribute,
                         payload.private_key_template_attribute, msg)

        msg = "public_key_template_attribute decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            public_key_template_attribute,
            payload.public_key_template_attribute)
        self.assertEqual(public_key_template_attribute,
                         payload.public_key_template_attribute, msg)

    def test_read_with_none(self):
        stream = self.encoding_empty
        payload = rekey_key_pair.RekeyKeyPairRequestPayload()

        self._test_read(stream, payload, None, None, None, None, None)

    def test_read_with_args(self):
        stream = self.encoding_full
        payload = rekey_key_pair.RekeyKeyPairRequestPayload()

        self._test_read(stream, payload, self.private_key_uuid, self.offset,
                        self.common_template_attribute,
                        self.private_key_template_attribute,
                        self.public_key_template_attribute)

    def _test_write(self, stream, payload, expected):
        payload.write(stream)

        length_expected = len(expected)
        length_received = len(stream)

        msg = "encoding lengths not equal"
        msg += "; expected {0}, received {1}".format(
            length_expected, length_received)
        self.assertEqual(length_expected, length_received, msg)

        msg = "encoding mismatch"
        msg += ";\nexpected:\n{0}\nreceived:\n{1}".format(expected, stream)

        self.assertEqual(expected, stream, msg)

    def test_write_with_none(self):
        stream = utils.BytearrayStream()
        payload = rekey_key_pair.RekeyKeyPairRequestPayload()

        self._test_write(stream, payload, self.encoding_empty)

    def test_write_with_args(self):
        stream = utils.BytearrayStream()
        payload = rekey_key_pair.RekeyKeyPairRequestPayload(
            self.private_key_uuid, self.offset, self.common_template_attribute,
            self.private_key_template_attribute,
            self.public_key_template_attribute)

        self._test_write(stream, payload, self.encoding_full)

class TestRekeyKeyPairResponsePayload(TestCase):

    def setUp(self):
        super(TestRekeyKeyPairResponsePayload, self).setUp()

        self.uuid = '00000000-0000-0000-0000-000000000000'
        self.private_key_uuid = attributes.PrivateKeyUniqueIdentifier(
            self.uuid)
        self.public_key_uuid = attributes.PublicKeyUniqueIdentifier(
            self.uuid)
        self.empty_private_key_uuid = attributes.PrivateKeyUniqueIdentifier('')
        self.empty_public_key_uuid = attributes.PublicKeyUniqueIdentifier('')

        self.private_key_template_attribute = \
            objects.PrivateKeyTemplateAttribute()
        self.public_key_template_attribute = \
            objects.PublicKeyTemplateAttribute()

        self.encoding_empty = utils.BytearrayStream((
            b'\x42\x00\x7C\x01\x00\x00\x00\x10\x42\x00\x66\x07\x00\x00\x00\x00'
            b'\x42\x00\x6F\x07\x00\x00\x00\x00'))
        self.encoding_full = utils.BytearrayStream((
            b'\x42\x00\x7C\x01\x00\x00\x00\x70\x42\x00\x66\x07\x00\x00\x00\x24'
            b'\x30\x30\x30\x30\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30'
            b'\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x30\x30\x30\x30'
            b'\x30\x30\x30\x30\x00\x00\x00\x00\x42\x00\x6F\x07\x00\x00\x00\x24'
            b'\x30\x30\x30\x30\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30'
            b'\x30\x30\x2d\x30\x30\x30\x30\x2d\x30\x30\x30\x30\x30\x30\x30\x30'
            b'\x30\x30\x30\x30\x00\x00\x00\x00\x42\x00\x65\x01\x00\x00\x00\x00'
            b'\x42\x00\x6E\x01\x00\x00\x00\x00'))

    def tearDown(self):
        super(TestRekeyKeyPairResponsePayload, self).tearDown()

    def test_init_with_none(self):
        rekey_key_pair.RekeyKeyPairResponsePayload()

    def test_init_with_args(self):
        rekey_key_pair.RekeyKeyPairResponsePayload(
            self.private_key_uuid, self.public_key_uuid,
            self.private_key_template_attribute,
            self.public_key_template_attribute)

    def test_validate_with_invalid_private_key_unique_identifier(self):
        kwargs = {'private_key_uuid': 'invalid',
                  'public_key_uuid': None,
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid private key unique identifier",
            rekey_key_pair.RekeyKeyPairResponsePayload, **kwargs)

    def test_validate_with_invalid_public_key_unique_identifier(self):
        kwargs = {'private_key_uuid': None,
                  'public_key_uuid': 'invalid',
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid public key unique identifier",
            rekey_key_pair.RekeyKeyPairResponsePayload, **kwargs)

    def test_validate_with_invalid_private_key_template_attribute(self):
        kwargs = {'private_key_uuid': None,
                  'public_key_uuid': None,
                  'private_key_template_attribute': 'invalid',
                  'public_key_template_attribute': None}
        self.assertRaisesRegexp(
            TypeError, "invalid private key template attribute",
            rekey_key_pair.RekeyKeyPairResponsePayload, **kwargs)

    def test_validate_with_invalid_public_key_template_attribute(self):
        kwargs = {'private_key_uuid': None,
                  'public_key_uuid': None,
                  'private_key_template_attribute': None,
                  'public_key_template_attribute': 'invalid'}
        self.assertRaisesRegexp(
            TypeError, "invalid public key template attribute",
            rekey_key_pair.RekeyKeyPairResponsePayload, **kwargs)

    def _test_read(self, stream, payload, private_key_uuid, public_key_uuid,
                   private_key_template_attribute,
                   public_key_template_attribute):
        payload.read(stream)

        msg = "private_key_uuid decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            private_key_uuid, payload.private_key_uuid)
        self.assertEqual(private_key_uuid, payload.private_key_uuid, msg)

        msg = "public_key_uuid decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            public_key_uuid, payload.public_key_uuid)
        self.assertEqual(public_key_uuid, payload.public_key_uuid, msg)

        msg = "private_key_template_attribute decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            private_key_template_attribute,
            payload.private_key_template_attribute)
        self.assertEqual(private_key_template_attribute,
                         payload.private_key_template_attribute, msg)

        msg = "public_key_template_attribute decoding mismatch"
        msg += "; expected {0}, received {1}".format(
            public_key_template_attribute,
            payload.public_key_template_attribute)
        self.assertEqual(public_key_template_attribute,
                         payload.public_key_template_attribute, msg)

    def test_read_with_none(self):
        stream = self.encoding_empty
        payload = rekey_key_pair.RekeyKeyPairResponsePayload()

        self._test_read(stream, payload, self.empty_private_key_uuid,
                        self.empty_public_key_uuid, None, None)

    def test_read_with_args(self):
        stream = self.encoding_full
        payload = rekey_key_pair.RekeyKeyPairResponsePayload(
            self.private_key_uuid, self.public_key_uuid,
            self.private_key_template_attribute,
            self.public_key_template_attribute)

        self._test_read(stream, payload, self.private_key_uuid,
                        self.public_key_uuid,
                        self.private_key_template_attribute,
                        self.public_key_template_attribute)

    def _test_write(self, stream, payload, expected):
        payload.write(stream)

        length_expected = len(expected)
        length_received = len(stream)

        msg = "encoding lengths not equal"
        msg += "; expected {0}, received {1}".format(
            length_expected, length_received)
        self.assertEqual(length_expected, length_received, msg)

        msg = "encoding mismatch"
        msg += ";\nexpected:\n{0}\nreceived:\n{1}".format(expected, stream)

        self.assertEqual(expected, stream, msg)

    def test_write_with_none(self):
        stream = utils.BytearrayStream()
        payload = rekey_key_pair.RekeyKeyPairResponsePayload()

        self._test_write(stream, payload, self.encoding_empty)

    def test_write_with_args(self):
        stream = utils.BytearrayStream()
        payload = rekey_key_pair.RekeyKeyPairResponsePayload(
            self.private_key_uuid, self.public_key_uuid,
            self.private_key_template_attribute,
            self.public_key_template_attribute)

        self._test_write(stream, payload, self.encoding_full)


text:
package command

import (
	"flag"
	"github.com/mefellows/godspeed/godspeed"
	"github.com/mefellows/godspeed/log"
	"strings"
)

type DeployCommand struct {
	Meta Meta
}

func (pc *DeployCommand) Run(args []string) int {
	cmdFlags := flag.NewFlagSet("proxy", flag.ContinueOnError)
	cmdFlags.Usage = func() { pc.Meta.Ui.Output(pc.Help()) }
	c := &godspeed.GodspeedConfig{}

	cmdFlags.StringVar(&c.ConfigFile, "config", "", "Path to a YAML configuration file")

	// Validate
	if err := cmdFlags.Parse(args); err != nil {
		return 1
	}

	godspeed := godspeed.New(c)
	godspeed.Setup()

	log.Info("Performing Deployment...")

	for _, d := range godspeed.DeploymentStrategies {
		res := d.Deploy()
		if res != nil {
			d.Rollback()
		}
	}

	godspeed.Shutdown()

	return 0
}

func (c *DeployCommand) Help() string {
	helpText := `
Usage: godspeed deploy [options]

  Deploy application

Options:

  --config                    Location of Godspeed configuration file
`

	return strings.TrimSpace(helpText)
}

func (c *DeployCommand) Synopsis() string {
	return "Run the Godspeed deployer"
}


text:
package org.apache.pulsar.socks5.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.socksx.SocksVersion;
import io.netty.handler.codec.socksx.v5.DefaultSocks5InitialRequest;
import io.netty.handler.codec.socksx.v5.DefaultSocks5InitialResponse;
import io.netty.handler.codec.socksx.v5.Socks5AuthMethod;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.socks5.config.Socks5Config;

@Slf4j
public class InitialRequestHandler extends SimpleChannelInboundHandler<DefaultSocks5InitialRequest> {

    private final Socks5Config socks5Config;

    public InitialRequestHandler(final Socks5Config socks5Config) {
        this.socks5Config = socks5Config;
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, DefaultSocks5InitialRequest msg) throws Exception {
        if (SocksVersion.SOCKS5.equals(msg.version())) {
            if (msg.decoderResult().isFailure()) {
                log.warn("decode failure : {}", msg.decoderResult());
                ctx.fireChannelRead(msg);
            } else {
                if (socks5Config.isEnableAuth()) {
                    ctx.writeAndFlush(new DefaultSocks5InitialResponse(Socks5AuthMethod.PASSWORD));
                } else {
                    ctx.writeAndFlush(new DefaultSocks5InitialResponse(Socks5AuthMethod.NO_AUTH));
                }
            }
        }
    }

}


text:
#pragma once
#include <aws/macie2/Macie2_EXPORTS.h>
#include <aws/macie2/model/ListJobsSortAttributeName.h>
#include <aws/macie2/model/OrderBy.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Macie2
{
namespace Model
{

  /**
   *
Specifies criteria for sorting the results of a request for information about
   * classification jobs.

See Also:
   AWS
   * API Reference

   */
  class AWS_MACIE2_API ListJobsSortCriteria
  {
  public:
    ListJobsSortCriteria();
    ListJobsSortCriteria(Aws::Utils::Json::JsonView jsonValue);
    ListJobsSortCriteria& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The property to sort the results by.

     */
    inline const ListJobsSortAttributeName& GetAttributeName() const{ return m_attributeName; }

    /**
     *
The property to sort the results by.

     */
    inline bool AttributeNameHasBeenSet() const { return m_attributeNameHasBeenSet; }

    /**
     *
The property to sort the results by.

     */
    inline void SetAttributeName(const ListJobsSortAttributeName& value) { m_attributeNameHasBeenSet = true; m_attributeName = value; }

    /**
     *
The property to sort the results by.

     */
    inline void SetAttributeName(ListJobsSortAttributeName&& value) { m_attributeNameHasBeenSet = true; m_attributeName = std::move(value); }

    /**
     *
The property to sort the results by.

     */
    inline ListJobsSortCriteria& WithAttributeName(const ListJobsSortAttributeName& value) { SetAttributeName(value); return *this;}

    /**
     *
The property to sort the results by.

     */
    inline ListJobsSortCriteria& WithAttributeName(ListJobsSortAttributeName&& value) { SetAttributeName(std::move(value)); return *this;}

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline const OrderBy& GetOrderBy() const{ return m_orderBy; }

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline bool OrderByHasBeenSet() const { return m_orderByHasBeenSet; }

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline void SetOrderBy(const OrderBy& value) { m_orderByHasBeenSet = true; m_orderBy = value; }

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline void SetOrderBy(OrderBy&& value) { m_orderByHasBeenSet = true; m_orderBy = std::move(value); }

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline ListJobsSortCriteria& WithOrderBy(const OrderBy& value) { SetOrderBy(value); return *this;}

    /**
     *
The sort order to apply to the results, based on the value for the property
     * specified by the attributeName property. Valid values are: ASC, sort the results
     * in ascending order; and, DESC, sort the results in descending order.

     */
    inline ListJobsSortCriteria& WithOrderBy(OrderBy&& value) { SetOrderBy(std::move(value)); return *this;}

  private:

    ListJobsSortAttributeName m_attributeName;
    bool m_attributeNameHasBeenSet = false;

    OrderBy m_orderBy;
    bool m_orderByHasBeenSet = false;
  };

} // namespace Model
} // namespace Macie2
} // namespace Aws