text:
package org.apache.geode.management.internal.cli.commands;

import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;

import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.internal.cache.wan.MyAsyncEventListener;
import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.AEQTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;

@Category({AEQTest.class})
public class ListAsyncEventQueuesCommandDUnitTest {

  @ClassRule
  public static ClusterStartupRule lsRule = new ClusterStartupRule();

  @Rule
  public GfshCommandRule gfsh = new GfshCommandRule(locator::getJmxPort, jmxManager);

  private static MemberVM locator;

  @BeforeClass
  public static void beforeClass() {
    locator = lsRule.startLocatorVM(0);
    lsRule.startServerVM(1, "group1", locator.getPort());
    lsRule.startServerVM(2, "group2", locator.getPort());
  }

  @Test
  public void list() {
    gfsh.executeAndAssertThat("list async-event-queue").statusIsSuccess()
        .containsOutput(CliStrings.LIST_ASYNC_EVENT_QUEUES__NO_QUEUES_FOUND_MESSAGE);

    gfsh.executeAndAssertThat("create async-event-queue --id=queue1 --group=group1 --listener="
        + MyAsyncEventListener.class.getName()).statusIsSuccess();

    gfsh.executeAndAssertThat("create async-event-queue --id=queue2 --group=group2 --listener="
        + MyAsyncEventListener.class.getName()).statusIsSuccess();

    locator.waitUntilAsyncEventQueuesAreReadyOnExactlyThisManyServers("queue1", 1);
    locator.waitUntilAsyncEventQueuesAreReadyOnExactlyThisManyServers("queue2", 1);

    gfsh.executeAndAssertThat("list async-event-queue").statusIsSuccess()
        .tableHasRowCount("Member", 2).tableHasRowWithValues("Member", "ID", "server-1", "queue1")
        .tableHasRowWithValues("Member", "ID", "server-2", "queue2");

    // create another async event queue on the entire cluster, verify that the command will list all
    gfsh.executeAndAssertThat(
        "create async-event-queue --id=queue --listener=" + MyAsyncEventListener.class.getName())
        .statusIsSuccess();

    gfsh.executeAndAssertThat("list async-event-queue").statusIsSuccess()
        .tableHasRowCount("Member", 4).tableHasRowWithValues("Member", "ID", "server-1", "queue1")
        .tableHasRowWithValues("Member", "ID", "server-2", "queue2")
        .tableHasRowWithValues("Member", "ID", "server-1", "queue")
        .tableHasRowWithValues("Member", "ID", "server-2", "queue");

  }
}


text:
//============================================================================
// Name        : importgl.cpp
// Description : Dynamically links OpenGL ES 1 and 2 for Android
//============================================================================

#ifdef ANDROID_NDK

#define IMPORTGL_NO_FNPTR_DEFS
#define IMPORTGL_API
#define IMPORTGL_FNPTRINIT = NULL
#include "importgl.h"
#include <stdlib.h>
#include <dlfcn.h>
static void *sGLESSO = NULL;
static void *sGLES2SO = NULL;

#define IMPORT_FUNC(libName, funcName) do { \
        void *procAddress = (void *)dlsym(libName, #funcName); \
        if (procAddress == NULL) result = 0; \
        *((void **)&FNPTR(funcName)) = procAddress; } while (0)

/* Imports function pointers to selected function calls in OpenGL ES Common
 * or Common Lite profile DLL or shared object. The function pointers are
 * stored as global symbols with equivalent function name but prefixed with
 * "funcPtr_". Standard gl/egl calls are redirected to the function pointers
 * with preprocessor macros (see importgl.h).
 */
