text:
/*
 *	ISO C99 Standard: 7.12 Mathematics	<math.h>
 */

#ifndef	_MATH_H
#define	_MATH_H	1

#include <features.h>

__BEGIN_DECLS

/* Get machine-dependent HUGE_VAL value (returned on overflow).
   On all IEEE754 machines, this is +Infinity.  */
#include <bits/huge_val.h>
#ifdef __USE_ISOC99
# include <bits/huge_valf.h>
# include <bits/huge_vall.h>

/* Get machine-dependent INFINITY value.  */
# include <bits/inf.h>

/* Get machine-dependent NAN value (returned for some domain errors).  */
# include <bits/nan.h>
#endif /* __USE_ISOC99 */

/* Get general and ISO C99 specific information.  */
#include <bits/mathdef.h>

/* The file <bits/mathcalls.h> contains the prototypes for all the
   actual math functions.  These macros are used for those prototypes,
   so we can easily declare each function as both `name' and `__name',
   and can declare the float versions `namef' and `__namef'.  */

#define __MATHCALL(function,suffix, args)	\
  __MATHDECL (_Mdouble_,function,suffix, args)
#define __MATHDECL(type, function,suffix, args) \
  __MATHDECL_1(type, function,suffix, args); \
  __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
#define __MATHCALLX(function,suffix, args, attrib)	\
  __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
#define __MATHDECLX(type, function,suffix, args, attrib) \
  __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
  __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
#define __MATHDECL_1(type, function,suffix, args) \
  extern type __MATH_PRECNAME(function,suffix) args __THROW

#define _Mdouble_ 		double
#define __MATH_PRECNAME(name,r)	__CONCAT(name,r)
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
# define _Mdouble_END_NAMESPACE   __END_NAMESPACE_STD
#include <bits/mathcalls.h>
#undef	_Mdouble_
#undef _Mdouble_BEGIN_NAMESPACE
#undef _Mdouble_END_NAMESPACE
#undef	__MATH_PRECNAME

#if defined __USE_MISC || defined __USE_ISOC99

/* Include the file of declarations again, this time using `float'
   instead of `double' and appending f to each function name.  */

# ifndef _Mfloat_
#  define _Mfloat_		float
# endif
# define _Mdouble_ 		_Mfloat_
# ifdef __STDC__
#  define __MATH_PRECNAME(name,r) name##f##r
# else
#  define __MATH_PRECNAME(name,r) name/**/f/**/r
# endif
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
# define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
# include <bits/mathcalls.h>
# undef	_Mdouble_
# undef _Mdouble_BEGIN_NAMESPACE
# undef _Mdouble_END_NAMESPACE
# undef	__MATH_PRECNAME

# if (__STDC__ - 0 || __GNUC__ - 0) \
     && (!defined __NO_LONG_DOUBLE_MATH \
	 || defined __LDBL_COMPAT \
	 || !defined _LIBC)
#  ifdef __LDBL_COMPAT

#   ifdef __USE_ISOC99
extern float __nldbl_nexttowardf (float __x, long double __y)
				  __THROW __attribute__ ((__const__));
#    ifdef __REDIRECT_NTH
extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y),
			     __nldbl_nexttowardf)
     __attribute__ ((__const__));
extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y),
			      nextafter) __attribute__ ((__const__));
extern long double __REDIRECT_NTH (nexttowardl,
				   (long double __x, long double __y),
				   nextafter) __attribute__ ((__const__));
#    endif
#   endif
#  endif

#  if defined __LDBL_COMPAT || defined __NO_LONG_DOUBLE_MATH

#   undef __MATHDECL_1
#   define __MATHDECL_2(type, function,suffix, args, alias) \
  extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
			     args, alias)
#   define __MATHDECL_1(type, function,suffix, args) \
  __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
#  endif

/* Include the file of declarations again, this time using `long double'
   instead of `double' and appending l to each function name.  */
#  ifndef _Mlong_double_
#   define _Mlong_double_	long double
#  endif
#  define _Mdouble_ 		_Mlong_double_
#  ifdef __STDC__
#   define __MATH_PRECNAME(name,r) name##l##r
#  else
#   define __MATH_PRECNAME(name,r) name/**/l/**/r
#  endif
#  define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
#  define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
#  include <bits/mathcalls.h>
#  undef _Mdouble_
#  undef _Mdouble_BEGIN_NAMESPACE
#  undef _Mdouble_END_NAMESPACE
#  undef __MATH_PRECNAME

# endif /* __STDC__ || __GNUC__ */

#endif	/* Use misc or ISO C99.  */
#undef	__MATHDECL_1
#undef	__MATHDECL
#undef	__MATHCALL

#if defined __USE_MISC || defined __USE_XOPEN
/* This variable is used by `gamma' and `lgamma'.  */
extern int signgam;
#endif

/* ISO C99 defines some generic macros which work on any data type.  */
#ifdef __USE_ISOC99

/* Get the architecture specific values describing the floating-point
   evaluation.  The following symbols will get defined:

    float_t	floating-point type at least as wide as `float' used
		to evaluate `float' expressions
    double_t	floating-point type at least as wide as `double' used
		to evaluate `double' expressions

    FLT_EVAL_METHOD
		Defined to
		  0	if `float_t' is `float' and `double_t' is `double'
		  1	if `float_t' and `double_t' are `double'
		  2	if `float_t' and `double_t' are `long double'
		  else	`float_t' and `double_t' are unspecified

    INFINITY	representation of the infinity value of type `float'

    FP_FAST_FMA
    FP_FAST_FMAF
    FP_FAST_FMAL
		If defined it indicates that the `fma' function
		generally executes about as fast as a multiply and an add.
		This macro is defined only iff the `fma' function is
		implemented directly with a hardware multiply-add instructions.

    FP_ILOGB0	Expands to a value returned by `ilogb (0.0)'.
    FP_ILOGBNAN	Expands to a value returned by `ilogb (NAN)'.

    DECIMAL_DIG	Number of decimal digits supported by conversion between
		decimal and all internal floating-point formats.

*/

/* All floating-point numbers can be put in one of these categories.  */
enum
  {
    FP_NAN,
# define FP_NAN FP_NAN
    FP_INFINITE,
# define FP_INFINITE FP_INFINITE
    FP_ZERO,
# define FP_ZERO FP_ZERO
    FP_SUBNORMAL,
# define FP_SUBNORMAL FP_SUBNORMAL
    FP_NORMAL
# define FP_NORMAL FP_NORMAL
  };

/* Return number of classification appropriate for X.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define fpclassify(x) \
     (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
# else
#  define fpclassify(x) \
     (sizeof (x) == sizeof (float)					      \
      ? __fpclassifyf (x)						      \
      : sizeof (x) == sizeof (double)					      \
      ? __fpclassify (x) : __fpclassifyl (x))
# endif

/* Return nonzero value if sign of X is negative.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define signbit(x) \
     (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
# else
#  define signbit(x) \
     (sizeof (x) == sizeof (float)					      \
      ? __signbitf (x)							      \
      : sizeof (x) == sizeof (double)					      \
      ? __signbit (x) : __signbitl (x))
# endif

/* Return nonzero value if X is not +-Inf or NaN.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isfinite(x) \
     (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
# else
#  define isfinite(x) \
     (sizeof (x) == sizeof (float)					      \
      ? __finitef (x)							      \
      : sizeof (x) == sizeof (double)					      \
      ? __finite (x) : __finitel (x))
# endif

/* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN.  */
# define isnormal(x) (fpclassify (x) == FP_NORMAL)

/* Return nonzero value if X is a NaN.  We could use `fpclassify' but
   we already have this functions `__isnan' and it is faster.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isnan(x) \
     (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
# else
#  define isnan(x) \
     (sizeof (x) == sizeof (float)					      \
      ? __isnanf (x)							      \
      : sizeof (x) == sizeof (double)					      \
      ? __isnan (x) : __isnanl (x))
# endif

/* Return nonzero value is X is positive or negative infinity.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isinf(x) \
     (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
# else
#  define isinf(x) \
     (sizeof (x) == sizeof (float)					      \
      ? __isinff (x)							      \
      : sizeof (x) == sizeof (double)					      \
      ? __isinf (x) : __isinfl (x))
# endif

/* Bitmasks for the math_errhandling macro.  */
# define MATH_ERRNO	1	/* errno set by math functions.  */
# define MATH_ERREXCEPT	2	/* Exceptions raised by math functions.  */

/* By default all functions support both errno and exception handling.
   In gcc's fast math mode and if inline functions are defined this
   might not be true.  */
# ifndef __FAST_MATH__
#  define math_errhandling	(MATH_ERRNO | MATH_ERREXCEPT)
# endif

#endif /* Use ISO C99.  */

#ifdef	__USE_MISC
/* Support for various different standard error handling behaviors.  */
typedef enum
{
  _IEEE_ = -1,	/* According to IEEE 754/IEEE 854.  */
  _SVID_,	/* According to System V, release 4.  */
  _XOPEN_,	/* Nowadays also Unix98.  */
  _POSIX_,
  _ISOC_	/* Actually this is ISO C99.  */
} _LIB_VERSION_TYPE;

/* This variable can be changed at run-time to any of the values above to
   affect floating point error handling behavior (it may also be necessary
   to change the hardware FPU exception settings).  */
