text:
OpenGLShader::OpenGLShader(UString vertexShader, UString fragmentShader, bool source) : Shader()
{
	m_sVsh = vertexShader;
	m_sFsh = fragmentShader;
	m_bSource = source;

	m_iProgram = 0;
	m_iVertexShader = 0;
	m_iFragmentShader = 0;

	m_iProgramBackup = 0;
}

void OpenGLShader::init()
{
	m_bReady = compile(m_sVsh, m_sFsh, m_bSource);
}

void OpenGLShader::initAsync()
{
	m_bAsyncReady = true;
}

void OpenGLShader::destroy()
{
	if (m_iProgram != 0)
		glDeleteObjectARB(m_iProgram);
	if (m_iFragmentShader != 0)
		glDeleteObjectARB(m_iFragmentShader);
	if (m_iVertexShader != 0)
		glDeleteObjectARB(m_iVertexShader);

	m_iProgram = 0;
	m_iFragmentShader = 0;
	m_iVertexShader = 0;

	m_iProgramBackup = 0;

	m_uniformLocationCache.clear();
}

void OpenGLShader::enable()
{
	if (!m_bReady) return;

	glGetIntegerv(GL_CURRENT_PROGRAM, &m_iProgramBackup); // backup
	glUseProgramObjectARB(m_iProgram);
}

void OpenGLShader::disable()
{
	if (!m_bReady) return;

	glUseProgramObjectARB(m_iProgramBackup); // restore
}

void OpenGLShader::setUniform1f(UString name, float value)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform1fARB(id, value);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform1fv(UString name, int count, float *values)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform1fvARB(id, count, values);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform1i(UString name, int value)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform1iARB(id, value);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform2f(UString name, float value1, float value2)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform2fARB(id, value1, value2);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform2fv(UString name, int count, float *vectors)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform2fv(id, count, (float*)&vectors[0]);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform3f(UString name, float x, float y, float z)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform3fARB(id, x, y, z);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform3fv(UString name, int count, float *vectors)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform3fv(id, count, (float*)&vectors[0]);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniform4f(UString name, float x, float y, float z, float w)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniform4fARB(id, x, y, z, w);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniformMatrix4fv(UString name, Matrix4 &matrix)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniformMatrix4fv(id, 1, GL_FALSE, matrix.get());
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

void OpenGLShader::setUniformMatrix4fv(UString name, float *v)
{
	if (!m_bReady) return;

	const int id = getAndCacheUniformLocation(name);
	if (id != -1)
		glUniformMatrix4fv(id, 1, GL_FALSE, v);
	else if (debug_shaders->getBool())
		debugLog("Shader Warning: Can't find uniform %s\n", name.toUtf8());
}

int OpenGLShader::getAttribLocation(UString name)
{
	if (!m_bReady) return -1;

	return glGetAttribLocation(m_iProgram, name.toUtf8());
}

int OpenGLShader::getAndCacheUniformLocation(const UString &name)
{
	if (!m_bReady) return -1;

	m_sTempStringBuffer.reserve(name.lengthUtf8());
	m_sTempStringBuffer.assign(name.toUtf8(), name.lengthUtf8());

	const auto cachedValue = m_uniformLocationCache.find(m_sTempStringBuffer);
	const bool cached = (cachedValue != m_uniformLocationCache.end());

	const int id = (cached ? cachedValue->second : glGetUniformLocationARB(m_iProgram, name.toUtf8()));
	if (!cached && id != -1)
		m_uniformLocationCache[m_sTempStringBuffer] = id;

	return id;
}

bool OpenGLShader::compile(UString vertexShader, UString fragmentShader, bool source)
{
	// load & compile shaders
	debugLog("Shader: Compiling %s ...\n", vertexShader.toUtf8());
	m_iVertexShader = source ? createShaderFromString(vertexShader, GL_VERTEX_SHADER_ARB) : createShaderFromFile(vertexShader, GL_VERTEX_SHADER_ARB);
	debugLog("Shader: Compiling %s ...\n", fragmentShader.toUtf8());
	m_iFragmentShader = source ? createShaderFromString(fragmentShader, GL_FRAGMENT_SHADER_ARB) : createShaderFromFile(fragmentShader, GL_FRAGMENT_SHADER_ARB);

	if (m_iVertexShader == 0 || m_iFragmentShader == 0)
	{
		engine->showMessageError("Shader Error", "Couldn't createShader()");
		return false;
	}

	// create program
	m_iProgram = glCreateProgramObjectARB();
	if (m_iProgram == 0)
	{
		engine->showMessageError("Shader Error", "Couldn't glCreateProgramObjectARB()");
		return false;
	}

	// attach
	glAttachObjectARB(m_iProgram, m_iVertexShader);
	glAttachObjectARB(m_iProgram, m_iFragmentShader);

	// link
	glLinkProgramARB(m_iProgram);

	int returnValue = GL_TRUE;
	glGetObjectParameterivARB(m_iProgram, GL_OBJECT_LINK_STATUS_ARB, &returnValue);
	if (returnValue == GL_FALSE)
	{
		engine->showMessageError("Shader Error", "Couldn't glLinkProgramARB()");
		return false;
	}

	// validate
	glValidateProgramARB(m_iProgram);
	returnValue = GL_TRUE;
	glGetObjectParameterivARB(m_iProgram, GL_OBJECT_VALIDATE_STATUS_ARB, &returnValue);
	if (returnValue == GL_FALSE)
	{
		engine->showMessageError("Shader Error", "Couldn't glValidateProgramARB()");
		return false;
	}

	return true;
}

int OpenGLShader::createShaderFromString(UString shaderSource, int shaderType)
{
	int shader = glCreateShaderObjectARB(shaderType);

	if (shader == 0)
	{
		engine->showMessageError("Shader Compile Error", "Couldn't glCreateShaderObjectARB()");
		return 0;
	}

	// compile shader
	const char* shaderSourceChar = shaderSource.toUtf8();
	glShaderSourceARB(shader, 1, &shaderSourceChar, NULL);
	glCompileShaderARB(shader);

	int returnValue = GL_TRUE;
	glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &returnValue);

	if (returnValue == GL_FALSE)
	{
		debugLog("------------------Shader Compile Error------------------\n");

		glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &returnValue);
		char *errorLog = new char[returnValue];
		glGetInfoLogARB(shader, returnValue, &returnValue, errorLog);

		debugLog(errorLog);
		delete[] errorLog;

		debugLog("--------------------------------------------------------\n");

		engine->showMessageError("Shader Error", "Couldn't glShaderSourceARB() or glCompileShaderARB()");
		return 0;
	}

	return shader;
}

int OpenGLShader::createShaderFromFile(UString fileName, int shaderType)
{
	// load file
	std::ifstream inFile(fileName.toUtf8());
	if (!inFile)
	{
		engine->showMessageError("Shader Error", fileName);
		return 0;
	}
	std::string line;
	std::string shaderSource;
	int linecount = 0;
	while (inFile.good())
	{
		std::getline(inFile, line);
		shaderSource += line + "\n\0";
		linecount++;
	}
	shaderSource += "\n\0";
	inFile.close();

	UString shaderSourcePtr = UString(shaderSource.c_str());

	return createShaderFromString(shaderSourcePtr, shaderType);
}

#endif


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _isString2 = require('lodash/isString');

var _isString3 = _interopRequireDefault(_isString2);

var _isObject2 = require('lodash/isObject');

var _isObject3 = _interopRequireDefault(_isObject2);

var _isArray2 = require('lodash/isArray');

var _isArray3 = _interopRequireDefault(_isArray2);

exports.identity = identity;
exports.sliceModifiers = sliceModifiers;
exports.deepTap = deepTap;
exports.tokenize = tokenize;
exports.isReacon = isReacon;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function identity(id) {
  return id;
}

function sliceModifiers(content) {
  if ((0, _isArray3.default)(content)) {
    var lastIdx = content.length - 1;
    return {
      mods: content.slice(0, lastIdx),
      target: content[lastIdx]
    };
  }
  return {
    mods: [],
    target: content
  };
}

function deepTap(obj, tap, isTapable) {
  var keyMap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : identity;

  if (isTapable && isTapable(obj)) {
    return tap(obj);
  } else if ((0, _isArray3.default)(obj)) {
    return obj.map(function (item) {
      return deepTap(item, tap, isTapable);
    });
  } else if ((0, _isObject3.default)(obj)) {
    return Object.keys(obj).reduce(function (sum, key) {
      return Object.assign(sum, _defineProperty({}, keyMap(key), deepTap(obj[key], tap, isTapable)));
    }, {});
  }
  if (isTapable) {
    return isTapable(obj) ? tap(obj) : obj;
  }
  return tap(obj);
}

function tokenize(str) {
  return new RegExp('^' + str.toUpperCase() + '\\s*(.+)$');
}

function isReacon(obj) {
  return obj && obj.type && (0, _isString3.default)(obj.type);
}

redpajama_set_name: RedPajamaGithub


text:
import { AngularFireAuth } from 'angularfire2/auth';
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { RoomService } from '../../services/room.service';
import { WaitingRoomPage } from '../waiting-room/waiting-room.page';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  private user;
  private enteredRoomId = '';

  constructor(private nav: NavController, private afAuth: AngularFireAuth, private roomService: RoomService) {
    this.afAuth.authState.subscribe(state => {
      this.user = state;
    });
  }

  private createRoom() {
    let room = this.roomService.create().then(room =>
      this.nav.push(WaitingRoomPage, {
        room
      })
    );
  }

  private joinRoom() {
    if (this.enteredRoomId) {
      this.roomService.join(this.user.uid, this.enteredRoomId)
        .then(room =>
          this.nav.push(WaitingRoomPage, {
            room
          })
        )
        .catch(() =>
          alert('Could not find room')
        );
    }
  }

}


text:
.class Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;
.super Ljava/lang/Object;
.source "PhoneWindow.java"

# interfaces
.implements Landroid/view/ActionMode$Callback;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/policy/impl/PhoneWindow$DecorView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ActionModeCallbackWrapper"
.end annotation

# instance fields
.field private mWrapped:Landroid/view/ActionMode$Callback;

.field final synthetic this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

# direct methods
.method public constructor <init>(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;Landroid/view/ActionMode$Callback;)V
    .locals 0
    .param p2, "wrapped"    # Landroid/view/ActionMode$Callback;

    .prologue
    .line 3423
    iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

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

    .line 3424
    iput-object p2, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->mWrapped:Landroid/view/ActionMode$Callback;

    .line 3425
    return-void
.end method

