text:
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * model description
 * Class SysDic
 * @package  App\Models
 *
 * @author  xrs
 * @SWG\Model(id="SysDic")
 * @SWG\Property(name="id", type="integer", description="id")
 * @SWG\Property(name="value", type="string", description="值")
 * @SWG\Property(name="text", type="string", description="显示")
 * @SWG\Property(name="category", type="string", description="类型")
 * @SWG\Property(name="created_at", type="timestamp", description="创建时间")
 * @SWG\Property(name="updated_at", type="timestamp", description="修改时间")
  */
class SysDic extends Model
{
	//
	protected $table = 'sys_dics';
	protected $guarded = ['id'];
}


text:
    <meta charset="utf-8">

    <title>Sky Selection Tests</title>

    <link rel="stylesheet" href="qunit-2.4.0.css"/>

redpajama_set_name: RedPajamaGithub


text:
/*
 * Created on Sep 28, 2004
 *
 */
package apollo.dataadapter.chadoxml;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.apache.log4j.*;

import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import apollo.dataadapter.chado.ChadoTransaction;
import apollo.dataadapter.chado.ChadoUpdateTransaction;

/**
 * This class is used to process xml template for transactions.
 * @author wgm
 */
public class ChadoTransactionXMLTemplate {

  // -----------------------------------------------------------------------
  // Class/static variables
  // -----------------------------------------------------------------------

  protected final static Logger logger = LogManager.getLogger(ChadoTransactionXMLTemplate.class);

  // -----------------------------------------------------------------------
  // Instance variables
  // -----------------------------------------------------------------------

  private Document doc;
  // Default parameter values
  private Map defaultValues = new HashMap();
  // To control export format
  private String startIndent = "";
  private String indent = "    ";

  public ChadoTransactionXMLTemplate(String fileName) {
    loadTemplates(fileName);
  }

  public ChadoTransactionXMLTemplate(String fileName, String startIndent, String indent) {
    this(fileName);
    this.startIndent = startIndent;
    this.indent = indent;
  }

  public void setStartIndent(String indent) {
    this.startIndent = indent;
  }

  public void setIndent(String indent) {
    this.indent = indent;
  }

  private void loadTemplates(String fileName) {
    try {
      DocumentBuilderFactory df = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = df.newDocumentBuilder();
      doc = builder.parse(fileName);
    }
    catch(Exception e) {
      logger.error("XMLTemplate.loadTemplates(): " + e, e);
    }
  }

  public String generateElement(ChadoTransaction tn) {
    StringBuffer buffer = new StringBuffer();
    buffer.append(startIndent);
    buffer.append("<");
    buffer.append(tn.getTableName());
    buffer.append(" op=\"");
    buffer.append(tn.getOperation());
    buffer.append("\"");
    if (tn.getID() != null) {
      buffer.append(" id=\"");
      buffer.append(tn.getID());
      buffer.append("\"");
    }
    buffer.append(">\n");
    outputProperties(buffer, startIndent + indent, tn.getProperties());
    if (tn instanceof ChadoUpdateTransaction) {
      outputUpdateProperties(buffer,
                             startIndent + indent,
                             ((ChadoUpdateTransaction)tn).getUpdateProperies());
    }
    closeElementTag(buffer, indent, tn);
    return buffer.toString();
  }

  private void outputProperties(StringBuffer buffer, String indent, Map properties) {
    String key;
    String value;
    for (Iterator it = properties.keySet().iterator(); it.hasNext();) {
      key = (String) it.next();
      value = (String) properties.get(key);
      buffer.append(indent);
      buffer.append("<");
      buffer.append(key);
      buffer.append(">");
      buffer.append(value);
      buffer.append("</");
      buffer.append(key);
      buffer.append(">\n");
    }
  }

  private void outputUpdateProperties(StringBuffer buffer, String indent, Map updateProps) {
    if (updateProps == null || updateProps.size() == 0)
      return;
    String key, value;
    for (Iterator it = updateProps.keySet().iterator(); it.hasNext();) {
      key = (String) it.next();
      value = (String) updateProps.get(key);
      buffer.append(indent);
      buffer.append("<");
      buffer.append(key);
      buffer.append(" op=\"update\">");
      buffer.append(value);
      buffer.append("</");
      buffer.append(key);
      buffer.append(">\n");
    }
  }

  private void closeElementTag(StringBuffer buffer, String indent, ChadoTransaction ts) {
    buffer.append(startIndent);
    buffer.append("</");
    buffer.append(ts.getTableName());
    buffer.append(">\n");
  }

  public Element getElement(String elmName) {
    // Find the root element
    Element root = doc.getDocumentElement();
    NodeList children = root.getChildNodes();
    int size = children.getLength();
    for (int i = 0; i < size; i++) {
      Node node = children.item(i);
      if (node.getNodeName().equals(elmName))
        return (Element)node;
    }
    return null;
  }

  public String getRootStartTag() {
    Element rootElm = getTxRootElement();
    StringBuffer buffer = new StringBuffer();
    buffer.append("<");
    buffer.append(rootElm.getNodeName());
    NamedNodeMap atts = rootElm.getAttributes();
    if (atts != null) {
      int size = atts.getLength();
      for (int i = 0; i < size; i++) {
        Node node = atts.item(i);
        if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
          Attr att = (Attr) node;
          buffer.append(" ");
          buffer.append(att.getName());
          buffer.append("=\"");
          buffer.append(att.getName());
          buffer.append("\"");
        }
      }
    }
    buffer.append(">\n");
    return buffer.toString();
  }

  public String getRootEndTag() {
    Element txRootElm = getTxRootElement();
    return "</" + txRootElm.getNodeName() + ">\n";
  }

  private Element getTxRootElement() {
    Element rootElm = getElement("root");
    NodeList children = rootElm.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node node = children.item(i);
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        return (Element)node;
      }
    }
    return null;
  }

  public String getPreambleString() {
    Element preamleElm = getElement("preamble");
    if (preamleElm != null) {
      StringBuffer buffer = new StringBuffer();
      // No need for <preamble> element
      NodeList children = preamleElm.getChildNodes();
      int size = children.getLength();
      for (int i = 0; i < size; i++) {
        Node node = children.item(i);
        if (node.getNodeType() == Node.ELEMENT_NODE)
          convertElementToString((Element)node, buffer, startIndent);
      }
      return buffer.toString();
    }
    return null;
  }

  private void convertElementToString(Element element, StringBuffer buffer, String indent1) {
    buffer.append(indent1);
    buffer.append("<");
    buffer.append(element.getNodeName());
    // Convert attributes
    NamedNodeMap attributes = element.getAttributes();
    if (attributes != null) {
      int size = attributes.getLength();
      Node node = null;
      for (int i = 0; i < size; i++) {
        node = attributes.item(i);
        if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
          Attr att = (Attr) node;
          buffer.append(" ");
          buffer.append(att.getName());
          buffer.append("=\"");
          buffer.append(att.getValue());
          buffer.append("\"");
        }
      }
    }
    buffer.append(">");
    // Convert elements
    NodeList children = element.getChildNodes();
    int size = children.getLength();
    // A special case for text node
    if (size == 1 && children.item(0).getNodeType() == Node.TEXT_NODE) {
      Node textNode = children.item(0);
      buffer.append(textNode.getNodeValue());
    }
    else {
      // Close the start tag
      buffer.append("\n");
      for (int i = 0; i < size; i++) {
        Node node = children.item(i);
        if (node.getNodeType() == Node.ELEMENT_NODE) {
          convertElementToString((Element) node, buffer, indent1 + indent);
        }
      }
      buffer.append(indent1);
    }
    buffer.append("</");
    buffer.append(element.getNodeName());
    buffer.append(">\n");
  }

}


