text:
// The MIT License (MIT)
//
// Copyright (c) 2022 Camptocamp SA
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import {TemplateResult, html, css, CSSResult, unsafeCSS} from 'lit';
import {classMap} from 'lit/directives/class-map.js';
import {customElement, state} from 'lit/decorators';
import GmfBaseElement from 'gmfapi/elements/BaseElement';

import OlGeomLineString from 'ol/geom/LineString';

import line from 'ngeo/lidar/line';
import panels from 'gmfapi/store/panels';
import {Configuration} from 'gmfapi/store/config';

@customElement('gmf-lidar-footer')
export class gmfLidarFooter extends GmfBaseElement {
  @state() private customCSS_ = '';
  // for non canvas mode
  @state() private open = false;
  connectedCallback(): void {
    this.subscriptions.push(
      line.getLine().subscribe({
        next: (line: OlGeomLineString) => {
          this.open = !!line;
          if (!line) {
            panels.closeFooterPanel();
          }
        },
      })
    );
    super.connectedCallback();
  }

  // Override default initConfig
  initConfig(configuration: Configuration): void {
    if (configuration.gmfCustomCSS && configuration.gmfCustomCSS.lidarFooter !== undefined) {
      this.customCSS_ = configuration.gmfCustomCSS.lidarFooter;
    }
  }

  static styles: CSSResult[] = [
    ...GmfBaseElement.styles,
    css`
      /** for non canvas mode */
      .hidden {
        display: none !important;
      }

      #gmf-lidarprofile-container {
        position: relative;
        overflow: hidden;
        padding: var(--app-margin);
        border-top: solid 0.06rem black;
        background-color: white;
        height: var(--lidarprofile-height);
        display: flex;
      }

      #gmf-lidarprofile-container .lidarprofile {
        width: calc(100% - var(--profile-legend-width));
        background-color: #f5f5f5;
      }

      #gmf-lidarprofile-container .lidar-legend {
        list-style-type: none;
        width: var(--profile-legend-width);
        padding: var(--app-margin);
      }

      #gmf-lidarprofile-container .close {
        height: 0.62rem;
        cursor: pointer;
      }

      #gmf-lidarprofile-container .lidar-error {
        visibility: hidden;
        position: absolute;
        z-index: 10;
        margin: var(--app-margin);
        padding-left: 6.25rem;
        padding-top: 6.25rem;
        width: calc(100% - 3.12rem - var(--profile-legend-width));
        height: calc(var(--lidarprofile-height) - 3.12rem);
        font-size: 1.5em;
        opacity: 1;
        background: #e1f1f7;
        color: #4b717f;
      }

      #gmf-lidarprofile-container .lod-info {
        max-height: 6.25rem;
        overflow-y: auto;
      }

      .gmf-lidarprofile-automatic-width {
        color: gray;
      }

      .gmf-lidarprofile-chart-active main {
        height: calc(100% - var(--lidarprofile-height));
      }

      .gmf-tooltip-measure {
        font-weight: bold;
      }
    `,
  ];

  render(): TemplateResult {
    return html`

          <canvas class="lidar-canvas"></canvas>
          <svg class="lidar-svg" style="fill: #ffff00; position: absolute; z-index: 1"></svg>

 this.closePanel()}">×

    `;
  }

  /**
   * Reset the line and close the footer
   */
  closePanel(): void {
    line.setLine(null);
    panels.closeFooterPanel();
  }
}


text:
/*! \file ExponentImportance.h
 *  \author Jared Hoberock
 *  \brief Defines the interface to a ScalarImportance
 *         class which assigns importance equal to luminance
 *         raised to an exponent.
 */

#ifndef EXPONENT_IMPORTANCE_H
#define EXPONENT_IMPORTANCE_H

#include "LuminanceImportance.h"

class ExponentImportance
  : public LuminanceImportance
{
  public:
    /*! \typedef Parent
     *  \brief Shorthand.
     */
    typedef LuminanceImportance Parent;

    /*! Constructor accepts an exponent.
     *  \param k Sets mExponent.
     */
    ExponentImportance(const float k);

    /*! This method converts the spectral Monte Carlo throughput
     *  of a Path into scalar importance by returning its luminance raised to mExponent.
     *  \param x The HyperPoint uniquely specifying the Path of interest.
     *  \param xPath The Path corresponding to x.
     *  \param results The list of PathSampler Results resulting from xPath.
     *  \return The scalar importance of x.
     */
    virtual float evaluate(const PathSampler::HyperPoint &x,
                           const Path &xPath,
                           const std::vector<PathSampler::Result> &results);

  protected:
    /*! The exponent.
     */
    float mExponent;
}; // end ExponentImportance

#endif // EXPONENT_IMPORTANCE_H

redpajama_set_name: RedPajamaGithub


text:
package ast

import (
	"fmt"
	"regexp"
	"time"

	"github.com/influxdata/influxdb/influxql"
)

// NodeTypeOf is used by all Node to identify the node duration Marshal and Unmarshal
const NodeTypeOf = "typeOf"

// JSONNode is the intermediate type between Node and JSON serialization
type JSONNode map[string]interface{}

// Type adds the Node type information
func (j JSONNode) Type(typ string) JSONNode {
	j[NodeTypeOf] = typ
	return j
}

// Set adds the key/value to the JSONNode
func (j JSONNode) Set(key string, value interface{}) JSONNode {
	j[key] = value
	return j
}

// SetDuration adds key to the JSONNode but formats the duration in InfluxQL style
func (j JSONNode) SetDuration(key string, value time.Duration) JSONNode {
	return j.Set(key, influxql.FormatDuration(value))
}

// SetRegex adds key to the JSONNode but formats the regex as a string
func (j JSONNode) SetRegex(key string, value *regexp.Regexp) JSONNode {
	if value == nil {
		return j.Set(key, nil)
	}
	return j.Set(key, value.String())
}

// SetOperator adds key to JSONNode but formats the operator as a string
func (j JSONNode) SetOperator(key string, op TokenType) JSONNode {
	return j.Set(key, op.String())
}

// SetFunctionType adds key to JSONNode but formats the function type as a string
func (j JSONNode) SetFunctionType(key string, fn FuncType) JSONNode {
	return j.Set(key, fn.String())
}

// TypeOf returns the type of the node
func (j JSONNode) TypeOf() (string, error) {
	return j.String(NodeTypeOf)
}

// CheckTypeOf tests that the typeOf field is correctly set to typ.
func (j JSONNode) CheckTypeOf(typ string) error {
	t, ok := j[NodeTypeOf]
	if !ok {
		return fmt.Errorf("missing typeOf field")
	}

	if t != typ {
		return fmt.Errorf("error unmarshaling node type %s; received %s", typ, t)
	}
	return nil
}

// Has returns true if field exists
func (j JSONNode) Has(field string) bool {
	_, ok := j[field]
	return ok
}

// Field returns expected field or error if field doesn't exist
func (j JSONNode) Field(field string) (interface{}, error) {
	fld, ok := j[field]
	if !ok {
		return nil, fmt.Errorf("missing expected field %s", field)
	}
	return fld, nil
}

// String reads the field for a string value
func (j JSONNode) String(field string) (string, error) {
	s, err := j.Field(field)
	if err != nil {
		return "", err
	}

	str, ok := s.(string)
	if !ok {
		return "", fmt.Errorf("field %s is not a string value but is %T", field, s)
	}
	return str, nil
}

// Int64 reads the field for a int64 value
func (j JSONNode) Int64(field string) (int64, error) {
	n, err := j.Field(field)
	if err != nil {
		return 0, err
	}

	num, ok := n.(int64)
	if !ok {
		flt, ok := n.(float64)
		if !ok {
			return 0, fmt.Errorf("field %s is not an integer value but is %T", field, n)
		}
		num = int64(flt)
	}
	return num, nil
}

// Float64 reads the field for a float64 value
func (j JSONNode) Float64(field string) (float64, error) {
	n, err := j.Field(field)
	if err != nil {
		return 0, err
	}

	num, ok := n.(float64)
	if !ok {
		integer, ok := n.(int64)
		if !ok {
			return 0, fmt.Errorf("field %s is not a floating point value but is %T", field, n)
		}
		num = float64(integer)
	}
	return num, nil
}

// Strings reads the field an array of strings
func (j JSONNode) Strings(field string) ([]string, error) {
	s, err := j.Field(field)
	if err != nil {
		return nil, err
	}

	strs, ok := s.([]string)
	if !ok {
		return nil, fmt.Errorf("field %s is not an array of strings but is %T", field, s)
	}
	return strs, nil
}

// Duration reads the field and assumes the string is in InfluxQL Duration format.
func (j JSONNode) Duration(field string) (time.Duration, error) {
	d, err := j.Field(field)
	if err != nil {
		return 0, err
	}

	dur, ok := d.(string)
	if !ok {
		return 0, fmt.Errorf("field %s is not a string duration value but is %T", field, d)
	}

	return influxql.ParseDuration(dur)
}

// Regex reads the field and assumes the string is a regular expression.
func (j JSONNode) Regex(field string) (*regexp.Regexp, error) {
	r, err := j.Field(field)
	if err != nil {
		return nil, err
	}

	re, ok := r.(string)
	if !ok {
		return nil, fmt.Errorf("field %s is not a string regex value but is %T", field, r)
	}

	return regexp.Compile(re)
}

// Bool reads the field for a boolean value
func (j JSONNode) Bool(field string) (bool, error) {
	b, err := j.Field(field)
	if err != nil {
		return false, err
	}

	boolean, ok := b.(bool)
	if !ok {
		return false, fmt.Errorf("field %s is not a bool value but is %T", field, b)
	}
	return boolean, nil
}

// Operator reads the field for an TokenType operator value
func (j JSONNode) Operator(field string) (TokenType, error) {
	o, err := j.Field(field)
	if err != nil {
		return TokenError, err
	}

	op, ok := o.(string)
	if !ok {
		return TokenError, fmt.Errorf("field %s is not an operator value but is %T", field, o)
	}

	return NewTokenType(op)
}

// FunctionType reads the field for an FuncType value
func (j JSONNode) FunctionType(field string) (FuncType, error) {
	f, err := j.Field(field)
	if err != nil {
		return -1, err
	}

	fn, ok := f.(string)
	if !ok {
		return -1, fmt.Errorf("field %s is not a function type value but is %T", field, f)
	}

	return NewFuncType(fn)
}

// NodeList reads the field for a list of nodes
func (j JSONNode) NodeList(field string) ([]Node, error) {
	l, err := j.Field(field)
	if err != nil {
		return nil, err
	}
	list, ok := l.([]interface{})
	if !ok {
		return nil, fmt.Errorf("field %s is not a list of values but is %T", field, l)
	}
	nodes := make([]Node, len(list))
	for i, lst := range list {
		nodes[i], err = j.getNode(lst)
		if err != nil {
			return nil, err
		}
	}

	return nodes, nil
}

// Node reads the field for a node
func (j JSONNode) Node(field string) (Node, error) {
	nn, err := j.Field(field)
	if err != nil {
		return nil, err
	}
	return j.getNode(nn)
}

// IDNode reads an IdentifierNode from the field
func (j JSONNode) IDNode(field string) (*IdentifierNode, error) {
	n, err := j.Node(field)
	if err != nil {
		return nil, err
	}
	id, ok := n.(*IdentifierNode)
	if !ok {
		return nil, fmt.Errorf("field %s is not an identifier node but is %T", field, n)
	}
	return id, nil
}

// RefNode reads a ReferenceNode from the field
func (j JSONNode) RefNode(field string) (*ReferenceNode, error) {
	n, err := j.Node(field)
	if err != nil {
		return nil, err
	}
	id, ok := n.(*ReferenceNode)
	if !ok {
		return nil, fmt.Errorf("field %s is not a reference node but is %T", field, n)
	}
	return id, nil
}