int importGLInit(int usingGLES2)
{
    int result = 1;
    sGLES2SO = dlopen("libGLESv2.so", RTLD_NOW);
    if (sGLES2SO && usingGLES2) {
    	// 1.0 functions carried over to 2.0
		IMPORT_FUNC(sGLES2SO, glActiveTexture);
		IMPORT_FUNC(sGLES2SO, glBindBuffer);
		IMPORT_FUNC(sGLES2SO, glBindTexture);
		IMPORT_FUNC(sGLES2SO, glBlendFunc);
		IMPORT_FUNC(sGLES2SO, glBufferData);
		IMPORT_FUNC(sGLES2SO, glBufferSubData);
		IMPORT_FUNC(sGLES2SO, glClear);
		IMPORT_FUNC(sGLES2SO, glClearColor);
		IMPORT_FUNC(sGLES2SO, glClearDepthf);
		IMPORT_FUNC(sGLES2SO, glClearStencil);
		IMPORT_FUNC(sGLES2SO, glClientActiveTexture);
		IMPORT_FUNC(sGLES2SO, glColor4f);
		IMPORT_FUNC(sGLES2SO, glColor4ub);
		IMPORT_FUNC(sGLES2SO, glColor4x);
		IMPORT_FUNC(sGLES2SO, glColorMask);
		IMPORT_FUNC(sGLES2SO, glColorPointer);
		IMPORT_FUNC(sGLES2SO, glCompressedTexImage2D);
		IMPORT_FUNC(sGLES2SO, glCompressedTexSubImage2D);
		IMPORT_FUNC(sGLES2SO, glCopyTexImage2D);
		IMPORT_FUNC(sGLES2SO, glCopyTexSubImage2D);
		IMPORT_FUNC(sGLES2SO, glCullFace);
		IMPORT_FUNC(sGLES2SO, glDeleteBuffers);
		IMPORT_FUNC(sGLES2SO, glDeleteTextures);
		IMPORT_FUNC(sGLES2SO, glDepthFunc);
		IMPORT_FUNC(sGLES2SO, glDepthMask);
		IMPORT_FUNC(sGLES2SO, glDepthRangef);
		IMPORT_FUNC(sGLES2SO, glDepthRangex);
		IMPORT_FUNC(sGLES2SO, glDisable);
		IMPORT_FUNC(sGLES2SO, glDisableClientState);
		IMPORT_FUNC(sGLES2SO, glDrawArrays);
		IMPORT_FUNC(sGLES2SO, glDrawElements);
		IMPORT_FUNC(sGLES2SO, glEnable);
		IMPORT_FUNC(sGLES2SO, glEnableClientState);
		IMPORT_FUNC(sGLES2SO, glFinish);
		IMPORT_FUNC(sGLES2SO, glFlush);
		IMPORT_FUNC(sGLES2SO, glFrontFace);
		IMPORT_FUNC(sGLES2SO, glGenBuffers);
		IMPORT_FUNC(sGLES2SO, glGenTextures);
		IMPORT_FUNC(sGLES2SO, glGetBooleanv);
		IMPORT_FUNC(sGLES2SO, glGetBufferParameteriv);
		IMPORT_FUNC(sGLES2SO, glGetError);
		IMPORT_FUNC(sGLES2SO, glGetFloatv);
		IMPORT_FUNC(sGLES2SO, glGetIntegerv);
		IMPORT_FUNC(sGLES2SO, glGetString);
		IMPORT_FUNC(sGLES2SO, glGetTexParameterfv);
		IMPORT_FUNC(sGLES2SO, glGetTexParameteriv);
		IMPORT_FUNC(sGLES2SO, glHint);
		IMPORT_FUNC(sGLES2SO, glIsBuffer);
		IMPORT_FUNC(sGLES2SO, glIsEnabled);
		IMPORT_FUNC(sGLES2SO, glIsTexture);
		IMPORT_FUNC(sGLES2SO, glLineWidth);
		IMPORT_FUNC(sGLES2SO, glPixelStorei);
		IMPORT_FUNC(sGLES2SO, glPolygonOffset);
		IMPORT_FUNC(sGLES2SO, glPolygonOffsetx);
		IMPORT_FUNC(sGLES2SO, glReadPixels);
		IMPORT_FUNC(sGLES2SO, glSampleCoverage);
		IMPORT_FUNC(sGLES2SO, glScissor);
		IMPORT_FUNC(sGLES2SO, glShadeModel);
		IMPORT_FUNC(sGLES2SO, glStencilFunc);
		IMPORT_FUNC(sGLES2SO, glStencilMask);
		IMPORT_FUNC(sGLES2SO, glStencilOp);
		IMPORT_FUNC(sGLES2SO, glTexImage2D);
		IMPORT_FUNC(sGLES2SO, glTexParameterf);
		IMPORT_FUNC(sGLES2SO, glTexParameterfv);
		IMPORT_FUNC(sGLES2SO, glTexParameteri);
		IMPORT_FUNC(sGLES2SO, glTexParameteriv);
		IMPORT_FUNC(sGLES2SO, glTexSubImage2D);
		IMPORT_FUNC(sGLES2SO, glViewport);
		// 2.0 functions
 		IMPORT_FUNC(sGLES2SO, glAttachShader);
 		IMPORT_FUNC(sGLES2SO, glBindAttribLocation);
 		IMPORT_FUNC(sGLES2SO, glBindFramebuffer);
 		IMPORT_FUNC(sGLES2SO, glBindRenderbuffer);
 		IMPORT_FUNC(sGLES2SO, glBlendColor);
 		IMPORT_FUNC(sGLES2SO, glBlendEquation);
 		IMPORT_FUNC(sGLES2SO, glBlendEquationSeparate);
 		IMPORT_FUNC(sGLES2SO, glBlendFuncSeparate);
 		IMPORT_FUNC(sGLES2SO, glCheckFramebufferStatus);
 		IMPORT_FUNC(sGLES2SO, glCompileShader);
 		IMPORT_FUNC(sGLES2SO, glCreateProgram);
 		IMPORT_FUNC(sGLES2SO, glCreateShader);
 		IMPORT_FUNC(sGLES2SO, glDeleteFramebuffers);
 		IMPORT_FUNC(sGLES2SO, glDeleteProgram);
 		IMPORT_FUNC(sGLES2SO, glDeleteRenderbuffers);
 		IMPORT_FUNC(sGLES2SO, glDeleteShader);
 		IMPORT_FUNC(sGLES2SO, glDetachShader);
 		IMPORT_FUNC(sGLES2SO, glDisableVertexAttribArray);
 		IMPORT_FUNC(sGLES2SO, glEnableVertexAttribArray);
 		IMPORT_FUNC(sGLES2SO, glFramebufferRenderbuffer);
 		IMPORT_FUNC(sGLES2SO, glFramebufferTexture2D);
 		IMPORT_FUNC(sGLES2SO, glGenFramebuffers);
 		IMPORT_FUNC(sGLES2SO, glGenRenderbuffers);
 		IMPORT_FUNC(sGLES2SO, glGetActiveAttrib);
 		IMPORT_FUNC(sGLES2SO, glGetActiveUniform);
 		IMPORT_FUNC(sGLES2SO, glGetAttachedShaders);
 		IMPORT_FUNC(sGLES2SO, glGetAttribLocation);
 		IMPORT_FUNC(sGLES2SO, glGetFramebufferAttachmentParameteriv);
 		IMPORT_FUNC(sGLES2SO, glGetProgramiv);
 		IMPORT_FUNC(sGLES2SO, glGetProgramInfoLog);
 		IMPORT_FUNC(sGLES2SO, glGetRenderbufferParameteriv);
 		IMPORT_FUNC(sGLES2SO, glGetShaderiv);
 		IMPORT_FUNC(sGLES2SO, glGetShaderInfoLog);
 		IMPORT_FUNC(sGLES2SO, glGetShaderPrecisionFormat);
 		IMPORT_FUNC(sGLES2SO, glGetShaderSource);
 		IMPORT_FUNC(sGLES2SO, glGetUniformfv);
 		IMPORT_FUNC(sGLES2SO, glGetUniformiv);
 		IMPORT_FUNC(sGLES2SO, glGetUniformLocation);
 		IMPORT_FUNC(sGLES2SO, glGetVertexAttribfv);
 		IMPORT_FUNC(sGLES2SO, glGetVertexAttribiv);
 		IMPORT_FUNC(sGLES2SO, glGetVertexAttribPointerv);
 		IMPORT_FUNC(sGLES2SO, glIsFramebuffer);
 		IMPORT_FUNC(sGLES2SO, glIsProgram);
 		IMPORT_FUNC(sGLES2SO, glIsRenderbuffer);
 		IMPORT_FUNC(sGLES2SO, glIsShader);
 		IMPORT_FUNC(sGLES2SO, glLinkProgram);
 		IMPORT_FUNC(sGLES2SO, glReleaseShaderCompiler);
 		IMPORT_FUNC(sGLES2SO, glRenderbufferStorage);
 		IMPORT_FUNC(sGLES2SO, glShaderBinary);
 		IMPORT_FUNC(sGLES2SO, glShaderSource);
 		IMPORT_FUNC(sGLES2SO, glStencilFuncSeparate);
 		IMPORT_FUNC(sGLES2SO, glStencilMaskSeparate);
 		IMPORT_FUNC(sGLES2SO, glStencilOpSeparate);
 		IMPORT_FUNC(sGLES2SO, glUniform1f);
 		IMPORT_FUNC(sGLES2SO, glUniform1fv);
 		IMPORT_FUNC(sGLES2SO, glUniform1i);
 		IMPORT_FUNC(sGLES2SO, glUniform1iv);
 		IMPORT_FUNC(sGLES2SO, glUniform2f);
 		IMPORT_FUNC(sGLES2SO, glUniform2fv);
 		IMPORT_FUNC(sGLES2SO, glUniform2i);
 		IMPORT_FUNC(sGLES2SO, glUniform2iv);
 		IMPORT_FUNC(sGLES2SO, glUniform3f);
 		IMPORT_FUNC(sGLES2SO, glUniform3fv);
 		IMPORT_FUNC(sGLES2SO, glUniform3i);
 		IMPORT_FUNC(sGLES2SO, glUniform3iv);
 		IMPORT_FUNC(sGLES2SO, glUniform4f);
 		IMPORT_FUNC(sGLES2SO, glUniform4fv);
 		IMPORT_FUNC(sGLES2SO, glUniform4i);
 		IMPORT_FUNC(sGLES2SO, glUniform4iv);
 		IMPORT_FUNC(sGLES2SO, glUniformMatrix2fv);
 		IMPORT_FUNC(sGLES2SO, glUniformMatrix3fv);
 		IMPORT_FUNC(sGLES2SO, glUniformMatrix4fv);
 		IMPORT_FUNC(sGLES2SO, glUseProgram);
 		IMPORT_FUNC(sGLES2SO, glValidateProgram);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib1f);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib1fv);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib2f);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib2fv);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib3f);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib3fv);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib4f);
 		IMPORT_FUNC(sGLES2SO, glVertexAttrib4fv);
 		IMPORT_FUNC(sGLES2SO, glVertexAttribPointer);
     }
    sGLESSO = dlopen("libGLESv1_CM.so", RTLD_NOW);
    // don't import anything if 2.0 was successful - it had everything we needed.
    if (!(sGLES2SO && usingGLES2) && sGLESSO) {
		// GLES 1.0/1.1
		IMPORT_FUNC(sGLESSO, glActiveTexture);
		IMPORT_FUNC(sGLESSO, glAlphaFunc);
		IMPORT_FUNC(sGLESSO, glAlphaFuncx);
		IMPORT_FUNC(sGLESSO, glBindBuffer);
		IMPORT_FUNC(sGLESSO, glBindTexture);
		IMPORT_FUNC(sGLESSO, glBlendFunc);
		IMPORT_FUNC(sGLESSO, glBufferData);
		IMPORT_FUNC(sGLESSO, glBufferSubData);
		IMPORT_FUNC(sGLESSO, glClear);
		IMPORT_FUNC(sGLESSO, glClearColor);
		IMPORT_FUNC(sGLESSO, glClearColorx);
		IMPORT_FUNC(sGLESSO, glClearDepthf);
		IMPORT_FUNC(sGLESSO, glClearDepthx);
		IMPORT_FUNC(sGLESSO, glClearStencil);
		IMPORT_FUNC(sGLESSO, glClientActiveTexture);
		IMPORT_FUNC(sGLESSO, glClipPlanef);
		IMPORT_FUNC(sGLESSO, glClipPlanex);
		IMPORT_FUNC(sGLESSO, glColor4f);
		IMPORT_FUNC(sGLESSO, glColor4ub);
		IMPORT_FUNC(sGLESSO, glColor4x);
		IMPORT_FUNC(sGLESSO, glColorMask);
		IMPORT_FUNC(sGLESSO, glColorPointer);
		IMPORT_FUNC(sGLESSO, glCompressedTexImage2D);
		IMPORT_FUNC(sGLESSO, glCompressedTexSubImage2D);
		IMPORT_FUNC(sGLESSO, glCopyTexImage2D);
		IMPORT_FUNC(sGLESSO, glCopyTexSubImage2D);
		IMPORT_FUNC(sGLESSO, glCullFace);
		IMPORT_FUNC(sGLESSO, glDeleteBuffers);
		IMPORT_FUNC(sGLESSO, glDeleteTextures);
		IMPORT_FUNC(sGLESSO, glDepthFunc);
		IMPORT_FUNC(sGLESSO, glDepthMask);
		IMPORT_FUNC(sGLESSO, glDepthRangef);
		IMPORT_FUNC(sGLESSO, glDepthRangex);
		IMPORT_FUNC(sGLESSO, glDisable);
		IMPORT_FUNC(sGLESSO, glDisableClientState);
		IMPORT_FUNC(sGLESSO, glDrawArrays);
		IMPORT_FUNC(sGLESSO, glDrawElements);
		IMPORT_FUNC(sGLESSO, glEnable);
		IMPORT_FUNC(sGLESSO, glEnableClientState);
		IMPORT_FUNC(sGLESSO, glFinish);
		IMPORT_FUNC(sGLESSO, glFlush);
		IMPORT_FUNC(sGLESSO, glFogf);
		IMPORT_FUNC(sGLESSO, glFogfv);
		IMPORT_FUNC(sGLESSO, glFogx);
		IMPORT_FUNC(sGLESSO, glFogxv);
		IMPORT_FUNC(sGLESSO, glFrontFace);
		IMPORT_FUNC(sGLESSO, glFrustumf);
		IMPORT_FUNC(sGLESSO, glFrustumx);
		IMPORT_FUNC(sGLESSO, glGenBuffers);
		IMPORT_FUNC(sGLESSO, glGenTextures);
		IMPORT_FUNC(sGLESSO, glGetBooleanv);
		IMPORT_FUNC(sGLESSO, glGetBufferParameteriv);
		IMPORT_FUNC(sGLESSO, glGetClipPlanef);
		IMPORT_FUNC(sGLESSO, glGetClipPlanex);
		IMPORT_FUNC(sGLESSO, glGetError);
		IMPORT_FUNC(sGLESSO, glGetFixedv);
		IMPORT_FUNC(sGLESSO, glGetFloatv);
		IMPORT_FUNC(sGLESSO, glGetIntegerv);
		IMPORT_FUNC(sGLESSO, glGetLightfv);
		IMPORT_FUNC(sGLESSO, glGetLightxv);
		IMPORT_FUNC(sGLESSO, glGetMaterialfv);
		IMPORT_FUNC(sGLESSO, glGetMaterialxv);
		IMPORT_FUNC(sGLESSO, glGetPointerv);
		IMPORT_FUNC(sGLESSO, glGetString);
		IMPORT_FUNC(sGLESSO, glGetTexEnvfv);
		IMPORT_FUNC(sGLESSO, glGetTexEnviv);
		IMPORT_FUNC(sGLESSO, glGetTexEnvxv);
		IMPORT_FUNC(sGLESSO, glGetTexParameterfv);
		IMPORT_FUNC(sGLESSO, glGetTexParameteriv);
		IMPORT_FUNC(sGLESSO, glGetTexParameterxv);
		IMPORT_FUNC(sGLESSO, glHint);
		IMPORT_FUNC(sGLESSO, glIsBuffer);
		IMPORT_FUNC(sGLESSO, glIsEnabled);
		IMPORT_FUNC(sGLESSO, glIsTexture);
		IMPORT_FUNC(sGLESSO, glLightf);
		IMPORT_FUNC(sGLESSO, glLightfv);
		IMPORT_FUNC(sGLESSO, glLightModelf);
		IMPORT_FUNC(sGLESSO, glLightModelfv);
		IMPORT_FUNC(sGLESSO, glLightModelx);
		IMPORT_FUNC(sGLESSO, glLightModelxv);
		IMPORT_FUNC(sGLESSO, glLightx);
		IMPORT_FUNC(sGLESSO, glLightxv);
		IMPORT_FUNC(sGLESSO, glLineWidth);
		IMPORT_FUNC(sGLESSO, glLineWidthx);
		IMPORT_FUNC(sGLESSO, glLoadIdentity);
		IMPORT_FUNC(sGLESSO, glLoadMatrixf);
		IMPORT_FUNC(sGLESSO, glLoadMatrixx);
		IMPORT_FUNC(sGLESSO, glLogicOp);
		IMPORT_FUNC(sGLESSO, glMaterialf);
		IMPORT_FUNC(sGLESSO, glMaterialfv);
		IMPORT_FUNC(sGLESSO, glMaterialx);
		IMPORT_FUNC(sGLESSO, glMaterialxv);
		IMPORT_FUNC(sGLESSO, glMatrixMode);
		IMPORT_FUNC(sGLESSO, glMultiTexCoord4f);
		IMPORT_FUNC(sGLESSO, glMultiTexCoord4x);
		IMPORT_FUNC(sGLESSO, glMultMatrixf);
		IMPORT_FUNC(sGLESSO, glMultMatrixx);
		IMPORT_FUNC(sGLESSO, glNormal3f);
		IMPORT_FUNC(sGLESSO, glNormal3x);
		IMPORT_FUNC(sGLESSO, glNormalPointer);
		IMPORT_FUNC(sGLESSO, glOrthof);
		IMPORT_FUNC(sGLESSO, glOrthox);
		IMPORT_FUNC(sGLESSO, glPixelStorei);
		IMPORT_FUNC(sGLESSO, glPointParameterf);
		IMPORT_FUNC(sGLESSO, glPointParameterfv);
		IMPORT_FUNC(sGLESSO, glPointParameterx);
		IMPORT_FUNC(sGLESSO, glPointParameterxv);
		IMPORT_FUNC(sGLESSO, glPointSize);
		IMPORT_FUNC(sGLESSO, glPointSizex);
		IMPORT_FUNC(sGLESSO, glPolygonOffset);
		IMPORT_FUNC(sGLESSO, glPolygonOffsetx);
		IMPORT_FUNC(sGLESSO, glPopMatrix);
		IMPORT_FUNC(sGLESSO, glPushMatrix);
		IMPORT_FUNC(sGLESSO, glReadPixels);
		IMPORT_FUNC(sGLESSO, glRotatef);
		IMPORT_FUNC(sGLESSO, glRotatex);
		IMPORT_FUNC(sGLESSO, glSampleCoverage);
		IMPORT_FUNC(sGLESSO, glSampleCoveragex);
		IMPORT_FUNC(sGLESSO, glScalef);
		IMPORT_FUNC(sGLESSO, glScalex);
		IMPORT_FUNC(sGLESSO, glScissor);
		IMPORT_FUNC(sGLESSO, glShadeModel);
		IMPORT_FUNC(sGLESSO, glStencilFunc);
		IMPORT_FUNC(sGLESSO, glStencilMask);
		IMPORT_FUNC(sGLESSO, glStencilOp);
		IMPORT_FUNC(sGLESSO, glTexCoordPointer);
		IMPORT_FUNC(sGLESSO, glTexEnvf);
		IMPORT_FUNC(sGLESSO, glTexEnvfv);
		IMPORT_FUNC(sGLESSO, glTexEnvi);
		IMPORT_FUNC(sGLESSO, glTexEnviv);
		IMPORT_FUNC(sGLESSO, glTexEnvx);
		IMPORT_FUNC(sGLESSO, glTexEnvxv);
		IMPORT_FUNC(sGLESSO, glTexImage2D);
		IMPORT_FUNC(sGLESSO, glTexParameterf);
		IMPORT_FUNC(sGLESSO, glTexParameterfv);
		IMPORT_FUNC(sGLESSO, glTexParameteri);
		IMPORT_FUNC(sGLESSO, glTexParameteriv);
		IMPORT_FUNC(sGLESSO, glTexParameterx);
		IMPORT_FUNC(sGLESSO, glTexParameterxv);
		IMPORT_FUNC(sGLESSO, glTexSubImage2D);
		IMPORT_FUNC(sGLESSO, glTranslatef);
		IMPORT_FUNC(sGLESSO, glTranslatex);
		IMPORT_FUNC(sGLESSO, glVertexPointer);
		IMPORT_FUNC(sGLESSO, glViewport);
    }
     return result;
}

