text:
from __future__ import absolute_import

from elasticapm.contrib.asyncio.traces import async_capture_span
from elasticapm.instrumentation.packages.base import AbstractInstrumentedModule
from elasticapm.traces import execution_context

class RedisConnectionPoolInstrumentation(AbstractInstrumentedModule):
    name = "aioredis"

    instrument_list = [
        ("aioredis.pool", "ConnectionsPool.execute"),
        ("aioredis.pool", "ConnectionsPool.execute_pubsub"),
    ]

    def call(self, module, method, wrapped, instance, args, kwargs):
        if len(args) > 0:
            wrapped_name = args[0]
            if isinstance(wrapped_name, bytes):
                wrapped_name = wrapped_name.decode()
        else:
            wrapped_name = self.get_wrapped_name(wrapped, instance, method)

        with async_capture_span(
            wrapped_name, span_type="db", span_subtype="redis", span_action="query", leaf=True
        ) as span:
            span.context["destination"] = _get_destination_info(instance)

            return wrapped(*args, **kwargs)

class RedisPipelineInstrumentation(AbstractInstrumentedModule):
    name = "aioredis"

    instrument_list = [("aioredis.commands.transaction", "Pipeline.execute")]

    def call(self, module, method, wrapped, instance, args, kwargs):
        wrapped_name = self.get_wrapped_name(wrapped, instance, method)

        with async_capture_span(
            wrapped_name, span_type="db", span_subtype="redis", span_action="query", leaf=True
        ) as span:
            span.context["destination"] = _get_destination_info(instance)

            return wrapped(*args, **kwargs)

class RedisConnectionInstrumentation(AbstractInstrumentedModule):
    name = "aioredis"

    instrument_list = (
        ("aioredis.connection", "RedisConnection.execute"),
        ("aioredis.pool", "ConnectionsPool.execute_pubsub"),
    )

    def call(self, module, method, wrapped, instance, args, kwargs):
        span = execution_context.get_span()
        if span and span.subtype == "aioredis":
            span.context["destination"] = _get_destination_info(instance)
        return wrapped(*args, **kwargs)

def _get_destination_info(connection):
    destination_info = {"service": {"name": "", "resource": "redis", "type": ""}}

    if hasattr(connection, "_pool_or_conn"):
        destination_info["port"] = connection._pool_or_conn.address[1]
        destination_info["address"] = connection._pool_or_conn.address[0]
    else:
        destination_info["port"] = connection.address[1]
        destination_info["address"] = connection.address[0]

    return destination_info


text:
import { createCoreTransformerOption } from '../../compiler/transformers/optional';
import { Context } from '../../core/context';
import { path2RegexPattern } from '../../utils/utils';

export function pluginAngular(target: RegExp | string) {
  return (ctx: Context) => {
    const rex = path2RegexPattern(target);

    const angularTransformerOption = createCoreTransformerOption('angular', rex);
    ctx.compilerOptions.transformers.push(angularTransformerOption);
  };
}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals
from ..utils import Edge3