func (j JSONNode) getNode(nn interface{}) (Node, error) {
	nd, ok := nn.(map[string]interface{})
	if !ok {
		return nil, fmt.Errorf("expected node type but is %T", nn)
	}

	node := JSONNode(nd)
	typ, err := node.TypeOf()
	if err != nil {
		return nil, err
	}

	var n Node
	switch typ {
	case "number":
		n = &NumberNode{}
	case "dbrp":
		n = &DBRPNode{}
	case "duration":
		n = &DurationNode{}
	case "bool":
		n = &BoolNode{}
	case "unary":
		n = &UnaryNode{}
	case "binary":
		n = &BinaryNode{}
	case "declaration":
		n = &DeclarationNode{}
	case "typeDeclaration":
		n = &TypeDeclarationNode{}
	case "identifier":
		n = &IdentifierNode{}
	case "reference":
		n = &ReferenceNode{}
	case "string":
		n = &StringNode{}
	case "list":
		n = &ListNode{}
	case "regex":
		n = &RegexNode{}
	case "star":
		n = &StarNode{}
	case "func":
		n = &FunctionNode{}
	case "lambda":
		n = &LambdaNode{}
	case "program":
		n = &ProgramNode{}
	case "comment":
		n = &CommentNode{}
	}
	err = n.unmarshal(node)
	return n, err
}


text:
using System;
using System.Collections.Generic;
using Aquarius.TimeSeries.Client.ServiceModels.Publish;
using SosExporter.Dtos;

namespace SosExporter
{
    public interface ISosClient : IDisposable
    {
        void Connect();
        void Disconnect();
        void ClearDatasource();
        void DeleteDeletedObservations();
        void EnableTransactionalOperations();
        void DisableTransactionalOperations();
        SensorInfo FindExistingSensor(TimeSeriesDescription timeSeriesDescription);
        void DeleteSensor(TimeSeriesDataServiceResponse timeSeries);
        InsertSensorResponse InsertSensor(TimeSeriesDataServiceResponse timeSeries);
        void InsertObservation(string assignedOffering, LocationDataServiceResponse location, LocationDescription locationDescription, TimeSeriesDataServiceResponse timeSeries);
        List<TimeSeriesPoint> GetObservations(TimeSeriesDescription timeSeriesDescription, DateTimeOffset startTime, DateTimeOffset endTime);
    }
}


text:
DIRECTORY=`pwd`

TEST_DIRECTORY=$DIRECTORY/tests_data
TEST_HOSTER_PATH=$TEST_DIRECTORY/hoster_path
TEST_HOST_FILE=$TEST_DIRECTORY/hosts

export HOSTER_PATH=$TEST_HOSTER_PATH
export HOST_FILE=$TEST_HOST_FILE

setUp()
{
  rm -rf $TEST_DIRECTORY
  mkdir $TEST_DIRECTORY
  cp $DIRECTORY/example_hosts $TEST_DIRECTORY/hosts
}

tearDown()
{
  rm -rf $TEST_DIRECTORY
}

installHoster()
{
  OUTPUT=`./cli.sh install > /dev/null`
  echo "$OUTPUT"
}

createSampleHostFile()
{
  cp $TEST_HOST_FILE $TEST_HOSTER_PATH/test1
  sed -i 's/maria/somethingElse/' $TEST_HOSTER_PATH/test1
}

checkContainment() {
  expected_substring="$1"
  actual_string="$2"
  echo "$actual_string" | grep -q "$expected_substring"
}

assertContains() {
  checkContainment "$1" "$2"
  assertTrue "$3" $?
}

assertDoesNotContain() {
  checkContainment "$1" "$2"
  assertFalse "$3" $?
}

testShowsAsNotInstalled()
{
  OUTPUT=`./cli.sh`
  assertContains "Hoster is not installed" "$OUTPUT" "Couldn't see not installed message"
}

testHelpShowsAllCommands()
{
  OUTPUT=`./cli.sh help`
  assertContains "Usage\: hoster \[command\]" "$OUTPUT" "Couldn't see usage"
  assertContains "\> install" "$OUTPUT" "Couldn't see install"
  assertContains "use" "$OUTPUT" "Couldn't see use"
  assertContains "list" "$OUTPUT" "Couldn't see list"
  assertContains "create" "$OUTPUT" "Couldn't see create"
}

testBackupsOriginalWhenInstall()
{
  installHoster

  ORIGINAL_HOST_CONTENTS=`cat "$TEST_HOST_FILE"`
  BACKUP_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/original"`

  assertEquals "$ORIGINAL_HOST_CONTENTS" "$BACKUP_HOST_CONTENTS"
}

testLinksOriginalToActiveHostWhenInstall()
{
  installHoster

  ORIGINAL_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/original"`
  ACTIVE_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/active"`

  assertEquals "$ORIGINAL_HOST_CONTENTS" "$ACTIVE_HOST_CONTENTS"
}

testReplacesOriginalHostFileOnSystemToActiveHoster()
{
  installHoster

  ORIGINAL_HOST_CONTENTS=`cat "$TEST_HOST_FILE"`
  ACTIVE_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/active"`

  assertEquals "$ORIGINAL_HOST_CONTENTS" "$ACTIVE_HOST_CONTENTS"
}

testUseSwitchesActiveHostToSelectedHost()
{
  installHoster
  createSampleHostFile
  OUTPUT=`./cli.sh use test1`

  NEW_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/test1"`
  ACTIVE_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/active"`

  assertEquals "$NEW_HOST_CONTENTS" "$ACTIVE_HOST_CONTENTS"
}

testListShowsAllHostsFileInDirectory()
{
  installHoster
  createSampleHostFile

  OUTPUT=`./cli.sh list`

  assertContains "test1" "$OUTPUT" "Expected to see test1 in output"
  assertContains "original" "$OUTPUT" "Expected to see original in output"
  assertDoesNotContain "active" "$OUTPUT" "Expected not to see active in output"
}

testLSIsIdenticalToList()
{
  installHoster
  createSampleHostFile

  OUTPUT_LS=`./cli.sh ls`
  OUTPUT_LIST=`./cli.sh list`

  assertEquals "$OUTPUT_LS" "$OUTPUT_LIST"
}

testCreateCreatesNewHostFileFromOriginal()
{
  installHoster
  ./cli.sh create test_create

  ORIGINAL_HOST_CONTENTS=`cat "$TEST_HOST_FILE"`
  NEW_HOST_CONTENTS=`cat "$TEST_HOSTER_PATH/test_create"`

  assertEquals "$ORIGINAL_HOST_CONTENTS" "$NEW_HOST_CONTENTS"
}

# load shunit2
. shunit2


text:
namespace Farmhand.Attributes
{
    using System;

    /// <summary>
    ///     Used by the installer. Redirects a constructor to a method (for factory classes to use).
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    public sealed class HookRedirectConstructorToMethodAttribute : FarmhandHook
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="HookRedirectConstructorToMethodAttribute" /> class.
        /// </summary>
        /// <param name="type">
        ///     The type.
        /// </param>
        /// <param name="method">
        ///     The method.
        /// </param>
        /// <param name="genericArguments">
        ///     The generic arguments.
        /// </param>
        public HookRedirectConstructorToMethodAttribute(string type, string method, params Type[] genericArguments)
        {
            this.Type = type;
            this.Method = method;
            this.GenericArguments = genericArguments;
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="HookRedirectConstructorToMethodAttribute" /> class.
        /// </summary>
        /// <param name="type">
        ///     The type.
        /// </param>
        /// <param name="method">
        ///     The method.
        /// </param>
        public HookRedirectConstructorToMethodAttribute(string type, string method)
        {
            this.Type = type;
            this.Method = method;
        }

        /// <summary>
        ///     Gets or sets the type.
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        ///     Gets or sets the method.
        /// </summary>
        public string Method { get; set; }

        /// <summary>
        ///     Gets or sets the generic arguments.
        /// </summary>
        public Type[] GenericArguments { get; set; }
    }
}


text:
package proxy

import (
	"errors"
	"log"
	"net/url"
	"sync"
	"time"
)

const (
	// amount of time an endpoint will be held in a failed
	// state before being reconsidered for proxied requests
	endpointFailureWait = 5 * time.Second
)

func newDirector(scheme string, addrs []string) (*director, error) {
	if len(addrs) == 0 {
		return nil, errors.New("one or more upstream addresses required")
	}

	endpoints := make([]*endpoint, len(addrs))
	for i, addr := range addrs {
		u := url.URL{Scheme: scheme, Host: addr}
		endpoints[i] = newEndpoint(u)
	}

	d := director{ep: endpoints}
	return &d, nil
}

type director struct {
	ep []*endpoint
}

func (d *director) endpoints() []*endpoint {
	filtered := make([]*endpoint, 0)
	for _, ep := range d.ep {
		if ep.Available {
			filtered = append(filtered, ep)
		}
	}

	return filtered
}

func newEndpoint(u url.URL) *endpoint {
	ep := endpoint{
		URL:       u,
		Available: true,
		failFunc:  timedUnavailabilityFunc(endpointFailureWait),
	}

	return &ep
}

type endpoint struct {
	sync.Mutex

	URL       url.URL
	Available bool

	failFunc func(ep *endpoint)
}

func (ep *endpoint) Failed() {
	ep.Lock()
	if !ep.Available {
		ep.Unlock()
		return
	}

	ep.Available = false
	ep.Unlock()

	log.Printf("proxy: marked endpoint %s unavailable", ep.URL.String())

	if ep.failFunc == nil {
		log.Printf("proxy: no failFunc defined, endpoint %s will be unavailable forever.", ep.URL.String())
		return
	}

	ep.failFunc(ep)
}

func timedUnavailabilityFunc(wait time.Duration) func(*endpoint) {
	return func(ep *endpoint) {
		time.AfterFunc(wait, func() {
			ep.Available = true
			log.Printf("proxy: marked endpoint %s available", ep.URL.String())
		})
	}
}


text:
package com.kodcu.service.shortcut;

import com.kodcu.controller.ApplicationController;
import com.kodcu.other.Current;
import com.kodcu.service.table.AsciidocTableController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by usta on 02.10.2015.
 */
@Component
public class HtmlShortcutService implements ShortcutService {

    private final Current current;
    private final ApplicationController controller;
    private final AsciidocTableController tableController;

    @Autowired
    public HtmlShortcutService(Current current, ApplicationController controller, AsciidocTableController tableController) {
        this.current = current;
        this.controller = controller;
        this.tableController = tableController;
    }

    @Override
    public void addBold() {
        current.currentEngine().executeScript("editorMenu.html.boldText()");
    }

    @Override
    public void addItalic() {
        current.currentEngine().executeScript("editorMenu.html.italicizeText()");
    }

    @Override
    public void addHeading() {
        current.currentEngine().executeScript("editorMenu.html.addHeading()");
    }

    @Override
    public void addCode(String lang) {
        current.currentEngine().executeScript("editorMenu.html.addSourceCode('" + lang + "')");
    }

    @Override
    public void addUnorderedList() {
        current.currentEngine().executeScript("editorMenu.html.addUlList()");
    }

    @Override
    public void addOrderedList() {
        current.currentEngine().executeScript("editorMenu.html.addOlList()");
    }

    @Override
    public void addTable() {
    }

    @Override
    public void addBasicTable(String row, String column) {
    }

    @Override
    public void addImage() {
        current.currentEngine().executeScript("editorMenu.html.addImageSection()");
    }

    @Override
    public void addSubscript() {
        current.currentEngine().executeScript("editorMenu.html.subScript()");
    }

    @Override
    public void addSuperscript() {
        current.currentEngine().executeScript("editorMenu.html.superScript()");
    }

    @Override
    public void addUnderline() {
        current.currentEngine().executeScript("editorMenu.html.underlinedText()");
    }

    @Override
    public void addHyperlink() {
        current.currentEngine().executeScript("editorMenu.html.addHyperLink()");
    }

    @Override
    public void addStrike() {
        current.currentEngine().executeScript("editorMenu.html.addStrikeThroughText()");
    }

