text:
#include "../gl_driver.h"
#include "common/common.h"
#include "serialise/string_utils.h"

bool WrappedOpenGL::Serialise_glBlendFunc(GLenum sfactor, GLenum dfactor)
{
  SERIALISE_ELEMENT(GLenum, s, sfactor);
  SERIALISE_ELEMENT(GLenum, d, dfactor);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendFunc(s, d);
  }

  return true;
}

void WrappedOpenGL::glBlendFunc(GLenum sfactor, GLenum dfactor)
{
  m_Real.glBlendFunc(sfactor, dfactor);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_FUNC);
    Serialise_glBlendFunc(sfactor, dfactor);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendFunci(GLuint buf, GLenum src, GLenum dst)
{
  SERIALISE_ELEMENT(GLuint, b, buf);
  SERIALISE_ELEMENT(GLenum, s, src);
  SERIALISE_ELEMENT(GLenum, d, dst);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendFunci(b, s, d);
  }

  return true;
}

void WrappedOpenGL::glBlendFunci(GLuint buf, GLenum src, GLenum dst)
{
  m_Real.glBlendFunci(buf, src, dst);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_FUNCI);
    Serialise_glBlendFunci(buf, src, dst);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
  SERIALISE_ELEMENT(float, r, red);
  SERIALISE_ELEMENT(float, g, green);
  SERIALISE_ELEMENT(float, b, blue);
  SERIALISE_ELEMENT(float, a, alpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendColor(r, g, b, a);
  }

  return true;
}

void WrappedOpenGL::glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
  m_Real.glBlendColor(red, green, blue, alpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_COLOR);
    Serialise_glBlendColor(red, green, blue, alpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB,
                                                  GLenum sfactorAlpha, GLenum dfactorAlpha)
{
  SERIALISE_ELEMENT(GLenum, s1, sfactorRGB);
  SERIALISE_ELEMENT(GLenum, d1, dfactorRGB);
  SERIALISE_ELEMENT(GLenum, s2, sfactorAlpha);
  SERIALISE_ELEMENT(GLenum, d2, dfactorAlpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendFuncSeparate(s1, d1, s2, d2);
  }

  return true;
}

void WrappedOpenGL::glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha,
                                        GLenum dfactorAlpha)
{
  m_Real.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_FUNC_SEP);
    Serialise_glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
                                                   GLenum sfactorAlpha, GLenum dfactorAlpha)
{
  SERIALISE_ELEMENT(uint32_t, b, buf);
  SERIALISE_ELEMENT(GLenum, s1, sfactorRGB);
  SERIALISE_ELEMENT(GLenum, d1, dfactorRGB);
  SERIALISE_ELEMENT(GLenum, s2, sfactorAlpha);
  SERIALISE_ELEMENT(GLenum, d2, dfactorAlpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendFuncSeparatei(b, s1, d1, s2, d2);
  }

  return true;
}

void WrappedOpenGL::glBlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
                                         GLenum sfactorAlpha, GLenum dfactorAlpha)
{
  m_Real.glBlendFuncSeparatei(buf, sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_FUNC_SEPI);
    Serialise_glBlendFuncSeparatei(buf, sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendEquation(GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendEquation(m);
  }

  return true;
}

void WrappedOpenGL::glBlendEquation(GLenum mode)
{
  m_Real.glBlendEquation(mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_EQ);
    Serialise_glBlendEquation(mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendEquationi(GLuint buf, GLenum mode)
{
  SERIALISE_ELEMENT(uint32_t, b, buf);
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendEquationi(b, m);
  }

  return true;
}

void WrappedOpenGL::glBlendEquationi(GLuint buf, GLenum mode)
{
  m_Real.glBlendEquationi(buf, mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_EQI);
    Serialise_glBlendEquationi(buf, mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
  SERIALISE_ELEMENT(GLenum, m1, modeRGB);
  SERIALISE_ELEMENT(GLenum, m2, modeAlpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendEquationSeparate(m1, m2);
  }

  return true;
}

void WrappedOpenGL::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
  m_Real.glBlendEquationSeparate(modeRGB, modeAlpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_EQ_SEP);
    Serialise_glBlendEquationSeparate(modeRGB, modeAlpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
{
  SERIALISE_ELEMENT(uint32_t, b, buf);
  SERIALISE_ELEMENT(GLenum, m1, modeRGB);
  SERIALISE_ELEMENT(GLenum, m2, modeAlpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glBlendEquationSeparatei(b, m1, m2);
  }

  return true;
}

void WrappedOpenGL::glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
{
  m_Real.glBlendEquationSeparatei(buf, modeRGB, modeAlpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_EQ_SEPI);
    Serialise_glBlendEquationSeparatei(buf, modeRGB, modeAlpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glBlendBarrierKHR()
{
  if(m_State <= EXECUTING)
    m_Real.glBlendBarrierKHR();

  return true;
}

void WrappedOpenGL::glBlendBarrierKHR()
{
  CoherentMapImplicitBarrier();

  m_Real.glBlendBarrierKHR();

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BLEND_BARRIER);
    Serialise_glBlendBarrierKHR();

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glLogicOp(GLenum opcode)
{
  SERIALISE_ELEMENT(GLenum, Op, opcode);

  if(m_State <= EXECUTING)
  {
    m_Real.glLogicOp(Op);
  }

  return true;
}

void WrappedOpenGL::glLogicOp(GLenum opcode)
{
  m_Real.glLogicOp(opcode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(LOGIC_OP);
    Serialise_glLogicOp(opcode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilFunc(GLenum func, GLint ref, GLuint mask)
{
  SERIALISE_ELEMENT(GLenum, f, func);
  SERIALISE_ELEMENT(int32_t, Ref, ref);
  SERIALISE_ELEMENT(uint32_t, Mask, mask);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilFunc(f, Ref, Mask);
  }

  return true;
}

void WrappedOpenGL::glStencilFunc(GLenum func, GLint ref, GLuint mask)
{
  m_Real.glStencilFunc(func, ref, mask);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_FUNC);
    Serialise_glStencilFunc(func, ref, mask);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
  SERIALISE_ELEMENT(GLenum, Face, face);
  SERIALISE_ELEMENT(GLenum, f, func);
  SERIALISE_ELEMENT(int32_t, Ref, ref);
  SERIALISE_ELEMENT(uint32_t, Mask, mask);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilFuncSeparate(Face, f, Ref, Mask);
  }

  return true;
}

void WrappedOpenGL::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
  m_Real.glStencilFuncSeparate(face, func, ref, mask);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_FUNC_SEP);
    Serialise_glStencilFuncSeparate(face, func, ref, mask);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilMask(GLuint mask)
{
  SERIALISE_ELEMENT(uint32_t, Mask, mask);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilMask(Mask);
  }

  return true;
}

void WrappedOpenGL::glStencilMask(GLuint mask)
{
  m_Real.glStencilMask(mask);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_MASK);
    Serialise_glStencilMask(mask);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilMaskSeparate(GLenum face, GLuint mask)
{
  SERIALISE_ELEMENT(GLenum, Face, face);
  SERIALISE_ELEMENT(uint32_t, Mask, mask);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilMaskSeparate(Face, Mask);
  }

  return true;
}

void WrappedOpenGL::glStencilMaskSeparate(GLenum face, GLuint mask)
{
  m_Real.glStencilMaskSeparate(face, mask);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_MASK_SEP);
    Serialise_glStencilMaskSeparate(face, mask);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
  SERIALISE_ELEMENT(GLenum, f, fail);
  SERIALISE_ELEMENT(GLenum, zf, zfail);
  SERIALISE_ELEMENT(GLenum, p, zpass);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilOp(f, zf, p);
  }

  return true;
}

void WrappedOpenGL::glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{
  m_Real.glStencilOp(fail, zfail, zpass);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_OP);
    Serialise_glStencilOp(fail, zfail, zpass);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail,
                                                  GLenum dppass)
{
  SERIALISE_ELEMENT(GLenum, Face, face);
  SERIALISE_ELEMENT(GLenum, sf, sfail);
  SERIALISE_ELEMENT(GLenum, zf, dpfail);
  SERIALISE_ELEMENT(GLenum, p, dppass);

  if(m_State <= EXECUTING)
  {
    m_Real.glStencilOpSeparate(Face, sf, zf, p);
  }

  return true;
}

void WrappedOpenGL::glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
{
  m_Real.glStencilOpSeparate(face, sfail, dpfail, dppass);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(STENCIL_OP_SEP);
    Serialise_glStencilOpSeparate(face, sfail, dpfail, dppass);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
  SERIALISE_ELEMENT(float, r, red);
  SERIALISE_ELEMENT(float, g, green);
  SERIALISE_ELEMENT(float, b, blue);
  SERIALISE_ELEMENT(float, a, alpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glClearColor(r, g, b, a);
  }

  return true;
}