void importGLDeinit() {
	dlclose(sGLESSO);
	dlclose(sGLES2SO);
}

#endif /* ANDROID_NDK */

redpajama_set_name: RedPajamaGithub


text:
<?php
use PostTypes\PostType;
// Technologies custom post type
$names = [
	'name' => 'technology',
	'singular' => __('Technology'),
	'plural' => __('Technologies'),
	'slug' => 'technology'
];

$technologies = new PostType($names);

$technologies->columns()->add(array(
		'cb' => '<input type="checkbox" />',
		'title' => __('Name'),
		'font_icon' => __('Icon')
));

$technologies->columns()->populate('font_icon', function($column, $post) {
	echo "<i class='".get_field('icon')."'></i> ".get_field('icon');
});

$technologies->icon("dashicons-awards");


text:
using SteamKit2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace StatusService
{
    class MasterMonitor : BaseMonitor
    {
        List<IPEndPoint> lastCmList;

        public MasterMonitor()
            : base( null )
        {
            lastCmList = new List<IPEndPoint>();
        }

        protected override void OnConnected( SteamClient.ConnectedCallback callback )
        {
            Log.WriteInfo( "MasterMonitor", "Connected to Steam!" );

            base.OnConnected( callback );
        }

        protected override void OnDisconnected( SteamClient.DisconnectedCallback callback )
        {
            Log.WriteWarn( "MasterMonitor", "Disconnected from Steam!" );

            base.OnDisconnected( callback );
        }

        protected override void OnLoggedOn( SteamUser.LoggedOnCallback callback )
        {
            base.OnLoggedOn( callback );

            if ( callback.Result != EResult.OK )
            {
                Log.WriteWarn( "MasterMonitor", "Unable to logon to Steam: {0}", callback.Result );
                return;
            }

            Log.WriteInfo( "MasterMonitor", "Logged onto Steam!" );

            Connect( DateTime.Now + TimeSpan.FromMinutes( 30 ) );
        }

        protected override void OnLoggedOff( SteamUser.LoggedOffCallback callback )
        {
            Log.WriteWarn( "MasterMonitor", "Logged off Steam: {0}", callback.Result );

            base.OnLoggedOff( callback );
        }

        protected override void OnCMList( SteamClient.CMListCallback callback )
        {
            List<IPEndPoint> sortedServers = callback.Servers
                .OrderBy( s => s.ToString() )
                .ToList();

            if ( !lastCmList.SequenceEqual( sortedServers ) )
            {
                Log.WriteInfo( "MasterMonitor", "Got new CM list containing {0} servers", sortedServers.Count );

                lastCmList = sortedServers;
            }

            base.OnCMList( callback );
        }
    }
}


text:
module RedisRpc
  VERSION = "0.0.1" unless defined?(RedisRpc::VERSION)
end


text:
package org.cc.util;

import android.util.Log;

import java.io.IOException;
import java.io.Writer;

public class IndentingWriter extends Writer {
    protected final Writer writer;
    protected final char[] buffer = new char[24];
    protected int indentLevel = 0;
    private boolean beginningOfLine = true;
    private static final String newLine = System.getProperty("line.separator");

    public IndentingWriter(Writer writer) {
        this.writer = writer;
    }

    protected void writeIndent() throws IOException {
        for (int i=0; i<indentLevel; i++) {
            writer.write(' ');
        }
    }

    @Override
    public void write(int chr) throws IOException {
        if (chr == '\n') {
            writer.write(newLine);
            beginningOfLine = true;
        } else {
            if (beginningOfLine) {
                writeIndent();
            }
            beginningOfLine = false;
            writer.write(chr);
        }
    }

    /**
     * Writes out a block of text that contains no newlines
     */
    private void writeLine(char[] chars, int start, int len) throws IOException {
        if (beginningOfLine && len > 0) {
            writeIndent();
            beginningOfLine = false;
        }
        writer.write(chars, start, len);
    }

    /**
     * Writes out a block of text that contains no newlines
     */
    private void writeLine(String str, int start, int len) throws IOException {
        if (beginningOfLine && len > 0) {
            writeIndent();
            beginningOfLine = false;
        }
        writer.write(str, start, len);
    }

    @Override
    public void write(char[] chars) throws IOException {
        write(chars, 0, chars.length);
    }

    @Override
    public void write(char[] chars, int start, int len) throws IOException {
        final int end = start+len;
        int pos = start;
        while (pos < end) {
            if (chars[pos] == '\n') {
                writeLine(chars, start, pos-start);

                writer.write(newLine);
                beginningOfLine = true;
                pos++;
                start = pos;
            } else {
                pos++;
            }
        }
        writeLine(chars, start, pos-start);
    }

    @Override
    public void write(String s) throws IOException {
        write(s, 0, s.length());
    }

    @Override
    public void write(String str, int start, int len) throws IOException {
        final int end = start+len;
        int pos = start;
        while (pos < end) {
            pos = str.indexOf('\n', start);
            if (pos == -1 || pos >= end) {
                writeLine(str, start, end-start);
                return;
            } else {
                writeLine(str, start, pos-start);
                writer.write(newLine);
                beginningOfLine = true;
                start = pos+1;
            }
        }
    }

    @Override
    public Writer append(CharSequence charSequence) throws IOException {
        write(charSequence.toString());
        return this;
    }

    @Override
    public Writer append(CharSequence charSequence, int start, int len) throws IOException {
        write(charSequence.subSequence(start, len).toString());
        return this;
    }

    @Override
    public Writer append(char c) throws IOException {
        write(c);
        return this;
    }

    @Override
    public void flush() throws IOException {
        writer.flush();
    }

    @Override
    public void close() throws IOException {
        writer.close();
    }

    public void indent(int indentAmount) {
        this.indentLevel += indentAmount;
        if (indentLevel < 0) {
            indentLevel = 0;
        }
    }

    public void deindent(int indentAmount) {
        this.indentLevel -= indentAmount;
        if (indentLevel < 0) {
            indentLevel = 0;
        }
    }

    public void printUnsignedLongAsHex(long value) throws IOException {
        int bufferIndex = 23;
        do {
            int digit = (int)(value & 15);
            if (digit < 10) {
                buffer[bufferIndex--] = (char)(digit + '0');
            } else {
                buffer[bufferIndex--] = (char)((digit - 10) + 'a');
            }

            value >>>= 4;
        } while (value != 0);

        bufferIndex++;

        writeLine(buffer, bufferIndex, 24-bufferIndex);
    }

    public void printSignedLongAsDec(long value) throws IOException {
        int bufferIndex = 23;

        if (value < 0) {
            value *= -1;
            write('-');
        }

        do {
            long digit = value % 10;
            buffer[bufferIndex--] = (char)(digit + '0');

            value = value / 10;
        } while (value != 0);

        bufferIndex++;

        writeLine(buffer, bufferIndex, 24-bufferIndex);
    }

    public void printSignedIntAsDec(int value) throws IOException {
        int bufferIndex = 15;

        if (value < 0) {
            value *= -1;
            write('-');
        }

        do {
            int digit = value % 10;
            buffer[bufferIndex--] = (char)(digit + '0');

            value = value / 10;
        } while (value != 0);

        bufferIndex++;

        writeLine(buffer, bufferIndex, 16-bufferIndex);
    }

    public void printUnsignedIntAsDec(int value) throws IOException {
        int bufferIndex = 15;

        if (value < 0) {
            printSignedLongAsDec(value & 0xFFFFFFFFL);
        } else {
            printSignedIntAsDec(value);
        }
    }
}


text:
require "overlay/engine"
require "overlay/configuration"
require "overlay/github"

module Overlay
end


text:
package de.androidbytes.recipr.presentation.overview.search.view;

import de.androidbytes.recipr.presentation.overview.core.model.RecipeViewModel;

import java.util.List;

/**
 * Created by Christoph on 05.05.2016.
 */
public interface SearchResultView {

    void renderRecipes(List<RecipeViewModel> recipes);
}


text:
<?php

namespace DonePM\ConsoleClient;

use DonePM\ConsoleClient\Commands\InitCommand;
use DonePM\ConsoleClient\Commands\RollbackCommand;
use DonePM\ConsoleClient\Commands\SelfUpdateCommand;
use DonePM\ConsoleClient\Commands\TokenCommand;
use DonePM\ConsoleClient\Repositories\Config;
use DonePM\ConsoleClient\Repositories\Reader\JsonReader;
use DonePM\ConsoleClient\Repositories\Writer\JsonWriter;
use Symfony\Component\Console\Command\Command;

/**
 * Class Application
 *
 * @package DonePM\ConsoleClient
 */
class Application extends \Symfony\Component\Console\Application
{
    const VERSION = '1.0.0';

    const API_URL = 'https://api.done.pm/';

    /**
     * config file
     *
     * @var string
     */
    private $configFile;

    /**
     * configuration
     *
     * @var Config
     */
    private $config;

    /**
     * Application constructor.
     *
     * @param string|null $configFile
     */
    public function __construct($configFile = null)
    {
        parent::__construct('donepm cli', self::VERSION);

        $this->configFile = $configFile ?: $this->getDirectoryInHomeDirectory('.dpm/config');
    }

    /**
     * returns configuration
     *
     * @return \DonePM\ConsoleClient\Repositories\Config|\DonePM\ConsoleClient\Repositories\Repository
     */
    public function config()
    {
        if (null === $this->config) {
            $this->config = $this->readConfigOrUseDefaultConfig();
        }

        return $this->config;
    }

    /**
     * resets config
     *
     * @return $this
     */
    public function resetConfig()
    {
        $this->config = null;

        return $this;
    }

    /**
     * writes config
     *
     * @param \DonePM\ConsoleClient\Repositories\Config $config
     *
     * @return $this
     */
    public function writeConfig(Config $config)
    {
        (new JsonWriter())->write($this->getConfigFile(), $config);

        return $this;
    }

    /**
     * Gets the default commands that should always be available.
     *
     * @return Command[] An array of default Command instances
     */
    protected function getDefaultCommands()
    {
        return array_merge(parent::getDefaultCommands(), [
            new InitCommand(),
            new TokenCommand(),
            new Commands\Projects\ListCommand(),
            new Commands\Projects\InfoCommand(),
            new Commands\Projects\CreateCommand(),
            new Commands\Projects\DeleteCommand(),

            new Commands\Tasks\ListCommand(),
            new Commands\Tasks\CreateCommand(),

            # does not work right now :-(
            #new SelfUpdateCommand(),
            #new RollbackCommand(),
        ]);
    }

    /**
     * returns config file
     *
     * @return string
     */
    private function getConfigFile()
    {
        return $this->configFile;
    }

    /**
     * returns directory path within home directory
     *
     * @param string $path
     *
     * @return string
     */
    private function getDirectoryInHomeDirectory($path)
    {
        if (isset($_SERVER['HOME'])) {
            return $_SERVER['HOME'] . DIRECTORY_SEPARATOR . $path;
        }

        return $_SERVER['HOMEDRIVE'] . DIRECTORY_SEPARATOR . $_SERVER['HOMEPATH'] . DIRECTORY_SEPARATOR . $path;
    }

    /**
     * reads existing config or returns default config
     *
     * @return \DonePM\ConsoleClient\Repositories\Config|\DonePM\ConsoleClient\Repositories\Repository
     */
    private function readConfigOrUseDefaultConfig()
    {
        if (file_exists($this->getConfigFile())) {
            return (new JsonReader())->read($this->getConfigFile());
        }

        return new Config();
    }
}


