text:
<!DOCTYPE html>

	<title>

            EAInfoBiz Inc. -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      EAInfoBiz Inc.

Legal/Operating Name:

EAInfoBiz Inc.

http://www.eainfobiz.com

info@eainfobiz.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   503-2 Lansing Square

                    NORTH YORK,

                    Ontario

                  M2J 4P8

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   503-2 Lansing Square

                    NORTH YORK,

                    Ontario

                  M2J 4P8

                         </address>

Tel.:
		      (647) 503-1830

Fax:
		      (647) 723-0188

Company Profile

            A Professional Services Organization specializing in Implementations, Upgrades, ERP Advisory, Strategy, Business Process Reviews, Application Development, Enterprise Support Services and Re-engineering centered on Oracle and Microsoft products.

We have extensive experience in the Public Sector, Higher Education, and Healthcare industries in delivering value-driven solutions that address the evolving needs of Universities, Colleges, Municipalities, State / Provincial Governments, Healthcare providers, and Broader Public Sector agencies.

We also provide: Support solutions for Oracle / PeopleSoft; Technology consulting services around: Oracle / PeopleSoft Fusion Applications, Fusion Middleware, EPM, Business Intelligence, BPM Suite Automation; and Identity Management solutions.

				Full profile

				Full profile

				Contact information

                Wendy
                Abbott

                  Title:

                Manager

                    Area of Responsibility:

                    Administrative Services.

                  Telephone:

                (647) 503-1834

                  Facsimile:

                (647) 723-0188

                    Email:

                  wabbott@eainfobiz.com

  top of page

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            541690 - Other Scientific and Technical Consulting Services

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Providing Technology enabled Business Transformation

                            EAInfoBiz Inc. is a Canadian Corporation founded on the client first business approach, with a goal to providing measurable value to our clients - by reducing time to deploy professional service teams for projects and delivery time for the overall project with innovative accelerators. To consistently deliver quality solutions.

A Professional Services Organization specializing in Implementations, Upgrades, ERP Advisory, Strategy, Business Process Reviews, Application Development, Enterprise Support Services and Re-engineering centered on Oracle and Microsoft products.

We have extensive experience in the Public Sector, Higher Education, and Healthcare industries in delivering value-driven solutions that address the evolving needs of Universities, Colleges, Municipalities, State / Provincial Governments, Healthcare providers, and Broader Public Sector agencies.

We pride ourselves on our practitioner's strength. Their depth of knowledge and delivery experience with Oracle / PeopleSoft (PS) Human Capital Management (HCM), Financial / Supply Chain application (FIN / SCM) and Microsoft Dynamics CRM is world-class.

We also provide: Support solutions for Oracle / PeopleSoft; Technology consulting services around: Oracle / PeopleSoft Fusion Applications, Fusion Middleware, EPM, Business Intelligence, BPM Suite Automation; and Identity Management solutions.

Headquartered in Toronto, Ontario - We have a proven track record of providing Technology Consulting services, with experienced employees (consulting staff), across our 3 current locations in Ontario, New York, and Asia; along with a practitioner network of over 208 + experienced professionals.

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Wendy
                Abbott

                  Title:

                Manager

                    Area of Responsibility:

                    Administrative Services.

                  Telephone:

                (647) 503-1834

                  Facsimile:

                (647) 723-0188

                    Email:

                  wabbott@eainfobiz.com

				Description

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541510 - Computer Systems Design and Related Services

            Alternate Industries (NAICS):

            541690 - Other Scientific and Technical Consulting Services

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Providing Technology enabled Business Transformation

                            EAInfoBiz Inc. is a Canadian Corporation founded on the client first business approach, with a goal to providing measurable value to our clients - by reducing time to deploy professional service teams for projects and delivery time for the overall project with innovative accelerators. To consistently deliver quality solutions.

A Professional Services Organization specializing in Implementations, Upgrades, ERP Advisory, Strategy, Business Process Reviews, Application Development, Enterprise Support Services and Re-engineering centered on Oracle and Microsoft products.

We have extensive experience in the Public Sector, Higher Education, and Healthcare industries in delivering value-driven solutions that address the evolving needs of Universities, Colleges, Municipalities, State / Provincial Governments, Healthcare providers, and Broader Public Sector agencies.

We pride ourselves on our practitioner's strength. Their depth of knowledge and delivery experience with Oracle / PeopleSoft (PS) Human Capital Management (HCM), Financial / Supply Chain application (FIN / SCM) and Microsoft Dynamics CRM is world-class.

We also provide: Support solutions for Oracle / PeopleSoft; Technology consulting services around: Oracle / PeopleSoft Fusion Applications, Fusion Middleware, EPM, Business Intelligence, BPM Suite Automation; and Identity Management solutions.

Headquartered in Toronto, Ontario - We have a proven track record of providing Technology Consulting services, with experienced employees (consulting staff), across our 3 current locations in Ontario, New York, and Asia; along with a practitioner network of over 208 + experienced professionals.

    Last Update Date 2015-03-27

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Function reference • nbpir</title>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<link href="../pkgdown.css" rel="stylesheet">

<meta property="og:title" content="Function reference" />

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">

      </button>

        nbpir
        0.3.0

  Reference

Reference

    <colgroup>

      <col class="alias" />
      <col class="title" />
    </colgroup>

All functions

nbp_expand_daily()

Expand xts do daily periodicity.

nbp_interest_rates()

Download interest rates from National Bank of Poland.

nbp_max_loan()

Maximum interest rates for loans in Poland

nbp_xts2tbl()

Convert xts to tibble.

Contents

All functions

Developed by Zygmunt Zawadzki.

Site built with pkgdown.

redpajama_set_name: RedPajamaGithub


text:
package co.cask.tephra.util;

import org.apache.hadoop.conf.Configuration;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 *
 */
public abstract class AbstractConfigurationProviderTest {
  @Test
  public void testVersionFactory() {
    HBaseVersion.Version foundVersion = HBaseVersion.get();
    assertEquals(getExpectedVersion(), foundVersion);
  }

  protected abstract HBaseVersion.Version getExpectedVersion();

  @Test
  public void testConfigurationProvider() {
    Configuration conf = new Configuration();
    conf.set("foo", "bar");
    Configuration newConf = new ConfigurationFactory().get(conf);
    assertNotNull(newConf);
    assertEquals("bar", newConf.get("foo"));
  }
}


text:
/* tolua: functions to map features
 ** Support code for Lua bindings.
 ** Written by Waldemar Celes
 ** TeCGraf/PUC-Rio
 ** Apr 2003
 ** $Id: tolua_map.c,v 1.10 2011/01/13 13:43:46 fabraham Exp $
 */

/* This code is free software; you can redistribute it and/or modify it.
 ** The software provided hereunder is on an "as is" basis, and
 ** the author has no obligation to provide maintenance, support, updates,
 ** enhancements, or modifications.
 */

#include "tolua.h"
#include "tolua_event.h"
#include "lauxlib.h"

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

static char toluaname[128] = "tolua.";
static const char* TOLUANAME (const char* n)
{
  sprintf(&toluaname[6],"%.120s",n);
  return toluaname;
}

/* Create metatable
 * Create and register new metatable
 */
void tolua_newmetatable (lua_State* L, const char* name)
{
  if (luaL_newmetatable(L,TOLUANAME(name)))
  {
    lua_pushvalue(L,-1);
    lua_pushstring(L,name);
    lua_rawset(L,LUA_REGISTRYINDEX);
  }

  /* set meta events */
  tolua_classevents(L);
  lua_pop(L,1);
}

/* Get metatable
 * Access already created metatable
 */
void tolua_getmetatable (lua_State* L, const char* name)
{
  luaL_getmetatable(L,TOLUANAME(name));
}

/* Map super classes
 * It sets 'name' as being also a 'base', mapping all super classes of 'base' in 'name'
 */
static void mapsuper (lua_State* L, const char* name, const char* base)
{
  /* push registry.super */
  lua_pushstring(L,"tolua_super");
  lua_rawget(L,LUA_REGISTRYINDEX);    /* stack: super */
  tolua_getmetatable(L,name);          /* stack: super mt */
  lua_rawget(L,-2);                   /* stack: super table */
  if (lua_isnil(L,-1))
  {
    /* create table */
    lua_pop(L,1);
    lua_newtable(L);                    /* stack: super table */
    tolua_getmetatable(L,name);          /* stack: super table mt */
    lua_pushvalue(L,-2);                /* stack: super table mt table */
    lua_rawset(L,-4);                   /* stack: super table */
  }

  /* set base as super class */
  lua_pushstring(L,base);
  lua_pushboolean(L,1);
  lua_rawset(L,-3);                    /* stack: super table */

  /* set all super class of base as super class of name */
  tolua_getmetatable(L,base);          /* stack: super table base_mt */
  lua_rawget(L,-3);                   /* stack: super table base_table */
  if (lua_istable(L,-1))
  {
    /* traverse base table */
    lua_pushnil(L);  /* first key */
    while (lua_next(L,-2) != 0)
    {
      /* stack: ... base_table key value */
      lua_pushvalue(L,-2);    /* stack: ... base_table key value key */
      lua_insert(L,-2);       /* stack: ... base_table key key value */
      lua_rawset(L,-5);       /* stack: ... base_table key */
    }
  }
  lua_pop(L,3);                       /* stack: <empty> */
}

/* Map inheritance
 * It sets 'name' as derived from 'base' by setting 'base' as metatable of 'name'
 */
static void mapinheritance (lua_State* L, const char* name, const char* base)
{
  /* set metatable inheritance */
  tolua_getmetatable(L,name);
  if (base && *base)
    tolua_getmetatable(L,base);
  else
    tolua_getmetatable(L,"tolua_commonclass");
  lua_setmetatable(L,-2);
  lua_pop(L,1);
}

/* Object type
 */
static int tolua_bnd_type (lua_State* L)
{
  tolua_typename(L,lua_gettop(L));
  return 1;
}

/* Take ownership
 */
TOLUA_API int tolua_bnd_takeownership (lua_State* L)
{
  lua_CFunction func = 0;
  if (lua_isuserdata(L,1))
  {
    if (lua_getmetatable(L,1))        /* if metatable? */
    {
      void* u;
      lua_pushstring(L,".collector");
      lua_rawget(L,-2);
      func = lua_iscfunction(L,-1) ? lua_tocfunction(L,-1) : NULL;
      lua_pop(L,2);
      u = *((void**)lua_touserdata(L,1));
      tolua_clone(L,u,func);
    }
  }
  lua_pushboolean(L,func!=0);
  return 1;
}