text:
namespace GLES3
{

PFNGLACTIVETEXTUREPROC glActiveTexture = NULL;
PFNGLATTACHSHADERPROC glAttachShader = NULL;
PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation = NULL;
PFNGLBINDBUFFERPROC glBindBuffer = NULL;
PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer = NULL;
PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer = NULL;
PFNGLBINDTEXTUREPROC glBindTexture = NULL;
PFNGLBLENDCOLORPROC glBlendColor = NULL;
PFNGLBLENDEQUATIONPROC glBlendEquation = NULL;
PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate = NULL;
PFNGLBLENDFUNCPROC glBlendFunc = NULL;
PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = NULL;
PFNGLBUFFERDATAPROC glBufferData = NULL;
PFNGLBUFFERSUBDATAPROC glBufferSubData = NULL;
PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus = NULL;
PFNGLCLEARPROC glClear = NULL;
PFNGLCLEARCOLORPROC glClearColor = NULL;
PFNGLCLEARDEPTHFPROC glClearDepthf = NULL;
PFNGLCLEARSTENCILPROC glClearStencil = NULL;
PFNGLCOLORMASKPROC glColorMask = NULL;
PFNGLCOMPILESHADERPROC glCompileShader = NULL;
PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D = NULL;
PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D = NULL;
PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D = NULL;
PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D = NULL;
PFNGLCREATEPROGRAMPROC glCreateProgram = NULL;
PFNGLCREATESHADERPROC glCreateShader = NULL;
PFNGLCULLFACEPROC glCullFace = NULL;
PFNGLDELETEBUFFERSPROC glDeleteBuffers = NULL;
PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers = NULL;
PFNGLDELETEPROGRAMPROC glDeleteProgram = NULL;
PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers = NULL;
PFNGLDELETESHADERPROC glDeleteShader = NULL;
PFNGLDELETETEXTURESPROC glDeleteTextures = NULL;
PFNGLDEPTHFUNCPROC glDepthFunc = NULL;
PFNGLDEPTHMASKPROC glDepthMask = NULL;
PFNGLDEPTHRANGEFPROC glDepthRangef = NULL;
PFNGLDETACHSHADERPROC glDetachShader = NULL;
PFNGLDISABLEPROC glDisable = NULL;
PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray = NULL;
PFNGLDRAWARRAYSPROC glDrawArrays = NULL;
PFNGLDRAWELEMENTSPROC glDrawElements = NULL;
PFNGLENABLEPROC glEnable = NULL;
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray = NULL;
PFNGLFINISHPROC glFinish = NULL;
PFNGLFLUSHPROC glFlush = NULL;
PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer = NULL;
PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D = NULL;
PFNGLFRONTFACEPROC glFrontFace = NULL;
PFNGLGENBUFFERSPROC glGenBuffers = NULL;
PFNGLGENERATEMIPMAPPROC glGenerateMipmap = NULL;
PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers = NULL;
PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers = NULL;
PFNGLGENTEXTURESPROC glGenTextures = NULL;
PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib = NULL;
PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform = NULL;
PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders = NULL;
PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation = NULL;
PFNGLGETBOOLEANVPROC glGetBooleanv = NULL;
PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv = NULL;
PFNGLGETERRORPROC glGetError = NULL;
PFNGLGETFLOATVPROC glGetFloatv = NULL;
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv = NULL;
PFNGLGETINTEGERVPROC glGetIntegerv = NULL;
PFNGLGETPROGRAMIVPROC glGetProgramiv = NULL;
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog = NULL;
PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv = NULL;
PFNGLGETSHADERIVPROC glGetShaderiv = NULL;
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog = NULL;
PFNGLGETSHADERPRECISIONFORMATPROC glGetShaderPrecisionFormat = NULL;
PFNGLGETSHADERSOURCEPROC glGetShaderSource = NULL;
PFNGLGETSTRINGPROC glGetString = NULL;
PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv = NULL;
PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv = NULL;
PFNGLGETUNIFORMFVPROC glGetUniformfv = NULL;
PFNGLGETUNIFORMIVPROC glGetUniformiv = NULL;
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation = NULL;
PFNGLGETVERTEXATTRIBFVPROC glGetVertexAttribfv = NULL;
PFNGLGETVERTEXATTRIBIVPROC glGetVertexAttribiv = NULL;
PFNGLGETVERTEXATTRIBPOINTERVPROC glGetVertexAttribPointerv = NULL;
PFNGLHINTPROC glHint = NULL;
PFNGLISBUFFERPROC glIsBuffer = NULL;
PFNGLISENABLEDPROC glIsEnabled = NULL;
PFNGLISFRAMEBUFFERPROC glIsFramebuffer = NULL;
PFNGLISPROGRAMPROC glIsProgram = NULL;
PFNGLISRENDERBUFFERPROC glIsRenderbuffer = NULL;
PFNGLISSHADERPROC glIsShader = NULL;
PFNGLISTEXTUREPROC glIsTexture = NULL;
PFNGLLINEWIDTHPROC glLineWidth = NULL;
PFNGLLINKPROGRAMPROC glLinkProgram = NULL;
PFNGLPIXELSTOREIPROC glPixelStorei = NULL;
PFNGLPOLYGONOFFSETPROC glPolygonOffset = NULL;
PFNGLREADPIXELSPROC glReadPixels = NULL;
PFNGLRELEASESHADERCOMPILERPROC glReleaseShaderCompiler = NULL;
PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage = NULL;
PFNGLSAMPLECOVERAGEPROC glSampleCoverage = NULL;
PFNGLSCISSORPROC glScissor = NULL;
PFNGLSHADERBINARYPROC glShaderBinary = NULL;
PFNGLSHADERSOURCEPROC glShaderSource = NULL;
PFNGLSTENCILFUNCPROC glStencilFunc = NULL;
PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate = NULL;
PFNGLSTENCILMASKPROC glStencilMask = NULL;
PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate = NULL;
PFNGLSTENCILOPPROC glStencilOp = NULL;
PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate = NULL;
PFNGLTEXIMAGE2DPROC glTexImage2D = NULL;
PFNGLTEXPARAMETERFPROC glTexParameterf = NULL;
PFNGLTEXPARAMETERFVPROC glTexParameterfv = NULL;
PFNGLTEXPARAMETERIPROC glTexParameteri = NULL;
PFNGLTEXPARAMETERIVPROC glTexParameteriv = NULL;
PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D = NULL;
PFNGLUNIFORM1FPROC glUniform1f = NULL;
PFNGLUNIFORM1FVPROC glUniform1fv = NULL;
PFNGLUNIFORM1IPROC glUniform1i = NULL;
PFNGLUNIFORM1IVPROC glUniform1iv = NULL;
PFNGLUNIFORM2FPROC glUniform2f = NULL;
PFNGLUNIFORM2FVPROC glUniform2fv = NULL;
PFNGLUNIFORM2IPROC glUniform2i = NULL;
PFNGLUNIFORM2IVPROC glUniform2iv = NULL;
PFNGLUNIFORM3FPROC glUniform3f = NULL;
PFNGLUNIFORM3FVPROC glUniform3fv = NULL;
PFNGLUNIFORM3IPROC glUniform3i = NULL;
PFNGLUNIFORM3IVPROC glUniform3iv = NULL;
PFNGLUNIFORM4FPROC glUniform4f = NULL;
PFNGLUNIFORM4FVPROC glUniform4fv = NULL;
PFNGLUNIFORM4IPROC glUniform4i = NULL;
PFNGLUNIFORM4IVPROC glUniform4iv = NULL;
PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv = NULL;
PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv = NULL;
PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv = NULL;
PFNGLUSEPROGRAMPROC glUseProgram = NULL;
PFNGLVALIDATEPROGRAMPROC glValidateProgram = NULL;
PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f = NULL;
PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv = NULL;
PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f = NULL;
PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv = NULL;
PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f = NULL;
PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv = NULL;
PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f = NULL;
PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv = NULL;
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = NULL;
PFNGLVIEWPORTPROC glViewport = NULL;
PFNGLREADBUFFERPROC glReadBuffer = NULL;
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = NULL;
PFNGLTEXIMAGE3DPROC glTexImage3D = NULL;
PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = NULL;
PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = NULL;
PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D = NULL;
PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D = NULL;
PFNGLGENQUERIESPROC glGenQueries = NULL;
PFNGLDELETEQUERIESPROC glDeleteQueries = NULL;
PFNGLISQUERYPROC glIsQuery = NULL;
PFNGLBEGINQUERYPROC glBeginQuery = NULL;
PFNGLENDQUERYPROC glEndQuery = NULL;
PFNGLGETQUERYIVPROC glGetQueryiv = NULL;
PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv = NULL;
PFNGLUNMAPBUFFERPROC glUnmapBuffer = NULL;
PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv = NULL;
PFNGLDRAWBUFFERSPROC glDrawBuffers = NULL;
PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv = NULL;
PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv = NULL;
PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv = NULL;
PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv = NULL;
PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv = NULL;
PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv = NULL;
PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer = NULL;
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample = NULL;
PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer = NULL;
PFNGLMAPBUFFERRANGEPROC glMapBufferRange = NULL;
PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange = NULL;
PFNGLBINDVERTEXARRAYPROC glBindVertexArray = NULL;
PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays = NULL;
PFNGLGENVERTEXARRAYSPROC glGenVertexArrays = NULL;
PFNGLISVERTEXARRAYPROC glIsVertexArray = NULL;
PFNGLGETINTEGERI_VPROC glGetIntegeri_v = NULL;
PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback = NULL;
PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback = NULL;
PFNGLBINDBUFFERRANGEPROC glBindBufferRange = NULL;
PFNGLBINDBUFFERBASEPROC glBindBufferBase = NULL;
PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings = NULL;
PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glGetTransformFeedbackVarying = NULL;
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
PFNGLGETVERTEXATTRIBIIVPROC glGetVertexAttribIiv = NULL;
PFNGLGETVERTEXATTRIBIUIVPROC glGetVertexAttribIuiv = NULL;
PFNGLVERTEXATTRIBI4IPROC glVertexAttribI4i = NULL;
PFNGLVERTEXATTRIBI4UIPROC glVertexAttribI4ui = NULL;
PFNGLVERTEXATTRIBI4IVPROC glVertexAttribI4iv = NULL;
PFNGLVERTEXATTRIBI4UIVPROC glVertexAttribI4uiv = NULL;
PFNGLGETUNIFORMUIVPROC glGetUniformuiv = NULL;
PFNGLGETFRAGDATALOCATIONPROC glGetFragDataLocation = NULL;
PFNGLUNIFORM1UIPROC glUniform1ui = NULL;
PFNGLUNIFORM2UIPROC glUniform2ui = NULL;
PFNGLUNIFORM3UIPROC glUniform3ui = NULL;
PFNGLUNIFORM4UIPROC glUniform4ui = NULL;
PFNGLUNIFORM1UIVPROC glUniform1uiv = NULL;
PFNGLUNIFORM2UIVPROC glUniform2uiv = NULL;
PFNGLUNIFORM3UIVPROC glUniform3uiv = NULL;
PFNGLUNIFORM4UIVPROC glUniform4uiv = NULL;
PFNGLCLEARBUFFERIVPROC glClearBufferiv = NULL;
PFNGLCLEARBUFFERUIVPROC glClearBufferuiv = NULL;
PFNGLCLEARBUFFERFVPROC glClearBufferfv = NULL;
PFNGLCLEARBUFFERFIPROC glClearBufferfi = NULL;
PFNGLGETSTRINGIPROC glGetStringi = NULL;
PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData = NULL;
PFNGLGETUNIFORMINDICESPROC glGetUniformIndices = NULL;
PFNGLGETACTIVEUNIFORMSIVPROC glGetActiveUniformsiv = NULL;
PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex = NULL;
PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv = NULL;
PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName = NULL;
PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding = NULL;
PFNGLDRAWARRAYSINSTANCEDPROC glDrawArraysInstanced = NULL;
PFNGLDRAWELEMENTSINSTANCEDPROC glDrawElementsInstanced = NULL;
PFNGLFENCESYNCPROC glFenceSync = NULL;
PFNGLISSYNCPROC glIsSync = NULL;
PFNGLDELETESYNCPROC glDeleteSync = NULL;
PFNGLCLIENTWAITSYNCPROC glClientWaitSync = NULL;
PFNGLWAITSYNCPROC glWaitSync = NULL;
PFNGLGETINTEGER64VPROC glGetInteger64v = NULL;
PFNGLGETSYNCIVPROC glGetSynciv = NULL;
PFNGLGETINTEGER64I_VPROC glGetInteger64i_v = NULL;
PFNGLGETBUFFERPARAMETERI64VPROC glGetBufferParameteri64v = NULL;
PFNGLGENSAMPLERSPROC glGenSamplers = NULL;
PFNGLDELETESAMPLERSPROC glDeleteSamplers = NULL;
PFNGLISSAMPLERPROC glIsSampler = NULL;
PFNGLBINDSAMPLERPROC glBindSampler = NULL;
PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri = NULL;
PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv = NULL;
PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf = NULL;
PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv = NULL;
PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv = NULL;
PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv = NULL;
PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor = NULL;
PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback = NULL;
PFNGLDELETETRANSFORMFEEDBACKSPROC glDeleteTransformFeedbacks = NULL;
PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks = NULL;
PFNGLISTRANSFORMFEEDBACKPROC glIsTransformFeedback = NULL;
PFNGLPAUSETRANSFORMFEEDBACKPROC glPauseTransformFeedback = NULL;
PFNGLRESUMETRANSFORMFEEDBACKPROC glResumeTransformFeedback = NULL;
PFNGLGETPROGRAMBINARYPROC glGetProgramBinary = NULL;
PFNGLPROGRAMBINARYPROC glProgramBinary = NULL;
PFNGLPROGRAMPARAMETERIPROC glProgramParameteri = NULL;
PFNGLINVALIDATEFRAMEBUFFERPROC glInvalidateFramebuffer = NULL;
PFNGLINVALIDATESUBFRAMEBUFFERPROC glInvalidateSubFramebuffer = NULL;
PFNGLTEXSTORAGE2DPROC glTexStorage2D = NULL;
PFNGLTEXSTORAGE3DPROC glTexStorage3D = NULL;
PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ = NULL;

static bool           g_initialized = false;
static pthread_once_t g_once        = PTHREAD_ONCE_INIT;

template<typename T> inline T LoadGLFunction(const char *name)
{
  T proc = (T)eglGetProcAddress(name);
  if(!proc) proc = (T)dlsym(RTLD_NEXT, name);
  return proc;
}

static void LoadGLFunctionsInternal(void)
{
  if((glActiveTexture = LoadGLFunction<PFNGLACTIVETEXTUREPROC>("glActiveTexture"))==NULL) return;
  if((glAttachShader = LoadGLFunction<PFNGLATTACHSHADERPROC>("glAttachShader"))==NULL) return;
  if((glBindAttribLocation = LoadGLFunction<PFNGLBINDATTRIBLOCATIONPROC>("glBindAttribLocation"))==NULL) return;
  if((glBindBuffer = LoadGLFunction<PFNGLBINDBUFFERPROC>("glBindBuffer"))==NULL) return;
  if((glBindFramebuffer = LoadGLFunction<PFNGLBINDFRAMEBUFFERPROC>("glBindFramebuffer"))==NULL) return;
  if((glBindRenderbuffer = LoadGLFunction<PFNGLBINDRENDERBUFFERPROC>("glBindRenderbuffer"))==NULL) return;
  if((glBindTexture = LoadGLFunction<PFNGLBINDTEXTUREPROC>("glBindTexture"))==NULL) return;
  if((glBlendColor = LoadGLFunction<PFNGLBLENDCOLORPROC>("glBlendColor"))==NULL) return;
  if((glBlendEquation = LoadGLFunction<PFNGLBLENDEQUATIONPROC>("glBlendEquation"))==NULL) return;
  if((glBlendEquationSeparate = LoadGLFunction<PFNGLBLENDEQUATIONSEPARATEPROC>("glBlendEquationSeparate"))==NULL) return;
  if((glBlendFunc = LoadGLFunction<PFNGLBLENDFUNCPROC>("glBlendFunc"))==NULL) return;
  if((glBlendFuncSeparate = LoadGLFunction<PFNGLBLENDFUNCSEPARATEPROC>("glBlendFuncSeparate"))==NULL) return;
  if((glBufferData = LoadGLFunction<PFNGLBUFFERDATAPROC>("glBufferData"))==NULL) return;
  if((glBufferSubData = LoadGLFunction<PFNGLBUFFERSUBDATAPROC>("glBufferSubData"))==NULL) return;
  if((glCheckFramebufferStatus = LoadGLFunction<PFNGLCHECKFRAMEBUFFERSTATUSPROC>("glCheckFramebufferStatus"))==NULL) return;
  if((glClear = LoadGLFunction<PFNGLCLEARPROC>("glClear"))==NULL) return;
  if((glClearColor = LoadGLFunction<PFNGLCLEARCOLORPROC>("glClearColor"))==NULL) return;
  if((glClearDepthf = LoadGLFunction<PFNGLCLEARDEPTHFPROC>("glClearDepthf"))==NULL) return;
  if((glClearStencil = LoadGLFunction<PFNGLCLEARSTENCILPROC>("glClearStencil"))==NULL) return;
  if((glColorMask = LoadGLFunction<PFNGLCOLORMASKPROC>("glColorMask"))==NULL) return;
  if((glCompileShader = LoadGLFunction<PFNGLCOMPILESHADERPROC>("glCompileShader"))==NULL) return;
  if((glCompressedTexImage2D = LoadGLFunction<PFNGLCOMPRESSEDTEXIMAGE2DPROC>("glCompressedTexImage2D"))==NULL) return;
  if((glCompressedTexSubImage2D = LoadGLFunction<PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC>("glCompressedTexSubImage2D"))==NULL) return;
  if((glCopyTexImage2D = LoadGLFunction<PFNGLCOPYTEXIMAGE2DPROC>("glCopyTexImage2D"))==NULL) return;
  if((glCopyTexSubImage2D = LoadGLFunction<PFNGLCOPYTEXSUBIMAGE2DPROC>("glCopyTexSubImage2D"))==NULL) return;
  if((glCreateProgram = LoadGLFunction<PFNGLCREATEPROGRAMPROC>("glCreateProgram"))==NULL) return;
  if((glCreateShader = LoadGLFunction<PFNGLCREATESHADERPROC>("glCreateShader"))==NULL) return;
  if((glCullFace = LoadGLFunction<PFNGLCULLFACEPROC>("glCullFace"))==NULL) return;
  if((glDeleteBuffers = LoadGLFunction<PFNGLDELETEBUFFERSPROC>("glDeleteBuffers"))==NULL) return;
  if((glDeleteFramebuffers = LoadGLFunction<PFNGLDELETEFRAMEBUFFERSPROC>("glDeleteFramebuffers"))==NULL) return;
  if((glDeleteProgram = LoadGLFunction<PFNGLDELETEPROGRAMPROC>("glDeleteProgram"))==NULL) return;
  if((glDeleteRenderbuffers = LoadGLFunction<PFNGLDELETERENDERBUFFERSPROC>("glDeleteRenderbuffers"))==NULL) return;
  if((glDeleteShader = LoadGLFunction<PFNGLDELETESHADERPROC>("glDeleteShader"))==NULL) return;
  if((glDeleteTextures = LoadGLFunction<PFNGLDELETETEXTURESPROC>("glDeleteTextures"))==NULL) return;
  if((glDepthFunc = LoadGLFunction<PFNGLDEPTHFUNCPROC>("glDepthFunc"))==NULL) return;
  if((glDepthMask = LoadGLFunction<PFNGLDEPTHMASKPROC>("glDepthMask"))==NULL) return;
  if((glDepthRangef = LoadGLFunction<PFNGLDEPTHRANGEFPROC>("glDepthRangef"))==NULL) return;
  if((glDetachShader = LoadGLFunction<PFNGLDETACHSHADERPROC>("glDetachShader"))==NULL) return;
  if((glDisable = LoadGLFunction<PFNGLDISABLEPROC>("glDisable"))==NULL) return;
  if((glDisableVertexAttribArray = LoadGLFunction<PFNGLDISABLEVERTEXATTRIBARRAYPROC>("glDisableVertexAttribArray"))==NULL) return;
  if((glDrawArrays = LoadGLFunction<PFNGLDRAWARRAYSPROC>("glDrawArrays"))==NULL) return;
  if((glDrawElements = LoadGLFunction<PFNGLDRAWELEMENTSPROC>("glDrawElements"))==NULL) return;
  if((glEnable = LoadGLFunction<PFNGLENABLEPROC>("glEnable"))==NULL) return;
  if((glEnableVertexAttribArray = LoadGLFunction<PFNGLENABLEVERTEXATTRIBARRAYPROC>("glEnableVertexAttribArray"))==NULL) return;
  if((glFinish = LoadGLFunction<PFNGLFINISHPROC>("glFinish"))==NULL) return;
  if((glFlush = LoadGLFunction<PFNGLFLUSHPROC>("glFlush"))==NULL) return;
  if((glFramebufferRenderbuffer = LoadGLFunction<PFNGLFRAMEBUFFERRENDERBUFFERPROC>("glFramebufferRenderbuffer"))==NULL) return;
  if((glFramebufferTexture2D = LoadGLFunction<PFNGLFRAMEBUFFERTEXTURE2DPROC>("glFramebufferTexture2D"))==NULL) return;
  if((glFrontFace = LoadGLFunction<PFNGLFRONTFACEPROC>("glFrontFace"))==NULL) return;
  if((glGenBuffers = LoadGLFunction<PFNGLGENBUFFERSPROC>("glGenBuffers"))==NULL) return;
  if((glGenerateMipmap = LoadGLFunction<PFNGLGENERATEMIPMAPPROC>("glGenerateMipmap"))==NULL) return;
  if((glGenFramebuffers = LoadGLFunction<PFNGLGENFRAMEBUFFERSPROC>("glGenFramebuffers"))==NULL) return;
  if((glGenRenderbuffers = LoadGLFunction<PFNGLGENRENDERBUFFERSPROC>("glGenRenderbuffers"))==NULL) return;
  if((glGenTextures = LoadGLFunction<PFNGLGENTEXTURESPROC>("glGenTextures"))==NULL) return;
  if((glGetActiveAttrib = LoadGLFunction<PFNGLGETACTIVEATTRIBPROC>("glGetActiveAttrib"))==NULL) return;
  if((glGetActiveUniform = LoadGLFunction<PFNGLGETACTIVEUNIFORMPROC>("glGetActiveUniform"))==NULL) return;
  if((glGetAttachedShaders = LoadGLFunction<PFNGLGETATTACHEDSHADERSPROC>("glGetAttachedShaders"))==NULL) return;
  if((glGetAttribLocation = LoadGLFunction<PFNGLGETATTRIBLOCATIONPROC>("glGetAttribLocation"))==NULL) return;
  if((glGetBooleanv = LoadGLFunction<PFNGLGETBOOLEANVPROC>("glGetBooleanv"))==NULL) return;
  if((glGetBufferParameteriv = LoadGLFunction<PFNGLGETBUFFERPARAMETERIVPROC>("glGetBufferParameteriv"))==NULL) return;
  if((glGetError = LoadGLFunction<PFNGLGETERRORPROC>("glGetError"))==NULL) return;
  if((glGetFloatv = LoadGLFunction<PFNGLGETFLOATVPROC>("glGetFloatv"))==NULL) return;
  if((glGetFramebufferAttachmentParameteriv = LoadGLFunction<PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC>("glGetFramebufferAttachmentParameteriv"))==NULL) return;
  if((glGetIntegerv = LoadGLFunction<PFNGLGETINTEGERVPROC>("glGetIntegerv"))==NULL) return;
  if((glGetProgramiv = LoadGLFunction<PFNGLGETPROGRAMIVPROC>("glGetProgramiv"))==NULL) return;
  if((glGetProgramInfoLog = LoadGLFunction<PFNGLGETPROGRAMINFOLOGPROC>("glGetProgramInfoLog"))==NULL) return;
  if((glGetRenderbufferParameteriv = LoadGLFunction<PFNGLGETRENDERBUFFERPARAMETERIVPROC>("glGetRenderbufferParameteriv"))==NULL) return;
  if((glGetShaderiv = LoadGLFunction<PFNGLGETSHADERIVPROC>("glGetShaderiv"))==NULL) return;
  if((glGetShaderInfoLog = LoadGLFunction<PFNGLGETSHADERINFOLOGPROC>("glGetShaderInfoLog"))==NULL) return;
  if((glGetShaderPrecisionFormat = LoadGLFunction<PFNGLGETSHADERPRECISIONFORMATPROC>("glGetShaderPrecisionFormat"))==NULL) return;
  if((glGetShaderSource = LoadGLFunction<PFNGLGETSHADERSOURCEPROC>("glGetShaderSource"))==NULL) return;
  if((glGetString = LoadGLFunction<PFNGLGETSTRINGPROC>("glGetString"))==NULL) return;
  if((glGetTexParameterfv = LoadGLFunction<PFNGLGETTEXPARAMETERFVPROC>("glGetTexParameterfv"))==NULL) return;
  if((glGetTexParameteriv = LoadGLFunction<PFNGLGETTEXPARAMETERIVPROC>("glGetTexParameteriv"))==NULL) return;
  if((glGetUniformfv = LoadGLFunction<PFNGLGETUNIFORMFVPROC>("glGetUniformfv"))==NULL) return;
  if((glGetUniformiv = LoadGLFunction<PFNGLGETUNIFORMIVPROC>("glGetUniformiv"))==NULL) return;
  if((glGetUniformLocation = LoadGLFunction<PFNGLGETUNIFORMLOCATIONPROC>("glGetUniformLocation"))==NULL) return;
  if((glGetVertexAttribfv = LoadGLFunction<PFNGLGETVERTEXATTRIBFVPROC>("glGetVertexAttribfv"))==NULL) return;
  if((glGetVertexAttribiv = LoadGLFunction<PFNGLGETVERTEXATTRIBIVPROC>("glGetVertexAttribiv"))==NULL) return;
  if((glGetVertexAttribPointerv = LoadGLFunction<PFNGLGETVERTEXATTRIBPOINTERVPROC>("glGetVertexAttribPointerv"))==NULL) return;
  if((glHint = LoadGLFunction<PFNGLHINTPROC>("glHint"))==NULL) return;
  if((glIsBuffer = LoadGLFunction<PFNGLISBUFFERPROC>("glIsBuffer"))==NULL) return;
  if((glIsEnabled = LoadGLFunction<PFNGLISENABLEDPROC>("glIsEnabled"))==NULL) return;
  if((glIsFramebuffer = LoadGLFunction<PFNGLISFRAMEBUFFERPROC>("glIsFramebuffer"))==NULL) return;
  if((glIsProgram = LoadGLFunction<PFNGLISPROGRAMPROC>("glIsProgram"))==NULL) return;
  if((glIsRenderbuffer = LoadGLFunction<PFNGLISRENDERBUFFERPROC>("glIsRenderbuffer"))==NULL) return;
  if((glIsShader = LoadGLFunction<PFNGLISSHADERPROC>("glIsShader"))==NULL) return;
  if((glIsTexture = LoadGLFunction<PFNGLISTEXTUREPROC>("glIsTexture"))==NULL) return;
  if((glLineWidth = LoadGLFunction<PFNGLLINEWIDTHPROC>("glLineWidth"))==NULL) return;
  if((glLinkProgram = LoadGLFunction<PFNGLLINKPROGRAMPROC>("glLinkProgram"))==NULL) return;
  if((glPixelStorei = LoadGLFunction<PFNGLPIXELSTOREIPROC>("glPixelStorei"))==NULL) return;
  if((glPolygonOffset = LoadGLFunction<PFNGLPOLYGONOFFSETPROC>("glPolygonOffset"))==NULL) return;
  if((glReadPixels = LoadGLFunction<PFNGLREADPIXELSPROC>("glReadPixels"))==NULL) return;
  if((glReleaseShaderCompiler = LoadGLFunction<PFNGLRELEASESHADERCOMPILERPROC>("glReleaseShaderCompiler"))==NULL) return;
  if((glRenderbufferStorage = LoadGLFunction<PFNGLRENDERBUFFERSTORAGEPROC>("glRenderbufferStorage"))==NULL) return;
  if((glSampleCoverage = LoadGLFunction<PFNGLSAMPLECOVERAGEPROC>("glSampleCoverage"))==NULL) return;
  if((glScissor = LoadGLFunction<PFNGLSCISSORPROC>("glScissor"))==NULL) return;
  if((glShaderBinary = LoadGLFunction<PFNGLSHADERBINARYPROC>("glShaderBinary"))==NULL) return;
  if((glShaderSource = LoadGLFunction<PFNGLSHADERSOURCEPROC>("glShaderSource"))==NULL) return;
  if((glStencilFunc = LoadGLFunction<PFNGLSTENCILFUNCPROC>("glStencilFunc"))==NULL) return;
  if((glStencilFuncSeparate = LoadGLFunction<PFNGLSTENCILFUNCSEPARATEPROC>("glStencilFuncSeparate"))==NULL) return;
  if((glStencilMask = LoadGLFunction<PFNGLSTENCILMASKPROC>("glStencilMask"))==NULL) return;
  if((glStencilMaskSeparate = LoadGLFunction<PFNGLSTENCILMASKSEPARATEPROC>("glStencilMaskSeparate"))==NULL) return;
  if((glStencilOp = LoadGLFunction<PFNGLSTENCILOPPROC>("glStencilOp"))==NULL) return;
  if((glStencilOpSeparate = LoadGLFunction<PFNGLSTENCILOPSEPARATEPROC>("glStencilOpSeparate"))==NULL) return;
  if((glTexImage2D = LoadGLFunction<PFNGLTEXIMAGE2DPROC>("glTexImage2D"))==NULL) return;
  if((glTexParameterf = LoadGLFunction<PFNGLTEXPARAMETERFPROC>("glTexParameterf"))==NULL) return;
  if((glTexParameterfv = LoadGLFunction<PFNGLTEXPARAMETERFVPROC>("glTexParameterfv"))==NULL) return;
  if((glTexParameteri = LoadGLFunction<PFNGLTEXPARAMETERIPROC>("glTexParameteri"))==NULL) return;
  if((glTexParameteriv = LoadGLFunction<PFNGLTEXPARAMETERIVPROC>("glTexParameteriv"))==NULL) return;
  if((glTexSubImage2D = LoadGLFunction<PFNGLTEXSUBIMAGE2DPROC>("glTexSubImage2D"))==NULL) return;
  if((glUniform1f = LoadGLFunction<PFNGLUNIFORM1FPROC>("glUniform1f"))==NULL) return;
  if((glUniform1fv = LoadGLFunction<PFNGLUNIFORM1FVPROC>("glUniform1fv"))==NULL) return;
  if((glUniform1i = LoadGLFunction<PFNGLUNIFORM1IPROC>("glUniform1i"))==NULL) return;
  if((glUniform1iv = LoadGLFunction<PFNGLUNIFORM1IVPROC>("glUniform1iv"))==NULL) return;
  if((glUniform2f = LoadGLFunction<PFNGLUNIFORM2FPROC>("glUniform2f"))==NULL) return;
  if((glUniform2fv = LoadGLFunction<PFNGLUNIFORM2FVPROC>("glUniform2fv"))==NULL) return;
  if((glUniform2i = LoadGLFunction<PFNGLUNIFORM2IPROC>("glUniform2i"))==NULL) return;
  if((glUniform2iv = LoadGLFunction<PFNGLUNIFORM2IVPROC>("glUniform2iv"))==NULL) return;
  if((glUniform3f = LoadGLFunction<PFNGLUNIFORM3FPROC>("glUniform3f"))==NULL) return;
  if((glUniform3fv = LoadGLFunction<PFNGLUNIFORM3FVPROC>("glUniform3fv"))==NULL) return;
  if((glUniform3i = LoadGLFunction<PFNGLUNIFORM3IPROC>("glUniform3i"))==NULL) return;
  if((glUniform3iv = LoadGLFunction<PFNGLUNIFORM3IVPROC>("glUniform3iv"))==NULL) return;
  if((glUniform4f = LoadGLFunction<PFNGLUNIFORM4FPROC>("glUniform4f"))==NULL) return;
  if((glUniform4fv = LoadGLFunction<PFNGLUNIFORM4FVPROC>("glUniform4fv"))==NULL) return;
  if((glUniform4i = LoadGLFunction<PFNGLUNIFORM4IPROC>("glUniform4i"))==NULL) return;
  if((glUniform4iv = LoadGLFunction<PFNGLUNIFORM4IVPROC>("glUniform4iv"))==NULL) return;
  if((glUniformMatrix2fv = LoadGLFunction<PFNGLUNIFORMMATRIX2FVPROC>("glUniformMatrix2fv"))==NULL) return;
  if((glUniformMatrix3fv = LoadGLFunction<PFNGLUNIFORMMATRIX3FVPROC>("glUniformMatrix3fv"))==NULL) return;
  if((glUniformMatrix4fv = LoadGLFunction<PFNGLUNIFORMMATRIX4FVPROC>("glUniformMatrix4fv"))==NULL) return;
  if((glUseProgram = LoadGLFunction<PFNGLUSEPROGRAMPROC>("glUseProgram"))==NULL) return;
  if((glValidateProgram = LoadGLFunction<PFNGLVALIDATEPROGRAMPROC>("glValidateProgram"))==NULL) return;
  if((glVertexAttrib1f = LoadGLFunction<PFNGLVERTEXATTRIB1FPROC>("glVertexAttrib1f"))==NULL) return;
  if((glVertexAttrib1fv = LoadGLFunction<PFNGLVERTEXATTRIB1FVPROC>("glVertexAttrib1fv"))==NULL) return;
  if((glVertexAttrib2f = LoadGLFunction<PFNGLVERTEXATTRIB2FPROC>("glVertexAttrib2f"))==NULL) return;
  if((glVertexAttrib2fv = LoadGLFunction<PFNGLVERTEXATTRIB2FVPROC>("glVertexAttrib2fv"))==NULL) return;
  if((glVertexAttrib3f = LoadGLFunction<PFNGLVERTEXATTRIB3FPROC>("glVertexAttrib3f"))==NULL) return;
  if((glVertexAttrib3fv = LoadGLFunction<PFNGLVERTEXATTRIB3FVPROC>("glVertexAttrib3fv"))==NULL) return;
  if((glVertexAttrib4f = LoadGLFunction<PFNGLVERTEXATTRIB4FPROC>("glVertexAttrib4f"))==NULL) return;
  if((glVertexAttrib4fv = LoadGLFunction<PFNGLVERTEXATTRIB4FVPROC>("glVertexAttrib4fv"))==NULL) return;
  if((glVertexAttribPointer = LoadGLFunction<PFNGLVERTEXATTRIBPOINTERPROC>("glVertexAttribPointer"))==NULL) return;
  if((glViewport = LoadGLFunction<PFNGLVIEWPORTPROC>("glViewport"))==NULL) return;
  if((glReadBuffer = LoadGLFunction<PFNGLREADBUFFERPROC>("glReadBuffer"))==NULL) return;
  if((glDrawRangeElements = LoadGLFunction<PFNGLDRAWRANGEELEMENTSPROC>("glDrawRangeElements"))==NULL) return;
  if((glTexImage3D = LoadGLFunction<PFNGLTEXIMAGE3DPROC>("glTexImage3D"))==NULL) return;
  if((glTexSubImage3D = LoadGLFunction<PFNGLTEXSUBIMAGE3DPROC>("glTexSubImage3D"))==NULL) return;
  if((glCopyTexSubImage3D = LoadGLFunction<PFNGLCOPYTEXSUBIMAGE3DPROC>("glCopyTexSubImage3D"))==NULL) return;
  if((glCompressedTexImage3D = LoadGLFunction<PFNGLCOMPRESSEDTEXIMAGE3DPROC>("glCompressedTexImage3D"))==NULL) return;
  if((glCompressedTexSubImage3D = LoadGLFunction<PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC>("glCompressedTexSubImage3D"))==NULL) return;
  if((glGenQueries = LoadGLFunction<PFNGLGENQUERIESPROC>("glGenQueries"))==NULL) return;
  if((glDeleteQueries = LoadGLFunction<PFNGLDELETEQUERIESPROC>("glDeleteQueries"))==NULL) return;
  if((glIsQuery = LoadGLFunction<PFNGLISQUERYPROC>("glIsQuery"))==NULL) return;
  if((glBeginQuery = LoadGLFunction<PFNGLBEGINQUERYPROC>("glBeginQuery"))==NULL) return;
  if((glEndQuery = LoadGLFunction<PFNGLENDQUERYPROC>("glEndQuery"))==NULL) return;
  if((glGetQueryiv = LoadGLFunction<PFNGLGETQUERYIVPROC>("glGetQueryiv"))==NULL) return;
  if((glGetQueryObjectuiv = LoadGLFunction<PFNGLGETQUERYOBJECTUIVPROC>("glGetQueryObjectuiv"))==NULL) return;
  if((glUnmapBuffer = LoadGLFunction<PFNGLUNMAPBUFFERPROC>("glUnmapBuffer"))==NULL) return;
  if((glGetBufferPointerv = LoadGLFunction<PFNGLGETBUFFERPOINTERVPROC>("glGetBufferPointerv"))==NULL) return;
  if((glDrawBuffers = LoadGLFunction<PFNGLDRAWBUFFERSPROC>("glDrawBuffers"))==NULL) return;
  if((glUniformMatrix2x3fv = LoadGLFunction<PFNGLUNIFORMMATRIX2X3FVPROC>("glUniformMatrix2x3fv"))==NULL) return;
  if((glUniformMatrix3x2fv = LoadGLFunction<PFNGLUNIFORMMATRIX3X2FVPROC>("glUniformMatrix3x2fv"))==NULL) return;
  if((glUniformMatrix2x4fv = LoadGLFunction<PFNGLUNIFORMMATRIX2X4FVPROC>("glUniformMatrix2x4fv"))==NULL) return;
  if((glUniformMatrix4x2fv = LoadGLFunction<PFNGLUNIFORMMATRIX4X2FVPROC>("glUniformMatrix4x2fv"))==NULL) return;
  if((glUniformMatrix3x4fv = LoadGLFunction<PFNGLUNIFORMMATRIX3X4FVPROC>("glUniformMatrix3x4fv"))==NULL) return;
  if((glUniformMatrix4x3fv = LoadGLFunction<PFNGLUNIFORMMATRIX4X3FVPROC>("glUniformMatrix4x3fv"))==NULL) return;
  if((glBlitFramebuffer = LoadGLFunction<PFNGLBLITFRAMEBUFFERPROC>("glBlitFramebuffer"))==NULL) return;
  if((glRenderbufferStorageMultisample = LoadGLFunction<PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC>("glRenderbufferStorageMultisample"))==NULL) return;
  if((glFramebufferTextureLayer = LoadGLFunction<PFNGLFRAMEBUFFERTEXTURELAYERPROC>("glFramebufferTextureLayer"))==NULL) return;
  if((glMapBufferRange = LoadGLFunction<PFNGLMAPBUFFERRANGEPROC>("glMapBufferRange"))==NULL) return;
  if((glFlushMappedBufferRange = LoadGLFunction<PFNGLFLUSHMAPPEDBUFFERRANGEPROC>("glFlushMappedBufferRange"))==NULL) return;
  if((glBindVertexArray = LoadGLFunction<PFNGLBINDVERTEXARRAYPROC>("glBindVertexArray"))==NULL) return;
  if((glDeleteVertexArrays = LoadGLFunction<PFNGLDELETEVERTEXARRAYSPROC>("glDeleteVertexArrays"))==NULL) return;
  if((glGenVertexArrays = LoadGLFunction<PFNGLGENVERTEXARRAYSPROC>("glGenVertexArrays"))==NULL) return;
  if((glIsVertexArray = LoadGLFunction<PFNGLISVERTEXARRAYPROC>("glIsVertexArray"))==NULL) return;
  if((glGetIntegeri_v = LoadGLFunction<PFNGLGETINTEGERI_VPROC>("glGetIntegeri_v"))==NULL) return;
  if((glBeginTransformFeedback = LoadGLFunction<PFNGLBEGINTRANSFORMFEEDBACKPROC>("glBeginTransformFeedback"))==NULL) return;
  if((glEndTransformFeedback = LoadGLFunction<PFNGLENDTRANSFORMFEEDBACKPROC>("glEndTransformFeedback"))==NULL) return;
  if((glBindBufferRange = LoadGLFunction<PFNGLBINDBUFFERRANGEPROC>("glBindBufferRange"))==NULL) return;
  if((glBindBufferBase = LoadGLFunction<PFNGLBINDBUFFERBASEPROC>("glBindBufferBase"))==NULL) return;
  if((glTransformFeedbackVaryings = LoadGLFunction<PFNGLTRANSFORMFEEDBACKVARYINGSPROC>("glTransformFeedbackVaryings"))==NULL) return;
  if((glGetTransformFeedbackVarying = LoadGLFunction<PFNGLGETTRANSFORMFEEDBACKVARYINGPROC>("glGetTransformFeedbackVarying"))==NULL) return;
  if((glVertexAttribIPointer = LoadGLFunction<PFNGLVERTEXATTRIBIPOINTERPROC>("glVertexAttribIPointer"))==NULL) return;
  if((glGetVertexAttribIiv = LoadGLFunction<PFNGLGETVERTEXATTRIBIIVPROC>("glGetVertexAttribIiv"))==NULL) return;
  if((glGetVertexAttribIuiv = LoadGLFunction<PFNGLGETVERTEXATTRIBIUIVPROC>("glGetVertexAttribIuiv"))==NULL) return;
  if((glVertexAttribI4i = LoadGLFunction<PFNGLVERTEXATTRIBI4IPROC>("glVertexAttribI4i"))==NULL) return;
  if((glVertexAttribI4ui = LoadGLFunction<PFNGLVERTEXATTRIBI4UIPROC>("glVertexAttribI4ui"))==NULL) return;
  if((glVertexAttribI4iv = LoadGLFunction<PFNGLVERTEXATTRIBI4IVPROC>("glVertexAttribI4iv"))==NULL) return;
  if((glVertexAttribI4uiv = LoadGLFunction<PFNGLVERTEXATTRIBI4UIVPROC>("glVertexAttribI4uiv"))==NULL) return;
  if((glGetUniformuiv = LoadGLFunction<PFNGLGETUNIFORMUIVPROC>("glGetUniformuiv"))==NULL) return;
  if((glGetFragDataLocation = LoadGLFunction<PFNGLGETFRAGDATALOCATIONPROC>("glGetFragDataLocation"))==NULL) return;
  if((glUniform1ui = LoadGLFunction<PFNGLUNIFORM1UIPROC>("glUniform1ui"))==NULL) return;
  if((glUniform2ui = LoadGLFunction<PFNGLUNIFORM2UIPROC>("glUniform2ui"))==NULL) return;
  if((glUniform3ui = LoadGLFunction<PFNGLUNIFORM3UIPROC>("glUniform3ui"))==NULL) return;
  if((glUniform4ui = LoadGLFunction<PFNGLUNIFORM4UIPROC>("glUniform4ui"))==NULL) return;
  if((glUniform1uiv = LoadGLFunction<PFNGLUNIFORM1UIVPROC>("glUniform1uiv"))==NULL) return;
  if((glUniform2uiv = LoadGLFunction<PFNGLUNIFORM2UIVPROC>("glUniform2uiv"))==NULL) return;
  if((glUniform3uiv = LoadGLFunction<PFNGLUNIFORM3UIVPROC>("glUniform3uiv"))==NULL) return;
  if((glUniform4uiv = LoadGLFunction<PFNGLUNIFORM4UIVPROC>("glUniform4uiv"))==NULL) return;
  if((glClearBufferiv = LoadGLFunction<PFNGLCLEARBUFFERIVPROC>("glClearBufferiv"))==NULL) return;
  if((glClearBufferuiv = LoadGLFunction<PFNGLCLEARBUFFERUIVPROC>("glClearBufferuiv"))==NULL) return;
  if((glClearBufferfv = LoadGLFunction<PFNGLCLEARBUFFERFVPROC>("glClearBufferfv"))==NULL) return;
  if((glClearBufferfi = LoadGLFunction<PFNGLCLEARBUFFERFIPROC>("glClearBufferfi"))==NULL) return;
  if((glGetStringi = LoadGLFunction<PFNGLGETSTRINGIPROC>("glGetStringi"))==NULL) return;
  if((glCopyBufferSubData = LoadGLFunction<PFNGLCOPYBUFFERSUBDATAPROC>("glCopyBufferSubData"))==NULL) return;
  if((glGetUniformIndices = LoadGLFunction<PFNGLGETUNIFORMINDICESPROC>("glGetUniformIndices"))==NULL) return;
  if((glGetActiveUniformsiv = LoadGLFunction<PFNGLGETACTIVEUNIFORMSIVPROC>("glGetActiveUniformsiv"))==NULL) return;
  if((glGetUniformBlockIndex = LoadGLFunction<PFNGLGETUNIFORMBLOCKINDEXPROC>("glGetUniformBlockIndex"))==NULL) return;
  if((glGetActiveUniformBlockiv = LoadGLFunction<PFNGLGETACTIVEUNIFORMBLOCKIVPROC>("glGetActiveUniformBlockiv"))==NULL) return;
  if((glGetActiveUniformBlockName = LoadGLFunction<PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC>("glGetActiveUniformBlockName"))==NULL) return;
  if((glUniformBlockBinding = LoadGLFunction<PFNGLUNIFORMBLOCKBINDINGPROC>("glUniformBlockBinding"))==NULL) return;
  if((glDrawArraysInstanced = LoadGLFunction<PFNGLDRAWARRAYSINSTANCEDPROC>("glDrawArraysInstanced"))==NULL) return;
  if((glDrawElementsInstanced = LoadGLFunction<PFNGLDRAWELEMENTSINSTANCEDPROC>("glDrawElementsInstanced"))==NULL) return;
  if((glFenceSync = LoadGLFunction<PFNGLFENCESYNCPROC>("glFenceSync"))==NULL) return;
  if((glIsSync = LoadGLFunction<PFNGLISSYNCPROC>("glIsSync"))==NULL) return;
  if((glDeleteSync = LoadGLFunction<PFNGLDELETESYNCPROC>("glDeleteSync"))==NULL) return;
  if((glClientWaitSync = LoadGLFunction<PFNGLCLIENTWAITSYNCPROC>("glClientWaitSync"))==NULL) return;
  if((glWaitSync = LoadGLFunction<PFNGLWAITSYNCPROC>("glWaitSync"))==NULL) return;
  if((glGetInteger64v = LoadGLFunction<PFNGLGETINTEGER64VPROC>("glGetInteger64v"))==NULL) return;
  if((glGetSynciv = LoadGLFunction<PFNGLGETSYNCIVPROC>("glGetSynciv"))==NULL) return;
  if((glGetInteger64i_v = LoadGLFunction<PFNGLGETINTEGER64I_VPROC>("glGetInteger64i_v"))==NULL) return;
  if((glGetBufferParameteri64v = LoadGLFunction<PFNGLGETBUFFERPARAMETERI64VPROC>("glGetBufferParameteri64v"))==NULL) return;
  if((glGenSamplers = LoadGLFunction<PFNGLGENSAMPLERSPROC>("glGenSamplers"))==NULL) return;
  if((glDeleteSamplers = LoadGLFunction<PFNGLDELETESAMPLERSPROC>("glDeleteSamplers"))==NULL) return;
  if((glIsSampler = LoadGLFunction<PFNGLISSAMPLERPROC>("glIsSampler"))==NULL) return;
  if((glBindSampler = LoadGLFunction<PFNGLBINDSAMPLERPROC>("glBindSampler"))==NULL) return;
  if((glSamplerParameteri = LoadGLFunction<PFNGLSAMPLERPARAMETERIPROC>("glSamplerParameteri"))==NULL) return;
  if((glSamplerParameteriv = LoadGLFunction<PFNGLSAMPLERPARAMETERIVPROC>("glSamplerParameteriv"))==NULL) return;
  if((glSamplerParameterf = LoadGLFunction<PFNGLSAMPLERPARAMETERFPROC>("glSamplerParameterf"))==NULL) return;
  if((glSamplerParameterfv = LoadGLFunction<PFNGLSAMPLERPARAMETERFVPROC>("glSamplerParameterfv"))==NULL) return;
  if((glGetSamplerParameteriv = LoadGLFunction<PFNGLGETSAMPLERPARAMETERIVPROC>("glGetSamplerParameteriv"))==NULL) return;
  if((glGetSamplerParameterfv = LoadGLFunction<PFNGLGETSAMPLERPARAMETERFVPROC>("glGetSamplerParameterfv"))==NULL) return;
  if((glVertexAttribDivisor = LoadGLFunction<PFNGLVERTEXATTRIBDIVISORPROC>("glVertexAttribDivisor"))==NULL) return;
  if((glBindTransformFeedback = LoadGLFunction<PFNGLBINDTRANSFORMFEEDBACKPROC>("glBindTransformFeedback"))==NULL) return;
  if((glDeleteTransformFeedbacks = LoadGLFunction<PFNGLDELETETRANSFORMFEEDBACKSPROC>("glDeleteTransformFeedbacks"))==NULL) return;
  if((glGenTransformFeedbacks = LoadGLFunction<PFNGLGENTRANSFORMFEEDBACKSPROC>("glGenTransformFeedbacks"))==NULL) return;
  if((glIsTransformFeedback = LoadGLFunction<PFNGLISTRANSFORMFEEDBACKPROC>("glIsTransformFeedback"))==NULL) return;
  if((glPauseTransformFeedback = LoadGLFunction<PFNGLPAUSETRANSFORMFEEDBACKPROC>("glPauseTransformFeedback"))==NULL) return;
  if((glResumeTransformFeedback = LoadGLFunction<PFNGLRESUMETRANSFORMFEEDBACKPROC>("glResumeTransformFeedback"))==NULL) return;
  if((glGetProgramBinary = LoadGLFunction<PFNGLGETPROGRAMBINARYPROC>("glGetProgramBinary"))==NULL) return;
  if((glProgramBinary = LoadGLFunction<PFNGLPROGRAMBINARYPROC>("glProgramBinary"))==NULL) return;
  if((glProgramParameteri = LoadGLFunction<PFNGLPROGRAMPARAMETERIPROC>("glProgramParameteri"))==NULL) return;
  if((glInvalidateFramebuffer = LoadGLFunction<PFNGLINVALIDATEFRAMEBUFFERPROC>("glInvalidateFramebuffer"))==NULL) return;
  if((glInvalidateSubFramebuffer = LoadGLFunction<PFNGLINVALIDATESUBFRAMEBUFFERPROC>("glInvalidateSubFramebuffer"))==NULL) return;
  if((glTexStorage2D = LoadGLFunction<PFNGLTEXSTORAGE2DPROC>("glTexStorage2D"))==NULL) return;
  if((glTexStorage3D = LoadGLFunction<PFNGLTEXSTORAGE3DPROC>("glTexStorage3D"))==NULL) return;
  if((glGetInternalformativ = LoadGLFunction<PFNGLGETINTERNALFORMATIVPROC>("glGetInternalformativ"))==NULL) return;
  g_initialized = true;
}

bool LoadGLFunctions(void)
{
  if(pthread_once(&g_once, LoadGLFunctionsInternal) == 0)
    return g_initialized;
  return false;
}

} // namespace GLES3