text:
function [theta_hat] = estimate_parameters(Gamma_min, Gamma_max, ...
		number_of_scans, Y, B, initializations, B_m_guess)
%
% [theta_hat] = estimate_parameters(Gamma_min, Gamma_max, ...
%     number_of_scans, Y, B, initializations, B_m_guess)
%
% This function estimates the unknown parameters from a set of scan data.
%
% The inputs are Gamma_min, Gamma_max, number_of_scans, Y, B, initializations,
% and B_m_guess:
%
%     Gamma_min       : the minimum HWHM linewidth expected, in Gauss
%     Gamma_max       : the maximum HWHM linewidth expected, in Gauss
%     number_of_scans : how many different scans were performed
%     Y               : the scan data, in arbitrary units
%     B               : the field values for each data point
%     initializations : how many initial guesses to try when fitting
%     B_m_guess       : the modulation amplitude you set on the instrument
%
% The output is theta_hat = [d_hat Gamma_hat B_m_hat], the estimated parameter
% values.
%

% Note: I am aware that number_of_scans is not strictly necessary, but it makes
% for a nice sanity check.

	% Argument checking
	if ~isscalar(Gamma_min) || ~isfloat(Gamma_min) || ~(Gamma_min>0)
		error('estimate_parameters:invalid_argument', ...
			'Gamma_min must be a positive scalar float');
	elseif ~isscalar(Gamma_max) || ~isfloat(Gamma_max) || ~(Gamma_max>0)
		error('crlb_on_var:invalid_argument', ...
			'Gamma must be a positive scalar float');
	elseif ~isscalar(number_of_scans) || ~isfloat(number_of_scans) || ...
		~(number_of_scans > 0)
			error('estimate_parameters:invalid_argument', ...
				'number_of_scans must be a positive scalar float');
	elseif ~(size(Y, 1) == number_of_scans) || ~isfloat(Y)
		error('estimate_parameters:invalid_argument', ...
			'Y must be a number_of_scans-by-M matrix of floats');
	elseif ~(size(B, 1) == number_of_scans) || ~isfloat(B)
		error('estimate_parameters:invalid_argument', ...
			'B must be a number_of_scans-by-M matrix of floats');
	elseif ~isequal(size(Y), size(B))
		error('estimate_parameters:invalid_argument', ...
			'Y and B must have the same size');
	elseif ~isscalar(initializations) || ~isfloat(initializations) || ...
		~(initializations > 0)
			error('estimate_parameters:invalid_argument', ...
				'initializations must be a positive scalar float');
	elseif ~isfloat(B_m_guess) || any(B_m_guess<0) || ...
			~isequal(size(B_m_guess), [1 number_of_scans])
		error('estimate_parameters:invalid_argument', ...
		'B_m_guess must be a 1-by-number_of_scans vector of positive floats');
	end

	% What program are we using?
	is_octave = exist('OCTAVE_VERSION', 'builtin');

	% We can try a few different initializations
	Gamma_guess = linspace(Gamma_min, Gamma_max, initializations);

	% Preallocate
	theta_hats = zeros(initializations, number_of_scans + 2);
	residual_norm = zeros(initializations, 1);

	% Create the objective function
	if is_octave % we're using octave
		fit_error_octave = @(theta) ...
			sum(sum(fit_error(theta, number_of_scans, Y, B).^2));
	else % we're using MATLAB
		fit_error_matlab = @(theta) ...
			fit_error(theta, number_of_scans, Y, B);
	end

	for i=1:initializations
		guess = [0 Gamma_guess(i) B_m_guess];

		if is_octave % we're using octave
			[theta_hats(i,:), residual_norm(i)] = sqp( ...
				guess,                         ... % starting guess
				fit_error_octave,              ... % objective function
				[], [],                        ... % no constraints
				zeros(1, number_of_scans + 2), ... % lower bounds (zero)
				inf(1, number_of_scans + 2),   ... % upper bounds (infinity)
				400,                           ... % maximum iterations
				1e-6);                         ... % stopping tolerance
		else % we're using MATLAB
			[theta_hats(i,:), residual_norm(i)] = lsqnonlin( ...
				fit_error_matlab,              ... % objective function
				guess,                         ... % starting guess
				zeros(1, number_of_scans + 2), ... % lower bounds (zero)
				inf(1, number_of_scans + 2));  ... % upper bounds (infinity)
		end
	end

	% Return the theta_hat with best residual norm
	[~, index] = min(residual_norm);
	theta_hat = theta_hats(index,:);
end

function [errors] = fit_error(theta, number_of_scans, Y, B)
% theta = [d Gamma B_m]
% d               : spin density, in arbitrary units
% Gamma           : HWHM linewidth, in Gauss
% B_m             : modulation amplitudes, in Gauss
% number_of_scans : how many scans were performed
% Y               : the scan data, in arbitrary units
% B               : field values for each data point, in Gauss

	% Break theta apart
	d = theta(1);
	Gamma = theta(2);
	B_m = theta(3:end);

	% Preallocate
	errors = zeros(size(Y));

	% Iterate over the scans
	for i=1:1:number_of_scans
		ideal_data = f([d Gamma B_m(i)], B(i,:));
		errors(i,:) = Y(i,:) - ideal_data;
	end

end


text:
package pl.touk.nussknacker.engine.management.rest

import io.circe.syntax.EncoderOps
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.Span.convertSpanToDuration
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
import pl.touk.nussknacker.engine.deployment.ExternalDeploymentId
import pl.touk.nussknacker.engine.management.FlinkConfig
import pl.touk.nussknacker.engine.management.rest.flinkRestModel.{JarFile, JarsResponse, UploadJarResponse}
import pl.touk.nussknacker.test.PatientScalaFutures
import sttp.client.monad.FutureMonad
import sttp.client.{HttpClientError, HttpError, Response}
import sttp.client.testing.SttpBackendStub
import sttp.model.{Method, StatusCode}

import java.io.File
import java.util.UUID
import java.util.concurrent.TimeUnit
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.{Await, Future}
import scala.concurrent.duration.FiniteDuration
import scala.util.Failure

class FlinkHttpClientTest extends AnyFunSuite
  with Matchers
  with ScalaFutures
  with PatientScalaFutures {

  private val jarFileName = "example.jar"
  private val jarFile = new File(s"/tmp/${jarFileName}")
  private val jarId = s"${UUID.randomUUID()}-example.jar"
  private val flinkJarFile = JarFile(jarId, jarFileName)
  private val deploymentId = ExternalDeploymentId("someDeploymentId")

  val config: FlinkConfig = FlinkConfig("http://localhost:12345/flink", None)

  test("uploadJarFileIfNotExists - should upload jar") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") => Response.ok(Right(JarsResponse(files = Some(Nil))))
      case req if req.uri.path == List("jars", "upload") =>
        Response.ok(Right(UploadJarResponse(filename = jarId)))
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.uploadJarFileIfNotExists(jarFile).futureValue

    result shouldBe flinkJarFile
  }

  test("uploadJarFileIfNotExists - should not upload if already exist") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") =>
        Response.ok(Right(JarsResponse(files = Some(List(JarFile(id = jarId, name = jarFileName))))))
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.uploadJarFileIfNotExists(jarFile).futureValue

    result shouldBe flinkJarFile
  }

  test("uploadJarFileIfNotExists - should upload if not recognized jars uploaded") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") =>
        Response.ok(Right(JarsResponse(files = Some(List(JarFile(id = "123-other.jar", name = "other.jar"))))))
      case req if req.uri.path == List("jars", "upload") =>
        Response.ok(Right(UploadJarResponse(filename = jarId)))
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.uploadJarFileIfNotExists(jarFile).futureValue

    result shouldBe flinkJarFile
  }

  test("deleteJarIfExists - should do so") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") =>
        Response.ok(Right(JarsResponse(files = Some(List(flinkJarFile)))))
      case req if req.uri.path == List("jars", jarId) && req.method == Method.DELETE =>
        Response.ok(Right(()))
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.deleteJarIfExists(jarFileName).futureValue

    result shouldBe (())
  }

  test("deleteJarIfExists - should do nothing if file not found") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") => Response.ok(Right(JarsResponse(files = Some(Nil))))
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.deleteJarIfExists(jarFileName).futureValue

    result shouldBe (())
  }

  test("deleteJarIfExists - should recover if deleting fails") {
    implicit val backend = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
      case req if req.uri.path == List("jars") =>
        Response.ok(Right(JarsResponse(files = Some(List(JarFile(id = jarId, name = jarFileName))))))
      case req if req.uri.path == List("jars", jarId) && req.method == Method.DELETE =>
        Response(Right(()), StatusCode.InternalServerError)
    }
    val flinkClient = new HttpFlinkClient(config)

    val result = flinkClient.deleteJarIfExists(jarFileName).futureValue

    result shouldBe (())
  }

  test("should throw FlinkError if action failed") {
    implicit val backend = new SttpBackendStub[Future, Nothing, Nothing](new FutureMonad(), {
      case req if req.uri.path == List("jars") =>
        Future.successful(Response.ok(Right(JarsResponse(files = Some(List(JarFile(id = jarId, name = jarFileName)))))))
      case req if req.uri.path == List("jars", jarId, "run") =>
        Future.failed(HttpError("Error, error".asJson.noSpaces, StatusCode.InternalServerError))
      case req if req.uri.path == List("jobs", deploymentId.value) && req.method == Method.PATCH =>
        Future.failed(HttpError("Error, error".asJson.noSpaces, StatusCode.InternalServerError))
    }, PartialFunction.empty, None)

    val flinkClient = new HttpFlinkClient(config)

    def checkIfWrapped(action: Future[_]) = {
      Await.ready(action, convertSpanToDuration(patienceConfig.timeout)).value should matchPattern {
        case Some(Failure(_: HttpClientError)) =>
      }
    }

    checkIfWrapped(flinkClient.cancel(deploymentId))
    checkIfWrapped(flinkClient.runProgram(jarFile, "any", Nil, None))
  }
}


text:
<?php

/**
 * CHelpCommand represents a console help command.
 *
 * CHelpCommand displays the available command list or the help instructions
 * about a specific command.
 *
 * To use this command, enter the following on the command line:
 * <pre>
 * php path/to/entry_script.php help [command name]
 * </pre>
 * In the above, if the command name is not provided, it will display all
 * available commands.
 *
 * @property string $help The command description.
 *
 * @author  Qiang Xue <qiang.xue@gmail.com>
 * @package system.console
 * @since   1.0
 */
class CHelpCommand extends CConsoleCommand
{

    /**
     * Execute the action.
     *
     * @param array $args command line parameters specific for this command
     *
     * @return integer non zero application exit code after printing help
     */
    public function run($args)
    {

        $runner   = $this->getCommandRunner();
        $commands = $runner->commands;
        if (isset($args[0])) {
            $name = strtolower($args[0]);
        }
        if (!isset($args[0]) || !isset($commands[$name])) {
            if (!empty($commands)) {
                echo "Yii command runner (based on Yii v" . Yii::getVersion() . ")\n";
                echo "Usage: " . $runner->getScriptName() . " <command-name> [parameters...]\n";
                echo "\nThe following commands are available:\n";
                $commandNames = array_keys($commands);
                sort($commandNames);
                echo ' - ' . implode("\n - ", $commandNames);
                echo "\n\nTo see individual command help, use the following:\n";
                echo "   " . $runner->getScriptName() . " help <command-name>\n";
            } else {
                echo "No available commands.\n";
                echo "Please define them under the following directory:\n";
                echo "\t" . Yii::app()->getCommandPath() . "\n";
            }
        } else {
            echo $runner->createCommand($name)->getHelp();
        }
        return 1;
    }

    /**
     * Provides the command description.
     *
     * @return string the command description.
     */
    public function getHelp()
    {

        return parent::getHelp() . ' [command-name]';
    }
}


text:
OptionData::OptionData() :
mFilename("Options.cfg"),
mMusic(true),
mSFX(true),
#ifndef GExL_ANDROID
mControls(CTRL_KEY)
#else
mControls(CTRL_TOUCH)
#endif
{

}