extern _LIB_VERSION_TYPE _LIB_VERSION;
#endif

#ifdef __USE_SVID
/* In SVID error handling, `matherr' is called with this description
   of the exceptional condition.

   We have a problem when using C++ since `exception' is a reserved
   name in C++.  */
# ifdef __cplusplus
struct __exception
# else
struct exception
# endif
  {
    int type;
    char *name;
    double arg1;
    double arg2;
    double retval;
  };

# ifdef __cplusplus
extern int matherr (struct __exception *__exc) throw ();
# else
extern int matherr (struct exception *__exc);
# endif

# define X_TLOSS	1.41484755040568800000e+16

/* Types of exceptions in the `type' field.  */
# define DOMAIN		1
# define SING		2
# define OVERFLOW	3
# define UNDERFLOW	4
# define TLOSS		5
# define PLOSS		6

/* SVID mode specifies returning this large value instead of infinity.  */
# define HUGE		3.40282347e+38F

#else	/* !SVID */

# ifdef __USE_XOPEN
/* X/Open wants another strange constant.  */
#  define MAXFLOAT	3.40282347e+38F
# endif

#endif	/* SVID */

/* Some useful constants.  */
#if defined __USE_BSD || defined __USE_XOPEN
# define M_E		2.7182818284590452354	/* e */
# define M_LOG2E	1.4426950408889634074	/* log_2 e */
# define M_LOG10E	0.43429448190325182765	/* log_10 e */
# define M_LN2		0.69314718055994530942	/* log_e 2 */
# define M_LN10		2.30258509299404568402	/* log_e 10 */
# define M_PI		3.14159265358979323846	/* pi */
# define M_PI_2		1.57079632679489661923	/* pi/2 */
# define M_PI_4		0.78539816339744830962	/* pi/4 */
# define M_1_PI		0.31830988618379067154	/* 1/pi */
# define M_2_PI		0.63661977236758134308	/* 2/pi */
# define M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
# define M_SQRT2	1.41421356237309504880	/* sqrt(2) */
# define M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
#endif

/* The above constants are not adequate for computation using `long double's.
   Therefore we provide as an extension constants with similar names as a
   GNU extension.  Provide enough digits for the 128-bit IEEE quad.  */
#ifdef __USE_GNU
# define M_El		2.7182818284590452353602874713526625L  /* e */
# define M_LOG2El	1.4426950408889634073599246810018921L  /* log_2 e */
# define M_LOG10El	0.4342944819032518276511289189166051L  /* log_10 e */
# define M_LN2l		0.6931471805599453094172321214581766L  /* log_e 2 */
# define M_LN10l	2.3025850929940456840179914546843642L  /* log_e 10 */
# define M_PIl		3.1415926535897932384626433832795029L  /* pi */
# define M_PI_2l	1.5707963267948966192313216916397514L  /* pi/2 */
# define M_PI_4l	0.7853981633974483096156608458198757L  /* pi/4 */
# define M_1_PIl	0.3183098861837906715377675267450287L  /* 1/pi */
# define M_2_PIl	0.6366197723675813430755350534900574L  /* 2/pi */
# define M_2_SQRTPIl	1.1283791670955125738961589031215452L  /* 2/sqrt(pi) */
# define M_SQRT2l	1.4142135623730950488016887242096981L  /* sqrt(2) */
# define M_SQRT1_2l	0.7071067811865475244008443621048490L  /* 1/sqrt(2) */
#endif

/* When compiling in strict ISO C compatible mode we must not use the
   inline functions since they, among other things, do not set the
   `errno' variable correctly.  */
#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES
# define __NO_MATH_INLINES	1
#endif

#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97)
/* ISO C99 defines some macros to compare number while taking care for
   unordered numbers.  Many FPUs provide special instructions to support
   these operations.  Generic support in GCC for these as builtins went
   in before 3.0.0, but not all cpus added their patterns.  We define
   versions that use the builtins here, and <bits/mathinline.h> will
   undef/redefine as appropriate for the specific GCC version in use.  */
# define isgreater(x, y)	__builtin_isgreater(x, y)
# define isgreaterequal(x, y)	__builtin_isgreaterequal(x, y)
# define isless(x, y)		__builtin_isless(x, y)
# define islessequal(x, y)	__builtin_islessequal(x, y)
# define islessgreater(x, y)	__builtin_islessgreater(x, y)
# define isunordered(u, v)	__builtin_isunordered(u, v)
#endif

/* Get machine-dependent inline versions (if there are any).  */
#ifdef __USE_EXTERN_INLINES
# include <bits/mathinline.h>
#endif

#ifdef __USE_ISOC99
/* If we've still got undefined comparison macros, provide defaults.  */

/* Return nonzero value if X is greater than Y.  */
# ifndef isgreater
#  define isgreater(x, y) \
  (__extension__							      \
   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
      !isunordered (__x, __y) && __x > __y; }))
# endif

/* Return nonzero value if X is greater than or equal to Y.  */
# ifndef isgreaterequal
#  define isgreaterequal(x, y) \
  (__extension__							      \
   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
      !isunordered (__x, __y) && __x >= __y; }))
# endif

/* Return nonzero value if X is less than Y.  */
# ifndef isless
#  define isless(x, y) \
  (__extension__							      \
   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
      !isunordered (__x, __y) && __x < __y; }))
# endif

/* Return nonzero value if X is less than or equal to Y.  */
# ifndef islessequal
#  define islessequal(x, y) \
  (__extension__							      \
   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
      !isunordered (__x, __y) && __x <= __y; }))
# endif

/* Return nonzero value if either X is less than Y or Y is less than X.  */
# ifndef islessgreater
#  define islessgreater(x, y) \
  (__extension__							      \
   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
      !isunordered (__x, __y) && (__x < __y || __y < __x); }))
# endif

/* Return nonzero value if arguments are unordered.  */
# ifndef isunordered
#  define isunordered(u, v) \
  (__extension__							      \
   ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v);			      \
      fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
# endif

#endif

__END_DECLS

#endif /* math.h  */


text:
package fr.openwide.core.wicket.more.link.descriptor.builder.state.main.common;

import java.util.Collection;
import java.util.TreeSet;

import org.springframework.core.convert.TypeDescriptor;

import com.google.common.base.Supplier;

import fr.openwide.core.wicket.more.link.descriptor.builder.state.main.INoMappableParameterMainState;
import fr.openwide.core.wicket.more.link.descriptor.builder.state.parameter.chosen.common.IChosenParameterState;
import fr.openwide.core.wicket.more.link.descriptor.builder.state.parameter.chosen.common.IOneChosenParameterState;
import fr.openwide.core.wicket.more.link.descriptor.mapper.ILinkDescriptorMapper;

/**
 * A state from which one can declare a mappable parameter.
 */
public interface IMappableParameterDeclarationState {

	/**
	 * Declare a mappable parameter that can be provided later through a
	 * {@link ILinkDescriptorMapper link descriptor mapper},
	 * but can still be referenced when building through methods such as {@link IOneChosenParameterState#map(String)} or
	 * {@link IChosenParameterState#map(fr.openwide.core.wicket.more.link.descriptor.parameter.mapping.factory.ILinkParameterMappingEntryFactory)}
	 * @param clazz The type of the parameter on the Java side, i.e. the type of objects that will be contained in models
	 * passed to the {@link ILinkDescriptorMapper link descriptor mapper}.
	 * @return A builder state that allows for referencing the newly-added parameter. The exact type of this state is
	 * defined in extending interfaces such as {@link INoMappableParameterMainState}.
	 */
	<TParam> IMainState<?> model(Class<TParam> clazz);

	/**
	 * {@link #model(Class) Declare a mappable parameter of Collection type}.
	 *
This method should be used when the model is expected to contain an {@link Collection},
	 * since it enables implementors to convert the collection's elements as well as the collection itself.
	 * @param clazz The type of the parameter on the Java side, i.e. the type of objects that will be contained in models
	 * passed to the {@link IOneParameterLinkDescriptorMapper#map(org.apache.wicket.model.IModel) link descriptor mapper}.
	 * @param elementType The expected type of elements stored in the parameter.
	 * @return A builder state that allows for referencing the newly-added parameter. The exact type of this state is
	 * defined in extending interfaces such as {@link INoMappableParameterMainState}.
	 * @see #model(Class)
	 */
	<TParam extends Collection<TElement>, TElement> IMainState<?> model(Class<? super TParam> clazz,
			Class<TElement> elementType);

	/**
	 * {@link #model(Class) Declare a mappable parameter of Collection type}.
	 *
This method should be used when the model is expected to contain an {@link Collection},
	 * since it enables implementors to convert the collection's elements as well as the collection itself.
	 * @param clazz The type of the parameter on the Java side, i.e. the type of objects that will be contained in models
	 * passed to the {@link IOneParameterLinkDescriptorMapper#map(org.apache.wicket.model.IModel) link descriptor mapper}.
	 * @param elementTypeDescriptor The expected type of elements stored in the parameter.
	 * @return A builder state that allows for referencing the newly-added parameter. The exact type of this state is
	 * defined in extending interfaces such as {@link INoMappableParameterMainState}.
	 * @see #model(Class)
	 */
	<TParam extends Collection<?>> IMainState<?> model(Class<? super TParam> clazz,
			TypeDescriptor elementTypeDescriptor);