def test_Edge3_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    datum=dict(argstr='-datum %s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    fscale=dict(argstr='-fscale',
    xor=['gscale', 'nscale', 'scale_floats'],
    ),
    gscale=dict(argstr='-gscale',
    xor=['fscale', 'nscale', 'scale_floats'],
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    in_file=dict(argstr='-input %s',
    copyfile=False,
    mandatory=True,
    position=0,
    ),
    nscale=dict(argstr='-nscale',
    xor=['fscale', 'gscale', 'scale_floats'],
    ),
    num_threads=dict(nohash=True,
    usedefault=True,
    ),
    out_file=dict(argstr='-prefix %s',
    position=-1,
    ),
    outputtype=dict(),
    scale_floats=dict(argstr='-scale_floats %f',
    xor=['fscale', 'gscale', 'nscale'],
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    verbose=dict(argstr='-verbose',
    ),
    )
    inputs = Edge3.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value

def test_Edge3_outputs():
    output_map = dict(out_file=dict(),
    )
    outputs = Edge3.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value


text:
class Singleton
{

    public:
    static Singleton& Instance()
    {
        static Singleton  s_singleton;
        return s_singleton;
    }

    private:
    Singleton(){}
    Singleton(Singleton& another);
};

 int main()
{

    Singleton& s1 = Singleton::Instance();
    Singleton& s2 = Singleton::Instance();

	std::cout << "output tow Instance value is equal" << std::endl;
    std::cout << &s1 << std::endl;
    std::cout << &s2 << std::endl;

	return 0;
}


text:
layout: page
title: Hadoop crawler
subtitle: subtitle
---

# This page is under construction...
# 该页面建设中...


text:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <wfs:Query typeName="feature:my_places" xmlns:feature="http://www.oskari.org">
        <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:And>
                <ogc:PropertyIsEqualTo>
                    <ogc:PropertyName>uuid</ogc:PropertyName>
                    <ogc:Literal>random uuid</ogc:Literal>
                </ogc:PropertyIsEqualTo>
                <ogc:FeatureId fid="1"></ogc:FeatureId>
            </ogc:And>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NiL.JS.Core;
using NiL.JS.Expressions;
using NiL.JS.Statements;

namespace X13.DevicePLC {
  internal class EP_VP2 : Visitor<EP_VP2> {
    private readonly EP_Compiler _compiler;

    public EP_VP2(EP_Compiler compiler) {
      _compiler = compiler;
    }
    protected override EP_VP2 Visit(CodeNode node) {
      throw new NotSupportedException("Visit(<" + node.GetType().Name + ">" + node.ToString() + ")");
    }
    protected override EP_VP2 Visit(Addition node) {
      AddCommon(node, node.Children[0] as Expression, node.Children[1] as Expression);
      return this;
    }
    protected override EP_VP2 Visit(BitwiseConjunction node) {
      Arg2Op(node, EP_InstCode.AND);
      return this;
    }
    protected override EP_VP2 Visit(ArrayDefinition node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Assignment node) {
      EP_Compiler.Instruction d2 = new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true };
      _compiler._sp.Push(d2);
      node.Children[1].Visit(this);
      _compiler.cur.AddInst(d2);
      Store(node, node.Children[0] as Expression);
      return this;
    }
    protected override EP_VP2 Visit(Call node) {
      Property p;
      Variable f;
      EP_Compiler.Merker m;
      Constant c;
      EP_Compiler.Instruction d;
      EP_Compiler.Scope sc;

      if((p = node.Children[0] as Property) != null
        && (((f = p.Source as Variable) != null && (m = _compiler.GetMerker(f.Descriptor)) != null && (sc = m.scope) != null) || (p.Source is This && (sc = _compiler.cur) != null))
        && (c = p.FieldName as Constant) != null && c.Value != null && c.Value.ValueType == JSValueType.String) {
        EP_Compiler.Merker mf;
        if((mf = sc.GetProperty(c.Value.ToString())) != null) {
          CallFunction(node, mf, p.Source as Expression);
          return this;
        }
      }
      f = node.Children[0] as Variable;
      if(f != null) {
        if(node.CallMode == CallMode.Regular) {
          m = _compiler.GetMerker(f.Descriptor);
          if(m == null || (m.type != EP_Type.FUNCTION && m.type != EP_Type.API)) {
            throw new ArgumentException("Unknown function: " + f.Descriptor.Name);
          }
          if(m.type == EP_Type.API) {
            int i;
            for(i = m.pIn - 1; i >= 0; i--) {
              if(i < node.Arguments.Length) {
                node.Arguments[i].Visit(this);
                _compiler._sp.Pop();
              } else {
                _compiler.cur.AddInst(EP_InstCode.LDI_0);
              }
            }
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.API, m, node), 0, m.pOut);
            return this;
          } else {  // m.type == EP_Type.FUNCTION
            CallFunction(node, m, null);
            return this;
          }
        } else {
          throw new NotSupportedException("Call(" + node.Children[0].ToString() + ") Mode: " + node.CallMode.ToString());
        }
      }

      for(int i = node.Arguments.Length - 1; i >= 0; i--) {
        node.Arguments[i].Visit(this);
      }
      _compiler.cur.AddInst(EP_InstCode.LDI_0, 0, 1);
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.SCALL, 1);

      for(int i = node.Arguments.Length - 1; i >= 0; i--) {
        _compiler.cur.AddInst(EP_InstCode.NIP);
        d = _compiler._sp.Pop();
        _compiler._sp.Pop();
        _compiler._sp.Push(d);
      }
      return this;
    }
    protected override EP_VP2 Visit(ClassDefinition node) {
      var mc = _compiler.GetMerker(node.Reference.Descriptor);
      if(mc == null || mc.type != EP_Type.CLASS) {
        throw new ApplicationException("Unknown merker in pass 2: " + node.Reference.Descriptor.Name);
      }
      mc.scope = _compiler.ScopePush(mc);
      var ctor = _compiler.GetMerker(node.Constructor.Reference.Descriptor);
      if(ctor == null || ctor.type != EP_Type.FUNCTION) {
        throw new ApplicationException("Unknown merker in pass 2: " + node.Constructor.Reference.Descriptor.Name);
      }
      DefineFunction(node.Constructor, ctor);
      foreach(var fv in node.Members.Where(z => z.Value is FunctionDefinition && z.Name is Constant)) {
        var fm = mc.scope.GetProperty((fv.Name as Constant).Value.ToString(), EP_Type.FUNCTION);
        if(fm == null || fm.type != EP_Type.FUNCTION) {
          throw new ApplicationException("Unknown merker in pass 2: " + mc.fName + "." + (fv.Name as Constant).Value.ToString());
        }
        DefineFunction(fv.Value as FunctionDefinition, fm);
      }
      _compiler.ScopePop();
      return this;
    }
    protected override EP_VP2 Visit(Constant node) {
      int v = node.Value == null ? 0 : (int)node.Value;
      LoadConstant(node, v);
      return this;
    }
    protected override EP_VP2 Visit(Decrement node) {
      Expression a;
      EP_Compiler.Instruction d2;
      node.Children[0].Visit(this);
      _compiler._sp.Pop();
      if(node.Type == DecrimentType.Predecriment) {
        d2 = new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true };
        _compiler._sp.Push(d2);
        _compiler.cur.AddInst(EP_InstCode.DEC, 0, 1);
        _compiler.cur.AddInst(d2);
      } else {
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true }, 0, 1);
        _compiler.cur.AddInst(EP_InstCode.DEC, 0, 1);
      }

      if((a = node.Children[0] as Expression) != null) {
        Store(node, a);
      } else {
        throw new NotImplementedException();
      }
      return this;
    }
    protected override EP_VP2 Visit(Delete node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(DeleteProperty node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Division node) {
      Arg2Op(node, EP_InstCode.DIV);
      return this;
    }
    protected override EP_VP2 Visit(Equal node) {
      Arg2Op(node, EP_InstCode.CEQ);
      return this;
    }
    protected override EP_VP2 Visit(Expression node) {
      var v = node as AssignmentOperatorCache;
      if(v != null) {
        return v.Source.Visit(this);
      }
      var t = node as This;
      if(t != null) {
        _compiler.cur.AddInst(EP_InstCode.LD_P0, 0, 1);
        return this;
      }
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(FunctionDefinition node) {
      var fm = _compiler.GetMerker(node.Reference.Descriptor);
      if(fm == null || fm.type != EP_Type.FUNCTION) {
        throw new ApplicationException("Unknown merker in pass 2: " + node.Reference.Descriptor.Name);
      }

      DefineFunction(node, fm);
      return this;
    }
    protected override EP_VP2 Visit(Property node) {
      Variable f;
      EP_Compiler.Merker m;
      Constant c;
      EP_Compiler.Scope sc;

      if((f = node.Source as Variable) != null && (m = _compiler.GetMerker(f.Descriptor)) != null) {
        switch(m.type) {
        case EP_Type.REFERENCE:  //TODO: LDM_xx_C16  (m.addr+offset)
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S4, m), 0, 1);
          sc = m.scope;
          break;
        case EP_Type.U8_CARR:
          node.FieldName.Visit(this);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CHECK_IDX, m), 0, 0);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LPM_U1, m, node), 1, 1);
          return this;
        case EP_Type.I8_CARR:
          node.FieldName.Visit(this);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CHECK_IDX, m), 0, 0);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LPM_S1, m, node), 1, 1);
          return this;
        case EP_Type.U16_CARR:
          node.FieldName.Visit(this);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CHECK_IDX, m), 0, 0);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LPM_U2, m, node), 1, 1);
          return this;
        case EP_Type.I16_CARR:
          node.FieldName.Visit(this);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CHECK_IDX, m), 0, 0);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LPM_S2, m, node), 1, 1);
          return this;
        case EP_Type.I32_CARR:
          node.FieldName.Visit(this);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CHECK_IDX, m), 0, 0);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LPM_S4, m, node), 1, 1);
          return this;
        default:
          throw new NotSupportedException("P2: " + node.ToString());
        }
      } else if(node.Source is This) {
        _compiler.cur.AddInst(EP_InstCode.LD_P0, 0, 1);
        sc = _compiler.cur;
        while(sc.fm.type!=EP_Type.CLASS) {
          sc = sc._parent;
          if(sc==null) {
            sc = _compiler.cur;
            break;
          }
        }
      } else {
        throw new NotSupportedException("P2: " + node.ToString());
      }
      if((c = node.FieldName as Constant) != null && c.Value != null && c.Value.ValueType == JSValueType.String) {
        string pn = c.Value.ToString();
        m = sc.GetProperty(pn);
        if(m == null) {
          sc = _compiler._scope.Skip(1).FirstOrDefault();
          if(sc != null) {
            m = sc.GetProperty(pn);
          }
        }
        if(m != null) {
          EP_InstCode cmd;
          switch(m.type) {
          case EP_Type.PropB1:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_B1_CS8 : EP_InstCode.LDM_B1_CS16;
            break;
          case EP_Type.PropS1:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_S1_CS8 : EP_InstCode.LDM_S1_CS16;
            break;
          case EP_Type.PropU1:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_U1_CS8 : EP_InstCode.LDM_U1_CS16;
            break;
          case EP_Type.PropS2:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_S2_CS8 : EP_InstCode.LDM_S2_CS16;
            break;
          case EP_Type.PropU2:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_U2_CS8 : EP_InstCode.LDM_U2_CS16;
            break;
          case EP_Type.PropS4:
            cmd = m.Addr < 256 ? EP_InstCode.LDM_S4_CS8 : EP_InstCode.LDM_S4_CS16;
            break;
          default:
            throw new ApplicationException("Merker " + m.ToString() + " is not property");
          }
          _compiler.cur.AddInst(new EP_Compiler.Instruction(cmd, m), 1, 1);
          return this;
        }
      }
      throw new NotSupportedException("Field name in " + node.ToString());
    }
    protected override EP_VP2 Visit(Variable node) {
      EP_Compiler.Merker m = _compiler.GetMerker(node.Descriptor);
      if(m == null) {
        throw new ArgumentException("undefined variable " + node.Name);
      }
      EP_Compiler.Instruction d;
      switch(m.type) {
      case EP_Type.BOOL:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_B1_C16, m, node);
        break;
      case EP_Type.UINT8:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_U1_C16, m, node);
        break;
      case EP_Type.SINT8:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_S1_C16, m, node);
        break;
      case EP_Type.UINT16:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_U2_C16, m, node);
        break;
      case EP_Type.SINT16:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_S2_C16, m, node);
        break;
      case EP_Type.SINT32:
        d = new EP_Compiler.Instruction(EP_InstCode.LDM_S4_C16, m, node);
        break;
      case EP_Type.PARAMETER:
        d = new EP_Compiler.Instruction((EP_InstCode)(EP_InstCode.LD_P0 + (byte)m.Addr));
        break;
      case EP_Type.INPUT:
      case EP_Type.OUTPUT:
        d = new EP_Compiler.Instruction(EP_InstCode.IN, m, node);
        break;
      case EP_Type.LOCAL:
        d = new EP_Compiler.Instruction((EP_InstCode)(EP_InstCode.LD_L0 + (byte)m.Addr));
        break;
      case EP_Type.FUNCTION:
        d = new EP_Compiler.Instruction(EP_InstCode.LDI_U2, m, node);
        break;
      default:
        throw new NotImplementedException(node.ToString());
      }
      _compiler.cur.AddInst(d, 0, 1);
      return this;
    }
    protected override EP_VP2 Visit(VariableReference node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(In node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Increment node) {
      Expression a;
      EP_Compiler.Instruction d2;
      node.Children[0].Visit(this);
      _compiler._sp.Pop();
      if(node.Type == IncrimentType.Preincriment) {
        d2 = new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true };
        _compiler._sp.Push(d2);
        _compiler.cur.AddInst(EP_InstCode.INC, 0, 1);
        _compiler.cur.AddInst(d2);
      } else {
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true }, 0, 1);
        _compiler.cur.AddInst(EP_InstCode.INC, 0, 1);
      }

      if((a = node.Children[0] as Expression) != null) {
        Store(node, a);
      } else {
        throw new NotImplementedException();
      }
      return this;
    }
    protected override EP_VP2 Visit(InstanceOf node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(NiL.JS.Expressions.ObjectDefinition node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Less node) {
      Arg2Op(node, EP_InstCode.CLT);
      return this;
    }
    protected override EP_VP2 Visit(LessOrEqual node) {
      Arg2Op(node, EP_InstCode.CLE);
      return this;
    }
    protected override EP_VP2 Visit(LogicalConjunction node) {
      EP_Compiler.Instruction j1, j2;
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.DUP, 0, 1);
      _compiler.cur.AddInst(j1 = new EP_Compiler.Instruction(EP_InstCode.JZ), 1);
      _compiler.cur.AddInst(EP_InstCode.DROP, 1, 0);
      node.Children[1].Visit(this);
      _compiler.cur.AddInst(j2 = new EP_Compiler.Instruction(EP_InstCode.LABEL));
      j1._ref = j2;
      return this;
    }
    protected override EP_VP2 Visit(LogicalNegation node) {
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.CZE, 1, 1);
      return this;

    }
    protected override EP_VP2 Visit(LogicalDisjunction node) {
      EP_Compiler.Instruction j1, j2;
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.DUP, 0, 1);
      _compiler.cur.AddInst(j1 = new EP_Compiler.Instruction(EP_InstCode.JNZ), 1, 0);
      _compiler.cur.AddInst(EP_InstCode.DROP, 1, 0);
      node.Children[1].Visit(this);
      _compiler.cur.AddInst(j2 = new EP_Compiler.Instruction(EP_InstCode.LABEL));
      j1._ref = j2;
      return this;
    }
    protected override EP_VP2 Visit(Modulo node) {
      Arg2Op(node, EP_InstCode.MOD);
      return this;
    }
    protected override EP_VP2 Visit(More node) {
      Arg2Op(node, EP_InstCode.CGT);
      return this;
    }
    protected override EP_VP2 Visit(MoreOrEqual node) {
      Arg2Op(node, EP_InstCode.CGE);
      return this;
    }
    protected override EP_VP2 Visit(Multiplication node) {
      Arg2Op(node, EP_InstCode.MUL);
      return this;
    }
    protected override EP_VP2 Visit(Negation node) {
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.NEG, 1, 1);
      return this;
    }
    protected override EP_VP2 Visit(New node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Comma node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(BitwiseNegation node) {
      node.Children[0].Visit(this);
      _compiler.cur.AddInst(EP_InstCode.NOT, 1, 1);
      return this;
    }
    protected override EP_VP2 Visit(NotEqual node) {
      Arg2Op(node, EP_InstCode.CNE);
      return this;
    }
    protected override EP_VP2 Visit(NumberAddition node) {
      AddCommon(node, node.Children[0] as Expression, node.Children[1] as Expression);
      return this;
    }
    protected override EP_VP2 Visit(NumberLess node) {
      Arg2Op(node, EP_InstCode.CLT);
      return this;
    }
    protected override EP_VP2 Visit(NumberLessOrEqual node) {
      Arg2Op(node, EP_InstCode.CLE);
      return this;
    }
    protected override EP_VP2 Visit(NumberMore node) {
      Arg2Op(node, EP_InstCode.CGT);
      return this;
    }
    protected override EP_VP2 Visit(NumberMoreOrEqual node) {
      Arg2Op(node, EP_InstCode.CGE);
      return this;
    }
    protected override EP_VP2 Visit(BitwiseDisjunction node) {
      Arg2Op(node, EP_InstCode.OR);
      return this;
    }
    protected override EP_VP2 Visit(RegExpExpression node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(SetProperty node) {
      FunctionDefinition fd;
      Variable f;
      EP_Compiler.Merker m;
      Call ca;

      if((fd = node.Value as FunctionDefinition) == null) {
        EP_Compiler.Instruction d2 = new EP_Compiler.Instruction(EP_InstCode.DUP) { canOptimized = true };
        _compiler._sp.Push(d2);
        if((ca = node.Value as Call) != null && (f = ca.Children[0] as Variable) != null && (new string[] { "Boolean", "Int8", "UInt8", "Int16", "UInt16", "Int32" }).Any(z => z == f.Name)) {
          if(ca.Arguments.Length > 0) {
            ca.Arguments[0].Visit(this);
          } else {
            _compiler._sp.Pop();
            return this;
          }
        } else {
          node.Value.Visit(this);
        }
        _compiler.cur.AddInst(d2);

        StoreProperty(node, node.Source, node.FieldName);
      } else {
        Constant c;
        if(node.Source is This && (c = node.FieldName as Constant) != null && c.Value != null && c.Value.ValueType == JSValueType.String) {
          m = _compiler.cur.GetProperty(c.Value.ToString());
          DefineFunction(fd, m);
        }
      }
      return this;
    }
    protected override EP_VP2 Visit(SignedShiftLeft node) {
      var c = node.Children[1] as Constant;
      if(c == null) {
        throw new NotImplementedException(node.ToString());
      } else {
        node.Children[0].Visit(this);
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LSL, null, c), 1, 1);
      }
      return this;
    }
    protected override EP_VP2 Visit(SignedShiftRight node) {
      var c = node.Children[1] as Constant;
      if(c == null) {
        throw new NotImplementedException(node.ToString());
      } else {
        node.Children[0].Visit(this);
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.ASR, null, c), 1, 1);
      }
      return this;
    }
    protected override EP_VP2 Visit(StrictEqual node) {
      Arg2Op(node, EP_InstCode.CEQ);
      return this;
    }
    protected override EP_VP2 Visit(StrictNotEqual node) {
      Arg2Op(node, EP_InstCode.CNE);
      return this;
    }
    protected override EP_VP2 Visit(StringConcatenation node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Substract node) {
      Arg2Op(node, EP_InstCode.SUB);
      return this;
    }
    protected override EP_VP2 Visit(Conditional node) {
      EP_Compiler.Instruction j1, j2, j3;
      node.Children[0].Visit(this);
      j1 = new EP_Compiler.Instruction(EP_InstCode.JZ, null, node.Children[0]);
      _compiler.cur.AddInst(j1);
      _compiler._sp.Pop();
      node.Threads[0].Visit(this);
      if(node.Threads.Count > 1) {
        j2 = new EP_Compiler.Instruction(EP_InstCode.JMP);
        _compiler.cur.AddInst(j2);
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j1._ref = j3;
        _compiler.cur.AddInst(j3);
        node.Threads[1].Visit(this);
        _compiler._sp.Pop();
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j2._ref = j3;
        _compiler.cur.AddInst(j3);
      } else {
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j1._ref = j3;
        _compiler.cur.AddInst(j3);
      }
      return this;
    }
    protected override EP_VP2 Visit(ConvertToBoolean node) {
      return this;
    }
    protected override EP_VP2 Visit(ConvertToInteger node) {
      return this;
    }
    protected override EP_VP2 Visit(ConvertToNumber node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(ConvertToString node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(ConvertToUnsignedInteger node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(TypeOf node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(UnsignedShiftRight node) {
      var c = node.Children[1] as Constant;
      if(c == null) {
        throw new NotImplementedException(node.ToString());
      } else {
        node.Children[0].Visit(this);
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LSR, null, c), 1, 1);
      }
      return this;
    }
    protected override EP_VP2 Visit(BitwiseExclusiveDisjunction node) {
      Arg2Op(node, EP_InstCode.XOR);
      return this;
    }
    protected override EP_VP2 Visit(Yield node) {
      return Visit(node as Expression);
    }
    protected override EP_VP2 Visit(Break node) {
      Loop cl;
      if(node.Label != null) {
        var l = node.Label.ToString();
        cl = _compiler.cur.loops.FirstOrDefault(z => z.labels.Any(y => y == l));
        if(cl == null) {
          cl = _compiler.cur.loops.Peek();
        }
      } else {
        cl = _compiler.cur.loops.Peek();
      }
      int tmp = _compiler._sp.Count;
      while(tmp > cl.sp1) {
        tmp--;
        _compiler.cur.AddInst(EP_InstCode.DROP);
      }
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = cl.L3 });
      return this;
    }
    protected override EP_VP2 Visit(CodeBlock node) {
      EP_Compiler.Merker m;
      int sp2 = _compiler._sp.Count;

      List<Assignment> inList = new List<Assignment>();
      foreach(var vd in node.Body.Select(z => z as VariableDefinition).Where(z => z != null)) {
        inList.AddRange(vd.Initializers.Select(z => z as Assignment).Where(z => z != null));
      }
      if(node.Variables!=null) {
        foreach(var v in node.Variables) {
          if(v.Initializer is ClassDefinition) {
            continue;
          }
          m = _compiler.GetMerker(v);
          if(m == null) {
            throw new ApplicationException("Unknown Merker in Pass2: " + v.Name);
          }
          if(m.vd.Initializer != null) {
            m.vd.Initializer.Visit(this);
          } else if(m.type == EP_Type.LOCAL) {
            var a2 = inList.FirstOrDefault(z => (z.Children[0] as Variable) != null && (z.Children[0] as Variable).Descriptor == m.vd);
            if(a2 != null) {
              a2.Children[1].Visit(this);
              m.initialized = true;
              _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LABEL, null, a2));
            } else {
              _compiler.cur.AddInst(EP_InstCode.LDI_0, 0, 1);
            }
          }
        }
      }

      int sp = _compiler._sp.Count;
      for(var i = 0; i < node.Body.Length; i++) {
        SafeCodeBlock(node.Body[i], sp);
      }
      while(_compiler._sp.Count > sp2) {
        _compiler.cur.AddInst(EP_InstCode.DROP, 1, 0);
        uint idx = (uint)_compiler.cur.memory.Where(z => z.type == EP_Type.LOCAL).Count();
        if(idx == 0 || _compiler.cur.memory.RemoveAll(z => z.type == EP_Type.LOCAL && z.Addr == idx - 1) != 1) {
          throw new ApplicationException("Stack error in " + node.ToString());
        }
      }

      return this;
    }
    protected override EP_VP2 Visit(Continue node) {
      Loop cl;
      if(node.Label != null) {
        var l = node.Label.ToString();
        cl = _compiler.cur.loops.FirstOrDefault(z => z.labels.Any(y => y == l));
        if(cl == null) {
          cl = _compiler.cur.loops.Peek();
        }
      } else {
        cl = _compiler.cur.loops.Peek();
      }
      int tmp = _compiler._sp.Count;
      while(tmp > cl.sp2) {
        tmp--;
        _compiler.cur.AddInst(EP_InstCode.DROP);
      }
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = cl.L2 });
      return this;
    }
    protected override EP_VP2 Visit(Debugger node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(DoWhile node) {
      var cl = new Loop(_compiler._sp.Count, node.Labels);
      _compiler.cur.loops.Push(cl);

      _compiler.cur.AddInst(cl.L1);

      cl.sp2 = _compiler._sp.Count;
      SafeCodeBlock(node.Body);

      _compiler.cur.AddInst(cl.L2);
      node.Condition.Visit(this);
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JNZ, null, node.Condition) { _ref = cl.L1 });
      _compiler.cur.AddInst(cl.L3);
      _compiler._sp.Pop();
      _compiler.cur.loops.Pop();

      return this;
    }
    protected override EP_VP2 Visit(Empty node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(ForIn node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(ForOf node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(For node) {
      var cl = new Loop(_compiler._sp.Count, node.Labels.ToArray());
      _compiler.cur.loops.Push(cl);

      if(node.Initializer != null) {
        node.Initializer.Visit(this);
      }
      _compiler.cur.AddInst(cl.L1);
      node.Condition.Visit(this);
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JZ, null, node.Condition) { _ref = cl.L3 });
      _compiler._sp.Pop();
      cl.sp2 = _compiler._sp.Count;
      SafeCodeBlock(node.Body);

      _compiler.cur.AddInst(cl.L2);
      if(node.Post != null) {
        node.Post.Visit(this);
      }
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = cl.L1 });
      _compiler.cur.AddInst(cl.L3);

      _compiler.cur.loops.Pop();
      return this;
    }
    protected override EP_VP2 Visit(IfElse node) {
      EP_Compiler.Instruction j1, j2, j3;
      node.Condition.Visit(this);

      j1 = new EP_Compiler.Instruction(EP_InstCode.JZ, null, node.Condition);
      _compiler.cur.AddInst(j1, 1);
      SafeCodeBlock(node.Then);
      if(node.Else != null) {
        j2 = new EP_Compiler.Instruction(EP_InstCode.JMP);
        _compiler.cur.AddInst(j2);
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j1._ref = j3;
        _compiler.cur.AddInst(j3);
        SafeCodeBlock(node.Else);
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j2._ref = j3;
        _compiler.cur.AddInst(j3);
      } else {
        j3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        j1._ref = j3;
        _compiler.cur.AddInst(j3);
      }
      return this;
    }
    protected override EP_VP2 Visit(InfinityLoop node) {
      var cl = new Loop(_compiler._sp.Count, node.Labels);
      _compiler.cur.loops.Push(cl);

      _compiler.cur.AddInst(cl.L1);
      _compiler.cur.AddInst(cl.L2);

      cl.sp2 = _compiler._sp.Count;
      SafeCodeBlock(node.Body);

      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = cl.L1 });
      _compiler.cur.AddInst(cl.L3);
      _compiler.cur.loops.Pop();
      return this;
    }
    protected override EP_VP2 Visit(LabeledStatement node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(Return node) {
      if(node.Value != null) {
        node.Value.Visit(this);
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.ST_P0, null, node), 1);
      }
      _compiler.cur.AddInst(EP_InstCode.RET);
      return this;
    }
    protected override EP_VP2 Visit(Switch node) {
      int i, j;
      var labels = new EP_Compiler.Instruction[node.Cases.Length];
      var cvs = node.Cases.Where(z => z.Statement != null).OrderBy(z => z.Index).Union(node.Cases.Where(z => z.Statement == null)).ToArray();
      node.Image.Visit(this);
      for(j = 0; j < cvs.Length; j++) {
        labels[j] = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        if(cvs[j].Statement != null) {
          if(j < cvs.Length - 2) {
            _compiler.cur.AddInst(EP_InstCode.DUP);
          }
          cvs[j].Statement.Visit(this);
          _compiler.cur.AddInst(EP_InstCode.CEQ);
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JNZ, null, cvs[j].Statement) { _ref = labels[j] }, 1);
        } else {
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = labels[j] });
        }
      }
      _compiler._sp.Pop();

      var cl = new Loop(_compiler._sp.Count, null);
      _compiler.cur.loops.Push(cl);

      j = 0;
      for(i = 0; i < node.Body.Length; i++) {
        if(j < cvs.Length && cvs[j].Index == i) {
          _compiler.cur.AddInst(labels[j]);
          j++;
        }
        SafeCodeBlock(node.Body[i]);
      }
      while(j < labels.Length) {
        _compiler.cur.AddInst(labels[j++]);
      }
      _compiler.cur.AddInst(cl.L3);
      _compiler.cur.loops.Pop();
      return this;
    }
    protected override EP_VP2 Visit(Throw node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(TryCatch node) {
      return Visit(node as CodeNode);
    }
    protected override EP_VP2 Visit(VariableDefinition node) {
      int i;
      Assignment a1;
      EP_Compiler.Scope tmp;
      EP_Compiler.Merker m, mf;
      List<EP_Compiler.Merker> tmp2;
      Variable v;
      for(i = 0; i < node.Initializers.Length; i++) {
        if(node.Initializers[i] is Variable) {
          continue;
        }
        if((a1 = node.Initializers[i] as Assignment) != null && (v = a1.Children[0] as Variable) != null) {
          Call ca;
          Variable f;
          m = _compiler.GetMerker(v.Descriptor);
          if(m == null) {
            throw new ApplicationException("Unknown merker in pass 2: " + v.Descriptor.Name);
          }
          if(m.initialized) {
            continue;
          }
          if((ca = a1.Children[1] as Call) != null && ca.CallMode == CallMode.Construct && (f = ca.Children[0] as Variable) != null) {
            if((new string[] { "Boolean", "Int8", "UInt8", "Int16", "UInt16", "Int32" }).Any(z => z == f.Name)) {
              mf = null;
            } else if((new string[] { "Uint8Array", "Uint16Array", "Int8Array", "Int16Array", "Int32Array"}).Any(z => z == f.Name)) {
              continue;
            } else {
              mf = _compiler.GetMerker(f.Descriptor);
              if(mf == null || (mf.type != EP_Type.FUNCTION && mf.type != EP_Type.CLASS)) {
                throw new ApplicationException("Unknown merker in pass 2: " + f.Descriptor.Name);
              }
              m.scope = mf.scope;
              if(mf.type == EP_Type.CLASS) {
                var mc = mf.scope.GetProperty("constructor");
                if(mc == null || mc.type != EP_Type.FUNCTION) {
                  throw new ApplicationException("Unknown merker in pass 2: " + f.Descriptor.Name + ".constructor");
                }
                mf = mc;
              }
              m.pOut = (int)(m.scope.memBlocks.Last().start + 31) / 32;
            }

            tmp = _compiler.cur;
            _compiler.cur = _compiler.initBlock;
            tmp2 = _compiler.cur.memory;
            _compiler.cur.memory = tmp.memory;
            if(mf != null) {
              CallFunction(ca, mf, v);    // Call in INIT section
              _compiler.cur.AddInst(EP_InstCode.DROP, 1, 0);
            } else {
              if(ca.Arguments.Length > 0) {
                ca.Arguments[0].Visit(this);
                Store(a1, v);
              }
            }
            _compiler.cur.memory = tmp2;
            _compiler.cur = tmp;

            continue;
          } else {
            if(m.type != EP_Type.LOCAL && m.type != EP_Type.NONE) {
              tmp = _compiler.cur;
              _compiler.cur = _compiler.initBlock;
              tmp2 = _compiler.cur.memory;
              _compiler.cur.memory = tmp.memory;
              SafeCodeBlock(node.Initializers[i]);
              _compiler.cur.memory = tmp2;
              _compiler.cur = tmp;
              continue;
            }
          }
        }
        SafeCodeBlock(node.Initializers[i]);
      }
      return this;
    }
    protected override EP_VP2 Visit(While node) {
      var cl = new Loop(_compiler._sp.Count, node.Labels);
      _compiler.cur.loops.Push(cl);

      _compiler.cur.AddInst(cl.L1);
      _compiler.cur.AddInst(cl.L2);
      node.Condition.Visit(this);
      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JZ, null, node.Condition) { _ref = cl.L3 });
      _compiler._sp.Pop();

      cl.sp2 = _compiler._sp.Count;
      SafeCodeBlock(node.Body, cl.sp2);

      _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.JMP) { _ref = cl.L1 });
      _compiler.cur.AddInst(cl.L3);
      _compiler.cur.loops.Pop();
      return this;
    }
    protected override EP_VP2 Visit(With node) {
      return Visit(node as CodeNode);
    }

    private void LoadConstant(CodeNode node, int v) {
      if(v == 0) {
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_0, null, node), 0, 1);
      } else if(v > 0) {
        if(v < 256) {
          if(v == 1) {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_1, null, node), 0, 1);
          } else {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_U1, null, node), 0, 1);
          }
        } else {
          if(v < 65536) {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_U2, null, node), 0, 1);
          } else {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S4, null, node), 0, 1);
          }
        }
      } else {
        if(v > -128) {
          if(v == -1) {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_M1, null, node), 0, 1);
          } else {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S1, null, node), 0, 1);
          }
        } else {
          if(v > -32768) {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S2, null, node), 0, 1);
          } else {
            _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S4, null, node), 0, 1);
          }
        }
      }
    }
    private void Store(CodeNode node, Expression e) {
      Variable a;
      AssignmentOperatorCache a2;
      Property p;
      if((a = e as Variable) != null || ((a2 = e as AssignmentOperatorCache) != null && (a = a2.Source as Variable) != null)) {
        var m = _compiler.GetMerker(a.Descriptor);
        if(m == null) {
          throw new ApplicationException("Unknown variable: " + a.Descriptor.Name);
        }
        switch(m.type) {
        case EP_Type.BOOL:
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.STM_B1_C16, m, node), 1, 0);
          break;
        case EP_Type.UINT8:
        case EP_Type.SINT8:
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.STM_S1_C16, m, node), 1, 0);
          break;
        case EP_Type.UINT16:
        case EP_Type.SINT16:
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.STM_S2_C16, m, node), 1, 0);
          break;
        case EP_Type.SINT32:
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.STM_S4_C16, m, node), 1, 0);
          break;
        case EP_Type.PARAMETER:
          _compiler.cur.AddInst(new EP_Compiler.Instruction((EP_InstCode)(EP_InstCode.ST_P0 + (byte)m.Addr), null, node), 1, 0);
          break;
        case EP_Type.LOCAL:
          _compiler.cur.AddInst(new EP_Compiler.Instruction((EP_InstCode)(EP_InstCode.ST_L0 + (byte)m.Addr), null, node), 1, 0);
          break;
        case EP_Type.OUTPUT:
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.OUT, m, node), 1, 0);
          break;
        default:
          throw new NotSupportedException(node.ToString());
        }
      } else if((p = e as Property) != null) {
        StoreProperty(node, p.Source as Expression, p.FieldName as Expression);
      } else {
        throw new NotImplementedException(node.ToString());
      }
    }
    private void StoreProperty(CodeNode node, Expression src, Expression name) {
      Variable f;
      EP_Compiler.Merker m;
      Constant c;
      EP_Compiler.Scope sc;

      if((f = src as Variable) != null && (m = _compiler.GetMerker(f.Descriptor)).type == EP_Type.REFERENCE) {
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S4, m), 0, 1);
        sc = m.scope;
        //TODO: STM_xx_C16  (m.addr*size+offset)
      } else if(src is This) {
        _compiler.cur.AddInst(EP_InstCode.LD_P0, 0, 1);
        sc = _compiler.cur;
        while(sc.fm.type!=EP_Type.CLASS) {
          sc = sc._parent;
          if(sc==null) {
            sc = _compiler.cur;
            break;
          }
        }
      } else {
        throw new NotSupportedException(src.ToString() + " as object");
      }
      if((c = name as Constant) != null && c.Value != null && c.Value.ValueType == JSValueType.String) {
        string pn = c.Value.ToString();
        m = sc.GetProperty(pn);
        if(m == null) {
          sc = _compiler._scope.Skip(1).FirstOrDefault();
          if(sc != null) {
            m = sc.GetProperty(pn);
          }
        }
        if(m != null) {
          EP_InstCode cmd;
          switch(m.type) {
          case EP_Type.PropB1:
            cmd = m.Addr < 256 ? EP_InstCode.STM_B1_CS8 : EP_InstCode.STM_B1_CS16;
            break;
          case EP_Type.PropS1:
          case EP_Type.PropU1:
            cmd = m.Addr < 256 ? EP_InstCode.STM_S1_CS8 : EP_InstCode.STM_S1_CS16;
            break;
          case EP_Type.PropS2:
          case EP_Type.PropU2:
            cmd = m.Addr < 256 ? EP_InstCode.STM_S2_CS8 : EP_InstCode.STM_S2_CS16;
            break;
          case EP_Type.PropS4:
            cmd = m.Addr < 256 ? EP_InstCode.STM_S4_CS8 : EP_InstCode.STM_S4_CS16;
            break;
          default:
            throw new ApplicationException("Merker " + m.ToString() + " is not property");
          }
          _compiler.cur.AddInst(new EP_Compiler.Instruction(cmd, m, node), 2, 0);
          return;
        }
      }
      throw new NotSupportedException("Field name in " + node.ToString());
    }
    private void AddCommon(CodeNode node, Expression a, Expression b) {
      var c1 = a as Constant;
      var c2 = b as Constant;
      if(c1 != null && c2 != null) {
        LoadConstant(node, (int)(c1.Value.Value) + (int)(c2.Value.Value));
      } else if(c1 != null && (int)(c1.Value.Value) == 1) {
        b.Visit(this);
        _compiler.cur.AddInst(EP_InstCode.INC, 1, 1);
      } else if(c1 != null && (int)(c1.Value.Value) == -1) {
        b.Visit(this);
        _compiler.cur.AddInst(EP_InstCode.DEC, 1, 1);
      } else if(c2 != null && (int)(c2.Value.Value) == 1) {
        a.Visit(this);
        _compiler.cur.AddInst(EP_InstCode.INC, 1, 1);
      } else if(c2 != null && (int)(c2.Value.Value) == -1) {
        a.Visit(this);
        _compiler.cur.AddInst(EP_InstCode.DEC, 1, 1);
      } else {
        a.Visit(this);
        b.Visit(this);
        _compiler.cur.AddInst(EP_InstCode.ADD, 2, 1);
      }
    }
    private void CallFunction(Call node, EP_Compiler.Merker m, Expression This) {
      EP_Compiler.Instruction d;
      EP_Compiler.Merker mt;
      Variable v;

      if(m.scope != null) {
        var al = m.scope.memory.Where(z => z.type == EP_Type.PARAMETER).OrderBy(z => z.Addr).ToArray();
        for(int i = al.Length - 1; i >= 0; i--) {
          if(i < node.Arguments.Length) {
            node.Arguments[i].Visit(this);
          } else if(al[i].init != null) {  //TODO: check function(a, b=7)
            al[i].init.Visit(this);
          } else {
            _compiler.cur.AddInst(EP_InstCode.LDI_0, 0, 1);
          }
        }
        if(This == null) {
          _compiler.cur.AddInst(EP_InstCode.LDI_MIN, 0, 1);
        } else if((v = This as Variable) != null && (mt = _compiler.GetMerker(v.Descriptor)).type == EP_Type.REFERENCE) {
          _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.LDI_S4, mt), 0, 1);
        } else if(This is This) {
          _compiler.cur.AddInst(EP_InstCode.LD_P0, 0, 1);
        } else {
          throw new NotSupportedException(This.ToString() + " as this");
        }
        _compiler.cur.AddInst(new EP_Compiler.Instruction(EP_InstCode.CALL, m, node));
        for(int i = al.Length - 1; i >= 0; i--) {
          _compiler.cur.AddInst(EP_InstCode.NIP);
          d = _compiler._sp.Pop();
          _compiler._sp.Pop();
          _compiler._sp.Push(d);
        }
      } else {
        throw new ApplicationException("undefined function: " + m.vd.Name);
      }
    }
    private void Arg2Op(Expression node, EP_InstCode c) {
      node.Children[0].Visit(this);
      node.Children[1].Visit(this);
      _compiler.cur.AddInst(c, 2, 1);
    }
    private void SafeCodeBlock(CodeNode node, int sp = -1) {
      if(node is CodeBlock) {
        node.Visit(this);
      } else {
        if(sp < 0) {
          sp = _compiler._sp.Count;
        }
        node.Visit(this);
        while(_compiler._sp.Count > sp) {
          var d = _compiler._sp.Pop();
          if(d == null || !d.canOptimized || !_compiler.cur.code.Remove(d)) {
            _compiler.cur.AddInst(EP_InstCode.DROP);
          }
        }
      }
    }
    private void DefineFunction(FunctionDefinition node, EP_Compiler.Merker fm) {
      fm.scope = _compiler.ScopePush(fm);
      for(int i = 0; i < node.Parameters.Count; i++) {
        if(i > 15) {
          throw new IndexOutOfRangeException(node.Reference.Descriptor.Name + "(.., " + node.Parameters[i].Name + " ..)" + " too many parameters");
        }
        var m = _compiler.GetMerker(node.Parameters[i]);
        if(m == null || m.type != EP_Type.PARAMETER || m.Addr != (uint)i + 1) {
          throw new ApplicationException("Unknown merker in pass 2: " + node.Reference.Descriptor.Name);
        }
      }
      node.Body.Visit(this);
      if(_compiler.cur.code.Count == 0 || _compiler.cur.code[_compiler.cur.code.Count - 1]._code.Length != 1 || _compiler.cur.code[_compiler.cur.code.Count - 1]._code[0] != (byte)EP_InstCode.RET) {
        _compiler.cur.AddInst(EP_InstCode.RET);
      }
      _compiler.ScopePop();
    }

    internal class Loop {
      public Loop(int sp1, ICollection<string> labels) {
        this.sp1 = sp1;
        this.labels = labels;
        L1 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        L2 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
        L3 = new EP_Compiler.Instruction(EP_InstCode.LABEL);
      }
      public EP_Compiler.Instruction L1, L2, L3;
      public int sp1, sp2;
      public ICollection<string> labels;
    }
  }
}