# virtual methods
.method public onActionItemClicked(Landroid/view/ActionMode;Landroid/view/MenuItem;)Z
    .locals 1
    .param p1, "mode"    # Landroid/view/ActionMode;
    .param p2, "item"    # Landroid/view/MenuItem;

    .prologue
    .line 3437
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->mWrapped:Landroid/view/ActionMode$Callback;

    invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onActionItemClicked(Landroid/view/ActionMode;Landroid/view/MenuItem;)Z

    move-result v0

    return v0
.end method

.method public onCreateActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
    .locals 1
    .param p1, "mode"    # Landroid/view/ActionMode;
    .param p2, "menu"    # Landroid/view/Menu;

    .prologue
    .line 3428
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->mWrapped:Landroid/view/ActionMode$Callback;

    invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onCreateActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z

    move-result v0

    return v0
.end method

.method public onDestroyActionMode(Landroid/view/ActionMode;)V
    .locals 2
    .param p1, "mode"    # Landroid/view/ActionMode;

    .prologue
    .line 3441
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->mWrapped:Landroid/view/ActionMode$Callback;

    invoke-interface {v0, p1}, Landroid/view/ActionMode$Callback;->onDestroyActionMode(Landroid/view/ActionMode;)V

    .line 3442
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModePopup:Landroid/widget/PopupWindow;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1800(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Landroid/widget/PopupWindow;

    move-result-object v0

    if-eqz v0, :cond_3

    .line 3443
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mShowActionModePopup:Ljava/lang/Runnable;
    invoke-static {v1}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$2800(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Ljava/lang/Runnable;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->removeCallbacks(Ljava/lang/Runnable;)Z

    .line 3444
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModePopup:Landroid/widget/PopupWindow;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1800(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Landroid/widget/PopupWindow;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/PopupWindow;->dismiss()V

    .line 3448
    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModeView:Lcom/android/internal/widget/ActionBarContextView;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1700(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Lcom/android/internal/widget/ActionBarContextView;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 3449
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModeView:Lcom/android/internal/widget/ActionBarContextView;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1700(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Lcom/android/internal/widget/ActionBarContextView;

    move-result-object v0

    invoke-virtual {v0}, Lcom/android/internal/widget/ActionBarContextView;->removeAllViews()V

    .line 3451
    :cond_1
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->this$0:Lcom/android/internal/policy/impl/PhoneWindow;

    invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindow;->getCallback()Landroid/view/Window$Callback;

    move-result-object v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->this$0:Lcom/android/internal/policy/impl/PhoneWindow;

    invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindow;->isDestroyed()Z

    move-result v0

    if-nez v0, :cond_2

    .line 3453
    :try_start_0
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->this$0:Lcom/android/internal/policy/impl/PhoneWindow;

    invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindow;->getCallback()Landroid/view/Window$Callback;

    move-result-object v0

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionMode:Landroid/view/ActionMode;
    invoke-static {v1}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$300(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Landroid/view/ActionMode;

    move-result-object v1

    invoke-interface {v0, v1}, Landroid/view/Window$Callback;->onActionModeFinished(Landroid/view/ActionMode;)V
    :try_end_0
    .catch Ljava/lang/AbstractMethodError; {:try_start_0 .. :try_end_0} :catch_0

    .line 3458
    :cond_2
    :goto_1
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    const/4 v1, 0x0

    # setter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionMode:Landroid/view/ActionMode;
    invoke-static {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$302(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;Landroid/view/ActionMode;)Landroid/view/ActionMode;

    .line 3459
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->requestFitSystemWindows()V

    .line 3460
    return-void

    .line 3445
    :cond_3
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModeView:Lcom/android/internal/widget/ActionBarContextView;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1700(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Lcom/android/internal/widget/ActionBarContextView;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 3446
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    # getter for: Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->mActionModeView:Lcom/android/internal/widget/ActionBarContextView;
    invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->access$1700(Lcom/android/internal/policy/impl/PhoneWindow$DecorView;)Lcom/android/internal/widget/ActionBarContextView;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Lcom/android/internal/widget/ActionBarContextView;->setVisibility(I)V

    goto :goto_0

    .line 3454
    :catch_0
    move-exception v0

    goto :goto_1
.end method

.method public onPrepareActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z
    .locals 1
    .param p1, "mode"    # Landroid/view/ActionMode;
    .param p2, "menu"    # Landroid/view/Menu;

    .prologue
    .line 3432
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->this$1:Lcom/android/internal/policy/impl/PhoneWindow$DecorView;

    invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindow$DecorView;->requestFitSystemWindows()V

    .line 3433
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindow$DecorView$ActionModeCallbackWrapper;->mWrapped:Landroid/view/ActionMode$Callback;

    invoke-interface {v0, p1, p2}, Landroid/view/ActionMode$Callback;->onPrepareActionMode(Landroid/view/ActionMode;Landroid/view/Menu;)Z

    move-result v0

    return v0
.end method


text:
import saml2
from saml2 import SamlBase

NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/'

class Header_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:Header element """

    c_tag = 'Header'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def header__from_string(xml_string):
    return saml2.create_class_from_xml_string(Header_, xml_string)

class Body_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:Body element """

    c_tag = 'Body'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def body__from_string(xml_string):
    return saml2.create_class_from_xml_string(Body_, xml_string)

class EncodingStyle_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:encodingStyle element """

    c_tag = 'encodingStyle'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def encoding_style__from_string(xml_string):
    return saml2.create_class_from_xml_string(EncodingStyle_, xml_string)

class Fault_faultcode(SamlBase):

    c_tag = 'faultcode'
    c_namespace = NAMESPACE
    c_value_type = {'base': 'QName'}
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def fault_faultcode_from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault_faultcode, xml_string)

class Fault_faultstring(SamlBase):

    c_tag = 'faultstring'
    c_namespace = NAMESPACE
    c_value_type = {'base': 'string'}
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def fault_faultstring_from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault_faultstring, xml_string)

class Fault_faultactor(SamlBase):

    c_tag = 'faultactor'
    c_namespace = NAMESPACE
    c_value_type = {'base': 'anyURI'}
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def fault_faultactor_from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault_faultactor, xml_string)

class Detail_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:detail element """

    c_tag = 'detail'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def detail__from_string(xml_string):
    return saml2.create_class_from_xml_string(Detail_, xml_string)

class Envelope_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element """

    c_tag = 'Envelope'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}Header'] = ('header', Header_)
    c_cardinality['header'] = {"min":0, "max":1}
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}Body'] = ('body', Body_)
    c_child_order.extend(['header', 'body'])

    def __init__(self,
            header=None,
            body=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.header=header
        self.body=body

def envelope__from_string(xml_string):
    return saml2.create_class_from_xml_string(Envelope_, xml_string)

class Header(Header_):
    """The http://schemas.xmlsoap.org/soap/envelope/:Header element """

    c_tag = 'Header'
    c_namespace = NAMESPACE
    c_children = Header_.c_children.copy()
    c_attributes = Header_.c_attributes.copy()
    c_child_order = Header_.c_child_order[:]
    c_cardinality = Header_.c_cardinality.copy()

def header_from_string(xml_string):
    return saml2.create_class_from_xml_string(Header, xml_string)

class Body(Body_):
    """The http://schemas.xmlsoap.org/soap/envelope/:Body element """

    c_tag = 'Body'
    c_namespace = NAMESPACE
    c_children = Body_.c_children.copy()
    c_attributes = Body_.c_attributes.copy()
    c_child_order = Body_.c_child_order[:]
    c_cardinality = Body_.c_cardinality.copy()

def body_from_string(xml_string):
    return saml2.create_class_from_xml_string(Body, xml_string)

class Fault_detail(Detail_):

    c_tag = 'detail'
    c_namespace = NAMESPACE
    c_children = Detail_.c_children.copy()
    c_attributes = Detail_.c_attributes.copy()
    c_child_order = Detail_.c_child_order[:]
    c_cardinality = Detail_.c_cardinality.copy()

def fault_detail_from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault_detail, xml_string)

class Fault_(SamlBase):
    """The http://schemas.xmlsoap.org/soap/envelope/:Fault element """

    c_tag = 'Fault'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultcode'] = ('faultcode', Fault_faultcode)
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultstring'] = ('faultstring', Fault_faultstring)
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultactor'] = ('faultactor', Fault_faultactor)
    c_cardinality['faultactor'] = {"min":0, "max":1}
    c_children['{http://schemas.xmlsoap.org/soap/envelope/}detail'] = ('detail', Fault_detail)
    c_cardinality['detail'] = {"min":0, "max":1}
    c_child_order.extend(['faultcode', 'faultstring', 'faultactor', 'detail'])

    def __init__(self,
            faultcode=None,
            faultstring=None,
            faultactor=None,
            detail=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.faultcode=faultcode
        self.faultstring=faultstring
        self.faultactor=faultactor
        self.detail=detail

def fault__from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault_, xml_string)

class Envelope(Envelope_):
    """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element """

    c_tag = 'Envelope'
    c_namespace = NAMESPACE
    c_children = Envelope_.c_children.copy()
    c_attributes = Envelope_.c_attributes.copy()
    c_child_order = Envelope_.c_child_order[:]
    c_cardinality = Envelope_.c_cardinality.copy()

def envelope_from_string(xml_string):
    return saml2.create_class_from_xml_string(Envelope, xml_string)

class Fault(Fault_):
    """The http://schemas.xmlsoap.org/soap/envelope/:Fault element """

    c_tag = 'Fault'
    c_namespace = NAMESPACE
    c_children = Fault_.c_children.copy()
    c_attributes = Fault_.c_attributes.copy()
    c_child_order = Fault_.c_child_order[:]
    c_cardinality = Fault_.c_cardinality.copy()

def fault_from_string(xml_string):
    return saml2.create_class_from_xml_string(Fault, xml_string)

#..................
# []
AG_encodingStyle = [
    ('encodingStyle', '', False),
]

ELEMENT_FROM_STRING = {
    Envelope.c_tag: envelope_from_string,
    Envelope_.c_tag: envelope__from_string,
    Header.c_tag: header_from_string,
    Header_.c_tag: header__from_string,
    Body.c_tag: body_from_string,
    Body_.c_tag: body__from_string,
    EncodingStyle_.c_tag: encoding_style__from_string,
    Fault.c_tag: fault_from_string,
    Fault_.c_tag: fault__from_string,
    Detail_.c_tag: detail__from_string,
    Fault_faultcode.c_tag: fault_faultcode_from_string,
    Fault_faultstring.c_tag: fault_faultstring_from_string,
    Fault_faultactor.c_tag: fault_faultactor_from_string,
}

ELEMENT_BY_TAG = {
    'Envelope': Envelope,
    'Envelope': Envelope_,
    'Header': Header,
    'Header': Header_,
    'Body': Body,
    'Body': Body_,
    'encodingStyle': EncodingStyle_,
    'Fault': Fault,
    'Fault': Fault_,
    'detail': Detail_,
    'faultcode': Fault_faultcode,
    'faultstring': Fault_faultstring,
    'faultactor': Fault_faultactor,
}

def factory(tag, **kwargs):
    return ELEMENT_BY_TAG[tag](**kwargs)


text:
package org.apache.hadoop.io.file.tfile;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.Random;

import junit.framework.Assert;
import junit.framework.TestCase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.io.file.tfile.TFile.Reader;
import org.apache.hadoop.io.file.tfile.TFile.Writer;
import org.apache.hadoop.io.file.tfile.TFile.Reader.Location;
import org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner;

/**
 *
 * Byte arrays test case class using GZ compression codec, base class of none
 * and LZO compression classes.
 *
 */
public class TestTFileByteArrays extends TestCase {
	private static String ROOT = System.getProperty("test.build.data",
			"/tmp/tfile-test");
	private final static int BLOCK_SIZE = 512;
	private final static int BUF_SIZE = 64;
	private final static int K = 1024;
	protected boolean skip = false;

	private static final String KEY = "key";
	private static final String VALUE = "value";

	private FileSystem fs;
	private Configuration conf;
	private Path path;
	private FSDataOutputStream out;
	private Writer writer;

	private String compression = Compression.Algorithm.GZ.getName();
	private String comparator = "memcmp";
	private String outputFile = "TFileTestByteArrays";
	/*
	 * pre-sampled numbers of records in one block, based on the given the
	 * generated key and value strings
	 */
	// private int records1stBlock = 4314;
	// private int records2ndBlock = 4108;
	private int records1stBlock = 4480;
	private int records2ndBlock = 4263;

	public void init(String compression, String comparator, String outputFile,
			int numRecords1stBlock, int numRecords2ndBlock) {
		this.compression = compression;
		this.comparator = comparator;
		this.outputFile = outputFile;
		this.records1stBlock = numRecords1stBlock;
		this.records2ndBlock = numRecords2ndBlock;
	}

	@Override
	public void setUp() throws IOException {
		conf = new Configuration();
		path = new Path(ROOT, outputFile);
		fs = path.getFileSystem(conf);
		out = fs.create(path);
		writer = new Writer(out, BLOCK_SIZE, compression, comparator, conf);
	}

	@Override
	public void tearDown() throws IOException {
		if (!skip)
			fs.delete(path, true);
	}

	public void testNoDataEntry() throws IOException {
		if (skip)
			return;
		closeOutput();

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Assert.assertTrue(reader.isSorted());
		Scanner scanner = reader.createScanner();
		Assert.assertTrue(scanner.atEnd());
		scanner.close();
		reader.close();
	}

	public void testOneDataEntry() throws IOException {
		if (skip)
			return;
		writeRecords(1);
		readRecords(1);

		checkBlockIndex(1, 0, 0);
		readValueBeforeKey(1, 0);
		readKeyWithoutValue(1, 0);
		readValueWithoutKey(1, 0);
		readKeyManyTimes(1, 0);
	}

	public void testTwoDataEntries() throws IOException {
		if (skip)
			return;
		writeRecords(2);
		readRecords(2);
	}

	/**
	 * Fill up exactly one block.
	 *
	 * @throws IOException
	 */
	public void testOneBlock() throws IOException {
		if (skip)
			return;
		// just under one block
		writeRecords(records1stBlock);
		readRecords(records1stBlock);
		// last key should be in the first block (block 0)
		checkBlockIndex(records1stBlock, records1stBlock - 1, 0);
	}

	/**
	 * One block plus one record.
	 *
	 * @throws IOException
	 */
	public void testOneBlockPlusOneEntry() throws IOException {
		if (skip)
			return;
		writeRecords(records1stBlock + 1);
		readRecords(records1stBlock + 1);
		checkBlockIndex(records1stBlock + 1, records1stBlock - 1, 0);
		checkBlockIndex(records1stBlock + 1, records1stBlock, 1);
	}

	public void testTwoBlocks() throws IOException {
		if (skip)
			return;
		writeRecords(records1stBlock + 5);
		readRecords(records1stBlock + 5);
		checkBlockIndex(records1stBlock + 5, records1stBlock + 4, 1);
	}

	public void testThreeBlocks() throws IOException {
		if (skip)
			return;
		writeRecords(2 * records1stBlock + 5);
		readRecords(2 * records1stBlock + 5);

		checkBlockIndex(2 * records1stBlock + 5, 2 * records1stBlock + 4, 2);
		// 1st key in file
		readValueBeforeKey(2 * records1stBlock + 5, 0);
		readKeyWithoutValue(2 * records1stBlock + 5, 0);
		readValueWithoutKey(2 * records1stBlock + 5, 0);
		readKeyManyTimes(2 * records1stBlock + 5, 0);
		// last key in file
		readValueBeforeKey(2 * records1stBlock + 5, 2 * records1stBlock + 4);
		readKeyWithoutValue(2 * records1stBlock + 5, 2 * records1stBlock + 4);
		readValueWithoutKey(2 * records1stBlock + 5, 2 * records1stBlock + 4);
		readKeyManyTimes(2 * records1stBlock + 5, 2 * records1stBlock + 4);

		// 1st key in mid block, verify block indexes then read
		checkBlockIndex(2 * records1stBlock + 5, records1stBlock - 1, 0);
		checkBlockIndex(2 * records1stBlock + 5, records1stBlock, 1);
		readValueBeforeKey(2 * records1stBlock + 5, records1stBlock);
		readKeyWithoutValue(2 * records1stBlock + 5, records1stBlock);
		readValueWithoutKey(2 * records1stBlock + 5, records1stBlock);
		readKeyManyTimes(2 * records1stBlock + 5, records1stBlock);

		// last key in mid block, verify block indexes then read
		checkBlockIndex(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock - 1, 1);
		checkBlockIndex(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock, 2);
		readValueBeforeKey(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock - 1);
		readKeyWithoutValue(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock - 1);
		readValueWithoutKey(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock - 1);
		readKeyManyTimes(2 * records1stBlock + 5, records1stBlock
				+ records2ndBlock - 1);

		// mid in mid block
		readValueBeforeKey(2 * records1stBlock + 5, records1stBlock + 10);
		readKeyWithoutValue(2 * records1stBlock + 5, records1stBlock + 10);
		readValueWithoutKey(2 * records1stBlock + 5, records1stBlock + 10);
		readKeyManyTimes(2 * records1stBlock + 5, records1stBlock + 10);
	}

	Location locate(Scanner scanner, byte[] key) throws IOException {
		if (scanner.seekTo(key) == true) {
			return scanner.currentLocation;
		}
		return scanner.endLocation;
	}

	public void testLocate() throws IOException {
		if (skip)
			return;
		writeRecords(3 * records1stBlock);
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();
		Location loc2 = locate(scanner, composeSortedKey(KEY,
				3 * records1stBlock, 2).getBytes());
		Location locLastIn1stBlock = locate(scanner, composeSortedKey(KEY,
				3 * records1stBlock, records1stBlock - 1).getBytes());
		Location locFirstIn2ndBlock = locate(scanner, composeSortedKey(KEY,
				3 * records1stBlock, records1stBlock).getBytes());
		Location locX = locate(scanner, "keyX".getBytes());
		Assert.assertEquals(scanner.endLocation, locX);
		scanner.close();
		reader.close();
	}

	public void testFailureWriterNotClosed() throws IOException {
		if (skip)
			return;
		Reader reader = null;
		try {
			reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(),
					conf);
			Assert.fail("Cannot read before closing the writer.");
		} catch (IOException e) {
			// noop, expecting exceptions
		} finally {
			if (reader != null) {
				reader.close();
			}
		}
	}

	public void testFailureWriteMetaBlocksWithSameName() throws IOException {
		if (skip)
			return;
		writer.append("keyX".getBytes(), "valueX".getBytes());

		// create a new metablock
		DataOutputStream outMeta = writer.prepareMetaBlock("testX",
				Compression.Algorithm.GZ.getName());
		outMeta.write(123);
		outMeta.write("foo".getBytes());
		outMeta.close();
		// add the same metablock
		try {
			DataOutputStream outMeta2 = writer.prepareMetaBlock("testX",
					Compression.Algorithm.GZ.getName());
			Assert.fail("Cannot create metablocks with the same name.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	public void testFailureGetNonExistentMetaBlock() throws IOException {
		if (skip)
			return;
		writer.append("keyX".getBytes(), "valueX".getBytes());

		// create a new metablock
		DataOutputStream outMeta = writer.prepareMetaBlock("testX",
				Compression.Algorithm.GZ.getName());
		outMeta.write(123);
		outMeta.write("foo".getBytes());
		outMeta.close();
		closeOutput();

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		DataInputStream mb = reader.getMetaBlock("testX");
		Assert.assertNotNull(mb);
		mb.close();
		try {
			DataInputStream mbBad = reader.getMetaBlock("testY");
			Assert.assertNull(mbBad);
			Assert.fail("Error on handling non-existent metablocks.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		reader.close();
	}

	public void testFailureWriteRecordAfterMetaBlock() throws IOException {
		if (skip)
			return;
		// write a key/value first
		writer.append("keyX".getBytes(), "valueX".getBytes());
		// create a new metablock
		DataOutputStream outMeta = writer.prepareMetaBlock("testX",
				Compression.Algorithm.GZ.getName());
		outMeta.write(123);
		outMeta.write("dummy".getBytes());
		outMeta.close();
		// add more key/value
		try {
			writer.append("keyY".getBytes(), "valueY".getBytes());
			Assert.fail("Cannot add key/value after start adding meta blocks.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	public void testFailureReadValueManyTimes() throws IOException {
		if (skip)
			return;
		writeRecords(5);

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();

		byte[] vbuf = new byte[BUF_SIZE];
		int vlen = scanner.entry().getValueLength();
		scanner.entry().getValue(vbuf);
		Assert.assertEquals(new String(vbuf, 0, vlen), VALUE + 0);
		try {
			scanner.entry().getValue(vbuf);
			Assert.fail("Cannot get the value mlutiple times.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}

		scanner.close();
		reader.close();
	}

	public void testFailureBadCompressionCodec() throws IOException {
		if (skip)
			return;
		closeOutput();
		out = fs.create(path);
		try {
			writer = new Writer(out, BLOCK_SIZE, "BAD", comparator, conf);
			Assert.fail("Error on handling invalid compression codecs.");
		} catch (Exception e) {
			// noop, expecting exceptions
			// e.printStackTrace();
		}
	}

	public void testFailureOpenEmptyFile() throws IOException {
		if (skip)
			return;
		closeOutput();
		// create an absolutely empty file
		path = new Path(fs.getWorkingDirectory(), outputFile);
		out = fs.create(path);
		out.close();
		try {
			Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
					.getLen(), conf);
			Assert.fail("Error on handling empty files.");
		} catch (EOFException e) {
			// noop, expecting exceptions
		}
	}

	public void testFailureOpenRandomFile() throws IOException {
		if (skip)
			return;
		closeOutput();
		// create an random file
		path = new Path(fs.getWorkingDirectory(), outputFile);
		out = fs.create(path);
		Random rand = new Random();
		byte[] buf = new byte[K];
		// fill with > 1MB data
		for (int nx = 0; nx < K + 2; nx++) {
			rand.nextBytes(buf);
			out.write(buf);
		}
		out.close();
		try {
			Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
					.getLen(), conf);
			Assert.fail("Error on handling random files.");
		} catch (IOException e) {
			// noop, expecting exceptions
		}
	}

	public void testFailureKeyLongerThan64K() throws IOException {
		if (skip)
			return;
		byte[] buf = new byte[64 * K + 1];
		Random rand = new Random();
		rand.nextBytes(buf);
		try {
			writer.append(buf, "valueX".getBytes());
		} catch (IndexOutOfBoundsException e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	public void testFailureOutOfOrderKeys() throws IOException {
		if (skip)
			return;
		try {
			writer.append("keyM".getBytes(), "valueM".getBytes());
			writer.append("keyA".getBytes(), "valueA".getBytes());
			Assert.fail("Error on handling out of order keys.");
		} catch (Exception e) {
			// noop, expecting exceptions
			// e.printStackTrace();
		}

		closeOutput();
	}

	public void testFailureNegativeOffset() throws IOException {
		if (skip)
			return;
		try {
			writer.append("keyX".getBytes(), -1, 4, "valueX".getBytes(), 0, 6);
			Assert.fail("Error on handling negative offset.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	public void testFailureNegativeOffset_2() throws IOException {
		if (skip)
			return;
		closeOutput();

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();
		try {
			scanner.lowerBound("keyX".getBytes(), -1, 4);
			Assert.fail("Error on handling negative offset.");
		} catch (Exception e) {
			// noop, expecting exceptions
		} finally {
			reader.close();
			scanner.close();
		}
		closeOutput();
	}

	public void testFailureNegativeLength() throws IOException {
		if (skip)
			return;
		try {
			writer.append("keyX".getBytes(), 0, -1, "valueX".getBytes(), 0, 6);
			Assert.fail("Error on handling negative length.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	public void testFailureNegativeLength_2() throws IOException {
		if (skip)
			return;
		closeOutput();

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();
		try {
			scanner.lowerBound("keyX".getBytes(), 0, -1);
			Assert.fail("Error on handling negative length.");
		} catch (Exception e) {
			// noop, expecting exceptions
		} finally {
			scanner.close();
			reader.close();
		}
		closeOutput();
	}

	public void testFailureNegativeLength_3() throws IOException {
		if (skip)
			return;
		writeRecords(3);

		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();
		try {
			// test negative array offset
			try {
				scanner.seekTo("keyY".getBytes(), -1, 4);
				Assert.fail("Failed to handle negative offset.");
			} catch (Exception e) {
				// noop, expecting exceptions
			}

			// test negative array length
			try {
				scanner.seekTo("keyY".getBytes(), 0, -2);
				Assert.fail("Failed to handle negative key length.");
			} catch (Exception e) {
				// noop, expecting exceptions
			}
		} finally {
			reader.close();
			scanner.close();
		}
	}

	public void testFailureCompressionNotWorking() throws IOException {
		if (skip)
			return;
		long rawDataSize = writeRecords(10 * records1stBlock, false);
		if (!compression.equalsIgnoreCase(Compression.Algorithm.NONE.getName())) {
			Assert.assertTrue(out.getPos() < rawDataSize);
		}
		closeOutput();
	}

	public void testFailureFileWriteNotAt0Position() throws IOException {
		if (skip)
			return;
		closeOutput();
		out = fs.create(path);
		out.write(123);

		try {
			writer = new Writer(out, BLOCK_SIZE, compression, comparator, conf);
			Assert.fail("Failed to catch file write not at position 0.");
		} catch (Exception e) {
			// noop, expecting exceptions
		}
		closeOutput();
	}

	private long writeRecords(int count) throws IOException {
		return writeRecords(count, true);
	}

	private long writeRecords(int count, boolean close) throws IOException {
		long rawDataSize = writeRecords(writer, count);
		if (close) {
			closeOutput();
		}
		return rawDataSize;
	}

	static long writeRecords(Writer writer, int count) throws IOException {
		long rawDataSize = 0;
		int nx;
		for (nx = 0; nx < count; nx++) {
			byte[] key = composeSortedKey(KEY, count, nx).getBytes();
			byte[] value = (VALUE + nx).getBytes();
			writer.append(key, value);
			rawDataSize += WritableUtils.getVIntSize(key.length) + key.length
					+ WritableUtils.getVIntSize(value.length) + value.length;
		}
		return rawDataSize;
	}

	/**
	 * Insert some leading 0's in front of the value, to make the keys sorted.
	 *
	 * @param prefix
	 * @param total
	 * @param value
	 * @return
	 */
	static String composeSortedKey(String prefix, int total, int value) {
		return String.format("%s%010d", prefix, value);
	}

	/**
	 * Calculate how many digits are in the 10-based integer.
	 *
	 * @param value
	 * @return
	 */
	private static int numberDigits(int value) {
		int digits = 0;
		while ((value = value / 10) > 0) {
			digits++;
		}
		return digits;
	}

	private void readRecords(int count) throws IOException {
		readRecords(fs, path, count, conf);
	}

	static void readRecords(FileSystem fs, Path path, int count,
			Configuration conf) throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();

		try {
			for (int nx = 0; nx < count; nx++, scanner.advance()) {
				Assert.assertFalse(scanner.atEnd());
				// Assert.assertTrue(scanner.next());

				byte[] kbuf = new byte[BUF_SIZE];
				int klen = scanner.entry().getKeyLength();
				scanner.entry().getKey(kbuf);
				Assert.assertEquals(new String(kbuf, 0, klen),
						composeSortedKey(KEY, count, nx));

				byte[] vbuf = new byte[BUF_SIZE];
				int vlen = scanner.entry().getValueLength();
				scanner.entry().getValue(vbuf);
				Assert.assertEquals(new String(vbuf, 0, vlen), VALUE + nx);
			}

			Assert.assertTrue(scanner.atEnd());
			Assert.assertFalse(scanner.advance());
		} finally {
			scanner.close();
			reader.close();
		}
	}

	private void checkBlockIndex(int count, int recordIndex,
			int blockIndexExpected) throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScanner();
		scanner.seekTo(composeSortedKey(KEY, count, recordIndex).getBytes());
		Assert.assertEquals(blockIndexExpected, scanner.currentLocation
				.getBlockIndex());
		scanner.close();
		reader.close();
	}

	private void readValueBeforeKey(int count, int recordIndex)
			throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScannerByKey(composeSortedKey(KEY,
				count, recordIndex).getBytes(), null);

		try {
			byte[] vbuf = new byte[BUF_SIZE];
			int vlen = scanner.entry().getValueLength();
			scanner.entry().getValue(vbuf);
			Assert.assertEquals(new String(vbuf, 0, vlen), VALUE + recordIndex);

			byte[] kbuf = new byte[BUF_SIZE];
			int klen = scanner.entry().getKeyLength();
			scanner.entry().getKey(kbuf);
			Assert.assertEquals(new String(kbuf, 0, klen), composeSortedKey(
					KEY, count, recordIndex));
		} finally {
			scanner.close();
			reader.close();
		}
	}

	private void readKeyWithoutValue(int count, int recordIndex)
			throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);
		Scanner scanner = reader.createScannerByKey(composeSortedKey(KEY,
				count, recordIndex).getBytes(), null);

		try {
			// read the indexed key
			byte[] kbuf1 = new byte[BUF_SIZE];
			int klen1 = scanner.entry().getKeyLength();
			scanner.entry().getKey(kbuf1);
			Assert.assertEquals(new String(kbuf1, 0, klen1), composeSortedKey(
					KEY, count, recordIndex));

			if (scanner.advance() && !scanner.atEnd()) {
				// read the next key following the indexed
				byte[] kbuf2 = new byte[BUF_SIZE];
				int klen2 = scanner.entry().getKeyLength();
				scanner.entry().getKey(kbuf2);
				Assert.assertEquals(new String(kbuf2, 0, klen2),
						composeSortedKey(KEY, count, recordIndex + 1));
			}
		} finally {
			scanner.close();
			reader.close();
		}
	}

	private void readValueWithoutKey(int count, int recordIndex)
			throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);

		Scanner scanner = reader.createScannerByKey(composeSortedKey(KEY,
				count, recordIndex).getBytes(), null);

		byte[] vbuf1 = new byte[BUF_SIZE];
		int vlen1 = scanner.entry().getValueLength();
		scanner.entry().getValue(vbuf1);
		Assert.assertEquals(new String(vbuf1, 0, vlen1), VALUE + recordIndex);

		if (scanner.advance() && !scanner.atEnd()) {
			byte[] vbuf2 = new byte[BUF_SIZE];
			int vlen2 = scanner.entry().getValueLength();
			scanner.entry().getValue(vbuf2);
			Assert.assertEquals(new String(vbuf2, 0, vlen2), VALUE
					+ (recordIndex + 1));
		}

		scanner.close();
		reader.close();
	}

	private void readKeyManyTimes(int count, int recordIndex)
			throws IOException {
		Reader reader = new Reader(fs.open(path), fs.getFileStatus(path)
				.getLen(), conf);

		Scanner scanner = reader.createScannerByKey(composeSortedKey(KEY,
				count, recordIndex).getBytes(), null);

		// read the indexed key
		byte[] kbuf1 = new byte[BUF_SIZE];
		int klen1 = scanner.entry().getKeyLength();
		scanner.entry().getKey(kbuf1);
		Assert.assertEquals(new String(kbuf1, 0, klen1), composeSortedKey(KEY,
				count, recordIndex));

		klen1 = scanner.entry().getKeyLength();
		scanner.entry().getKey(kbuf1);
		Assert.assertEquals(new String(kbuf1, 0, klen1), composeSortedKey(KEY,
				count, recordIndex));

		klen1 = scanner.entry().getKeyLength();
		scanner.entry().getKey(kbuf1);
		Assert.assertEquals(new String(kbuf1, 0, klen1), composeSortedKey(KEY,
				count, recordIndex));

		scanner.close();
		reader.close();
	}

	private void closeOutput() throws IOException {
		if (writer != null) {
			writer.close();
			writer = null;
		}
		if (out != null) {
			out.close();
			out = null;
		}
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{{ article.title}}</title>

{{article.title}}

{{article.body}}


text:
// Copyright Pololu Corporation.  For more information, see http://www.pololu.com/

/*! \file Romi32U4Motors.h */

#pragma once

#include <stdint.h>

/*! \brief Controls motor speed and direction on the Romi 32U4.
 *
 * This library uses Timer 1, so it will conflict with any other libraries using
 * that timer. */
class Romi32U4Motors
{
  public:

    /** \brief Flips the direction of the left motor.
     *
     * You can call this function with an argument of \c true if the left motor
     * of your Romi was not wired in the standard way and you want a
     * positive speed argument to correspond to forward movement.
     *
     * \param flip If true, then positive motor speeds will correspond to the
     * direction pin being high.  If false, then positive motor speeds will
     * correspond to the direction pin being low.
     */
    static void flipLeftMotor(bool flip);

    /** \brief Flips the direction of the right motor.
     *
     * You can call this function with an argument of \c true if the right motor
     * of your Romi was not wired in the standard way and you want a
     * positive speed argument to correspond to forward movement.
     *
     * \param flip If true, then positive motor speeds will correspond to the
     * direction pin being high.  If false, then positive motor speeds will
     * correspond to the direction pin being low. */
    static void flipRightMotor(bool flip);

    /** \brief Sets the speed for the left motor.
     *
     * \param speed A number from -300 to 300 representing the speed and
     * direction of the left motor.  Values of -300 or less result in full speed
     * reverse, and values of 300 or more result in full speed forward. */
    static void setLeftSpeed(int16_t speed);

    /** \brief Sets the speed for the right motor.
     *
     * \param speed A number from -300 to 300 representing the speed and
     * direction of the right motor. Values of -300 or less result in full speed
     * reverse, and values of 300 or more result in full speed forward. */
    static void setRightSpeed(int16_t speed);

    /** \brief Sets the speed for both motors.
     *
     * \param leftSpeed A number from -300 to 300 representing the speed and
     * direction of the right motor. Values of -300 or less result in full speed
     * reverse, and values of 300 or more result in full speed forward.
     * \param rightSpeed A number from -300 to 300 representing the speed and
     * direction of the right motor. Values of -300 or less result in full speed
     * reverse, and values of 300 or more result in full speed forward. */
    static void setSpeeds(int16_t leftSpeed, int16_t rightSpeed);

    /** \brief Turns turbo mode on or off.
     *
     * By default turbo mode is off.  When turbo mode is on, the range of speeds
     * accepted by the other functions in this library becomes -400 to 400
     * (instead of -300 to 300).  Turning turbo mode on allows the Romi to move
     * faster but could decrease the lifetime of the motors.
     *
     * This function does not have any immediate effect on the speed of the
     * motors; it just changes the behavior of the other functions in this
     * library.
     *
     * \param turbo If true, turns turbo mode on.
     *   If false, turns turbo mode off. */
    static void allowTurbo(bool turbo);

  private:

    static inline void init()
    {
        static bool initialized = false;

        if (!initialized)
        {
            initialized = true;
            init2();
        }
    }

    static void init2();

    static int16_t maxSpeed;
    static bool flipLeft;
    static bool flipRight;
};


text:
namespace v8 {
namespace internal {

// static
Handle<JSArray> TemplateObjectDescription::GetTemplateObject(
    Isolate* isolate, Handle<NativeContext> native_context,
    Handle<TemplateObjectDescription> description,
    Handle<SharedFunctionInfo> shared_info, int slot_id) {
  // Check the template weakmap to see if the template object already exists.
  Handle<EphemeronHashTable> template_weakmap =
      native_context->template_weakmap().IsUndefined(isolate)
          ? EphemeronHashTable::New(isolate, 0)
          : handle(EphemeronHashTable::cast(native_context->template_weakmap()),
                   isolate);

  uint32_t hash = shared_info->Hash();
  Object maybe_cached_template = template_weakmap->Lookup(shared_info, hash);
  while (!maybe_cached_template.IsTheHole()) {
    CachedTemplateObject cached_template =
        CachedTemplateObject::cast(maybe_cached_template);
    if (cached_template.slot_id() == slot_id)
      return handle(cached_template.template_object(), isolate);

    maybe_cached_template = cached_template.next();
  }

  // Create the raw object from the {raw_strings}.
  Handle<FixedArray> raw_strings(description->raw_strings(), isolate);
  Handle<JSArray> raw_object = isolate->factory()->NewJSArrayWithElements(
      raw_strings, PACKED_ELEMENTS, raw_strings->length(),
      AllocationType::kOld);

  // Create the template object from the {cooked_strings}.
  Handle<FixedArray> cooked_strings(description->cooked_strings(), isolate);
  Handle<JSArray> template_object = isolate->factory()->NewJSArrayWithElements(
      cooked_strings, PACKED_ELEMENTS, cooked_strings->length(),
      AllocationType::kOld);

  // Freeze the {raw_object}.
  JSObject::SetIntegrityLevel(raw_object, FROZEN, kThrowOnError).ToChecked();

  // Install a "raw" data property for {raw_object} on {template_object}.
  PropertyDescriptor raw_desc;
  raw_desc.set_value(raw_object);
  raw_desc.set_configurable(false);
  raw_desc.set_enumerable(false);
  raw_desc.set_writable(false);
  JSArray::DefineOwnProperty(isolate, template_object,
                             isolate->factory()->raw_string(), &raw_desc,
                             Just(kThrowOnError))
      .ToChecked();

  // Freeze the {template_object} as well.
  JSObject::SetIntegrityLevel(template_object, FROZEN, kThrowOnError)
      .ToChecked();

  // Insert the template object into the template weakmap.
  Handle<HeapObject> previous_cached_templates = handle(
      HeapObject::cast(template_weakmap->Lookup(shared_info, hash)), isolate);
  Handle<CachedTemplateObject> cached_template = CachedTemplateObject::New(
      isolate, slot_id, template_object, previous_cached_templates);
  template_weakmap = EphemeronHashTable::Put(
      isolate, template_weakmap, shared_info, cached_template, hash);
  native_context->set_template_weakmap(*template_weakmap);

  return template_object;
}

Handle<CachedTemplateObject> CachedTemplateObject::New(
    Isolate* isolate, int slot_id, Handle<JSArray> template_object,
    Handle<HeapObject> next) {
  DCHECK(next->IsCachedTemplateObject() || next->IsTheHole());
  Factory* factory = isolate->factory();
  Handle<CachedTemplateObject> result = Handle<CachedTemplateObject>::cast(
      factory->NewStruct(TUPLE3_TYPE, AllocationType::kOld));
  result->set_slot_id(slot_id);
  result->set_template_object(*template_object);
  result->set_next(*next);
  return result;
}

}  // namespace internal
}  // namespace v8


text:
require 'spec_helper'

module ITSF::FundReports
  describe Security do
    describe 'associations' do
      it { should have_many :trades }
    end # describe 'associations'

    describe 'validations' do
      it { should validate_presence_of :name }
      it { should validate_uniqueness_of :name }
      it { should validate_presence_of :isin }
      it { should validate_uniqueness_of :isin }
    end # describe 'validations'
  end # describe Security
end # module ITSF::FundReports


text:
package com.spotify.scio

package object grpc extends SCollectionSyntax


text:
<?php

namespace Behance\Middleware;

use Slim\Http\Request;
use Slim\Http\Response;
use Behance\Model\User;

class TokenAuth {
    const WHITELIST = ['\/auth'];

    public function __construct($app) {
        $this->app = $app;
    }

    /**
     * Check against the DB if the token is valid
     *
     * @param string $auth_token
     * @return bool
     */
    public function authenticate_and_set_user($auth_token) {
       $this->user = $this->app->user = User::query()->where('token', '=', $auth_token)->get();
       if (isset($this->user[0])) {
           return true;
       }
       return false;
    }

    /**
     * This function will compare the provided url against the whitelist and
     * return wether the $url is public or not
     *
     * @param string $url
     * @return bool
     */
    public function isPublicUrl($url) {
        $patterns_flattened = implode('|', self::WHITELIST);
       // var_dump($patterns_flattened); die();
        $matches = null;
        preg_match('/' . $patterns_flattened . '/', $url, $matches);
        return (count($matches) > 0);
    }

    public function __invoke(Request $request, Response $response, $next) {
        //Get the token sent from jquery
        $auth_token = $request->getHeader('auth_token');
        //We can check if the url requested is public or protected
        if ($this->isPublicUrl($request->getUri())) {
            //if public, then we just call the next middleware and continue execution normally
            return $next($request, $response);
        } else {
            //If protected url, we check if our token is valid and set the user
            if ($request->hasHeader('auth_token') && $this->authenticate_and_set_user($request->getHeader('auth_token')[0])) {
                return $next($request, $response);
            } else {
                return $response
                    ->withStatus(403)
                    ->write('Not Authorized');
            }
        }
    }

}


text:
package br.pucpr.jvlppm.classicmix.android;

import br.pucpr.jvlppm.classicmix.services.HighScore;
import br.pucpr.jvlppm.classicmix.services.Settings;
import br.pucpr.jvlppm.classicmix.services.Sound;

public class Application extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Settings.init(this);
        HighScore.init(this);
        Sound.init(this);
    }
}


text:
id: gen-test
title: Test Generation
sidebar_label: Test Generation
keywords:
  - test
  - generation
---


text:
When using [Vue's SSR capabilities](https://ssr.vuejs.org), portal-vue can't work reliably for a couple of reasons:

1. The internal Store (the [Wormhole](../api/wormhole.md)) that's caching vnodes and connecting `<portal>` components to their `<portal-target>` counterparts, is a singleton. As such, changes to the Wormhole persist between requests, leading to all sorts of problems.
2. In SSR, Vue renders the page directly to a string, there are not reactive updates applied. Consequently, a `<portal-target>` appearing before a `<portal>` will render an empty div on the server whereas it will render the sent content on the client, resulting in a hydration vdom mismatch error, while a `<portal-target>` _following_ a `<portal>` would technically work.

## Solutions

### Disabling the portal on the server

For the aforementioned reasons, starting with <Badge text="2.1.2" />, content won't be cached in the Wormhole anymore when on the server. Consequently, the HTML rendered by the server won't contain any DOM nodes in place of any `<portal-target>`

### Handling on the client

We want to display the `<portal-target>` content on the client, though. In order to prevent any hydration mismatches, we can use a _really_ tiny [component called `<no-ssr>`](https://github.com/egoist/vue-no-ssr), written by [@egoist](https://github.com/egoist), which can solve this problem.

We wrap our `<portal-target>` elements in it, and it will prevent rendering on the server as well as on the client during hydration, preventing the error described above. Immediatly _after_ hyration, it will render the previously "hidden" content, so that the `<portal-target>` will render its content. Usually the user can hardly notice this as the update is near-immediate.

Example:

```html
<no-ssr>
  <portal-target name="destination">
</no-ssr>

<!-- with placeholder text, usually not necessary -->
<no-ssr placeholder="Loading...">
  <portal-target name="destination">
</no-ssr>
```


text:
package codemasters;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/**
 *
 * @author frasiek
 */
public class Reader {

    private final ArrayList<Element> lines = new ArrayList<>();

    public Reader(String file) throws FileNotFoundException, IOException {
        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
            String line;
            while ((line = br.readLine()) != null) {
                lines.add(new Element(lines.size(), line));
            }
        }
    }

    public ArrayList<Element> getList() {
        return lines;
    }

}


text:
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace DazPaz.Cyclone.Test
{
	[TestClass]
	public class ParticleForceRegistryTests
	{
		private const double Duration = 1.5;

		[TestMethod]
		public void UpdateForces_TheParticleForceRegistryUpdatesTheForcesOfAllItemsInItsRegistry()
		{
			var forceRegistry = new ParticleForceRegistry();
			var mockParticles = new List<Mock<IParticle>>();
			var mockGenerators = new List<Mock<IParticleForceGenerator>>();

			for ( var i = 0; i < 3; i++)
			{
				var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
				var mockGenerator = new Mock<IParticleForceGenerator>(MockBehavior.Strict);
				mockGenerator.Setup(g => g.UpdateForce(mockParticle.Object, Duration));

				mockParticles.Add(mockParticle);
				mockGenerators.Add(mockGenerator);

				var registration = new ParticleForceRegistration
				{
					Generator = mockGenerator.Object,
					Particle = mockParticle.Object
				};

				forceRegistry.Add(registration);
			}

			forceRegistry.UpdateForces(1.5);

			Assert.AreEqual(3, forceRegistry.Count);
			foreach (var particle in mockParticles)
			{
				particle.VerifyAll();
			}

			foreach (var generator in mockGenerators)
			{
				generator.VerifyAll();
			}
		}
	}
}


text:
import Ember from 'ember';
import ModalComponent from 'ghost-admin/components/modals/base';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';

const {
    RSVP: {Promise},
    inject: {service},
    run
} = Ember;
const emberA = Ember.A;

export default ModalComponent.extend(ValidationEngine, {
    classNames: 'modal-content invite-new-user',

    role: null,
    roles: null,
    authorRole: null,
    submitting: false,

    validationType: 'inviteUser',

    notifications: service(),
    store: service(),

    init() {
        this._super(...arguments);

        // populate roles and set initial value for the dropdown
        run.schedule('afterRender', this, function () {
            this.get('store').query('role', {permissions: 'assign'}).then((roles) => {
                let authorRole = roles.findBy('name', 'Author');

                this.set('roles', roles);
                this.set('authorRole', authorRole);

                if (!this.get('role')) {
                    this.set('role', authorRole);
                }
            });
        });
    },

    willDestroyElement() {
        this._super(...arguments);
        // TODO: this should not be needed, ValidationEngine acts as a
        // singleton and so it's errors and hasValidated state stick around
        this.get('errors').clear();
        this.set('hasValidated', emberA());
    },

    validate() {
        let email = this.get('email');

        // TODO: either the validator should check the email's existence or
        // the API should return an appropriate error when attempting to save
        return new Promise((resolve, reject) => {
            return this._super().then(() => {
                this.get('store').findAll('user', {reload: true}).then((result) => {
                    let invitedUser = result.findBy('email', email);

                    if (invitedUser) {
                        this.get('errors').clear('email');
                        if (invitedUser.get('status') === 'invited' || invitedUser.get('status') === 'invited-pending') {
                            this.get('errors').add('email', 'A user with that email address was already invited.');
                        } else {
                            this.get('errors').add('email', 'A user with that email address already exists.');
                        }

                        // TODO: this shouldn't be needed, ValidationEngine doesn't mark
                        // properties as validated when validating an entire object
                        this.get('hasValidated').addObject('email');
                        reject();
                    } else {
                        resolve();
                    }
                });
            }, () => {
                // TODO: this shouldn't be needed, ValidationEngine doesn't mark
                // properties as validated when validating an entire object
                this.get('hasValidated').addObject('email');
                reject();
            });
        });
    },

    actions: {
        setRole(role) {
            this.set('role', role);
        },

        confirm() {
            let email = this.get('email');
            let role = this.get('role');
            let notifications = this.get('notifications');
            let newUser;

            this.validate().then(() => {
                this.set('submitting', true);

                newUser = this.get('store').createRecord('user', {
                    email,
                    role,
                    status: 'invited'
                });

                newUser.save().then(() => {
                    let notificationText = `Invitation sent! (${email})`;

                    // If sending the invitation email fails, the API will still return a status of 201
                    // but the user's status in the response object will be 'invited-pending'.
                    if (newUser.get('status') === 'invited-pending') {
                        notifications.showAlert('Invitation email was not sent.  Please try resending.', {type: 'error', key: 'invite.send.failed'});
                    } else {
                        notifications.showNotification(notificationText, {key: 'invite.send.success'});
                    }
                }).catch((errors) => {
                    newUser.deleteRecord();
                    notifications.showErrors(errors, {key: 'invite.send'});
                }).finally(() => {
                    this.send('closeModal');
                });
            });
        }
    }
});


text:
SYNONYM

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

#### Published in
Annls mycol. 11: 547 (1913)

#### Original name
Sphaeria miconiae Duby, 1836

### Remarks
null


text:
import _ol_tilecoord_ from '../../../src/ol/tilecoord.js';
import TileGrid from '../../../src/ol/tilegrid/TileGrid.js';

describe('ol.TileCoord', function() {

  describe('create', function() {
    it('sets x y z properties as expected', function() {
      const tileCoord = [1, 2, 3];
      expect(tileCoord[0]).to.eql(1);
      expect(tileCoord[1]).to.eql(2);
      expect(tileCoord[2]).to.eql(3);
    });
  });

  describe('call quadKey', function() {
    it('returns expected string', function() {
      const tileCoord = [3, 3, 5];
      const s = _ol_tilecoord_.quadKey(tileCoord);
      expect(s).to.eql('213');
    });
  });

  describe('getKey()', function() {
    it('returns a key for a tile coord', function() {
      const key = _ol_tilecoord_.getKey([1, 2, 3]);
      expect(key).to.eql('1/2/3');
    });
  });

  describe('fromKey()', function() {
    it('returns a tile coord given a key', function() {
      const tileCoord = [1, 2, 3];
      const key = _ol_tilecoord_.getKey(tileCoord);

      const returned = _ol_tilecoord_.fromKey(key);
      expect(returned).to.eql(tileCoord);
    });
  });

  describe('hash', function() {
    it('produces different hashes for different tile coords', function() {
      const tileCoord1 = [3, 2, 1];
      const tileCoord2 = [3, 1, 1];
      expect(_ol_tilecoord_.hash(tileCoord1)).not.to.eql(
        _ol_tilecoord_.hash(tileCoord2));
    });
  });

  describe('withinExtentAndZ', function() {

    it('restricts by z', function() {
      const tileGrid = new TileGrid({
        extent: [10, 20, 30, 40],
        tileSize: 10,
        resolutions: [2, 1],
        minZoom: 1
      });
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, -1], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([1, 0, -1], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([2, 0, -1], tileGrid)).to.be(false);
    });

    it('restricts by extent when extent defines tile ranges', function() {
      const tileGrid = new TileGrid({
        extent: [10, 20, 30, 40],
        sizes: [[3, -3]],
        tileSize: 10,
        resolutions: [1]
      });
      expect(_ol_tilecoord_.withinExtentAndZ([0, 1, -2], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 2, -1], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, -3], tileGrid)).to.be(false);
    });

    it('restricts by extent when sizes define tile ranges', function() {
      const tileGrid = new TileGrid({
        origin: [10, 20],
        sizes: [[3, 3]],
        tileSize: 10,
        resolutions: [1]
      });
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, 0], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, -1, 0], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, -1], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 2, 2], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 3, 0], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, 3], tileGrid)).to.be(false);
    });

    it('restricts by extent when sizes (neg y) define tile ranges', function() {
      const tileGrid = new TileGrid({
        origin: [10, 40],
        sizes: [[3, -3]],
        tileSize: 10,
        resolutions: [1]
      });
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, -1], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, -1, -1], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, 0], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 2, -3], tileGrid)).to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 3, -1], tileGrid)).to.be(false);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, -4], tileGrid)).to.be(false);
    });

    it('does not restrict by extent with no extent or sizes', function() {
      const tileGrid = new TileGrid({
        origin: [10, 20],
        tileSize: 10,
        resolutions: [1]
      });
      expect(_ol_tilecoord_.withinExtentAndZ([0, Infinity, 0], tileGrid))
        .to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, Infinity], tileGrid))
        .to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, -Infinity, 0], tileGrid))
        .to.be(true);
      expect(_ol_tilecoord_.withinExtentAndZ([0, 0, Infinity], tileGrid))
        .to.be(true);
    });
  });

});