OptionData::OptionData(std::string theFilename, bool theMusic, bool theSFX, GExL::Uint32 theControls):
mFilename(theFilename),
mMusic(theMusic),
mSFX(theSFX),
mControls(theControls)
{

}

void OptionData::SaveOptions()
{
#ifndef GExL_ANDROID
	std::ofstream anFileWriter(mFilename.c_str(), std::ios::out);
#else
	std::string anFilename = SDL_AndroidGetInternalStoragePath();
	anFilename += "/";
	anFilename += mFilename;
	std::ofstream anFileWriter(anFilename.c_str(), std::ios::out);
#endif
	if (anFileWriter.good())
	{
		anFileWriter << mMusic << std::endl;
		anFileWriter << mSFX << std::endl;
		anFileWriter << mControls << std::endl;
		anFileWriter.close();
	}
}

void OptionData::LoadOptions()
{
#ifndef GExL_ANDROID
	std::ifstream anFileReader(mFilename.c_str(), std::ios::in);
#else
	std::string anFilename = SDL_AndroidGetInternalStoragePath();
	anFilename += "/";
	anFilename += mFilename;
	std::ifstream anFileReader(anFilename.c_str(), std::ios::in);
#endif

	if (!anFileReader.good())
	{
		SaveOptions();
	}
	else
	{
			char* anCharString = new char[16];
			std::string anString;
			anFileReader.getline(anCharString, 20);
			anString = anCharString;
			mMusic = GExL::BoolParser::ToValue(anString, true);
			anFileReader.getline(anCharString, 20);
			anString = anCharString;
			mSFX = GExL::BoolParser::ToValue(anString, true);
			anFileReader.getline(anCharString, 20);
			anString = anCharString;
#ifndef GEXL_ANDROID
			mControls = GExL::Uint32Parser::ToValue(anString, CTRL_KEY);
#else
			mControls = GExL::Uint32Parser::ToValue(anString, CTRL_TOUCH);
#endif

		}
	anFileReader.close();

}


text:
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EscapistasClub.Command.Interfaces;
using EscapistasClub.Core.Context;
using EscapistasClub.Core.Enums;
using EscapistasClub.Core.Helpers;
using EscapistasClub.Core.Models;
using EscapistasClub.Core.Settings;
using EscapistasClub.Middleware.Events;
using EscapistasClub.Middleware.Events.Events;
using Microsoft.Extensions.Options;

namespace EscapistasClub.Command.GameRating.AddGameRating
{
    public class AddGameRatingCommandHandler : IHandleCommand<AddGameRatingCommnad>
    {
        private readonly IApplicationDbContext _applicationDbContext;
        private readonly IEventNotifier _eventNotifier;
        private readonly WebSettings _webSettings;

        public AddGameRatingCommandHandler(IApplicationDbContext applicationDbContext, IOptions<WebSettings> webSettings, IEventNotifier eventNotifier)
        {
            _applicationDbContext = applicationDbContext;
            _eventNotifier = eventNotifier;
            _webSettings = webSettings.Value;
        }

        public async Task<CommandResult> Handle(AddGameRatingCommnad command)
        {
            var game = _applicationDbContext.Games.FirstOrDefault(g => g.Id == command.GameId);
            var user = _applicationDbContext.Users.FirstOrDefault(u => u.Id == command.AuthorId);

            game.Ratings.Add(new Core.Models.GameRating()
            {
                Id = GuidHelper.NewGuid(),
                AuthorIpAddress = command.AuthorIpAddress,
                AuthorType = command.AuthorType,
                Rating = command.GeneralRating,
                RatingType = RatingType.General,
                Game = game,
                User = user
            });

            game.Ratings.Add(new Core.Models.GameRating()
            {
                Id = GuidHelper.NewGuid(),
                AuthorIpAddress = command.AuthorIpAddress,
                AuthorType = command.AuthorType,
                Rating = command.DifficultyRating,
                RatingType = RatingType.Difficulty,
                Game = game,
                User = user
            });

            game.Ratings.Add(new Core.Models.GameRating()
            {
                Id = GuidHelper.NewGuid(),
                AuthorIpAddress = command.AuthorIpAddress,
                AuthorType = command.AuthorType,
                Rating = command.AtmosphereRating,
                RatingType = RatingType.Atmosphere,
                Game = game,
                User = user
            });

            game.CalculateRatingTotals();
            game.CalculateRatingScore(_webSettings.MinimunRatingsToScore, _applicationDbContext.GameRatings.AsEnumerable());

            await _applicationDbContext.SaveChangesAsync();

            _eventNotifier.Notify(new GameRatingAddedEvent
            {
                GameId = game.Id,
                GameName = game.Name,
                GameUrl = game.WebGameUrl(),
                PlaceName = game.Place.Name,
                PlaceCity = game.Place.City,
                GeneralRating = command.GeneralRating,
                AtmosphereRating = command.AtmosphereRating,
                DifficultyRating = command.DifficultyRating,
                AuthorIpAddress = command.AuthorIpAddress,
                AuthorId = command.AuthorId,
                AuthorType = command.AuthorType,
                AuthorEmail = user?.Email,
                AuthorName = user?.FullName,
            }).FireAndForget();

            return new CommandResult();
        }

    }
}


text:
import React, { Component } from "react";
import PropTypes from 'prop-types';

class IframeComm extends Component {
    constructor() {
        super();
        this.onReceiveMessage = this.onReceiveMessage.bind(this);
        this.onLoad = this.onLoad.bind(this);
        this.sendMessage = this.sendMessage.bind(this);
    }
    componentDidMount() {
        window.addEventListener("message", this.onReceiveMessage);
        this._frame.addEventListener("load", this.onLoad);
    }
    componentWillUnmount() {
        window.removeEventListener("message", this.onReceiveMessage, false);
    }
    componentWillReceiveProps(nextProps) {
        if (this.props.postMessageData !== nextProps.postMessageData) {
            // send a message if postMessageData changed
            this.sendMessage(nextProps.postMessageData);
        }
    }
    onReceiveMessage(event) {
        const { handleReceiveMessage } = this.props;
        if (handleReceiveMessage) {
            handleReceiveMessage(event);
        }
    }
    onLoad() {
        const { handleReady } = this.props;
        if (handleReady) {
            handleReady();
        }
        // TODO: Look into doing a syn-ack TCP-like handshake
        //       to make sure iFrame is ready to REALLY accept messages, not just loaded.
        // send intial props when iframe loads
        this.sendMessage(this.props.postMessageData);
    }
    serializePostMessageData(data) {
        // Rely on the browser's built-in structured clone algorithm for serialization of the
        // message as described in
        // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
        if (!this.props.serializeMessage) {
            return data;
        }

        // To be on the safe side we can also ignore the browser's built-in serialization feature
        // and serialize the data manually.
        if (typeof data === "object") {
            return JSON.stringify(data);
        } else if (typeof data === "string") {
            return data;
        } else {
            return `${data}`;
        }
    }
    sendMessage(postMessageData) {
        // Using postMessage data from props will result in a subtle but deadly bug,
        // where old data from props is being sent instead of new postMessageData.
        // This is because data sent from componentWillReceiveProps is not yet in props but only in nextProps.
        const { targetOrigin } = this.props;
        const serializedData = this.serializePostMessageData(postMessageData);
        this._frame.contentWindow.postMessage(serializedData, targetOrigin);
    }
    render() {
        const { attributes } = this.props;
        // define some sensible defaults for our iframe attributes
        const defaultAttributes = {
            allowFullScreen: false,
            frameBorder: 0
        };
        // then merge in the user's attributes with our defaults
        const mergedAttributes = Object.assign(
            {},
            defaultAttributes,
            attributes
        );
        return (
            <iframe
                ref={el => {
                    this._frame = el;
                }}
                {...mergedAttributes}
            />
        );
    }
}

IframeComm.defaultProps = {
    serializeMessage: true,
    targetOrigin: "*",
    postMessageData: ""
};

IframeComm.propTypes = {
    /*
        Iframe Attributes
        https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#Attributes
        React Supported Attributes
        https://facebook.github.io/react/docs/dom-elements.html#all-supported-html-attributes
        Note: attributes are camelCase, not all lowercase as usually defined.
    */
    attributes: PropTypes.shape({
        allowFullScreen: PropTypes.oneOfType([
            PropTypes.string,
            PropTypes.bool
        ]),
        frameBorder: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
        height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
        name: PropTypes.string,
        scrolling: PropTypes.string,
        // https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
        sandbox: PropTypes.string,
        srcDoc: PropTypes.string,
        src: PropTypes.string.isRequired,
        width: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
    }),

    // Callback function called when iFrame sends the parent window a message.
    handleReceiveMessage: PropTypes.func,

    /*
        Callback function called when iframe loads.
        We're simply listening to the iframe's `window.onload`.
        To ensure communication code in your iframe is totally loaded,
        you can implement a syn-ack TCP-like handshake using `postMessageData` and `handleReceiveMessage`.
    */
    handleReady: PropTypes.func,

    /*
        You can pass it anything you want, we'll serialize to a string
        preferablly use a simple string message or an object.
        If you use an object, you need to follow the same naming convention
        in the iframe so you can parse it accordingly.
     */
    postMessageData: PropTypes.any.isRequired,

    /*
        Enable use of the browser's built-in structured clone algorithm for serialization
        by settings this to `false`.
        Default is `true`, using our built in logic for serializing everything to a string.
    */
    serializeMessage: PropTypes.bool,

    /*
        Always provide a specific targetOrigin, not *, if you know where the other window's document should be located. Failing to provide a specific target discloses the data you send to any interested malicious site.
     */
    targetOrigin: PropTypes.string
};

export default IframeComm;


text:
```
docker build -t neunnsy/websphere-traditional:8.5.5.10-profile .
```

## Pull Image From Docker Hub
```
docker pull neunnsy/websphere-traditional:8.5.5.10-profile
```


text:
using namespace std;
#define MAXN 6

int array[MAXN];

void insertionSort(){
	// Loop through elements to place them in correct positions
	for(int i = 1; i < MAXN; i++){
		int key = array[i];
		int j= i - 1;
		// Find correct position
		for(; j >= 0 && array[j] > key; j--){
			// Shift current element one to the right
			array[j+1] = array[j];
		}
		// Place the key after the first element that is less than it
		// If key should go at index 0, then j is -1 after the loop, so it works
		array[j+1] = key;
	}
}

int main(){
	for(int i = 0; i < MAXN; i++)
		scanf("%d", &array[i]);

	insertionSort();

	for(int i = 0; i < MAXN; i++)
		printf("%d ", array[i]);

	return 0;
}


text:
import React from 'react';
import {SmoothLine} from 'react-pathjs-chart';
import genie from 'genie'
import ChartDemo from './ChartDemo.js';
import _ from 'lodash';

export class SmoothLineDemo {
    get dataTemplate() {
        return {
            n:3,
            a: 1,
            b: 0,
            c: 0
        }
    }
    get options() {
        return {
            width:600,
            height:600,
            color:'#2980B9',
            margin: {top: 40, left: 60, bottom: 50, right: 20},
            animate:{
                type:'delayed',
                duration:200
            },
            axisX: {
                showAxis: true,
                showLines: true,
                showLabels: true,
                showTicks: true,
                zeroAxis: false,
                orient: 'bottom',
                label:{
                    fontFamily:'Arial',
                    fontSize:14,
                    fontWeight:true,
                    fill:'#34495E'
                }
            },
            axisY: {
                showAxis: true,
                showLines: true,
                showLabels: true,
                showTicks: true,
                zeroAxis: false,
                orient: 'left',
                label:{
                    fontFamily:'Arial',
                    fontSize:14,
                    fontWeight:true,
                    fill:'#34495E'
                }
            }
        }
    }
    get props(){
        return {xKey:"x",yKey:"y"}
    }
    generateData(dataTemplate){
        var xs = _.range(-10, 11, 1);
        var nPolynom = function (n, a, b, c) {
            return _.map(xs, function (x) {
                return {x: x, y: a * Math.pow(x, n) + b * x + c}
            })
        };
        return [nPolynom(dataTemplate.n,dataTemplate.a,dataTemplate.b,dataTemplate.c),nPolynom(dataTemplate.n -1,dataTemplate.a,dataTemplate.b,dataTemplate.c)]
    }
}

