text:
import { alert } from 'vs/base/browser/ui/aria/aria';
import { createCancelablePromise } from 'vs/base/common/async';
import { CancellationToken } from 'vs/base/common/cancellation';
import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import * as platform from 'vs/base/common/platform';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorAction, IActionOptions, registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import * as corePosition from 'vs/editor/common/core/position';
import { Range, IRange } from 'vs/editor/common/core/range';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ITextModel, IWordAtPosition } from 'vs/editor/common/model';
import { LocationLink, Location, isLocationLink } from 'vs/editor/common/modes';
import { MessageController } from 'vs/editor/contrib/message/messageController';
import { PeekContext } from 'vs/editor/contrib/referenceSearch/peekViewWidget';
import { ReferencesController } from 'vs/editor/contrib/referenceSearch/referencesController';
import { ReferencesModel } from 'vs/editor/contrib/referenceSearch/referencesModel';
import * as nls from 'vs/nls';
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getDeclarationsAtPosition } from './goToDefinition';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';

export class DefinitionActionConfig {

	constructor(
		public readonly openToSide = false,
		public readonly openInPeek = false,
		public readonly filterCurrent = true,
		public readonly showMessage = true,
	) {
		//
	}
}

export class DefinitionAction extends EditorAction {

	private readonly _configuration: DefinitionActionConfig;

	constructor(configuration: DefinitionActionConfig, opts: IActionOptions) {
		super(opts);
		this._configuration = configuration;
	}

	public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise<void> {
		if (!editor.hasModel()) {
			return Promise.resolve(undefined);
		}
		const notificationService = accessor.get(INotificationService);
		const editorService = accessor.get(ICodeEditorService);
		const progressService = accessor.get(IProgressService);

		const model = editor.getModel();
		const pos = editor.getPosition();

		const definitionPromise = this._getTargetLocationForPosition(model, pos, CancellationToken.None).then(async references => {

			if (model.isDisposed() || editor.getModel() !== model) {
				// new model, no more model
				return;
			}

			// * remove falsy references
			// * find reference at the current pos
			let idxOfCurrent = -1;
			const result: LocationLink[] = [];
			for (const reference of references) {
				if (!reference || !reference.range) {
					continue;
				}
				const newLen = result.push(reference);
				if (this._configuration.filterCurrent
					&& reference.uri.toString() === model.uri.toString()
					&& Range.containsPosition(reference.range, pos)
					&& idxOfCurrent === -1
				) {
					idxOfCurrent = newLen - 1;
				}
			}

			if (result.length === 0) {
				// no result -> show message
				if (this._configuration.showMessage) {
					const info = model.getWordAtPosition(pos);
					MessageController.get(editor).showMessage(this._getNoResultFoundMessage(info), pos);
				}
			} else if (result.length === 1 && idxOfCurrent !== -1) {
				// only the position at which we are -> adjust selection
				let [current] = result;
				return this._openReference(editor, editorService, current, false).then(() => undefined);

			} else {
				// handle multile results
				return this._onResult(editorService, editor, new ReferencesModel(result));
			}

		}, (err) => {
			// report an error
			notificationService.error(err);
		});

		progressService.showWhile(definitionPromise, 250);
		return definitionPromise;
	}

	protected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {
		return getDefinitionsAtPosition(model, position, token);
	}

	protected _getNoResultFoundMessage(info: IWordAtPosition | null): string {
		return info && info.word
			? nls.localize('noResultWord', "No definition found for '{0}'", info.word)
			: nls.localize('generic.noResults', "No definition found");
	}

	protected _getMetaTitle(model: ReferencesModel): string {
		return model.references.length > 1 ? nls.localize('meta.title', " – {0} definitions", model.references.length) : '';
	}

	private async _onResult(editorService: ICodeEditorService, editor: ICodeEditor, model: ReferencesModel): Promise<void> {

		const msg = model.getAriaMessage();
		alert(msg);

		if (this._configuration.openInPeek || model.references.length > 1) {
			this._openInPeek(editorService, editor, model);
		} else if (editor.hasModel()) {
			const next = model.nearestReference(editor.getModel().uri, editor.getPosition());
			if (next) {
				await this._openReference(editor, editorService, next, this._configuration.openToSide);
				model.dispose();
			}
		}
	}

	private _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise<ICodeEditor | null> {
		// range is the target-selection-range when we have one
		// and the the fallback is the 'full' range
		let range: IRange | undefined = undefined;
		if (isLocationLink(reference)) {
			range = reference.targetSelectionRange;
		}
		if (!range) {
			range = reference.range;
		}

		return editorService.openCodeEditor({
			resource: reference.uri,
			options: {
				selection: Range.collapseToStart(range),
				revealIfOpened: true,
				revealInCenterIfOutsideViewport: true
			}
		}, editor, sideBySide);
	}

	private _openInPeek(editorService: ICodeEditorService, target: ICodeEditor, model: ReferencesModel) {
		let controller = ReferencesController.get(target);
		if (controller) {
			controller.toggleWidget(target.getSelection(), createCancelablePromise(_ => Promise.resolve(model)), {
				getMetaTitle: (model) => {
					return this._getMetaTitle(model);
				},
				onGoto: (reference) => {
					controller.closeWidget();
					return this._openReference(target, editorService, reference, false);
				}
			});
		} else {
			model.dispose();
		}
	}
}

const goToDefinitionKb = platform.isWeb
	? KeyMod.CtrlCmd | KeyCode.F12
	: KeyCode.F12;

export class GoToDefinitionAction extends DefinitionAction {

	static readonly id = 'editor.action.revealDefinition';

	constructor() {
		super(new DefinitionActionConfig(), {
			id: GoToDefinitionAction.id,
			label: nls.localize('actions.goToDecl.label', "Go to Definition"),
			alias: 'Go to Definition',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasDefinitionProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: goToDefinitionKb,
				weight: KeybindingWeight.EditorContrib
			},
			menuOpts: {
				group: 'navigation',
				order: 1.1
			}
		});
		CommandsRegistry.registerCommandAlias('editor.action.goToDeclaration', GoToDefinitionAction.id);
	}
}

export class OpenDefinitionToSideAction extends DefinitionAction {

	static readonly id = 'editor.action.revealDefinitionAside';

	constructor() {
		super(new DefinitionActionConfig(true), {
			id: OpenDefinitionToSideAction.id,
			label: nls.localize('actions.goToDeclToSide.label', "Open Definition to the Side"),
			alias: 'Open Definition to the Side',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasDefinitionProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDefinitionKb),
				weight: KeybindingWeight.EditorContrib
			}
		});
		CommandsRegistry.registerCommandAlias('editor.action.openDeclarationToTheSide', OpenDefinitionToSideAction.id);
	}
}

export class PeekDefinitionAction extends DefinitionAction {

	static readonly id = 'editor.action.peekDefinition';

	constructor() {
		super(new DefinitionActionConfig(undefined, true, false), {
			id: PeekDefinitionAction.id,
			label: nls.localize('actions.previewDecl.label', "Peek Definition"),
			alias: 'Peek Definition',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasDefinitionProvider,
				PeekContext.notInPeekEditor,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: KeyMod.Alt | KeyCode.F12,
				linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 },
				weight: KeybindingWeight.EditorContrib
			},
			menuOpts: {
				group: 'navigation',
				order: 1.2
			}
		});
		CommandsRegistry.registerCommandAlias('editor.action.previewDeclaration', PeekDefinitionAction.id);
	}
}

export class DeclarationAction extends DefinitionAction {

	protected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {
		return getDeclarationsAtPosition(model, position, token);
	}

	protected _getNoResultFoundMessage(info: IWordAtPosition | null): string {
		return info && info.word
			? nls.localize('decl.noResultWord', "No declaration found for '{0}'", info.word)
			: nls.localize('decl.generic.noResults', "No declaration found");
	}

	protected _getMetaTitle(model: ReferencesModel): string {
		return model.references.length > 1 ? nls.localize('decl.meta.title', " – {0} declarations", model.references.length) : '';
	}
}

export class GoToDeclarationAction extends DeclarationAction {

	static readonly id = 'editor.action.revealDeclaration';

	constructor() {
		super(new DefinitionActionConfig(), {
			id: GoToDeclarationAction.id,
			label: nls.localize('actions.goToDeclaration.label', "Go to Declaration"),
			alias: 'Go to Declaration',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasDeclarationProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			menuOpts: {
				group: 'navigation',
				order: 1.3
			}
		});
	}

	protected _getNoResultFoundMessage(info: IWordAtPosition | null): string {
		return info && info.word
			? nls.localize('decl.noResultWord', "No declaration found for '{0}'", info.word)
			: nls.localize('decl.generic.noResults', "No declaration found");
	}

	protected _getMetaTitle(model: ReferencesModel): string {
		return model.references.length > 1 ? nls.localize('decl.meta.title', " – {0} declarations", model.references.length) : '';
	}
}

export class PeekDeclarationAction extends DeclarationAction {
	constructor() {
		super(new DefinitionActionConfig(undefined, true, false), {
			id: 'editor.action.peekDeclaration',
			label: nls.localize('actions.peekDecl.label', "Peek Declaration"),
			alias: 'Peek Declaration',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasDeclarationProvider,
				PeekContext.notInPeekEditor,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			menuOpts: {
				group: 'navigation',
				order: 1.31
			}
		});
	}
}