text:
module BABYLON {
    export class SmartArray<T> {
        public data: Array<T>;
        public length: number = 0;

        protected _id: number;

        [index: number]: T;

        constructor(capacity: number) {
            this.data = new Array(capacity);
            this._id = SmartArray._GlobalId++;
        }

        public push(value: T): void {
            this.data[this.length++] = value;

            if (this.length > this.data.length) {
                this.data.length *= 2;
            }
        }

        public forEach(func: (content: T) => void): void {
            for (var index = 0; index < this.length; index++) {
                func(this.data[index]);
            }
        }

        public sort(compareFn: (a: T, b: T) => number): void {
            this.data.sort(compareFn);
        }

        public reset(): void {
            this.length = 0;
        }

        public dispose(): void {
            this.reset();

            if (this.data) {
                this.data.length = 0;
                this.data = [];
            }
        }

        public concat(array: any): void {
            if (array.length === 0) {
                return;
            }
            if (this.length + array.length > this.data.length) {
                this.data.length = (this.length + array.length) * 2;
            }

            for (var index = 0; index < array.length; index++) {
                this.data[this.length++] = (array.data || array)[index];
            }
        }

        public indexOf(value: T): number {
            var position = this.data.indexOf(value);

            if (position >= this.length) {
                return -1;
            }

            return position;
        }