	/**
	 * Similar to {@link #model(Class, TypeDescriptor)}, but additionally allows to define the
	 * exact collection implementation to use (for instance a {@link TreeSet} even if the raw type is simply
	 * {@link Collection}).
	 * @see #model(Class, TypeDescriptor)
	 */
	<TParam extends Collection<?>> IMainState<?> model(Class<? super TParam> clazz,
			TypeDescriptor elementTypeDescriptor, Supplier<? extends TParam> emptyCollectionSupplier);

}

redpajama_set_name: RedPajamaGithub


text:
NS_FS_BEGIN

GpsProvider* GpsProvider::create()
{
	return new GpsProvider();
}

GpsProvider::GpsProvider()
{

}

GpsProvider::~GpsProvider()
{

}

void GpsProvider::getLastKnownLocation(float* latitude,float* longitude)
{
	*latitude=0;
	*longitude=0;
}

const char* GpsProvider::className()
{
	return "GpsProvider";
}

NS_FS_END


text:
const ExceptionHandler = require("./ExceptionHandler.js")
const SymbolResolver = require("./SymbolResolver.js")
const InputEmptyException = require("../Exceptions/InputEmptyException.js")

class Evaluator
{
    constructor(ace, parser)
    {
        this.ace = ace
        this.parser = parser

        this.exceptionHandler = new ExceptionHandler(this.ace)
        this.symbolResolver = new SymbolResolver()
    }

    /**
     * Evaluates row and prints output
     *
     * Called on row submit
     */
    evaluateRow(row)
    {
        let parseTree

        try
        {
            parseTree = this.parser.parse(row)
        }
        catch (e)
        {
            if (e instanceof InputEmptyException)
            {
                this.$printEmptySolution()
                return
            }

            this.exceptionHandler.handle(e)
            return
        }

        let {resolvedTree, resolvedAll} =
            this.symbolResolver.resolveSymbols(parseTree)

        if (resolvedAll)
        {
            let result = resolvedTree.eval()

            if (math.parse(result.toString()).equals(parseTree))
                this.$printEmptySolution()
            else
                this.$printSolution(result)
        }
        else
        {
            let simplified = math.simplify(resolvedTree)

            if (simplified.equals(parseTree))
                this.$printEmptySolution()
            else
                this.$printSolution(simplified)
        }
    }

    $printSolution(solution)
    {
        this.ace.editor.insert("\n" + solution.toString())
    }

    $printEmptySolution()
    {
        this.ace.editor.insert("\n")
    }
}

module.exports = Evaluator


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.datastore.v1beta1.model;

/**
 * Metadata for ExportEntities operations.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Datastore API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleDatastoreAdminV1ExportEntitiesMetadata extends com.google.api.client.json.GenericJson {

  /**
   * Metadata common to all Datastore Admin operations.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleDatastoreAdminV1CommonMetadata common;

  /**
   * Description of which entities are being exported.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleDatastoreAdminV1EntityFilter entityFilter;

  /**
   * Location for the export metadata and data files. This will be the same value as the
   * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. The final output
   * location is provided in google.datastore.admin.v1.ExportEntitiesResponse.output_url.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String outputUrlPrefix;

  /**
   * An estimate of the number of bytes processed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleDatastoreAdminV1Progress progressBytes;

  /**
   * An estimate of the number of entities processed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleDatastoreAdminV1Progress progressEntities;

  /**
   * Metadata common to all Datastore Admin operations.
   * @return value or {@code null} for none
   */
  public GoogleDatastoreAdminV1CommonMetadata getCommon() {
    return common;
  }

  /**
   * Metadata common to all Datastore Admin operations.
   * @param common common or {@code null} for none
   */
  public GoogleDatastoreAdminV1ExportEntitiesMetadata setCommon(GoogleDatastoreAdminV1CommonMetadata common) {
    this.common = common;
    return this;
  }

  /**
   * Description of which entities are being exported.
   * @return value or {@code null} for none
   */
  public GoogleDatastoreAdminV1EntityFilter getEntityFilter() {
    return entityFilter;
  }

  /**
   * Description of which entities are being exported.
   * @param entityFilter entityFilter or {@code null} for none
   */
  public GoogleDatastoreAdminV1ExportEntitiesMetadata setEntityFilter(GoogleDatastoreAdminV1EntityFilter entityFilter) {
    this.entityFilter = entityFilter;
    return this;
  }

  /**
   * Location for the export metadata and data files. This will be the same value as the
   * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. The final output
   * location is provided in google.datastore.admin.v1.ExportEntitiesResponse.output_url.
   * @return value or {@code null} for none
   */
  public java.lang.String getOutputUrlPrefix() {
    return outputUrlPrefix;
  }

  /**
   * Location for the export metadata and data files. This will be the same value as the
   * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. The final output
   * location is provided in google.datastore.admin.v1.ExportEntitiesResponse.output_url.
   * @param outputUrlPrefix outputUrlPrefix or {@code null} for none
   */
  public GoogleDatastoreAdminV1ExportEntitiesMetadata setOutputUrlPrefix(java.lang.String outputUrlPrefix) {
    this.outputUrlPrefix = outputUrlPrefix;
    return this;
  }

  /**
   * An estimate of the number of bytes processed.
   * @return value or {@code null} for none
   */
  public GoogleDatastoreAdminV1Progress getProgressBytes() {
    return progressBytes;
  }

  /**
   * An estimate of the number of bytes processed.
   * @param progressBytes progressBytes or {@code null} for none
   */
  public GoogleDatastoreAdminV1ExportEntitiesMetadata setProgressBytes(GoogleDatastoreAdminV1Progress progressBytes) {
    this.progressBytes = progressBytes;
    return this;
  }

  /**
   * An estimate of the number of entities processed.
   * @return value or {@code null} for none
   */
  public GoogleDatastoreAdminV1Progress getProgressEntities() {
    return progressEntities;
  }

  /**
   * An estimate of the number of entities processed.
   * @param progressEntities progressEntities or {@code null} for none
   */
  public GoogleDatastoreAdminV1ExportEntitiesMetadata setProgressEntities(GoogleDatastoreAdminV1Progress progressEntities) {
    this.progressEntities = progressEntities;
    return this;
  }

  @Override
  public GoogleDatastoreAdminV1ExportEntitiesMetadata set(String fieldName, Object value) {
    return (GoogleDatastoreAdminV1ExportEntitiesMetadata) super.set(fieldName, value);
  }

  @Override
  public GoogleDatastoreAdminV1ExportEntitiesMetadata clone() {
    return (GoogleDatastoreAdminV1ExportEntitiesMetadata) super.clone();
  }

}


text:
#import "NuInternals.h"
#import "NuBlock.h"
#import "NuCell.h"
#import "NuSymbol.h"
#import "NuClass.h"
#import "NuSuper.h"
#import "NuExtensions.h"

extern id Nu__null;

@class NuSuper;

@implementation NuBlock

- (void) dealloc
{
    [parameters release];
    [body release];
    [context release];
    [super dealloc];
}

- (id) initWithParameters:(NuCell *)p body:(NuCell *)b context:(NSMutableDictionary *)c
{
    [super init];
    parameters = [p retain];
    body = [b retain];
    #ifdef CLOSE_ON_VALUES
    context = [c mutableCopy];
    #else
    context = [[NSMutableDictionary alloc] init];
    [context setPossiblyNullObject:c forKey:PARENT_KEY];
    [context setPossiblyNullObject:[c objectForKey:SYMBOLS_KEY] forKey:SYMBOLS_KEY];
    #endif

	// Check for the presence of "*args" in parameter list
	id plist = parameters;

	if (!(   ([parameters length] == 1)
		  && ([[[parameters car] stringValue] isEqualToString:@"*args"])))
	{
		while (plist && (plist != Nu__null))
		{
			id parameter = [plist car];

			if ([[parameter stringValue] isEqualToString:@"*args"])
			{
				printf("Warning: Overriding implicit variable '*args'.\n");
				return self;
			}

			plist = [plist cdr];
		}
	}

    return self;
}

- (NSString *) stringValue
{
    return [NSString stringWithFormat:@"(do %@ %@)", [parameters stringValue], [body stringValue]];
}