text:
package com.commercetools.pspadapter.payone.transaction.common;

import com.commercetools.pspadapter.payone.domain.ctp.CustomTypeBuilder;
import com.commercetools.pspadapter.payone.domain.ctp.PaymentWithCartLike;
import com.commercetools.pspadapter.payone.mapping.CustomFieldKeys;
import com.commercetools.pspadapter.payone.transaction.TransactionExecutor;
import io.sphere.sdk.client.BlockingSphereClient;
import io.sphere.sdk.payments.Payment;
import io.sphere.sdk.payments.Transaction;
import io.sphere.sdk.payments.TransactionState;
import io.sphere.sdk.payments.commands.PaymentUpdateCommand;
import io.sphere.sdk.payments.commands.updateactions.AddInterfaceInteraction;
import io.sphere.sdk.payments.commands.updateactions.ChangeTransactionState;

import javax.annotation.Nonnull;
import java.time.ZonedDateTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import static java.lang.String.format;

/**
 * @author Jan Wolter
 * <p>
 * "Executes" a transaction by setting the status to Failure.
 */
public class UnsupportedTransactionExecutor implements TransactionExecutor {
    private final BlockingSphereClient client;

    /**
     * Initializes the executor.
     *
     * @param client the commercetools platform client
     */
    public UnsupportedTransactionExecutor(final BlockingSphereClient client) {
        this.client = client;
    }