        public contains(value: T): boolean {
            return this.data.indexOf(value) !== -1;
        }

        // Statics
        private static _GlobalId = 0;
    }

    export class SmartArrayNoDuplicate<T> extends SmartArray<T> {
        private _duplicateId = 0;

        [index: number]: T;

        public push(value: T): void {
            super.push(value);

            if (!(<any>value).__smartArrayFlags) {
                (<any>value).__smartArrayFlags = {};
            }

            (<any>value).__smartArrayFlags[this._id] = this._duplicateId;
        }

        public pushNoDuplicate(value: T): boolean {
            if ((<any>value).__smartArrayFlags && (<any>value).__smartArrayFlags[this._id] === this._duplicateId) {
                return false;
            }
            this.push(value);
            return true;
        }

        public reset(): void {
            super.reset();
            this._duplicateId++;
        }

        public concatWithNoDuplicate(array: any): void {
            if (array.length === 0) {
                return;
            }
            if (this.length + array.length > this.data.length) {
                this.data.length = (this.length + array.length) * 2;
            }

            for (var index = 0; index < array.length; index++) {
                var item = (array.data || array)[index];
                this.pushNoDuplicate(item);
            }
        }
    }
}


text:
module ChatWork::OAuthClient::TokenMethods
  # refresh access_token with refresh_token
  #
  # @param refresh_token [String]
  # @param scope [Array<String>]
  #
  # @return [Hash]
  # @example response
  #   {
  #     "access_token" => "new_access_token",
  #     "token_type" => "Bearer",
  #     "expires_in" => "1800",
  #     "refresh_token" => "refresh_token",
  #     "scope" => "users.all:read rooms.all:read_write contacts.all:read_write",
  #   }
  def refresh_access_token(refresh_token, scope = [])
    params = {
      grant_type:    "refresh_token",
      refresh_token: refresh_token,
    }
    params[:scope] = scope.join(" ") unless scope.empty?

    post("/token", params)
  end