export class ImplementationAction extends DefinitionAction {
	protected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {
		return getImplementationsAtPosition(model, position, token);
	}

	protected _getNoResultFoundMessage(info: IWordAtPosition | null): string {
		return info && info.word
			? nls.localize('goToImplementation.noResultWord', "No implementation found for '{0}'", info.word)
			: nls.localize('goToImplementation.generic.noResults', "No implementation found");
	}

	protected _getMetaTitle(model: ReferencesModel): string {
		return model.references.length > 1 ? nls.localize('meta.implementations.title', " – {0} implementations", model.references.length) : '';
	}
}

export class GoToImplementationAction extends ImplementationAction {

	public static readonly ID = 'editor.action.goToImplementation';

	constructor() {
		super(new DefinitionActionConfig(), {
			id: GoToImplementationAction.ID,
			label: nls.localize('actions.goToImplementation.label', "Go to Implementation"),
			alias: 'Go to Implementation',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasImplementationProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: KeyMod.CtrlCmd | KeyCode.F12,
				weight: KeybindingWeight.EditorContrib
			}
		});
	}
}

export class PeekImplementationAction extends ImplementationAction {

	public static readonly ID = 'editor.action.peekImplementation';

	constructor() {
		super(new DefinitionActionConfig(false, true, false), {
			id: PeekImplementationAction.ID,
			label: nls.localize('actions.peekImplementation.label', "Peek Implementation"),
			alias: 'Peek Implementation',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasImplementationProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12,
				weight: KeybindingWeight.EditorContrib
			}
		});
	}
}

export class TypeDefinitionAction extends DefinitionAction {
	protected _getTargetLocationForPosition(model: ITextModel, position: corePosition.Position, token: CancellationToken): Promise<LocationLink[]> {
		return getTypeDefinitionsAtPosition(model, position, token);
	}

	protected _getNoResultFoundMessage(info: IWordAtPosition | null): string {
		return info && info.word
			? nls.localize('goToTypeDefinition.noResultWord', "No type definition found for '{0}'", info.word)
			: nls.localize('goToTypeDefinition.generic.noResults', "No type definition found");
	}

	protected _getMetaTitle(model: ReferencesModel): string {
		return model.references.length > 1 ? nls.localize('meta.typeDefinitions.title', " – {0} type definitions", model.references.length) : '';
	}
}

export class GoToTypeDefinitionAction extends TypeDefinitionAction {

	public static readonly ID = 'editor.action.goToTypeDefinition';

	constructor() {
		super(new DefinitionActionConfig(), {
			id: GoToTypeDefinitionAction.ID,
			label: nls.localize('actions.goToTypeDefinition.label', "Go to Type Definition"),
			alias: 'Go to Type Definition',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasTypeDefinitionProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: 0,
				weight: KeybindingWeight.EditorContrib
			},
			menuOpts: {
				group: 'navigation',
				order: 1.4
			}
		});
	}
}

export class PeekTypeDefinitionAction extends TypeDefinitionAction {

	public static readonly ID = 'editor.action.peekTypeDefinition';

	constructor() {
		super(new DefinitionActionConfig(false, true, false), {
			id: PeekTypeDefinitionAction.ID,
			label: nls.localize('actions.peekTypeDefinition.label', "Peek Type Definition"),
			alias: 'Peek Type Definition',
			precondition: ContextKeyExpr.and(
				EditorContextKeys.hasTypeDefinitionProvider,
				EditorContextKeys.isInEmbeddedEditor.toNegated()),
			kbOpts: {
				kbExpr: EditorContextKeys.editorTextFocus,
				primary: 0,
				weight: KeybindingWeight.EditorContrib
			}
		});
	}
}

registerEditorAction(GoToDefinitionAction);
registerEditorAction(OpenDefinitionToSideAction);
registerEditorAction(PeekDefinitionAction);
registerEditorAction(GoToDeclarationAction);
registerEditorAction(PeekDeclarationAction);
registerEditorAction(GoToImplementationAction);
registerEditorAction(PeekImplementationAction);
registerEditorAction(GoToTypeDefinitionAction);
registerEditorAction(PeekTypeDefinitionAction);

// Go to menu
MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
	group: '4_symbol_nav',
	command: {
		id: 'editor.action.goToDeclaration',
		title: nls.localize({ key: 'miGotoDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Definition")
	},
	order: 2
});

MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
	group: '4_symbol_nav',
	command: {
		id: 'editor.action.goToTypeDefinition',
		title: nls.localize({ key: 'miGotoTypeDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Type Definition")
	},
	order: 3
});

MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
	group: '4_symbol_nav',
	command: {
		id: 'editor.action.goToImplementation',
		title: nls.localize({ key: 'miGotoImplementation', comment: ['&& denotes a mnemonic'] }, "Go to &&Implementation")
	},
	order: 4
});


text:
namespace ui {

class PageFlipObserver {
 public:
  virtual ~PageFlipObserver() {}

  virtual void OnPageFlipEvent() = 0;
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_DRI_PAGE_FLIP_OBSERVER_H_

redpajama_set_name: RedPajamaGithub


text:
<?php

 include_once 'conexao.php';

 class Emprestar{

     protected $id_cliente;
     protected $nome;
     protected $email;
     protected $senha;
     protected $sexo;
     protected $telefone;
     protected $endereco;
     protected $status;

     /**
      * @return mixed
      */
     public function getIdCliente()
     {
         return $this->id_cliente;
     }

     /**
      * @param mixed $id_cliente
      */
     public function setIdCliente($id_cliente)
     {
         $this->id_cliente = $id_cliente;
     }

     /**
      * @return mixed
      */
     public function getNome()
     {
         return $this->nome;
     }

     /**
      * @param mixed $nome
      */
     public function setNome($nome)
     {
         $this->nome = $nome;
     }

     /**
      * @return mixed
      */
     public function getEmail()
     {
         return $this->email;
     }

     /**
      * @param mixed $email
      */
     public function setEmail($email)
     {
         $this->email = $email;
     }

     /**
      * @return mixed
      */
     public function getSenha()
     {
         return $this->senha;
     }

     /**
      * @param mixed $senha
      */
     public function setSenha($senha)
     {
         $this->senha = $senha;
     }

     /**
      * @return mixed
      */
     public function getSexo()
     {
         return $this->sexo;
     }

     /**
      * @param mixed $sexo
      */
     public function setSexo($sexo)
     {
         $this->sexo = $sexo;
     }

     /**
      * @return mixed
      */
     public function getTelefone()
     {
         return $this->telefone;
     }

     /**
      * @param mixed $telefone
      */
     public function setTelefone($telefone)
     {
         $this->telefone = $telefone;
     }

     /**
      * @return mixed
      */
     public function getEndereco()
     {
         return $this->endereco;
     }

     /**
      * @param mixed $endereco
      */
     public function setEndereco($endereco)
     {
         $this->endereco = $endereco;
     }

     /**
      * @return mixed
      */
     public function getStatus()
     {
         return $this->status;
     }

     /**
      * @param mixed $status
      */
     public function setStatus($status)
     {
         $this->status = $status;
     }

 public function cadastrar($dados){

  $id_cliente = $dados['id_cliente'];
  $id_livros = $dados['id_livros'];
  $devolucao = $dados['devolucao'];

   $sql = "INSERT INTO emprestimos (id_cliente, dia_emprestimo, dia_devolucao) VALUES ('$id_cliente', now(), '$devolucao')";
   $conexao = new Conexao();
   $id_emprestimos = $conexao->executar2($sql);

   foreach ($id_livros as $livros) {

   	$sql2 = "INSERT INTO livros_emprestimos VALUES ('{$livros}', '$id_emprestimos')";
   	$resultado = $conexao->executar($sql2);

   }

   return $resultado;

 }

 public function devolver($id_livros, $id_emprestimos){

      $sql = "delete from livros_emprestimos where id_livros = '$id_livros' and id_emprestimos = '$id_emprestimos'";
      $conexao = new Conexao();
      $conexao->executar($sql);

      $sql2 = "UPDATE livros SET quant = quant + 1 WHERE id_livros = $id_livros";
      return $conexao->executar($sql2);

 }

     public function listarEmprestados($id_cliente){

     $sql = "select * from view_emprestimos where id_cliente = '$id_cliente'";
     $conexao = new Conexao();

     return $conexao->recuperarTodos($sql);

 }

  public function quantidade($id_cliente){

     $sql = "select count(*) as quantidade from view_emprestimos where id_cliente = '$id_cliente'";
     $conexao = new Conexao();

     return $conexao->recuperarTodos($sql);

 }

  public function listarLivros(){

     $sql = "select * from livros WHERE quant >= 1 ";
     $conexao = new Conexao();

     return $conexao->recuperarTodos($sql);

 }

     public function recuperarClientes(){

         $sql = "select * from cliente where status = '1'";
         $conexao = new Conexao();
         return $conexao->recuperarTodos($sql);

     }

     public function recuperarInativos(){

         $sql = "select * from cliente where status = '0'";
         $conexao = new Conexao();
         return $conexao->recuperarTodos($sql);

     }