/* Release ownership
 */
static int tolua_bnd_releaseownership (lua_State* L)
{
  int done = 0;
  if (lua_isuserdata(L,1))
  {
    void* u = *((void**)lua_touserdata(L,1));
    lua_pushstring(L,"tolua_gc");
    lua_rawget(L,LUA_REGISTRYINDEX);
    lua_pushlightuserdata(L,u);
    lua_rawget(L,-2);
    lua_pushlightuserdata(L,u);
    lua_pushnil(L);
    lua_rawset(L,-4);
    done = 1;
  }
  lua_pushboolean(L,done!=0);
  return 1;
}

/* Type casting
 */
static int tolua_bnd_cast (lua_State* L)
{
  void* v = tolua_tousertype(L,1,NULL);
  const char* s = tolua_tostring(L,2,NULL);
  if (!v)
    lua_pushnil(L);
  else if (v && s) {
    tolua_getmetatable(L,s);             /* stack: ubox[u] super super[mt] flag mt */
    if (lua_isnil(L,-1)) {
      tolua_error(L,"Unknown 'type' for 'tolua.cast' function",NULL);
    }
    tolua_pushusertype(L,v,s);
  }
  else {
    tolua_error(L,"Invalid arguments for 'tolua.cast' function",NULL);
  }
  return 1;
}

/* Release
** Function to be called by a Lua code that uses a function to explicitly
** release a mapped object. This function is automatically called by all
** destructors bound by tolua and by all collected objects.
*/
static int tolua_bnd_release (lua_State* L)
{
  void* value = tolua_tousertype(L,1,NULL);
  if (value)
    tolua_release(L,value);
  return 1;
}

/*
** Function to return peer table associated to a given object
*/
static int tolua_bnd_getpeertable (lua_State* L)
{
  lua_pushstring(L,"tolua_peer");
  lua_rawget(L,LUA_REGISTRYINDEX);        /* stack: k v peer */
  lua_pushvalue(L,1);
  lua_rawget(L,-2);                       /* stack: k v peer peer[u] */
  if (!lua_istable(L,-1))
  {
    lua_pop(L,1);                          /* stack: k v peer */
    lua_newtable(L);                       /* stack: k v peer table */
    lua_pushvalue(L,1);
    lua_pushvalue(L,-2);                   /* stack: k v peer table u table */
    lua_rawset(L,-4);                      /* stack: k v peer peer[u]=table */
  }
  return 1;
}

static void tolua_push_globals_table (lua_State* L)
{
#if defined (LUA_VERSION_NUM) && LUA_VERSION_NUM >= 502 /* after lua 5.2 */
  lua_pushvalue(L,LUA_REGISTRYINDEX); /* registry */
  lua_pushnumber(L,LUA_RIDX_GLOBALS); /* registry globalsindex */
  lua_rawget(L, -2);                  /* registry registry[globalsindex] */
  lua_remove(L, -2);                  /* registry[globalsindex] */
#else
  lua_pushvalue(L,LUA_GLOBALSINDEX);
#endif
}

TOLUA_API void tolua_open (lua_State* L)
{
  int top = lua_gettop(L);
  lua_pushstring(L,"tolua_opened");
  lua_rawget(L,LUA_REGISTRYINDEX);
  if (!lua_isboolean(L,-1))
  {
    lua_pushstring(L,"tolua_opened"); lua_pushboolean(L,1); lua_rawset(L,LUA_REGISTRYINDEX);
    lua_pushstring(L,"tolua_ubox");
    lua_newtable(L);
    lua_pushvalue(L, -1); /* metatable: for weak table */
    lua_pushstring(L, "__mode");
    lua_pushstring(L, "v");
    lua_rawset(L, -3);
    lua_setmetatable(L, -2);
    lua_rawset(L,LUA_REGISTRYINDEX);
    lua_pushstring(L,"tolua_peer");
    lua_newtable(L);
    lua_pushvalue(L, -1); /* metatable: for weak table */
    lua_pushstring(L, "__mode");
    lua_pushstring(L, "k");
    lua_rawset(L, -3);
    lua_setmetatable(L, -2);
    lua_rawset(L,LUA_REGISTRYINDEX);
    lua_pushstring(L,"tolua_super"); lua_newtable(L); lua_rawset(L,LUA_REGISTRYINDEX);
    lua_pushstring(L,"tolua_gc"); lua_newtable(L); lua_rawset(L,LUA_REGISTRYINDEX);

    tolua_newmetatable(L,"tolua_commonclass");

    tolua_module(L,NULL,0);
    tolua_beginmodule(L,NULL);
    tolua_module(L,"tolua",0);
    tolua_beginmodule(L,"tolua");
    tolua_function(L,"type",tolua_bnd_type);
    tolua_function(L,"takeownership",tolua_bnd_takeownership);
    tolua_function(L,"releaseownership",tolua_bnd_releaseownership);
    tolua_function(L,"cast",tolua_bnd_cast);
    tolua_function(L,"release",tolua_bnd_release);
    tolua_function(L,"getpeertable",tolua_bnd_getpeertable);
    tolua_endmodule(L);
    tolua_endmodule(L);
  }
  lua_settop(L,top);
}

/* Copy a C object
 */
TOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size)
{
  void* clone = (void*)malloc(size);
  if (clone)
    memcpy(clone,value,size);
  else
    tolua_error(L,"insuficient memory",NULL);
  return clone;
}

/* Release userdata from tolua
 */
TOLUA_API void tolua_release (lua_State* L, void* value)
{
  void** p;
  lua_pushstring(L,"tolua_ubox");
  lua_rawget(L,LUA_REGISTRYINDEX); /* stack: ubox */
  lua_pushlightuserdata(L,value);  /* stack: ubox u */
  /* set userdata pointer to NULL: this pointer might be reused by C/C++ */
  lua_rawget(L,-2);                /* stack: ubox ud */
  p = (void**)lua_touserdata(L,-1);
  if (p) *p = NULL;
      /* fixed bug: thanks to Ulrik Sverdrup -- it was 1 instead of -1 */
  lua_pop(L,1);                    /* stack: ubox */
  /* remove value from ubox */
  lua_pushlightuserdata(L,value);  /* stack: ubox u */
  lua_pushnil(L);
  lua_rawset(L,-3);
  lua_pop(L,1);
}

/* Do clone
 */
TOLUA_API void* tolua_clone (lua_State* L, void* value, lua_CFunction func)
{
  lua_pushstring(L,"tolua_gc");
  lua_rawget(L,LUA_REGISTRYINDEX);
  lua_pushlightuserdata(L,value);
  lua_pushcfunction(L,func);
  lua_rawset(L,-3);
  lua_pop(L,1);
  return value;
}

/* Register a usertype
 * It creates the correspoding metatable in the registry, for both 'type' and 'const type'.
 * It maps 'const type' as being also a 'type'
 */
TOLUA_API void tolua_usertype (lua_State* L, const char* type)
{
  char ctype[128] = "const ";
  strncat(ctype,type,120);

  tolua_newmetatable(L,ctype);         /* create both metatables */
  tolua_newmetatable(L,type);

  mapsuper(L,type,ctype);             /* 'type' is also a 'const type' */
}

/* Begin module
 * It pushes the module (or class) table on the stack
 */
TOLUA_API void tolua_beginmodule (lua_State* L, const char* name)
{
  if (name)
  {
    lua_pushstring(L,name);
    lua_rawget(L,-2);
  }
  else
    tolua_push_globals_table(L);
}

/* End module
 * It pops the module (or class) from the stack
 */
TOLUA_API void tolua_endmodule (lua_State* L)
{
  lua_pop(L,1);
}

/* Map module
 * It creates a new module
 */
#if 1
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)
{
  if (name)
  {
    /* tolua module */
    lua_pushstring(L,name);
    lua_rawget(L,-2);
    if (!lua_istable(L,-1))  /* check if module already exists */
    {
      lua_pop(L,1);
      lua_newtable(L);
      lua_pushstring(L,name);
      lua_pushvalue(L,-2);
      lua_rawset(L,-4);       /* assing module into module */
    }
  }
  else
    tolua_push_globals_table(L);
  if (hasvar)
  {
    if (!tolua_ismodulemetatable(L))  /* check if it already has a module metatable */
    {
      /* create metatable to get/set C/C++ variable */
      lua_newtable(L);
      tolua_moduleevents(L);
      if (lua_getmetatable(L,-2))
        lua_setmetatable(L,-2);  /* set old metatable as metatable of metatable */
      lua_setmetatable(L,-2);
    }
  }
  lua_pop(L,1);               /* pop module */
}
#else
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)
{
  if (name)
  {
    /* tolua module */
    lua_pushstring(L,name);
    lua_newtable(L);
  }
  else
    tolua_push_globals_table(L);
  if (hasvar)
  {
    /* create metatable to get/set C/C++ variable */
    lua_newtable(L);
    tolua_moduleevents(L);
    if (lua_getmetatable(L,-2))
      lua_setmetatable(L,-2);  /* set old metatable as metatable of metatable */
    lua_setmetatable(L,-2);
  }
  if (name)
    lua_rawset(L,-3);       /* assing module into module */
  else
    lua_pop(L,1);           /* pop global table */
}
#endif

/* Map C class
 * It maps a C class, setting the appropriate inheritance and super classes.
 */
TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col)
{
  char cname[128] = "const ";
  char cbase[128] = "const ";
  strncat(cname,name,120);
  strncat(cbase,base,120);

  mapinheritance(L,name,base);
  mapinheritance(L,cname,name);

  mapsuper(L,cname,cbase);
  mapsuper(L,name,base);

  lua_pushstring(L,lname);
  tolua_getmetatable(L,name);
  lua_pushstring(L,".collector");
  lua_pushcfunction(L,col);
  lua_rawset(L,-3);              /* store collector function into metatable */
  lua_rawset(L,-3);              /* assign class metatable to module */
}

/* Map function
 * It assigns a function into the current module (or class)
 */
TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func)
{
  lua_pushstring(L,name);
  lua_pushcfunction(L,func);
  lua_rawset(L,-3);
}

/* Map constant number
 * It assigns a constant number into the current module (or class)
 */
TOLUA_API void tolua_constant (lua_State* L, const char* name, double value)
{
  lua_pushstring(L,name);
  tolua_pushnumber(L,value);
  lua_rawset(L,-3);
}

/* Map variable
 * It assigns a variable into the current module (or class)
 */
TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
{
  /* get func */
  lua_pushstring(L,".get");
  lua_rawget(L,-2);
  if (!lua_istable(L,-1))
  {
    /* create .get table, leaving it at the top */
    lua_pop(L,1);
    lua_newtable(L);
    lua_pushstring(L,".get");
    lua_pushvalue(L,-2);
    lua_rawset(L,-4);
  }
  lua_pushstring(L,name);
  lua_pushcfunction(L,get);
  lua_rawset(L,-3);                  /* store variable */
  lua_pop(L,1);                      /* pop .get table */

  /* set func */
  if (set)
  {
    lua_pushstring(L,".set");
    lua_rawget(L,-2);
    if (!lua_istable(L,-1))
    {
      /* create .set table, leaving it at the top */
      lua_pop(L,1);
      lua_newtable(L);
      lua_pushstring(L,".set");
      lua_pushvalue(L,-2);
      lua_rawset(L,-4);
    }
    lua_pushstring(L,name);
    lua_pushcfunction(L,set);
    lua_rawset(L,-3);                  /* store variable */
    lua_pop(L,1);                      /* pop .set table */
  }
}

/* Access const array
 * It reports an error when trying to write into a const array
 */
static int const_array (lua_State* L)
{
  luaL_error(L,"value of const array cannot be changed");
  return 0;
}

/* Map an array
 * It assigns an array into the current module (or class)
 */
TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
{
  lua_pushstring(L,".get");
  lua_rawget(L,-2);
  if (!lua_istable(L,-1))
  {
    /* create .get table, leaving it at the top */
    lua_pop(L,1);
    lua_newtable(L);
    lua_pushstring(L,".get");
    lua_pushvalue(L,-2);
    lua_rawset(L,-4);
  }
  lua_pushstring(L,name);

  lua_newtable(L);           /* create array metatable */
  lua_pushvalue(L,-1);
  lua_setmetatable(L,-2);    /* set the own table as metatable (for modules) */
  lua_pushstring(L,"__index");
  lua_pushcfunction(L,get);
  lua_rawset(L,-3);
  lua_pushstring(L,"__newindex");
  lua_pushcfunction(L,set?set:const_array);
  lua_rawset(L,-3);

  lua_rawset(L,-3);                  /* store variable */
  lua_pop(L,1);                      /* pop .get table */
}


text:
<?php

namespace Oro\Bundle\ApiBundle\Command;

use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

use Oro\Bundle\ApiBundle\Config\ConfigExtensionRegistry;
use Oro\Bundle\ApiBundle\Config\Definition\ApiConfiguration;

class DumpConfigReferenceCommand extends ContainerAwareCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('oro:api:config:dump-reference')
            ->setDescription('Dumps the structure of "Resources/config/oro/api.yml".')
            ->addOption(
                'max-nesting-level',
                null,
                InputOption::VALUE_REQUIRED,
                'The maximum number of nesting target entities.'
            );
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output = new SymfonyStyle($input, $output);

        /** @var ConfigExtensionRegistry $configExtensionRegistry */
        $configExtensionRegistry = $this->getContainer()->get('oro_api.config_extension_registry');

        $maxNestingLevel = $input->getOption('max-nesting-level');
        if (null === $maxNestingLevel) {
            $maxNestingLevel = $configExtensionRegistry->getMaxNestingLevel();
        } else {
            $maxNestingLevel = (int)$maxNestingLevel;
            if ($maxNestingLevel < 0 || $maxNestingLevel > $configExtensionRegistry->getMaxNestingLevel()) {
                throw new \LogicException(
                    sprintf(
                        'The "max-nesting-level" should be a positive number less than or equal to %d.',
                        $configExtensionRegistry->getMaxNestingLevel()
                    )
                );
            }
        }

        $configuration = new ApiConfiguration(
            $configExtensionRegistry,
            $maxNestingLevel
        );

        $output->writeln('# The structure of "Resources/config/oro/api.yml"');
        $dumper = new YamlReferenceDumper();
        $output->writeln($dumper->dump($configuration));
    }
}


text:
package org.scalatest

import SharedHelpers.thisLineNumber
import exceptions.TestFailedException
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers._

class ShouldCompileSpec extends AnyFunSpec {

  val fileName = "ShouldCompileSpec.scala"

  describe("Compile matcher") {

    describe("when work with string literal") {

      it("should do nothing when type check passed") {
        "val a = 1" should compile
      }

      it("should throw TestFailedException with correct message and stack depth when type check failed") {
        val e = intercept[TestFailedException] {
          "val a: String = 2" should compile
        }
        val errMsg = Resources.expectedNoErrorButGotTypeError("", "")
        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("val a: String = 2") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }

      it("should throw TestFailedException with correct message and stack depth when parse failed") {

        // SKIP-DOTTY-START
        val errMsg = Resources.expectedNoErrorButGotParseError("", "")
        // SKIP-DOTTY-END
        //DOTTY-ONLY val errMsg = Resources.expectedNoErrorButGotTypeError("", "")

        val e = intercept[TestFailedException] {
          "println(\"test)" should compile
        }

        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("println(\"test)") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }

    }

    describe("when work with string literal with triple double quotes") {

      it("should do nothing when type check passed") {
        """val a = 1""" should compile
      }

      it("should throw TestFailedException with correct message and stack depth when type check failed") {
        val e = intercept[TestFailedException] {
          """val a: String = 2""" should compile
        }
        val errMsg = Resources.expectedNoErrorButGotTypeError("", "")
        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("val a: String = 2") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }

      it("should throw TestFailedException with correct message and stack depth when parse failed") {

        // SKIP-DOTTY-START
        val errMsg = Resources.expectedNoErrorButGotParseError("", "")
        // SKIP-DOTTY-END
        //DOTTY-ONLY val errMsg = Resources.expectedNoErrorButGotTypeError("", "")

        val e = intercept[TestFailedException] {
          """println("test)""" should compile
        }

        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("println(\"test)") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }

    }

    describe("when work with triple quotes string literal with stripMargin") {

      it("should do nothing when type check passed") {
        """
          |val a = 1
          |""".stripMargin should compile
      }

      it("should throw TestFailedException with correct message and stack depth when type check failed") {
        val e = intercept[TestFailedException] {
          """
            |val a: String = 2
            |""".stripMargin should compile
        }
        val errMsg = Resources.expectedNoErrorButGotTypeError("", "")
        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("val a: String = 2") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }

      it("should throw TestFailedException with correct message and stack depth when parse failed") {
        // SKIP-DOTTY-START
        val errMsg = Resources.expectedNoErrorButGotParseError("", "")
        // SKIP-DOTTY-END
        //DOTTY-ONLY val errMsg = Resources.expectedNoErrorButGotTypeError("", "")

        val e = intercept[TestFailedException] {
          """
            |println("test)
            |""".stripMargin should compile
        }

        assert(e.message.get.startsWith(errMsg.substring(0, errMsg.indexOf(':'))))
        assert(e.message.get.indexOf("println(\"test)") >= 0)
        assert(e.failedCodeFileName === (Some(fileName)))
        assert(e.failedCodeLineNumber === (Some(thisLineNumber - 6)))
      }
    }
  }
}


text:
using System.IO;
using System.Drawing;

namespace SphereStudio.Vanilla
{
    /// <summary>
    /// A Sphere Zone object.
    /// </summary>
    public class Zone
    {
        #region attributes
        private short _x1, _y1;
        private short _x2, _y2;

        /// <summary>
        /// Gets or sers the layer index of this Zone.
        /// </summary>
        public short Layer { get; set; }

        /// <summary>
        /// Gets or sets the number of steps for this Zone.
        /// </summary>
        public short NumSteps { get; set; }

        /// <summary>
        /// Gets or sets the Function used by this Zone.
        /// </summary>
        public string Function { get; set; }

        /// <summary>
        /// Gets or sets the visibility of this Zone.
        /// </summary>
        public bool Visible { get; set; }

        private static readonly Brush Bg = new SolidBrush(Color.FromArgb(125, Color.Red));
        private static readonly Brush Bg2 = new SolidBrush(Color.FromArgb(125, Color.Yellow));
        private static Pen _offPen;
        #endregion

        /// <summary>
        /// Gets or sets the width of this Zone in pixels.
        /// </summary>
        public int Width { get { return _x2 - _x1; } set { _x2 = (short)(_x1 + value); } }

        /// <summary>
        /// Gets or sets the height of this Zone in pixels.
        /// </summary>
        public int Height { get { return _y2 - _y1; } set { _y2 = (short)(_y1 + value); } }

        /// <summary>
        /// Gets or sets the x location of this Zone in pixels.
        /// </summary>
        public int X { get { return _x1; } set { _x1 = (short)value; } }

        /// <summary>
        /// Gets or sets the y location of this zone in pixels.
        /// </summary>
        public int Y { get { return _y1; } set { _y1 = (short)value; } }

        /// <summary>
        /// Creates a new, blank zone.
        /// </summary>
        public Zone()
        {
            if (_offPen == null)
            {
                _offPen = new Pen(Color.Red) {DashStyle = System.Drawing.Drawing2D.DashStyle.Dash};
            }

            Function = "";
            NumSteps = 8;
            Layer = 0;
            Visible = true;
        }

        /// <summary>
        /// Creates a zone from a filestream.
        /// </summary>
        /// <param name="reader">The System.IO.BinrayReader to use.</param>
        /// <returns>A zone object.</returns>
        public static Zone FromBinary(BinaryReader reader)
        {
            Zone zone = new Zone
                {
                    _x1 = reader.ReadInt16(),
                    _y1 = reader.ReadInt16(),
                    _x2 = reader.ReadInt16(),
                    _y2 = reader.ReadInt16(),
                    Layer = reader.ReadInt16(),
                    NumSteps = reader.ReadInt16()
                };

            // read header:
            reader.ReadBytes(4);

            // read function:
            short length = reader.ReadInt16();
            zone.Function = new string(reader.ReadChars(length));

            return zone;
        }

        /// <summary>
        /// Stores the zone into a filestream.
        /// </summary>
        /// <param name="writer">The System.IO.BinaryWriter to use.</param>
        public void Save(BinaryWriter writer)
        {
            // save header:
            writer.Write(_x1);
            writer.Write(_y1);
            writer.Write(_x2);
            writer.Write(_y2);
            writer.Write(Layer);
            writer.Write(NumSteps);
            writer.Write(new byte[4]);

            // save function:
            writer.Write((short)Function.Length);
            writer.Write(Function.ToCharArray());
        }