end


text:
require 'test_helper'

module FiLabApp
  class UserControllerTest < ActionController::TestCase
    # test "the truth" do
    #   assert true
    # end
  end
end


text:
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">

  <!-- INCIDENT DELETE -->

  <delete id="deleteIncident" parameterType="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">
    delete from ${prefix}ACT_RU_INCIDENT where ID_ = #{id} and REV_ = #{revision}
  </delete>

  <!-- INCIDENT INSERT -->

  <insert id="insertIncident" parameterType="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">
    insert into ${prefix}ACT_RU_INCIDENT (ID_, INCIDENT_TIMESTAMP_, INCIDENT_MSG_, INCIDENT_TYPE_, EXECUTION_ID_, ACTIVITY_ID_, PROC_INST_ID_, PROC_DEF_ID_, CAUSE_INCIDENT_ID_, ROOT_CAUSE_INCIDENT_ID_, CONFIGURATION_, REV_)
    values (
      #{id ,jdbcType=VARCHAR},
      #{incidentTimestamp, jdbcType=TIMESTAMP},
      #{incidentMessage, jdbcType=VARCHAR},
      #{incidentType, jdbcType=VARCHAR},
      #{executionId ,jdbcType=VARCHAR},
      #{activityId ,jdbcType=VARCHAR},
      #{processInstanceId ,jdbcType=VARCHAR},
      #{processDefinitionId ,jdbcType=VARCHAR},
      #{causeIncidentId ,jdbcType=VARCHAR},
      #{rootCauseIncidentId ,jdbcType=VARCHAR},
      #{configuration, jdbcType=VARCHAR},
      1
    )
  </insert>

  <!-- INCIDENT RESULTMAP -->

  <resultMap id="incidentResultMap" type="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">
    <id property="id" column="ID_" jdbcType="VARCHAR" />
    <result property="incidentTimestamp" column="INCIDENT_TIMESTAMP_" jdbcType="TIMESTAMP" />
    <result property="incidentType" column="INCIDENT_TYPE_" jdbcType="VARCHAR" />
    <result property="incidentMessage" column="INCIDENT_MSG_" jdbcType="VARCHAR" />
    <result property="executionId" column="EXECUTION_ID_" jdbcType="VARCHAR" />
    <result property="activityId" column="ACTIVITY_ID_" jdbcType="VARCHAR" />
    <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
    <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR" />
    <result property="causeIncidentId" column="CAUSE_INCIDENT_ID_" jdbcType="VARCHAR" />
    <result property="rootCauseIncidentId" column="ROOT_CAUSE_INCIDENT_ID_" jdbcType="VARCHAR" />
    <result property="configuration" column="CONFIGURATION_" jdbcType="VARCHAR" />
    <result property="revision" column="REV_" jdbcType="INTEGER" />
  </resultMap>

  <!-- INCIDENT SELECT -->

  <select id="selectIncidentsByExecutionId" parameterType="string" resultMap="incidentResultMap">
    select *
    from ${prefix}ACT_RU_INCIDENT I
    where I.EXECUTION_ID_ = #{parameter}
  </select>

  <select id="selectIncidentsByProcessInstanceId" parameterType="string" resultMap="incidentResultMap">
    select *
    from ${prefix}ACT_RU_INCIDENT I
    where I.PROC_INST_ID_ = #{parameter}
  </select>

  <select id="selectIncidentsByConfiguration" resultMap="incidentResultMap">
    select *
    from ${prefix}ACT_RU_INCIDENT I
    where I.CONFIGURATION_ = #{parameter.configuration, jdbcType=VARCHAR}
    <if test="parameter.incidentType != null">
      and INCIDENT_TYPE_ = #{parameter.incidentType, jdbcType=VARCHAR}
    </if>
  </select>

  <select id="selectIncidentByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.IncidentQueryImpl" resultMap="incidentResultMap">
    <include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.bindOrderBy"/>
    ${limitBefore}
    select RES.*
    ${limitBetween}
    <include refid="selectIncidentByQueryCriteriaSql"/>
    ${orderBy}
    ${limitAfter}
  </select>

  <select id="selectIncidentCountByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.IncidentQueryImpl" resultType="long">
    select count(distinct RES.ID_)
    <include refid="selectIncidentByQueryCriteriaSql"/>
  </select>

  <sql id="selectIncidentByQueryCriteriaSql">
    from ${prefix}ACT_RU_INCIDENT RES

    <if test="isAuthorizationCheckEnabled && authUserId != null">
      left join ${prefix}ACT_RE_PROCDEF PROCDEF
      on RES.PROC_DEF_ID_ = PROCDEF.ID_
    </if>

    <where>
      <if test="id != null">
        RES.ID_ = #{id}
      </if>
      <if test="incidentType != null">
        and RES.INCIDENT_TYPE_ = #{incidentType}
      </if>
      <if test="incidentMessage != null">
        and RES.INCIDENT_MSG_ = #{incidentMessage}
      </if>
      <if test="executionId != null">
        and RES.EXECUTION_ID_ = #{executionId}
      </if>
      <if test="activityId != null">
        and RES.ACTIVITY_ID_ = #{activityId}
      </if>
      <if test="processInstanceId != null">
        and RES.PROC_INST_ID_ = #{processInstanceId}
      </if>
      <if test="processDefinitionId != null">
        and RES.PROC_DEF_ID_ = #{processDefinitionId}
      </if>
      <if test="causeIncidentId != null">
        and RES.CAUSE_INCIDENT_ID_ = #{causeIncidentId}
      </if>
      <if test="rootCauseIncidentId != null">
        and RES.ROOT_CAUSE_INCIDENT_ID_ = #{rootCauseIncidentId}
      </if>
      <if test="configuration != null">
        and RES.CONFIGURATION_ = #{configuration}
      </if>

      <if test="isAuthorizationCheckEnabled && authUserId != null">
        AND
          ( CASE

            WHEN
              <!-- incident exists in context of a process instance -->
              RES.PROC_DEF_ID_ is not null
            THEN
              (<include refid="org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.authorizationCheck" />)

            ELSE
              1
          END ) = 1
      </if>

    </where>
  </sql>

  <update id="updateIncident" parameterType="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">
    update ${prefix}ACT_RU_INCIDENT
    <set>
      REV_ = #{revisionNext, jdbcType=INTEGER},
      EXECUTION_ID_ = #{executionId, jdbcType=VARCHAR},
      PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}
    </set>
    <where>
      ID_ = #{id, jdbcType=VARCHAR}
      and REV_ = #{revision, jdbcType=INTEGER}
    </where>
  </update>