    @Override
    public void addQuote() {
        current.currentEngine().executeScript("editorMenu.html.addQuote()");
    }

    @Override
    public void addHighlight() {
    }

    @Override
    public void addAdmonition(String type) {
    }

    @Override
    public void addSidebarBlock() {
    }

    @Override
    public void addExampleBlock() {
    }

    @Override
    public void addPassthroughBlock() {
    }

    @Override
    public void addIndexSelection() {
    }

    @Override
    public void addColophon() {
    }

    @Override
    public void addPreface() {
    }

    @Override
    public void addDedication() {
    }

    @Override
    public void addAppendix() {
    }

    @Override
    public void addGlossary() {
    }

    @Override
    public void addBibliography() {
    }

    @Override
    public void addIndex() {
    }

    @Override
    public void addBookHeader() {
    }

    @Override
    public void addArticleHeader() {
    }

    @Override
    public void addMathBlock() {
    }

    @Override
    public void addUmlBlock() {
    }

    @Override
    public void addDitaaBlock() {
    }

    @Override
    public void addTreeBlock() {
    }

    @Override
    public void addPieChart() {
    }

    @Override
    public void addBarChart() {
    }

    @Override
    public void addLineChart() {
    }

    @Override
    public void addAreaChart() {
    }

    @Override
    public void addScatterChart() {
    }

    @Override
    public void addBubbleChart() {
    }

    @Override
    public void addStackedAreaChart() {
    }

    @Override
    public void addStackedBarChart() {
    }

    @Override
    public void includeAsSubdocument() {

    }

}


text:
package com.harmazing.openbridge.alarm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.harmazing.openbridge.alarm.dao.ActionMapper;
import com.harmazing.openbridge.alarm.dao.TemplateMapper;
import com.harmazing.openbridge.alarm.model.Action;
import com.harmazing.openbridge.alarm.model.Template;
import com.harmazing.openbridge.alarm.model.vo.ActionDTO;
import com.harmazing.openbridge.alarm.model.vo.ActionFalconDTO;
import com.harmazing.openbridge.alarm.service.IActionService;

/**
 * Created by 李杨 [liyang@yihecloud.com] on 2016/8/5 9:36.
 */
@Service
@Transactional
public class ActionServiceImpl implements IActionService {
	@Autowired
	private ActionMapper actionMapper;
	@Autowired
	private TemplateMapper templateMapper;
	@Override
	@Transactional(readOnly = true)
	public Action findById(long id) {
		return actionMapper.findById(id);
	}

	@Override
	@Transactional(readOnly = true)
	public ActionFalconDTO findFalconById(long id) {
		return actionMapper.findFlaconById(id);
	}