        /// <summary>
        /// Gets if whather or not the mouse is in a zone.
        /// </summary>
        /// <param name="mouse">The System.Drawing.Point of the mouses location.</param>
        /// <returns>True if mouse is inside.</returns>
        public bool IsMouseWithin(Point mouse)
        {
            return (mouse.X >= X && mouse.X < X + Width && mouse.Y >= Y && mouse.Y < Y + Height);
        }

        /// <summary>
        /// Draws the zone to a System.drawing.Graphics.
        /// </summary>
        /// <param name="map">The System.Drawing.Graphics to use.</param>
        /// <param name="offset">The x/y offset of the zone.</param>
        /// <param name="lighted">The state the zone is in.</param>
        /// <param name="zoom">The zoom factor.</param>
        public void Draw(Graphics map, Point offset, int lighted, int zoom)
        {
            if (!Visible) return;
            int x = offset.X + X * zoom;
            int y = offset.Y + Y * zoom;
            int w = Width * zoom;
            int h = Height * zoom;
            if (lighted < 0) // disabled
            {
                map.DrawRectangle(_offPen, x, y, w, h);
            }
            else if (lighted > 0) // hovered
            {
                map.FillRectangle(Bg2, x, y, w, h);
                map.DrawRectangle(Pens.Yellow, x, y, w, h);
            }
            else // enabled
            {
                map.FillRectangle(Bg, x, y, w, h);
                map.DrawRectangle(Pens.Red, x, y, w, h);
                Point p = new Point(x + 4, y + 4);
                map.DrawString("Layer: " + Layer, SystemFonts.DialogFont, Brushes.White, p);
            }
        }

        /// <summary>
        /// Creates a perfect copy of this Zone.
        /// </summary>
        /// <returns>A Zone object.</returns>
        public Zone Clone()
        {
            return new Zone
                {
                    X = X,
                    Y = Y,
                    Width = Width,
                    Height = Height,
                    Layer = Layer,
                    NumSteps = NumSteps,
                    Function = Function
                };
        }
    }
}


text:
layout: default
---

        Home

{{ page.title | escape }}

    {% if page.date or page.time_to_read %}

      {% include rss_icon.svg %}

    {% endif %}
    {% if page.date %}
      <time class="small inline" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time>
    {% endif %}
    {% if page.time_to_read %}
      {{page.time_to_read}} minute read
    {% endif %}

{{ content }}
{% if page.next or page.previous %}

    {% if page.previous.url %}

          {{page.previous.title}}

        {% if page.previous.time_to_read %}
          <time class="small inline read-time">{{page.previous.time_to_read}} minute read</time>
        {% endif %}

    {% endif %}
    {% if page.next.url %}

          {{page.next.title}}

        {% if page.next.time_to_read %}
          <time class="small inline read-time ">{{page.next.time_to_read}} minute read</time>
        {% endif %}

    {% endif %}

{% endif %}


text:
package net.savantly.sprout.domain.user.search;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter @Setter
@Accessors(chain = true)
public class UserSearchResponseItem {

	private String itemId;
	private String userName;
	private String displayName;
}


text:
<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * e.g., it puts together the home page when no home.php file exists.
 *
 * Learn more: {@link https://codex.wordpress.org/Template_Hierarchy}
 */

get_header();

if (have_posts()) {

	the_post();
	get_template_part('content', get_post_format());
	get_template_part('pagination');

}
else {

	get_template_part('content', 'none');

}

get_footer();

?>


text:
<?php

namespace yii\db\mysql;

use yii\db\Exception;
use yii\base\InvalidParamException;

/**
 * QueryBuilder is the query builder for MySQL databases.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class QueryBuilder extends \yii\db\QueryBuilder
{
	/**
	 * @var array mapping from abstract column types (keys) to physical column types (values).
	 */
	public $typeMap = array(
		Schema::TYPE_PK => 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
		Schema::TYPE_STRING => 'varchar(255)',
		Schema::TYPE_TEXT => 'text',
		Schema::TYPE_SMALLINT => 'smallint(6)',
		Schema::TYPE_INTEGER => 'int(11)',
		Schema::TYPE_BIGINT => 'bigint(20)',
		Schema::TYPE_FLOAT => 'float',
		Schema::TYPE_DECIMAL => 'decimal(10,0)',
		Schema::TYPE_DATETIME => 'datetime',
		Schema::TYPE_TIMESTAMP => 'timestamp',
		Schema::TYPE_TIME => 'time',
		Schema::TYPE_DATE => 'date',
		Schema::TYPE_BINARY => 'blob',
		Schema::TYPE_BOOLEAN => 'tinyint(1)',
		Schema::TYPE_MONEY => 'decimal(19,4)',
	);

	/**
	 * Builds a SQL statement for renaming a column.
	 * @param string $table the table whose column is to be renamed. The name will be properly quoted by the method.
	 * @param string $oldName the old name of the column. The name will be properly quoted by the method.
	 * @param string $newName the new name of the column. The name will be properly quoted by the method.
	 * @return string the SQL statement for renaming a DB column.
	 * @throws Exception
	 */
	public function renameColumn($table, $oldName, $newName)
	{
		$quotedTable = $this->db->quoteTableName($table);
		$row = $this->db->createCommand('SHOW CREATE TABLE ' . $quotedTable)->queryRow();
		if ($row === false) {
			throw new Exception("Unable to find column '$oldName' in table '$table'.");
		}
		if (isset($row['Create Table'])) {
			$sql = $row['Create Table'];
		} else {
			$row = array_values($row);
			$sql = $row[1];
		}
		if (preg_match_all('/^\s*`(.*?)`\s+(.*?),?$/m', $sql, $matches)) {
			foreach ($matches[1] as $i => $c) {
				if ($c === $oldName) {
					return "ALTER TABLE $quotedTable CHANGE "
						. $this->db->quoteColumnName($oldName) . ' '
						. $this->db->quoteColumnName($newName) . ' '
						. $matches[2][$i];
				}
			}
		}
		// try to give back a SQL anyway
		return "ALTER TABLE $quotedTable CHANGE "
			. $this->db->quoteColumnName($oldName) . ' '
			. $this->db->quoteColumnName($newName);
	}

	/**
	 * Builds a SQL statement for dropping a foreign key constraint.
	 * @param string $name the name of the foreign key constraint to be dropped. The name will be properly quoted by the method.
	 * @param string $table the table whose foreign is to be dropped. The name will be properly quoted by the method.
	 * @return string the SQL statement for dropping a foreign key constraint.
	 */
	public function dropForeignKey($name, $table)
	{
		return 'ALTER TABLE ' . $this->db->quoteTableName($table)
			. ' DROP FOREIGN KEY ' . $this->db->quoteColumnName($name);
	}

	/**
	 * Builds a SQL statement for removing a primary key constraint to an existing table.
	 * @param string $name the name of the primary key constraint to be removed.
	 * @param string $table the table that the primary key constraint will be removed from.
	 * @return string the SQL statement for removing a primary key constraint from an existing table.
	 */
	public function dropPrimaryKey($name, $table)
	{
		return 'ALTER TABLE ' . $this->db->quoteTableName($table) . ' DROP PRIMARY KEY';
	}

	/**
	 * Creates a SQL statement for resetting the sequence value of a table's primary key.
	 * The sequence will be reset such that the primary key of the next new row inserted
	 * will have the specified value or 1.
	 * @param string $tableName the name of the table whose primary key sequence will be reset
	 * @param mixed $value the value for the primary key of the next new row inserted. If this is not set,
	 * the next new row's primary key will have a value 1.
	 * @return string the SQL statement for resetting sequence
	 * @throws InvalidParamException if the table does not exist or there is no sequence associated with the table.
	 */
	public function resetSequence($tableName, $value = null)
	{
		$table = $this->db->getTableSchema($tableName);
		if ($table !== null && $table->sequenceName !== null) {
			$tableName = $this->db->quoteTableName($tableName);
			if ($value === null) {
				$key = reset($table->primaryKey);
				$value = $this->db->createCommand("SELECT MAX(`$key`) FROM $tableName")->queryScalar() + 1;
			} else {
				$value = (int)$value;
			}
			return "ALTER TABLE $tableName AUTO_INCREMENT=$value";
		} elseif ($table === null) {
			throw new InvalidParamException("Table not found: $tableName");
		} else {
			throw new InvalidParamException("There is not sequence associated with table '$tableName'.");
		}
	}

	/**
	 * Builds a SQL statement for enabling or disabling integrity check.
	 * @param boolean $check whether to turn on or off the integrity check.
	 * @param string $table the table name. Meaningless for MySQL.
	 * @param string $schema the schema of the tables. Meaningless for MySQL.
	 * @return string the SQL statement for checking integrity
	 */
	public function checkIntegrity($check = true, $schema = '', $table = '')
	{
		return 'SET FOREIGN_KEY_CHECKS = ' . ($check ? 1 : 0);
	}

	/**
	 * Generates a batch INSERT SQL statement.
	 * For example,
	 *
	 * ~~~
	 * $connection->createCommand()->batchInsert('tbl_user', array('name', 'age'), array(
	 *     array('Tom', 30),
	 *     array('Jane', 20),
	 *     array('Linda', 25),
	 * ))->execute();
	 * ~~~
	 *
	 * Not that the values in each row must match the corresponding column names.
	 *
	 * @param string $table the table that new rows will be inserted into.
	 * @param array $columns the column names
	 * @param array $rows the rows to be batch inserted into the table
	 * @return string the batch INSERT SQL statement
	 */
	public function batchInsert($table, $columns, $rows)
	{
		foreach ($columns as $i => $name) {
			$columns[$i] = $this->db->quoteColumnName($name);
		}

		$values = array();
		foreach ($rows as $row) {
			$vs = array();
			foreach ($row as $value) {
				$vs[] = is_string($value) ? $this->db->quoteValue($value) : $value;
			}
			$values[] = '(' . implode(', ', $vs) . ')';
		}

		return 'INSERT INTO ' . $this->db->quoteTableName($table)
			. ' (' . implode(', ', $columns) . ') VALUES ' . implode(', ', $values);
	}
}


text:
using System;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.packager;

namespace Kraken
{
    public class UmbracoEvents : ApplicationBase
    {
        public UmbracoEvents()
        {
            Media.AfterSave += Media_AfterSave;
            InstalledPackage.BeforeDelete += InstalledPackage_BeforeDelete;
        }