     public function carregarPorId($id_cliente)
     {
         $sql = "select * from cliente where id_cliente = '$id_cliente'";
         $conexao = new Conexao();
         $dados = $conexao->recuperarTodos($sql);
         $this->id_cliente = $dados[0]['id_cliente'];
         $this->nome = $dados[0]['nome'];
         $this->email = $dados[0]['email'];
         $this->senha = $dados[0]['senha'];
         $this->sexo = $dados[0]['sexo'];
         $this->telefone = $dados[0]['telefone'];
         $this->endereco = $dados[0]['endereco'];
         $this->status = $dados[0]['status'];

     }

 }


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/test/mock_render_widget_host_delegate.h"

#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/display/screen.h"

namespace content {

MockRenderWidgetHostDelegate::MockRenderWidgetHostDelegate()
    : text_input_manager_(false /* should_do_learning */) {}

MockRenderWidgetHostDelegate::~MockRenderWidgetHostDelegate() = default;

void MockRenderWidgetHostDelegate::ResizeDueToAutoResize(
    RenderWidgetHostImpl* render_widget_host,
    const gfx::Size& new_size) {}

KeyboardEventProcessingResult
MockRenderWidgetHostDelegate::PreHandleKeyboardEvent(
    const NativeWebKeyboardEvent& event) {
  last_event_ = std::make_unique<NativeWebKeyboardEvent>(event);
  return pre_handle_keyboard_event_result_;
}

void MockRenderWidgetHostDelegate::ExecuteEditCommand(
    const std::string& command,
    const base::Optional<base::string16>& value) {}

void MockRenderWidgetHostDelegate::Undo() {}

void MockRenderWidgetHostDelegate::Redo() {}

void MockRenderWidgetHostDelegate::Cut() {}

void MockRenderWidgetHostDelegate::Copy() {}

void MockRenderWidgetHostDelegate::Paste() {}

void MockRenderWidgetHostDelegate::PasteAndMatchStyle() {}

void MockRenderWidgetHostDelegate::SelectAll() {}

void MockRenderWidgetHostDelegate::CreateInputEventRouter() {
  rwh_input_event_router_ =
      std::make_unique<RenderWidgetHostInputEventRouter>();
}

RenderWidgetHostInputEventRouter*
MockRenderWidgetHostDelegate::GetInputEventRouter() {
  return rwh_input_event_router_.get();
}

RenderWidgetHostImpl* MockRenderWidgetHostDelegate::GetFocusedRenderWidgetHost(
    RenderWidgetHostImpl* widget_host) {
  return !!focused_widget_ ? focused_widget_ : widget_host;
}

void MockRenderWidgetHostDelegate::SendScreenRects() {
  if (rwh_)
    rwh_->SendScreenRects();
}

TextInputManager* MockRenderWidgetHostDelegate::GetTextInputManager() {
  return &text_input_manager_;
}

bool MockRenderWidgetHostDelegate::IsFullscreenForCurrentTab() {
  return is_fullscreen_;
}

RenderViewHostDelegateView* MockRenderWidgetHostDelegate::GetDelegateView() {
  return &rvh_delegate_view_;
}

}  // namespace content


text:
require 'spec_helper'

describe 'osx::system::update::automatic_downloads' do
  describe('enabled') do
    let(:params) { {:ensure => 'present'} }
    it 'should set the value to true' do
      should contain_boxen__osx_defaults('Toggle Whether Software Updates are Downloaded in the Background when Available').with({
        :user   => 'root',
        :domain => 'AutomaticDownload',
        :key    => '/Library/Preferences/com.apple.SoftwareUpdate',
        :value  => true,
      })
    end
  end

  describe('disabled') do
    let(:params) { {:ensure => 'absent'} }
    it 'should set the value to false' do
      should contain_boxen__osx_defaults('Toggle Whether Software Updates are Downloaded in the Background when Available').with({
        :user   => 'root',
        :domain => 'AutomaticDownload',
        :key    => '/Library/Preferences/com.apple.SoftwareUpdate',
        :value  => false,
      })
    end
  end

end


text:
using System;

namespace Azure.AI.FormRecognizer.Models
{
    /// <summary> Request parameter that contains authorization claims for copy operation. </summary>
    internal partial class CopyAuthorizationResult
    {
        /// <summary> Initializes a new instance of CopyAuthorizationResult. </summary>
        /// <param name="modelId"> Model identifier. </param>
        /// <param name="accessToken"> Token claim used to authorize the request. </param>
        /// <param name="expirationDateTimeTicks"> The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="modelId"/> or <paramref name="accessToken"/> is null. </exception>
        public CopyAuthorizationResult(string modelId, string accessToken, long expirationDateTimeTicks)
        {
            if (modelId == null)
            {
                throw new ArgumentNullException(nameof(modelId));
            }
            if (accessToken == null)
            {
                throw new ArgumentNullException(nameof(accessToken));
            }

            ModelId = modelId;
            AccessToken = accessToken;
            ExpirationDateTimeTicks = expirationDateTimeTicks;
        }