text:
(function() {

  angular
    .module( "app" )
    .component( "dynamicTabs", {

    bindings: {},
    templateUrl: 'dynamicTabs.html',
    controller: DynamicTabsController,
    controllerAs: "vm",

  });

  DynamicTabsController.$inject = [ ];
  function DynamicTabsController() {

    var vm    = this;

    // Initial state.
    vm.tabs = [ ];  // To hold the registered tabs.

    // Expose the public methods.
    vm.setSelected = setSelected;
    vm.addTab      = addTab;

    // ---
    // PUBLIC METHODS.
    // ---

    // I update the selected tab and tab.
    function setSelected( tab ) {

      // Set all the tabs to the "not selected" state.
      angular.forEach( vm.tabs, function( each ) {

        each.selected = false;

      });

      // Set the specified tab to the "selected" state.
      tab.selected = true;

    }

    /**
     * Register the specified tab.
     * @param  Tab data (child component's scope)
     */
    function addTab( tab ) {

      // Select the first tab when the page is loaded.
      if ( vm.tabs.length === 0 ) {
        vm.setSelected( tab );
      }

      // Add the specified tab to the list.
      vm.tabs.push( tab );

    }

  } // end DynamicTabsController

  // --------------------------------------------------------------------------- //
  // --------------------------------------------------------------------------- //

  /**
   * tab
   * - Only one selected tab will be displayed at a time.
   * - Transcluded into dynamicTabs component.
   * --
   * REQUIREMENTS:
   * - The dynamicTabs component as a parent.
   * - The label attribute must be passed in.
   * e.g., <tab label="World tab"></tab>
   */
  angular
    .module( "app" )
    .directive( "tab", tab );

  function tab() {

    var directive = {
      require: "^dynamicTabs",  // Mix in its parent component.

      restrict: "E",
      transclude: true,
      scope: {
        label: "@"
      },
      template: '<ng-transclude ng-show="selected"></ng-transclude>',
      link: link,
    };

    return directive;

    /**
     * When a new tab is created, register that tab in the dynamicTabs component's list.
     */
    function link( scope, element, attrs, tabsCtrl ) {

      // Call tabs's addTab function passing in this scope.
      tabsCtrl.addTab( scope );

    }

    // NOTE: When a directive requires a controller, its link function receives
    // that controller as the fourth argument.
    // Taking advantage of this, tab can call the addTab function of tabs.

  } // end tab

})();