        void InstalledPackage_BeforeDelete(InstalledPackage sender, EventArgs e)
        {
            if (sender.Data.Name == Constants.UmbracoPackageName)
            {
                Kraken.Uninstall();
            }
        }

        void Media_AfterSave(Media sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {
            try
            {
                if (Configuration.Settings.Enabled)
                    if (Kraken.GetKrakStatus(sender) == EnmIsKrakable.Krakable)
                    {
                        // In elkaar krakken
                        var result = Kraken.Compress(sender);
                        // Goed uitgekrakt?
                        if (result != null && result.success)
                            // Opslaan in Umbraco
                            result.Save(sender);
                    }
            }
            catch
            {
                // Als de hel los breekt, ga dan in ieder geval door. Anders verpesten we (mogelijK) de media save event voor de gebruiker
            }
        }
    }
}


text:
{{ fullname | escape }}
=====================================================================

.. rubric:: Description

.. automodule:: {{ fullname }}

.. currentmodule:: {{ fullname }}

{% if classes %}
.. rubric:: Classes

.. autosummary::
    :toctree: .
    {% for class in classes %}
    {{ class }}
    {% endfor %}

{% endif %}

{% if functions %}
.. rubric:: Functions

.. autosummary::
    :toctree: .
    {% for function in functions %}
    {{ function }}
    {% endfor %}

{% endif %}


text:
    <button type="button" class="close" ng-click="close()" aria-label="Close">
    	×
    </button>

Are you sure you want to delete?

		You can not undo this action and the {{ entity.entityType }} will be deleted forever.

 0) && settings.canAccessCloud()">

		There is also a linked {{ entity.entityType }} in the cloud.
		Would you like to delete this one as well?
		This action can not be undone.

		<input type="checkbox" ng-model="action.fromCloud" name="fromCloud"/>
		 Delete the linked {{ entity.entityType }} from the cloud

    <button type="button" class="btn btn-default" ng-click="cancel()">
    	Cancel
    </button>

    <button type="button" ng-if="!action.fromCloud" class="btn btn-primary warning" ng-click="doAction(entity.delete(), 'delete')">
    	Delete
    </button>

    <button type="button" ng-if="action.fromCloud" class="btn btn-primary warning" ng-click="doAction([entity.delete(action.fromCloud),entity.delete()], 'delete')">
    	Delete from Both
    </button>


text:
<sep-alert>

            ×

        <yield />

</sep-alert>


text:
package com.cloudworkers.cloudworker.web.rest;

import com.codahale.metrics.annotation.Timed;
import com.cloudworkers.cloudworker.domain.Node;
import com.cloudworkers.cloudworker.domain.Worker;
import com.cloudworkers.cloudworker.service.NodeService;
import com.cloudworkers.cloudworker.service.WorkerService;
import com.cloudworkers.cloudworker.web.rest.util.HeaderUtil;
import com.cloudworkers.cloudworker.web.rest.util.PaginationUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.inject.Inject;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;

/**
 * REST controller for managing Worker.
 */
@RestController
@RequestMapping("/api")
public class WorkerResource {

    private final Logger log = LoggerFactory.getLogger(WorkerResource.class);

    @Inject
    private WorkerService workerService;

    @Inject
    private NodeService nodeService;

    /**
     * POST  /workers -> Create a new worker.
     */
    @RequestMapping(value = "/workers",
        method = RequestMethod.POST,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<Worker> createWorker(@RequestBody Worker worker) throws URISyntaxException {
        log.debug("REST request to save Worker : {}", worker);
        if (worker.getId() != null) {
            return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("worker", "idexists", "A new worker cannot already have an ID")).body(null);
        }
        Worker result = workerService.save(worker);
        return ResponseEntity.created(new URI("/api/workers/" + result.getId()))
            .headers(HeaderUtil.createEntityCreationAlert("worker", result.getId().toString()))
            .body(result);
    }