    @Override
    @Nonnull
    public PaymentWithCartLike executeTransaction(@Nonnull final PaymentWithCartLike paymentWithCartLike,
                                                  @Nonnull final Transaction transaction) {
        final Payment payment = paymentWithCartLike.getPayment();
        final ChangeTransactionState changeTransactionState = ChangeTransactionState.of(
                TransactionState.FAILURE,
                transaction.getId());

        final Map<String, Object> fieldsMap = new HashMap<>();
        fieldsMap.put(CustomFieldKeys.TIMESTAMP_FIELD, ZonedDateTime.now());
        fieldsMap.put(CustomFieldKeys.TRANSACTION_ID_FIELD, transaction.getId());
        fieldsMap.put(CustomFieldKeys.MESSAGE_FIELD, format("Transaction type [%s] not supported for payment method [%s].",
            transaction.getType(), payment.getPaymentMethodInfo().getMethod()));

        final AddInterfaceInteraction addInterfaceInteraction = AddInterfaceInteraction.ofTypeKeyAndObjects(
                CustomTypeBuilder.PAYONE_UNSUPPORTED_TRANSACTION, fieldsMap);

        return paymentWithCartLike.withPayment(
            client.executeBlocking(
                PaymentUpdateCommand.of(payment, Arrays.asList(changeTransactionState, addInterfaceInteraction))));
    }

}