export default class SmoothLineChartDemo extends ChartDemo {
    constructor(props) {
        super(props, SmoothLine, new SmoothLineDemo());
    }
};


text:
<component name="libraryTable">
  <library name="palette-v7-23.1.1">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/palette-v7/23.1.1/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/palette-v7/23.1.1/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AndroidSDKFolder/extras/android/m2repository/com/android/support/palette-v7/23.1.1/palette-v7-23.1.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
package ubc.pavlab.aspiredb.server.service;

import gemma.gsec.SecurityService;
import gemma.gsec.authentication.UserManager;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserCache;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.cache.NullUserCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ubc.pavlab.aspiredb.server.model.common.auditAndSecurity.User;
import ubc.pavlab.aspiredb.server.model.common.auditAndSecurity.UserGroup;
import ubc.pavlab.aspiredb.server.security.authentication.UserService;

/**
 * Manage user groups.
 *
 * @author Gaya Charath
 * @since: 11/03/14
 */
@Service
@RemoteProxy(name = "UserManagerService")
public class UserManagerServiceImpl implements UserManagerService {

    @Autowired(required = false)
    private UserCache userCache = new NullUserCache();

    @Autowired
    private UserService userService;

    @Autowired
    private SubjectService subjectService;

    @Autowired
    private SecurityService securityService;
    @Autowired
    private UserManager userManager;

    /*
     * (non-Javadoc)
     *
     * @see ubic.gemma.security.authentication.UserManagerI#getCurrentUser()
     */
    @Override
    public User getCurrentUser() {
        return ( User ) userManager.getCurrentUser();
    }

    /*
     * (non-Javadoc)
     *
     * @see ubic.gemma.security.authentication.UserManager#getCurrentUsername()
     */
    @Override
    public String getCurrentUsername() {
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();

        if ( auth == null || !auth.isAuthenticated() ) {
            throw new IllegalStateException( "Not authenticated!" );
        }

        if ( auth.getPrincipal() instanceof UserDetails ) {
            return ( ( UserDetails ) auth.getPrincipal() ).getUsername();
        }
        return auth.getPrincipal().toString();
    }

    /**
     * Create group using gsec
     */
    @Override
    @Transactional
    @RemoteMethod
    public String createUserGroup( String groupName ) {

        try {
            securityService.createGroup( groupName );
        } catch ( Exception exception ) {
            return exception.toString();
        }
        return "Success";
    }

    /**
     * Remove user from the group using gsec
     */
    @Override
    @Transactional
    @RemoteMethod
    public String deleteUserFromGroup( String groupName, String userName ) {

        try {
            securityService.removeUserFromGroup( userName, groupName );
        } catch ( Exception exception ) {
            return exception.toString();
        }
        return "Success";
    }

    @Override
    @Transactional
    @RemoteMethod
    public String deleteGroup( String groupName ) {

        if ( !securityService.getGroupsUserCanEdit( getCurrentUsername() ).contains( groupName ) ) {
            throw new IllegalArgumentException( "You don't have permission to modify that group" );
        }
        /*
         * Additional checks for ability to delete group handled by ss.
         */
        try {
            userManager.deleteGroup( groupName );
        } catch ( DataIntegrityViolationException div ) {
            // throw div;
            return div.toString();
        }
        return "Success";

    }

    @Override
    @Transactional
    @RemoteMethod
    public Collection<String> loadUserEditableGroups() {

        Collection<String> usergroups = securityService.getGroupsUserCanEdit( getCurrentUsername() );
        List<UserGroup> UserGroup = new ArrayList<UserGroup>();

        for ( String usergroup : usergroups ) {
            UserGroup.add( ( ubc.pavlab.aspiredb.server.model.common.auditAndSecurity.UserGroup ) userService
                    .findGroupByName( usergroup ) );
        }
        return usergroups;
    }

    @Override
    @Transactional
    @RemoteMethod
    public List<String> findGroupMemebers( String groupName ) {
        List<String> members = new ArrayList<String>();

        if ( groupName == null ) {
            return members;
        }

        members = userManager.findUsersInGroup( groupName );
        return members;
    }

    @Override
    @Transactional
    @RemoteMethod
    public String addUserToGroup( String groupName, String userName ) {

        User userTakingAction = ( User ) userManager.getCurrentUser();

        if ( userTakingAction == null ) {
            throw new IllegalStateException( "Cannot add user to group when user is not logged in" );
        }

        User u;
        if ( userManager.userExists( userName ) ) {
            u = ( User ) userManager.findByUserName( userName );
            if ( !u.getEnabled() ) {
                throw new IllegalArgumentException( "Sorry, that user's account is not enabled." );
            }

            securityService.addUserToGroup( userName, groupName );
        } else if ( userManager.userWithEmailExists( userName ) ) {
            u = ( User ) userManager.findByEmail( userName );
            if ( !u.getEnabled() ) {
                throw new IllegalArgumentException( "Sorry, that user's account is not enabled." );
            }

            String uname = u.getUserName();
            securityService.addUserToGroup( uname, groupName );
        } else {
            // throw new IllegalArgumentException( "Sorry, there is no matching user." );
            return "Sorry, there is no matching user.";
        }

        // /*
        // * send the user an email.
        // */
        // String emailAddress = u.getEmail();
        // if ( StringUtils.isNotBlank( emailAddress ) ) {
        // log.debug( "Sending email notification to " + emailAddress );
        // SimpleMailMessage msg = new SimpleMailMessage();
        // msg.setTo( emailAddress );
        // msg.setFrom( Settings.getAdminEmailAddress() );
        // msg.setSubject( "You have been added to a group on Gemma" );
        //
        // msg.setText( userTakingAction.getUserName() + " has added you to the group '" + groupName
        // + "'.\nTo view groups you belong to, visit " + GROUP_MANAGER_URL
        // + "\n\nIf you believe you received this email in error, contact " + Settings.getAdminEmailAddress()
        // + "." );
        //
        // mailEngine.send( msg );
        // }

        return "Success";

    }

    /*
     * (non-Javadoc)
     *
     * @see ubic.gemma.security.authentication.UserManager#findGroupByName(java.lang.String)
     */
    @Override
    @Transactional
    public UserGroup findGroupByName( String name ) {
        return ( ubc.pavlab.aspiredb.server.model.common.auditAndSecurity.UserGroup ) this.userService
                .findGroupByName( name );
    }

}


text:
#pragma once

#include <coffee/core/libc_types.h>
#include <coffee/core/stl_types.h>
#include <coffee/core/types/version.h>

namespace Coffee {
namespace Display {
namespace GL {

/*!
 * \brief GL context version
 */
struct Version : public version<u8>
{
    Version()
    {
        this->major    = 0;
        this->minor    = 0;
        this->revision = 0;
    }
    Version(u8 maj, u8 min)
    {
        this->major    = maj;
        this->minor    = min;
        this->revision = 0;
    }
    CString driver;
};

} // namespace GL
} // namespace Display
} // namespace Coffee


text:
package connect.view;

import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;

import connect.ui.activity.R;
import connect.utils.system.SystemUtil;

/**
 * Created by pujin on 17-5-2.
 */

public class DBUpgradeView extends View {

    private String Tag = "DBUpgradeView";

    private int progress;
    private int ROUND_DIRECT = -360;
    private int padding;

    private boolean drawFinish = false;
    private Paint mPaint = new Paint();
    private Paint backPaint = new Paint();
    private RectF rectf;

    public DBUpgradeView(Context context) {
        super(context);
        initView();
    }

    public DBUpgradeView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    public DBUpgradeView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView();
    }

    protected void initView() {
        padding = SystemUtil.dipToPx(5);

        mPaint.setColor(getContext().getResources().getColor(R.color.color_00c400));
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setAntiAlias(true);
        mPaint.setStrokeWidth(SystemUtil.pxToSp(5));

        backPaint.setColor(getContext().getResources().getColor(R.color.color_b3b5bc));
        backPaint.setStyle(Paint.Style.STROKE);
        backPaint.setAntiAlias(true);
        backPaint.setStrokeWidth(SystemUtil.pxToSp(5));
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        drawBackCircle(canvas);
        drawProgressCircle(canvas);
            drawProgress(canvas);
    }

    private float curProgress = 0;

    public void drawProgress(Canvas canvas) {
        if (progress < 100) {
//            int fontsize = SystemUtil.dipToPx(16);
//            int startX = getWidth()/2 - Math.abs(progress) < 10 ? fontsize / 2 : fontsize;
//            canvas.drawText(String.valueOf(progress), startX, getHeight() / 2 - fontsize / 2, mPaint);
        } else {
            Path path = new Path();
            path.moveTo(getWidth() * 3 / 10-10, getWidth() * 4 / 10);
            float[] firstLine = calculateFirstLine(curProgress);
            path.lineTo(firstLine[0], firstLine[1]);

            if (curProgress > 50) {
                float[] secondLine = calculateSecondLine(curProgress);
                path.lineTo(secondLine[0], secondLine[1]);
            }
            canvas.drawPath(path, mPaint);
        }
    }

    public float[] calculateFirstLine(float progress) {
        float[] point = new float[2];
        float percent = progress / 50;
        if (percent >= 1) {
            percent = 1;
        }
        point[0] = getWidth() * 3 / 10-10 + (getWidth() * 2 / 10) * percent;
        point[1] = getWidth() * 4 / 10 + (getWidth() * 2 / 10) * percent;
        return point;
    }

    public float[] calculateSecondLine(float progress) {
        progress -= 50;
        float[] point = {0, 0};
        float percent = progress / 50;
        if (percent > 0) {
            point[0] = getWidth() * 5 / 10-10 + (getWidth() * 3 / 10) * percent;
            point[1] = getWidth() * 6 / 10 - (getWidth() * 3/ 10) * percent;
        }
        return point;
    }

    protected void drawProgressCircle(Canvas canvas) {
        rectf = new RectF(padding, padding, getWidth() - padding, getHeight() - padding);
        canvas.drawArc(rectf, -90, -progress * ROUND_DIRECT / 100, false, mPaint);
    }

    protected void drawBackCircle(Canvas canvas) {
        rectf = new RectF(padding, padding, getWidth() - padding, getHeight() - padding);
        canvas.drawArc(rectf, -90, 360, false, backPaint);
    }

    public void setProgress(int progress) {
        this.progress = progress;
        invalidate();

        if (progress == 100) {
            ValueAnimator animator = ValueAnimator.ofFloat(0, 100);
            animator.setDuration(200).start();
            animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    curProgress = (float) animation.getAnimatedValue();
                    invalidate();
                }
            });
        }
    }
}