void WrappedOpenGL::glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
  m_Real.glClearColor(red, green, blue, alpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CLEAR_COLOR);
    Serialise_glClearColor(red, green, blue, alpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glClearStencil(GLint stencil)
{
  SERIALISE_ELEMENT(uint32_t, s, (uint32_t)stencil);

  if(m_State <= EXECUTING)
  {
    m_Real.glClearStencil((GLint)s);
  }

  return true;
}

void WrappedOpenGL::glClearStencil(GLint stencil)
{
  m_Real.glClearStencil(stencil);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CLEAR_STENCIL);
    Serialise_glClearStencil(stencil);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glClearDepth(GLdouble depth)
{
  SERIALISE_ELEMENT(double, d, depth);

  if(m_State <= EXECUTING)
  {
    if(IsGLES)
      m_Real.glClearDepthf((float)d);
    else
      m_Real.glClearDepth(d);
  }

  return true;
}

void WrappedOpenGL::glClearDepth(GLdouble depth)
{
  m_Real.glClearDepth(depth);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CLEAR_DEPTH);
    Serialise_glClearDepth(depth);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

void WrappedOpenGL::glClearDepthf(GLfloat depth)
{
  m_Real.glClearDepthf(depth);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CLEAR_DEPTH);
    Serialise_glClearDepth(depth);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthFunc(GLenum func)
{
  SERIALISE_ELEMENT(GLenum, f, func);

  if(m_State <= EXECUTING)
  {
    m_Real.glDepthFunc(f);
  }

  return true;
}

void WrappedOpenGL::glDepthFunc(GLenum func)
{
  m_Real.glDepthFunc(func);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_FUNC);
    Serialise_glDepthFunc(func);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthMask(GLboolean flag)
{
  SERIALISE_ELEMENT(uint8_t, f, flag);

  if(m_State <= EXECUTING)
  {
    m_Real.glDepthMask(f);
  }

  return true;
}

void WrappedOpenGL::glDepthMask(GLboolean flag)
{
  m_Real.glDepthMask(flag);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_MASK);
    Serialise_glDepthMask(flag);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthRange(GLdouble nearVal, GLdouble farVal)
{
  SERIALISE_ELEMENT(GLdouble, n, nearVal);
  SERIALISE_ELEMENT(GLdouble, f, farVal);

  if(m_State <= EXECUTING)
    m_Real.glDepthRange(n, f);

  return true;
}

void WrappedOpenGL::glDepthRange(GLdouble nearVal, GLdouble farVal)
{
  m_Real.glDepthRange(nearVal, farVal);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_RANGE);
    Serialise_glDepthRange(nearVal, farVal);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthRangef(GLfloat nearVal, GLfloat farVal)
{
  SERIALISE_ELEMENT(GLfloat, n, nearVal);
  SERIALISE_ELEMENT(GLfloat, f, farVal);

  if(m_State <= EXECUTING)
    m_Real.glDepthRangef(n, f);

  return true;
}

void WrappedOpenGL::glDepthRangef(GLfloat nearVal, GLfloat farVal)
{
  m_Real.glDepthRangef(nearVal, farVal);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_RANGEF);
    Serialise_glDepthRangef(nearVal, farVal);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthRangeIndexed(GLuint index, GLdouble nearVal, GLdouble farVal)
{
  SERIALISE_ELEMENT(GLuint, i, index);
  SERIALISE_ELEMENT(GLdouble, n, nearVal);
  SERIALISE_ELEMENT(GLdouble, f, farVal);

  if(m_State <= EXECUTING)
    m_Real.glDepthRangeIndexed(i, n, f);

  return true;
}

void WrappedOpenGL::glDepthRangeIndexed(GLuint index, GLdouble nearVal, GLdouble farVal)
{
  m_Real.glDepthRangeIndexed(index, nearVal, farVal);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_RANGE_IDX);
    Serialise_glDepthRangeIndexed(index, nearVal, farVal);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthRangeArrayv(GLuint first, GLsizei count, const GLdouble *v)
{
  SERIALISE_ELEMENT(uint32_t, idx, first);
  SERIALISE_ELEMENT(uint32_t, cnt, count);
  SERIALISE_ELEMENT_ARR(GLdouble, ranges, v, cnt * 2);

  if(m_State <= EXECUTING)
  {
    m_Real.glDepthRangeArrayv(idx, cnt, ranges);
  }

  delete[] ranges;

  return true;
}

void WrappedOpenGL::glDepthRangeArrayv(GLuint first, GLsizei count, const GLdouble *v)
{
  m_Real.glDepthRangeArrayv(first, count, v);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_RANGEARRAY);
    Serialise_glDepthRangeArrayv(first, count, v);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDepthBoundsEXT(GLclampd nearVal, GLclampd farVal)
{
  SERIALISE_ELEMENT(GLdouble, n, nearVal);
  SERIALISE_ELEMENT(GLdouble, f, farVal);

  if(m_State <= EXECUTING)
  {
    m_Real.glDepthBoundsEXT(n, f);
  }

  return true;
}

void WrappedOpenGL::glDepthBoundsEXT(GLclampd nearVal, GLclampd farVal)
{
  m_Real.glDepthBoundsEXT(nearVal, farVal);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DEPTH_BOUNDS);
    Serialise_glDepthBoundsEXT(nearVal, farVal);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glClipControl(GLenum origin, GLenum depth)
{
  SERIALISE_ELEMENT(GLenum, o, origin);
  SERIALISE_ELEMENT(GLenum, d, depth);

  if(m_State <= EXECUTING)
  {
    m_Real.glClipControl(o, d);
  }

  return true;
}

void WrappedOpenGL::glClipControl(GLenum origin, GLenum depth)
{
  m_Real.glClipControl(origin, depth);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CLIP_CONTROL);
    Serialise_glClipControl(origin, depth);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glProvokingVertex(GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glProvokingVertex(m);
  }

  return true;
}