</mapper>


text:
#include "config.h"

#include "libavutil/aarch64/cpu.h"
#include "libavutil/attributes.h"
#include "libavutil/internal.h"
#include "libavcodec/fft.h"
#include "libavcodec/synth_filter.h"

#include "asm-offsets.h"

#if HAVE_NEON || HAVE_VFP
AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF);
#endif

void ff_synth_filter_float_neon(FFTContext *imdct,
                                float *synth_buf_ptr, int *synth_buf_offset,
                                float synth_buf2[32], const float window[512],
                                float out[32], const float in[32],
                                float scale);

av_cold void ff_synth_filter_init_aarch64(SynthFilterContext *s)
{
    int cpu_flags = av_get_cpu_flags();

    if (have_neon(cpu_flags))
        s->synth_filter_float = ff_synth_filter_float_neon;
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<wicket:extend>
    <form wicket:id="mainForm" class="form-horizontal">

<wicket:message key="pageTaskEdit.basic"/>

                        <wicket:message key="pageTaskEdit.name"/>
                        <input type="text" class="form-control input-sm" wicket:id="name"/>

                        <wicket:message key="pageTaskEdit.description"/>
                        <textarea class="form-control input-sm" rows="2" wicket:id="description"/>

                        <wicket:message key="pageTaskEdit.oid"/>

                        <wicket:message key="pageTaskEdit.identifier"/>

                        <wicket:message key="pageTaskEdit.category"/>

                        <wicket:message key="pageTaskEdit.parent"/>

                        <wicket:message key="pageTaskEdit.handlerUri"/>

                        <wicket:message key="pageTaskEdit.execution"/>

<wicket:message key="pageTaskEdit.threadAction"/>

                    <wicket:remove>

                    </wicket:remove>

                        <wicket:message key="pageTaskEdit.threadStop"/>
                        <select class="form-control input-sm" wicket:id="threadStop"/>

<wicket:message key="pageTaskEdit.scheduleTitle"/>

                    <wicket:message key="pageTaskEdit.scheduleHelp"/>

                            <wicket:message key="pageTaskEdit.recurring"/>

                                <input type="checkbox" class="input-sm" wicket:id="recurring"/>
                                <wicket:message key="pageTaskEdit.suspendReq"/>

                                <wicket:message key="pageTaskEdit.bound"/>

                                <input type="checkbox" class="input-sm" wicket:id="bound"/>
                                <wicket:message key="pageTaskEdit.suspendReq"/>

                            <wicket:message key="pageTaskEdit.scheduleInterval"/>
                            <input type="text" class="form-control input-sm" wicket:id="interval"/>

                                <wicket:message key="pageTaskEdit.cronSpec"/>

                                <input type="text" class="form-control input-sm" wicket:id="cron"/>

                                    <wicket:message key="pageTaskEdit.cronHelpLink" />
                                    <wicket:message key="pageTaskEdit.cronHelpLinkTutorial" />

                            <wicket:message key="pageTaskEdit.notStartBefore"/>

                            <wicket:message key="pageTaskEdit.notStartAfter"/>

                            <wicket:message key="pageTaskEdit.misfire"/>
                            <select class="form-control input-sm" wicket:id="misfireAction"/>

                            <wicket:message key="pageTaskEdit.lastStarted"/>

                            <wicket:message key="pageTaskEdit.lastFinished"/>

                            <wicket:message key="pageTaskEdit.nextRun"/>

<wicket:message key="pageTaskEdit.opResult"/>

            <wicket:message key="pageTaskEdit.options"/>

                        <input type="checkbox" wicket:id="dryRun">
                        <wicket:message key="pageTaskEdit.dryRun" />

    </form>
</wicket:extend>


text:
#include "tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_cpu.h"
namespace tensorflow {
namespace recommenders_addons {
namespace lookup {
namespace cpu {
DEFINE_CREATE_TABLE(tstring, int8, 0, 0);
}  // namespace cpu
}  // namespace lookup
}  // namespace recommenders_addons
}  // namespace tensorflow


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
{
    /// <summary>
    /// this commandlet will create remote ps session with site
    /// </summary>
    [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "WebAppContainerPSSession", DefaultParameterSetName = ParameterSet1Name, SupportsShouldProcess = true)]
    [OutputType(typeof(System.Management.Automation.Runspaces.PSSession))]
    public class NewAzureRmWebAppContainerPSSession : WebAppBaseCmdlet
    {
        [Parameter(ParameterSetName = ParameterSet1Name, Position = 1, Mandatory = false, HelpMessage = "The name of the web app slot.", ValueFromPipelineByPropertyName = true)]
        [ValidateNotNullOrEmpty]
        public string SlotName { get; set; }

        [Parameter(Mandatory = false, HelpMessage = "Create the PowerShell session without prompting for confirmation.")]
        public SwitchParameter Force { get; set; }
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName == ParameterSet2Name)
            {
                string rg, name, slot;
                Utilities.CmdletHelpers.TryParseWebAppMetadataFromResourceId(WebApp.Id, out rg, out name, out slot);
                ResourceGroupName = rg;
                Name = name;
                SlotName = slot;
            }

            if (this.Force.IsPresent || ShouldProcess(Properties.Resources.EnterContainerPSSessionConfirmation))
            {
                WebsitesClient.RunWebAppContainerPSSessionScript(this, ResourceGroupName, Name, SlotName, true);
            }
        }
    }
}