text:
require 'test_helper'

# FIXME: move to system directory for system tests

class ConfigurationSingletonTest < ActiveSupport::TestCase
  #FIXME: this approach is ugly and difficult to follow
  #
  # Marshaling the Configuration doesn't work because the methods are evaluated when
  # you call them: Configuration doesn't store data for most of its options.
  #
  # Using Bundler.with_clean_env to provide several unit tests, one for loading
  # dotenv, and one for ConfigurationSingleton.new once expected env is loaded, doesn't
  # let us test dataroot because of OodAppkit's approach to storing the dataroot
  # as an instance variable.
  #
  # One solution to clean up the below code would be to implement a
  # ConfigurationSingleton#to_h method.
  def runner(code, env: 'development', envvars: '')
    Tempfile.open('runnerbin') do |f|
      Bundler.with_clean_env do
        f.write(code)
        f.close
        `RAILS_ENV=#{env} #{envvars} bin/rails runner -e #{env} #{f.path}`
      end
    end
  end

  # Use bin/rails runner to get values set in Configuration after initialization
  # using marshal to pass the OpenStruct between processes
  #
  # @return [OpenStruct] attrs have values set in Configuration after initialization
  def config_via_runner(env: 'development', envvars: '')
    code = %q(puts Marshal.dump(
        OpenStruct.new(
          dataroot: Configuration.dataroot,
          production_database_path: Configuration.production_database_path,
          load_external_config: Configuration.load_external_config?,
          show_job_options_account_field: Configuration.show_job_options_account_field?
        )
      )
    )
    Marshal.load(runner(code, env: env, envvars: envvars))
  end

  test "tests should not be run with .env.local* files in directory" do
    assert Dir.glob(".env.local{.development,.production,}").none?, "these tests should not be run with a .env.local or .env.local.development or .env.local.production"
  end

  test "configuration defaults in development env" do
    config = config_via_runner

    assert_equal Rails.root.join("data").to_s, config.dataroot.to_s
    refute config.load_external_config
    assert config.show_job_options_account_field
  end

  test "loading custom OSC external config in production env" do
    config_root = Rails.root.join('config','examples','osc')
    config = config_via_runner(env: 'production', envvars: "OOD_APP_CONFIG_ROOT=#{config_root}")

    assert_equal File.expand_path("~/ondemand/data/sys/myjobs"), config.dataroot.to_s
    assert_equal File.expand_path("~/ondemand/data/sys/myjobs/production.sqlite3"), config.production_database_path.to_s
    assert_equal true, config.load_external_config
  end

  test "loading custom AweSim external config in production env" do
    config_root = Rails.root.join('config','examples','awesim')
    config = config_via_runner(env: 'production', envvars: "OOD_APP_CONFIG_ROOT=#{config_root}")

    assert_equal File.expand_path("~/awesim/data/sys/myjobs"), config.dataroot.to_s
    assert_equal File.expand_path("~/awesim/data/sys/myjobs/production.sqlite3"), config.production_database_path.to_s
    assert_equal true, config.load_external_config
  end

  test "setting dataroot and database path" do
    Bundler.with_clean_env do
      ENV['OOD_DATAROOT'] = nil
      ENV['RAILS_ENV'] = 'production'

      # default
      assert_equal File.expand_path("~/ondemand/data/sys/myjobs"), ConfigurationSingleton.new.dataroot.to_s
      assert_equal File.expand_path("~/ondemand/data/sys/myjobs/production.sqlite3"), ConfigurationSingleton.new.production_database_path.to_s

      # set to tmp dir
      ENV['OOD_DATAROOT'] = "/tmp/myjobs"
      assert_equal "/tmp/myjobs", ConfigurationSingleton.new.dataroot.to_s
      assert_equal "/tmp/myjobs/production.sqlite3", ConfigurationSingleton.new.production_database_path.to_s

      # set seprate database path
      ENV['DATABASE_PATH'] = "/tmp/db.sqlite3"
      assert_equal "/tmp/db.sqlite3", ConfigurationSingleton.new.production_database_path.to_s

      ENV['DATABASE_PATH'] = "~root/db.sqlite3"
      assert_equal "/root/db.sqlite3", ConfigurationSingleton.new.production_database_path.to_s
    end
  end

  test "hide account field" do
    Bundler.with_clean_env do
      assert ConfigurationSingleton.new.show_job_options_account_field?

      ENV['OOD_SHOW_JOB_OPTIONS_ACCOUNT_FIELD'] = '1'
      assert ConfigurationSingleton.new.show_job_options_account_field?

      ENV['OOD_SHOW_JOB_OPTIONS_ACCOUNT_FIELD'] = '0'
      refute ConfigurationSingleton.new.show_job_options_account_field?

      ENV['OOD_SHOW_JOB_OPTIONS_ACCOUNT_FIELD'] = 'false'
      refute ConfigurationSingleton.new.show_job_options_account_field?
    end
  end