        /// <summary> Model identifier. </summary>
        public string ModelId { get; set; }
        /// <summary> Token claim used to authorize the request. </summary>
        public string AccessToken { get; set; }
        /// <summary> The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. </summary>
        public long ExpirationDateTimeTicks { get; set; }
    }
}


text:
layout: post
title: "Social Meta Tags"
date: 2015-02-09 19:33:48
image: '/assets/img/dica-rapida-2/main.png'
description: 'Aprenda como ser mais social, ter maior relevância nas redes sociais e atrair mais usuários.'
main-class: 'html'
color: '#EB7728'
tags:
- social
- seo
- tutorial
categories:
twitter_text: 'Aprenda a usar as meta tags sociais.'
introduction: "Aprenda como ser mais social, ter maior relevância nas redes sociais e atrair mais usuários. Para isso, basta criar as meta tags corretas."
---

## Introdução

Estou aqui de novo para mais uma **#dicarapida** sobre um assunto que é bastante importante, mas muita gente esquece ou não faz de forma correta, que são as Meta Tags Sociais.

Hoje em dia, as redes sociais são fundamentais para que a gente consiga alcançar um maior número de pessoas. Antes isso ficava mais a cargo das pesquisas orgânicas, ads e outros modelos de divulgação (email marketing, spots de rádio, tv, etc).

No meu blog, muito do acesso é dado pelas redes sociais, sendo o facebook o maior propagador, acho que é porque sigo os passos do [Fernando Daciuk](http://blog.da2k.com.br/) e mando spam para todos os grupos do face =p

Segue o gráfico abaixo, indicando as origens de acessos do meu blog:

![Gráfico de Acessos do Blog por Origem](/assets/img/dica-rapida-2/canais.png)

## Mas e por que dessa tal de Meta Tag?

Cada rede social possui um conjunto de informações para serem lidas e elas serão enviadas do seu site para as redes através dessas Meta Tags. Isso que permite que as redes leiam seu link e já preencham o post de informações. Elas podem ser visíveis para os outros usuários, como: imagem, título, descrição, hiperlink. Mas também podem ser informações somente para análise da rede social, como o tipo do site (blog, website, ecommerce), autor, hora de publicação, tags e etc.

## Facebook

A maior rede social que temos hoje possui um conjunto de informações que é o chamado [Open Graph](https://developers.facebook.com/docs/sharing/best-practices?locale=pt_BR). A partir dela conseguimos organizar bastante as informações e inclusive fazer uma análise do nosso site utilizando o Facebook Insights.

Existem vários tipos de Meta Tags que o Open Graph suporta e todas elas são sempre iniciadas com o prefixo `og:`, caso queira saber todas que tem, basta dar uma olhada lá no site do [Open Graph](https://developers.facebook.com/docs/sharing/best-practices#tags).

Abaixo seguem algumas das tags principais, das quais inclusive utilizo no meu blog:

{% highlight html %}
<!-- Social: Facebook / Open Graph -->
<meta property="fb:admins" content="id do seu fb insight">
<meta property="og:url" content="url do seu site">
<meta property="og:type" content="tipo do link, article, page, etc">
<meta property="og:title" content="título do site">
<meta property="og:image" content="imagem do site (LINK ABSOLUTO)">
<meta property="og:description" content="breve descrição">
<meta property="og:site_name" content="Nome do site">
<meta property="article:author" content="fb de quem escreveu">
<meta property="article:publisher" content="fb de quem publicou">
<meta property="article:published_time" content="momento de publicação">
<meta property="article:tag" content="tag1">
<meta property="article:tag" content="tag2">
{% endhighlight %}

Tendo esse conjunto de informações, quando você for colocar seu link em algum lugar do facebook, ele vai ler as informações e colocar semelhante a imagem abaixo:

![Imagem de um post no Facebook](/assets/img/dica-rapida-2/face-post.png)

**AVISO:** o facebook é uma bosta para ler seus links corretamente, portanto, utilize a ferramenta de [debug](https://developers.facebook.com/tools/debug/og/object/), para que ele possa ler os dados e identificar se está tudo certinho. Lembre-se também de seguir as regras do facebook, como, por exemplo, tamanhos de imagem e dados passados.

## Twitter

Outra grande rede social, um pouco mais simples, mas que também permite carregar certas informações. Esses dados são chamados de Twitter Cards e são iniciados com o prefixo `twitter:`. Para saber um pouquinho mais, [leia a documentação deles](https://dev.twitter.com/cards/overview)

Seguem as tags básicas:

{% highlight html %}
<!-- Social: Twitter -->
<meta name="twitter:card" content="summary_large_image"> <!-- aqui fica o tipo de card -->
<meta name="twitter:site" content="@willian_justen"> <!-- twitter handler do site -->
<meta name="twitter:title" content="Título do Post">
<meta name="twitter:description" content="Descrição do post">
<meta property="twitter:image:src" content="link da imagem">
{% endhighlight %}

Para que o twitter passe a aceitar seus cards, você precisa validar [neste link aqui](https://cards-dev.twitter.com/validator). Após validado, quando você postar algum link do seu site, ele será visualizado conforme a imagem abaixo:

![Imagem de um post no twitter](/assets/img/dica-rapida-2/twitter-post.png)

## Google Plus

Por último, mas não menos importante, vem o Google Plus. Apesar de muita gente achar inútil, ele tem uma indexação excelente e por ser do google, muitas vezes é favorecido, portanto, não vamos esquecer dele =p

Ele segue o padrão do [Schema.org](http://schema.org/) e seguem abaixo as tags:

{% highlight html %}
<link rel="author" href="google plus do autor">
<!-- Social: Google+ / Schema.org  -->
<meta itemprop="name" content="Título da página">
<meta itemprop="description" content="Pequena descrição">
<meta itemprop="image" content="imagem da página">
{% endhighlight %}

## Conclusão

Com isso fecho a **#dicarapida** de hoje, espero que tenham entendido a importância dessas meta tags e consigam mais relevância em suas postagens e/ou sites. Se tiverem alguma dúvida ou alguma informação a acrescentar, só falar nos comentários logo abaixo =)


text:
namespace PH_DirectInput
{
	class CInputManager
	{
	public:
		enum BINDINGTYPE
		{
			BINDING_UNBOUND = 0,
			BINDING_SIMPLE = 1,
			BINDING_SIMULATEDAXIS = 2,
			BINDING_POVHAT = 3,
		};

		struct BINDINGINFO
		{
			BINDINGINFO() = default;
			BINDINGINFO(const GUID& device, uint32 id) : device(device), id(id) { }
			GUID		device;
			uint32		id = 0;
		};

		class CBinding
		{
		public:
			virtual							~CBinding() {};

			virtual BINDINGTYPE				GetBindingType() const = 0;

			virtual std::tstring			GetDescription(Framework::DirectInput::CManager*) const = 0;
			virtual void					ProcessEvent(const GUID&, uint32, uint32) = 0;

			virtual uint32					GetValue() const = 0;
			virtual void					SetValue(uint32) = 0;

			virtual void					Save(Framework::CConfig&, const char*) const = 0;
			virtual void					Load(Framework::CConfig&, const char*) = 0;
		};

		class CSimpleBinding : public CBinding
		{
		public:
											CSimpleBinding(const GUID& = GUID(), uint32 = 0);
			virtual							~CSimpleBinding();

			static void						RegisterPreferences(Framework::CConfig&, const char*);

			virtual BINDINGTYPE				GetBindingType() const override;

			virtual std::tstring			GetDescription(Framework::DirectInput::CManager*) const override;
			virtual void					ProcessEvent(const GUID&, uint32, uint32) override;

			virtual uint32					GetValue() const override;
			virtual void					SetValue(uint32) override;

			virtual void					Save(Framework::CConfig&, const char*) const override;
			virtual void					Load(Framework::CConfig&, const char*) override;

		private:
			BINDINGINFO						m_binding;
			uint32							m_value = 0;
		};

		class CPovHatBinding : public CBinding
		{
		public:
											CPovHatBinding(const GUID& = GUID(), uint32 = 0, uint32 = -1);
			virtual							~CPovHatBinding();

			static void						RegisterPreferences(Framework::CConfig&, const char*);

			virtual BINDINGTYPE				GetBindingType() const override;

			virtual std::tstring			GetDescription(Framework::DirectInput::CManager*) const override;
			virtual void					ProcessEvent(const GUID&, uint32, uint32) override;

			virtual uint32					GetValue() const override;
			virtual void					SetValue(uint32) override;

			virtual void					Save(Framework::CConfig&, const char*) const override;
			virtual void					Load(Framework::CConfig&, const char*) override;

		private:
			static int32					GetShortestDistanceBetweenAngles(int32, int32);

			BINDINGINFO						m_binding;
			uint32							m_refValue = 0;
			uint32							m_value = 0;
		};

		class CSimulatedAxisBinding : public CBinding
		{
		public:
											CSimulatedAxisBinding(const BINDINGINFO& = BINDINGINFO(), const BINDINGINFO& = BINDINGINFO());
			virtual							~CSimulatedAxisBinding();

			static void						RegisterPreferences(Framework::CConfig&, const char*);

			virtual BINDINGTYPE				GetBindingType() const override;

			virtual std::tstring			GetDescription(Framework::DirectInput::CManager*) const override;
			virtual void					ProcessEvent(const GUID&, uint32, uint32) override;

			virtual uint32					GetValue() const override;
			virtual void					SetValue(uint32) override;

			virtual void					Save(Framework::CConfig&, const char*) const override;
			virtual void					Load(Framework::CConfig&, const char*) override;

		private:
			static void						RegisterKeyBindingPreferences(Framework::CConfig&, const char*);
			void							SaveKeyBinding(Framework::CConfig&, const char*, const BINDINGINFO&) const;
			void							LoadKeyBinding(Framework::CConfig&, const char*, BINDINGINFO&);

			BINDINGINFO						m_key1Binding;
			BINDINGINFO						m_key2Binding;

			uint32							m_key1State = 0;
			uint32							m_key2State = 0;
		};

											CInputManager(HWND, Framework::CConfig&);
		virtual								~CInputManager();

		uint32								GetBindingValue(PS2::CControllerInfo::BUTTON) const;
		void								ResetBindingValues();

		const CBinding*						GetBinding(PS2::CControllerInfo::BUTTON) const;
		void								SetSimpleBinding(PS2::CControllerInfo::BUTTON, const BINDINGINFO&);
		void								SetPovHatBinding(PS2::CControllerInfo::BUTTON, const BINDINGINFO&, uint32);
		void								SetSimulatedAxisBinding(PS2::CControllerInfo::BUTTON, const BINDINGINFO&, const BINDINGINFO&);

		void								Load();
		void								Save();
		void								AutoConfigureKeyboard();

		Framework::DirectInput::CManager*	GetDirectInputManager() const;
		std::tstring						GetBindingDescription(PS2::CControllerInfo::BUTTON) const;

	private:
		typedef std::shared_ptr<CBinding> BindingPtr;

		void								OnInputEventReceived(const GUID&, uint32, uint32);

		static std::tstring					GetBindingInfoDescription(Framework::DirectInput::CManager*, const BINDINGINFO&);

		BindingPtr							m_bindings[PS2::CControllerInfo::MAX_BUTTONS];
		static uint32						m_buttonDefaultValue[PS2::CControllerInfo::MAX_BUTTONS];

		Framework::DirectInput::CManager*	m_directInputManager;
		Framework::CConfig&					m_config;
	};
}


text:
<?php

namespace Venyii\HipChatCommander\Test\Package\Crypt;

use Venyii\HipChatCommander\Api\Response;
use Venyii\HipChatCommander\WebTestCase;

class PackageTest extends WebTestCase
{
    private static $plainData = 'encrypt_it';

    /**
     * @return array
     */
    public static function dataProviderCrypts()
    {
        return [
            'encryptMd5' => [
                'encrypt',
                'md5',
                self::$plainData,
                md5(self::$plainData),
            ],
            'encryptSha256' => [
                'encrypt',
                'sha256',
                self::$plainData,
                hash('sha256', self::$plainData),
            ],
            'encryptSha512' => [
                'encrypt',
                'sha512',
                self::$plainData,
                hash('sha512', self::$plainData),
            ],
            'encryptBase64' => [
                'encrypt',
                'base64',
                self::$plainData,
                base64_encode(self::$plainData),
            ],
            'decryptBase64' => [
                'decrypt',
                'base64',
                base64_encode(self::$plainData),
                self::$plainData,
            ],
        ];
    }

    /**
     * @param string $cmd
     * @param string $type
     * @param string $tbdCryptString
     * @param string $resultCryptString
     *
     * @dataProvider dataProviderCrypts
     */
    public function testEncrypt($cmd, $type, $tbdCryptString, $resultCryptString)
    {
        $this->createTestConfig();

        $response = $this->request($this->buildDummyData(sprintf('/%s %s %s', $cmd, $type, $tbdCryptString)));

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('application/json', $response->headers->get('Content-Type'));

        $responseJson = json_decode($response->getContent(), true);

        $this->assertSame(sprintf('%s: %s', strtoupper($type), $resultCryptString), $responseJson['message']);
        $this->assertEquals(Response::FORMAT_TEXT, $responseJson['message_format']);
    }

    public function testDecryptUnsupportedCrypt()
    {
        $this->createTestConfig();

        $response = $this->request($this->buildDummyData('/decrypt md5 yolo'));

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('application/json', $response->headers->get('Content-Type'));

        $responseJson = json_decode($response->getContent(), true);

        $this->assertSame('(failed) Operation not supported!', $responseJson['message']);
        $this->assertEquals(Response::FORMAT_TEXT, $responseJson['message_format']);
    }

    public function testDecryptCorruptData()
    {
        $this->createTestConfig();

        $response = $this->request($this->buildDummyData('/decrypt base64 yo+lo'));

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('application/json', $response->headers->get('Content-Type'));

        $responseJson = json_decode($response->getContent(), true);

        $this->assertSame('(failed) Could not decrypt the base64 data.', $responseJson['message']);
        $this->assertEquals(Response::FORMAT_TEXT, $responseJson['message_format']);
    }

    /**
     * {@inheritdoc}
     */
    protected function getPackageName()
    {
        return 'encrypt';
    }

    /**
     * {@inheritdoc}
     */
    protected function getPackageClass()
    {
        return 'Venyii\HipChatCommander\Package\Crypt';
    }
}


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        src/gtk1/button.cpp
// Purpose:
// Author:      Robert Roebling
// Copyright:   (c) 1998 Robert Roebling
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#if wxUSE_BUTTON

#ifndef WX_PRECOMP
    #include "wx/button.h"
#endif

#include "wx/stockitem.h"

#include "wx/gtk1/private.h"
#include "wx/gtk1/win_gtk.h"

//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------

class wxButton;

//-----------------------------------------------------------------------------
// idle system
//-----------------------------------------------------------------------------

extern void wxapp_install_idle_handler();
extern bool g_isIdle;

//-----------------------------------------------------------------------------
// data
//-----------------------------------------------------------------------------

extern bool   g_blockEventsOnDrag;

//-----------------------------------------------------------------------------
// "clicked"
//-----------------------------------------------------------------------------

extern "C" {
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button )
{
    if (g_isIdle)
       wxapp_install_idle_handler();

    if (!button->m_hasVMT) return;
    if (g_blockEventsOnDrag) return;

    wxCommandEvent event(wxEVT_BUTTON, button->GetId());
    event.SetEventObject(button);
    button->HandleWindowEvent(event);
}
}

//-----------------------------------------------------------------------------
// "style_set" from m_widget
//-----------------------------------------------------------------------------

static gint
gtk_button_style_set_callback( GtkWidget *m_widget, GtkStyle *WXUNUSED(style), wxButton *win )
{
    if (g_isIdle)
        wxapp_install_idle_handler();

    int left_border = 0;
    int right_border = 0;
    int top_border = 0;
    int bottom_border = 0;

    /* the default button has a border around it */
    if (GTK_WIDGET_CAN_DEFAULT(m_widget))
    {
        left_border = 6;
        right_border = 6;
        top_border = 6;
        bottom_border = 5;
        win->DoMoveWindow( win->m_x-top_border,
                           win->m_y-left_border,
                           win->m_width+left_border+right_border,
                           win->m_height+top_border+bottom_border );
    }

    return FALSE;
}

//-----------------------------------------------------------------------------
// wxButton
//-----------------------------------------------------------------------------

wxButton::wxButton()
{
}

wxButton::~wxButton()
{
}

bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
      const wxPoint &pos, const wxSize &size,
      long style, const wxValidator& validator, const wxString &name )
{
    m_needParent = true;
    m_acceptsFocus = true;

    if (!PreCreation( parent, pos, size ) ||
        !CreateBase( parent, id, pos, size, style, validator, name ))
    {
        wxFAIL_MSG( wxT("wxButton creation failed") );
        return false;
    }

    m_widget = gtk_button_new_with_label("");

    float x_alignment = 0.5;
    if (HasFlag(wxBU_LEFT))
        x_alignment = 0.0;
    else if (HasFlag(wxBU_RIGHT))
        x_alignment = 1.0;

    float y_alignment = 0.5;
    if (HasFlag(wxBU_TOP))
        y_alignment = 0.0;
    else if (HasFlag(wxBU_BOTTOM))
        y_alignment = 1.0;

    if (GTK_IS_MISC(BUTTON_CHILD(m_widget)))
        gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)),
                                x_alignment, y_alignment);

    SetLabel(label);

    if (style & wxNO_BORDER)
       gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );

    gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked",
      GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this );

    gtk_signal_connect_after( GTK_OBJECT(m_widget), "style_set",
      GTK_SIGNAL_FUNC(gtk_button_style_set_callback), (gpointer*) this );

    m_parent->DoAddChild( this );

    PostCreation(size);

    return true;
}

wxWindow *wxButton::SetDefault()
{
    wxWindow *oldDefault = wxButtonBase::SetDefault();

    GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
    gtk_widget_grab_default( m_widget );

    // resize for default border
    gtk_button_style_set_callback( m_widget, NULL, this );

    return oldDefault;
}

/* static */
wxSize wxButtonBase::GetDefaultSize(wxWindow* WXUNUSED(win))
{
    return wxSize(80,26);
}

void wxButton::SetLabel( const wxString &lbl )
{
    wxCHECK_RET( m_widget != NULL, wxT("invalid button") );

    wxString label(lbl);

    if (label.empty() && wxIsStockID(m_windowId))
        label = wxGetStockLabel(m_windowId);

    wxControl::SetLabel(label);

    const wxString labelGTK = GTKRemoveMnemonics(label);

    gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV(labelGTK));
}

bool wxButton::Enable( bool enable )
{
    if ( !wxControl::Enable( enable ) )
        return false;

    gtk_widget_set_sensitive( BUTTON_CHILD(m_widget), enable );

    return true;
}

bool wxButton::IsOwnGtkWindow( GdkWindow *window )
{
    return (window == m_widget->window);
}

void wxButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
    gtk_widget_modify_style(m_widget, style);
    gtk_widget_modify_style(BUTTON_CHILD(m_widget), style);
}