text:
using ContosoWeb.Utils;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace ContosoWeb.Areas.Admin.Controllers
{
    public class RaincheckController : AdminController
    {
        private readonly IRaincheckQuery _query;

        public RaincheckController(IRaincheckQuery query)
        {
            _query = query;
        }

        public async Task<ActionResult> Index()
        {
            var rainchecks = await _query.GetAllAsync();

            return View(rainchecks);
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Index — Pythonista Documentation</title>
    <link rel="stylesheet" href="_static/pythonista.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Pythonista Documentation"
          href="_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="about.html" />
    <link rel="copyright" title="Copyright" href="copyright.html" />
    <link rel="top" title="Pythonista Documentation" href="index.html" />
    <link rel="shortcut icon" type="image/png" href="_static/py.png" />
    <meta name = "viewport" content = "width=device-width,initial-scale=1.0,user-scalable=no;">

Navigation

          index

          modules |

Pythonista Documentation »

Index – G

G.722

gaierror

gamma() (in module math)

gammavariate() (in module random)

garbage (in module gc)

garbage collection, [1]

gauss() (in module random)

gc (module)

gcd() (in module fractions)

gdbm

module, [1], [2]

ge() (in module operator)

generate_tokens() (in module tokenize)

generator, [1]

expression

function, [1], [2]

iterator, [1]

object, [1], [2]

Generator (class in email.generator)

generator expression, [1]

GeneratorExit

exception

GeneratorType (in module types)

generic

special attribute

generic_visit() (ast.NodeVisitor method)

genops() (in module pickletools)

geocode() (in module location)

GET (bottle.BaseRequest attribute)

get() (bottle.Bottle method)

(ConfigParser.ConfigParser method)

(ConfigParser.RawConfigParser method)

(Queue.Queue method)

(bottle.MultiDict method)

(bs4.Tag method)

(dict method)

(email.message.Message method)

(in module bottle)

(in module clipboard)

(in module requests)

(in module stpl)

(mailbox.Mailbox method)

(requests.Session method)

(rfc822.Message method)

(xml.etree.ElementTree.Element method)

get_account() (in module twitter)

get_adapter() (requests.Session method)

get_albums() (in module photos)

get_all() (email.message.Message method)

(wsgiref.headers.Headers method)

get_all_accounts() (in module twitter)

get_all_breaks() (bdb.Bdb method)

get_all_calendars() (in module reminders)

get_all_groups() (in module contacts)

get_all_people() (in module contacts)

get_app() (wsgiref.simple_server.WSGIServer method)

get_archive_formats() (in module shutil)

get_asset_with_local_id() (in module photos)

get_assets() (in module photos)

get_attachments() (in module appex)

get_attitude() (in module motion)

get_body_encoding() (email.charset.Charset method)

get_boundary() (email.message.Message method)

get_break() (bdb.Bdb method)

get_breaks() (bdb.Bdb method)

get_buffer() (xdrlib.Packer method)

(xdrlib.Unpacker method)

get_calendar() (in module reminders)

get_charset() (email.message.Message method)

get_charsets() (email.message.Message method)

get_children() (symtable.SymbolTable method)

get_clipboard_size() (in module canvas)

get_close_matches() (in module difflib)

get_code() (imputil.BuiltinImporter method)

(imputil.Importer method)

(zipimport.zipimporter method)

get_config_h_filename() (in module sysconfig)

get_config_var() (in module sysconfig)

get_config_vars() (in module sysconfig)

get_content_charset() (email.message.Message method)

get_content_maintype() (email.message.Message method)

get_content_subtype() (email.message.Message method)

get_content_type() (email.message.Message method)

get_controllers() (in module scene)

get_cookie() (bottle.BaseRequest method)

get_count() (in module gc)

get_data() (in module pkgutil)

(urllib2.Request method)

(zipimport.zipimporter method)

get_date() (mailbox.MaildirMessage method)

get_debug() (in module gc)

get_default() (argparse.ArgumentParser method)

get_default_calendar() (in module reminders)

get_default_type() (email.message.Message method)

get_dialect() (in module csv)

get_docstring() (in module ast)

get_doctest() (doctest.DocTestParser method)

get_environ() (wsgiref.simple_server.WSGIRequestHandler method)

get_errno() (in module ctypes)

get_examples() (doctest.DocTestParser method)

get_favorites() (in module twitter)

get_favorites_album() (in module photos)

get_field() (string.Formatter method)

get_file() (mailbox.Babyl method)

(mailbox.MH method)

(mailbox.MMDF method)

(mailbox.Mailbox method)

(mailbox.Maildir method)

(mailbox.mbox method)

get_file_breaks() (bdb.Bdb method)

get_file_path() (in module appex)

get_file_paths() (in module appex)

get_filename() (email.message.Message method)

(zipimport.zipimporter method)

get_flags() (mailbox.MaildirMessage method)

(mailbox.MMDFMessage method)

(mailbox.mboxMessage method)

get_folder() (mailbox.Maildir method)

(mailbox.MH method)

get_frees() (symtable.Function method)

get_from() (mailbox.mboxMessage method)

(mailbox.MMDFMessage method)

get_full_url() (urllib2.Request method)

get_globals() (symtable.Function method)

get_gravity() (in module motion)

get_group() (in module contacts)

get_grouped_opcodes() (difflib.SequenceMatcher method)

get_header() (bottle.BaseRequest method)

(bottle.BaseResponse method)

(urllib2.Request method)

get_home_timeline() (in module twitter)

get_host() (urllib2.Request method)

get_id() (symtable.SymbolTable method)

get_ident() (in module thread)

get_identifiers() (symtable.SymbolTable method)

get_image() (in module appex)

(in module clipboard)

(photos.Asset method)

(ui.ImageContext method)

get_image_data() (in module appex)

(photos.Asset method)

get_image_path() (in module scene)

get_image_size() (in module canvas)

get_images() (in module appex)

get_images_data() (in module appex)

get_importer() (in module pkgutil)

get_info() (mailbox.MaildirMessage method)

GET_ITER (opcode)

get_labels() (mailbox.Babyl method)

(mailbox.BabylMessage method)

get_languages() (in module speech)

get_last_error() (in module ctypes)

get_line_selection() (in module editor)

get_lineno() (symtable.SymbolTable method)

get_loader() (in module pkgutil)

get_locals() (symtable.Function method)

get_location() (in module location)

get_magic() (in module imp)

get_magnetic_field() (in module motion)

get_matching_blocks() (difflib.SequenceMatcher method)

get_mentions_timeline() (in module twitter)

get_message() (mailbox.Mailbox method)

get_method() (urllib2.Request method)

get_methods() (symtable.Class method)

get_moments() (in module photos)

get_name() (symtable.Symbol method)

(symtable.SymbolTable method)

get_namespace() (symtable.Symbol method)

get_namespaces() (symtable.Symbol method)

get_nonstandard_attr() (cookielib.Cookie method)

get_nowait() (Queue.Queue method)

get_objects() (in module gc)

get_opcodes() (difflib.SequenceMatcher method)

get_option() (optparse.OptionParser method)

get_option_group() (optparse.OptionParser method)

get_origin_req_host() (urllib2.Request method)

get_output_charset() (email.charset.Charset method)

get_param() (email.message.Message method)

get_parameters() (symtable.Function method)

get_params() (email.message.Message method)

get_password() (in module keychain)

get_path() (in module editor)

(in module sysconfig)

get_path_names() (in module sysconfig)

get_paths() (in module sysconfig)

get_payload() (email.message.Message method)

get_person() (in module contacts)

get_platform() (in module sysconfig)

get_position() (xdrlib.Unpacker method)

get_python_version() (in module sysconfig)

get_recently_added_album() (in module photos)

get_referents() (in module gc)

get_referrers() (in module gc)

get_reminders() (in module reminders)

get_request() (SocketServer.BaseServer method)

get_request_headers() (in module twitter)

get_scheduled() (in module notification)

get_scheme() (wsgiref.handlers.BaseHandler method)

get_scheme_names() (in module sysconfig)

get_screen_scale() (in module scene)

get_screen_size() (in module scene)

(in module ui)

get_screenshots_album() (in module photos)

get_selection() (in module editor)

get_selector() (urllib2.Request method)

get_selfies_album() (in module photos)

get_sequences() (mailbox.MH method)

(mailbox.MHMessage method)

get_server_certificate() (in module ssl)

get_size() (in module canvas)

get_smart_albums() (in module photos)

get_socket() (telnetlib.Telnet method)

get_source() (zipimport.zipimporter method)

get_stack() (bdb.Bdb method)

get_starttag_text() (HTMLParser.HTMLParser method)

(sgmllib.SGMLParser method)

get_state() (in module cb)

get_stderr() (wsgiref.handlers.BaseHandler method)

(wsgiref.simple_server.WSGIRequestHandler method)

get_stdin() (wsgiref.handlers.BaseHandler method)

get_string() (mailbox.Mailbox method)

get_subdir() (mailbox.MaildirMessage method)

get_suffixes() (in module imp)

get_symbols() (symtable.SymbolTable method)

get_terminator() (asynchat.async_chat method)

get_text() (bs4.Tag method)

(in module appex)

(in module editor)

get_text_size() (in module canvas)

get_threshold() (in module gc)

get_token() (shlex.shlex method)

get_type() (symtable.SymbolTable method)

(urllib2.Request method)

get_ui_image() (photos.Asset method)

get_uniform() (scene.Shader method)

get_unixfrom() (email.message.Message method)

get_url() (bottle.Bottle method)

(in module appex)

get_urls() (in module appex)

get_usage() (optparse.OptionParser method)

get_user_acceleration() (in module motion)

get_value() (string.Formatter method)

get_vcards() (in module appex), [1]

get_version() (optparse.OptionParser method)

get_visible() (mailbox.BabylMessage method)

get_widget_view() (in module appex)

get_window_size() (in module ui)

getacl() (imaplib.IMAP4 method)

getaddr() (rfc822.Message method)

getaddresses() (in module email.utils)

getaddrinfo() (in module socket)

getaddrlist() (rfc822.Message method)

getall() (bottle.MultiDict method)

getallmatchingheaders() (rfc822.Message method)

getannotation() (imaplib.IMAP4 method)

getargspec() (in module inspect)

getargvalues() (in module inspect)

getatime() (in module os.path)

getattr() (built-in function)

getAttribute() (xml.dom.Element method)

getAttributeNode() (xml.dom.Element method)

getAttributeNodeNS() (xml.dom.Element method)

getAttributeNS() (xml.dom.Element method)

getbands() (Image.Image method)

GetBase() (xml.parsers.expat.xmlparser method)

getbbox() (Image.Image method)

(ImagePath.path method)

getboolean() (ConfigParser.RawConfigParser method)

getByteStream() (xml.sax.xmlreader.InputSource method)

getcallargs() (in module inspect)

getcaps() (in module mailcap)

getCharacterStream() (xml.sax.xmlreader.InputSource method)

getcheckinterval() (in module sys)

getChild() (logging.Logger method)

getChildNodes() (compiler.ast.Node method)

getChildren() (compiler.ast.Node method)

getchildren() (xml.etree.ElementTree.Element method)

getclasstree() (in module inspect)

getcolor() (in module ImageColor)

getcolors() (Image.Image method), [1]

getColumnNumber() (xml.sax.xmlreader.Locator method)

getcomments() (in module inspect)

getcompname() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getcomptype() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getContentHandler() (xml.sax.xmlreader.XMLReader method)

getcontext() (in module decimal)

(mhlib.MH method)

getctime() (in module os.path)

getcurrent() (mhlib.Folder method)

getcwd() (in module os)

getcwdu (2to3 fixer)

getcwdu() (in module os)

getdata() (Image.Image method)

getdate() (rfc822.Message method)

getdate_tz() (rfc822.Message method)

getdecoder() (in module codecs)

getdefaultencoding() (in module sys)

getdefaultlocale() (in module locale)

getdefaulttimeout() (in module socket)

getdlopenflags() (in module sys)

getdoc() (in module inspect)

getDOMImplementation() (in module xml.dom)

getDTDHandler() (xml.sax.xmlreader.XMLReader method)

getEffectiveLevel() (logging.Logger method)

getegid() (in module os)

getElementsByTagName() (xml.dom.Document method)

(xml.dom.Element method)

getElementsByTagNameNS() (xml.dom.Document method)

(xml.dom.Element method)

getencoder() (in module codecs)

getencoding() (mimetools.Message method)

getEncoding() (xml.sax.xmlreader.InputSource method)

getEntityResolver() (xml.sax.xmlreader.XMLReader method)

getenv() (in module os)

getErrorHandler() (xml.sax.xmlreader.XMLReader method)

geteuid() (in module os)

getEvent() (xml.dom.pulldom.DOMEventStream method)

getEventCategory() (logging.handlers.NTEventLogHandler method)

getEventType() (logging.handlers.NTEventLogHandler method)

getException() (xml.sax.SAXException method)

getextrema() (Image.Image method)

getFeature() (xml.sax.xmlreader.XMLReader method)

getfile() (in module inspect)

getfilesystemencoding() (in module sys)

getfirst() (cgi.FieldStorage method)

getfirstmatchingheader() (rfc822.Message method)

getfloat() (ConfigParser.RawConfigParser method)

getfqdn() (in module socket)

getframeinfo() (in module inspect)

getframerate() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getfullname() (mhlib.Folder method)

getgid() (in module os)

getgroups() (in module os)

getheader() (httplib.HTTPResponse method)

(rfc822.Message method)

getheaders() (httplib.HTTPResponse method)

gethostbyaddr() (in module socket), [1]

gethostbyname() (in module socket)

gethostbyname_ex() (in module socket)

gethostname() (in module socket), [1]

getincrementaldecoder() (in module codecs)

getincrementalencoder() (in module codecs)

getinfo() (zipfile.ZipFile method)

getinnerframes() (in module inspect)

GetInputContext() (xml.parsers.expat.xmlparser method)

getint() (ConfigParser.RawConfigParser method)

getitem() (in module operator)

getiterator() (xml.etree.ElementTree.Element method)

(xml.etree.ElementTree.ElementTree method)

getitimer() (in module signal)

getlast() (mhlib.Folder method)

GetLastError() (in module ctypes)

getLength() (xml.sax.xmlreader.Attributes method)

getLevelName() (in module logging)

getline() (in module linecache)

getLineNumber() (xml.sax.xmlreader.Locator method)

getlist() (bottle.MultiDict method)

(cgi.FieldStorage method)

getloadavg() (in module os)

getlocale() (in module locale)

getLogger() (in module logging)

getLoggerClass() (in module logging)

getlogin() (in module os)

getmaintype() (mimetools.Message method)

getmark() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getmarkers() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getmask() (ImageFont.font method)

getmember() (tarfile.TarFile method)

getmembers() (in module inspect)

(tarfile.TarFile method)

getMessage() (logging.LogRecord method)

(xml.sax.SAXException method)

getmessagefilename() (mhlib.Folder method)

getMessageID() (logging.handlers.NTEventLogHandler method)

getmodule() (in module inspect)

getmoduleinfo() (in module inspect)

getmodulename() (in module inspect)

getmro() (in module inspect)

getmtime() (in module os.path)

getname() (chunk.Chunk method)

getName() (threading.Thread method)

getNameByQName() (xml.sax.xmlreader.AttributesNS method)

getnameinfo() (in module socket)

getnames() (tarfile.TarFile method)

getNames() (xml.sax.xmlreader.Attributes method)

getnchannels() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getnframes() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getnode

getnode() (in module uuid)

getone (bottle.MultiDict attribute)

getopt (module)

getopt() (in module getopt)

GetoptError

getouterframes() (in module inspect)

getoutput() (in module commands)

getparam() (mimetools.Message method)

getparams() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getpass (module)

getpass() (in module getpass)

getpath() (mhlib.MH method)

getpeercert() (ssl.SSLSocket method)

getpeername() (socket.socket method)

getpgid() (in module os)

getpgrp() (in module os)

getpid() (in module os)

getpixel() (Image.Image method)

getplist() (mimetools.Message method)

getpos() (HTMLParser.HTMLParser method)

getppid() (in module os)

getpreferredencoding() (in module locale)

getprofile() (in module sys)

(mhlib.MH method)

getProperty() (xml.sax.xmlreader.XMLReader method)

getprotobyname() (in module socket)

getproxies() (in module urllib)

getPublicId() (xml.sax.xmlreader.InputSource method)

(xml.sax.xmlreader.Locator method)

getpwall() (in module pwd)

getpwnam() (in module pwd)

getpwuid() (in module pwd)

getQNameByName() (xml.sax.xmlreader.AttributesNS method)

getQNames() (xml.sax.xmlreader.AttributesNS method)

getquota() (imaplib.IMAP4 method)

getquotaroot() (imaplib.IMAP4 method)

getrandbits() (in module random)

getrawheader() (rfc822.Message method)

getreader() (in module codecs)

getrecursionlimit() (in module sys)

getrefcount() (in module sys)

getresgid() (in module os)

getresponse() (httplib.HTTPConnection method)

getresuid() (in module os)

getrgb() (in module ImageColor)

getroot() (xml.etree.ElementTree.ElementTree method)

getsampwidth() (aifc.aifc method)

(sunau.AU_read method)

(wave.Wave_read method)

getsequences() (mhlib.Folder method)

getsequencesfilename() (mhlib.Folder method)

getservbyname() (in module socket)

getservbyport() (in module socket)

GetSetDescriptorType (in module types)

getsid() (in module os)

getsignal() (in module signal)

getsize() (chunk.Chunk method)

(ImageFont.font method)

(in module os.path)

getsizeof() (in module sys)

getslice() (in module operator)

getsockname() (socket.socket method)

getsockopt() (socket.socket method)

getsource() (in module inspect)

getsourcefile() (in module inspect)

getsourcelines() (in module inspect)

getstate() (in module random)

getstatus() (in module commands)

getstatusoutput() (in module commands)

getSubject() (logging.handlers.SMTPHandler method)

getsubtype() (mimetools.Message method)

getSystemId() (xml.sax.xmlreader.InputSource method)

(xml.sax.xmlreader.Locator method)

gettarinfo() (tarfile.TarFile method)

gettempdir() (in module tempfile)

gettempprefix() (in module tempfile)

getTestCaseNames() (unittest.TestLoader method)

gettext (module)

getText() (bs4.Tag method)

gettext() (gettext.GNUTranslations method)

(gettext.NullTranslations method)

(in module gettext)

gettimeout() (socket.socket method)

gettrace() (in module sys)

gettype() (mimetools.Message method)

getType() (xml.sax.xmlreader.Attributes method)

getuid() (in module os)

geturl() (urlparse.ParseResult method)

getvalue() (io.BytesIO method)

(StringIO.StringIO method)

(io.StringIO method)

getValue() (xml.sax.xmlreader.Attributes method)

getValueByQName() (xml.sax.xmlreader.AttributesNS method)

getweakrefcount() (in module weakref)

getweakrefs() (in module weakref)

getwelcome() (ftplib.FTP method)

(nntplib.NNTP method)

(poplib.POP3 method)

getwindowsversion() (in module sys)

getwriter() (in module codecs)

gid (tarfile.TarInfo attribute)

GIL

glob

module

glob (module)

glob() (in module glob)

global

name binding

namespace

statement, [1], [2]

global interpreter lock

global_config() (bottle.BaseTemplate class method)

globals

built-in function

globals() (built-in function)

globs (doctest.DocTest attribute)

gmtime() (in module time)

gname (tarfile.TarInfo attribute)

GNOME

GNU_FORMAT (in module tarfile)

gnu_getopt() (in module getopt)

go_back() (ui.WebView method)

go_forward() (ui.WebView method)

got (doctest.DocTestFailure attribute)

grammar

gravity() (in module scene)

grayscale() (in module ImageOps)

GREATER (in module token)

GREATEREQUAL (in module token)

Greenwich Mean Time

Group (class in contacts)

group() (nntplib.NNTP method)

(re.MatchObject method)

(scene.Action class method)

groupby() (in module itertools)

groupdict() (re.MatchObject method)

groupindex (re.RegexObject attribute)

grouping

groups (re.RegexObject attribute)

groups() (re.MatchObject method)

GState (class in ui)

gt() (in module operator)

guess_all_extensions() (in module mimetypes)

(mimetypes.MimeTypes method)

guess_extension() (in module mimetypes)

(mimetypes.MimeTypes method)

guess_scheme() (in module wsgiref.util)

guess_type() (in module mimetypes)

(mimetypes.MimeTypes method)

gzip (module)

GzipFile (class in gzip)

    © Copyright 1990-2016, Python Software Foundation.

    The Python Software Foundation is a non-profit corporation.
    Please donate.

    Last updated on Jun 10, 2016.
    Found a bug?

    Created using Sphinx 1.0.7.


text:
package org.keycloak.testsuite.cluster;

import org.apache.commons.lang.RandomStringUtils;
import org.junit.Before;
import org.keycloak.admin.client.resource.GroupResource;
import org.keycloak.admin.client.resource.GroupsResource;
import org.keycloak.representations.idm.GroupRepresentation;
import org.keycloak.testsuite.admin.ApiUtil;
import org.keycloak.testsuite.arquillian.ContainerInfo;

import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.Response;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

/**
 *
 * @author tkyjovsk
 */
public class GroupInvalidationClusterTest extends AbstractInvalidationClusterTestWithTestRealm<GroupRepresentation, GroupResource> {

    @Before
    public void setExcludedComparisonFields() {
        excludedComparisonFields.add("subGroups");
    }

    @Override
    protected GroupRepresentation createTestEntityRepresentation() {
        GroupRepresentation group = new GroupRepresentation();
        group.setName("group_" + RandomStringUtils.randomAlphabetic(5));
        group.setAttributes(new HashMap<String, List<String>>());
        group.getAttributes().put("attr1", Arrays.asList(new String[]{"attr1 value"}));
        group.getAttributes().put("attr2", Arrays.asList(new String[]{"attr2 value", "attr2 value2"}));
        return group;
    }

    protected GroupsResource groups(ContainerInfo node) {
        return getAdminClientFor(node).realm(testRealmName).groups();
    }

    @Override
    protected GroupResource entityResource(GroupRepresentation group, ContainerInfo node) {
        return entityResource(group.getId(), node);
    }

    @Override
    protected GroupResource entityResource(String id, ContainerInfo node) {
        return groups(node).group(id);
    }

    @Override
    protected GroupRepresentation createEntity(GroupRepresentation group, ContainerInfo node) {
        Response response = groups(node).add(group);
        String id = ApiUtil.getCreatedId(response);
        response.close();
        group.setId(id);
        return readEntity(group, node);
    }

    @Override
    protected GroupRepresentation readEntity(GroupRepresentation group, ContainerInfo node) {
        GroupRepresentation u = null;
        try {
            u = entityResource(group, node).toRepresentation();
        } catch (NotFoundException nfe) {
            // expected when group doesn't exist
        }
        return u;
    }

    @Override
    protected GroupRepresentation updateEntity(GroupRepresentation group, ContainerInfo node) {
        entityResource(group, node).update(group);
        return readEntity(group, node);
    }

    @Override
    protected void deleteEntity(GroupRepresentation group, ContainerInfo node) {
        entityResource(group, node).remove();
        assertNull(readEntity(group, node));
    }

    @Override
    protected GroupRepresentation testEntityUpdates(GroupRepresentation group, boolean backendFailover) {

        // groupname
        group.setName(group.getName() + "_updated");
        group = updateEntityOnCurrentFailNode(group, "name");
        verifyEntityUpdateDuringFailover(group, backendFailover);

        // attributes - add new
        group.getAttributes().put("attr3", Arrays.asList(new String[]{"attr3 value"}));
        group = updateEntityOnCurrentFailNode(group, "attributes - adding");
        verifyEntityUpdateDuringFailover(group, backendFailover);

        // attributes - remove
        group.getAttributes().remove("attr3");
        group = updateEntityOnCurrentFailNode(group, "attributes - removing");
        verifyEntityUpdateDuringFailover(group, backendFailover);

        // attributes - update 1
        group.getAttributes().get("attr1").set(0,
                group.getAttributes().get("attr1").get(0) + " - updated");
        group = updateEntityOnCurrentFailNode(group, "attributes");
        verifyEntityUpdateDuringFailover(group, backendFailover);

        // attributes - update 2
        group.getAttributes().get("attr2").set(1,
                group.getAttributes().get("attr2").get(1) + " - updated");
        group = updateEntityOnCurrentFailNode(group, "attributes");
        verifyEntityUpdateDuringFailover(group, backendFailover);

        // move
        log.info("Updating Group parent on " + getCurrentFailNode());
        GroupRepresentation parentGroup = new GroupRepresentation();
        parentGroup.setName("parent");
        parentGroup = createEntityOnCurrentFailNode(parentGroup);
        assertEquals("/" + parentGroup.getName(), parentGroup.getPath());

        Response r = entityResourceOnCurrentFailNode(parentGroup).subGroup(group);
        r.close();
        parentGroup = readEntityOnCurrentFailNode(parentGroup);
        group = readEntityOnCurrentFailNode(group);

        assertTrue(ApiUtil.groupContainsSubgroup(parentGroup, group));
        assertEquals(parentGroup.getPath() + "/" + group.getName(), group.getPath());

        verifyEntityUpdateDuringFailover(group, backendFailover);

        return group;
    }

}