    /**
     * PUT  /workers -> Updates an existing worker.
     */
    @RequestMapping(value = "/workers",
        method = RequestMethod.PUT,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<Worker> updateWorker(@RequestBody Worker worker) throws URISyntaxException {
        log.debug("REST request to update Worker : {}", worker);
        if (worker.getId() == null) {
            return createWorker(worker);
        }
        Worker result = workerService.save(worker);
        return ResponseEntity.ok()
            .headers(HeaderUtil.createEntityUpdateAlert("worker", worker.getId().toString()))
            .body(result);
    }

    /**
     * GET  /workers -> get all the workers.
     */
    @RequestMapping(value = "/workers",
        method = RequestMethod.GET,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<List<Worker>> getAllWorkers(Pageable pageable)
        throws URISyntaxException {
        log.debug("REST request to get a page of Workers");
        Page<Worker> page = workerService.findAll(pageable);
        HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/workers");
        return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
    }

    /**
     * GET  /workers/node/:id -> get workers for node "id".
     */
    @RequestMapping(value = "/workers/node/{id}",
        method = RequestMethod.GET,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<List<Worker>> getNodeWorker(@PathVariable Long id) {
        log.debug("REST request to get Worker for Node : {}", id);

        Node node = nodeService.findOne(id);
        if (node.getId() == null) {
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }

        List<Worker> workers = workerService.findAllByNodeId(id);
        return Optional.ofNullable(workers)
            .map(result -> new ResponseEntity<>(
                result,
                HttpStatus.OK))
            .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
    }

    /**
     * GET  /workers/:id -> get the "id" worker.
     */
    @RequestMapping(value = "/workers/{id}",
        method = RequestMethod.GET,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<Worker> getWorker(@PathVariable Long id) {
        log.debug("REST request to get Worker : {}", id);
        Worker worker = workerService.findOne(id);
        return Optional.ofNullable(worker)
            .map(result -> new ResponseEntity<>(
                result,
                HttpStatus.OK))
            .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
    }

    /**
     * DELETE  /workers/:id -> delete the "id" worker.
     */
    @RequestMapping(value = "/workers/{id}",
        method = RequestMethod.DELETE,
        produces = MediaType.APPLICATION_JSON_VALUE)
    @Timed
    public ResponseEntity<Void> deleteWorker(@PathVariable Long id) {
        log.debug("REST request to delete Worker : {}", id);
        workerService.delete(id);
        return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("worker", id.toString())).build();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NldbApi.Models
{
    public class Character
    {
        public string Name { get; set; }
        public string ImageName { get; set; }
        public string UrlName { get; set; }
        public string FromMod { get; set; }
        public string Color { get; set; }
        public int? CssHorizontalOffset { get; set; }
        public int? CssVerticalOffset { get; set; }
    }

    public class DetailedCharacter
    {
        public Character Character { get; set; }
        public GraphBar GraphBar { get; set; }
    }

    public class CharacterUrlName
    {
        public string Name { get; set; }
        public string UniqueName { get; set; }
    }
}


text:
![Build Status](https://travis-ci.org/fukumone/rails_log_profiling.svg)
[![Gem Version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=rb&type=6&v=0.1.1&x4=0)](https://d25lcipzij17d.cloudfront.net/badge.svg?id=rb&type=6&v=0.1.1&x4=0)

Rails専用のパフォーマンスツール
 - クエリ、viewレンダリングにかかった時間をログに計測して記録
 - クエリプロファイリング:1リクエストごとにクエリを昇順または降順に整理してログに出力、またsqlのクエリの実行箇所を記録
 - Viewプロファイリング:1リクエストごとにviewレンダリングにかかったページをログに計測して記録
 - 対応version:Rails4.0, 4.1, 4.2, 5.0

## Installation

- gemとしてインストール

```
$ gem install rails_log_profiling
```

- gemfileに追加

```
gem 'rails_log_profiling', :group => "development"
```

## Usage
  Rails::Log::Profilingは初期の段階ではなにも行いません

  動作させるにはconfig/environments/development.rbに下記の設定を追加してください

```:devlopment.rb
# クエリのプロファイリングを有効にします
Rails::Log::Profiling.query_profiling_enable = true
# viewのプロファイリングを有効にします
Rails::Log::Profiling.view_profiling_enable = true
```

設定後、Rails Serverを起動
  log/以下に
  - **rails_log_query_profiling.log**
  - **rails_log_view_profiling.log**

2つのログファイルが作られ、記録されます

```
$ tail -f log/rails_log_query_profiling.log

# output
PostsController#index

total query count: 2, total query time: 26.6ms

  1: Articles Load (21.7ms)  SELECT  `articles`.* FROM `articles` ORDER BY `articles`.`id` ASC LIMIT 1
  Identify Query Location:
    /Users/fukumone/private_repo/rails_test/app/controllers/posts_controller.rb:9:in `index'

  2: Post Load (4.9ms)  SELECT `posts`.* FROM `posts`
  Identify Query Location:
    /Users/fukumone/private_repo/rails_test/app/views/posts/index.html.erb:16:in `_app_views_posts_index_html_erb__3476269730194822991_70352062040540'
```

```
$ tail -f log/rails_log_view_profiling.log

# output
Parent: 65.5ms
  /Users/fukumone/private_repo/rails_test/app/views/posts/index.html.erb
Children: total time: 6.9ms, partial page count: 3, total rendering page count: 12
  5.4ms: /Users/fukumone/private_repo/rails_test/app/views/articles/_show.html.erb
    rendering page count: 10
  0.8ms: /Users/fukumone/private_repo/rails_test/app/views/articles/_show_3.html.erb
  0.7ms: /Users/fukumone/private_repo/rails_test/app/views/articles/_show_2.html.erb
```

## Configuration
Rails::Log::Profilingはオプションが用意されています
  - `Rails::Log::Profiling.query_profiling_enable`: true => クエリのプロファイリングを有効にする
  - `Rails::Log::Profiling.view_profiling_enable`: true => viewのプロファイリングを有効にする
  - `Rails::Log::Profiling.sort_order`: rails_log_query_profiling.logのクエリの並び順を指定する、降順はdesc、昇順はascと設定してください。初期設定はdescになっています
  - `Rails::Log::Profiling.continue_to_query_caller`: true => rails_log_query_profiling.logにてクエリメソッドの呼び出し状況を最後までトレースし記録します、探知する量が多くなってしまう場合があるため、初期設定はfalseになっています

## ChangeLog
[here](https://github.com/fukumone/rails_log_profiling/blob/master/CHANGELOG.md)

## Inspire
 - [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler)
 - [Activerecord::Cause](https://github.com/joker1007/activerecord-cause)
 - [Bullet](https://github.com/flyerhzm/bullet)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## License
MIT


text:
package com.whippy.sponge.whipconomy.main;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.event.Subscribe;
import org.spongepowered.api.event.entity.player.PlayerJoinEvent;
import org.spongepowered.api.event.state.ServerStartingEvent;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.service.command.CommandService;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.util.command.args.GenericArguments;
import org.spongepowered.api.util.command.spec.CommandSpec;

import com.google.inject.Inject;
import com.whippy.sponge.whipconomy.beans.Payment;
import com.whippy.sponge.whipconomy.beans.StaticsHandler;
import com.whippy.sponge.whipconomy.cache.AuctionCache;
import com.whippy.sponge.whipconomy.cache.ConfigurationLoader;
import com.whippy.sponge.whipconomy.cache.EconomyCache;
import com.whippy.sponge.whipconomy.cache.PendingNotificaitions;
import com.whippy.sponge.whipconomy.commands.AucCommand;
import com.whippy.sponge.whipconomy.commands.BalCommand;
import com.whippy.sponge.whipconomy.commands.BankCommand;
import com.whippy.sponge.whipconomy.commands.BidCommand;
import com.whippy.sponge.whipconomy.commands.ChargeCommand;
import com.whippy.sponge.whipconomy.commands.GiftCommand;
import com.whippy.sponge.whipconomy.commands.PayCommand;
import com.whippy.sponge.whipconomy.commands.SavingsAccHistoryCommand;
import com.whippy.sponge.whipconomy.commands.TransactionsCommand;
import com.whippy.sponge.whipconomy.commands.TransferCommand;
import com.whippy.sponge.whipconomy.commands.WithdrawCommand;
import com.whippy.sponge.whipconomy.orchestrator.AuctionRunner;
import com.whippy.sponge.whipconomy.orchestrator.Auctioneer;

@Plugin(id = "Whipconomy", name = "Whipconomy")
public class Whipconomy {

	@Inject
	Game game;

	@Inject
	Logger logger;

	@Subscribe
	public void onServerStarting(ServerStartingEvent event)  {
		StaticsHandler.setLogger(logger);
		StaticsHandler.setGame(game);

		if(!ConfigurationLoader.initProperties()){
			logger.warn("Failed to load configuration defaults will be used");
		}
		if(!ConfigurationLoader.initAliases()){
			logger.warn("Failed to load aliases defaults will be used");
		}
		EconomyCache.refreshMappingsFromFile();
		EconomyCache.refreshAccountsFromFile();
		PendingNotificaitions.refreshPendingFromFile();

	}

	@Subscribe
	public void onPlayerJoin(PlayerJoinEvent event){
		EconomyCache.updatePlayerMapping(event.getUser());
		List<Payment> pendingPayments = PendingNotificaitions.getAndRemovePendingPayments(event.getUser().getIdentifier());

		if(pendingPayments!=null & pendingPayments.size()!=0){
			event.getUser().sendMessage(Texts.builder("Following transactions occured whilst offline: ").color(TextColors.BLUE).build());
			Map<String, Double> playerToAmount = new HashMap<String, Double>();
			double serverPayament = 0;
			for (Payment payment : pendingPayments) {
				if(payment.getPlayerNamePayer()!=null && payment.getPlayerNamePayer().equals(event.getUser().getName())){
					if(payment.getPlayerNameReceiver()==null || payment.getPlayerNameReceiver().isEmpty()){
						//Is payment made by player to server
						serverPayament -= payment.getAmount();
					}else if(playerToAmount.get(payment.getPlayerNameReceiver())!=null){
						Double currentAmmount = playerToAmount.get(payment.getPlayerNameReceiver());
						currentAmmount -= payment.getAmount();
						playerToAmount.put(payment.getPlayerNameReceiver(), currentAmmount);
					}else{
						playerToAmount.put(payment.getPlayerNameReceiver(), payment.getAmount()*-1);
					}
				}else if(payment.getPlayerNameReceiver()!=null && payment.getPlayerNameReceiver().equals(event.getUser().getName())){
					if(payment.getPlayerNamePayer()==null || payment.getPlayerNamePayer().isEmpty()){
						//Is payment made by server to player
						serverPayament += payment.getAmount();
					}else if(playerToAmount.get(payment.getPlayerNamePayer())!=null){
						Double currentAmmount = playerToAmount.get(payment.getPlayerNamePayer());
						currentAmmount += payment.getAmount();
						playerToAmount.put(payment.getPlayerNamePayer(), currentAmmount);
					}else{
						playerToAmount.put(payment.getPlayerNamePayer(), payment.getAmount());
					}
				}
			}

			for (String payer : playerToAmount.keySet()) {
				StringBuilder messageBuilder = new StringBuilder();
				if(playerToAmount.get(payer)<0){
					messageBuilder.append("Paid ");
					messageBuilder.append(StaticsHandler.getAmountWithCurrency(EconomyCache.round(Math.abs(playerToAmount.get(payer)), ConfigurationLoader.getDecPlaces())));
					messageBuilder.append(" to ");
					messageBuilder.append(payer);
					event.getUser().sendMessage(Texts.builder(messageBuilder.toString()).color(TextColors.RED).build());
				}else{
					messageBuilder.append("Received ");
					messageBuilder.append(StaticsHandler.getAmountWithCurrency(EconomyCache.round(Math.abs(playerToAmount.get(payer)), ConfigurationLoader.getDecPlaces())));
					messageBuilder.append(" from ");
					messageBuilder.append(payer);
					event.getUser().sendMessage(Texts.builder(messageBuilder.toString()).color(TextColors.GREEN).build());
				}
			}

			if(serverPayament!=0){
				StringBuilder messageBuilder = new StringBuilder();
				if(serverPayament<0){
					messageBuilder.append("Paid ");
					messageBuilder.append(StaticsHandler.getAmountWithCurrency(EconomyCache.round(Math.abs(serverPayament), ConfigurationLoader.getDecPlaces())));
					messageBuilder.append(" to the server");
					event.getUser().sendMessage(Texts.builder(messageBuilder.toString()).color(TextColors.RED).build());
				}else{
					messageBuilder.append("Received ");
					messageBuilder.append(StaticsHandler.getAmountWithCurrency(EconomyCache.round(Math.abs(serverPayament), ConfigurationLoader.getDecPlaces())));
					messageBuilder.append(" from the server");
					event.getUser().sendMessage(Texts.builder(messageBuilder.toString()).color(TextColors.GREEN).build());
				}
			}

		}
	}

	@Subscribe
	public void onPreInitializationEvent(ServerStartingEvent event) {
		CommandService cmdService = game.getCommandDispatcher();

		CommandSpec balCommandSpec = CommandSpec.builder()
				.description(Texts.of("Retrieve the ballance of a player"))
				.permission("whippyconomy.bal.own")
				.arguments(GenericArguments.optional(GenericArguments.string((Texts.of("playerName")))))
				.executor(new BalCommand())
				.build();

		cmdService.register(this, balCommandSpec, ConfigurationLoader.getBalAliases());

		CommandSpec payCommandSpec = CommandSpec.builder()
				.description(Texts.of("Pay another player"))
				.permission("whippyconomy.pay")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("playerName")))
						,GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
						.executor(new PayCommand())
						.build();

		cmdService.register(this, payCommandSpec, ConfigurationLoader.getPayAliases());

		CommandSpec accHistoryCommandSpec = CommandSpec.builder()
				.description(Texts.of("List a history of transactions"))
				.permission("whippyconomy.accHistory.own")
				.arguments(GenericArguments.optional(GenericArguments.integer((Texts.of("numberOfTransactions"))), 10)
						,GenericArguments.optional(GenericArguments.string(Texts.of("playerName"))))
						.executor(new TransactionsCommand())
						.build();

		cmdService.register(this, accHistoryCommandSpec, ConfigurationLoader.getAccHistoryAliases());

		CommandSpec chargeCommandSpec = CommandSpec.builder()
				.description(Texts.of("Charge another player money"))
				.permission("whippyconomy.charge")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("playerName")))
						,GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
						.executor(new ChargeCommand())
						.build();

		cmdService.register(this, chargeCommandSpec,ConfigurationLoader.getChargeAliases());

		CommandSpec transferCommandSpec = CommandSpec.builder()
				.description(Texts.of("Transfer money from one player to another"))
				.permission("whippyconomy.transfer")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("playerNameFrom")))
						,GenericArguments.onlyOne(GenericArguments.string(Texts.of("playerNameTo")))
						,GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
						.executor(new TransferCommand())
						.build();

		cmdService.register(this, transferCommandSpec, ConfigurationLoader.getTransferAliases());

		CommandSpec giftCommandSpec = CommandSpec.builder()
				.description(Texts.of("Give a player an amount of money from the server"))
				.permission("whippyconomy.give")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("playerName")))
						,GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
						.executor(new GiftCommand())
						.build();

		cmdService.register(this, giftCommandSpec,ConfigurationLoader.getGiftAliases());

		CommandSpec bankCommandSpec = CommandSpec.builder()
				.description(Texts.of("Transfer money from current account to savings account"))
				.permission("whippyconomy.bank")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
				.executor(new BankCommand())
				.build();

		cmdService.register(this, bankCommandSpec, ConfigurationLoader.getBankAliases());

		CommandSpec withdrawCommandSpec = CommandSpec.builder()
				.description(Texts.of("Transfer money from savings account to current account"))
				.permission("whippyconomy.withdraw")
				.arguments(GenericArguments.onlyOne(GenericArguments.string(Texts.of("amount"))))
				.executor(new WithdrawCommand())
				.build();

		cmdService.register(this, withdrawCommandSpec, ConfigurationLoader.getWithdrawAliases());

		CommandSpec savingsHistoryCommandSpec = CommandSpec.builder()
				.description(Texts.of("List a history of savings transfers"))
				.permission("whippyconomy.savingsHistort")
				.arguments(GenericArguments.optional(GenericArguments.integer((Texts.of("numberOfTransfers"))), 10))
				.executor(new SavingsAccHistoryCommand())
				.build();

		cmdService.register(this, savingsHistoryCommandSpec, ConfigurationLoader.getSavingsHistoryAliases());

		if(ConfigurationLoader.hasAuctions() && ConfigurationLoader.getMaxAuctions()>0){
			cmdService.register(this, new AucCommand(), "auc");
			cmdService.register(this, new BidCommand(), "bid");
		}
		StaticsHandler.setAuctionCache(new AuctionCache());
		StaticsHandler.setAuctioneer(new Auctioneer());
		StaticsHandler.setAuctionRunner(new AuctionRunner());
	}
}


text:
package com.qiqi.demo.datatables;

import com.qiqi.demo.pager.PagingCriteria;
import com.qiqi.demo.pager.PageResultSet;
import com.qiqi.demo.pager.WebResultSet;

/**
 * datatables工具类
 * @author JOHN
 *
 */
public class DataTableUtils {

	/**
	 * 可分页结果集转化为controller返回个客户端的结果集</br>
	 * 这里返回DataTablesResultSet
	 * @param pc
	 * @param rs
	 * @return
	 */
	public static <T> WebResultSet<T> getWebResultSet(
			PagingCriteria pc, PageResultSet<T> rs) {
		return new DataTablesResultSet<T>(pc, rs);
	}

	/**
	 * 将datatables查询参数转换为通用的分页查询参数
	 * @param table
	 * @return
	 */
	public static PagingCriteria parseReqParameter(DataTablesCriteria table) {
		// TODO Auto-generated method stub
		return null;
	}

}


text:
FUNCTION_NAME=twodconv

include ../../../common/c.mk


text:
package ipvlan

import (
	"fmt"

	"github.com/Sirupsen/logrus"
	"github.com/docker/libnetwork/driverapi"
	"github.com/docker/libnetwork/netlabel"
	"github.com/docker/libnetwork/ns"
	"github.com/docker/libnetwork/osl"
	"github.com/docker/libnetwork/types"
)

// CreateEndpoint assigns the mac, ip and endpoint id for the new container
func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
	epOptions map[string]interface{}) error {
	defer osl.InitOSContext()()

	if err := validateID(nid, eid); err != nil {
		return err
	}
	n, err := d.getNetwork(nid)
	if err != nil {
		return fmt.Errorf("network id %q not found", nid)
	}
	if ifInfo.MacAddress() != nil {
		return fmt.Errorf("%s interfaces do not support custom mac address assigment", ipvlanType)
	}
	ep := &endpoint{
		id:     eid,
		nid:    nid,
		addr:   ifInfo.Address(),
		addrv6: ifInfo.AddressIPv6(),
	}
	if ep.addr == nil {
		return fmt.Errorf("create endpoint was not passed an IP address")
	}
	// disallow port mapping -p
	if opt, ok := epOptions[netlabel.PortMap]; ok {
		if _, ok := opt.([]types.PortBinding); ok {
			if len(opt.([]types.PortBinding)) > 0 {
				logrus.Warnf("%s driver does not support port mappings", ipvlanType)
			}
		}
	}
	// disallow port exposure --expose
	if opt, ok := epOptions[netlabel.ExposedPorts]; ok {
		if _, ok := opt.([]types.TransportPort); ok {
			if len(opt.([]types.TransportPort)) > 0 {
				logrus.Warnf("%s driver does not support port exposures", ipvlanType)
			}
		}
	}

	if err := d.storeUpdate(ep); err != nil {
		return fmt.Errorf("failed to save ipvlan endpoint %s to store: %v", ep.id[0:7], err)
	}

	n.addEndpoint(ep)

	return nil
}

// DeleteEndpoint remove the endpoint and associated netlink interface
func (d *driver) DeleteEndpoint(nid, eid string) error {
	defer osl.InitOSContext()()
	if err := validateID(nid, eid); err != nil {
		return err
	}
	n := d.network(nid)
	if n == nil {
		return fmt.Errorf("network id %q not found", nid)
	}
	ep := n.endpoint(eid)
	if ep == nil {
		return fmt.Errorf("endpoint id %q not found", eid)
	}
	if link, err := ns.NlHandle().LinkByName(ep.srcName); err == nil {
		ns.NlHandle().LinkDel(link)
	}

	if err := d.storeDelete(ep); err != nil {
		logrus.Warnf("Failed to remove ipvlan endpoint %s from store: %v", ep.id[0:7], err)
	}

	return nil
}


text:
class ZSwcTerminalSurfaceMetric : public ZSwcMetric
{
public:
  ZSwcTerminalSurfaceMetric();