end


text:
package io.vamp.persistence

import io.vamp.common.Namespace
import io.vamp.common.notification.NotificationProvider
import io.vamp.model.artifact._
import io.vamp.persistence.notification.UnsupportedPersistenceRequest

trait TypeOfArtifact {
  this: NotificationProvider ⇒

  protected def type2string(`type`: Class[_]): String = `type` match {
    // gateway persistence
    case t if classOf[RouteTargets].isAssignableFrom(t) ⇒ "route-targets"
    case t if classOf[GatewayPort].isAssignableFrom(t) ⇒ "gateway-ports"
    case t if classOf[GatewayServiceAddress].isAssignableFrom(t) ⇒ "gateway-services"
    case t if classOf[GatewayDeploymentStatus].isAssignableFrom(t) ⇒ "gateway-deployment-statuses"
    case t if classOf[InternalGateway].isAssignableFrom(t) ⇒ "internal-gateway"
    // deployment persistence
    case t if classOf[DeploymentServiceStatus].isAssignableFrom(t) ⇒ "deployment-service-statuses"
    case t if classOf[DeploymentServiceScale].isAssignableFrom(t) ⇒ "deployment-service-scales"
    case t if classOf[DeploymentServiceInstances].isAssignableFrom(t) ⇒ "deployment-service-instances"
    case t if classOf[DeploymentServiceEnvironmentVariables].isAssignableFrom(t) ⇒ "deployment-service-environment-variables"
    case t if classOf[DeploymentServiceHealth].isAssignableFrom(t) ⇒ "deployment-service-health"
    // workflow persistence
    case t if classOf[WorkflowBreed].isAssignableFrom(t) ⇒ "workflow-breed"
    case t if classOf[WorkflowStatus].isAssignableFrom(t) ⇒ "workflow-status"
    case t if classOf[WorkflowScale].isAssignableFrom(t) ⇒ "workflow-scale"
    case t if classOf[WorkflowNetwork].isAssignableFrom(t) ⇒ "workflow-network"
    case t if classOf[WorkflowArguments].isAssignableFrom(t) ⇒ "workflow-arguments"
    case t if classOf[WorkflowEnvironmentVariables].isAssignableFrom(t) ⇒ "workflow-environment-variables"
    case t if classOf[WorkflowInstances].isAssignableFrom(t) ⇒ "workflow-instances"
    case t if classOf[WorkflowHealth].isAssignableFrom(t) ⇒ "workflow-health"
    //
    case t if classOf[Gateway].isAssignableFrom(t) ⇒ "gateways"
    case t if classOf[Deployment].isAssignableFrom(t) ⇒ "deployments"
    case t if classOf[Breed].isAssignableFrom(t) ⇒ "breeds"
    case t if classOf[Blueprint].isAssignableFrom(t) ⇒ "blueprints"
    case t if classOf[Sla].isAssignableFrom(t) ⇒ "slas"
    case t if classOf[Scale].isAssignableFrom(t) ⇒ "scales"
    case t if classOf[Escalation].isAssignableFrom(t) ⇒ "escalations"
    case t if classOf[Route].isAssignableFrom(t) ⇒ "routes"
    case t if classOf[Condition].isAssignableFrom(t) ⇒ "conditions"
    case t if classOf[Rewrite].isAssignableFrom(t) ⇒ "rewrites"
    case t if classOf[Workflow].isAssignableFrom(t) ⇒ "workflows"
    case t if classOf[Namespace].isAssignableFrom(t) ⇒ "namespaces"
    case t if classOf[Template].isAssignableFrom(t) ⇒ "templates"
    case _ ⇒ throwException(UnsupportedPersistenceRequest(`type`))
  }
}