text:
<?php

class ComparisonSearchQueryFilter extends SearchQueryFilter {
    static $operators = ['<', '>', '='];
    protected $name;
    protected $columnName;
    protected $value;
    private $min;
    private $max;
    private $multiplier;

    public function __construct($name, $min = 0, $max = null, $multiplier = 1) {
        $this->name = $name;
        $this->columnName = $name;
        $this->min = $min;
        $this->max = $max;
        $this->multiplier = $multiplier;
    }

    public function getName() {
        return $this->name;
    }

    public function getSearchterm() {
        if($this->getValue()) {
            list($operator, $value) = $this->getValue();

            if($value === '') {
                return false;
            }

            if($this->min) {
                $value = max($this->min, $value);
            }

            if($this->max) {
                $value = min($this->max, $value);
            }

            return $this->getName().':'.($operator === '=' ? '' : $operator).$value;
        }

        return false;
    }

    protected function getValueFromTerm($term) {
        $regex = '/^'.preg_quote($this->getName()).':(?<operator>['.implode(self::$operators).']?)(?<value>.*)$/';

        if(preg_match($regex, $term, $match)) {
            $operator = $match['operator'];
            $value = $match['value'];

            if(!$value) {
                return false;
            }

            $value = intval($value);

            if($this->min) {
                $value = max($this->min, $value);
            }

            if($this->max) {
                $value = min($this->max, $value);
            }

            return [$operator ? $operator : '=', $value];
        }

        return false;
    }

    public function render() {
        list($operator, $value) = $this->getValue();

        $operators = array_combine(static::$operators, static::$operators);

        return Form::label($this->getHtmlId(), $this->getLabel($this->getName())) . '
' .
            Form::select($this->getHtmlId().'[0]', $operators, $operator) .
            Form::number($this->getHtmlId().'[1]', $value, ['min' => $this->min, 'max' => $this->max]) . '
';
    }