void WrappedOpenGL::glProvokingVertex(GLenum mode)
{
  m_Real.glProvokingVertex(mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(PROVOKING_VERTEX);
    Serialise_glProvokingVertex(mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPrimitiveRestartIndex(GLuint index)
{
  SERIALISE_ELEMENT(GLuint, i, index);

  if(m_State <= EXECUTING)
  {
    m_Real.glPrimitiveRestartIndex(i);
  }

  return true;
}

void WrappedOpenGL::glPrimitiveRestartIndex(GLuint index)
{
  m_Real.glPrimitiveRestartIndex(index);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(PRIMITIVE_RESTART);
    Serialise_glPrimitiveRestartIndex(index);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDisable(GLenum cap)
{
  SERIALISE_ELEMENT(GLenum, c, cap);

  if(m_State <= EXECUTING)
  {
    m_Real.glDisable(c);
  }

  return true;
}

void WrappedOpenGL::glDisable(GLenum cap)
{
  m_Real.glDisable(cap);

  if(m_State == WRITING_CAPFRAME)
  {
    // Skip some compatibility caps purely for the sake of avoiding debug message spam.
    // We don't explicitly support compatibility, but where it's trivial we try and support it.
    // If these are enabled anywhere in the program/capture then the replay will probably be
    // wrong, but some legacy codebases running compatibility might still disable these.
    // So we don't skip these on glEnable (they will be serialised, and fire an error as
    // appropriate).
    if(cap == 0x0B50)
      return;    // GL_LIGHTING
    if(cap == 0x0BC0)
      return;    // GL_ALPHA_TEST

    SCOPED_SERIALISE_CONTEXT(DISABLE);
    Serialise_glDisable(cap);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glEnable(GLenum cap)
{
  SERIALISE_ELEMENT(GLenum, c, cap);

  if(m_State <= EXECUTING)
  {
    m_Real.glEnable(c);
  }

  return true;
}

void WrappedOpenGL::glEnable(GLenum cap)
{
  m_Real.glEnable(cap);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(ENABLE);
    Serialise_glEnable(cap);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glDisablei(GLenum cap, GLuint index)
{
  SERIALISE_ELEMENT(GLenum, c, cap);
  SERIALISE_ELEMENT(uint32_t, i, index);

  if(m_State <= EXECUTING)
  {
    m_Real.glDisablei(c, i);
  }

  return true;
}

void WrappedOpenGL::glDisablei(GLenum cap, GLuint index)
{
  m_Real.glDisablei(cap, index);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(DISABLEI);
    Serialise_glDisablei(cap, index);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glEnablei(GLenum cap, GLuint index)
{
  SERIALISE_ELEMENT(GLenum, c, cap);
  SERIALISE_ELEMENT(uint32_t, i, index);

  if(m_State <= EXECUTING)
  {
    m_Real.glEnablei(c, i);
  }

  return true;
}

void WrappedOpenGL::glEnablei(GLenum cap, GLuint index)
{
  m_Real.glEnablei(cap, index);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(ENABLEI);
    Serialise_glEnablei(cap, index);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glFrontFace(GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glFrontFace(m);
  }

  return true;
}

void WrappedOpenGL::glFrontFace(GLenum mode)
{
  m_Real.glFrontFace(mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(FRONT_FACE);
    Serialise_glFrontFace(mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glCullFace(GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glCullFace(m);
  }

  return true;
}

void WrappedOpenGL::glCullFace(GLenum mode)
{
  m_Real.glCullFace(mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(CULL_FACE);
    Serialise_glCullFace(mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glHint(GLenum target, GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, t, target);
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glHint(t, m);
  }

  return true;
}

void WrappedOpenGL::glHint(GLenum target, GLenum mode)
{
  m_Real.glHint(target, mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(HINT);
    Serialise_glHint(target, mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glColorMask(GLboolean red, GLboolean green, GLboolean blue,
                                          GLboolean alpha)
{
  SERIALISE_ELEMENT(uint8_t, r, red);
  SERIALISE_ELEMENT(uint8_t, g, green);
  SERIALISE_ELEMENT(uint8_t, b, blue);
  SERIALISE_ELEMENT(uint8_t, a, alpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glColorMask(r, g, b, a);
  }

  return true;
}

void WrappedOpenGL::glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
{
  m_Real.glColorMask(red, green, blue, alpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(COLOR_MASK);
    Serialise_glColorMask(red, green, blue, alpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glColorMaski(GLuint buf, GLboolean red, GLboolean green,
                                           GLboolean blue, GLboolean alpha)
{
  SERIALISE_ELEMENT(uint32_t, buffer, buf);
  SERIALISE_ELEMENT(uint8_t, r, red);
  SERIALISE_ELEMENT(uint8_t, g, green);
  SERIALISE_ELEMENT(uint8_t, b, blue);
  SERIALISE_ELEMENT(uint8_t, a, alpha);

  if(m_State <= EXECUTING)
  {
    m_Real.glColorMaski(buffer, r, g, b, a);
  }

  return true;
}

void WrappedOpenGL::glColorMaski(GLuint buf, GLboolean red, GLboolean green, GLboolean blue,
                                 GLboolean alpha)
{
  m_Real.glColorMaski(buf, red, green, blue, alpha);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(COLOR_MASKI);
    Serialise_glColorMaski(buf, red, green, blue, alpha);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glSampleMaski(GLuint maskNumber, GLbitfield mask)
{
  SERIALISE_ELEMENT(uint32_t, num, maskNumber);
  SERIALISE_ELEMENT(uint32_t, Mask, mask);

  if(m_State <= EXECUTING)
  {
    m_Real.glSampleMaski(num, Mask);
  }

  return true;
}

void WrappedOpenGL::glSampleMaski(GLuint maskNumber, GLbitfield mask)
{
  m_Real.glSampleMaski(maskNumber, mask);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(SAMPLE_MASK);
    Serialise_glSampleMaski(maskNumber, mask);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glSampleCoverage(GLfloat value, GLboolean invert)
{
  SERIALISE_ELEMENT(float, Value, value);
  SERIALISE_ELEMENT(bool, Invert, invert != 0);

  if(m_State <= EXECUTING)
  {
    m_Real.glSampleCoverage(Value, Invert ? GL_TRUE : GL_FALSE);
  }

  return true;
}

void WrappedOpenGL::glSampleCoverage(GLfloat value, GLboolean invert)
{
  m_Real.glSampleCoverage(value, invert);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(SAMPLE_COVERAGE);
    Serialise_glSampleCoverage(value, invert);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glMinSampleShading(GLfloat value)
{
  SERIALISE_ELEMENT(float, Value, value);

  if(m_State <= EXECUTING)
  {
    m_Real.glMinSampleShading(Value);
  }

  return true;
}

void WrappedOpenGL::glMinSampleShading(GLfloat value)
{
  m_Real.glMinSampleShading(value);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(MIN_SAMPLE_SHADING);
    Serialise_glMinSampleShading(value);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glRasterSamplesEXT(GLuint samples, GLboolean fixedsamplelocations)
{
  SERIALISE_ELEMENT(uint32_t, s, samples);
  SERIALISE_ELEMENT(bool, f, fixedsamplelocations != 0);

  if(m_State <= EXECUTING)
  {
    m_Real.glRasterSamplesEXT(s, f);
  }

  return true;
}

void WrappedOpenGL::glRasterSamplesEXT(GLuint samples, GLboolean fixedsamplelocations)
{
  m_Real.glRasterSamplesEXT(samples, fixedsamplelocations);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(RASTER_SAMPLES);
    Serialise_glRasterSamplesEXT(samples, fixedsamplelocations);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPatchParameteri(GLenum pname, GLint value)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);
  SERIALISE_ELEMENT(int32_t, Value, value);

  if(m_State <= EXECUTING)
  {
    m_Real.glPatchParameteri(PName, Value);
  }

  return true;
}

void WrappedOpenGL::glPatchParameteri(GLenum pname, GLint value)
{
  m_Real.glPatchParameteri(pname, value);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(PATCH_PARAMI);
    Serialise_glPatchParameteri(pname, value);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPatchParameterfv(GLenum pname, const GLfloat *values)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);
  const size_t nParams = (PName == eGL_PATCH_DEFAULT_OUTER_LEVEL ? 4U : 2U);
  SERIALISE_ELEMENT_ARR(float, Values, values, nParams);

  if(m_State <= EXECUTING)
  {
    m_Real.glPatchParameterfv(PName, Values);
  }

  delete[] Values;

  return true;
}

void WrappedOpenGL::glPatchParameterfv(GLenum pname, const GLfloat *values)
{
  m_Real.glPatchParameterfv(pname, values);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(PATCH_PARAMFV);
    Serialise_glPatchParameterfv(pname, values);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glLineWidth(GLfloat width)
{
  SERIALISE_ELEMENT(GLfloat, w, width);

  if(m_State <= EXECUTING)
  {
    m_Real.glLineWidth(w);
  }

  return true;
}

void WrappedOpenGL::glLineWidth(GLfloat width)
{
  m_Real.glLineWidth(width);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(LINE_WIDTH);
    Serialise_glLineWidth(width);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPointSize(GLfloat size)
{
  SERIALISE_ELEMENT(GLfloat, s, size);

  if(m_State <= EXECUTING)
  {
    m_Real.glPointSize(s);
  }

  return true;
}

void WrappedOpenGL::glPointSize(GLfloat size)
{
  m_Real.glPointSize(size);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POINT_SIZE);
    Serialise_glPointSize(size);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPointParameteri(GLenum pname, GLint param)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);

  int32_t ParamValue = 0;

  RDCCOMPILE_ASSERT(sizeof(int32_t) == sizeof(GLenum),
                    "int32_t isn't the same size as GLenum - aliased serialising will break");
  // special case a few parameters to serialise their value as an enum, not an int
  if(PName == GL_POINT_SPRITE_COORD_ORIGIN)
  {
    SERIALISE_ELEMENT(GLenum, Param, (GLenum)param);

    ParamValue = (int32_t)Param;
  }
  else
  {
    SERIALISE_ELEMENT(int32_t, Param, param);

    ParamValue = Param;
  }

  if(m_State <= EXECUTING)
  {
    m_Real.glPointParameteri(PName, ParamValue);
  }

  return true;
}

void WrappedOpenGL::glPointParameteri(GLenum pname, GLint param)
{
  m_Real.glPointParameteri(pname, param);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POINT_PARAMI);
    Serialise_glPointParameteri(pname, param);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPointParameteriv(GLenum pname, const GLint *params)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);
  SERIALISE_ELEMENT(int32_t, Param, *params);

  if(m_State <= EXECUTING)
  {
    m_Real.glPointParameteriv(PName, &Param);
  }

  return true;
}

void WrappedOpenGL::glPointParameteriv(GLenum pname, const GLint *params)
{
  m_Real.glPointParameteriv(pname, params);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POINT_PARAMIV);
    Serialise_glPointParameteriv(pname, params);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPointParameterf(GLenum pname, GLfloat param)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);
  SERIALISE_ELEMENT(float, Param, param);

  if(m_State <= EXECUTING)
  {
    m_Real.glPointParameterf(PName, Param);
  }

  return true;
}

void WrappedOpenGL::glPointParameterf(GLenum pname, GLfloat param)
{
  m_Real.glPointParameterf(pname, param);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POINT_PARAMF);
    Serialise_glPointParameterf(pname, param);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPointParameterfv(GLenum pname, const GLfloat *params)
{
  SERIALISE_ELEMENT(GLenum, PName, pname);
  SERIALISE_ELEMENT(float, Param, *params);

  if(m_State <= EXECUTING)
  {
    m_Real.glPointParameterfv(PName, &Param);
  }

  return true;
}

void WrappedOpenGL::glPointParameterfv(GLenum pname, const GLfloat *params)
{
  m_Real.glPointParameterfv(pname, params);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POINT_PARAMFV);
    Serialise_glPointParameterfv(pname, params);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
  SERIALISE_ELEMENT(int32_t, X, x);
  SERIALISE_ELEMENT(int32_t, Y, y);
  SERIALISE_ELEMENT(uint32_t, W, width);
  SERIALISE_ELEMENT(uint32_t, H, height);

  if(m_State <= EXECUTING)
  {
    m_Real.glViewport(X, Y, W, H);
  }

  return true;
}

void WrappedOpenGL::glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
  m_Real.glViewport(x, y, width, height);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(VIEWPORT);
    Serialise_glViewport(x, y, width, height);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glViewportArrayv(GLuint index, GLuint count, const GLfloat *v)
{
  SERIALISE_ELEMENT(uint32_t, idx, index);
  SERIALISE_ELEMENT(uint32_t, cnt, count);
  SERIALISE_ELEMENT_ARR(GLfloat, views, v, cnt * 4);

  if(m_State <= EXECUTING)
  {
    m_Real.glViewportArrayv(idx, cnt, views);
  }

  delete[] views;

  return true;
}

void WrappedOpenGL::glViewportArrayv(GLuint index, GLuint count, const GLfloat *v)
{
  m_Real.glViewportArrayv(index, count, v);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(VIEWPORT_ARRAY);
    Serialise_glViewportArrayv(index, count, v);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

void WrappedOpenGL::glViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
{
  const float v[4] = {x, y, w, h};
  glViewportArrayv(index, 1, v);
}

void WrappedOpenGL::glViewportIndexedfv(GLuint index, const GLfloat *v)
{
  glViewportArrayv(index, 1, v);
}

bool WrappedOpenGL::Serialise_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
  SERIALISE_ELEMENT(int32_t, X, x);
  SERIALISE_ELEMENT(int32_t, Y, y);
  SERIALISE_ELEMENT(uint32_t, W, width);
  SERIALISE_ELEMENT(uint32_t, H, height);

  if(m_State <= EXECUTING)
  {
    m_Real.glScissor(X, Y, W, H);
  }

  return true;
}

void WrappedOpenGL::glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
  m_Real.glScissor(x, y, width, height);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(SCISSOR);
    Serialise_glScissor(x, y, width, height);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glScissorArrayv(GLuint index, GLsizei count, const GLint *v)
{
  SERIALISE_ELEMENT(uint32_t, idx, index);
  SERIALISE_ELEMENT(uint32_t, cnt, count);
  SERIALISE_ELEMENT_ARR(GLint, scissors, v, cnt * 4);

  if(m_State <= EXECUTING)
  {
    m_Real.glScissorArrayv(idx, cnt, scissors);
  }

  delete[] scissors;

  return true;
}

void WrappedOpenGL::glScissorArrayv(GLuint first, GLsizei count, const GLint *v)
{
  m_Real.glScissorArrayv(first, count, v);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(SCISSOR_ARRAY);
    Serialise_glScissorArrayv(first, count, v);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

void WrappedOpenGL::glScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width,
                                     GLsizei height)
{
  const GLint v[4] = {left, bottom, width, height};
  glScissorArrayv(index, 1, v);
}

void WrappedOpenGL::glScissorIndexedv(GLuint index, const GLint *v)
{
  glScissorArrayv(index, 1, v);
}

bool WrappedOpenGL::Serialise_glPolygonMode(GLenum face, GLenum mode)
{
  SERIALISE_ELEMENT(GLenum, f, face);
  SERIALISE_ELEMENT(GLenum, m, mode);

  if(m_State <= EXECUTING)
  {
    m_Real.glPolygonMode(f, m);
  }

  return true;
}

void WrappedOpenGL::glPolygonMode(GLenum face, GLenum mode)
{
  m_Real.glPolygonMode(face, mode);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POLYGON_MODE);
    Serialise_glPolygonMode(face, mode);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPolygonOffset(GLfloat factor, GLfloat units)
{
  SERIALISE_ELEMENT(float, f, factor);
  SERIALISE_ELEMENT(float, u, units);

  if(m_State <= EXECUTING)
  {
    m_Real.glPolygonOffset(f, u);
  }

  return true;
}

void WrappedOpenGL::glPolygonOffset(GLfloat factor, GLfloat units)
{
  m_Real.glPolygonOffset(factor, units);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POLYGON_OFFSET);
    Serialise_glPolygonOffset(factor, units);

    m_ContextRecord->AddChunk(scope.Get());
  }
}

bool WrappedOpenGL::Serialise_glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp)
{
  SERIALISE_ELEMENT(float, f, factor);
  SERIALISE_ELEMENT(float, u, units);
  SERIALISE_ELEMENT(float, c, clamp);

  if(m_State <= EXECUTING)
  {
    m_Real.glPolygonOffsetClampEXT(f, u, c);
  }

  return true;
}

void WrappedOpenGL::glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp)
{
  m_Real.glPolygonOffsetClampEXT(factor, units, clamp);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(POLYGON_OFFSET_CLAMP);
    Serialise_glPolygonOffsetClampEXT(factor, units, clamp);

    m_ContextRecord->AddChunk(scope.Get());
  }
}


text:
package es.tododev.auth.server.dto;

import java.util.Map;
import java.util.Set;

public class RolesDTO {

	public final static String OK = "OK";
	public final static String KO = "KO";
	public final static String ERR = "ERROR";
	private String status;
	private Set<String> roles;
	private Map<String,String> properties;
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Set<String> getRoles() {
		return roles;
	}
	public void setRoles(Set<String> roles) {
		this.roles = roles;
	}
	public Map<String, String> getProperties() {
		return properties;
	}
	public void setProperties(Map<String, String> properties) {
		this.properties = properties;
	}

}

redpajama_set_name: RedPajamaGithub


text:
@interface ABI44_0_0EXAccelerometer : ABI44_0_0EXBaseSensorModule

@end


text:
package com.swtworkbench.community.xswt.scripting;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

import org.omg.CORBA.portable.InvokeHandler;

import com.swtworkbench.community.xswt.XSWTException;
import com.swtworkbench.community.xswt.dataparser.IDataParserContext;
import com.swtworkbench.community.xswt.dataparser.NonDisposableDataParser;

public class InterfaceDataParser extends NonDisposableDataParser {

	private static class FunctionProxy implements InvocationHandler {

		protected Function fun;

		public FunctionProxy(Function fun) {
			this.fun = fun;
		}

		protected Object invoke(Method method, Object[] args) throws Throwable {
			if (fun.arity() != args.length) {
				throw new IllegalArgumentException(fun.getName() + " requires " + fun.arity() + " arguments but received " + args.length);
			}
			for (int i = 0; i < args.length; i++) {
				if (args[i] != null && (! fun.argumentType(i).isInstance(args[i]))) {
					throw new IllegalArgumentException(fun.getName() + "'s " + i + ". argument must be of " + fun.argumentType(i) + " but was " + args[i] + " of " + args[i].getClass());
				}
			}
			return fun.invoke(args);
		}
		public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
			return invoke(method, args);
		}
	}

	private static class BindingsProxy extends FunctionProxy {

		private Bindings bindings;

		public BindingsProxy(Bindings bindings) {
			super(null);
			this.bindings = bindings;
		}

		public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
			Object o = bindings.get(method.getName());
			if (o == null) {
				return null;
			}
			if (! (o instanceof Function)) {
				throw new IllegalArgumentException(o + " is not a Function");
			}
			fun = (Function)o;
			return invoke(method, args);
		}
	}

	private ClassLoader cl;

	public void setClassLoader(ClassLoader cl) {
		this.cl = cl;
	}

	public Object parse(String source, Class klass, IDataParserContext context) throws XSWTException {
		InvocationHandler handler = null;
		Bindings bindings = null;
		try {
			bindings = (Bindings)context.parse(source, Bindings.class);
		} catch (XSWTException e) {
		}
		if (bindings != null) {
			handler = new BindingsProxy(bindings);
		} else {
			Function fun = null;
			try {
				fun = (Function)context.parse(source, Function.class);
			} catch (XSWTException e) {
			}
			if (fun != null) {
				handler = new FunctionProxy(fun);
			}
		}
		if (handler == null) {
			return null;
		}
		ClassLoader cl = this.cl != null ? this.cl : getClass().getClassLoader();
		return Proxy.newProxyInstance(cl, new Class[]{klass}, handler);
	}
}


text:
import json
import datetime
from bulbs.cms_notifications.models import CmsNotification

from django.core.urlresolvers import reverse
from django.test import Client
from bulbs.utils.test import JsonEncoder, BaseIndexableTestCase
from django.contrib.auth import get_user_model

class TestAPI(BaseIndexableTestCase):

    def setUp(self):
        super(TestAPI, self).setUp()
        User = get_user_model()

        # create a superuser and regular user
        self.superuser_pass = "password"
        self.regular_user_pass = "abc123"
        self.superuser = User.objects.create_superuser("superuser", "superuser@theonion.com", self.superuser_pass)
        self.regular_user = User.objects.create_user("regularuser", "regularguy@aol.com", self.regular_user_pass)

        self.client = Client()

    def test_listing(self):
        """Test creating and retrieving a list of CMS notifications from the DB via the API."""

        self.client.login(username=self.superuser.username, password=self.superuser_pass)

        time_now = datetime.datetime.now()

        data_cms_notification = {
            "title": "We've Made an Update!",
            "body": "Some updates were made on the site. Enjoy them while they last.",
            "post_date": time_now.isoformat(),
            "notify_end_date": (time_now + datetime.timedelta(days=3)).isoformat()
        }

        # post new listing
        self.client.post(
            reverse("cms_notifications"),
            json.dumps(data_cms_notification, cls=JsonEncoder),
            content_type="application/json"
        )

        # get new listing
        response = self.client.get(reverse("cms_notifications"))
        self.assertEqual(response.status_code, 200)

        resp_cms_notification = json.loads(response.content.decode("utf8"))

        self.assertEqual(len(resp_cms_notification), 1)
        self.assertTrue("id" in resp_cms_notification[0])
        self.assertEqual(data_cms_notification["title"], resp_cms_notification[0]["title"])

        # attempt an update of listing
        up_cms_notification = resp_cms_notification[0]
        up_cms_notification["title"] = "Updated title"
        self.client.put(
            reverse("cms_notifications", kwargs={"pk": up_cms_notification["id"]}),
            json.dumps(up_cms_notification, cls=JsonEncoder),
            content_type="application/json"
        )

        response = self.client.get(reverse("cms_notifications"))
        self.assertEqual(response.status_code, 200)

        up_resp_cms_notification = json.loads(response.content.decode("utf8"))

        self.assertEqual(len(up_resp_cms_notification), 1)
        self.assertEqual(up_cms_notification["title"], up_resp_cms_notification[0]["title"])

    def test_delete(self):
        """Test DELETEing a record."""

        self.client.login(username=self.superuser.username, password=self.superuser_pass)

        time_now = datetime.datetime.now()

        data_cms_notification = {
            "title": "We've Made an Update!",
            "body": "Some updates were made on the site. Enjoy them while they last.",
            "post_date": time_now.isoformat(),
            "notify_end_date": (time_now + datetime.timedelta(days=3)).isoformat()
        }

        # post new listing
        self.client.post(
            reverse("cms_notifications"),
            json.dumps(data_cms_notification, cls=JsonEncoder),
            content_type="application/json"
        )

        self.assertEqual(CmsNotification.objects.count(), 1)

        # delete listing
        delete_response = self.client.delete(reverse("cms_notifications",
                                                     kwargs={"pk": CmsNotification.objects.all()[0].id}))

        self.assertEqual(delete_response.status_code, 204)
        self.assertEqual(CmsNotification.objects.count(), 0)

    def test_validation(self):
        """Test serializer validation."""

        self.client.login(username=self.superuser.username, password=self.superuser_pass)

        time_now = datetime.datetime.now()

        data_cms_notification = {
            "title": "Dates Are All Wrong",
            "post_date": (time_now + datetime.timedelta(days=3)).isoformat(),
            "notify_end_date": time_now.isoformat()
        }

        # post new listing
        response = self.client.post(
            reverse("cms_notifications"),
            json.dumps(data_cms_notification, cls=JsonEncoder),
            content_type="application/json"
        )

        errors = json.loads(response.content.decode("utf8"))

        self.assertEquals(errors["non_field_errors"][0], "Post date must occur before promotion end date.")

        response = self.client.get(reverse("cms_notifications"))

        self.assertEqual(len(json.loads(response.content.decode("utf8"))), 0)

    def test_permissions(self):
        """Test that only super users can PUT/POST."""

        # test a regular user first
        self.client.login(username=self.regular_user.username, password=self.regular_user_pass)

        post_response = self.client.post(reverse("cms_notifications"))
        put_response = self.client.put(reverse("cms_notifications"))
        get_response = self.client.get(reverse("cms_notifications"))
        delete_response = self.client.delete(reverse("cms_notifications"))

        self.assertEqual(post_response.status_code, 403)
        self.assertEqual(put_response.status_code, 403)
        self.assertEqual(get_response.status_code, 200)
        self.assertEqual(delete_response.status_code, 403)

        # now test a superuser
        self.client.login(username=self.superuser.username, password=self.superuser_pass)

        time_now = datetime.datetime.now()

        json_data = json.dumps({
            "title": "Dates Are All Wrong",
            "post_date": time_now.isoformat(),
            "notify_end_date": (time_now + datetime.timedelta(days=3)).isoformat()
        }, cls=JsonEncoder)

        post_response = self.client.post(reverse("cms_notifications"),
                                         json_data,
                                         content_type="application/json")
        notification_id = post_response.data["id"]
        put_response = self.client.put(reverse("cms_notifications", kwargs={"pk": notification_id}),
                                       json_data,
                                       content_type="application/json")
        get_response = self.client.get(reverse("cms_notifications"))
        delete_response = self.client.delete(reverse("cms_notifications", kwargs={"pk": notification_id}))

        self.assertEqual(post_response.status_code, 201)
        self.assertEqual(put_response.status_code, 200)
        self.assertEqual(get_response.status_code, 200)
        self.assertEqual(delete_response.status_code, 204)


text:
@interface rightSegue : UIStoryboardSegue

@end


text:
package dwarf.gfx;

import dwarf.util.Point2D;

import static dwarf.util.math.PI;
import static dwarf.util.math.sqr;
import static dwarf.util.math.TWO_PI;

/**
 * A 60 sided shape with all methods overridden to return values for a circle.
 * (A simple Circle geometry)
 *
 *

 * A circle is a plane figure formed by a curved line called the circumference
 * and is such that all right lines drawn from a certain point with in the
 * figure to the circumference are equal to one another. This point is called
 * the center. A radius of a circle is any right line drawn from the center to
 * the circumference. A diameter of a circle is aright line drawn through the
 * center and terminated both ways by the circumference. From the definition of
 * a circle it follows at once that the path of a movable point in a plane which
 * remains at a constant distance from a fixed point is a circle; also that any
 * point Pin the plane is inside, outside, or on the circumference of a circle
 * according as its distance from the center is less than greater than or equal
 * to, the radius.
 *

 *
 * @author Matthew 'siD' Van der Bijl
 *
 * @see wikipedia
 * @see dwarf.gfx.Shape
 * @see dwarf.gfx.Polygon
 */
public class Circle extends Shape {

    /**
     * The radius of the circle.
     */
    private double radius;

    /**
     * Default constructor.
     */
    public Circle() {
        super();
    }

    public Circle(double radius, Point2D location, int mode, Colour colour) {
        super(SHAPE_CIRCLE, ((TWO_PI * radius) / 60), location, mode, colour);
        this.radius = radius;
    }

    public Circle(Circle circle) {
        super(SHAPE_CIRCLE, circle.getRadius(), circle.getPosition(), circle.getMode(), circle.getColour());
        this.radius = circle.getRadius();
    }

    public double getCircumference() {
        return TWO_PI * radius;
    }

    @Override
    public double getArea() {
        return PI * sqr(radius);
    }

    public double getDiameter() {
        return 2 * radius;
    }

    /**
     * Length of a Circular Arc: (with central angle theta) if the angle theta
     * is in degrees, then length = theta x (PI/180) x r if the angle theta is
     * in radians, then length = r x theta
     *
     * @see www.math.com
     *
     * @param theta (degrees)
     * @return theta * (PI / 180) * radius
     */
    public double getCircularArcLength(double theta) {
        return theta * (PI / 180) * radius;
    }

    /**
     * Area of Circle Sector: (with central angle theta) if the angle theta is
     * in degrees, then area = (theta/360)x PI r2 if the angle theta is in
     * radians, then area = ((theta/(2PI))x PI r2
     *
     * @see www.math.com
     *
     * @param theta (degrees)
     * @return (theta / 360) * this.getArea()
     */
    public double getCircleSector(double theta) {
        return (theta / 360) * this.getArea();
    }

    @Override
    public double getRadius() {
        return this.radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;

        super.setNumSides(SHAPE_CIRCLE);
        super.setLineLength(((TWO_PI * radius) / 60));

        super.init();
    }

    public double getHalfWidth() {
        return radius;
    }

    public double getHalfHeight() {
        return radius;
    }

    @Override
    public Circle get() {
        return this;
    }

    @Override
    public void scale(double delta) {
        this.setRadius(getRadius() * delta);
    }

    @Override
    public Point2D getCenterX() {
        return new Point2D(
                this.getPosition().getX() + this.getRadius(),
                this.getPosition().getY()
        );
    }

    @Override
    public Point2D getCenterY() {
        return new Point2D(
                this.getPosition().getX(),
                this.getPosition().getY() + this.getRadius()
        );
    }

    @Override
    public Point2D getCenter() {
        return new Point2D(
                this.getCenterX().getX(),
                this.getCenterY().getY()
        );
    }

    @Override
    public Circle clone() throws CloneNotSupportedException {
        return new Circle(this);
    }

    @Override
    @Deprecated
    public double getPerimeter() {
        return super.getPerimeter();
    }

    @Override
    @Deprecated
    public void changeNumSides(int input) {
        super.changeNumSides(input);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.radius) ^ (Double.doubleToLongBits(this.radius) >>> 32));
        return hash;
    }

    /**
     * Returns true if the this is equal to the argument and false
     * otherwise. Consequently, if both argument are null, true is returned,
     * false is returned. Otherwise, equality is determined by using the equals
     * method of the first argument.
     *
     * @param obj the Object to be tested
     * @see java.lang.Object#equals(java.lang.Object)
     *
     * @return true if the argument is equal to this other and
     * false otherwise
     */
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } else if (super.getClass() != obj.getClass()) {
            return false;
        }

        final Circle other = (Circle) obj;

        if (Double.doubleToLongBits(this.radius) != Double.doubleToLongBits(other.radius)) {
            return false;
        }

        return true;
    }

    /**
     * Returns a string representation of the object.
     *

     * In general, the toString method returns a string that "textually
     * represents" this object. The result should be a concise but informative
     * representation that is easy for a person to read. It is recommended that
     * all subclasses override this method.

     *
     * @return a textually representation of this object
     */
    @Override
    public String toString() {
        return "Circle[" + "radius: " + radius + ", position: " + super.getPosition() + "]";
    }
}


text:
The noLeft prop of Header removes `<Left>` from Android Header.

![Preview ios header-no-left-headref](https://raw.githubusercontent.com/GeekyAnts/NativeBase-KitchenSink/v2.6.1/screenshots/ios/header-with-title.png)
![Preview android header-no-left-headref](https://raw.githubusercontent.com/GeekyAnts/NativeBase-KitchenSink/v2.6.1/screenshots/android/header-noleft.png)

*Syntax*

{% codetabs name="React Native", type="js" -%}
import React, { Component } from "react";
import { Container, Header, Title, Content, Button, Icon, Left, Right, Body, Text } from "native-base";
export default class HeaderNoLeft extends Component {
  render() {
    return (
      <Container>

          <Left>
            <Button transparent>
              <Icon name="arrow-back" />
            </Button>
          </Left>

            <Title>Header</Title>

          <Right>
            <Button transparent>
              <Text>Cancel</Text>
            </Button>
          </Right>

        <Content padder>
          <Text>
            Header with noLeft prop, eliminates Left component for Android
          </Text>
        </Content>
      </Container>
    );
  }
}
{%- language name="Vue Native", type="vue" -%}
<template>
  <nb-container>
    <nb-header noLeft>
      <nb-left>
        <nb-button transparent>
          <nb-icon name="arrow-back" />
        </nb-button>
      </nb-left>
      <nb-body>
        <nb-title>Header</nb-title>
      </nb-body>
      <nb-right>
        <nb-button transparent>
          <nb-text>Cancel</nb-text>
        </nb-button>
      </nb-right>
    </nb-header>
    <nb-content padder>
      <nb-text>Header with noLeft prop, eliminates Left component for Android</nb-text>
    </nb-content>
  </nb-container>
</template>
{%- endcodetabs %}


text:
description: This template allows you to create an Azure Databricks workspace and configure CMK.
page_type: sample
products:
- azure
- azure-resource-manager
urlFragment: databricks-workspace-with-customer-managed-keys
languages:
- json
---
# Deploy an Azure Databricks Workspace and configure CMK

![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/PublicLastTestDate.svg)
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/PublicDeployment.svg)

![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/FairfaxLastTestDate.svg)
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/FairfaxDeployment.svg)

![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/BestPracticeResult.svg)
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.databricks/databricks-workspace-with-customer-managed-keys/CredScanResult.svg)

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.databricks%2Fdatabricks-workspace-with-customer-managed-keys%2Fazuredeploy.json)

[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.databricks%2Fdatabricks-workspace-with-customer-managed-keys%2Fazuredeploy.json)

This template allows you to create a Azure Databricks workspace with customer managed key (CMK). For more information, see the [Azure Databricks CMK Documentation](https://aka.ms/adbbyokdocs).

`Tags: Microsoft.Databricks/workspaces, Microsoft.Resources/deployments, Microsoft.KeyVault/vaults/accessPolicies`


text:
(function($) {
    // "use strict";
    var baseConfig = {
       chart: {
           backgroundColor: null
       },
       title: {
          text: null
       },
       plotArea: {
          shadow: null,
          borderWidth: null
       },
       tooltip: {
          enabled: false
       },
       plotOptions: {
          pie: {
             allowPointSelect: false,
             dataLabels: {
                enabled: false,
                color: '#333'
             },
             animation: false,
             size:190
          }
       },
       credits: {enabled:false},
       legend: {
          enabled:false
       },
       series: [{
            type: 'pie'
       }]
    };

    $.fn.topChart = function(cfg) {
        $(this).each(function() {
            var $self   = $(this),
                $win    = $(window),
                $chart  = $self.find('.piechart'),
                hChart,
                $table  = $self.find('table'),
                metric  = $table.attr('data-metric'),
                view    = {
                    'metric': metric,
                    'group' : 'all'
                };

            // reload the data when the view's range is modified.
            $win.bind('changeview', function(e, newView) {
                // we only want to respond to changes in range.
                if (!newView.range) return;
                $self.addClass('loading');
                $self.removeClass('nodata');
                _.extend(view, {'range' : normalizeRange(newView.range)});
                $.when(z.StatsManager.getDataRange(view))
                 .then(function(data) {
                    generateRankedList(data, render);
                 });
            });

            // We take the data (aggregated to one row)
            function generateRankedList(data, done) {
                if (data.empty) {
                    $self.removeClass('loading');
                    $self.addClass('nodata');
                    if (hChart && hChart.destroy) hChart.destroy();
                    $table.html('');
                    return;
                }
                var totalValue = 0,
                    otherValue = 0;
                data = data[data.firstIndex].data;
                if (_.isEmpty(data)) return;
                // Sum all fields.
                _.each(data, function(val) {
                    totalValue += val;
                });
                // Convert all fields to percentages and prettify names.
                var rankedList = _.map(data, function(val, key) {
                    var field = key.split("|").slice(-1)[0];
                    return [z.StatsManager.getPrettyName(metric, field),
                            val, val/totalValue*100];
                });
                // Sort by value.
                rankedList = _.sortBy(rankedList, function(a) {
                    return -a[1];
                });
                // Calculate the 'Other' percentage
                for (var i=5; i<rankedList.length; i++) {
                    otherValue += rankedList[i][1];
                }
                // Take the top 5 values and append an 'Other' row.
                rankedList = rankedList.slice(0,5);
                rankedList.push([gettext('Other'), otherValue, otherValue/totalValue*100]);
                // Move on with our lives.
                done(rankedList);
            }

            var tableRow = template("
{0}	{1}	({2}%)
");

            function render(data) {
                var newBody = "
";
                _.each(data, function(row) {
                    var pct = Math.round(row[2]);
                        num = Highcharts.numberFormat(row[1], 0);
                    if (pct < 1) pct = "<1";
                    newBody += tableRow([row[0], num, pct]);
                });
                newBody += "
";
                $table.html(newBody);

                // set up chart.
                var newConfig = _.clone(baseConfig),
                    row;
                newConfig.chart.renderTo = $chart[0];
                newConfig.series[0].data = _.map(data, function(r) { return r.slice(0,2); });
                hChart = new Highcharts.Chart(newConfig);
                for (i = 0; i < data.length; i++) {
                   row = $table.find('tr').eq(i);
                   row.children().eq(0).append($(" "));
                }
                $self.removeClass('loading');
            }
        });
    };
})(jQuery);


text:
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Settings;
using osuTK;

namespace osu.Game.Overlays
{
    public abstract class SettingsSubPanel : SettingsPanel
    {
        protected SettingsSubPanel()
            : base(true)
        {
        }

        [BackgroundDependencyLoader]
        private void load()
        {
            AddInternal(new BackButton
            {
                Anchor = Anchor.BottomLeft,
                Origin = Anchor.BottomLeft,
                Action = Hide
            });
        }

        protected override bool DimMainContent => false; // dimming is handled by main overlay

        private class BackButton : SidebarButton
        {
            private Container content;

            [BackgroundDependencyLoader]
            private void load()
            {
                Size = new Vector2(Sidebar.DEFAULT_WIDTH);

                AddRange(new Drawable[]
                {
                    content = new Container
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Children = new Drawable[]
                        {
                            new SpriteIcon
                            {
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Size = new Vector2(15),
                                Shadow = true,
                                Icon = FontAwesome.Solid.ChevronLeft
                            },
                            new OsuSpriteText
                            {
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Y = 15,
                                Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
                                Text = @"back",
                            },
                        }
                    }
                });
            }

            protected override void UpdateState()
            {
                content.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, FADE_DURATION, Easing.OutQuint);
            }
        }
    }
}


text:
import React from 'react';
import ReactDOM from 'react-dom';
import Archive from './Archive';

ReactDOM.render(<Archive />, document.getElementById('app'));


text:
from loguru import logger
from proxypool.storages.redis import RedisClient
from proxypool.setting import PROXY_NUMBER_MAX
from proxypool.crawlers import __all__ as crawlers_cls

class Getter(object):
    """
    getter of proxypool
    """

    def __init__(self):
        """
        init db and crawlers
        """
        self.redis = RedisClient()
        self.crawlers_cls = crawlers_cls
        self.crawlers = [crawler_cls() for crawler_cls in self.crawlers_cls]

    def is_full(self):
        """
        if proxypool if full
        return: bool
        """
        return self.redis.count() >= PROXY_NUMBER_MAX

    @logger.catch
    def run(self):
        """
        run crawlers to get proxy
        :return:
        """
        if self.is_full():
            return
        for crawler in self.crawlers:
            logger.info(f'crawler {crawler} to get proxy')
            for proxy in crawler.crawl():
                self.redis.add(proxy)

if __name__ == '__main__':
    getter = Getter()
    getter.run()


text:
package com.tle.web.api.item.interfaces.beans;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tle.common.interfaces.I18NString;
import com.tle.web.api.interfaces.beans.UserBean;
import java.util.Date;
import java.util.List;

public class ItemTaskStatusBean extends ItemNodeStatusBean {
  private I18NString description;
  private Date started;
  private Date due;
  private boolean overdue;
  private int priority;
  private ItemNodeStatusBean cause;
  private UserBean assignedTo;

  private List<String> acceptedUsers;

  @JsonCreator
  public ItemTaskStatusBean(@JsonProperty("uuid") String uuid) {
    super(uuid);
  }

  public Date getStarted() {
    return started;
  }

  public void setStarted(Date started) {
    this.started = started;
  }

  public Date getDue() {
    return due;
  }

  public void setDue(Date due) {
    this.due = due;
  }

  public boolean isOverdue() {
    return overdue;
  }

  public void setOverdue(boolean overdue) {
    this.overdue = overdue;
  }

  public int getPriority() {
    return priority;
  }

  public void setPriority(int priority) {
    this.priority = priority;
  }

  public UserBean getAssignedTo() {
    return assignedTo;
  }

  public void setAssignedTo(UserBean assignedTo) {
    this.assignedTo = assignedTo;
  }

  public List<String> getAcceptedUsers() {
    return acceptedUsers;
  }

  public void setAcceptedUsers(List<String> acceptedUsers) {
    this.acceptedUsers = acceptedUsers;
  }

  public I18NString getDescription() {
    return description;
  }

  public void setDescription(I18NString description) {
    this.description = description;
  }

  public ItemNodeStatusBean getCause() {
    return cause;
  }

  public void setCause(ItemNodeStatusBean cause) {
    this.cause = cause;
  }
}


text:
module ActiveModel
  module Validations

    module HelperMethods
      def validates_date(*attr_names)
        timeliness_validation_for attr_names, :date
      end

      def validates_time(*attr_names)
        timeliness_validation_for attr_names, :time
      end

      def validates_datetime(*attr_names)
        timeliness_validation_for attr_names, :datetime
      end

      def validates_timeliness_of(*attr_names)
        timeliness_validation_for attr_names
      end

      def timeliness_validation_for(attr_names, type=nil)
        options = _merge_attributes(attr_names)
        options.update(:type => type) if type
        validates_with TimelinessValidator, options
      end
    end

  end
end


text:
<?php
  class Evaluation extends CI_Controller {
    function __construct(){
      parent::__construct();
      $this->load->model('student_model');
      $this->load->model('evaluation_model');
      $this->load->model('user_model');
      $this->load->helper('date');
      if (!$this->user_model->isLogin()) { redirect('/sign_in/', 'refresh'); }
    }

    function index() {
      $student = $this->student_model->get_student($this->session->userdata['student_id']);
      $has_turn = $student[0]->turn != NULL;

      if (($this->user_model->isLogin()) && ($has_turn)) {
        $evaluations = $this->evaluation_model->get_evaluations($this->session->userdata['student_id']);
        $data_view['evaluations'] = $evaluations;

        $data_menu_view['has_turn'] = $has_turn;

        $datos_layout["title"] = "CADP - Evaluaciones";
        $datos_layout["user_menu"] = $this->load->view('user/menu_view', $data_menu_view, true);
        $datos_layout["content"] = $this->load->view('evaluation/index_evaluation_view', $data_view, true);
        $this->load->view('layout_view', $datos_layout);

      } else { redirect('/error_404', 'refresh'); }
   }
}
?>


text:
"""
.. dialect:: mssql+pymssql
    :name: pymssql
    :dbapi: pymssql
    :connectstring: mssql+pymssql://<username>:<password>@<freetds_name>/?charset=utf8

pymssql is a Python module that provides a Python DBAPI interface around
`FreeTDS <https://www.freetds.org/>`_.

.. note::

    pymssql is currently not included in SQLAlchemy's continuous integration
    (CI) testing.

Modern versions of this driver worked very well with SQL Server and FreeTDS
from Linux and were highly recommended. However, pymssql is currently
unmaintained and has fallen behind the progress of the Microsoft ODBC driver in
its support for newer features of SQL Server. The latest official release of
pymssql at the time of this document is version 2.1.4 (August, 2018) and it
lacks support for:

1. table-valued parameters (TVPs),
2. ``datetimeoffset`` columns using timezone-aware ``datetime`` objects
   (values are sent and retrieved as strings), and
3. encrypted connections (e.g., to Azure SQL), when pymssql is installed from
   the pre-built wheels. Support for encrypted connections requires building
   pymssql from source, which can be a nuisance, especially under Windows.

The above features are all supported by mssql+pyodbc when using Microsoft's
ODBC Driver for SQL Server (msodbcsql), which is now available for Windows,
(several flavors of) Linux, and macOS.

"""  # noqa
import re

from .base import MSDialect
from .base import MSIdentifierPreparer
from ... import processors
from ... import types as sqltypes
from ... import util

class _MSNumeric_pymssql(sqltypes.Numeric):
    def result_processor(self, dialect, type_):
        if not self.asdecimal:
            return processors.to_float
        else:
            return sqltypes.Numeric.result_processor(self, dialect, type_)

class MSIdentifierPreparer_pymssql(MSIdentifierPreparer):
    def __init__(self, dialect):
        super(MSIdentifierPreparer_pymssql, self).__init__(dialect)
        # pymssql has the very unusual behavior that it uses pyformat
        # yet does not require that percent signs be doubled
        self._double_percents = False

class MSDialect_pymssql(MSDialect):
    supports_statement_cache = True
    supports_native_decimal = True
    driver = "pymssql"

    preparer = MSIdentifierPreparer_pymssql

    colspecs = util.update_copy(
        MSDialect.colspecs,
        {sqltypes.Numeric: _MSNumeric_pymssql, sqltypes.Float: sqltypes.Float},
    )

    @classmethod
    def dbapi(cls):
        module = __import__("pymssql")
        # pymmsql < 2.1.1 doesn't have a Binary method.  we use string
        client_ver = tuple(int(x) for x in module.__version__.split("."))
        if client_ver < (2, 1, 1):
            # TODO: monkeypatching here is less than ideal
            module.Binary = lambda x: x if hasattr(x, "decode") else str(x)

        if client_ver < (1,):
            util.warn(
                "The pymssql dialect expects at least "
                "the 1.0 series of the pymssql DBAPI."
            )
        return module

    def _get_server_version_info(self, connection):
        vers = connection.exec_driver_sql("select @@version").scalar()
        m = re.match(r"Microsoft .*? - (\d+)\.(\d+)\.(\d+)\.(\d+)", vers)
        if m:
            return tuple(int(x) for x in m.group(1, 2, 3, 4))
        else:
            return None

    def create_connect_args(self, url):
        opts = url.translate_connect_args(username="user")
        opts.update(url.query)
        port = opts.pop("port", None)
        if port and "host" in opts:
            opts["host"] = "%s:%s" % (opts["host"], port)
        return [[], opts]

    def is_disconnect(self, e, connection, cursor):
        for msg in (
            "Adaptive Server connection timed out",
            "Net-Lib error during Connection reset by peer",
            "message 20003",  # connection timeout
            "Error 10054",
            "Not connected to any MS SQL server",
            "Connection is closed",
            "message 20006",  # Write to the server failed
            "message 20017",  # Unexpected EOF from the server
            "message 20047",  # DBPROCESS is dead or not enabled
        ):
            if msg in str(e):
                return True
        else:
            return False

    def set_isolation_level(self, connection, level):
        if level == "AUTOCOMMIT":
            connection.autocommit(True)
        else:
            connection.autocommit(False)
            super(MSDialect_pymssql, self).set_isolation_level(
                connection, level
            )

dialect = MSDialect_pymssql


text:
@interface GQMantleAdapter ()

@property (nonatomic, strong) MTLModel *mantleObject;

@property (nonatomic, copy) NSArray *mantleObjectList;

@property (nonatomic, strong) NSError *error;

@end

@implementation GQMantleAdapter

- (instancetype)initWithJSONObject:(id)jsonObject modelClass:(Class)modelClass
{
    self = [super init];

    if (self) {
        NSError *error;

        if ([jsonObject isKindOfClass:[NSDictionary class]]) {

            self.mantleObject = [MTLJSONAdapter modelOfClass:modelClass
                                      fromJSONDictionary:jsonObject
                                                   error:&error];

        } else if ([jsonObject isKindOfClass:[NSArray class]]) {

            self.mantleObjectList = [MTLJSONAdapter modelsOfClass:modelClass
                                           fromJSONArray:jsonObject
                                                   error:&error];
        }

        _error = error;

    }

    return self;
}

- (id)modelObject
{
    return self.mantleObject;
}

- (NSArray *)modelObjectList
{
    return self.mantleObjectList;
}

@end

@implementation GQDataController (GQMantleAdapter)

- (__kindof MTLModel *)mantleObject
{
    NSAssert([self.modelObject isKindOfClass:[MTLModel class]], @"Must be a MTLModel instance.");

    return self.modelObject;
}

- (NSMutableArray<__kindof MTLModel *> *)mantleObjectList
{
    return self.modelObjectList;
}

@end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace LunchUX.Models {
    public class Application {
        public Application() {
            IsInAssistancePrograms = false;
            CaseNumber = "";
            AddressLineOne = "";
            AddressLineTwo = "";
            City = "";
            State = 0;
            ZipCode = "";
            Email = "";
            Phone = "";
            DateSubmitted = DateTimeOffset.MinValue;
            IsSubmitted = false;
            Children = new List<Child>();
            Adults = new List<Adult>();
            LastFourSSN = "";
            NoSSN = false;
        }

        [JsonProperty("applicationId")]
        public Guid ApplicationId { get; set; }

        [JsonProperty("isInAssistancePrograms")]
        public bool IsInAssistancePrograms { get; set; }

        [JsonProperty("caseNumber")]
        public string CaseNumber { get; set; }

        [JsonProperty("addressLineOne")]
        public string AddressLineOne { get; set; }

        [JsonProperty("addressLineTwo")]
        public string AddressLineTwo { get; set; }

        [JsonProperty("city")]
        public string City { get; set; }

        [JsonProperty("state")]
        [Range(0, 50)]
        public State State { get; set; }

        [JsonProperty("zipCode")]
        [MaxLength(5)]
        public string ZipCode { get; set; }

        [JsonProperty("email")]
        [MaxLength(254)]
        public string Email { get; set; }

        [JsonProperty("phone")]
        [MaxLength(14)]
        public string Phone { get; set; }

        [JsonProperty("dateSubmitted")]
        public DateTimeOffset DateSubmitted { get; set; }

        [JsonProperty("isSubmitted")]
        public bool IsSubmitted { get; set; }

        [JsonProperty("children")]
        public virtual ICollection<Child> Children { get; set; }

        [JsonProperty("adults")]
        public virtual ICollection<Adult> Adults { get; set; }

        [JsonProperty("lastFourSSN")]
        [MaxLength(4)]
        public string LastFourSSN { get; set; }

        [JsonProperty("noSSN")]
        public bool NoSSN { get; set; }
    }
}


text:
module CustomFields
  class FieldDefSet < Base
    def validate_value(_name, fields_values)
      fields_values.each do |field_name, field_value|
        fd = @fds[field_name] || @fds[field_name.intern]

        if fd.nil?
          fields_values.delete(field_name)
          fields_values.delete(field_name.intern)
          errors[field_name] << t('no_known_fields') if fields_values.empty?
        else
          fd.validate_value(field_name, field_value)
          errors[field_name] += fd.errors[field_name] unless fd.valid?
        end
      end
    end

    def nil_fields_values
      options.keys.each_with_object({}) do |key, h|
        h[key] = nil
      end
    end

    def coerce(values)
      options.keys.each_with_object({}) do |key, h|
        key_s = key.to_s
        h[key_s] = if values.key?(key_s) && !values.fetch(key_s).nil?
                     @fds.fetch(key).coerce_value(values.fetch(key_s))
                   end
      end
    end

    protected

    def validate_definition
      @fds = {}
      options.each do |field_name, field_params|
        next unless should_have_key?(field_name, in: options, as: Hash)

        fd = field_def_class.new(field_params.merge(name: field_name.to_s))
        if fd.valid?
          @fds[field_name] = fd
        else
          errors[field_name] << "#{field_name}: #{fd.errors.values.join(', ')}"
        end
      end
    end

    private

    def field_def_class
      FieldDef
    end
  end
end


text:
/************************************************************************************
 * Included Files
 ************************************************************************************/

#include <nuttx/config.h>

#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <errno.h>

#include <nuttx/spi/spi.h>
#include <arch/board/board.h>

#include "up_arch.h"
#include "chip.h"
#include "sam_gpio.h"
#include "sam_spi.h"
#include "sam3u-ek.h"

#ifdef CONFIG_SAM34_SPI0

/************************************************************************************
 * Definitions
 ************************************************************************************/

/* Enables debug output from this file (needs CONFIG_DEBUG too) */

#undef SPI_DEBUG   /* Define to enable debug */
#undef SPI_VERBOSE /* Define to enable verbose debug */

#ifdef SPI_DEBUG
#  define spidbg  lldbg
#  ifdef SPI_VERBOSE
#    define spivdbg lldbg
#  else
#    define spivdbg(x...)
#  endif
#else
#  undef SPI_VERBOSE
#  define spidbg(x...)
#  define spivdbg(x...)
#endif

/************************************************************************************
 * Private Functions
 ************************************************************************************/

/************************************************************************************
 * Public Functions
 ************************************************************************************/

/************************************************************************************
 * Name: sam_spiinitialize
 *
 * Description:
 *   Called to configure SPI chip select GPIO pins for the SAM3U-EK board.
 *
 ************************************************************************************/

void weak_function sam_spiinitialize(void)
{
  /* The ZigBee module connects used NPCS0.  However, there is not yet any
   * ZigBee support.
   */

   /* The touchscreen connects using NPCS2 (PC14). */

#if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E)
   sam_configgpio(GPIO_TSC_NPCS2);
#endif
}

/****************************************************************************
 * Name:  sam_spi0select, sam_spi0status, and sam_spic0mddata
 *
 * Description:
 *   These external functions must be provided by board-specific logic.  They
 *   include:
 *
 *   o sam_spi0select is a functions tomanage the board-specific chip selects
 *   o sam_spi0status and sam_spic0mddata:  Implementations of the status
 *     and cmddata methods of the SPI interface defined by struct spi_ops_
 *     (see include/nuttx/spi/spi.h). All other methods including
 *     up_spiinitialize()) are provided by common SAM3/4 logic.
 *
 *  To use this common SPI logic on your board:
 *
 *   1. Provide logic in sam_boardinitialize() to configure SPI chip select
 *      pins.
 *   2. Provide sam_spi0select() and sam_spi0status() functions in your board-
 *      specific logic.  These functions will perform chip selection and
 *      status operations using GPIOs in the way your board is configured.
 *   2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide
 *      sam_spic0mddata() functions in your board-specific logic.  This
 *      function will perform cmd/data selection operations using GPIOs in
 *      the way your board is configured.
 *   3. Add a call to up_spiinitialize() in your low level application
 *      initialization logic
 *   4. The handle returned by up_spiinitialize() may then be used to bind the
 *      SPI driver to higher level logic (e.g., calling
 *      mmcsd_spislotinitialize(), for example, will bind the SPI driver to
 *      the SPI MMC/SD driver).
 *
 ****************************************************************************/

/****************************************************************************
 * Name: sam_spi0select
 *
 * Description:
 *   PIO chip select pins may be programmed by the board specific logic in
 *   one of two different ways.  First, the pins may be programmed as SPI
 *   peripherals.  In that case, the pins are completely controlled by the
 *   SPI driver.  This method still needs to be provided, but it may be only
 *   a stub.
 *
 *   An alternative way to program the PIO chip select pins is as a normal
 *   GPIO output.  In that case, the automatic control of the CS pins is
 *   bypassed and this function must provide control of the chip select.
 *   NOTE:  In this case, the GPIO output pin does *not* have to be the
 *   same as the NPCS pin normal associated with the chip select number.
 *
 * Input Parameters:
 *   devid - Identifies the (logical) device
 *   selected - TRUE:Select the device, FALSE:De-select the device
 *
 * Returned Values:
 *   None
 *
 ****************************************************************************/

void sam_spi0select(enum spi_dev_e devid, bool selected)
{
  /* The touchscreen chip select is implemented as a GPIO OUTPUT that must
   * be controlled by this function.  This is because the ADS7843E driver
   * must be able to sample the device BUSY GPIO input between SPI transfers.
   * However, the AD7843E will tri-state the BUSY input whenever the chip
   * select is de-asserted.  So the only option is to control the chip select
   * manually and hold it low throughout the SPI transfer.
   */

#if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E)
  if (devid == SPIDEV_TOUCHSCREEN)
    {
      sam_gpiowrite(GPIO_TSC_NPCS2, !selected);
    }
#endif
}

/****************************************************************************
 * Name: sam_spi0status
 *
 * Description:
 *   Return status information associated with the SPI device.
 *
 * Input Parameters:
 *   devid - Identifies the (logical) device
 *
 * Returned Values:
 *   Bit-encoded SPI status (see include/nuttx/spi/spi.h.
 *
 ****************************************************************************/

uint8_t sam_spi0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
{
  return 0;
}

#endif /* CONFIG_SAM34_SPI0 */


text:
<TITLE>Review for Island of Dr. Moreau, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Island of Dr. Moreau, The (1996)

reviewed by
Michael Redman

                           THE ISLAND OF DR. MOREAU
                       A film review by Michael Redman
                        Copyright 1996 Michael Redman

** (out of ****)

Remember the scene near the end of "Apocalypse Now" where the boat
finally makes it to the village? What they find is a hidden society
filled with inhabitants involved in strange rituals and run by the
bigger than life God-King Marlon Brando. This film takes that village
even further into the Twilight Zone.

Edward Douglas (David Thewlis) is rescued from a life raft after
drifting for days in the Java sea when his plane crashed on the way to
his assignment as a UN peace negotiator. He is taken to a lush island by
an increasingly crazed doctor -- or is he a vet? -- Montgomery (Val
Kilmer).  The place is run by Dr. Moreau (Marlon Brando) who is splicing
human and various animal DNA in order to create the perfect non-violent
being.

Of course things fall apart. Montgomery starts the dominos tumbling by
killing a rabbit for dinner, then dead rabbits are found around the
island. A manimal is killed because he killed and dirty dog Hyena takes
over. Trouble in paradise. Almighty Brando can't keep them under control
as they revert more and more to their animal selves.

This is the third film based on the H. G. Wells book and is visually
hypnotizing. Each scene on the island is overflowing with mood and
movement. Men, animals and everything inbetween crowd the dark and
mutable screen. Montgomery's warning to Douglas describes the entire
film, "Be careful, there are a lot of unstable phenomena out there."

Like much of "Apocalypse Now", there's far too much going on to catch it
all and that's the way it's supposed to be. The over-stimulation crowds
your senses, leaving few details, but creating a massive impression of
foggy and breathtaking eeriness.

Brando's Moreau is beyond outlandish as he is carried on a litter,
dressed in a muumuu, coated with pancake makeup and giving forth the law
while swamped and worshipped by his creations. Kilmer is just a bit less
bizarre as the drug doctor heading into insanity. His Brando Junior
impression is a masterpiece of the grotesque and fantastic.

Yeah, the extravagant make-up, sets and dark and murky feel of the film
are grand, but occasionally the story rears its ugly head and that's the
downfall of the movie. The religious overtones are extremely heavy
handed and the add-on preachy montage at the end is just horrid. Very
little happens for a reason. Characterization is minimal and often
sacrificed for sensationalism. We have no idea who any of these people
are or what lead them to the situation they find themselves in. The
animals are easier to care about than the humans.

See this film if you're up for a disturbing visual treat, but don't
expect anything beyond that.

[This appeared in "The Bloomington Voice", Bloomington, Indiana,
8/27/96. Michael Redman can be reached at mredman@bvoice.com]

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import React, {Component} from 'react';
import Header from './header';
import Container from './container';
export default class App extends Component {
  render () {
    return (

            <Container />

    );
  }
}


text:
layout: default
---

                    <input type="search" placeholder="Find the right answers" class="form-control max-500 display-ib" />
                    <input type="submit" class="btn btn-primary max-100 display-ib" value="Search" />

Are you ready?

              Be part of an ambitious and successful entrepreneurs networking community.

              Get advice from experts.

              Get the right answers for your problems.

              Start your adventure.

              Share your stories about success and failure.

Your entrepreneur journey

Start a business

Financing

Events

How to

How to open a new business?

How to hire an employee?

How to pay the taxes?

How to open a new business?

How to hire an employee?

How to pay the taxes?

Categories

                       Finance
                       Marketing
                       Risk management
                       Ideas
                       Business plan
                       User experience
                       Partners
                       Law

Want to ask questions?

  Join the club

Partners

Banks

Consulting Firms

Marketing Agencies


text:
using System;
using System.Configuration;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Barchart.MarketData.Service;
using NUnit.Framework;

namespace Barchart.MarketData.UnitTests
{
    [TestFixture]
    public class ResponseHandling
    {

        [Test]
        public async Task CheckOkResponseHandling()
        {
            const string expectedResponse = "response";

            var mockHttpMessageHandler = new MockHttpMessageHandler
            {
                Response =
                {
                    StatusCode = HttpStatusCode.OK,
                    Content = new StringContent(expectedResponse)
                }
            };

            var client = new Client(new HttpClient(mockHttpMessageHandler));
            var uri = new Uri("http://unittest");
            var response = await client.HttpGetAsync(uri);

            Assert.IsNotNullOrEmpty(response);
            Assert.AreEqual(expectedResponse, response);
        }

        [Test]
        [ExpectedException(typeof(HttpRequestException))]
        public async Task CheckBadRequestResponseHandling()
        {
            var mockHttpMessageHandler = new MockHttpMessageHandler
            {
                Response = { StatusCode = HttpStatusCode.BadRequest }
            };

            var client = new Client(new HttpClient(mockHttpMessageHandler));
            var uri = new Uri("http://unittest");

            try
            {
                await client.HttpGetAsync(uri);
            }
            catch (HttpRequestException httpRequestException)
            {
                Assert.AreEqual(httpRequestException.Message, "Response status code does not indicate success: 400 (Bad Request).");

                throw;
            }
        }

        [Test]
        [ExpectedException(typeof(HttpRequestException))]
        public async Task CheckInternalServerErrorResponseHandling()
        {
            var mockHttpMessageHandler = new MockHttpMessageHandler
            {
                Response = { StatusCode = HttpStatusCode.InternalServerError }
            };

            var client = new Client(new HttpClient(mockHttpMessageHandler));
            var uri = new Uri("http://unittest");

            try
            {
                await client.HttpGetAsync(uri);
            }
            catch (HttpRequestException httpRequestException)
            {
                Assert.AreEqual(httpRequestException.Message, "Response status code does not indicate success: 500 (Internal Server Error).");

                throw;
            }
        }
    }
}


text:
package main

func main() {
	var i interface{} = "truc"

	switch i.(type) {
	case string:
		println("string")
	default:
		println("unknown")
	}
}

// Output:
// string


text:
@class WCFile;

@interface WCSearchContainer : RSTreeNode
@property (readonly,nonatomic) NSString *searchStatus;

+ (id)searchContainerWithFile:(WCFile *)file;
- (id)initWithFile:(WCFile *)file;
@end


text:
namespace updater {

scoped_refptr<ExternalConstants> CreateExternalConstants() {
  return CreateDefaultExternalConstants();
}

}  // namespace updater