- (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)calling_context
{
    int numberOfArguments = [cdr length];
    int numberOfParameters = [parameters length];

    if (numberOfArguments != numberOfParameters) {
        // is the last parameter a variable argument? if so, it's ok, and we allow it to have zero elements.
        id lastParameter = [parameters lastObject];
        if (lastParameter && ([[lastParameter stringValue] characterAtIndex:0] == '*')) {
            if (numberOfArguments < (numberOfParameters - 1)) {
                [NSException raise:@"NuIncorrectNumberOfArguments"
                    format:@"Incorrect number of arguments to block. Received %d but expected %d or more: %@",
                    numberOfArguments,
                    numberOfParameters - 1,
                    [parameters stringValue]];
            }
        }
        else {
            [NSException raise:@"NuIncorrectNumberOfArguments"
                format:@"Incorrect number of arguments to block. Received %d but expected %d: %@",
                numberOfArguments,
                numberOfParameters,
                [parameters stringValue]];
        }
    }
    //NSLog(@"block eval %@", [cdr stringValue]);
    // loop over the parameters, looking up their values in the calling_context and copying them into the evaluation_context
    id plist = parameters;
    id vlist = cdr;
    id evaluation_context = [context mutableCopy];

	// Insert the implicit variable "*args".  It contains the entire parameter list.
	NuSymbolTable *symbolTable = [evaluation_context objectForKey:SYMBOLS_KEY];
	[evaluation_context setPossiblyNullObject:cdr forKey:[symbolTable symbolWithCString:"*args"]];

    while (plist && (plist != Nu__null)) {
        id parameter = [plist car];
        if ([[parameter stringValue] characterAtIndex:0] == '*') {
            id varargs = [[[NuCell alloc] init] autorelease];
            id cursor = varargs;
            while (vlist != Nu__null) {
                [cursor setCdr:[[[NuCell alloc] init] autorelease]];
                cursor = [cursor cdr];
                id value = [vlist car];
                if (calling_context && (calling_context != Nu__null))
                    value = [value evalWithContext:calling_context];
                [cursor setCar:value];
                vlist = [vlist cdr];
            }
            [evaluation_context setPossiblyNullObject:[varargs cdr] forKey:parameter];
            plist = [plist cdr];
            // this must be the last element in the parameter list
            if (plist != Nu__null) {
                [NSException raise:@"NuBadParameterList"
                    format:@"Variable argument list must be the last parameter in the parameter list: %@",
                    [parameters stringValue]];
            }
        }
        else {
            id value = [vlist car];
            if (calling_context && (calling_context != Nu__null))
                value = [value evalWithContext:calling_context];
            //NSLog(@"setting %@ = %@", parameter, value);
            [evaluation_context setPossiblyNullObject:value forKey:parameter];
            plist = [plist cdr];
            vlist = [vlist cdr];
        }
    }
    // evaluate the body of the block with the saved context (implicit progn)
    id value = Nu__null;
    id cursor = body;
    @try
    {
        while (cursor && (cursor != Nu__null)) {
            value = [[cursor car] evalWithContext:evaluation_context];
            cursor = [cursor cdr];
        }
    }
    @catch (NuReturnException *exception) {
        value = [exception value];
		if ([exception blockForReturn] && ([exception blockForReturn] != self)) {
			@throw(exception);
		}
    }
    @catch (id exception) {
        @throw(exception);
    }
    [value retain];
    [value autorelease];
    [evaluation_context release];
    return value;
}

- (id) evalWithArguments:(id)cdr context:(NSMutableDictionary *)calling_context
{
    return [self callWithArguments:cdr context:calling_context];
}

id getObjectFromContext(id context, id symbol)
{
    while (IS_NOT_NULL(context)) {
        id object = [context objectForKey:symbol];
        if (object)
            return object;
        context = [context objectForKey:PARENT_KEY];
    }
    return nil;
}

- (id) evalWithArguments:(id)cdr context:(NSMutableDictionary *)calling_context self:(id)object
{
    int numberOfArguments = [cdr length];
    int numberOfParameters = [parameters length];
    if (numberOfArguments != numberOfParameters) {
        [NSException raise:@"NuIncorrectNumberOfArguments"
            format:@"Incorrect number of arguments to method. Received %d but expected %d, %@",
            numberOfArguments,
            numberOfParameters,
            [parameters stringValue]];
    }
    //    NSLog(@"block eval %@", [cdr stringValue]);
    // loop over the arguments, looking up their values in the calling_context and copying them into the evaluation_context
    id plist = parameters;
    id vlist = cdr;
    id evaluation_context = [context mutableCopy];
    //    NSLog(@"after copying, evaluation context %@ retain count %d", evaluation_context, [evaluation_context retainCount]);
    if (object) {
        NuSymbolTable *symbolTable = [evaluation_context objectForKey:SYMBOLS_KEY];
        // look up one level for the _class value, but allow for it to be higher (in the perverse case of nested method declarations).
        NuClass *c = getObjectFromContext([context objectForKey:PARENT_KEY], [symbolTable symbolWithString:@"_class"]);
        [evaluation_context setPossiblyNullObject:object forKey:[symbolTable symbolWithCString:"self"]];
        [evaluation_context setPossiblyNullObject:[NuSuper superWithObject:object ofClass:[c wrappedClass]] forKey:[symbolTable symbolWithCString:"super"]];
    }
    while (plist && (plist != Nu__null) && vlist && (vlist != Nu__null)) {
        id arg = [plist car];
        // since this message is sent by a method handler (which has already evaluated the block arguments),
        // we don't evaluate them here; instead we just copy them
        id value = [vlist car];
        //        NSLog(@"setting %@ = %@", arg, value);
        [evaluation_context setPossiblyNullObject:value forKey:arg];
        plist = [plist cdr];
        vlist = [vlist cdr];
    }
    // evaluate the body of the block with the saved context (implicit progn)
    id value = Nu__null;
    id cursor = body;
    @try
    {
        while (cursor && (cursor != Nu__null)) {
            value = [[cursor car] evalWithContext:evaluation_context];
            cursor = [cursor cdr];
        }
    }
    @catch (NuReturnException *exception) {
        value = [exception value];
		if ([exception blockForReturn] && ([exception blockForReturn] != self)) {
			@throw(exception);
		}
    }
    @catch (id exception) {
        @throw(exception);
    }
    [value retain];
    [value autorelease];
    [evaluation_context release];
    return value;
}

- (NSMutableDictionary *) context
{
    return context;
}

- (NuCell *) parameters
{
    return parameters;
}

- (NuCell *) body
{
    return body;
}

@end


text:
# Name: get_subdirs
# Description: Scan and return all subdirectories that contain the filename
# specified.
# Usage: get_subdirs(list_returned_here filename-to-find)
# Example: get_subdirs(dir-list "CMakeLists.txt")
macro(get_subdirs retval filename)
  # Search from current directory for filename specified
  file(GLOB file-list RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} */${filename})

  # Return relative path to each directory found
  set(dir-list "")
  foreach(item ${file-list})
    get_filename_component(file-path ${item} PATH)
    set(dir-list ${dir-list} ${file-path})
  endforeach()
  set(${retval} ${dir-list})
endmacro(get_subdirs)

# Name: get_add_list_by_dependency
# Description: Retrieve a list of external modules to include based on
# dependency order.
# Usage: get_add_list_by_dependency(list_returned_here external_dir)
# Example: get_add_list_by_dependency(external-dir-list ${EXTERNAL_CMAKE_DIR})
macro(get_add_list_by_dependency retval)
  # Use get_subdirs macro to find all subdirectories with a CMakeLists.txt files
  get_subdirs(CMAKE_LISTS "CMakeLists.txt")

  # Return relative path to each directory found
  set(add-list "")

  # Now add each subdirectory found
  foreach(CMAKE_LIST_DIR ${CMAKE_LISTS})
    # Get the uppercase version of the subdirectory name
    string(TOUPPER ${CMAKE_LIST_DIR} CMAKE_LIST_NAME)

    # First see if this module is enabled and not already added
    if(${${CMAKE_LIST_NAME}_ENABLED})
      # Now see if a prebuilt version already exists
      find_package(${CMAKE_LIST_DIR} COMPONENTS ${${CMAKE_LIST_NAME}_COMPONENTS})

      # Force local module or local module the only one found?
      if(NOT USE_PRECOMPILED_EXTERNAL OR ${CMAKE_LIST_NAME}_LOCAL)
        # Parse this modules library dependencies
        parse_arguments(THIS "${${CMAKE_LIST_NAME}_DEPS}" "" ${${CMAKE_LIST_NAME}_LIB_DEPS})

        # Loop through each dependency
        foreach(DEP_DIR ${${CMAKE_LIST_NAME}_DEPS})
          # Get the uppercase version of the dependency directory name
          string(TOUPPER ${DEP_DIR} DEP_NAME)

          # See if a prebuilt version already exists for dependency
          find_package(${DEP_DIR} COMPONENTS ${${DEP_NAME}_COMPONENTS})

          # Force local module or local module the only one found?
          if(NOT USE_PRECOMPILED_EXTERNAL OR ${DEP_NAME}_LOCAL)
            # Add dependencies to front of list
            set(add-list ${DEP_DIR} ${add-list})
          endif(NOT USE_PRECOMPILED_EXTERNAL OR ${DEP_NAME}_LOCAL)
        endforeach()

        # Add this module to the back of the list
        set(add-list ${add-list} ${CMAKE_LIST_DIR})
      endif(NOT USE_PRECOMPILED_EXTERNAL OR ${CMAKE_LIST_NAME}_LOCAL)
    endif(${${CMAKE_LIST_NAME}_ENABLED})
    # Remove duplicates
    list(REMOVE_DUPLICATES add-list)
    # Set return result from list above
    set(${retval} ${add-list})
  endforeach(CMAKE_LIST_DIR ${CMAKE_LISTS})

endmacro(get_add_list_by_dependency retval)

# Name: set_option
# Description: Set the CMAKE option to default if not found or to the value
# specified.
# Usage: set_option(var default type docstring)
# Example: set_option(TARGET_HOST_TYPE "x86" String "x64")
macro(set_option var default type docstring)
  if(NOT DEFINED ${var})
    set(${var} ${default})
  endif()
  set(${var} ${${var}} CACHE ${type} ${docstring} FORCE)