	@Override
	@Transactional(readOnly = true)
	public Action findByUic(String uic) {
		return actionMapper.findByUic(uic);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Action> findAll() {
		return actionMapper.findAll();
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public Action insert(ActionDTO actionDTO) {
		Action action = null;
		Template template = templateMapper.findById(actionDTO.getTplId());
		if (template != null) {
			action = actionDTO.getAction();
			actionMapper.insert(action);
			templateMapper.updateActionIdById(action.getId(), template.getId());
		}
		return action;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public int update(Action action) {
		return actionMapper.update(action);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public int deleteById(long id) {
		return actionMapper.deleteById(id);
	}

	@Override
	public int getCountByUic(String uic) {
		return actionMapper.getCountByUic("uic");
	}
}


text:
If there is an existing Electron issue for this, please link it here:

https://github.com/atom/electron/issues

Describe your problem:


text:
namespace NULLC
{
	extern const char*	nullcLastError;
}

namespace
{
	JNIEnv *env = 0;

	jclass classBool, classChar, classShort, classInt, classLong, classFloat, classDouble;
	jclass classNullcArray, classNullcRef, classNullcFuncPtr, classNullcAutoArray;

	jclass classFileHandler = 0;
	jobject fileHandler = 0;
}

const char* nullcAndroidFileLoadFunc(const char* name, unsigned int* size)
{
	//__android_log_print(ANDROID_LOG_INFO, "nullc", "nullcAndroidfileLoadFunc %s\n", name);

	assert(name);
	assert(size);

	if(!env || !fileHandler)
	{
		*size = 0;
		return NULL;
	}

	jmethodID mid = env->GetMethodID(classFileHandler, "Read", "(Ljava/lang/String;)[B");

	jstring javaName = env->NewStringUTF(name);
	jbyteArray arr = (jbyteArray)env->CallObjectMethod(fileHandler, mid, javaName);
	env->DeleteLocalRef(javaName);

    if(!arr)
    {
        *size = 0;
        return NULL;
    }

	jsize arrSize = env->GetArrayLength(arr);
	jbyte *arrElements = env->GetByteArrayElements(arr, NULL);

	char *contents = (char*)NULLC::alloc(arrSize + 1);
	memcpy(contents, arrElements, arrSize);
	contents[arrSize] = 0;

	env->ReleaseByteArrayElements(arr, arrElements, 0);

	*size = arrSize;
	return contents;
}

void nullcAndroidFileFreeFunc(const char* data)
{
	if(!data)
		return;

	NULLC::dealloc((void*)data);
}

extern "C" {

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcInit(JNIEnv *env, jclass cls)
{
	::env = env;

	nullcInit();

	nullcSetFileReadHandler(nullcAndroidFileLoadFunc, nullcAndroidFileFreeFunc);

	classBool = env->FindClass("java/lang/Boolean");
	classBool = (jclass)env->NewGlobalRef(classBool);

	classChar = env->FindClass("java/lang/Character");
	classChar = (jclass)env->NewGlobalRef(classChar);

	classShort = env->FindClass("java/lang/Short");
	classShort = (jclass)env->NewGlobalRef(classShort);

	classInt = env->FindClass("java/lang/Integer");
	classInt = (jclass)env->NewGlobalRef(classInt);

	classLong = env->FindClass("java/lang/Long");
	classLong = (jclass)env->NewGlobalRef(classLong);

	classFloat = env->FindClass("java/lang/Float");
	classFloat = (jclass)env->NewGlobalRef(classFloat);

	classDouble = env->FindClass("java/lang/Double");
	classDouble = (jclass)env->NewGlobalRef(classDouble);

	classNullcArray = env->FindClass("org/nullc/Nullc$NULLCArray");
	classNullcArray = (jclass)env->NewGlobalRef(classNullcArray);

	classNullcRef = env->FindClass("org/nullc/Nullc$NULLCRef");
	classNullcRef = (jclass)env->NewGlobalRef(classNullcRef);

	classNullcFuncPtr = env->FindClass("org/nullc/Nullc$NULLCFuncPtr");
	classNullcFuncPtr = (jclass)env->NewGlobalRef(classNullcFuncPtr);

	classNullcAutoArray = env->FindClass("org/nullc/Nullc$NULLCAutoArray");
	classNullcAutoArray = (jclass)env->NewGlobalRef(classNullcAutoArray);

	return 1;
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcClearImportPath(JNIEnv *env, jclass cls)
{
	nullcClearImportPaths();
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcAddImportPath(JNIEnv *env, jclass cls, jstring importPath)
{
	const char *nativeString = env->GetStringUTFChars(importPath, 0);

	nullcAddImportPath(nativeString);

	env->ReleaseStringUTFChars(importPath, nativeString);
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcSetFileReadHandler(JNIEnv *env, jclass cls, jobject handler)
{
	::env = env;

	if(classFileHandler)
		env->DeleteGlobalRef(classFileHandler);
	classFileHandler = 0;

	if(handler)
	{
		classFileHandler = env->FindClass("org/nullc/Nullc$FileReadHandler");
		classFileHandler = (jclass)env->NewGlobalRef(classFileHandler);

		//__android_log_print(ANDROID_LOG_INFO, "nullc", "nullcSetFileReadHandler 1 %p\n", classFileHandler);
	}

	if(fileHandler)
		env->DeleteGlobalRef(fileHandler);

	fileHandler = handler;

	if(handler)
	{
		fileHandler = env->NewGlobalRef(fileHandler);

		//__android_log_print(ANDROID_LOG_INFO, "nullc", "nullcSetFileReadHandler 2 %p\n", fileHandler);
	}
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcSetGlobalMemoryLimit(JNIEnv *env, jclass cls, jint limit)
{
	nullcSetGlobalMemoryLimit(limit);
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcSetEnableLogFiles(JNIEnv *env, jclass cls, jint enable)
{
	nullcSetEnableLogFiles(enable, 0, 0, 0);
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcSetOptimizationLevel(JNIEnv *env, jclass cls, jint level)
{
	nullcSetOptimizationLevel(level);
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcTerminate(JNIEnv *env, jclass cls)
{
	env->DeleteGlobalRef(classBool);
	classBool = 0;
	env->DeleteGlobalRef(classChar);
	classChar = 0;
	env->DeleteGlobalRef(classShort);
	classShort = 0;
	env->DeleteGlobalRef(classInt);
	classInt = 0;
	env->DeleteGlobalRef(classLong);
	classLong = 0;
	env->DeleteGlobalRef(classFloat);
	classFloat = 0;
	env->DeleteGlobalRef(classDouble);
	classDouble = 0;
	env->DeleteGlobalRef(classNullcArray);
	classNullcArray = 0;
	env->DeleteGlobalRef(classNullcRef);
	classNullcRef = 0;
	env->DeleteGlobalRef(classNullcFuncPtr);
	classNullcFuncPtr = 0;
	env->DeleteGlobalRef(classNullcAutoArray);
	classNullcAutoArray = 0;

	nullcTerminate();
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcSetExecutor(JNIEnv *env, jclass cls, jobject id)
{
	// TODO
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcLoadModuleBySource(JNIEnv *env, jclass cls, jstring module, jstring code)
{
	const char *moduleStr = env->GetStringUTFChars(module, 0);
	const char *codeStr = env->GetStringUTFChars(code, 0);

	nullres res = nullcLoadModuleBySource(moduleStr, codeStr);

	env->ReleaseStringUTFChars(module, moduleStr);
	env->ReleaseStringUTFChars(code, codeStr);

	return !!res;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcLoadModuleByBinary(JNIEnv *env, jclass cls, jstring module, jbyteArray code)
{
	const char *moduleStr = env->GetStringUTFChars(module, 0);
	jbyte *codeArr = env->GetByteArrayElements(code, 0);

	nullres res = nullcLoadModuleByBinary(moduleStr, (const char*)codeArr);

	env->ReleaseStringUTFChars(module, moduleStr);
	env->ReleaseByteArrayElements(code, codeArr, JNI_ABORT);

	return !!res;
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcRemoveModule(JNIEnv *env, jclass cls, jstring module)
{
	const char *moduleStr = env->GetStringUTFChars(module, 0);

	nullcRemoveModule(moduleStr);

	env->ReleaseStringUTFChars(module, moduleStr);
}

JNIEXPORT jstring JNICALL Java_org_nullc_Nullc_nullcEnumerateModules(JNIEnv *env, jclass cls, jint id)
{
	return env->NewStringUTF(nullcEnumerateModules(id));
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcBuild(JNIEnv *env, jclass cls, jstring code)
{
	const char *codeStr = env->GetStringUTFChars(code, 0);

	nullres res = nullcBuild(codeStr);

	env->ReleaseStringUTFChars(code, codeStr);

	return !!res;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcRun(JNIEnv *env, jclass cls)
{
	return !!nullcRun();
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcRunFunction(JNIEnv *env, jclass cls, jstring funcName, jobjectArray arguments)
{
	if(!funcName)
		return !!nullcRun();

	const char *funcNameStr = env->GetStringUTFChars(funcName, 0);

	NULLCFuncPtr func;
	if(!nullcGetFunction(funcNameStr, &func))
	{
		env->ReleaseStringUTFChars(funcName, funcNameStr);
		return false;
	}

	unsigned functionCount = 0;
	ExternFuncInfo *functions = nullcDebugFunctionInfo(&functionCount);

	unsigned typeCount = 0;
	ExternTypeInfo *types = nullcDebugTypeInfo(&typeCount);

	unsigned localCount = 0;
	ExternLocalInfo *locals = nullcDebugLocalInfo(&localCount);

	ExternFuncInfo &function = functions[func.id];

	char *argBuf = (char*)NULLC::alloc(function.argumentSize + sizeof(void*));

	jsize argCount = env->GetArrayLength(arguments);

	static char errorText[512];

	if(argCount != function.paramCount)
	{
		NULLC::SafeSprintf(errorText, 512, "ERROR: function '%s' expects %d arguments, but %d were supplied", funcNameStr, function.paramCount, argCount);
		NULLC::nullcLastError = errorText;
		return false;
	}

	env->ReleaseStringUTFChars(funcName, funcNameStr);

	char *argPos = argBuf;
	for(unsigned int i = 0; i < function.paramCount; i++)
	{
		ExternLocalInfo &lInfo = locals[function.offsetToFirstLocal + i];
		ExternTypeInfo &tInfo = types[lInfo.type];

		jobject obj = env->GetObjectArrayElement(arguments, i);
		jclass objClass = env->GetObjectClass(obj);

		switch(tInfo.type)
		{
		case ExternTypeInfo::TYPE_CHAR:
			if(objClass == classBool)
			{
				*(int*)argPos = (int)env->CallBooleanMethod(obj, env->GetMethodID(classBool, "booleanValue", "()Z"));
			}else if(objClass == classChar){
				*(int*)argPos = (int)env->CallCharMethod(obj, env->GetMethodID(classChar, "charValue", "()C"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 4;
			break;
		case ExternTypeInfo::TYPE_SHORT:
			if(objClass == classShort)
			{
				*(int*)argPos = (int)env->CallShortMethod(obj, env->GetMethodID(classShort, "shortValue", "()S"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 4;
			break;
		case ExternTypeInfo::TYPE_INT:
			if(objClass == classInt)
			{
				*(int*)argPos = env->CallIntMethod(obj, env->GetMethodID(classInt, "intValue", "()I"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 4;
			break;
		case ExternTypeInfo::TYPE_LONG:
			if(objClass == classLong)
			{
				*(long long*)argPos = env->CallLongMethod(obj, env->GetMethodID(classLong, "longValue", "()J"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 8;
			break;
		case ExternTypeInfo::TYPE_FLOAT:
			if(objClass == classFloat)
			{
				*(float*)argPos = env->CallFloatMethod(obj, env->GetMethodID(classFloat, "floatValue", "()F"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 4;
			break;
		case ExternTypeInfo::TYPE_DOUBLE:
			if(objClass == classDouble)
			{
				*(double*)argPos = env->CallDoubleMethod(obj, env->GetMethodID(classDouble, "doubleValue", "()D"));
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			argPos += 8;
			break;
		case ExternTypeInfo::TYPE_COMPLEX:
			if(objClass == classNullcArray)
			{
				jfieldID ptrField = env->GetFieldID(classNullcArray, "ptr", "J");
				jfieldID lengthField = env->GetFieldID(classNullcArray, "length", "I");

				*(int*)argPos = (int)env->GetLongField(obj, ptrField);
				argPos += 4;

				*(int*)argPos = env->GetIntField(obj, lengthField);
				argPos += 4;
			}else if(objClass == classNullcRef){
				jfieldID typeIdField = env->GetFieldID(classNullcArray, "typeID", "I");
				jfieldID ptrField = env->GetFieldID(classNullcArray, "ptr", "J");

				*(int*)argPos = env->GetIntField(obj, typeIdField);
				argPos += 4;

				*(int*)argPos = (int)env->GetLongField(obj, ptrField);
				argPos += 4;
			}else if(objClass == classNullcFuncPtr){
				jfieldID contextField = env->GetFieldID(classNullcArray, "context", "J");
				jfieldID idField = env->GetFieldID(classNullcArray, "id", "I");

				*(int*)argPos = (int)env->GetLongField(obj, contextField);
				argPos += 4;

				*(int*)argPos = env->GetIntField(obj, idField);
				argPos += 4;
			}else if(objClass == classNullcAutoArray){
				jfieldID typeIdField = env->GetFieldID(classNullcArray, "typeID", "I");
				jfieldID ptrField = env->GetFieldID(classNullcArray, "ptr", "J");
				jfieldID lengthField = env->GetFieldID(classNullcArray, "length", "I");

				*(int*)argPos = env->GetIntField(obj, typeIdField);
				argPos += 4;

				*(int*)argPos = (int)env->GetLongField(obj, ptrField);
				argPos += 4;

				*(int*)argPos = env->GetIntField(obj, lengthField);
				argPos += 4;
			}else{
				NULLC::SafeSprintf(errorText, 512, "ERROR: function argument %d is of type %s", i, nullcDebugSource() + tInfo.offsetToName);
				NULLC::nullcLastError = errorText;
				return false;
			}
			break;
		case ExternTypeInfo::TYPE_VOID:
			break;
		}
	}
	*(uintptr_t*)argPos = 0;
	argPos += sizeof(uintptr_t);

	nullres res = nullcRunFunctionInternal(func.id, argBuf);

	NULLC::dealloc(argBuf);

	return !!res;
}

JNIEXPORT jstring JNICALL Java_org_nullc_Nullc_nullcGetResult(JNIEnv *env, jclass cls)
{
	return env->NewStringUTF(nullcGetResult());
}

JNIEXPORT jint JNICALL Java_org_nullc_Nullc_nullcGetResultInt(JNIEnv *env, jclass cls)
{
	return nullcGetResultInt();
}

JNIEXPORT jdouble JNICALL Java_org_nullc_Nullc_nullcGetResultDouble(JNIEnv *env, jclass cls)
{
	return nullcGetResultDouble();
}

JNIEXPORT jlong JNICALL Java_org_nullc_Nullc_nullcGetResultLong(JNIEnv *env, jclass cls)
{
	return nullcGetResultLong();
}

JNIEXPORT jstring JNICALL Java_org_nullc_Nullc_nullcGetLastError(JNIEnv *env, jclass cls)
{
	return env->NewStringUTF(nullcGetLastError());
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcFinalize(JNIEnv *env, jclass cls)
{
	return !!nullcFinalize();
}

JNIEXPORT jlong JNICALL Java_org_nullc_Nullc_nullcAllocate(JNIEnv *env, jclass cls, jint size)
{
	return (intptr_t)nullcAllocate(size);
}

JNIEXPORT jlong JNICALL Java_org_nullc_Nullc_nullcAllocateTyped(JNIEnv *env, jclass cls, jint typeID)
{
	return (intptr_t)nullcAllocateTyped(typeID);
}

JNIEXPORT jobject JNICALL Java_org_nullc_Nullc_nullcAllocateArrayTyped(JNIEnv *env, jclass cls, jint typeID, jint size)
{
	jobject array = env->AllocObject(classNullcArray);

	jfieldID ptrField = env->GetFieldID(classNullcArray, "ptr", "J");
	jfieldID lengthField = env->GetFieldID(classNullcArray, "length", "I");

	NULLCArray arr = nullcAllocateArrayTyped(typeID, size);

	env->SetLongField(array, ptrField, (long long)arr.ptr);
	env->SetIntField(array, lengthField, arr.len);

	return array;
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcThrowError(JNIEnv *env, jclass cls, jstring error)
{
	const char *errorStr = env->GetStringUTFChars(error, 0);

	nullcThrowError("%s", errorStr);

	env->ReleaseStringUTFChars(error, errorStr);
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcCallFunction(JNIEnv *env, jclass cls, jobject ptr, jobjectArray arguments)
{
	// TODO
	return false;
}

JNIEXPORT jobject JNICALL Java_org_nullc_Nullc_nullcGetGlobal(JNIEnv *env, jclass cls, jstring name)
{
	// TODO
	return 0;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcSetGlobal(JNIEnv *env, jclass cls, jstring name, jobject data)
{
	// TODO
	return false;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcGetFunction(JNIEnv *env, jclass cls, jstring name, jobject func)
{
	// TODO
	return false;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcSetFunction(JNIEnv *env, jclass cls, jstring name, jobject func)
{
	// TODO
	return false;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcIsStackPointer(JNIEnv *env, jclass cls, jlong ptr)
{
	return !!nullcIsStackPointer((void*)(intptr_t)ptr);
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcIsManagedPointer(JNIEnv *env, jclass cls, jlong ptr)
{
	return !!nullcIsManagedPointer((void*)(intptr_t)ptr);
}

JNIEXPORT jint JNICALL Java_org_nullc_Nullc_nullcInitTypeinfoModule(JNIEnv *env, jclass cls)
{
	return nullcInitTypeinfoModule();
}

JNIEXPORT jint JNICALL Java_org_nullc_Nullc_nullcInitDynamicModule(JNIEnv *env, jclass cls)
{
	return nullcInitDynamicModule();
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcAnalyze(JNIEnv *env, jclass cls, jstring code)
{
	const char *codeStr = env->GetStringUTFChars(code, 0);

	nullres res = nullcAnalyze(codeStr);

	env->ReleaseStringUTFChars(code, codeStr);

	return !!res;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcCompile(JNIEnv *env, jclass cls, jstring code)
{
	const char *codeStr = env->GetStringUTFChars(code, 0);

	nullres res = nullcCompile(codeStr);

	env->ReleaseStringUTFChars(code, codeStr);

	return !!res;
}

JNIEXPORT jbyteArray JNICALL Java_org_nullc_Nullc_nullcGetBytecode(JNIEnv *env, jclass cls)
{
	char *bytecode = 0;
	unsigned size = nullcGetBytecode(&bytecode);

	if(!bytecode)
		return 0;

	jbyteArray arr = env->NewByteArray(size);
	jbyte *arrElements = env->GetByteArrayElements(arr, NULL);

	memcpy(arrElements, bytecode, size);
	delete[] bytecode;

	env->ReleaseByteArrayElements(arr, arrElements, 0);

	return arr;
}

JNIEXPORT jbyteArray JNICALL Java_org_nullc_Nullc_nullcGetBytecodeNoCache(JNIEnv *env, jclass cls)
{
	char *bytecode = 0;
	unsigned size = nullcGetBytecodeNoCache(&bytecode);

	if(!bytecode)
		return 0;

	jbyteArray arr = env->NewByteArray(size);
	jbyte *arrElements = env->GetByteArrayElements(arr, NULL);

	memcpy(arrElements, bytecode, size);
	delete[] bytecode;

	env->ReleaseByteArrayElements(arr, arrElements, 0);

	return arr;
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcSaveListing(JNIEnv *env, jclass cls, jstring fileName)
{
	const char *fileNameStr = env->GetStringUTFChars(fileName, 0);

	nullres res = nullcSaveListing(fileNameStr);

	env->ReleaseStringUTFChars(fileName, fileNameStr);

	return !!res;
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcTranslateToC(JNIEnv *env, jclass cls, jstring fileName, jstring mainName)
{
	const char *fileNameStr = env->GetStringUTFChars(fileName, 0);
	const char *mainNameStr = env->GetStringUTFChars(mainName, 0);

	nullcTranslateToC(fileNameStr, mainNameStr, 0);

	env->ReleaseStringUTFChars(fileName, fileNameStr);
	env->ReleaseStringUTFChars(mainName, mainNameStr);
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcClean(JNIEnv *env, jclass cls)
{
	nullcClean();
}

JNIEXPORT jboolean JNICALL Java_org_nullc_Nullc_nullcLinkCode(JNIEnv *env, jclass cls, jbyteArray arr)
{
	jsize size = env->GetArrayLength(arr);
	jbyte *arrElements = env->GetByteArrayElements(arr, NULL);

	char *bytecode = (char*)NULLC::alloc(size);
	memcpy(bytecode, arrElements, size);

	env->ReleaseByteArrayElements(arr, arrElements, 0);

	nullres res = nullcLinkCode(bytecode);

	NULLC::dealloc(bytecode);

	return !!res;
}

JNIEXPORT void JNICALL Java_org_nullc_Nullc_nullcRunTests(JNIEnv *env, jclass cls, jboolean verbose)
{
#ifdef BUILD_TESTS
	RunTests(verbose, nullcAndroidFileLoadFunc, nullcAndroidFileFreeFunc, false, false, false, false, false);
#endif
}

}


text:
cask 'imaging-edge' do
  version '2.0.0_1908a,RXbW3ux0HM'
  sha256 '0faf40d6acf2e867b250b58d15d8291580115135e20a48c67a9749f321edcf17'

  # ids.update.sony.net/IDC was verified as official when first introduced to the cask
  url "http://ids.update.sony.net/IDC/#{version.after_comma}/IE#{version.before_comma.no_dots}.dmg"
  appcast 'https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://support.d-imaging.sony.co.jp/disoft_DL/imagingedge_DL/mac?fm=en',
          configuration: version.after_comma
  name 'Sony Imaging Edge'
  homepage 'https://support.d-imaging.sony.co.jp/app/imagingedge/'

  pkg 'IE_INST.pkg'

  uninstall pkgutil: 'com.sony.ImagingEdgeVer.1.pkg',
            delete:  '/Applications/Imaging Edge'

  zap trash: [
               '~/Library/Caches/com.sony.Viewer',
               '~/Library/Preferences/com.sony.Edit.plist',
               '~/Library/Preferences/com.sony.Remote.plist',
               '~/Library/Preferences/com.sony.Viewer.plist',
               '~/Library/Saved Application State/com.sony.Viewer.savedState',
             ]
end


text:
package serviceaccount

import (
	"net/http"
	"strings"

	"appengine"
	"appengine/urlfetch"

	"github.com/azoff/goauth2/oauth"
)

// NewClient returns an *http.Client authorized for the
// given scopes with the service account owned by the application.
// Tokens are cached in memcache until they expire.
func NewClient(c appengine.Context, scopes ...string) (*http.Client, error) {
	t := &transport{
		Context: c,
		Scopes:  scopes,
		Transport: &urlfetch.Transport{
			Context:                       c,
			Deadline:                      0,
			AllowInvalidServerCertificate: false,
		},
		TokenCache: &cache{
			Context: c,
			Key:     "goauth2_serviceaccount_" + strings.Join(scopes, "_"),
		},
	}
	// Get the initial access token.
	if err := t.FetchToken(); err != nil {
		return nil, err
	}
	return &http.Client{
		Transport: t,
	}, nil
}

// transport is an oauth.Transport with a custom Refresh and RoundTrip implementation.
type transport struct {
	*oauth.Token
	Context    appengine.Context
	Scopes     []string
	Transport  http.RoundTripper
	TokenCache oauth.Cache
}

func (t *transport) Refresh() error {
	// Get a new access token for the application service account.
	tok, expiry, err := appengine.AccessToken(t.Context, t.Scopes...)
	if err != nil {
		return err
	}
	t.Token = &oauth.Token{
		AccessToken: tok,
		Expiry:      expiry,
	}
	if t.TokenCache != nil {
		// Cache the token and ignore error (as we can always get a new one).
		t.TokenCache.PutToken(t.Token)
	}
	return nil
}

// Fetch token from cache or generate a new one if cache miss or expired.
func (t *transport) FetchToken() error {
	// Try to get the Token from the cache if enabled.
	if t.Token == nil && t.TokenCache != nil {
		// Ignore cache error as we can always get a new token with Refresh.
		t.Token, _ = t.TokenCache.Token()
	}

	// Get a new token using Refresh in case of a cache miss of if it has expired.
	if t.Token == nil || t.Expired() {
		if err := t.Refresh(); err != nil {
			return err
		}
	}
	return nil
}

// cloneRequest returns a clone of the provided *http.Request.
// The clone is a shallow copy of the struct and its Header map.
func cloneRequest(r *http.Request) *http.Request {
	// shallow copy of the struct
	r2 := new(http.Request)
	*r2 = *r
	// deep copy of the Header
	r2.Header = make(http.Header)
	for k, s := range r.Header {
		r2.Header[k] = s
	}
	return r2
}

// RoundTrip issues an authorized HTTP request and returns its response.
func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
	if err := t.FetchToken(); err != nil {
		return nil, err
	}

	// To set the Authorization header, we must make a copy of the Request
	// so that we don't modify the Request we were given.
	// This is required by the specification of http.RoundTripper.
	newReq := cloneRequest(req)
	newReq.Header.Set("Authorization", "Bearer "+t.AccessToken)

	// Make the HTTP request.
	return t.Transport.RoundTrip(newReq)
}


text:
#pragma once
#include <aws/swf/SWF_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace SWF
{
namespace Model
{
  /*

Represents a workflow execution.

  */
  class AWS_SWF_API WorkflowExecution
  {
  public:
    WorkflowExecution();
    WorkflowExecution(const Aws::Utils::Json::JsonValue& jsonValue);
    WorkflowExecution& operator=(const Aws::Utils::Json::JsonValue& jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /*

The user defined identifier associated with the workflow execution.

    */
    inline const Aws::String& GetWorkflowId() const{ return m_workflowId; }

    /*

The user defined identifier associated with the workflow execution.

    */
    inline void SetWorkflowId(const Aws::String& value) { m_workflowIdHasBeenSet = true; m_workflowId = value; }

    /*

The user defined identifier associated with the workflow execution.

    */
    inline void SetWorkflowId(Aws::String&& value) { m_workflowIdHasBeenSet = true; m_workflowId = value; }

    /*

The user defined identifier associated with the workflow execution.

    */
    inline void SetWorkflowId(const char* value) { m_workflowIdHasBeenSet = true; m_workflowId.assign(value); }

    /*

The user defined identifier associated with the workflow execution.

    */
    inline WorkflowExecution& WithWorkflowId(const Aws::String& value) { SetWorkflowId(value); return *this;}

    /*

The user defined identifier associated with the workflow execution.

    */
    inline WorkflowExecution& WithWorkflowId(Aws::String&& value) { SetWorkflowId(value); return *this;}

    /*

The user defined identifier associated with the workflow execution.

    */
    inline WorkflowExecution& WithWorkflowId(const char* value) { SetWorkflowId(value); return *this;}

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline const Aws::String& GetRunId() const{ return m_runId; }

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline void SetRunId(const Aws::String& value) { m_runIdHasBeenSet = true; m_runId = value; }

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline void SetRunId(Aws::String&& value) { m_runIdHasBeenSet = true; m_runId = value; }

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline void SetRunId(const char* value) { m_runIdHasBeenSet = true; m_runId.assign(value); }

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline WorkflowExecution& WithRunId(const Aws::String& value) { SetRunId(value); return *this;}

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline WorkflowExecution& WithRunId(Aws::String&& value) { SetRunId(value); return *this;}

    /*

A system-generated unique identifier for the workflow execution.

    */
    inline WorkflowExecution& WithRunId(const char* value) { SetRunId(value); return *this;}

  private:
    Aws::String m_workflowId;
    bool m_workflowIdHasBeenSet;
    Aws::String m_runId;
    bool m_runIdHasBeenSet;
  };

} // namespace Model
} // namespace SWF
} // namespace Aws


text:
package org.analogweb.scala

import org.analogweb.core.RequestPathDefinition

trait Route {

  val method: String

  val rawPath: String

  val path = RequestPathDefinition.define("/", rawPath, Array[String](method))

  def invoke(request: Request): Any

  def update(parentPath: String): Route

}

trait Routes {
  def routes: Seq[Route]
}

class RequestInvocation(override val method: String,
                        override val rawPath: String,
                        val arounds: Arounds)(val invocation: Request => Any)
    extends Route {
  override def invoke(request: Request): Any = {
    val (rejection, passes) =
      arounds.allBefore
        .map(_.action(request))
        .partition(_.isInstanceOf[reject])
    val invocationResult = rejection.headOption
      .map(_.asInstanceOf[reject].reason)
      .getOrElse {
        val passedWithValues =
          passes
            .collect {
              case p: passWith[_] =>
                p
            }
            .map(p => p.key -> p.result)
            .toMap
        invocation(request.copy(passedWith = passedWithValues))
      }
    arounds.allAfter
      .filter(_.action.isDefinedAt(invocationResult))
      .headOption
      .map(_.action(invocationResult))
      .getOrElse(invocationResult)
  }
  override def update(parentPath: String) =
    new RequestInvocation(method, parentPath + rawPath, arounds)(invocation)
}

object Route {

  def apply[T](method: String, path: String, arounds: Arounds)(invocation: Request => T) =
    new RequestInvocation(method, path, arounds)(invocation)

}


text:
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json.Linq;

namespace Plivo
{
    /// <summary>
    /// Util.
    /// </summary>
    public static class Util
    {
        /// <summary>
        /// XPlivoSignature
        /// </summary>
        public static class XPlivoSignature
        {
            /// <summary>
            /// Verify the signature
            /// </summary>
            /// <param name="uri"></param>
            /// <param name="plivoHttpParams"></param>
            /// <param name="xPlivoSignature"></param>
            /// <param name="authToken"></param>
            /// <returns></returns>
            [System.Obsolete(
                "Util.XPlivoSignature.Verify is deprecated. Use Utilities.XPlivoSignature.Verify instead.")]
            public static bool Verify(string uri, Dictionary<string, object> plivoHttpParams, string xPlivoSignature,
                string authToken)
            {
                return Utilities.XPlivoSignature.Verify(uri, plivoHttpParams, xPlivoSignature, authToken);
            }
        }

        /// <summary>
        /// HtmlEntity.
        /// </summary>
        public static class HtmlEntity
        {
            /// <summary>
            /// Escapes unicode characters in input string
            /// </summary>
            /// <param name="inputText"></param>
            /// <returns></returns>
            [System.Obsolete("Util.HtmlEntity.Convert is deprecated. Use Utilities.HtmlEntity.Convert instead.")]
            public static string Convert(string inputText)
            {
                return Utilities.HtmlEntity.Convert(inputText);
            }
        }

        /// <summary>
        /// Compare the specified json and a.
        /// </summary>
        /// <returns>The compare.</returns>
        /// <param name="json">Json.</param>
        /// <param name="a">The alpha component.</param>
        [System.Obsolete("Util.Compare is deprecated. Use Utilities.ComparisonUtilities.Compare instead.")]
        public static string Compare(string json, object a)
        {
            return Utilities.ComparisonUtilities.Compare(json, a);
        }

        /// <summary>
        /// Compares the objects changing the case of source from snakecase to Pascal case
        /// </summary>
        /// <returns>The objects.</returns>
        /// <param name="source">Source.</param>
        /// <param name="target">Target.</param>
        [System.Obsolete(
            "Util.CompareObjects is deprecated. Use Utilities.ComparisonUtilities.CompareObjects instead.")]
        public static StringBuilder CompareObjects(JObject source, JObject target)
        {
            return Utilities.ComparisonUtilities.CompareObjects(source, target);
        }

        /// <summary>
        /// Deep compare two JObjects. If they don't match, returns text diffs
        /// </summary>
        /// <returns>The raw objects.</returns>
        /// <param name="source">Source.</param>
        /// <param name="target">Target.</param>
        [System.Obsolete(
            "Util.CompareRawObjects is deprecated. Use Utilities.ComparisonUtilities.CompareRawObjects instead.")]
        public static StringBuilder CompareRawObjects(JObject source, JObject target)
        {
            return Utilities.ComparisonUtilities.CompareRawObjects(source, target);
        }

        /// <summary>
        /// Deep compare two NewtonSoft JArrays. If they don't match, returns text diffs
        /// </summary>
        /// <param name="source">The expected results</param>
        /// <param name="target">The actual results</param>
        /// <param name="arrayName">The name of the array to use in the text diff</param>
        /// <returns>string string</returns>
        [System.Obsolete("Util.CompareArrays is deprecated. Use Utilities.ComparisonUtilities.CompareArrays instead.")]
        private static StringBuilder CompareArrays(JArray source, JArray target, string arrayName = "")
        {
            return Utilities.ComparisonUtilities.CompareArrays(source, target, arrayName);
        }

        /// <summary>
        /// Compare two json strings
        /// </summary>
        /// <returns>The compare.</returns>
        /// <param name="expectedJson">Expected json.</param>
        /// <param name="actualJson">Actual json.</param>
        [System.Obsolete("Util.DoCompare is deprecated. Use Utilities.ComparisonUtilities.DoCompare instead.")]
        public static IEnumerable<JProperty> DoCompare(string expectedJson, string actualJson)
        {
            return Utilities.ComparisonUtilities.DoCompare(expectedJson, actualJson);
        }

        /// <summary>
        /// Convert pascal case to snake case.
        /// </summary>
        /// <returns>The case to snake case.</returns>
        /// <param name="name">Name.</param>
        [System.Obsolete(
            "Util.PascalCaseToSnakeCase is deprecated. Use Utilities.StringUtilities.PascalCaseToSnakeCase instead.")]
        public static string PascalCaseToSnakeCase(string name)
        {
            return Utilities.StringUtilities.PascalCaseToSnakeCase(name);
        }

        /// <summary>
        /// Converts camel case to snake case.
        /// </summary>
        /// <returns>The case to snake case.</returns>
        /// <param name="name">Name.</param>
        [System.Obsolete(
            "Util.CamelCaseToSnakeCase is deprecated. Use Utilities.StringUtilities.CamelCaseToSnakeCase instead.")]
        public static string CamelCaseToSnakeCase(string name)
        {
            return Utilities.StringUtilities.CamelCaseToSnakeCase(name);
        }

        /// <summary>
        /// Converts snake case to pascal case.
        /// </summary>
        /// <returns>The case to pascal case.</returns>
        /// <param name="name">Name.</param>
        [System.Obsolete(
            "Util.SnakeCaseToPascalCase is deprecated. Use Utilities.StringUtilities.SnakeCaseToPascalCase instead.")]
        public static string SnakeCaseToPascalCase(string name)
        {
            return Utilities.StringUtilities.SnakeCaseToPascalCase(name);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Squamaria sirgii Colmeiro

### Remarks
null


text:
    int LSVMparser(const char * filename, CvLSVMFilterObject *** model, int *last, int *max,
                   int **comp, float **b, int *count, float * score);
#ifdef __cplusplus
extern "C"
#endif
    int loadModel(

              const char *modelPath,

              CvLSVMFilterObject ***filters,
              int *kFilters,
              int *kComponents,
              int **kPartFilters,
              float **b,
              float *scoreThreshold);
//};
#endif


text:
<!DOCTYPE html>
<html ng-app="app">

<head>
    <title>Products</title>
    <!-- bower:css -->
    <link rel="stylesheet" href="/bower_components/angular-material/angular-material.css">
    <!-- endinject -->
    <!-- inject:css -->
    <link rel="stylesheet" href="/src/client/content/cobweb.css">
    <link rel="stylesheet" href="/src/client/content/icon.css">
    <!-- endinject -->
</head>

<body>
    <section flex layout-fill>
        <div ng-view flex layout-fill></div>
    </section>

    <!-- bower:js -->
    <script src="/bower_components/angular/angular.js"></script>
    <script src="/bower_components/angular-route/angular-route.js"></script>
    <script src="/bower_components/angular-resource/angular-resource.js"></script>
    <script src="/bower_components/angular-animate/angular-animate.js"></script>
    <script src="/bower_components/angular-aria/angular-aria.js"></script>
    <script src="/bower_components/angular-messages/angular-messages.js"></script>
    <script src="/bower_components/material-design-icons/index.js"></script>
    <script src="/bower_components/ngstorage/ngStorage.js"></script>
    <script src="/bower_components/angular-cookies/angular-cookies.js"></script>
    <script src="/bower_components/angular-material/angular-material.js"></script>
    <!-- endinject -->
    <!-- inject:js -->
    <script src="/src/client/app/app.module.js"></script>
    <script src="/src/client/app/common/common.module.js"></script>
    <script src="/src/client/app/configuration/config.module.js"></script>
    <script src="/src/client/app/data/data.module.js"></script>
    <script src="/src/client/app/login/login.module.js"></script>
    <script src="/src/client/app/sensor/sensor.module.js"></script>
    <script src="/src/client/app/widgets/widgets.module.js"></script>
    <script src="/src/client/app/common/common.js"></script>
    <script src="/src/client/app/common/logger.js"></script>
    <script src="/src/client/app/configuration/smartConfigurable.js"></script>
    <script src="/src/client/app/data/datacontext.js"></script>
    <script src="/src/client/app/login/login.js"></script>
    <script src="/src/client/app/login/route.config.js"></script>
    <script src="/src/client/app/sensor/route.config.js"></script>
    <script src="/src/client/app/sensor/sensor.js"></script>
    <script src="/src/client/app/sensor/sensorDetail.js"></script>
    <script src="/src/client/app/widgets/theme.config.js"></script>
    <script src="/src/client/app/data/repositories/repository.auth.js"></script>
    <script src="/src/client/app/data/repositories/repository.boxes.js"></script>
    <script src="/src/client/app/data/repositories/repository.products.js"></script>
    <script src="/src/client/app/login/auth/authenticator.js"></script>
    <script src="/src/client/app/login/auth/authInterceptor.js"></script>
    <script src="/src/client/app/login/config/loginConfig.js"></script>
    <script src="/src/client/app/widgets/sensor/sensorPaperButton.js"></script>
    <!-- endinject -->
</body>

</html>


text:
import configparser as ConfigParser
import errno
import os
import sys

from eventlet.green import subprocess
from neutron.common import config
from neutron.common import utils
from neutron_lib.utils import helpers
from oslo_config import cfg
from oslo_log import log as logging
from oslo_rootwrap import wrapper

from neutron_vpnaas._i18n import _

LOG = logging.getLogger(__name__)

def setup_conf():
    cli_opts = [
        cfg.DictOpt('mount_paths',
                    required=True,
                    help=_('Dict of paths to bind-mount (source:target) '
                           'prior to launch subprocess.')),
        cfg.ListOpt(
            'cmd',
            required=True,
            help=_('Command line to execute as a subprocess '
                   'provided as comma-separated list of arguments.')),
        cfg.StrOpt('rootwrap_config', default='/etc/neutron/rootwrap.conf',
                   help=_('Rootwrap configuration file.')),
    ]
    conf = cfg.CONF
    conf.register_cli_opts(cli_opts)
    return conf

def execute(cmd):
    if not cmd:
        return
    cmd = list(map(str, cmd))
    LOG.debug("Running command: %s", cmd)
    env = os.environ.copy()
    obj = utils.subprocess_popen(cmd, shell=False,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,
                                 env=env)

    _stdout, _stderr = obj.communicate()
    _stdout = helpers.safe_decode_utf8(_stdout)
    _stderr = helpers.safe_decode_utf8(_stderr)
    msg = ('Command: %(cmd)s Exit code: %(returncode)s '
           'Stdout: %(stdout)s Stderr: %(stderr)s' %
           {'cmd': cmd,
            'returncode': obj.returncode,
            'stdout': _stdout,
            'stderr': _stderr})
    LOG.debug(msg)
    obj.stdin.close()
    # Pass the output to calling process
    sys.stdout.write(msg)
    sys.stdout.flush()
    return obj.returncode

def filter_command(command, rootwrap_config):
    # Load rootwrap configuration
    try:
        rawconfig = ConfigParser.RawConfigParser()
        rawconfig.read(rootwrap_config)
        rw_config = wrapper.RootwrapConfig(rawconfig)
    except ValueError as exc:
        LOG.error('Incorrect value in %(config)s: %(exc)s',
                  {'config': rootwrap_config, 'exc': exc})
        sys.exit(errno.EINVAL)
    except ConfigParser.Error:
        LOG.error('Incorrect configuration file: %(config)s',
                  {'config': rootwrap_config})
        sys.exit(errno.EINVAL)

    # Check if command matches any of the loaded filters
    filters = wrapper.load_filters(rw_config.filters_path)
    try:
        wrapper.match_filter(filters, command, exec_dirs=rw_config.exec_dirs)
    except wrapper.FilterMatchNotExecutable as exc:
        LOG.error('Command %(command)s is not executable: '
                  '%(path)s (filter match = %(name)s)',
                  {'command': command,
                   'path': exc.match.exec_path,
                   'name': exc.match.name})
        sys.exit(errno.EINVAL)
    except wrapper.NoFilterMatched:
        LOG.error('Unauthorized command: %(cmd)s (no filter matched)',
                  {'cmd': command})
        sys.exit(errno.EPERM)

def execute_with_mount():
    config.register_common_config_options()
    conf = setup_conf()
    conf()
    config.setup_logging()
    if not conf.cmd:
        LOG.error('No command provided, exiting')
        return errno.EINVAL

    if not conf.mount_paths:
        LOG.error('No mount path provided, exiting')
        return errno.EINVAL

    # Both sudoers and rootwrap.conf will not exist in the directory /etc
    # after bind-mount, so we can't use utils.execute(conf.cmd,
    # run_as_root=True). That's why we have to check here if cmd matches
    # CommandFilter
    filter_command(conf.cmd, conf.rootwrap_config)

    # Make sure the process is running in net namespace invoked by ip
    # netns exec(/proc/[pid]/ns/net) which is since Linux 3.0,
    # as we can't check mount namespace(/proc/[pid]/ns/mnt)
    # which is since Linux 3.8. For more detail please refer the link
    # http://man7.org/linux/man-pages/man7/namespaces.7.html
    if os.path.samefile(os.path.join('/proc/1/ns/net'),
                        os.path.join('/proc', str(os.getpid()), 'ns/net')):
        LOG.error('Cannot run without netns, exiting')
        return errno.EINVAL

    for path, new_path in conf.mount_paths.items():
        if not os.path.isdir(new_path):
            # Sometimes all directories are not ready
            LOG.debug('%s is not directory', new_path)
            continue
        if os.path.isdir(path) and os.path.isabs(path):
            return_code = execute(['mount', '--bind', new_path, path])
            if return_code == 0:
                LOG.info('%(new_path)s has been '
                         'bind-mounted in %(path)s',
                         {'new_path': new_path, 'path': path})
            else:
                LOG.error('Failed to bind-mount '
                          '%(new_path)s in %(path)s',
                          {'new_path': new_path, 'path': path})
    return execute(conf.cmd)

def main():
    sys.exit(execute_with_mount())

if __name__ == "__main__":
    main()


text:
#region License

#endregion

using System.Collections;
using System.Collections.Generic;

namespace Gremlin.Net.Driver
{
    /// <summary>
    ///     A ResultSet is returned from the submission of a Gremlin script to the server and represents the results
    ///     provided by the server. ResultSet includes enumerable data and status attributes.
    /// </summary>
    /// <typeparam name="T">Type of the result elements</typeparam>
    public sealed class ResultSet<T> : IReadOnlyCollection<T>
    {
        private readonly IReadOnlyCollection<T> _data;

        /// <summary>
        ///     Gets or sets the status attributes from the gremlin response
        /// </summary>
        public IReadOnlyDictionary<string, object> StatusAttributes { get; }

        /// <summary>
        ///     Initializes a new instance of the ResultSet class for the specified data and status attributes.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="attributes"></param>
        public ResultSet(IReadOnlyCollection<T> data, IReadOnlyDictionary<string, object> attributes)
        {
            _data = data;
            this.StatusAttributes = attributes;
        }

        /// <inheritdoc />
        public IEnumerator<T> GetEnumerator()
        {
            return _data.GetEnumerator();
        }

        /// <inheritdoc />
        IEnumerator IEnumerable.GetEnumerator()
        {
            return _data.GetEnumerator();
        }

        /// <inheritdoc />
        public int Count => _data.Count;
    }
}


text:
"""Tests of Illumina sequence file parser.
"""

__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Greg Caporaso", "Gavin Huttley"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
__status__ = "Production"

def MinimalIlluminaSequenceParser(data):
    """ Yields (header, sequence, quality strings) given an Illumina sequence file
    """
    if hasattr(data,'lower'):
        # passed a string so open filepath
        data = open(data,'U')

    for line in data:
        fields = line.strip().split(':')
        yield fields[:-2], fields[-2], fields[-1]

    try:
        # if data is a file, close it
        data.close()
    except AttributeError:
        # otherwise do nothing
        pass

    return


text:
<?php

if ( ! class_exists( 'GFForms' ) ) {
	die();
}

/**
 * Class GF_Field
 *
 * Note to third party developers:
 * GF_Field is still in a state of flux at the moment so we don't recommend that you start using it just yet as a base for new fields in production environments.
 * Once it's stable we'll provide documentation and instructions on how to use it for your own projects.
 *
 */
class GF_Field extends stdClass implements ArrayAccess {

	// Suppress deprecation until all the add-ons have been updated
	const SUPPRESS_DEPRECATION_NOTICE = true;

	private static $deprecation_notice_fired = false;

	private $_is_entry_detail = null;

	public function __construct( $data = array() ) {
		if ( empty( $data ) ) {
			return;
		}
		foreach ( $data as $key => $value ) {
			$this->{$key} = $value;
		}
	}

	/*
	 * Fires the deprecation notice only once per page
	 */
	private function maybe_fire_array_access_deprecation_notice( $offset ) {
		if ( self::SUPPRESS_DEPRECATION_NOTICE ) {
			return;
		};

		if ( ! self::$deprecation_notice_fired ) {
			_deprecated_function( 'Array access to the field object is now deprecated. Further notices will be suppressed. Offset: ' . $offset, '1.9', 'the object operator e.g. $field->' . $offset );
			self::$deprecation_notice_fired = true;
		}
	}

	/**
	 * Handles array notation
	 *
	 * @param mixed $offset
	 *
	 * @return bool
	 */
	public function offsetExists( $offset ) {
		$this->maybe_fire_array_access_deprecation_notice( $offset );

		return isset( $this->$offset );
	}

	public function offsetGet( $offset ) {
		$this->maybe_fire_array_access_deprecation_notice( $offset );
		if ( ! isset( $this->$offset ) ) {
			$this->$offset = '';
		}

		return $this->$offset;
	}

	public function offsetSet( $offset, $data ) {
		$this->maybe_fire_array_access_deprecation_notice( $offset );
		if ( $offset === null ) {
			$this[] = $data;
		} else {
			$this->$offset = $data;
		}
	}

	public function offsetUnset( $offset ) {
		$this->maybe_fire_array_access_deprecation_notice( $offset );
		unset( $this->$offset );
	}

	public function __isset( $key ) {
		return isset( $this->$key );
	}

	public function __set( $key, $value ) {
		$this->$key = $value;
	}

	public function &__get( $key ) {
		if ( ! isset( $this->$key ) ) {
			$this->$key = '';
		}

		return $this->$key;
	}

	public function __unset( $key ) {
		unset( $this->$key );
	}

	public function is_conditional_logic_supported() {
		return false;
	}

	public function get_value_default_if_empty( $value ) {

		if ( ! GFCommon::is_empty_array( $value ) ) {
			return $value;
		}

		return $this->get_value_default();
	}

	public function get_value_default() {

		if ( is_array( $this->inputs ) ) {
			$value = array();
			foreach ( $this->inputs as $input ) {
				$value[ strval( $input['id'] ) ] = $this->is_form_editor() ? rgar( $input, 'defaultValue' ) : GFCommon::replace_variables_prepopulate( rgar( $input, 'defaultValue' ) );
			}
		} else {
			$value = $this->is_form_editor() ? $this->defaultValue : GFCommon::replace_variables_prepopulate( $this->defaultValue );
		}

		return $value;
	}

	public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) {
		return $value;
	}

	public function get_value_entry_list( $value, $entry, $field_id, $columns, $form ) {
		return esc_html( $value );
	}

	public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) {
		if ( ! is_array( $value ) && $format == 'html' ) {
			$value = nl2br( $value );
		}

		return $value;
	}

	public function is_description_above( $form ) {
		$form_label_placement        = rgar( $form, 'labelPlacement' );
		$field_label_placement       = $this->labelPlacement;
		$form_description_placement  = rgar( $form, 'descriptionPlacement' );
		$field_description_placement = $this->descriptionPlacement;
		if ( empty( $field_description_placement ) ) {
			$field_description_placement = $form_description_placement;
		}
		$is_description_above = $field_description_placement == 'above' && ( $field_label_placement == 'top_label' || $field_label_placement == 'hidden_label' || ( empty( $field_label_placement ) && $form_label_placement == 'top_label' ) );

		return $is_description_above;
	}

	public function get_description( $description, $css_class ) {
		$is_form_editor  = $this->is_form_editor();
		$is_entry_detail = $this->is_entry_detail();
		$is_admin        = $is_form_editor || $is_entry_detail;

		return $is_admin || ! empty( $description ) ? "
" . $description . '
' : '';
	}

	public function get_field_content( $value, $force_frontend_label, $form ) {

		$field_label = $this->get_field_label( $force_frontend_label, $value );

		$validation_message = ( $this->failed_validation && ! empty( $this->validation_message ) ) ? sprintf( "
%s
", $this->validation_message ) : '';

		$is_form_editor  = $this->is_form_editor();
		$is_entry_detail = $this->is_entry_detail();
		$is_admin        = $is_form_editor || $is_entry_detail;

		$required_div = $is_admin || $this->isRequired ? sprintf( "%s", $this->isRequired ? '*' : '' ) : '';

		$admin_buttons = $this->get_admin_buttons();

		$target_input_id = $this->get_first_input_id( $form );

		$for_attribute = empty( $target_input_id ) ? '' : "for='{$target_input_id}'";

		$description = $this->get_description( $this->description, 'gfield_description' );
		if ( $this->is_description_above( $form ) ) {
			$clear         = $is_admin ? "

" : '';
			$field_content = sprintf( "%s%s%s%s{FIELD}%s$clear", $admin_buttons, esc_html( $field_label ), $required_div, $description, $validation_message );
		} else {
			$field_content = sprintf( "%s%s%s{FIELD}%s%s", $admin_buttons, esc_html( $field_label ), $required_div, $description, $validation_message );
		}

		return $field_content;
	}

	public function get_first_input_id( $form ) {
		$form_id = $form['id'];

		$is_entry_detail = $this->is_entry_detail();
		$is_form_editor  = $this->is_form_editor();
		$field_id        = $is_entry_detail || $is_form_editor || $form_id == 0 ? 'input_' : "input_{$form_id}_";

		if ( is_array( $this->inputs ) ) {
			foreach ( $this->inputs as $input ) {
				if ( ! isset( $input['isHidden'] ) || ! $input['isHidden'] ) {
					$field_id .= str_replace( '.', '_', $input['id'] );
					break;
				}
			}
		} else {
			$field_id .= $this->id;
		}

		return $field_id;
	}

	public function get_field_label( $force_frontend_label, $value ) {
		$field_label = $force_frontend_label ? $this->label : GFCommon::get_label( $this );
		if ( ( $this->inputType == 'singleproduct' || $this->inputType == 'calculation' ) && ! rgempty( $this->id . '.1', $value ) ) {
			$field_label = rgar( $value, $this->id . '.1' );
		}

		return $field_label;
	}

	public function get_admin_buttons() {
		$duplicate_disabled   = array(
			'captcha',
			'post_title',
			'post_content',
			'post_excerpt',
			'total',
			'shipping',
			'creditcard'
		);
		$duplicate_field_link = ! in_array( $this->type, $duplicate_disabled ) ? "id}' title='" . esc_attr__( 'click to duplicate this field', 'gravityforms' ) . "' href='#' onclick='StartDuplicateField(this); return false;'>" : '';
		$duplicate_field_link = apply_filters( 'gform_duplicate_field_link', $duplicate_field_link );

		$delete_field_link = "id}' title='" . esc_attr__( 'click to delete this field', 'gravityforms' ) . "' href='#' onclick='StartDeleteField(this); return false;'>";
		$delete_field_link = apply_filters( 'gform_delete_field_link', $delete_field_link );
		$field_type_title  = esc_html( GFCommon::get_field_type_title( $this->type ) );

		$is_form_editor  = $this->is_form_editor();
		$is_entry_detail = $this->is_entry_detail();
		$is_admin        = $is_form_editor || $is_entry_detail;

		$admin_buttons = $is_admin ? "

{$field_type_title} : " . esc_html__( 'Field ID', 'gravityforms' ) . " {$this->id}
" . $delete_field_link . $duplicate_field_link . "
" : '';

		return $admin_buttons;
	}

	public function get_field_input( $form, $value = '', $entry = null ) {
		return '';
	}

	public function validate( $value, $form ) {
		//
	}

	public function get_entry_inputs() {
		return $this->inputs;
	}

	public function get_input_value_submission( $standard_name, $custom_name = '', $field_values = array(), $get_from_post_global_var = true ) {

		$form_id = $this->formId;
		if ( ! empty( $_POST[ 'is_submit_' . $form_id ] ) && $get_from_post_global_var ) {
			$value = rgpost( $standard_name );
			$value = GFFormsModel::maybe_trim_input( $value, $form_id, $this );

			return $value;
		} elseif ( $this->allowsPrepopulate ) {
			return GFFormsModel::get_parameter_value( $custom_name, $field_values, $this );
		}

	}

	/**
	 * Used to determine the required validation result.
	 *
	 * @param int $form_id
	 *
	 * @return bool
	 */
	public function is_value_submission_empty( $form_id ) {

		$copy_values_option_activated = $this->enableCopyValuesOption && rgpost( 'input_' . $this->id . '_copy_values_activated' );

		if ( is_array( $this->inputs ) ) {
			foreach ( $this->inputs as $input ) {

				if ( $copy_values_option_activated ) {
					$input_id          = $input['id'];
					$input_name        = 'input_' . str_replace( '.', '_', $input_id );
					$source_field_id   = $this->copyValuesOptionField;
					$source_input_name = str_replace( 'input_' . $this->id, 'input_' . $source_field_id, $input_name );
					$value             = rgpost( $source_input_name );
				} else {
					$value = rgpost( 'input_' . str_replace( '.', '_', $input['id'] ) );
				}

				if ( is_array( $value ) && ! empty( $value ) ) {
					return false;
				}

				if ( ! is_array( $value ) && strlen( trim( $value ) ) > 0 ) {
					return false;
				}
			}

			return true;
		} else {
			if ( $copy_values_option_activated ) {
				$value = rgpost( 'input_' . $this->copyValuesOptionField );
			} else {
				$value = rgpost( 'input_' . $this->id );
			}

			if ( is_array( $value ) ) {
				//empty if any of the inputs are empty (for inputs with the same name)
				foreach ( $value as $input ) {
					if ( strlen( trim( $input ) ) <= 0 ) {
						return true;
					}
				}

				return false;
			} elseif ( $this->enablePrice ) {
				list( $label, $price ) = explode( '|', $value );
				$is_empty = ( strlen( trim( $price ) ) <= 0 );

				return $is_empty;
			} else {
				$is_empty = ( strlen( trim( $value ) ) <= 0 ) || ( $this->type == 'post_category' && $value < 0 );

				return $is_empty;
			}
		}
	}

	public function get_value_submission( $field_values, $get_from_post_global_var = true ) {

		$inputs = $this->get_entry_inputs();

		if ( is_array( $inputs ) ) {
			$value = array();
			foreach ( $inputs as $input ) {
				$value[ strval( $input['id'] ) ] = $this->get_input_value_submission( 'input_' . str_replace( '.', '_', strval( $input['id'] ) ), RGForms::get( 'name', $input ), $field_values, $get_from_post_global_var );;
			}
		} else {
			$value = $this->get_input_value_submission( 'input_' . $this->id, $this->inputName, $field_values, $get_from_post_global_var );
		}

		return $value;
	}

	public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lead ) {

		// only sanitize non-array based values
		if ( ! is_array( $value ) ) {

			$value = $this->sanitize_entry_value( $value, $form['id'] );

		}

		return $value;
	}

	public function has_calculation() {

		$type = $this->get_input_type();

		if ( $type == 'number' ) {
			return $this->enableCalculation && $this->calculationFormula;
		}

		return $type == 'calculation';
	}

	public function get_conditional_logic_event( $event ) {
		if ( empty( $this->conditionalLogicFields ) || $this->is_entry_detail() || $this->is_form_editor() ) {
			return '';
		}

		switch ( $event ) {
			case 'keyup' :
				return "onchange='gf_apply_rules(" . $this->formId . ',' . GFCommon::json_encode( $this->conditionalLogicFields ) . ");' onkeyup='clearTimeout(__gf_timeout_handle); __gf_timeout_handle = setTimeout(\"gf_apply_rules(" . $this->formId . ',' . GFCommon::json_encode( $this->conditionalLogicFields ) . ")\", 300);'";
				break;

			case 'click' :
				return "onclick='gf_apply_rules(" . $this->formId . ',' . GFCommon::json_encode( $this->conditionalLogicFields ) . ");'";
				break;

			case 'change' :
				return "onchange='gf_apply_rules(" . $this->formId . ',' . GFCommon::json_encode( $this->conditionalLogicFields ) . ");'";
				break;
		}
	}

	public function register_form_init_scripts( $form ) {
		GFFormDisplay::add_init_script( $form['id'], $this->type . '_' . $this->id, GFFormDisplay::ON_PAGE_RENDER, $this->get_form_inline_script_on_page_render( $form ) );
	}

	public function get_form_inline_script_on_page_render( $form ) {
		return '';
	}

	public function get_field_placeholder_attribute() {

		$placeholder_value = GFCommon::replace_variables_prepopulate( $this->placeholder );

		return ! empty( $placeholder_value ) ? sprintf( "placeholder='%s'", esc_attr( $placeholder_value ) ) : '';
	}

	public function get_input_placeholder_attribute( $input ) {

		$placeholder_value = GFCommon::get_input_placeholder_value( $input );

		return ! empty( $placeholder_value ) ? sprintf( "placeholder='%s'", esc_attr( $placeholder_value ) ) : '';
	}

	public function get_input_placeholder_value( $input ) {

		$placeholder = rgar( $input, 'placeholder' );

		return empty( $placeholder ) ? '' : GFCommon::replace_variables_prepopulate( $placeholder );
	}

	public function add_button( $field_groups ) {

		// Check a button for the type hasn't already been added
		foreach ( $field_groups as $group ) {
			foreach ( $group['fields'] as $button ) {
				if ( isset( $button['data-type'] ) && $button['data-type'] == $this->type ) {
					return $field_groups;
				}
			}
		}

		$new_button = $this->get_form_editor_button();
		if ( ! empty( $new_button ) ) {
			foreach ( $field_groups as &$group ) {
				if ( $group['name'] == $new_button['group'] ) {
					$group['fields'][] = array(
						'class'     => 'button',
						'value'     => $new_button['text'],
						'data-type' => $this->type,
						'onclick'   => "StartAddField('{$this->type}');",
					);
					break;
				}
			}
		}

		return $field_groups;
	}

	/**
	 * Returns the button for the form editor. The array contains two elements:
	 * 'group' => 'standard_fields' // or  'advanced_fields', 'post_fields', 'pricing_fields'
	 * 'text'  => 'Button text'
	 *
	 * Built-in fields don't need to implement this because the buttons are added in sequence in GFFormDetail
	 *
	 * @return array
	 */
	public function get_form_editor_button() {
		return array(
			'group' => 'standard_fields',
			'text'  => $this->get_form_editor_field_title()
		);
	}

	public function get_form_editor_field_title() {
		return $this->type;
	}

	public function get_form_editor_field_settings() {
		return array();
	}

	public function get_form_editor_inline_script_on_page_render() {
		return '';
	}

	public function get_tabindex() {
		return GFCommon::$tab_index > 0 ? "tabindex='" . GFCommon::$tab_index ++ . "'" : '';
	}

	public function is_form_editor() {
		return GFCommon::is_form_editor();
	}

	public function is_entry_detail() {
		return isset( $this->_is_entry_detail ) ? (bool) $this->_is_entry_detail : GFCommon::is_entry_detail();
	}

	public function is_entry_detail_edit() {
		return GFCommon::is_entry_detail_edit();
	}

	public function strip_script_tag( $string ) {
		$allowable_tags = '<acronym><address><area><area /><base><base /><bdo><big>

<button>
<col><col /><colgroup><command><command />
<dfn>

<DOCTYPE>
<fieldset><form>

<input><input /><legend>
<link><map><meta><meta />
<optgroup><option>
<param><param />
<q><samp><select>


text:
class NonBlank:

    def __set__(self, instance, value):
        if not isinstance(value, str):
            raise TypeError("%r must be of type 'str'" % self.storage_name)
        elif len(value) == 0:
            raise ValueError("%r must not be empty" % self.storage_name)
        instance.__dict__[self.storage_name] = value

def named_fields(cls):
    for name, attr in cls.__dict__.items():
        if isinstance(attr, NonBlank):
            attr.storage_name = name
    return cls


text:
require 'spec_helper'

describe ProjectList do
  let(:filter_form) {
    double(:filter_form,
      page: 123,
      status: 'the-status',
      program: program,
      sort_column: "deployment_code",
      sort_direction: "desc"
    )
  }
  let(:list) { ProjectList.new(filter_form) }
  let(:program) { double(:program, id: 44, projects: projects) }
  let(:projects) { double(:projects, includes: projects_with_country) }
  let(:projects_with_country) { double(:projects_with_country) }

  let(:by_status_query) { double(:by_status_query) }
  let(:ordered_query) { double(:ordered_query) }
  let(:paginated_query) { double(:paginated_query) }

  before do
    allow(ByStatusQuery).to receive(:new).with('the-status') { by_status_query }
    allow(OrderedQuery).to receive(:new).with('deployment_code desc') { ordered_query }
    allow(PaginatedQuery).to receive(:new).with(123) { paginated_query }
  end

  it 'is a filterable list' do
    expect(list).to be_a FilterableList
  end

  it 'configures the source' do
    expect(list.source).to eq projects_with_country
  end

  it 'includes the country' do
    list.source

    expect(projects).to have_received(:includes).with(:country)
  end

  it 'configures the presenter' do
    expect(list.presenter).to eq ProjectPresenter
  end

  it 'configures the filters' do
    expect(list.filters.length).to eq 3
    expect(list.filters).to include by_status_query
    expect(list.filters).to include ordered_query
    expect(list.filters).to include paginated_query
  end
end


text:
package com.siyeh.ig.migration;

import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;

public class WhileCanBeForeachInspectionTest extends LightInspectionTestCase {

  public void testWhileCanBeForeach() {
    doTest();
  }

  @Nullable
  @Override
  protected InspectionProfileEntry getInspection() {
    return new WhileCanBeForeachInspection();
  }
}


text:
/**
 * Apply `output` transform per record, then run the serializer.
 * This mutates `context.response`.
 *
 * @return {Promise}
 */
export default function (context) {
  const { serializer, transforms } = this
  const { request, response } = context
  const { type } = request
  const transform = transforms[type]
  const { records, include } = response

  // Delete temporary keys.
  delete response.records
  delete response.include

  // Run transforms on primary type.
  return (records ? Promise.all(records.map(record =>
    Promise.resolve(transform && transform.output ?
      transform.output(context, record) : record)))

  .then(updatedRecords => {
    for (let i = 0; i < updatedRecords.length; i++)
      records[i] = updatedRecords[i]

    if (!include) return null

    // The order of the keys and their corresponding indices matter. Since it
    // is an associative array, we are not guaranteed any particular order,
    // but the order that we get matters.
    const includeTypes = Object.keys(include)

    // Run output transforms per include type.
    return Promise.all(includeTypes.map(includeType =>
      Promise.all(include[includeType].map(record => Promise.resolve(
        transforms[includeType] && transforms[includeType].output ?
          transforms[includeType].output(context, record) : record)))))

    .then(types => types.reduce((include, records, index) => {
      include[includeTypes[index]] = records
      return include
    }, {}))
  }) : Promise.resolve())

  .then(include => {
    const args = [ context ]

    if (records) args.push(records)
    if (include) args.push(include)

    context = serializer.showResponse(...args)

    return context
  })
}


text:
/*******************************************************************************
* Name: QuizziPedia::Back-End::App::Controllers::LangController
* Description: classe controller che gestisce gli errori Back-End dell'applicazione.
* Creation data: 09-05-2016
* Author: Matteo Granzotto
********************************************************************************
* Updates history
* -------------------------------------------------------------------------------
* Update data: 13-06-2016;
* Description: Corretto vari bugs;
* Author: Matteo Granzotto.
*-------------------------------------------------------------------------------
* ID: ErrorsHandler_20160503
* Update data: 09-05-2016
* Description: Creata classe.
* Autore: Matteo Granzotto
*-------------------------------------------------------------------------------
* ID: ErrorsHandler_20160503
* Update data: 10-05-2016
* Description: Creati metodi: getVarlist(), getLang(), getSlang().
* Autore: Matteo Granzotto
*-------------------------------------------------------------------------------
*******************************************************************************/
var LangModel = require("../Model/LangModel.js");

exports.getVarlist=function(req,res,next){
  LangModel.getVarlist(req.params.lang,function(err,result){
    if(err || result.length==0)
      return res.status(500).json({code: 1601, title: "getVarlistErrror", message: "error"});
    return res.send(result);
  })
}

exports.getLang=function(req,res,next){
  LangModel.getLang(function(err,result){
    if(err)
      return res.status(500).json({code: 1601, title: "getLangErrror", message: "error"});
    return res.send(result);
  })
}

exports.getSlang=function(req,res,next){ {
  LangModel.getSlang(req.params.language,function(err,result){
    if(err)
      return res.status(500).json({code: 1601, title: "getSlangErrror", message: "error"});
    return res.send(result);
  })
}}


text:
using System;
using System.Collections.ObjectModel;
using System.Reflection;
#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
#endif

namespace System.Linq.Expressions {

	public sealed class ElementInit {

		MethodInfo add_method;
		ReadOnlyCollection<Expression> arguments;

		public MethodInfo AddMethod {
			get { return add_method; }
		}

		public ReadOnlyCollection<Expression> Arguments {
			get { return arguments; }
		}

		internal ElementInit (MethodInfo add_method, ReadOnlyCollection<Expression> arguments)
		{
			this.add_method = add_method;
			this.arguments = arguments;
		}

		public override string ToString ()
		{
			return ExpressionPrinter.ToString (this);
		}

#if !FULL_AOT_RUNTIME
		void EmitPopIfNeeded (EmitContext ec)
		{
			if (add_method.ReturnType == typeof (void))
				return;

			ec.ig.Emit (OpCodes.Pop);
		}

		internal void Emit (EmitContext ec, LocalBuilder local)
		{
			ec.EmitCall (local, arguments, add_method);
			EmitPopIfNeeded (ec);
		}
#endif
	}
}


text:
//Write a program that enters from the console a positive integer n and prints all the numbers from 1 to n, on a single line, separated by a space.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace numbersToN
{
    class printLoopedNumbers
    {
        static void Main(string[] args)
        {
            long x = long.MaxValue;
            for (long i = 1; i <= x; i++)
            {
                Console.Write(i + " ");
            }
        }
    }
}