  virtual double measureDistance(const ZSwcTree *tree1, const ZSwcTree *tree2);
};

#endif // ZSWCTERMINALSURFACEMETRIC_H


text:
package org.apache.struts.webapp.example;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Locale;
import java.util.Hashtable;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.PropertyUtils;

/**
 * Implementation of Action that validates and creates or
 * updates the mail subscription entered by the user.
 *
 * @author Craig R. McClanahan
 * @version $Revision: 1.2 $ $Date: 2001/04/14 12:53:08 $
 */

public final class SaveSubscriptionAction extends Action {

    // --------------------------------------------------------- Public Methods

    /**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     * Return an ActionForward instance describing where and how
     * control should be forwarded, or null if the response has
     * already been completed.
     *
     * @param mapping The ActionMapping used to select this instance
     * @param actionForm The optional ActionForm bean for this request (if any)
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     */
    public ActionForward perform(ActionMapping mapping,
				 ActionForm form,
				 HttpServletRequest request,
				 HttpServletResponse response)
	throws IOException, ServletException {

	// Extract attributes and parameters we will need
	Locale locale = getLocale(request);
	MessageResources messages = getResources();
	HttpSession session = request.getSession();
	SubscriptionForm subform = (SubscriptionForm) form;
	String action = request.getParameter("action");
	if (action == null)
	    action = "?";
        if (servlet.getDebug() >= 1)
            servlet.log("SaveSubscriptionAction:  Processing " + action +
                        " action");

	// Is there a currently logged on user?
	User user = (User) session.getAttribute(Constants.USER_KEY);
	if (user == null) {
            if (servlet.getDebug() >= 1)
                servlet.log(" User is not logged on in session "
                            + session.getId());
	    return (servlet.findForward("logon"));
        }

	// Is there a related Subscription object?
	Subscription subscription =
	  (Subscription) session.getAttribute(Constants.SUBSCRIPTION_KEY);
	if (subscription == null) {
	    servlet.log(" Missing subscription for user '" +
	                 user.getUsername() + "'");
	    response.sendError(HttpServletResponse.SC_BAD_REQUEST,
	                       messages.getMessage("error.noSubscription"));
	    return (null);
	}

	// Was this transaction cancelled?
	if (isCancelled(request)) {
	    if (servlet.getDebug() >= 1)
	        servlet.log(" Transaction '" + action +
	                    "' was cancelled");
	    if (mapping.getAttribute() != null)
	        session.removeAttribute(mapping.getAttribute());
	    session.removeAttribute(Constants.SUBSCRIPTION_KEY);
	    return (mapping.findForward("success"));
	}

	// Was this transaction a Delete?
	if (action.equals("Delete")) {
	    if (servlet.getDebug() >= 1)
	        servlet.log(" Deleting mail server '" +
	                    subscription.getHost() + "' for user '" +
	                    user.getUsername() + "'");
	    subscription.setHost(null);
	    subscription.setUser(null);
	    if (mapping.getAttribute() != null)
	        session.removeAttribute(mapping.getAttribute());
	    session.removeAttribute(Constants.SUBSCRIPTION_KEY);
	    return (mapping.findForward("success"));
	}

	// All required validations were done by the form itself

	// Update the persistent subscription information
        if (servlet.getDebug() >= 1)
            servlet.log(" Populating database from form bean");
        try {
            PropertyUtils.copyProperties(subscription, subform);
        } catch (InvocationTargetException e) {
            Throwable t = e.getTargetException();
            if (t == null)
                t = e;
            servlet.log("Subscription.populate", t);
            throw new ServletException("Subscription.populate", t);
        } catch (Throwable t) {
            servlet.log("Subscription.populate", t);
            throw new ServletException("Subscription.populate", t);
        }

	// Remove the obsolete form bean and current subscription
	if (mapping.getAttribute() != null) {
            if ("request".equals(mapping.getScope()))
                request.removeAttribute(mapping.getAttribute());
            else
                session.removeAttribute(mapping.getAttribute());
        }
	session.removeAttribute(Constants.SUBSCRIPTION_KEY);

	// Forward control to the specified success URI
        if (servlet.getDebug() >= 1)
            servlet.log(" Forwarding to success page");
	return (mapping.findForward("success"));

    }

}


text:
package org.apache.kafka.streams.state;

import org.apache.kafka.common.utils.Bytes;

/**
 * A store supplier that can be used to create one or more {@link WindowStore WindowStore<Bytes, byte[]>} instances of type <Byte, byte[]>.
 *
 * For any stores implementing the {@link WindowStore WindowStore<Bytes, byte[]>} interface, null value bytes are considered as "not exist". This means:
 *
 * 1. Null value bytes in put operations should be treated as delete.
 * 2. Null value bytes should never be returned in range query results.
 */
public interface WindowBytesStoreSupplier extends StoreSupplier<WindowStore<Bytes, byte[]>> {
    /**
     * The number of segments the store has. If your store is segmented then this should be the number of segments
     * in the underlying store.
     * It is also used to reduce the amount of data that is scanned when caching is enabled.
     *
     * @return number of segments
     */
    int segments();

    /**
     * The size of the windows any store created from this supplier is creating.
     *
     * @return window size
     */
    long windowSize();

    /**
     * Whether or not this store is retaining duplicate keys.
     * Usually only true if the store is being used for joins.
     * Note this should return false if caching is enabled.
     *
     * @return true if duplicates should be retained
     */
    boolean retainDuplicates();

    /**
     * The time period for which the {@link WindowStore} will retain historic data.
     *
     * @return retentionPeriod
     */
    long retentionPeriod();
}


text:
/*
    Implement the ADT stack as auto-resizable array.
    Resize the capacity on demand (when no space is available to add / insert a new element).
 */
using System;

namespace Problem_12___Implement_Stack
{
    public class StartUp
    {
        public static void Main()
        {
            CustomStack<int> myFirstStack = new CustomStack<int>();

            myFirstStack.Push(5);
            myFirstStack.Push(1);
            myFirstStack.Push(6);
            myFirstStack.Push(3);
            myFirstStack.Push(13);

            Console.WriteLine("Print all items:");
            myFirstStack.PrintAllItems();

            Console.WriteLine("Poped element: {0}", myFirstStack.Pop());
            Console.WriteLine("Peeked element: {0}", myFirstStack.Peek());
        }
    }
}


text:
package com.qframework.core;

import java.applet.Applet;
import java.awt.Component;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLException;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureIO;

public class TextureFactory {

	public enum Type {
		DEFAULT,
		FONT,
	}

	public float mU1;
	public float mV1;
	public float mU2;
	public float mV2;
	public float mCp;