wxSize wxButton::DoGetBestSize() const
{
    // the default button in wxGTK is bigger than the other ones because of an
    // extra border around it, but we don't want to take it into account in
    // our size calculations (otherwsie the result is visually ugly), so
    // always return the size of non default button from here
    const bool isDefault = GTK_WIDGET_HAS_DEFAULT(m_widget);
    if ( isDefault )
    {
        // temporarily unset default flag
        GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_DEFAULT );
    }

    wxSize ret( wxControl::DoGetBestSize() );

    if ( isDefault )
    {
        // set it back again
        GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
    }

    ret.x += 10;  // add a few pixels for sloppy (but common) themes

    if (!HasFlag(wxBU_EXACTFIT))
    {
        wxSize defaultSize = GetDefaultSize();
        if (ret.x < defaultSize.x) ret.x = defaultSize.x;
        if (ret.y < defaultSize.y) ret.y = defaultSize.y;
    }

    return ret;
}

// static
wxVisualAttributes
wxButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
    return GetDefaultAttributesFromGTKWidget(gtk_button_new);
}

#endif // wxUSE_BUTTON


text:
Survey administrators

    <form action="" id="survey-user-form">

Add a survey administrator

        <input type="text" placeholder="email" name="email" class="large">

        <button class="survey-users-add flex small">Add administrator</button>

Administrator added

We couldn't add that user.

    </form>


text:
# ember-cli-airbrake