endmacro(set_option)

# Name: list_contains
# Description: Check if a value is contained in a list and sets ${var} to TRUE
# if the value is found
# Usage: list_contains(VAR VALUE)
# Example: list_contains(is_arg_name ${ARG} ${ARG_NAMES})
macro(list_contains var value)
  set(${var})
  foreach(value2 ${ARGN})
    if(${value} STREQUAL ${value2})
      set(${var} TRUE)
    endif()
  endforeach()
endmacro(list_contains)

# Name: parse_arguments
# Description: Parse a list of arguments and options
# Usage: parse_arguments(prefix arg_names option_names)
# Example: parse_arguments(THIS "SOURCES;DEPENDS" "FLAG" FLAG
#   SOURCES s1 s2 s3
#   DEPENDS d1 d2)
# which will define the following variables:
# - THIS_SOURCES (s1 s2 s3)
# - THIS_DEPENDS (d1 d2)
# - THIS_FLAG TRUE
macro(parse_arguments prefix arg_names option_names)
  foreach(arg_name ${arg_names})
    set(${prefix}_${arg_name})
  endforeach()
  foreach(option_name ${option_names})
    set(${prefix}_${option_name} FALSE)
  endforeach()
  set(current_arg_name)
  set(current_arg_list)
  foreach(arg ${ARGN})
    list_contains(is_arg_name ${arg} ${arg_names})
    if(is_arg_name)
      set(${prefix}_${current_arg_name} ${current_arg_list})
      set(current_arg_name ${arg})
      set(current_arg_list)
    else()
      list_contains(is_option ${arg} ${option_names})
      if(is_option)
        set(${prefix}_${arg} TRUE)
      else()
        set(current_arg_list ${current_arg_list} ${arg})
      endif()
    endif()
  endforeach()
  set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro(parse_arguments)

# Name: add_project
# Description: Add a new target(s) for the project specified
# Usage: add_project(TicTacToe
#                    SOURCES main.cpp ...
#                    DEPENDS gqe-core)
# Example: add_project(${PROJECT_NAME}
#                      SOURCES ${${PROJECT_NAME}_SOURCES}
#                      DEPENDS ${${PROJECT_NAME}_DEPENDS}
macro(add_project target)
  # parse the arguments
  parse_arguments(THIS "SOURCES;DEPENDS" "" ${ARGN})

  # Add the target specified and its source files
  add_executable(${target} ${THIS_SOURCES})

  # set the debug suffix
  set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)

  # for gcc 4.x on Windows, apply the BUILD_STATIC_STD_LIBS option if it is enabled
  if(WINDOWS AND COMPILER_GCC AND BUILD_STATIC_STD_LIBS)
    if(${GCC_VERSION} MATCHES "4\\..*")
      set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
    endif()
  endif()

  # link the target to its dependencies
  if(THIS_DEPENDS)
    target_link_libraries(${target} ${THIS_DEPENDS})
  endif()

  # TODO: Copy DLL files from external to build directory after build

  # Copy resources folder to build directory after build
  add_custom_command(TARGET ${target}
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory
    ${PROJECT_SOURCE_DIR}/resources
    ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/resources)

  # TODO: Add the install rule
  #install(TARGETS ${target}
  #  RUNTIME DESTINATION ${INSTALL_DATA_DIR} COMPONENT binaries)

  # TODO: Add the install rule for the resources folder if it exists
  #set(RESOURCES "${PROJECT_SOURCE_DIR}/resources")
  #if(EXISTS ${RESOURCES})
  #  install(DIRECTORY ${RESOURCES}
  #          DESTINATION ${INSTALL_DATA_DIR}
  #          COMPONENT binaries)
  #endif()
endmacro(add_project)


text:
require("../base/guid.js");
require("../base/iteration_helpers.js");
require("../base/utils.js");

'use strict';

global.tr.exportTo('tr.v', function() {
  function Value(canonicalUrl, name, opt_options, opt_groupingKeys,
                 opt_diagnostics) {
    if (typeof(name) !== 'string')
      throw new Error('Expected value_name grouping key to be provided');

    // Allow callers to re-use groupingKeys dictionaries.
    this.groupingKeys = {name: name};
    if (opt_groupingKeys) {
      for (var keyName in opt_groupingKeys) {
        this.addGroupingKey(keyName, opt_groupingKeys[keyName]);
      }
    }

    this.diagnostics = opt_diagnostics || {};

    // May be undefined
    this.diagnostics.canonical_url = canonicalUrl;

    var options = opt_options || {};
    this.description = options.description;
    this.important = options.important !== undefined ?
        options.important : false;
  }

  Value.fromDict = function(d) {
    if (d.type === 'numeric')
      return NumericValue.fromDict(d);

    if (d.type === 'dict')
      return DictValue.fromDict(d);

    if (d.type == 'failure')
      return FailureValue.fromDict(d);

    if (d.type === 'skip')
      return SkipValue.fromDict(d);

    throw new Error('Not implemented');
  };

  Value.prototype = {
    get name() {
      return this.groupingKeys.name;
    },

    get canonicalUrl() {
      return this.diagnostics.canonical_url;
    },

    addGroupingKey: function(keyName, key) {
      if (keyName === 'name')
        throw new Error('Invalid groupingKey name "name"');

      if (this.groupingKeys.hasOwnProperty(keyName))
        throw new Error('Tried to redefine grouping key ' + keyName);

      this.groupingKeys[keyName] = key;
    },

    asDict: function() {
      return this.asJSON();
    },

    asJSON: function() {
      var d = {
        grouping_keys: tr.b.cloneDictionary(this.groupingKeys),
        description: this.description,
        important: this.important,
        diagnostics: this.diagnostics
      };

      this._asDictInto(d);
      if (d.type === undefined)
        throw new Error('_asDictInto must set type field');
      return d;
    },

    _asDictInto: function(d) {
      throw new Error('Not implemented');
    }
  };

  function NumericValue(canonicalUrl, name, numeric, opt_options,
                        opt_groupingKeys, opt_diagnostics) {
    if (!(numeric instanceof tr.v.NumericBase))
      throw new Error('Expected numeric to be instance of tr.v.NumericBase');

    Value.call(this, canonicalUrl, name, opt_options, opt_groupingKeys,
               opt_diagnostics);
    this.numeric = numeric;
  }

  NumericValue.fromDict = function(d) {
    if (d.numeric === undefined)
      throw new Error('Expected numeric to be provided');
    var numeric = tr.v.NumericBase.fromDict(d.numeric);
    var name = d.grouping_keys.name;
    d.grouping_keys = tr.b.cloneDictionary(d.groupingKeys);
    delete d.grouping_keys.name;
    return new NumericValue(d.diagnostics.canonical_url, name,
                            numeric, d, d.grouping_keys, d.diagnostics);
  };

  NumericValue.prototype = {
    __proto__: Value.prototype,

    _asDictInto: function(d) {
      d.type = 'numeric';
      d.numeric = this.numeric.asDict();
    }
  };

  function DictValue(canonicalUrl, name, value, opt_options, opt_groupingKeys,
                     opt_diagnostics) {
    Value.call(this, canonicalUrl, name, opt_options, opt_groupingKeys,
               opt_diagnostics);
    this.value = value;
  }

  DictValue.fromDict = function(d) {
    if (d.units !== undefined)
      throw new Error('Expected units to be undefined');
    if (d.value === undefined)
      throw new Error('Expected value to be provided');
    var name = d.grouping_keys.name;
    d.grouping_keys = tr.b.cloneDictionary(d.groupingKeys);
    delete d.grouping_keys.name;
    return new DictValue(d.diagnostics.canonical_url, name,
                         d.value, d, d.groupingKeys, d.diagnostics);
  };

  DictValue.prototype = {
    __proto__: Value.prototype,

    _asDictInto: function(d) {
      d.type = 'dict';
      d.value = this.value;
    }
  };

  function FailureValue(canonicalUrl, name, opt_options, opt_groupingKeys,
                        opt_diagnostics) {
    var options = opt_options || {};

    var stack;
    if (options.stack === undefined) {
      if (options.stack_str === undefined) {
        throw new Error('Expected stack_str or stack to be provided');
      } else {
        stack = options.stack_str;
      }
    } else {
      stack = options.stack;
    }

    if (typeof stack !== 'string')
      throw new Error('stack must be provided as a string');

    if (canonicalUrl === undefined) {
      throw new Error('FailureValue must provide canonicalUrl');
    }

    Value.call(this, canonicalUrl, name, options, opt_groupingKeys,
               opt_diagnostics);
    this.stack = stack;
  }

  FailureValue.fromError = function(canonicalUrl, e) {
    var ex = tr.b.normalizeException(e);
    return new FailureValue(canonicalUrl, ex.typeName,
                            {description: ex.message,
                             stack: ex.stack});

  };

  FailureValue.fromDict = function(d) {
    if (d.units !== undefined)
      throw new Error('Expected units to be undefined');
    if (d.stack_str === undefined)
      throw new Error('Expected stack_str to be provided');
    var name = d.grouping_keys.name;
    d.grouping_keys = tr.b.cloneDictionary(d.groupingKeys);
    delete d.grouping_keys.name;
    return new FailureValue(d.diagnostics.canonical_url, name,
                            d, d.grouping_keys, d.diagnostics);
  };

  FailureValue.prototype = {
    __proto__: Value.prototype,

    _asDictInto: function(d) {
      d.type = 'failure';
      d.stack_str = this.stack;
    }
  };

  function SkipValue(canonicalUrl, name, opt_options, opt_groupingKeys,
                     opt_diagnostics) {
    Value.call(this, canonicalUrl, name, opt_options, opt_groupingKeys,
               opt_diagnostics);
  }

  SkipValue.fromDict = function(d) {
    if (d.units !== undefined)
      throw new Error('Expected units to be undefined');
    var name = d.grouping_keys.name;
    d.grouping_keys = tr.b.cloneDictionary(d.groupingKeys);
    delete d.grouping_keys.name;
    return new SkipValue(d.diagnostics.canonical_url, name,
                         d, d.grouping_keys, d.diagnostics);
  };

  SkipValue.prototype = {
    __proto__: Value.prototype,

    _asDictInto: function(d) {
      d.type = 'skip';
    }
  };

  return {
    Value: Value,
    NumericValue: NumericValue,
    DictValue: DictValue,
    FailureValue: FailureValue,
    SkipValue: SkipValue
  };
});