text:
import {Component} from 'angular2/core';
import {ProductListComponent} from './products/product-list.component';
import {ProductDetailComponent} from './products/product-detail.component';
import {ProductService} from './products/product.service';
import {HTTP_PROVIDERS} from 'angular2/http';
import {ROUTER_PROVIDERS,RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {WelcomeComponent} from './home/welcome.component';
import 'rxjs/Rx';

@Component({
    selector: 'pm-app',
    template: `

		{{pageTitle}}

Home

Product List

	    <router-outlet></router-outlet>

	`,
	directives: [ROUTER_DIRECTIVES],
	providers: [ProductService, HTTP_PROVIDERS, ROUTER_PROVIDERS]
	})
@RouteConfig([
    {path: '/welcome', name: 'Welcome', component: WelcomeComponent, useAsDefault: true},
    {path: '/products' name: 'Products' component: ProductListComponent},
    {path: '/product/:id' name: 'ProductDetail' component: ProductDetailComponent}
])

export class AppComponent {
    pageTitle:string = 'Acme Product Management';
    }


text:
package net.evolutionaryarchitecture.jpa.querying;

import java.sql.Date;

import net.evolutionaryarchitecture.jpa.querying.Conference;
import net.evolutionaryarchitecture.jpa.querying.EventRepository;
import net.evolutionaryarchitecture.jpa.querying.OnsiteCourse;
import net.evolutionaryarchitecture.jpa.querying.Person;
import net.evolutionaryarchitecture.jpa.querying.PublicCourse;

public class LabDataHelper {

	public static void createDefaultDataSet(EventRepository eventRepo) {

		// Add some events
		Long eventId1 = eventRepo.registerNewEvent(new Conference("JavaZone", Date
				.valueOf("2009-08-21"), "Stockholm Globe Arena"));
		Long eventId2 = eventRepo.registerNewEvent(new OnsiteCourse("Hibernate In Essence",
				Date.valueOf("2011-02-25"), "Marten Haglind", "Oracle"));
		Long eventId3 = eventRepo.registerNewEvent(new PublicCourse("Core Spring", Date
				.valueOf("2011-04-25"), "Christian Bale",
				"Geita, Programutvikling"));
		Long eventId4 = eventRepo.registerNewEvent(new OnsiteCourse("Spring and Housecleaning",
				Date.valueOf("2011-01-03"), "Tore Skogman", "Telenor"));
		Long eventId5 = eventRepo.registerNewEvent(new PublicCourse("Core Fall", Date
				.valueOf("2011-02-25"), "Nils Karlsson",
				"Holsa, Programutvikling"));
		Long eventId6 = eventRepo.registerNewEvent(new Conference("Scandinavian Developer Conference 2011", Date
				.valueOf("2011-03-03"), "Svenska Massan"));
		Long eventId7 = eventRepo.registerNewEvent(new Conference("JavaOne", Date
				.valueOf("2008-09-28"), "Moscone Center"));

		// Add some users
		Person user1 = eventRepo.registerNewUser("Kalle", "Karlsson");
		eventRepo.addNewAddressForUser(user1.getId(), "Andra Langgatan 1", "Goteborg", "123", "Sverige");
		eventRepo.addNewEmailForUser(user1.getId(), "kalle@karlsson.se");

		Person user2 = eventRepo.registerNewUser("Eva", "Larsson");
		eventRepo.addNewAddressForUser(user2.getId(), "Storveien 4", "Oslo", "456", "Norge");
		eventRepo.addNewEmailForUser(user2.getId(), "eva@larsson.no");
		eventRepo.addNewEmailForUser(user2.getId(), "nospam@google.com");

		Person user3 = eventRepo.registerNewUser("Erik", "Eriksson");
		eventRepo.addNewAddressForUser(user3.getId(), "Main Street 1", "Los Angeles", "1212", "USA");
		eventRepo.addNewAddressForUser(user3.getId(), "West Burbington Lane 43", "London", "754", "UK");
		eventRepo.addNewEmailForUser(user3.getId(), "erik@apple.com");

		// Register users for some events
		eventRepo.registerForEvent(user1.getId(), eventId1);
		eventRepo.registerForEvent(user1.getId(), eventId6);
		eventRepo.registerForEvent(user1.getId(), eventId5);

		eventRepo.registerForEvent(user2.getId(), eventId1);
		eventRepo.registerForEvent(user2.getId(), eventId2);
		eventRepo.registerForEvent(user2.getId(), eventId7);

		eventRepo.registerForEvent(user3.getId(), eventId2);
		eventRepo.registerForEvent(user3.getId(), eventId3);
		eventRepo.registerForEvent(user3.getId(), eventId4);
		eventRepo.registerForEvent(user3.getId(), eventId5);

	}

}


text:
package org.atdl4j.ui.app.impl;

import java.util.List;
import java.util.Vector;

import org.atdl4j.config.Atdl4jOptions;
import org.atdl4j.ui.app.FixMsgLoadPanel;
import org.atdl4j.ui.app.FixMsgLoadPanelListener;

/**
 * Represents the base, non-GUI system-specific tester's "Load Message" button and text field GUI component.
 *
 * @author Scott Atwell
 * @version 1.0, Feb 28, 2010
 */
public abstract class AbstractFixMsgLoadPanel
		implements FixMsgLoadPanel
{
	private Atdl4jOptions atdl4jOptions = null;

	private List<FixMsgLoadPanelListener> listenerList = new Vector<FixMsgLoadPanelListener>();

	/**
	 * @param atdl4jOptions the atdl4jOptions to set
	 */
	protected void setAtdl4jOptions(Atdl4jOptions atdl4jOptions)
	{
		this.atdl4jOptions = atdl4jOptions;
	}

	/**
	 * @return the atdl4jOptions
	 */
	public Atdl4jOptions getAtdl4jOptions()
	{
		return atdl4jOptions;
	}

	public void addListener( FixMsgLoadPanelListener aFixMsgLoadPanelListener )
	{
		listenerList.add( aFixMsgLoadPanelListener );
	}

	public void removeListener( FixMsgLoadPanelListener aFixMsgLoadPanelListener )
	{
		listenerList.remove( aFixMsgLoadPanelListener );
	}

	protected void fireFixMsgLoadSelectedEvent( String aFixMsg )
	{
		for ( FixMsgLoadPanelListener tempListener : listenerList )
		{
			tempListener.fixMsgLoadSelected( aFixMsg );
		}
	}
}


text:
kubectl create configmap red --from-file=red-files/index.html
kubectl create configmap blue --from-file=blue-files/index.html


text:
package com.defano.wyldcard.effect;

import com.defano.hypertalk.ast.model.effect.VisualEffectImage;
import com.defano.hypertalk.ast.model.specifier.VisualEffectSpecifier;
import com.defano.jmonet.transform.image.ApplyPixelTransform;
import com.defano.jmonet.transform.pixel.InvertPixelTransform;
import com.defano.jsegue.AnimatedSegue;
import com.defano.jsegue.renderers.*;
import com.defano.wyldcard.runtime.ExecutionContext;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * A factory of HyperCard visual effects.
 */
public class VisualEffectFactory {

    public static AnimatedSegue create(VisualEffectSpecifier effectSpecifier, BufferedImage from, BufferedImage to) {
        try {
            AnimatedSegue effect = effectSpecifier.effect.newInstance();
            effect.setSource(from);
            effect.setOverlay(requiresOverlay(effect));
            effect.setDestination(effectImage(effectSpecifier.image, to));
            effect.setDurationMs(effectSpecifier.speed.durationMs);

            return effect;
        } catch (IllegalAccessException | InstantiationException e) {
            throw new IllegalStateException("Bug! Visual effect renderer class cannot be instantiated.", e);
        }
    }

    public static PlainEffect createScreenLock(ExecutionContext context) {
        BufferedImage screenShot = context.getCurrentStack().getDisplayedCard().getScreenshot();

        PlainEffect effect = new PlainEffect();
        effect.setSource(screenShot);
        effect.setDestination(screenShot);     // Ignored; never visible
        effect.setFps(1);
        effect.setDurationMs(Integer.MAX_VALUE);
        return effect;
    }

    private static BufferedImage effectImage(VisualEffectImage image, BufferedImage to) {
        switch (image) {
            case BLACK:
                return solidColorImage(to.getWidth(), to.getHeight(), Color.BLACK);
            case GRAY:
                return solidColorImage(to.getWidth(), to.getHeight(), Color.GRAY);
            case CARD:
                return to;
            case WHITE:
                return solidColorImage(to.getWidth(), to.getHeight(), Color.WHITE);
            case INVERSE:
                return new ApplyPixelTransform(new InvertPixelTransform()).apply(to);
            default:
                throw new IllegalArgumentException("Bug! Not implemented: " + image);
        }
    }

    private static BufferedImage solidColorImage(int width, int height, Color color) {
        BufferedImage solid = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics2D g = solid.createGraphics();
        g.setPaint(color);
        g.fillRect(0, 0, width, height);
        g.dispose();
        return solid;
    }

    private static boolean requiresOverlay(AnimatedSegue effect) {
        return effect instanceof WipeRightEffect ||
                effect instanceof WipeLeftEffect ||
                effect instanceof WipeUpEffect ||
                effect instanceof WipeDownEffect;
    }

}


text:
module.exports = {
	process: async message => {
		let updateInfo = bot.config.bot.updates;
		if(bot.config.beta) return "This is the beta bot!";
		else if(!updateInfo) return "No update object was set in the config";
		else if(!updateInfo.channel) return "A channel id to release the updates in has not been set in the config";
		else if(!updateInfo.guild) return "A guild id which the updates role belongs to has not been set in the config";
		else if(!updateInfo.role) return "An updates role has not been set in the config";

		try {
			await bot.editRole(updateInfo.guild, updateInfo.role, { mentionable: true });
			await bot.createMessage(updateInfo.channel,
				`<@&${updateInfo.role}>\n${bot.utils.codeBlock(message.args[0], "diff")}`);
			await bot.editRole(updateInfo.guild, updateInfo.role, { mentionable: false });
			return "Update released";
		} catch(err) {
			return `Error during releasing update: ${err.message}`;
		}
	},
	caseSensitive: true,
	description: "Release an update",
	args: [{
		type: "text",
		label: "update"
	}]
};


text:
Simple and fast way to use Vue.js with Ruby on Rails and Turbolinks 5.

This gem is fantastic to sprinkle your web page with Vue components. Lightweight script (1KB minified) that mounts and destroys Vue components on demand.

It works nicely with:
- Turbolinks rendering and caching system
- Javascript loaded asynchronously with defer or async script attribute

It's fully Google PageSpeed friendly since you can use it with defer or async, no need for render-blocking JavaScript :)

If you are building a pure SPA app with Vue and Rails without Turbolinks, you will be better off looking into:
https://github.com/adambutler/vuejs-rails

## Requirements

- [Vue.js](https://vuejs.org/v2/guide/installation.html) >= 2.0
- [Turbolinks](https://github.com/turbolinks/turbolinks) >= 5.0

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'vue_on_rails'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install vue_on_rails

## Usage

Require vue_on_rails in application.js
```
//= require vue_on_rails
```

Mount and destroy Vue components:
```
# Mount Vue components
document.addEventListener('turbolinks:load', function() {
  VueOnRails.mountComponents();
});

# Destroy Vue components
document.addEventListener('turbolinks:before-render', function() {
  VueOnRails.destroyComponents();
});
```
VueOnRails.mountComponents() will scan the page and mount components using data-vue-component and data-vue-props.

Example Vue component in my_component.js
```
MyComponent = {
  props: ['myProp'],
  template: '<div>A custom component with {{myProp}}</div>'
};
```

Add component in view.html.erb
```
<%= vue_component 'MyComponent', my_prop: 'awesome prop!' %>
<!-- This will output -->
<div data-vue-component="MyComponent" data-vue-props="{"my-prop":"awesome prop!"}">
   <div>A custom component with awesome prop!</div>
</div>
```

## View Helper
A view helper generate a div with component and props:
```
def vue_component(component_name, props = {}, html_options = {})
```
Example with html tag:
```
<%= vue_component 'UserComponent', { user_id: 1 }, { class: 'd-inline-block align-middle' } %>
<!-- Becomes: -->
<div data-vue-component="UserComponent" data-vue-props="{'user-id': 1}" class="d-inline-block align-middle">
...
</div>
```

## Props

### Kebab-case (hyphen-delimited)

Props are automatically hyphen-delimited to follow vuejs and HTML5 standard.

### Dynamic props
```
<%= vue_component 'MessageComponent', ':my_object': { title: 'Test', subtitle: 'Sweet!' } %>
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/benoitontgit/vue-on-rails.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
package org.normandra.orientdb.data.impl;

import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultSet;
import org.normandra.NormandraException;
import org.normandra.data.DataHolder;
import org.normandra.meta.EntityMeta;
import org.normandra.orientdb.data.OrientDatabaseSession;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * a lazy-loaded orientdb data holder based on query string
 * <p>
 * Date: 4/5/14
 */
public class OrientLazyQueryHolder implements DataHolder {
    private final AtomicBoolean loaded = new AtomicBoolean(false);

    private final OrientDatabaseSession session;

    private final EntityMeta entity;

    private final boolean collection;

    private final String query;

    private final List<Object> parameters;

    private final OrientDocumentHandler handler;

    private final List<ODocument> documents = new ArrayList<>();

    public OrientLazyQueryHolder(final OrientDatabaseSession session, final EntityMeta meta, final boolean collection, final String query, final List<Object> params, final OrientDocumentHandler handler) {
        this.session = session;
        this.entity = meta;
        this.collection = collection;
        this.query = query;
        this.parameters = new ArrayList<>(params);
        this.handler = handler;
    }

    @Override
    public boolean isEmpty() {
        try {
            return this.ensureResults().isEmpty();
        } catch (final Exception e) {
            throw new IllegalStateException("Unable to query lazy loaded results from [" + this.entity + "].", e);
        }
    }

    @Override
    public Object get() throws NormandraException {
        final Collection<ODocument> results = this.ensureResults();
        if (null == results || results.isEmpty()) {
            return null;
        }
        try {
            if (this.collection) {
                final List<Object> items = new ArrayList<>(results.size());
                for (final ODocument doc : results) {
                    final Object item = this.handler.convert(doc);
                    if (item != null) {
                        items.add(item);
                    }
                }
                return Collections.unmodifiableCollection(items);
            } else {
                return this.handler.convert(results.iterator().next());
            }
        } catch (final Exception e) {
            throw new NormandraException("Unable to toEntity lazy loaded results for entity [" + this.entity + "].", e);
        }
    }

    private List<ODocument> ensureResults() throws NormandraException {
        if (this.loaded.get()) {
            return Collections.unmodifiableList(this.documents);
        }

        try {
            this.documents.clear();
            try (final OResultSet results = this.session.database().query(this.query, parameters.toArray())) {
                while (results.hasNext()) {
                    final OResult item = results.next();
                    if (item.isRecord()) {
                        final ODocument doc = this.session.database().load(item.getRecord().get());
                        if (doc != null) {
                            this.documents.add(doc);
                        }
                    }
                }
            }
            this.loaded.getAndSet(true);
        } catch (final Exception e) {
            throw new NormandraException("Unable to get orientdb document by query [" + this.query + "].", e);
        }
        return Collections.unmodifiableList(this.documents);
    }
}


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

<title>P-Index</title>
<meta name="date" content="2013-08-09">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E G H I L M N O P R S T U W Z

P

parseString(String) - Method in class com.ucsoftwareeng.herald.SmsService

phone_hint - Static variable in class com.ucsoftwareeng.herald.R.string

PICK_CONTACT - Static variable in class com.ucsoftwareeng.herald.MainActivity

pMgr - Variable in class com.ucsoftwareeng.herald.MainActivity

A B C D E G H I L M N O P R S T U W Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
"""
RAR parser

Status: can only read higher-level attructures
Author: Christophe Gisquet
"""

from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (StaticFieldSet, FieldSet,
    Bit, Bits, Enum,
    UInt8, UInt16, UInt32, UInt64,
    String, TimeDateMSDOS32,
    NullBytes, NullBits, RawBytes)
from lib.hachoir_core.text_handler import textHandler, filesizeHandler, hexadecimal
from lib.hachoir_core.endian import LITTLE_ENDIAN
from lib.hachoir_parser.common.msdos import MSDOSFileAttr32

MAX_FILESIZE = 1000 * 1024 * 1024

BLOCK_NAME = {
    0x72: "Marker",
    0x73: "Archive",
    0x74: "File",
    0x75: "Comment",
    0x76: "Extra info",
    0x77: "Subblock",
    0x78: "Recovery record",
    0x79: "Archive authenticity",
    0x7A: "New-format subblock",
    0x7B: "Archive end",
}

COMPRESSION_NAME = {
    0x30: "Storing",
    0x31: "Fastest compression",
    0x32: "Fast compression",
    0x33: "Normal compression",
    0x34: "Good compression",
    0x35: "Best compression"
}

OS_MSDOS = 0
OS_WIN32 = 2
OS_NAME = {
    0: "MS DOS",
    1: "OS/2",
    2: "Win32",
    3: "Unix",
}

DICTIONARY_SIZE = {
    0: "Dictionary size 64 Kb",
    1: "Dictionary size 128 Kb",
    2: "Dictionary size 256 Kb",
    3: "Dictionary size 512 Kb",
    4: "Dictionary size 1024 Kb",
    7: "File is a directory",
}

def formatRARVersion(field):
    """
    Decodes the RAR version stored on 1 byte
    """
    return "%u.%u" % divmod(field.value, 10)

def commonFlags(s):
    yield Bit(s, "has_added_size", "Additional field indicating additional size")
    yield Bit(s, "is_ignorable", "Old versions of RAR should ignore this block when copying data")

class ArchiveFlags(StaticFieldSet):
    format = (
        (Bit, "vol", "Archive volume"),
        (Bit, "has_comment", "Whether there is a comment"),
        (Bit, "is_locked", "Archive volume"),
        (Bit, "is_solid", "Whether files can be extracted separately"),
        (Bit, "new_numbering", "New numbering, or compressed comment"), # From unrar
        (Bit, "has_authenticity_information", "The integrity/authenticity of the archive can be checked"),
        (Bit, "is_protected", "The integrity/authenticity of the archive can be checked"),
        (Bit, "is_passworded", "Needs a password to be decrypted"),
        (Bit, "is_first_vol", "Whether it is the first volume"),
        (Bit, "is_encrypted", "Whether the encryption version is present"),
        (NullBits, "internal", 6, "Reserved for 'internal use'")
    )

def archiveFlags(s):
    yield ArchiveFlags(s, "flags", "Archiver block flags")

def archiveHeader(s):
    yield NullBytes(s, "reserved[]", 2, "Reserved word")
    yield NullBytes(s, "reserved[]", 4, "Reserved dword")

def commentHeader(s):
    yield filesizeHandler(UInt16(s, "total_size", "Comment header size + comment size"))
    yield filesizeHandler(UInt16(s, "uncompressed_size", "Uncompressed comment size"))
    yield UInt8(s, "required_version", "RAR version needed to extract comment")
    yield UInt8(s, "packing_method", "Comment packing method")
    yield UInt16(s, "comment_crc16", "Comment CRC")

def commentBody(s):
    size = s["total_size"].value - s.current_size
    if size > 0:
        yield RawBytes(s, "comment_data", size, "Compressed comment data")

def signatureHeader(s):
    yield TimeDateMSDOS32(s, "creation_time")
    yield filesizeHandler(UInt16(s, "arc_name_size"))
    yield filesizeHandler(UInt16(s, "user_name_size"))

def recoveryHeader(s):
    yield filesizeHandler(UInt32(s, "total_size"))
    yield textHandler(UInt8(s, "version"), hexadecimal)
    yield UInt16(s, "rec_sectors")
    yield UInt32(s, "total_blocks")
    yield RawBytes(s, "mark", 8)

def avInfoHeader(s):
    yield filesizeHandler(UInt16(s, "total_size", "Total block size"))
    yield UInt8(s, "version", "Version needed to decompress", handler=hexadecimal)
    yield UInt8(s, "method", "Compression method", handler=hexadecimal)
    yield UInt8(s, "av_version", "Version for AV", handler=hexadecimal)
    yield UInt32(s, "av_crc", "AV info CRC32", handler=hexadecimal)

def avInfoBody(s):
    size = s["total_size"].value - s.current_size
    if size > 0:
        yield RawBytes(s, "av_info_data", size, "AV info")

class FileFlags(FieldSet):
    static_size = 16
    def createFields(self):
        yield Bit(self, "continued_from", "File continued from previous volume")
        yield Bit(self, "continued_in", "File continued in next volume")
        yield Bit(self, "is_encrypted", "File encrypted with password")
        yield Bit(self, "has_comment", "File comment present")
        yield Bit(self, "is_solid", "Information from previous files is used (solid flag)")
        # The 3 following lines are what blocks more staticity
        yield Enum(Bits(self, "dictionary_size", 3, "Dictionary size"), DICTIONARY_SIZE)
        for bit in commonFlags(self):
            yield bit
        yield Bit(self, "is_large", "file64 operations needed")
        yield Bit(self, "is_unicode", "Filename also encoded using Unicode")
        yield Bit(self, "has_salt", "Has salt for encryption")
        yield Bit(self, "uses_file_version", "File versioning is used")
        yield Bit(self, "has_ext_time", "Extra time ??")
        yield Bit(self, "has_ext_flags", "Extra flag ??")

def fileFlags(s):
    yield FileFlags(s, "flags", "File block flags")

class ExtTime(FieldSet):
    def createFields(self):
        yield textHandler(UInt16(self, "time_flags", "Flags for extended time"), hexadecimal)
        flags = self["time_flags"].value
        for index in xrange(4):
            rmode = flags >> ((3-index)*4)
            if rmode & 8:
                if index:
                    yield TimeDateMSDOS32(self, "dos_time[]", "DOS Time")
                if rmode & 3:
                    yield RawBytes(self, "remainder[]", rmode & 3, "Time remainder")

def specialHeader(s, is_file):
    yield filesizeHandler(UInt32(s, "compressed_size", "Compressed size (bytes)"))
    yield filesizeHandler(UInt32(s, "uncompressed_size", "Uncompressed size (bytes)"))
    yield Enum(UInt8(s, "host_os", "Operating system used for archiving"), OS_NAME)
    yield textHandler(UInt32(s, "crc32", "File CRC32"), hexadecimal)
    yield TimeDateMSDOS32(s, "ftime", "Date and time (MS DOS format)")
    yield textHandler(UInt8(s, "version", "RAR version needed to extract file"), formatRARVersion)
    yield Enum(UInt8(s, "method", "Packing method"), COMPRESSION_NAME)
    yield filesizeHandler(UInt16(s, "filename_length", "File name size"))
    if s["host_os"].value in (OS_MSDOS, OS_WIN32):
        yield MSDOSFileAttr32(s, "file_attr", "File attributes")
    else:
        yield textHandler(UInt32(s, "file_attr", "File attributes"), hexadecimal)

    # Start additional field from unrar
    if s["flags/is_large"].value:
        yield filesizeHandler(UInt64(s, "large_size", "Extended 64bits filesize"))

    # End additional field
    size = s["filename_length"].value
    if size > 0:
        if s["flags/is_unicode"].value:
            charset = "UTF-8"
        else:
            charset = "ISO-8859-15"
        yield String(s, "filename", size, "Filename", charset=charset)
    # Start additional fields from unrar - file only
    if is_file:
        if s["flags/has_salt"].value:
            yield textHandler(UInt8(s, "salt", "Salt"), hexadecimal)
        if s["flags/has_ext_time"].value:
            yield ExtTime(s, "extra_time", "Extra time info")

def fileHeader(s):
    return specialHeader(s, True)

def fileBody(s):
    # File compressed data
    size = s["compressed_size"].value
    if s["flags/is_large"].value:
        size += s["large_size"].value
    if size > 0:
        yield RawBytes(s, "compressed_data", size, "File compressed data")

def fileDescription(s):
    return "File entry: %s (%s)" % \
           (s["filename"].display, s["compressed_size"].display)

def newSubHeader(s):
    return specialHeader(s, False)

class EndFlags(StaticFieldSet):
    format = (
        (Bit, "has_next_vol", "Whether there is another next volume"),
        (Bit, "has_data_crc", "Whether a CRC value is present"),
        (Bit, "rev_space"),
        (Bit, "has_vol_number", "Whether the volume number is present"),
        (Bits, "unused[]", 4),
        (Bit, "has_added_size", "Additional field indicating additional size"),
        (Bit, "is_ignorable", "Old versions of RAR should ignore this block when copying data"),
        (Bits, "unused[]", 6),
    )

def endFlags(s):
    yield EndFlags(s, "flags", "End block flags")

class BlockFlags(FieldSet):
    static_size = 16

    def createFields(self):
        yield textHandler(Bits(self, "unused[]", 8, "Unused flag bits"), hexadecimal)
        yield Bit(self, "has_added_size", "Additional field indicating additional size")
        yield Bit(self, "is_ignorable", "Old versions of RAR should ignore this block when copying data")
        yield Bits(self, "unused[]", 6)

class Block(FieldSet):
    BLOCK_INFO = {
        # None means 'use default function'
        0x72: ("marker", "Archive header", None, None, None),
        0x73: ("archive_start", "Archive info", archiveFlags, archiveHeader, None),
        0x74: ("file[]", fileDescription, fileFlags, fileHeader, fileBody),
        0x75: ("comment[]", "Stray comment", None, commentHeader, commentBody),
        0x76: ("av_info[]", "Extra information", None, avInfoHeader, avInfoBody),
        0x77: ("sub_block[]", "Stray subblock", None, newSubHeader, fileBody),
        0x78: ("recovery[]", "Recovery block", None, recoveryHeader, None),
        0x79: ("signature", "Signature block", None, signatureHeader, None),
        0x7A: ("new_sub_block[]", "Stray new-format subblock", fileFlags,
               newSubHeader, fileBody),
        0x7B: ("archive_end", "Archive end block", endFlags, None, None),
    }

    def __init__(self, parent, name):
        FieldSet.__init__(self, parent, name)
        t = self["block_type"].value
        if t in self.BLOCK_INFO:
            self._name, desc, parseFlags, parseHeader, parseBody = self.BLOCK_INFO[t]
            if callable(desc):
                self.createDescription = lambda: desc(self)
            elif desc:
                self._description = desc
            if parseFlags    : self.parseFlags     = lambda: parseFlags(self)
            if parseHeader   : self.parseHeader    = lambda: parseHeader(self)
            if parseBody     : self.parseBody      = lambda: parseBody(self)
        else:
            self.info("Processing as unknown block block of type %u" % type)

        self._size = 8*self["block_size"].value
        if t == 0x74 or t == 0x7A:
            self._size += 8*self["compressed_size"].value
            if "is_large" in self["flags"] and self["flags/is_large"].value:
                self._size += 8*self["large_size"].value
        elif "has_added_size" in self:
            self._size += 8*self["added_size"].value
        # TODO: check if any other member is needed here

    def createFields(self):
        yield textHandler(UInt16(self, "crc16", "Block CRC16"), hexadecimal)
        yield textHandler(UInt8(self, "block_type", "Block type"), hexadecimal)

        # Parse flags
        for field in self.parseFlags():
            yield field

        # Get block size
        yield filesizeHandler(UInt16(self, "block_size", "Block size"))

        # Parse remaining header
        for field in self.parseHeader():
            yield field

        # Finish header with stuff of unknow size
        size = self["block_size"].value - (self.current_size//8)
        if size > 0:
            yield RawBytes(self, "unknown", size, "Unknow data (UInt32 probably)")

        # Parse body
        for field in self.parseBody():
            yield field

    def createDescription(self):
        return "Block entry: %s" % self["type"].display

    def parseFlags(self):
        yield BlockFlags(self, "flags", "Block header flags")

    def parseHeader(self):
        if "has_added_size" in self["flags"] and \
           self["flags/has_added_size"].value:
            yield filesizeHandler(UInt32(self, "added_size",
                "Supplementary block size"))

    def parseBody(self):
        """
        Parse what is left of the block
        """
        size = self["block_size"].value - (self.current_size//8)
        if "has_added_size" in self["flags"] and self["flags/has_added_size"].value:
            size += self["added_size"].value
        if size > 0:
            yield RawBytes(self, "body", size, "Body data")

class RarFile(Parser):
    MAGIC = "Rar!\x1A\x07\x00"
    PARSER_TAGS = {
        "id": "rar",
        "category": "archive",
        "file_ext": ("rar",),
        "mime": (u"application/x-rar-compressed", ),
        "min_size": 7*8,
        "magic": ((MAGIC, 0),),
        "description": "Roshal archive (RAR)",
    }
    endian = LITTLE_ENDIAN

    def validate(self):
        magic = self.MAGIC
        if self.stream.readBytes(0, len(magic)) != magic:
            return "Invalid magic"
        return True

    def createFields(self):
        while not self.eof:
            yield Block(self, "block[]")

    def createContentSize(self):
        start = 0
        end = MAX_FILESIZE * 8
        pos = self.stream.searchBytes("\xC4\x3D\x7B\x00\x40\x07\x00", start, end)
        if pos is not None:
            return pos + 7*8
        return None


text:
package net

import (
	"context"
	"sync"
)

var onceReadProtocols sync.Once

// readProtocols loads contents of /etc/protocols into protocols map
// for quick access.
func readProtocols() {
	if file, err := open("/etc/protocols"); err == nil {
		for line, ok := file.readLine(); ok; line, ok = file.readLine() {
			// tcp    6   TCP    # transmission control protocol
			if i := byteIndex(line, '#'); i >= 0 {
				line = line[0:i]
			}
			f := getFields(line)
			if len(f) < 2 {
				continue
			}
			if proto, _, ok := dtoi(f[1], 0); ok {
				if _, ok := protocols[f[0]]; !ok {
					protocols[f[0]] = proto
				}
				for _, alias := range f[2:] {
					if _, ok := protocols[alias]; !ok {
						protocols[alias] = proto
					}
				}
			}
		}
		file.close()
	}
}

// lookupProtocol looks up IP protocol name in /etc/protocols and
// returns correspondent protocol number.
func lookupProtocol(_ context.Context, name string) (int, error) {
	onceReadProtocols.Do(readProtocols)
	proto, found := protocols[name]
	if !found {
		return 0, &AddrError{Err: "unknown IP protocol specified", Addr: name}
	}
	return proto, nil
}

func lookupHost(ctx context.Context, host string) (addrs []string, err error) {
	order := systemConf().hostLookupOrder(host)
	if order == hostLookupCgo {
		if addrs, err, ok := cgoLookupHost(ctx, host); ok {
			return addrs, err
		}
		// cgo not available (or netgo); fall back to Go's DNS resolver
		order = hostLookupFilesDNS
	}
	return goLookupHostOrder(ctx, host, order)
}

func lookupIP(ctx context.Context, host string) (addrs []IPAddr, err error) {
	order := systemConf().hostLookupOrder(host)
	if order == hostLookupCgo {
		if addrs, err, ok := cgoLookupIP(ctx, host); ok {
			return addrs, err
		}
		// cgo not available (or netgo); fall back to Go's DNS resolver
		order = hostLookupFilesDNS
	}
	return goLookupIPOrder(ctx, host, order)
}

func lookupPort(ctx context.Context, network, service string) (int, error) {
	// TODO: use the context if there ever becomes a need. Related
	// is issue 15321. But port lookup generally just involves
	// local files, and the os package has no context support. The
	// files might be on a remote filesystem, though. This should
	// probably race goroutines if ctx != context.Background().
	if systemConf().canUseCgo() {
		if port, err, ok := cgoLookupPort(ctx, network, service); ok {
			return port, err
		}
	}
	return goLookupPort(network, service)
}

func lookupCNAME(ctx context.Context, name string) (string, error) {
	if systemConf().canUseCgo() {
		if cname, err, ok := cgoLookupCNAME(ctx, name); ok {
			return cname, err
		}
	}
	return goLookupCNAME(ctx, name)
}

func lookupSRV(ctx context.Context, service, proto, name string) (string, []*SRV, error) {
	var target string
	if service == "" && proto == "" {
		target = name
	} else {
		target = "_" + service + "._" + proto + "." + name
	}
	cname, rrs, err := lookup(ctx, target, dnsTypeSRV)
	if err != nil {
		return "", nil, err
	}
	srvs := make([]*SRV, len(rrs))
	for i, rr := range rrs {
		rr := rr.(*dnsRR_SRV)
		srvs[i] = &SRV{Target: rr.Target, Port: rr.Port, Priority: rr.Priority, Weight: rr.Weight}
	}
	byPriorityWeight(srvs).sort()
	return cname, srvs, nil
}

func lookupMX(ctx context.Context, name string) ([]*MX, error) {
	_, rrs, err := lookup(ctx, name, dnsTypeMX)
	if err != nil {
		return nil, err
	}
	mxs := make([]*MX, len(rrs))
	for i, rr := range rrs {
		rr := rr.(*dnsRR_MX)
		mxs[i] = &MX{Host: rr.Mx, Pref: rr.Pref}
	}
	byPref(mxs).sort()
	return mxs, nil
}

func lookupNS(ctx context.Context, name string) ([]*NS, error) {
	_, rrs, err := lookup(ctx, name, dnsTypeNS)
	if err != nil {
		return nil, err
	}
	nss := make([]*NS, len(rrs))
	for i, rr := range rrs {
		nss[i] = &NS{Host: rr.(*dnsRR_NS).Ns}
	}
	return nss, nil
}

func lookupTXT(ctx context.Context, name string) ([]string, error) {
	_, rrs, err := lookup(ctx, name, dnsTypeTXT)
	if err != nil {
		return nil, err
	}
	txts := make([]string, len(rrs))
	for i, rr := range rrs {
		txts[i] = rr.(*dnsRR_TXT).Txt
	}
	return txts, nil
}

func lookupAddr(ctx context.Context, addr string) ([]string, error) {
	if systemConf().canUseCgo() {
		if ptrs, err, ok := cgoLookupPTR(ctx, addr); ok {
			return ptrs, err
		}
	}
	return goLookupPTR(ctx, addr)
}


text:
require 'spec_helper'

describe FairRandom do
  describe 'Box' do
    Given(:box) { FairRandom::Box.new(element_type_count, box_capacity) }
    context 'box size == type count' do
      describe 'content count' do
        Given(:box_capacity) { 4 }
        Given(:element_type_count) { 2 }
        When(:box_contents) { box_capacity.times.map { box.next } }
        Then { box_contents.count_by(&1) == {0 => 2, 1 => 2} }
      end
      describe 'reset contents' do
        Given(:box_capacity) { 4 }
        Given(:element_type_count) { 2 }
        When(:box_contents) { (box_capacity * 2).times.map { box.next } }
        Then { box_contents.count_by(&1) == {0 => 4, 1 => 4} }
      end
    end
    context 'box size MOD type count != 0' do
      Given(:box_capacity) { 3 }
      Given(:element_type_count) { 2 }
      Then { expect{box}.to raise_error ArgumentError }
    end
    context 'serialize/deserialize with PORO' do
      Given(:box_capacity) { 4 }
      Given(:element_type_count) { 2 }
      Given(:poro) { box.to_poro }
      Given(:revived) { FairRandom::Box.from_poro(poro) }
      When(:box_contents) { (box_capacity * 2).times.map { revived.next } }
      Then { box_contents.count_by(&1) == {0 => 4, 1 => 4} }
    end
  end
end


text:
from sys import version_info
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_SimFlowSegment_Pipe_Indoor', [dirname(__file__)])
        except ImportError:
            import _SimFlowSegment_Pipe_Indoor
            return _SimFlowSegment_Pipe_Indoor
        if fp is not None:
            try:
                _mod = imp.load_module('_SimFlowSegment_Pipe_Indoor', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _SimFlowSegment_Pipe_Indoor = swig_import_helper()
    del swig_import_helper
else:
    import _SimFlowSegment_Pipe_Indoor
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)

def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0

try:
    import weakref
    weakref_proxy = weakref.proxy
except:
    weakref_proxy = lambda x: x

import base
class SimFlowSegment(base.SimDistributionFlowElement):
    __swig_setmethods__ = {}
    for _s in [base.SimDistributionFlowElement]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimFlowSegment, name, value)
    __swig_getmethods__ = {}
    for _s in [base.SimDistributionFlowElement]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimFlowSegment, name)
    __repr__ = _swig_repr

    def Representation(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Representation(self, *args)

    def __init__(self, *args):
        this = _SimFlowSegment_Pipe_Indoor.new_SimFlowSegment(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment__clone(self, f, c)
    __swig_destroy__ = _SimFlowSegment_Pipe_Indoor.delete_SimFlowSegment
    __del__ = lambda self: None
SimFlowSegment_swigregister = _SimFlowSegment_Pipe_Indoor.SimFlowSegment_swigregister
SimFlowSegment_swigregister(SimFlowSegment)

class SimFlowSegment_Pipe(SimFlowSegment):
    __swig_setmethods__ = {}
    for _s in [SimFlowSegment]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimFlowSegment_Pipe, name, value)
    __swig_getmethods__ = {}
    for _s in [SimFlowSegment]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimFlowSegment_Pipe, name)
    __repr__ = _swig_repr

    def SimFlowSeg_Name(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_SimFlowSeg_Name(self, *args)

    def __init__(self, *args):
        this = _SimFlowSegment_Pipe_Indoor.new_SimFlowSegment_Pipe(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe__clone(self, f, c)
    __swig_destroy__ = _SimFlowSegment_Pipe_Indoor.delete_SimFlowSegment_Pipe
    __del__ = lambda self: None
SimFlowSegment_Pipe_swigregister = _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_swigregister
SimFlowSegment_Pipe_swigregister(SimFlowSegment_Pipe)

class SimFlowSegment_Pipe_Indoor(SimFlowSegment_Pipe):
    __swig_setmethods__ = {}
    for _s in [SimFlowSegment_Pipe]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimFlowSegment_Pipe_Indoor, name, value)
    __swig_getmethods__ = {}
    for _s in [SimFlowSegment_Pipe]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimFlowSegment_Pipe_Indoor, name)
    __repr__ = _swig_repr

    def SimFlowSeg_ConstructionName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_ConstructionName(self, *args)

    def SimFlowSeg_FluidInletNodeName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_FluidInletNodeName(self, *args)

    def SimFlowSeg_FluidOutletNodeName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_FluidOutletNodeName(self, *args)

    def SimFlowSeg_EnvironmentType(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_EnvironmentType(self, *args)

    def SimFlowSeg_AmbTempZoneName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_AmbTempZoneName(self, *args)

    def SimFlowSeg_AmbTempSchedName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_AmbTempSchedName(self, *args)

    def SimFlowSeg_AmbAirVeloSchedName(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_AmbAirVeloSchedName(self, *args)

    def SimFlowSeg_PipesideDiam(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_PipesideDiam(self, *args)

    def SimFlowSeg_PipeLength(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_SimFlowSeg_PipeLength(self, *args)

    def __init__(self, *args):
        this = _SimFlowSegment_Pipe_Indoor.new_SimFlowSegment_Pipe_Indoor(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor__clone(self, f, c)
    __swig_destroy__ = _SimFlowSegment_Pipe_Indoor.delete_SimFlowSegment_Pipe_Indoor
    __del__ = lambda self: None
SimFlowSegment_Pipe_Indoor_swigregister = _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_swigregister
SimFlowSegment_Pipe_Indoor_swigregister(SimFlowSegment_Pipe_Indoor)

class SimFlowSegment_Pipe_Indoor_sequence(base.sequence_common):
    __swig_setmethods__ = {}
    for _s in [base.sequence_common]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimFlowSegment_Pipe_Indoor_sequence, name, value)
    __swig_getmethods__ = {}
    for _s in [base.sequence_common]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimFlowSegment_Pipe_Indoor_sequence, name)
    __repr__ = _swig_repr

    def __init__(self, *args):
        this = _SimFlowSegment_Pipe_Indoor.new_SimFlowSegment_Pipe_Indoor_sequence(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def assign(self, n, x):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_assign(self, n, x)

    def begin(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_begin(self, *args)

    def end(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_end(self, *args)

    def rbegin(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_rbegin(self, *args)

    def rend(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_rend(self, *args)

    def at(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_at(self, *args)

    def front(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_front(self, *args)

    def back(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_back(self, *args)

    def push_back(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_push_back(self, *args)

    def pop_back(self):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_pop_back(self)

    def detach_back(self, pop=True):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_detach_back(self, pop)

    def insert(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_insert(self, *args)

    def erase(self, *args):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_erase(self, *args)

    def detach(self, position, r, erase=True):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_detach(self, position, r, erase)

    def swap(self, x):
        return _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_swap(self, x)
    __swig_destroy__ = _SimFlowSegment_Pipe_Indoor.delete_SimFlowSegment_Pipe_Indoor_sequence
    __del__ = lambda self: None
SimFlowSegment_Pipe_Indoor_sequence_swigregister = _SimFlowSegment_Pipe_Indoor.SimFlowSegment_Pipe_Indoor_sequence_swigregister
SimFlowSegment_Pipe_Indoor_sequence_swigregister(SimFlowSegment_Pipe_Indoor_sequence)

# This file is compatible with both classic and new-style classes.


text:
<?php namespace EugeneTolok\Telegram\Models;

use Model;

/**
 * Model
 */
class Dialog extends Model
{
    use \October\Rain\Database\Traits\Validation;

    /*
     * Validation
     */
    public $rules = [
    ];

    /*
     * Disable timestamps by default.
     * Remove this line if timestamps are defined in the database table.
     */
    public $timestamps = false;

    /**
     * @var string The database table used by the model.
     */
    public $table = 'eugenetolok_telegram_dialogs';

    public $jsonable = ['steps_order'];

    public $belongsTo = [
        'step' => [
            'EugeneTolok\Telegram\Models\Step',
            'table' => 'eugenetolok_telegram_steps',
            'order' => 'name'
        ]
    ];
}