ember-cli-airbrake is an  [Ember CLI](http://www.ember-cli.com/) addon for integrating the [Airbrake JS](https://github.com/airbrake/airbrake-js) error notifier into your app.

## Installation

`npm install --save-dev ember-cli-airbrake`

## Configuration

ember-cli-airbrake is configured per environment. If it isn't configured for a particular environment it will not be built into your ember application for that environment.

You must specify your `project_id` and `project_key` for ember-cli-airbrake to work. Your `project_id` can be found in the url of your project/ app error page.

If you are using [Errbit](https://github.com/errbit/errbit), the open-source, Airbrake API compatible error catcher, you must also set the host parameter to your errbit installation.

```javascript
// config/environment.js
module.exports = function(environment) {
  var ENV = {
    /* ... */

  if (environment === 'production') {
    ENV.airbrake = {
      projectId:  'my_project_id',
      projectKey: 'my_project_key'
      // host: 'http://errors.myapp.com/'
    };
  }

  return ENV;
};

```


text:
package io.igu.cityindex.authentication.model

case class LogOnResponse(session: String,
                         passwordChangeRequired: Boolean,
                         allowedAccountOperator: Boolean,
                         statusCode: Int,
                         additionalInfo: Option[String] = None) {

}


text:
@protocol CellForSuperProtocol <NSObject>

- (void)proctocolCell:(id)obj withInfo:(NSDictionary *)dic;

@end


text:
#import "RCTProfile.h"

#import <mach/mach.h>
#import <objc/message.h>
#import <objc/runtime.h>

#import <UIKit/UIKit.h>

#import "RCTAssert.h"
#import "RCTBridge.h"
#import "RCTDefines.h"
#import "RCTModuleData.h"
#import "RCTUtils.h"

NSString *const RCTProfileDidStartProfiling = @"RCTProfileDidStartProfiling";
NSString *const RCTProfileDidEndProfiling = @"RCTProfileDidEndProfiling";

#if RCT_DEV

#pragma mark - Constants

NSString const *RCTProfileTraceEvents = @"traceEvents";
NSString const *RCTProfileSamples = @"samples";
NSString *const RCTProfilePrefix = @"rct_profile_";

#pragma mark - Variables

NSDictionary *RCTProfileInfo;
NSUInteger RCTProfileEventID = 0;
NSMutableDictionary *RCTProfileOngoingEvents;
NSTimeInterval RCTProfileStartTime;
NSRecursiveLock *_RCTProfileLock;

#pragma mark - Macros

#define RCTProfileAddEvent(type, props...) \
[RCTProfileInfo[type] addObject:@{ \
  @"pid": @([[NSProcessInfo processInfo] processIdentifier]), \
  @"tid": RCTCurrentThreadName(), \
  props \
}];

#define CHECK(...) \
if (!RCTProfileIsProfiling()) { \
  return __VA_ARGS__; \
}

#define RCTProfileLock(...) \
[_RCTProfileLock lock]; \
__VA_ARGS__ \
[_RCTProfileLock unlock]

#pragma mark - Private Helpers

static NSNumber *RCTProfileTimestamp(NSTimeInterval timestamp)
{
  return @((timestamp - RCTProfileStartTime) * 1e6);
}

static NSString *RCTProfileMemory(vm_size_t memory)
{
  double mem = ((double)memory) / 1024 / 1024;
  return [NSString stringWithFormat:@"%.2lfmb", mem];
}

static NSDictionary *RCTProfileGetMemoryUsage(void)
{
  struct task_basic_info info;
  mach_msg_type_number_t size = sizeof(info);
  kern_return_t kerr = task_info(mach_task_self(),
                                 TASK_BASIC_INFO,
                                 (task_info_t)&info,
                                 &size);
  if( kerr == KERN_SUCCESS ) {
    return @{
      @"suspend_count": @(info.suspend_count),
      @"virtual_size": RCTProfileMemory(info.virtual_size),
      @"resident_size": RCTProfileMemory(info.resident_size),
    };
  } else {
    return @{};
  }
}

static NSDictionary *RCTProfileMergeArgs(NSDictionary *args0, NSDictionary *args1)
{
  args0 = RCTNilIfNull(args0);
  args1 = RCTNilIfNull(args1);

  if (!args0 && args1) {
    args0 = args1;
  } else if (args0 && args1) {
    NSMutableDictionary *d = [args0 mutableCopy];
    [d addEntriesFromDictionary:args1];
    args0 = [d copy];
  }

  return RCTNullIfNil(args0);
}

#pragma mark - Module hooks

static const char *RCTProfileProxyClassName(Class);
static const char *RCTProfileProxyClassName(Class class)
{
  return [RCTProfilePrefix stringByAppendingString:NSStringFromClass(class)].UTF8String;
}

static SEL RCTProfileProxySelector(SEL);
static SEL RCTProfileProxySelector(SEL selector)
{
  NSString *selectorName = NSStringFromSelector(selector);
  return NSSelectorFromString([RCTProfilePrefix stringByAppendingString:selectorName]);
}

static void RCTProfileForwardInvocation(NSObject *, SEL, NSInvocation *);
static void RCTProfileForwardInvocation(NSObject *self, __unused SEL cmd, NSInvocation *invocation)
{
  NSString *name = [NSString stringWithFormat:@"-[%@ %@]", NSStringFromClass([self class]), NSStringFromSelector(invocation.selector)];
  SEL newSel = RCTProfileProxySelector(invocation.selector);

  if ([object_getClass(self) instancesRespondToSelector:newSel]) {
    invocation.selector = newSel;
    RCTProfileBeginEvent(0, name, nil);
    [invocation invoke];
    RCTProfileEndEvent(0, @"objc_call,modules,auto", nil);
  } else if ([self respondsToSelector:invocation.selector]) {
    [invocation invoke];
  } else {
    // Use original selector to don't change error message
    [self doesNotRecognizeSelector:invocation.selector];
  }
}

static IMP RCTProfileMsgForward(NSObject *, SEL);
static IMP RCTProfileMsgForward(NSObject *self, SEL selector)
{
  IMP imp = (IMP)_objc_msgForward;
#if !defined(__arm64__)
  NSMethodSignature *signature = [self methodSignatureForSelector:selector];
  if (signature.methodReturnType[0] == _C_STRUCT_B && signature.methodReturnLength > 8) {
    imp = (IMP)_objc_msgForward_stret;
  }
#endif
  return imp;
}

void RCTProfileHookModules(RCTBridge *bridge)
{
  for (RCTModuleData *moduleData in [bridge valueForKey:@"moduleDataByID"]) {
    [moduleData dispatchBlock:^{
      Class moduleClass = moduleData.moduleClass;
      Class proxyClass = objc_allocateClassPair(moduleClass, RCTProfileProxyClassName(moduleClass), 0);

      if (!proxyClass) {
        return;
      }

      unsigned int methodCount;
      Method *methods = class_copyMethodList(moduleClass, &methodCount);
      for (NSUInteger i = 0; i < methodCount; i++) {
        Method method = methods[i];
        SEL selector = method_getName(method);
        if ([NSStringFromSelector(selector) hasPrefix:@"rct"] || [NSObject instancesRespondToSelector:selector]) {
          continue;
        }
        IMP originalIMP = method_getImplementation(method);
        const char *returnType = method_getTypeEncoding(method);
        class_addMethod(proxyClass, selector, RCTProfileMsgForward(moduleData.instance, selector), returnType);
        class_addMethod(proxyClass, RCTProfileProxySelector(selector), originalIMP, returnType);
      }
      free(methods);

      class_replaceMethod(object_getClass(proxyClass), @selector(initialize), imp_implementationWithBlock(^{}), "v@:");

      for (Class cls in @[proxyClass, object_getClass(proxyClass)]) {
        Method oldImp = class_getInstanceMethod(cls, @selector(class));
        class_replaceMethod(cls, @selector(class), imp_implementationWithBlock(^{ return moduleClass; }), method_getTypeEncoding(oldImp));
      }

      IMP originalFwd = class_replaceMethod(moduleClass, @selector(forwardInvocation:), (IMP)RCTProfileForwardInvocation, "v@:@");
      if (originalFwd != NULL) {
        class_addMethod(proxyClass, RCTProfileProxySelector(@selector(forwardInvocation:)), originalFwd, "v@:@");
      }

      objc_registerClassPair(proxyClass);
      object_setClass(moduleData.instance, proxyClass);
    }];
  }
}

void RCTProfileUnhookModules(RCTBridge *bridge)
{
  for (RCTModuleData *moduleData in [bridge valueForKey:@"moduleDataByID"]) {
    Class proxyClass = object_getClass(moduleData.instance);
    if (moduleData.moduleClass != proxyClass) {
      object_setClass(moduleData.instance, moduleData.moduleClass);
      objc_disposeClassPair(proxyClass);
    }
  };
}

#pragma mark - Public Functions

BOOL RCTProfileIsProfiling(void)
{
  RCTProfileLock(
    BOOL profiling = RCTProfileInfo != nil;
  );
  return profiling;
}

void RCTProfileInit(RCTBridge *bridge)
{
  RCTProfileHookModules(bridge);

  static dispatch_once_t onceToken;
  dispatch_once(&onceToken, ^{
    _RCTProfileLock = [NSRecursiveLock new];
  });
  RCTProfileLock(
    RCTProfileStartTime = CACurrentMediaTime();
    RCTProfileOngoingEvents = [NSMutableDictionary new];
    RCTProfileInfo = @{
      RCTProfileTraceEvents: [NSMutableArray new],
      RCTProfileSamples: [NSMutableArray new],
    };
  );

  [[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidStartProfiling
                                                      object:nil];
}

NSString *RCTProfileEnd(RCTBridge *bridge)
{
  [[NSNotificationCenter defaultCenter] postNotificationName:RCTProfileDidEndProfiling
                                                      object:nil];

  RCTProfileLock(
    NSString *log = RCTJSONStringify(RCTProfileInfo, NULL);
    RCTProfileEventID = 0;
    RCTProfileInfo = nil;
    RCTProfileOngoingEvents = nil;
  );

  RCTProfileUnhookModules(bridge);

  return log;
}

static NSMutableArray *RCTProfileGetThreadEvents(void)
{
  static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey";
  NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey];
  if (!threadEvents) {
    threadEvents = [[NSMutableArray alloc] init];
    [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents;
  }
  return threadEvents;
}

void RCTProfileBeginEvent(uint64_t tag, NSString *name, NSDictionary *args)
{
  CHECK();
  NSMutableArray *events = RCTProfileGetThreadEvents();
  [events addObject:@[
    RCTProfileTimestamp(CACurrentMediaTime()),
    @(tag),
    name,
    RCTNullIfNil(args),
  ]];
}

void RCTProfileEndEvent(
  __unused uint64_t tag,
  NSString *category,
  NSDictionary *args
) {
  CHECK();

  NSMutableArray *events = RCTProfileGetThreadEvents();
  NSArray *event = events.lastObject;
  [events removeLastObject];

  if (!event) {
    return;
  }

  NSNumber *start = event[0];

  RCTProfileLock(
    RCTProfileAddEvent(RCTProfileTraceEvents,
      @"name": event[2],
      @"cat": category,
      @"ph": @"X",
      @"ts": start,
      @"dur": @(RCTProfileTimestamp(CACurrentMediaTime()).doubleValue - start.doubleValue),
      @"args": RCTProfileMergeArgs(event[3], args),
    );
  );
}

int RCTProfileBeginAsyncEvent(
  __unused uint64_t tag,
  NSString *name,
  NSDictionary *args
) {
  CHECK(0);

  static int eventID = 0;

  RCTProfileLock(
    RCTProfileOngoingEvents[@(eventID)] = @[
      RCTProfileTimestamp(CACurrentMediaTime()),
      name,
      RCTNullIfNil(args),
    ];
  );

  return eventID++;
}

void RCTProfileEndAsyncEvent(
  __unused uint64_t tag,
  NSString *category,
  int cookie,
  __unused NSString *name,
  NSDictionary *args
) {
  CHECK();
  RCTProfileLock(
    NSArray *event = RCTProfileOngoingEvents[@(cookie)];
    if (event) {
      NSNumber *endTimestamp = RCTProfileTimestamp(CACurrentMediaTime());

      RCTProfileAddEvent(RCTProfileTraceEvents,
        @"name": event[1],
        @"cat": category,
        @"ph": @"X",
        @"ts": event[0],
        @"dur": @(endTimestamp.doubleValue - [event[0] doubleValue]),
        @"args": RCTProfileMergeArgs(event[2], args),
      );
      [RCTProfileOngoingEvents removeObjectForKey:@(cookie)];
    }
  );
}

void RCTProfileImmediateEvent(
  __unused uint64_t tag,
  NSString *name,
  char scope
) {
  CHECK();

  RCTProfileLock(
    RCTProfileAddEvent(RCTProfileTraceEvents,
      @"name": name,
      @"ts": RCTProfileTimestamp(CACurrentMediaTime()),
      @"scope": @(scope),
      @"ph": @"i",
      @"args": RCTProfileGetMemoryUsage(),
    );
  );
}

NSNumber *_RCTProfileBeginFlowEvent(void)
{
  static NSUInteger flowID = 0;

  CHECK(@0);
  RCTProfileAddEvent(RCTProfileTraceEvents,
    @"name": @"flow",
    @"id": @(++flowID),
    @"cat": @"flow",
    @"ph": @"s",
    @"ts": RCTProfileTimestamp(CACurrentMediaTime()),
  );

  return @(flowID);
}

void _RCTProfileEndFlowEvent(NSNumber *flowID)
{
  CHECK();
  RCTProfileAddEvent(RCTProfileTraceEvents,
    @"name": @"flow",
    @"id": flowID,
    @"cat": @"flow",
    @"ph": @"f",
    @"ts": RCTProfileTimestamp(CACurrentMediaTime()),
  );
}

#endif


text:
module Faker
  class SouthAfrica < Base
    class << self
      def id_number
        Faker::IDNumber.south_african_id_number
      end

      def valid_id_number
        Faker::IDNumber.valid_south_african_id_number
      end

      def invalid_id_number
        Faker::IDNumber.invalid_south_african_id_number
      end

      def phone_number
        with_locale 'en-ZA' do
          Faker::PhoneNumber.phone_number
        end
      end

      def cell_phone
        with_locale 'en-ZA' do
          Faker::PhoneNumber.cell_phone
        end
      end

      def pty_ltd_registration_number
        Faker::Company.south_african_pty_ltd_registration_number
      end

      def close_corporation_registration_number
        Faker::Company.south_african_close_corporation_registration_number
      end

      def listed_company_registration_number
        Faker::Company.south_african_listed_company_registration_number
      end

      def trust_registration_number
        Faker::Company.south_african_trust_registration_number
      end

      def vat_number
        Faker::Finance.vat_number('ZA')
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections;
using Nixxis.Client.Controls;

namespace Nixxis.Client.Agent
{
    /// <summary>
    /// Interaction logic for TeamSelectionControl.xaml
    /// </summary>
    public partial class TeamSelectionControl : UserControl
    {
        #region Properties XAML
        public static readonly DependencyProperty ItemSourceProperty = DependencyProperty.Register("ItemSource", typeof(object), typeof(TeamSelectionControl), new PropertyMetadata(new PropertyChangedCallback(ItemSourceChanged)));
        public object ItemSource
        {
            get { return (object)GetValue(ItemSourceProperty); }
            set { SetValue(ItemSourceProperty, value); }
        }
        public static void ItemSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {

        }

        public NixxisAdvListBoxCollection ItemList
        {
            get { return (NixxisAdvListBoxCollection)lstTeam.ItemsSource; }
        }
        #endregion

        #region Constructor
        public TeamSelectionControl()
        {
            InitializeComponent();
        }
        #endregion

        #region Members

        #endregion
    }
}


text:
export var VISITOR_KEYS = {};
export var ALIAS_KEYS = {};
export var BUILDER_KEYS = {};

function builderFromArray(arr) {
  var builder = {};
  for (var key of (arr: Array)) builder[key] = null;
  return builder;
}

export default function defineType(type, opts = {}) {
  opts.visitor = opts.visitor || [];
  opts.aliases = opts.aliases || [];

  if (!opts.builder) opts.builder = builderFromArray(opts.visitor);
  if (Array.isArray(opts.builder)) opts.builder = builderFromArray(opts.builder);

  VISITOR_KEYS[type] = opts.visitor;
  ALIAS_KEYS[type] = opts.aliases;
  BUILDER_KEYS[type] = opts.builder;
}


text:
<?xml version='1.0'?>
<module>
	<name>VtigerVulnPlugin</name>
	<label>VtigerVulnPlugin</label>
	<parent>Tools</parent>
	<version>1.01</version>
	<dependencies>
		<vtiger_version>7.0.0</vtiger_version>
		<vtiger_max_version>7.*</vtiger_max_version>
	</dependencies>
	<license>
		<file>LICENSE.txt</file>
	</license>

	<actions>
		<action>
			<name><![CDATA[Import]]></name>
			<status>enabled</status>
		</action>
		<action>
			<name><![CDATA[Export]]></name>
			<status>disabled</status>
		</action>
	</actions>
</module>


text:
using Serenity.Data;
using Serenity.Testing;
using Serenity.Test.Testing;
using System;
using Xunit;

namespace Serenity.Test.Data
{
    [Collection("AvoidParallel")]
    public partial class RowMappingTests : SerenityTestBase
    {
        [Fact]
        public void FaultyRowThrowsException()
        {
            Exception innerException = null;

            Assert.Throws(typeof(TypeInitializationException), () =>
            {
                try
                {
                    new FaultyRow();
                }
                catch (Exception ex)
                {
                    innerException = ex.InnerException;
                    throw;
                }
            });

            Assert.IsType(typeof(InvalidProgramException), innerException);
            Assert.Contains("Missing", innerException.Message);
        }

        [Fact]
        public void BasicRowHasCorrectMappings()
        {
            Assert.Equal("Basic", BasicRow.Fields.TableName);

            Assert.Equal("AString", BasicRow.Fields.AString.Name);
            Assert.Equal("T0.AString", BasicRow.Fields.AString.Expression);
            Assert.Equal("AString", BasicRow.Fields.AString.PropertyName);
            Assert.Equal(FieldFlags.Default, BasicRow.Fields.AString.Flags);
            Assert.Equal(0, BasicRow.Fields.AString.Size);
            Assert.Equal(0, BasicRow.Fields.AString.Scale);
            Assert.Equal(null, BasicRow.Fields.AString.DefaultValue);
            Assert.Equal(SelectLevel.Auto, BasicRow.Fields.AString.MinSelectLevel);
            Assert.Equal(null, BasicRow.Fields.AString.ForeignTable);
            Assert.Equal(null, BasicRow.Fields.AString.ForeignField);
            Assert.Equal(null, BasicRow.Fields.AString.Join);
            Assert.Equal(null, BasicRow.Fields.AString.JoinAlias);
            Assert.Equal(null, BasicRow.Fields.AString.ReferencedAliases);
            Assert.Equal(null, BasicRow.Fields.AString.Origin);
            Assert.Equal(0, BasicRow.Fields.AString.NaturalOrder);
            Assert.Equal(null, BasicRow.Fields.AString.TextualField);
            Assert.Equal(null, BasicRow.Fields.AString.Caption);
            Assert.Equal("AString", BasicRow.Fields.AString.Title);
            Assert.Equal(FieldType.String, BasicRow.Fields.AString.Type);
            Assert.Equal(typeof(String), BasicRow.Fields.AString.ValueType);
            Assert.Equal(0, BasicRow.Fields.AString.Index);
            Assert.Equal(BasicRow.Fields, BasicRow.Fields.AString.Fields);

            Assert.Equal("AInt32", BasicRow.Fields.AInt32.Name);
            Assert.Equal("T0.AInt32", BasicRow.Fields.AInt32.Expression);
            Assert.Equal("AInt32", BasicRow.Fields.AInt32.PropertyName);
            Assert.Equal(FieldFlags.Default, BasicRow.Fields.AInt32.Flags);
            Assert.Equal(0, BasicRow.Fields.AInt32.Size);
            Assert.Equal(0, BasicRow.Fields.AInt32.Scale);
            Assert.Equal(null, BasicRow.Fields.AInt32.DefaultValue);
            Assert.Equal(SelectLevel.Auto, BasicRow.Fields.AInt32.MinSelectLevel);
            Assert.Equal(null, BasicRow.Fields.AInt32.ForeignTable);
            Assert.Equal(null, BasicRow.Fields.AInt32.ForeignField);
            Assert.Equal(null, BasicRow.Fields.AInt32.Join);
            Assert.Equal(null, BasicRow.Fields.AInt32.JoinAlias);
            Assert.Equal(null, BasicRow.Fields.AInt32.ReferencedAliases);
            Assert.Equal(null, BasicRow.Fields.AInt32.Origin);
            Assert.Equal(0, BasicRow.Fields.AInt32.NaturalOrder);
            Assert.Equal(null, BasicRow.Fields.AInt32.TextualField);
            Assert.Equal(null, BasicRow.Fields.AInt32.Caption);
            Assert.Equal("AInt32", BasicRow.Fields.AInt32.Title);
            Assert.Equal(FieldType.Int32, BasicRow.Fields.AInt32.Type);
            Assert.Equal(typeof(Int32?), BasicRow.Fields.AInt32.ValueType);
            Assert.Equal(1, BasicRow.Fields.AInt32.Index);
            Assert.Equal(BasicRow.Fields, BasicRow.Fields.AInt32.Fields);

        }

        [Fact]
        public void TableNameAttributeSetsRowTableName()
        {
            Assert.Equal("ComplexTable", ComplexRow.Fields.TableName);
        }

        [Fact]
        public void DisplayNameAttributeIsHonored()
        {
            Assert.Equal("Complex ID", ComplexRow.Fields.ID.Title);
        }

        [Fact]
        public void DisplayNameAttributeOverridesManualValue()
        {
            Assert.Equal("OverridenCaption", ComplexRow.Fields.Overriden.Title);
        }

        [Fact]
        public void ColumnAttributeCantOverrideManualValue()
        {
            Exception innerException = null;

            Assert.Throws(typeof(TypeInitializationException), () =>
            {
                try
                {
                    new InvalidColumnRow();
                }
                catch (Exception ex)
                {
                    innerException = ex.InnerException;
                    throw;
                }
            });

            Assert.IsType(typeof(InvalidProgramException), innerException);
            Assert.Contains("can't be overridden", innerException.Message);
            Assert.Contains("'Override'", innerException.Message);
        }

        [Fact]
        public void ColumnAttributeOverrideCanUseSameNameWithManualValue()
        {
            Assert.Equal("ManualName", ComplexRow.Fields.Overriden.Name);
        }

        [Fact]
        public void ExpressionAttributeOverridesManualValue()
        {
            Assert.Equal("T0.OverridenExpression", ComplexRow.Fields.Overriden.Expression);
        }

        [Fact]
        public void ForeignKeyAttributeSetsPropertiesProperly()
        {
            Assert.Equal("TheCountryTable", ComplexRow.Fields.CountryID.ForeignTable);
            Assert.Equal("TheCountryID", ComplexRow.Fields.CountryID.ForeignField);
        }

        [Fact]
        public void AddJoinAttributeCreatesLeftJoinProperly()
        {
            Assert.True(ComplexRow.Fields.Joins.ContainsKey("c"));

            var join = ComplexRow.Fields.Joins["c"];
            Assert.Equal(
                TestSqlHelper.Normalize("(c.TheCountryID = T0.CountryID)"),
                TestSqlHelper.Normalize(join.OnCriteria.ToStringIgnoreParams()));

            Assert.Equal("TheCountryTable", join.Table);

            Assert.IsType(typeof(LeftJoin), join);
        }

        [Fact]
        public void ExpressionAttributeSetsForeignFlagIfContainsAnyAliasOtherThanT0()
        {
            Assert.True(ComplexRow.Fields.CountryName.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeSetsCalculatedFlagForExpressionsWithoutAliases()
        {
            Assert.True(ComplexRow.Fields.ConcatExpression.Flags.HasFlag(FieldFlags.Calculated));
            Assert.False(ComplexRow.Fields.ConcatExpression.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeDoesntSetForeignFlagIfContainsOnlyT0()
        {
            Assert.False(ComplexRow.Fields.Name.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeDoesntSetCalculatedFlagIfContainsOnlyOneAliasAndName()
        {
            Assert.False(ComplexRow.Fields.Name.Flags.HasFlag(FieldFlags.Calculated));
            Assert.False(ComplexRow.Fields.CountryName.Flags.HasFlag(FieldFlags.Calculated));
        }

        [Fact]
        public void ExpressionAttributeDoesntSetCalculatedFlagForBasicExpressions()
        {
            Assert.False(ComplexRow.Fields.BasicExpression.Flags.HasFlag(FieldFlags.Calculated));
            Assert.False(ComplexRow.Fields.BasicExpression.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeDoesntSetCalculatedFlagForQuotedExpressions()
        {
            Assert.False(ComplexRow.Fields.QuotedExpression.Flags.HasFlag(FieldFlags.Calculated));
            Assert.False(ComplexRow.Fields.QuotedExpression.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeDoesntSetCalculatedFlagForAliasDotQuotedExpressions()
        {
            Assert.False(ComplexRow.Fields.AliasDotQuotedExpression.Flags.HasFlag(FieldFlags.Calculated));
            Assert.False(ComplexRow.Fields.AliasDotQuotedExpression.Flags.HasFlag(FieldFlags.Foreign));
        }

        [Fact]
        public void ExpressionAttributeSetsCalculatedFlagIfContainsMoreThanOneAliasAndName()
        {
            Assert.True(ComplexRow.Fields.FullName.Flags.HasFlag(FieldFlags.Calculated));
        }
    }
}


text:
MT evaluation metrics can be used to define loss functions used for MBR or Consensus decoding.
To add a new loss function based on your own evaluation metric (decomposable at the sentence level), simply implement the following interface:

1. Import the interface

    ```python
    from chisel.mteval import LossFunction
    ```

2. To configure your metric use the config dictionary passed to the following method

    ```python
    def configure(self, config):
      pass
    ```

3. Precompute sufficient statistics from references

    ```python
    def prepare_decoding(self, source, evidence, hypotheses):
      pass
    ```

4. Implement the loss against a *reference*

    ```python
    def loss(self, c, r):
      pass
    ```

5. Implement the loss against an *expected reference* (aka `consensus loss`)

    ```python
    def coloss(self, c):
      pass
    ```

6. You might want to cleanup stuff after decoding a sentence

    ```python
    def cleanup(self):
      pass
    ```

7. Finally, teach the decoder how to construct the wrapper to your loss function. For that your module must define `construct` which takes an alias and returns an instance of your custom class. Note that this is not where you configure your underlying metric, for that you should be using `configure` in the interface mteval.LossFunction.

        ```python
    def construct(alias):
            return MyWrappedLoss(alias)
    ```


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Politics on @alspur</title>
    <link>/tags/politics/</link>
    <description>Recent content in Politics on @alspur</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 09 Aug 2016 13:31:00 -0500</lastBuildDate>

	<atom:link href="/tags/politics/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Intellectuals are Freaks</title>
      <link>/intellectuals-are-freaks/</link>
      <pubDate>Tue, 09 Aug 2016 13:31:00 -0500</pubDate>

      <guid>/intellectuals-are-freaks/</guid>
      <description>Michael Lind on the weakness of intellectuals&rsquo; approach to inequality:
 The views of intellectuals about social reform tend to be warped by professional and personal biases, as well. In the U.S. the default prescription for inequality and other social problems among professors, pundits, and policy wonks alike tends to be: More education! Successful intellectuals get where they are by being good at taking tests and by going to good schools.</description>
    </item>

    <item>
      <title>Ezra Klein interviews Yuval Levin</title>
      <link>/ezra-klein-interviews-yuval-levin/</link>
      <pubDate>Tue, 19 Jul 2016 21:54:00 -0500</pubDate>

      <guid>/ezra-klein-interviews-yuval-levin/</guid>
      <description>This is a thoughtful, in-depth conversation that covers from the thesis of Levin&rsquo;s latest book, The Fractured Republic, his experience working in the Bush (43) Administration, the most interesting policy ideas on each side of the political spectrum, and more.
This is the first Ezra Klein Show episode I&rsquo;ve listened to - I&rsquo;m looking forward to adding others to my Overcast queue.</description>
    </item>

  </channel>
</rss>


text:
ACCEPTED

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

#### Published in
in Bondartseva & Herrera, Mikol. Fitopatol. 14(1): 8 (1980)

#### Original name
Poria umbrinella Bres., 1896

### Remarks
null


text:
package org.elasticsearch.xpack.security.rest.action.saml;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.License;
import org.elasticsearch.license.LicenseUtils;
import org.elasticsearch.license.TestUtils;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.xpack.core.XPackSettings;
import org.hamcrest.Matchers;

import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.instanceOf;

public class SamlBaseRestHandlerTests extends ESTestCase {

    public void testSamlAvailableOnTrialAndPlatinum() {
        final SamlBaseRestHandler handler = buildHandler(randomFrom(License.OperationMode.TRIAL, License.OperationMode.PLATINUM));
        assertThat(handler.checkFeatureAvailable(new FakeRestRequest()), Matchers.nullValue());
    }

    public void testSamlNotAvailableOnBasicStandardOrGold() {
        final SamlBaseRestHandler handler = buildHandler(randomFrom(License.OperationMode.BASIC, License.OperationMode.STANDARD,
            License.OperationMode.GOLD));
        Exception e = handler.checkFeatureAvailable(new FakeRestRequest());
        assertThat(e, instanceOf(ElasticsearchException.class));
        ElasticsearchException elasticsearchException = (ElasticsearchException) e;
        assertThat(elasticsearchException.getMetadata(LicenseUtils.EXPIRED_FEATURE_METADATA), contains("saml"));
    }

    private SamlBaseRestHandler buildHandler(License.OperationMode licenseMode) {
        final Settings settings = Settings.builder()
                .put(XPackSettings.SECURITY_ENABLED.getKey(), true)
                .build();
        final TestUtils.UpdatableLicenseState licenseState = new TestUtils.UpdatableLicenseState(settings);
        licenseState.update(licenseMode, true, null);

        return new SamlBaseRestHandler(settings, licenseState) {

            @Override
            public String getName() {
                return "saml_test";
            }

            @Override
            protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) {
                return null;
            }
        };
    }

}