text:
<?php

use App\Models\Evaluator;
use App\Models\Exercise;
use App\Models\User;
use Illuminate\Database\Seeder;

class EvaluatorTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $exercises = Exercise::all();
        $u = User::all();

        foreach ($exercises as $exercise) {

            $users = $u->random(20);
            foreach ($users as $user) {
                factory(Evaluator::class)->create([
                    'exercise_id' => $exercise->id,
                    'user_id' => $user->id,
                ]);
            }
        }
    }
}


text:
class Staffs::StaffSignupController < ApplicationController
    before_action :authenticate_admin!
    def new
        @staff = StaffSignup.new
    end

    def create
        @staff = StaffSignup.new(staff_params)

        if @staff.save
            StaffMailer.signup_email(@staff).deliver_now
            flash[:notice] = "Staff Registered Successfully"
            redirect_to system_path
        else
            flash.now[:alert] = "Error! Staff not registered"
            render 'new'
        end
    end

    def show
        @staff = StaffSignup.find(params[:id])
    end

    def edit
        @staff = StaffSignup.find(params[:id])
        render 'new'
    end

    def update
        @staff = StaffSignup.find(params[:id])

        if @staff.update(staff_params)
            flash[:notice] = "Staff updated successfully"
            redirect_to @staff
        else
            flash.now[:alert] = "Staff not updated"
            render 'new'
        end
    end

    def staff_applications
        @staffs_signups = StaffSignup.all
    end
    private
    def staff_params
        params.require(:staff_signup).permit(
            :email,
            :role
        )
    end