	public int mTextureDefault;
	public int mTextureFont;
	HashMap<String, Integer>	mTextures = new HashMap<String, Integer>();
	Vector<Texture>  mTextureIds = new Vector<Texture>();
	Vector<StringString> mInfos = new Vector<StringString>();
	Vector<String>	mToDelete = new Vector<String>();

	boolean mUpdated = false;
	GameonApp mApp;
	public TextureFactory(GameonApp app)
	{
		mApp = app;
	}
	private int loadTextureFromFile(GL2 gl , String fname, boolean system)
	{
            String location = "";
            location += fname;
            //System.out.println(" name " + location + "\n");
            InputStream  instream = mApp.getInputStream(location , system);
            try {
                Texture text = TextureIO.newTexture(instream, true, "png");
                gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
                gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
                gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
                gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
                gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE,GL2.GL_MODULATE);
                //text.enable(gl);
                text.enable(gl);
                int id = mTextureIds.size();
                mTextureIds.add( text);
                mUpdated = true;
                //return text.getTextureObject(gl);
                return text.getTextureObject(gl);
            } catch (IOException ex) {
            	return -1;
                //Logger.getLogger(TextureFactory.class.getName()).log(Level.SEVERE, null, ex);
            } catch (GLException ex) {
            	return -1;
                //Logger.getLogger(TextureFactory.class.getName()).log(Level.SEVERE, null, ex);
            }
            //return -1;
	}

	public void init(GL2 gl) {

		mTextures.clear();
		mTextureDefault = loadTextureFromFile( gl, "whitesys.png", true);
		mTextureFont = loadTextureFromFile( gl, "fontsys.png" , true);
		for (int a=0; a< mInfos.size(); a++)
		{
			StringString e = mInfos.get(a);
			newTexture(gl,e.b, e.a , false);
		}

            //loadAssetsTextures(gl);

	}
	public int get(Type type) {
		switch (type) {

			case FONT: return mTextureFont;
			case DEFAULT: return mTextureDefault;
			//mTextureFont;
		}
		//Log.d("model", " get failed ");
		return mTextureDefault;
	}
	public int getTexture(String strData) {
		//Log.d("model" , " getTexture " + strData);

		if (mTextures.containsKey(strData))
		{
			//Log.d("model" , " returning " + mTextures.get(strData));
			return mTextures.get(strData);
		}
		//Log.d("model", " get failed " + strData);
		return mTextureDefault;
	}

	public void deleteTexture(GL2 gl, String textname)
	{
		mToDelete.add(textname);
	}

	public void flushTextures(GL2 gl)
	{
		for (int a=0; a< mToDelete.size(); a++)
		{
			clearTexture(gl, mToDelete.get(a));
		}
		mToDelete.clear();
	}

	private void clearTexture(GL2 gl, String textname)
	{
		if (mTextures.containsKey(textname))
		{
			int id = mTextures.get(textname);
			gl.glDeleteTextures(1 , new int[]{id} ,0);
			mTextures.remove(textname);
			for (int a=0; a < mInfos.size(); a++)
			{
				StringString info = mInfos.get(a);
				if (info.b.equals(textname))
				{
					mInfos.remove(a);
					break;
				}
			}
		}

	}
	public void clear() {
		// TODO Auto-generated method stub
		mTextures.clear();
		mInfos.clear();
	}

	public void newTexture(GL2 gl,String textname , String textfile, boolean add)
	{

		int texture =  loadTextureFromFile( gl, textfile, false);
		if (texture > 0)
        {
			mTextures.put(textname, texture);
			if (add)
			{
				StringString info = new StringString();
				info.a = textfile;
				info.b = textname;
				mInfos.add( info );
			}
			if (textname.equals("font"))
			{
				mTextureFont = texture;
			}
        }else
        {
        	System.out.println("cant load " + textname);
        }

	}
	public boolean isUpdated()
	{
		return mUpdated;
	}

	public void resetUpdated()
	{
		mUpdated = false;
	}

	public void setParam(float u1, float v1, float u2, float v2, float cp) {
		mU1 = u1;
		mV1 = v1;
		mU2 = u2;
		mV2 = v2;
		mCp = cp;

	}

    public void initTextures(GL2 gl, JSONObject response)
    {
        // init layout
		try {
	    	JSONArray areas;
			areas = response.getJSONArray("texture");

	        for (int a=0; a< areas.length(); a++)
	        {
	            JSONObject pCurr = areas.getJSONObject(a);
	            processTexture(gl, pCurr);
	        }
		} catch (JSONException e) {
			e.printStackTrace();
        }

	}

    private void processTexture(GL2 gl, JSONObject areaData) {
    	try {
			String name = areaData.getString("name");
			String file = areaData.getString("file");

			if (name != null && name.length() > 0 && file != null && file.length() > 0)
			{
				newTexture(gl ,name , file , true);
			}
    	}
    	catch (JSONException e) {

    		e.printStackTrace();
         }
    }

}


text:
package org.mitre.synthea.helpers;

import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * The FactTable helper class aids in the export of database-style
 * Fact Tables. If you have a "table" where each row is a fact or
 * lookup table where a value should be referenced by an ID, you
 * can add these keys and facts to this table and get back the ID.
 */
public class FactTable {
  /**
   * System-dependent string for a line break. (\n on Mac, *nix, \r\n on Windows)
   */
  private static final String NEWLINE = System.lineSeparator();
  /** Table column headers. Comma-separated. */
  private String header;
  /** This is the ID sequence generator. */
  private AtomicInteger id;
  /** Lookup the ID for a key. */
  private Map<String,Integer> keys;
  /** Lookup the fact by ID. */
  private Map<Integer,String> facts;
  /** Synchronization lock. */
  private static final Object LOCK = new Object();

  /**
   * Create a FactTable with an ID that starts at 1
   * and increments with each new key/fact.
   */
  public FactTable() {
    id = new AtomicInteger(1);
    keys = new HashMap<String,Integer>();
    facts = new HashMap<Integer,String>();
  }

  /**
   * Set the next ID.
   * @param id The value of the next ID.
   */
  public void setNextId(int id) {
    synchronized (LOCK) {
      this.id = new AtomicInteger(id);
    }
  }

  /**
   * Set the column headers of the fact table.
   * @param header Column headers of the fact table.
   */
  public void setHeader(String header) {
    this.header = header;
  }

  /**
   * Get the ID for a fact by a key.
   * @param key The key for a fact. For example, 'M' or 'F'.
   * @return The ID for the fact. For example, 1 or 2.
   */
  public int getFactId(String key) {
    synchronized (LOCK) {
      return keys.get(key);
    }
  }

  /**
   * Get the fact for a given key.
   * @param key The key for a fact. For example, 'M' or 'F'.
   * @return The fact. For example, 'Male' or 'Female'.
   */
  public String getFactByKey(String key) {
    synchronized (LOCK) {
      Integer id = keys.get(key);
      return facts.get(id);
    }
  }

  /**
   * Get the fact for a given key.
   * @param id The ID for the fact. For example, 1 or 2.
   * @return The fact. For example, 'Male' or 'Female'.
   */
  public String getFactById(Integer id) {
    synchronized (LOCK) {
      return facts.get(id);
    }
  }

  /**
   * Adds a new key/fact combination to the table
   * and returns the ID. If the key already exists,
   * the appropriate ID is returned without modifying
   * the table.
   *
   * @param key The key for a fact. For example, 'M' or 'F'.
   * @param fact The fact. For example, 'Male' or 'Female'.
   * @return The ID for the fact. For example, 1 or 2.
   */
  public int addFact(String key, String fact) {
    synchronized (LOCK) {
      if (keys.containsKey(key)) {
        return keys.get(key);
      }

      int next = id.getAndIncrement();
      keys.put(key, next);
      facts.put(next, fact);
      return next;
    }
  }

  /**
   * Write the contents of the FactTable to a file.
   * @param writer The open Writer to use to record the FactTable.
   * @throws IOException On errors.
   */
  public void write(Writer writer) throws IOException {
    synchronized (LOCK) {
      writer.write(header);
      writer.write(NEWLINE);
      for (Integer key : facts.keySet()) {
        writer.write(key.toString());
        writer.write(',');
        String fact = facts.get(key);
        if (fact != null) {
          writer.write(facts.get(key));
        }
        writer.write(NEWLINE);
      }
      writer.flush();
    }
  }
}


text:
package com.zjg.enjoy.weexfinance.common.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.List;

/**
 * Created by yanghongbing on 16/3/17.
 */
public class JsonUtils {

    public static <T> T parseObject(String text, Class<T> cls) {
        T t = null;
        try {
            t = JSON.parseObject(text, cls);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return t;
    }

    public static String toJSONString(Object obj) {
        String objString = null;
        try {
            objString = JSON.toJSONString(obj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return objString;
    }

    public static JSONArray parseJson(String json) {
        JSONArray jsonArray = null;
        try {
            jsonArray = JSON.parseArray(json);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonArray;
    }

    public static <T> List<T> parseArray(String json, Class<T> tClass) {
        List<T> list = null;
        try {
            list = JSON.parseArray(json, tClass);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

    public static JSONObject parseJsonObject(String json) {
        JSONObject object = null;
        try {
            object = JSON.parseObject(json);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return object;
    }

}


text:
<?php
namespace VincentWon\Mws;

/**
 * Core class for Amazon Reports API.
 *
 * This is the core class for all objects in the Amazon Reports section.
 * It contains no methods in itself other than the constructor.
 */
abstract class AmazonReportsCore extends AmazonCore
{
    /**
     * AmazonReportsCore constructor sets up key information used in all Amazon Reports Core requests
     *
     * This constructor is called when initializing all objects in the Amazon Reports Core.
     * The parameters are passed by the child objects' constructors, which are
     * in turn passed to the AmazonCore constructor. See it for more information
     * on these parameters and common methods.
     * @param string $s [optional]
Name for the store you want to use.
     * This parameter is optional if only one store is defined in the config file.

     * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
     * This defaults to FALSE.

     * @param array|string $m [optional]
The files (or file) to use in Mock Mode.

     * @param string $config [optional]
An alternate config file to set. Used for testing.

     */
    public function __construct($s = null, $mock = false, $m = null, $config = null)
    {
        parent::__construct($s, $mock, $m, $config);
        $this->urlbranch = '';
        if (isset($this->env['AMAZON_VERSION_REPORTS'])) {
            $this->options['Version'] = $this->env['AMAZON_VERSION_REPORTS'];
        }
    }
}