    public function query($query) {
        if($this->getValue()) {
            list($operator, $value) = $this->getValue();

            return $query->where($this->columnName, $operator, $value / $this->multiplier);
        }

        return $query;
    }

    protected function getHtmlId() {
        return 'filter['.$this->getName().']';
    }

    public function column($column) {
        $this->columnName = $column;

        return $this;
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
//
import * as Basic from '../../basic';
import * as Utils from '../../../utils';
import { AuthorizationPolicyManager, SecurityManager } from '../../../redux';
import AbstractEntityInfo from '../EntityInfo/AbstractEntityInfo';
import EntityInfo from '../EntityInfo/EntityInfo';

const manager = new AuthorizationPolicyManager();

/**
 * Authorization policy basic information (info card).
 *
 * @author Vít Švanda
 * @author Radek Tomiška
 */
export class AuthorizationPolicyInfo extends AbstractEntityInfo {

  getManager() {
    return manager;
  }

  showLink() {
    if (!super.showLink()) {
      return false;
    }
    if (!SecurityManager.hasAccess({ type: 'HAS_ANY_AUTHORITY', authorities: ['AUTHORIZATIONPOLICY_READ'] })) {
      return false;
    }
    return true;
  }

  /**
   * Get link to detail (`url`).
   *
   * @return {string}
   */
  getLink() {
    const entity = this.getEntity();

    return `/role/${encodeURIComponent(entity.role)}/authorization-policies`;
  }

  getTableChildren() {
    // component are used in #getPopoverContent => skip default column resolving
    return [
      <Basic.Column property="label"/>,
      <Basic.Column property="value"/>
    ];
  }

  /**
   * Returns popover info content
   *
   * @param  {array} table data
   */
  getPopoverContent(entity) {
    return [
      {
        label: this.i18n('entity.Role._type'),
        value: (
          <EntityInfo
            entityType="role"
            entity={ entity._embedded ? entity._embedded.role : null }
            entityIdentifier={ entity.role }
            face="link" />
        )
      },
      {
        label: this.i18n('entity.name.label'),
        value: Utils.Ui.getSimpleJavaType(entity.authorizableType)
      },
      {
        label: this.i18n('entity.type'),
        value: Utils.Ui.getSimpleJavaType(entity.evaluatorType)
      }
    ];
  }

  /**
   * Returns entity icon (null by default - icon will not be rendered)
   *
   * @param  {object} entity
   */
  getEntityIcon() {
    return 'fa:shield-alt';
  }
}

AuthorizationPolicyInfo.propTypes = {
  ...AbstractEntityInfo.propTypes,
  /**
   * Selected entity - has higher priority
   */
  entity: PropTypes.object,
  /**
   * Selected entity's id - entity will be loaded automatically
   */
  entityIdentifier: PropTypes.string,
  /**
   * Internal entity loaded by given identifier
   */
  _entity: PropTypes.object,
  _showLoading: PropTypes.bool
};
AuthorizationPolicyInfo.defaultProps = {
  ...AbstractEntityInfo.defaultProps,
  entity: null,
  showLink: true,
  face: 'link',
  _showLoading: true,
};

function select(state, component) {
  return {
    _entity: manager.getEntity(state, component.entityIdentifier),
    _showLoading: manager.isShowLoading(state, null, component.entityIdentifier)
  };
}
export default connect(select)(AuthorizationPolicyInfo);


text:
export default {
    data() {
        return {
            searchFor: null
        }
    },
    methods: {
        resetSearch() {
            this.searchFor = null
        }
    },
    watch: {
        searchFor(val) {
            let res = this.sorter.search(val, [this.searchColName])

            if (typeof this.updateCounter == 'function') {
                this.updateCounter(res.length)
            }
        }
    }
}


text:
using System;
using System.Globalization;
using System.IO;

namespace Syndll2.Data
{
    public class HardwareConfiguration
    {
        private readonly int _firmwareVersion;
        private readonly DateTime _firmwareDate;
        private readonly TerminalTypes _terminalType;
        private readonly KeyboardTypes _keyboardType;
        private readonly DisplayTypes _displayType;
        private readonly string _hostSerialParameters;
        private readonly int _hostSerialBaudRate;
        private readonly byte _terminalId;
        private readonly byte _fingerprintUnitType;
        private readonly FingerprintUnitModes _fingerprintUnitMode;
        private readonly int _userDefinedField;

        public int FirmwareVersion
        {
            get { return _firmwareVersion; }
        }

        public DateTime FirmwareDate
        {
            get { return _firmwareDate; }
        }

        public TerminalTypes TerminalType
        {
            get { return _terminalType; }
        }

        public KeyboardTypes KeyboardType
        {
            get { return _keyboardType; }
        }

        public DisplayTypes DisplayType
        {
            get { return _displayType; }
        }

        public string HostSerialParameters
        {
            get { return _hostSerialParameters; }
        }

        public int HostSerialBaudRate
        {
            get { return _hostSerialBaudRate; }
        }

        public byte TerminalId
        {
            get { return _terminalId; }
        }

        public byte FingerprintUnitType
        {
            get { return _fingerprintUnitType; }
        }

        public FingerprintUnitModes FingerprintUnitMode
        {
            get { return _fingerprintUnitMode; }
        }

        public int UserDefinedField
        {
            get { return _userDefinedField; }
        }

        // Sample Raw Data  C = command, T = terminal id, CCCC = CRC code
        // Only the Data field should be passed in.
        // S0HG82434@17.09.2011-VBT8n140F3S0000<8:4
        // CT0123456789012345678901234567890123CCCC
        //   0         1         2         3

        // Data Field Breakdown
        // HG 82434 @17.09.2011 - V B T 8n14 0 F 3 S 0000

        internal static HardwareConfiguration Parse(string data)
        {
            if (data == null)
                throw new ArgumentNullException("data");

            const int expectedLength = 34;
            if (data.Length != expectedLength)
                throw new ArgumentException(
                    string.Format(
                        "Hardware configuration data should be exactly {0} characters, and you passed {1} characters.  " +
                        "Do not pass the command, terminal id, or CRC here.", expectedLength, data.Length),
                    "data");

            return new HardwareConfiguration(data);
        }

        private HardwareConfiguration(string data)
        {
            var subcode = data.Substring(0, 2);
            if (subcode != "HG")
                throw new InvalidDataException(
                    string.Format("Expected sub-code of \"{0}\" but got \"{1}\".", "HG", subcode));

            if (!int.TryParse(data.Substring(2, 5), NumberStyles.None, CultureInfo.InvariantCulture, out _firmwareVersion))
                throw new InvalidDataException("Couldn't parse firmware version from hardware configuration data.");

            if (!DateTime.TryParseExact(data.Substring(8, 10), "dd.MM.yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out _firmwareDate))
                throw new InvalidDataException("Couldn't parse firmware date from hardware configuration data.");

            // TODO: what does 18 represent?

            _terminalType = (TerminalTypes)data[19];
            _keyboardType = (KeyboardTypes)data[20];
            _displayType = (DisplayTypes)data[21];
            _hostSerialParameters = data.Substring(22, 3);

            byte b;
            if (!byte.TryParse(data.Substring(25, 1), NumberStyles.None, CultureInfo.InvariantCulture, out b))
                throw new InvalidDataException("Couldn't parse host serial baud rate from hardware configuration data.");
            _hostSerialBaudRate = BaudRates.Get(b);

            _terminalId = Util.CharToTerminalId(data[26]);

            // TODO: what does 27 represent?  Maybe the network card type?

            if (!byte.TryParse(data.Substring(28, 1), NumberStyles.None, CultureInfo.InvariantCulture, out _fingerprintUnitType))
                throw new InvalidDataException("Couldn't parse fingerprint unit type from hardware configuration data.");

            _fingerprintUnitMode = (FingerprintUnitModes)data[29];

            if (!int.TryParse(data.Substring(30, 4), NumberStyles.None, CultureInfo.InvariantCulture, out _userDefinedField))
                throw new InvalidDataException("Couldn't parse user defined field from hardware configuration data.");
        }
    }
}


text:
// Any comments, input: @KevinDockx
// Any issues, requests: https://github.com/KevinDockx/HttpCacheHeaders

using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;

namespace Marvin.Cache.Headers.Sample.Controllers
{
    [Route("api/morevalues")]
    [HttpCacheExpiration(CacheLocation = CacheLocation.Public, MaxAge = 11111)]
    [HttpCacheValidation(MustRevalidate = false)]
    public class MoreValuesController : Controller
    {
        [HttpGet]
        [HttpCacheExpiration(CacheLocation = CacheLocation.Private, MaxAge = 99999)]
        [HttpCacheValidation(MustRevalidate = true, Vary = new[] { "Test" })]
        public IEnumerable<string> Get()
        {
            return new[] { "anothervalue1", "anothervalue2" };
        }

        // no expiration/validation attributes: must take controller level config
        [HttpGet("{id}")]
        public string GetOne(string id)
        {
            return "somevalue";
        }
    }
}