text:
package ir.goodluckapps.leitnerbox.widgets;

import java.util.List;

import ir.goodluckapps.leitnerbox.BuiltinCard;
import ir.goodluckapps.leitnerbox.Card;
import ir.goodluckapps.leitnerbox.Helper;
import ir.goodluckapps.leitnerbox.R;
import ir.goodluckapps.leitnerbox.activities.PreviewCardsActivity;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class CardsArrayAdapter extends ArrayAdapter<Card>{

	static class ViewHolder
	{
		TextView cardFront;
	}

	private final Context _context;

	public CardsArrayAdapter(Context context)
	{
		super(context, R.layout.element_custom_card);
		_context = context;
	}

	public CardsArrayAdapter(Context context, List<Card> values)
	{
		super(context, R.layout.element_custom_card, values);
		_context = context;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		View rowView = convertView;
		final ViewHolder viewHolder;
		Card card = getItem(position);

		if(rowView == null)
		{
			LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			rowView = inflater.inflate(R.layout.element_custom_card, parent, false);
			viewHolder = new ViewHolder();
			viewHolder.cardFront = (TextView)rowView.findViewById(R.id.text_view_front);
			rowView.setTag(viewHolder);
		}
		else
		{
			viewHolder = (ViewHolder)convertView.getTag();
		}

		BuiltinCard builtinCard = Helper.convertToBuitinCard(card);
		String front = builtinCard.getFrontContent();
		if(front.length() > 15)
			front = front.substring(0, 15) + "...";
		viewHolder.cardFront.setText(front);
		viewHolder.cardFront.setTag(card);

		OnClickListnerExtended onClickListnerExtended = new OnClickListnerExtended();
		onClickListnerExtended.setIndex(position);
		viewHolder.cardFront.setOnClickListener(onClickListnerExtended);

		return rowView;
	}

	private class OnClickListnerExtended implements View.OnClickListener {
		private int _index = 0;
		public void setIndex(int index)
		{
			_index = index;
		}

		@Override
		public void onClick(View arg0) {
			Card card = (Card)arg0.getTag();
			if(card != null)
			{
				Intent nextIntent = new Intent(_context, PreviewCardsActivity.class);
				nextIntent.putExtra("Front", card.getFront());
				nextIntent.putExtra("Back", card.getBack());
				nextIntent.putExtra("CardId", card.getId());
				nextIntent.putExtra("PackageId", card.getPackageId());
				nextIntent.putExtra("selectedItem", _index);
				_context.startActivity(nextIntent);
			}
		}
	}
}


text:
Virtual Boards
=============

VirtualBoard is a drawing program conceived to help the users in their presentation for better explantion on the screen.
VirtualBoard allows to draw with hand, lines, rectangles, ellipses...