end


text:
<!DOCTYPE html>

        <link href='https://api.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css' rel='stylesheet' />
        <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
        <link rel="stylesheet" href="style.css">

        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/MarkerCluster.Default.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/MarkerCluster.css" />

RPI Incident Map

Visualization of the Incidents Reported to Public Safety

Filter Options:

Select Location

Select Type of Incident

Select Month

                        ×

                            Amos Eaton
                            Barton
                            BAR-H
                            City Station
                            Lally
                            Student Union

                        ×

                            January 2016
                            February 2016
                            March 2016
                            April 2016
                            May 2016
                            June 2016
                            July 2016
                            August 2016
                            September 2016
                            October 2016
                            November 2016
                            December 2016

                        ×

                            Mischief
                            Fire Alarm
                            Medical Incident
                            Intoxication
                            Property Damage
                            Larceny
                            Assault


text:
namespace media {

EllipseFrame::EllipseFrame(const FrameBase& aFrame)
    {
    Q_ASSERT(isCopyable(aFrame));
    setMaxVectors(aFrame.getDimensionT(VectorNo).mResolution);
    setVectorSizeT(VectorSize);
    int point[Dimensions] = {0, 0};
    for (point[VectorNo] = 0; point[VectorNo] < aFrame.getDimensionT(VectorNo).mResolution; ++point[VectorNo])
        for (point[ParamNo] = 0; point[ParamNo] < aFrame.getDimensionT(ParamNo).mResolution; ++point[ParamNo])
            setSampleT(point, aFrame.getSampleT(point));
    }

cv::RotatedRect EllipseFrame::getRect(int aIndex) const
    {
    cv::RotatedRect rect;

    int point[Dimensions] = {aIndex, CenterX};
    rect.center.x = getSampleT(point);
    point[ParamNo] = CenterY;
    rect.center.y = getSampleT(point);
    point[ParamNo] = SizeWidth;
    rect.size.width = getSampleT(point);
    point[ParamNo] = SizeHeight;
    rect.size.height = getSampleT(point);
    point[ParamNo] = AngleRotate;
    rect.angle = getSampleT(point);

    return rect;
    }

} // namespace media


text:
import { Skeleton } from '@rocket.chat/fuselage';
import React from 'react';

import Subtitle from '../../components/basic/Subtitle';
import { useTranslation } from '../../contexts/TranslationContext';
import { useFormatDateAndTime } from '../../hooks/useFormatDateAndTime';
import { useFormatDuration } from '../../hooks/useFormatDuration';
import { DescriptionList } from './DescriptionList';

export function RocketChatSection({ info, statistics, isLoading }) {
	const t = useTranslation();
	const formatDateAndTime = useFormatDateAndTime();
	const formatDuration = useFormatDuration();

	const s = (fn) => (isLoading ? <Skeleton width='50%' /> : fn());

	const appsEngineVersion = info && info.marketplaceApiVersion;

	return <DescriptionList
		data-qa='rocket-chat-list'
		title={<Subtitle data-qa='rocket-chat-title'>{t('Rocket.Chat')}</Subtitle>}
	>
		<DescriptionList.Entry label={t('Version')}>{s(() => statistics.version)}</DescriptionList.Entry>
		{appsEngineVersion && <DescriptionList.Entry label={t('Apps_Engine_Version')}>{appsEngineVersion}</DescriptionList.Entry>}
		<DescriptionList.Entry label={t('DB_Migration')}>{s(() => statistics.migration.version)}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('DB_Migration_Date')}>{s(() => formatDateAndTime(statistics.migration.lockedAt))}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('Installed_at')}>{s(() => formatDateAndTime(statistics.installedAt))}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('Uptime')}>{s(() => formatDuration(statistics.process.uptime))}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('Deployment_ID')}>{s(() => statistics.uniqueId)}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('PID')}>{s(() => statistics.process.pid)}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('Running_Instances')}>{s(() => statistics.instanceCount)}</DescriptionList.Entry>
		<DescriptionList.Entry label={t('OpLog')}>{s(() => (statistics.oplogEnabled ? t('Enabled') : t('Disabled')))}</DescriptionList.Entry>
	</DescriptionList>;
}


text:
FROM ubuntu:14.04
MAINTAINER Juan Jose Amor <jjamorNOSPAM@gmail.com>

ADD http://nginx.org/keys/nginx_signing.key /root/
RUN apt-key add /root/nginx_signing.key
ADD nginx.list /etc/apt/sources.list.d/
ADD http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb /root/
RUN dpkg -i /root/erlang-solutions_1.0_all.deb && apt-get update
RUN apt-get install -y ca-certificates-java default-jre-headless emacsen-common fontconfig \
  build-essential git git-flow \
  fontconfig-config fonts-dejavu-core hicolor-icon-theme icedtea-7-jre-jamvm \
  java-common libatk1.0-0 libatk1.0-data libavahi-client3 libavahi-common-data \
  libavahi-common3 libcairo2 libcups2 libdatrie1 libdrm-intel1 libdrm-nouveau2 \
  libdrm-radeon1 libfontconfig1 libfontenc1 libgdk-pixbuf2.0-0 \
  libgdk-pixbuf2.0-common libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa \
  libglu1-mesa libgraphite2-3 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common \
  libharfbuzz0b libice6 libjasper1 libjbig0 libjpeg-turbo8 libjpeg8 liblcms2-2 \
  libllvm3.4 libltdl7 libnspr4 libnss3 libnss3-1d libnss3-nssdb libodbc1 \
  libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpciaccess0 \
  libpixman-1-0 libsctp1 libsm6 libtcl8.6 libthai-data libthai0 libtiff5 \
  libtk8.6 libtxc-dxtn-s2tc0 libutempter0 libwxbase2.8-0 libwxgtk2.8-0 \
  libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 \
  libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcomposite1 \
  libxcursor1 libxdamage1 libxfixes3 libxft2 libxi6 libxinerama1 libxmu6 \
  libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 \
  libxxf86dga1 libxxf86vm1 lksctp-tools openjdk-7-jre-headless tcl tcl8.6 tk \
  tk8.6 tzdata-java x11-common x11-utils xbitmaps xterm \
  postfix opendkim-tools opendkim nginx bundler ruby-childprocess ruby curl \
  ruby-erubis ruby-ffi ruby-i18n ruby-log4r ruby-net-scp ruby-net-ssh ruby1.9.1
RUN apt-get install -y esl-erlang=1:17.1 && apt-mark hold esl-erlang erlang-mode
# Limits: Try to establish open file limits required for project users.
# This is effective only if you run image with "docker run --privileged=true"
RUN echo "* soft nofile 70000" >> /etc/security/limits.conf && \
echo "* hard nofile 100000" >> /etc/security/limits.conf && \
echo "session required pam_limits.so" >> /etc/pam.d/common-session && \
echo "session required pam_limits.so" >> /etc/pam.d/common-session-noninteractive && \
echo "fs.file-max = 379284" >> /etc/sysctl.conf


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>org.apache.giraph.counters (Apache Giraph Core 1.0.0 API)</title>
<meta name="date" content="2014-01-02">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

程序包 org.apache.giraph.counters

Package of all the Giraph Hadoop counters related data.

请参阅: 说明

类概要

类
说明

GiraphHadoopCounter

Wrapper around Hadoop Counter to make it easier to use.

GiraphStats

Hadoop Counters in group "Giraph Stats".

GiraphTimers

Hadoop Counters in group "Giraph Timers" for timing things.

HadoopCountersBase

Base class for groups of Hadoop Counters.

程序包org.apache.giraph.counters的说明

Package of all the Giraph Hadoop counters related data.

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

Copyright © 2011-2014 The Apache Software Foundation. All Rights Reserved.


text:
<versions>
 <version displayName="JSF 1.1.02 - Reference Implementation">
  <lib type="core" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-1.1" />
 </version>
 <version displayName="JSF 1.2" servlet-version="2.5">
  <lib type="core" location="../lib/jsf-1.2"/>
  <lib type="common" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-1.2" />
 </version>
 <version displayName="JSF 1.2 with Facelets" servlet-version="2.5">
  <lib type="core" location="../lib/jsf-1.2" />
  <lib type="common" location="../lib/facelets" />
  <lib type="common" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-1.2-facelets" />
 </version>
 <version displayName="JSF 2.0" servlet-version="3.0" min-servlet-version="2.5">
  <lib type="core" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-2.0" />
 </version>
 <version displayName="JSF 2.1" servlet-version="3.0" min-servlet-version="2.5">
  <lib type="core" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-2.1" />
 </version>
 <version displayName="JSF 2.2" servlet-version="3.0" min-servlet-version="2.5">
  <lib type="core" location="../lib/ApacheCommon2.3" />
  <refLib type="servlet" location="../servlet" />
  <projectTempl location="./jsf-2.2" />
 </version>
</versions>