This project uses:
- [Firebase](https://www.firebase.com)
- [AngularJS](https://github.com/angular/angular.js)
- [AngularFire](https://github.com/firebase/angularfire)
- [Google SVG-Edit](https://code.google.com/p/svg-edit)

_This one was generated with [Yeoman AngularFire generator](https://github.com/firebase/generator-angularfire)_

Installation
============

Run to install:

```javascript
npm install
bower install
grunt --force
```

Run server with `grunt serve` command.

License
-------
This projected is licensed under the terms of the [MIT](http://rem.mit-license.org) license.


text:
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
		"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
		"https://checkstyle.org/dtds/suppressions_1_0.dtd">
<suppressions>
	<!-- Too many closely related types, referenced/instantiated.
	 	 Unavoidable due to architecture.
	 	 Refactoring would make the design less legible / maintainable.
	 -->
	<suppress checks="CyclomaticComplexity"
			  files="JavacTargetVersion.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="Disassembler.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="Disassembler.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="MethodAssembler.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="MethodAssembler.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="JavassistMethodTranslator.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="JavaParserUtil.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="JavaParserUtil.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="JavaParserRecovery.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="SimpleRecordingRemapper.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="Variables.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="MethodAssembler.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="JavassistASMTranslator.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="Parse.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="InvokeDynamicParser.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="LdcInsnParser.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="SearchRootItem.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="SearchRootItem.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="SplitableTabPane.java"
			  lines="0-9999"/>

	<suppress checks="ClassFanOutComplexity"
			  files="ContextBuilder.java"
			  lines="0-9999"/>

	<suppress checks="CyclomaticComplexity"
			  files="BytecodeContextHandling.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="BytecodeContextHandling.java"
			  lines="0-9999"/>

	<suppress checks="ClassDataAbstractionCoupling"
			  files="MainMenu.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="MainMenu.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="SearchPane.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="SearchPane.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="ClassNodeEditorPane.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="ClassNodeEditorPane.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="ClassNodeEditorPane.java"
			  lines="0-9999"/>
	<suppress checks="Indentation"
			  files="ClassNodeEditorPane.java"
			  lines="0-9999"/>

	<suppress checks="CyclomaticComplexity"
			  files="VMWrap.java"
			  lines="0-9999"/>
	<suppress checks="ClassFanOutComplexity"
			  files="VMWrap.java"
			  lines="0-9999"/>

	<suppress checks="CyclomaticComplexity"
			  files="LoadWorkspace.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="WorkspaceIO.java"
			  lines="0-9999"/>
	<suppress checks="CyclomaticComplexity"
			  files="Configurable.java"
			  lines="0-9999"/>

	<suppress checks="BooleanExpressionComplexity"
			  files="ClassUtil.java"
			  lines="0-9999"/>

	<suppress checks="CyclomaticComplexity"
			  files="IllegalBytecodePatcherUtil.java"
			  lines="0-9999"/>

	<suppress checks="ClassDataAbstractionCoupling"
			  files="FernFlowerAccessor.java"
			  lines="0-9999"/>

	<suppress checks="ClassFanOutComplexity"
			  files="UiUtil.java"
			  lines="0-9999"/>
	<suppress checks="ClassDataAbstractionCoupling"
			  files="UiUtil.java"
			  lines="0-9999"/>
</suppressions>


text:
<?php
/**
 * Custom functions that act independently of the theme templates
 *
 * Eventually, some of the functionality here could be replaced by core features
 *
 * @package Manning
 */

/**
 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
 */
function manning_page_menu_args( $args ) {
	$args['show_home'] = true;
	return $args;
}
add_filter( 'wp_page_menu_args', 'manning_page_menu_args' );

/**
 * Adds custom classes to the array of body classes.
 */
function manning_body_classes( $classes ) {
	// Adds a class of group-blog to blogs with more than 1 published author
	if ( is_multi_author() ) {
		$classes[] = 'group-blog';
	}

	return $classes;
}
add_filter( 'body_class', 'manning_body_classes' );

/**
 * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
 */
function manning_enhanced_image_navigation( $url, $id ) {
	if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
		return $url;

	$image = get_post( $id );
	if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
		$url .= '#main';

	return $url;
}
add_filter( 'attachment_link', 'manning_enhanced_image_navigation', 10, 2 );

/**
 * Filters wp_title to print a neat <title> tag based on what is being viewed.
 */
function manning_wp_title( $title, $sep ) {
	global $page, $paged;

	if ( is_feed() )
		return $title;

	// Add the blog name
	$title .= get_bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title .= " $sep $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		$title .= " $sep " . sprintf( __( 'Page %s', 'manning' ), max( $paged, $page ) );

	return $title;
}
add_filter( 'wp_title', 'manning_wp_title', 10, 2 );


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.hanaonazure.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Detailed HANA operation information. */
@Immutable
public final class Display {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class);

    /*
     * The localized friendly form of the resource provider name. This form is
     * also expected to include the publisher/company responsible. Use Title
     * Casing. Begin with "Microsoft" for 1st party services.
     */
    @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY)
    private String provider;

    /*
     * The localized friendly form of the resource type related to this
     * action/operation. This form should match the public documentation for
     * the resource provider. Use Title Casing. For examples, refer to the
     * "name" section.
     */
    @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY)
    private String resource;

    /*
     * The localized friendly name for the operation as shown to the user. This
     * name should be concise (to fit in drop downs), but clear
     * (self-documenting). Use Title Casing and include the entity/resource to
     * which it applies.
     */
    @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY)
    private String operation;

    /*
     * The localized friendly description for the operation as shown to the
     * user. This description should be thorough, yet concise. It will be used
     * in tool-tips and detailed views.
     */
    @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
    private String description;

    /*
     * The intended executor of the operation; governs the display of the
     * operation in the RBAC UX and the audit logs UX. Default value is
     * 'user,system'
     */
    @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
    private String origin;

    /**
     * Get the provider property: The localized friendly form of the resource provider name. This form is also expected
     * to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services.
     *
     * @return the provider value.
     */
    public String provider() {
        return this.provider;
    }

    /**
     * Get the resource property: The localized friendly form of the resource type related to this action/operation.
     * This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer
     * to the "name" section.
     *
     * @return the resource value.
     */
    public String resource() {
        return this.resource;
    }

    /**
     * Get the operation property: The localized friendly name for the operation as shown to the user. This name should
     * be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource
     * to which it applies.
     *
     * @return the operation value.
     */
    public String operation() {
        return this.operation;
    }

    /**
     * Get the description property: The localized friendly description for the operation as shown to the user. This
     * description should be thorough, yet concise. It will be used in tool-tips and detailed views.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the origin property: The intended executor of the operation; governs the display of the operation in the RBAC
     * UX and the audit logs UX. Default value is 'user,system'.
     *
     * @return the origin value.
     */
    public String origin() {
        return this.origin;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
import React from 'react';
import HiddenInput from './HiddenInput';
import {shallow} from 'enzyme';

test('Renders a hidden input with name and value', () => {
  const wrapper = shallow(<HiddenInput
    name="testname"
    value="testvalue"
  />
  );

  // Should be a hidden input with name and value set
  expect(wrapper.find('input[type="hidden"][name="testname"][value="testvalue"]').length).toBe(1);

});


text:
class STRING;
class UNICHARSET;

namespace tesseract {

class ShapeTable;

// Simple struct to hold a single classifier unichar selection, a corresponding
// rating, and a list of appropriate fonts.
struct UnicharRating {
  UnicharRating()
    : unichar_id(0), rating(0.0f), adapted(false), config(0),
      feature_misses(0) {}
  UnicharRating(int u, float r)
    : unichar_id(u), rating(r), adapted(false), config(0), feature_misses(0) {}

  // Print debug info.
  void Print() const {
    tprintf("Unichar-id=%d, rating=%g, adapted=%d, config=%d, misses=%d,"
            " %d fonts\n", unichar_id, rating, adapted, config, feature_misses,
            fonts.size());
  }

  // Sort function to sort ratings appropriately by descending rating.
  static int SortDescendingRating(const void* t1, const void* t2) {
    const UnicharRating* a = static_cast<const UnicharRating *>(t1);
    const UnicharRating* b = static_cast<const UnicharRating *>(t2);
    if (a->rating > b->rating) {
      return -1;
    } else if (a->rating < b->rating) {
      return 1;
    } else {
      return a->unichar_id - b->unichar_id;
    }
  }
  // Helper function to get the index of the first result with the required
  // unichar_id. If the results are sorted by rating, this will also be the
  // best result with the required unichar_id.
  // Returns -1 if the unichar_id is not found
  static int FirstResultWithUnichar(const GenericVector<UnicharRating>& results,
                                    UNICHAR_ID unichar_id);

  // Index into some UNICHARSET table indicates the class of the answer.
  UNICHAR_ID unichar_id;
  // Rating from classifier with 1.0 perfect and 0.0 impossible.
  // Call it a probability if you must.
  float rating;
  // True if this result is from the adaptive classifier.
  bool adapted;
  // Index of best matching font configuration of result.
  uinT8 config;
  // Number of features that were total misses - were liked by no classes.
  uinT16 feature_misses;
  // Unsorted collection of fontinfo ids and scores. Note that a raw result
  // from the IntegerMatch will contain config ids, that require transforming
  // to fontinfo ids via fontsets and (possibly) shapetable.
  GenericVector<ScoredFont> fonts;
};

// Classifier result from a low-level classification is an index into some
// ShapeTable and a rating.
struct ShapeRating {
  ShapeRating()
    : shape_id(0), rating(0.0f), raw(0.0f), font(0.0f),
      joined(false), broken(false) {}
  ShapeRating(int s, float r)
    : shape_id(s), rating(r), raw(1.0f), font(0.0f),
      joined(false), broken(false) {}

  // Sort function to sort ratings appropriately by descending rating.
  static int SortDescendingRating(const void* t1, const void* t2) {
    const ShapeRating* a = static_cast<const ShapeRating *>(t1);
    const ShapeRating* b = static_cast<const ShapeRating *>(t2);
    if (a->rating > b->rating) {
      return -1;
    } else if (a->rating < b->rating) {
      return 1;
    } else {
      return a->shape_id - b->shape_id;
    }
  }
  // Helper function to get the index of the first result with the required
  // unichar_id. If the results are sorted by rating, this will also be the
  // best result with the required unichar_id.
  // Returns -1 if the unichar_id is not found
  static int FirstResultWithUnichar(const GenericVector<ShapeRating>& results,
                                    const ShapeTable& shape_table,
                                    UNICHAR_ID unichar_id);

  // Index into some shape table indicates the class of the answer.
  int shape_id;
  // Rating from classifier with 1.0 perfect and 0.0 impossible.
  // Call it a probability if you must.
  float rating;
  // Subsidiary rating that a classifier may use internally.
  float raw;
  // Subsidiary rating that a classifier may use internally.
  float font;
  // Flag indicating that the input may be joined.
  bool joined;
  // Flag indicating that the input may be broken (a fragment).
  bool broken;
};

// Simple struct to hold an entry for a heap-based priority queue of
// ShapeRating.
struct ShapeQueueEntry {
  ShapeQueueEntry() : result(ShapeRating(0, 0.0f)), level(0) {}
  ShapeQueueEntry(const ShapeRating& rating, int level0)
    : result(rating), level(level0) {}

  // Sort by decreasing rating and decreasing level for equal rating.
  bool operator<(const ShapeQueueEntry& other) const {
    if (result.rating > other.result.rating) return true;
    if (result.rating == other.result.rating)
      return level > other.level;
    return false;
  }

  // Output from classifier.
  ShapeRating result;
  // Which level in the tree did this come from?
  int level;
};
typedef GenericHeap<ShapeQueueEntry> ShapeQueue;

// Simple struct to hold a set of fonts associated with a single unichar-id.
// A vector of UnicharAndFonts makes a shape.
struct UnicharAndFonts {
  UnicharAndFonts() : unichar_id(0) {
  }
  UnicharAndFonts(int uni_id, int font_id) : unichar_id(uni_id) {
    font_ids.push_back(font_id);
  }

  // Writes to the given file. Returns false in case of error.
  bool Serialize(FILE* fp) const;
  // Reads from the given file. Returns false in case of error.
  bool DeSerialize(TFile* fp);

  // Sort function to sort a pair of UnicharAndFonts by unichar_id.
  static int SortByUnicharId(const void* v1, const void* v2);

  GenericVector<inT32> font_ids;
  inT32 unichar_id;
};

// A Shape is a collection of unichar-ids and a list of fonts associated with
// each, organized as a vector of UnicharAndFonts. Conceptually a Shape is
// a classifiable unit, and represents a group of characters or parts of
// characters that have a similar or identical shape. Shapes/ShapeTables may
// be organized hierarchically from identical shapes at the leaves to vaguely
// similar shapes near the root.
class Shape {
 public:
  Shape() : destination_index_(-1) {}

  // Writes to the given file. Returns false in case of error.
  bool Serialize(FILE* fp) const;
  // Reads from the given file. Returns false in case of error.
  bool DeSerialize(TFile* fp);

  int destination_index() const {
    return destination_index_;
  }
  void set_destination_index(int index) {
    destination_index_ = index;
  }
  int size() const {
    return unichars_.size();
  }
  // Returns a UnicharAndFonts entry for the given index, which must be
  // in the range [0, size()).
  const UnicharAndFonts& operator[](int index) const {
    return unichars_[index];
  }
  // Sets the unichar_id of the given index to the new unichar_id.
  void SetUnicharId(int index, int unichar_id) {
    unichars_[index].unichar_id = unichar_id;
  }
  // Adds a font_id for the given unichar_id. If the unichar_id is not
  // in the shape, it is added.
  void AddToShape(int unichar_id, int font_id);
  // Adds everything in other to this.
  void AddShape(const Shape& other);
  // Returns true if the shape contains the given unichar_id, font_id pair.
  bool ContainsUnicharAndFont(int unichar_id, int font_id) const;
  // Returns true if the shape contains the given unichar_id, ignoring font.
  bool ContainsUnichar(int unichar_id) const;
  // Returns true if the shape contains the given font, ignoring unichar_id.
  bool ContainsFont(int font_id) const;
  // Returns true if the shape contains the given font properties, ignoring
  // unichar_id.
  bool ContainsFontProperties(const FontInfoTable& font_table,
                              uinT32 properties) const;
  // Returns true if the shape contains multiple different font properties,
  // ignoring unichar_id.
  bool ContainsMultipleFontProperties(const FontInfoTable& font_table) const;
  // Returns true if this shape is equal to other (ignoring order of unichars
  // and fonts).
  bool operator==(const Shape& other) const;
  // Returns true if this is a subset (including equal) of other.
  bool IsSubsetOf(const Shape& other) const;
  // Returns true if the lists of unichar ids are the same in this and other,
  // ignoring fonts.
  // NOT const, as it will sort the unichars on demand.
  bool IsEqualUnichars(Shape* other);

 private:
  // Sorts the unichars_ vector by unichar.
  void SortUnichars();

  // Flag indicates that the unichars are sorted, allowing faster set
  // operations with another shape.
  bool unichars_sorted_;
  // If this Shape is part of a ShapeTable the destiation_index_ is the index
  // of some other shape in the ShapeTable with which this shape is merged.
  int destination_index_;
  // Array of unichars, each with a set of fonts. Each unichar has at most
  // one entry in the vector.
  GenericVector<UnicharAndFonts> unichars_;
};

// ShapeTable is a class to encapsulate the triple indirection that is
// used here.
// ShapeTable is a vector of shapes.
// Each shape is a vector of UnicharAndFonts representing the set of unichars
// that the shape represents.
// Each UnicharAndFonts also lists the fonts of the unichar_id that were
// mapped to the shape during training.
class ShapeTable {
 public:
  ShapeTable();
  // The UNICHARSET reference supplied here, or in set_unicharset below must
  // exist for the entire life of the ShapeTable. It is used only by DebugStr.
  explicit ShapeTable(const UNICHARSET& unicharset);

  // Writes to the given file. Returns false in case of error.
  bool Serialize(FILE* fp) const;
  // Reads from the given file. Returns false in case of error.
  bool DeSerialize(TFile* fp);

  // Accessors.
  int NumShapes() const {
    return shape_table_.size();
  }
  const UNICHARSET& unicharset() const {
    return *unicharset_;
  }
  // Returns the number of fonts used in this ShapeTable, computing it if
  // necessary.
  int NumFonts() const;
  // Shapetable takes a pointer to the UNICHARSET, so it must persist for the
  // entire life of the ShapeTable.
  void set_unicharset(const UNICHARSET& unicharset) {
    unicharset_ = &unicharset;
  }
  // Re-indexes the class_ids in the shapetable according to the given map.
  // Useful in conjunction with set_unicharset.
  void ReMapClassIds(const GenericVector<int>& unicharset_map);
  // Returns a string listing the classes/fonts in a shape.
  STRING DebugStr(int shape_id) const;
  // Returns a debug string summarizing the table.
  STRING SummaryStr() const;

  // Adds a new shape starting with the given unichar_id and font_id.
  // Returns the assigned index.
  int AddShape(int unichar_id, int font_id);
  // Adds a copy of the given shape unless it is already present.
  // Returns the assigned index or index of existing shape if already present.
  int AddShape(const Shape& other);
  // Removes the shape given by the shape index. All indices above are changed!
  void DeleteShape(int shape_id);
  // Adds a font_id to the given existing shape index for the given
  // unichar_id. If the unichar_id is not in the shape, it is added.
  void AddToShape(int shape_id, int unichar_id, int font_id);
  // Adds the given shape to the existing shape with the given index.
  void AddShapeToShape(int shape_id, const Shape& other);
  // Returns the id of the shape that contains the given unichar and font.
  // If not found, returns -1.
  // If font_id < 0, the font_id is ignored and the first shape that matches
  // the unichar_id is returned.
  int FindShape(int unichar_id, int font_id) const;
  // Returns the first unichar_id and font_id in the given shape.
  void GetFirstUnicharAndFont(int shape_id,
                              int* unichar_id, int* font_id) const;

  // Accessors for the Shape with the given shape_id.
  const Shape& GetShape(int shape_id) const {
    return *shape_table_[shape_id];
  }
  Shape* MutableShape(int shape_id) {
    return shape_table_[shape_id];
  }

  // Expands all the classes/fonts in the shape individually to build
  // a ShapeTable.
  int BuildFromShape(const Shape& shape, const ShapeTable& master_shapes);

  // Returns true if the shapes are already merged.
  bool AlreadyMerged(int shape_id1, int shape_id2) const;
  // Returns true if any shape contains multiple unichars.
  bool AnyMultipleUnichars() const;
  // Returns the maximum number of unichars over all shapes.
  int MaxNumUnichars() const;
  // Merges shapes with a common unichar over the [start, end) interval.
  // Assumes single unichar per shape.
  void ForceFontMerges(int start, int end);
  // Returns the number of unichars in the master shape.
  int MasterUnicharCount(int shape_id) const;
  // Returns the sum of the font counts in the master shape.
  int MasterFontCount(int shape_id) const;
  // Returns the number of unichars that would result from merging the shapes.
  int MergedUnicharCount(int shape_id1, int shape_id2) const;
  // Merges two shape_ids, leaving shape_id2 marked as merged.
  void MergeShapes(int shape_id1, int shape_id2);
  // Swaps two shape_ids.
  void SwapShapes(int shape_id1, int shape_id2);
  // Appends the master shapes from other to this.
  // Used to create a clean ShapeTable from a merged one, or to create a
  // copy of a ShapeTable.
  // If not NULL, shape_map is set to map other shape_ids to this's shape_ids.
  void AppendMasterShapes(const ShapeTable& other,
                          GenericVector<int>* shape_map);
  // Returns the number of master shapes remaining after merging.
  int NumMasterShapes() const;
  // Returns the destination of this shape, (if merged), taking into account
  // the fact that the destination may itself have been merged.
  // For a non-merged shape, returns the input shape_id.
  int MasterDestinationIndex(int shape_id) const;

  // Returns false if the unichars in neither shape is a subset of the other..
  bool SubsetUnichar(int shape_id1, int shape_id2) const;
  // Returns false if the unichars in neither shape is a subset of the other..
  bool MergeSubsetUnichar(int merge_id1, int merge_id2, int shape_id) const;
  // Returns true if the unichar sets are equal between the shapes.
  bool EqualUnichars(int shape_id1, int shape_id2) const;
  bool MergeEqualUnichars(int merge_id1, int merge_id2, int shape_id) const;
  // Returns true if there is a common unichar between the shapes.
  bool CommonUnichars(int shape_id1, int shape_id2) const;
  // Returns true if there is a common font id between the shapes.
  bool CommonFont(int shape_id1, int shape_id2) const;

  // Adds the unichars of the given shape_id to the vector of results. Any
  // unichar_id that is already present just has the fonts added to the
  // font set for that result without adding a new entry in the vector.
  // NOTE: it is assumed that the results are given to this function in order
  // of decreasing rating.
  // The unichar_map vector indicates the index of the results entry containing
  // each unichar, or -1 if the unichar is not yet included in results.
  void AddShapeToResults(const ShapeRating& shape_rating,
                         GenericVector<int>* unichar_map,
                         GenericVector<UnicharRating>* results) const;

 private:
  // Adds the given unichar_id to the results if needed, updating unichar_map
  // and returning the index of unichar in results.
  int AddUnicharToResults(int unichar_id, float rating,
                          GenericVector<int>* unichar_map,
                          GenericVector<UnicharRating>* results) const;

  // Pointer to a provided unicharset used only by the Debugstr member.
  const UNICHARSET* unicharset_;
  // Vector of pointers to the Shapes in this ShapeTable.
  PointerVector<Shape> shape_table_;

  // Cached data calculated on demand.
  mutable int num_fonts_;
};

}  // namespace tesseract.

#endif  // TESSERACT_CLASSIFY_SHAPETABLE_H_


text:
@interface ViewController : UIViewController <UITableViewDataSource,UITableViewDelegate,UINavigationControllerDelegate, MFMessageComposeViewControllerDelegate, MFMailComposeViewControllerDelegate,UIAlertViewDelegate,RengMessageParserDelegate>

@property(nonatomic,retain)IBOutlet UITableView *tableView;
@property(nonatomic,retain)IBOutlet UILabel *userLabel;
@property(nonatomic,retain)IBOutlet UILabel *statusLabel;
@property(nonatomic, retain) IBOutlet UIImageView *stateImageView;
@property (retain, nonatomic) IBOutlet UIImageView *image_avatar;
@property (nonatomic,retain) MainViewController *mainViewController;
- (IBAction)actionUserDetail:(id)sender;
-(void) initialView : (int) isOnOffStatus;
@end


text:
<?php

/**
 * Base class to create GetUnprocessedXXXCount responses.
 *
 * User: Alex Gusev <alex@flancer64.com>
 */
abstract class Praxigento_Bonus_Model_Own_Service_Registry_Response_BaseGetUnprocessedCount
    extends Praxigento_Bonus_Service_Base_Response {
    private $_count = null;

    /**
     * @return null
     */
    public function getCount() {
        return $this->_count;
    }

    /**
     * @param null $val
     */
    public function setCount($val) {
        $this->_count = $val;
    }

    public function isSucceed() {
        $result = !is_null($this->_count);
        return $result;
    }
}