text:
package org.gradle.tooling.model.internal;

import org.gradle.tooling.UnknownModelException;
import org.gradle.tooling.UnsupportedVersionException;
import org.gradle.tooling.exceptions.UnsupportedOperationConfigurationException;
import org.gradle.tooling.internal.consumer.Distribution;
import org.gradle.tooling.internal.consumer.versioning.ModelMapping;
import org.gradle.tooling.internal.protocol.InternalUnsupportedModelException;
import org.gradle.tooling.model.UnsupportedMethodException;

public class Exceptions {

    public final static String INCOMPATIBLE_VERSION_HINT =
            "Most likely the model of that type is not supported in the target Gradle version."
                    + "\nTo resolve the problem you can change/upgrade the Gradle version the tooling api connects to.";

    public static UnsupportedMethodException unsupportedMethod(String method) {
        return new UnsupportedMethodException(formatUnsupportedModelMethod(method));
    }

    private static String formatUnsupportedModelMethod(String method) {
        return String.format("Unsupported method: %s."
                + "\nThe version of Gradle you connect to does not support that method."
                + "\nTo resolve the problem you can change/upgrade the target version of Gradle you connect to."
                + "\nAlternatively, you can ignore this exception and read other information from the model."
                , method);
    }

    public static UnsupportedOperationConfigurationException unsupportedOperationConfiguration(String operation, String targetVersion, String versionAdded) {
        return new UnsupportedOperationConfigurationException(String.format("The version of Gradle you are using (%s) does not support the %s configuration option. Support for this is available in Gradle %s and all later versions.",
                targetVersion, operation, versionAdded));
    }

    public static UnknownModelException unsupportedModel(Class<?> modelType, String targetVersion) {
        ModelMapping modelMapping = new ModelMapping();
        String versionAdded = modelMapping.getVersionAdded(modelType);
        if (versionAdded != null) {
            return new UnknownModelException(String.format("The version of Gradle you are using (%s) does not support building a model of type '%s'. Support for building '%s' models was added in Gradle %s and is available in all later versions.",
                    targetVersion, modelType.getSimpleName(), modelType.getSimpleName(), versionAdded));
        } else {
            return new UnknownModelException(String.format("The version of Gradle you are using (%s) does not support building a model of type '%s'. Support for building custom tooling models was added in Gradle 1.6 and is available in all later versions.",
                    targetVersion, modelType.getSimpleName()));
        }
    }

    public static UnknownModelException unknownModel(Class<?> type, InternalUnsupportedModelException failure) {
        return new UnknownModelException(String.format("No model of type '%s' is available in this build.", type.getSimpleName()), failure.getCause());
    }

    public static UnsupportedVersionException unsupportedFeature(String feature, Distribution distro, String versionAdded) {
        return new UnsupportedVersionException(String.format("The version of Gradle you are using (%s) does not support the %s. Support for this is available in Gradle %s and all later versions.",
                distro.getDisplayName(), feature, versionAdded));
    }

    public static UnsupportedVersionException unsupportedFeature(String feature, String targetVersion, String versionAdded) {
        return new UnsupportedVersionException(String.format("The version of Gradle you are using (%s) does not support the %s. Support for this is available in Gradle %s and all later versions.",
                targetVersion, feature, versionAdded));
    }
}


text:
# Working with Services in the Browser

## Supported Services

By default, the SDK ships with support for 5 AWS services. Each service object
in the SDK currently provides low-level access to every API call in the
respective AWS service. The full list of methods and their parameters are
documented in the complete API reference documentation (linked from each
service name in the list below).

The 5 services that come with the default hosted package of the SDK are:

* [AWS.DynamoDB](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!AWS/DynamoDB.html)
* [AWS.S3](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!AWS/S3.html)
* [AWS.SNS](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!AWS/SNS.html)
* [AWS.SQS](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!AWS/SQS.html)
* [AWS.STS](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!AWS/STS.html)

It is possible to use the SDK with other services if [CORS](http://www.w3.org/TR/cors/)
security checking is disabled in your environment. In this case, you can build
your own custom version of the SDK. See the {file:browser-building.md Building the SDK}
section of the guide for more information on how to create a custom build of
the SDK.

## Constructing a Service

Each service can be constructed with runtime configuration data that is
specific to that service object. The service-specific configuration data
will be merged on top of global configuration, so there is no need to
re-specify any global settings. For example, an DynamoDB object can be created
for a specific region:

```javascript
var dynamodb = new AWS.DynamoDB({region: 'us-west-2'});
```

This object will continue to use the globally provided credentials.

## Passing Parameters to a Service Operation

When calling a method to a service, you should pass parameters in as
option values, similar to the way configuration is passed.
For example, to read an object for a given bucket and key in S3, you
can pass the following parameters to the `getObject` method:

```javascript
s3.getObject({Bucket: 'bucketName', Key: 'keyName'});
```

Note that the full parameter documentation for each method is found
in each service page in the complete API reference documentation.

## Bound Parameters

Parameters can be automatically passed to service operations by binding them
directly when constructing the service object. To do this, pass the `params`
parameter to your constructed service with the map of default parameter
values like so:

```javascript
var s3bucket = new AWS.S3({ params: {Bucket: 'myBucket'} });
```

The `s3bucket` object will now represent an S3 service object bound to a bucket
named 'myBucket'. Any operation that takes the `Bucket` parameter will now
have it auto-filled with this value. This value can be overridden by passing
a new value in the service operation. Additionally, operations that do not
require a `Bucket` parameter will automatically ignore this bound parameter,
so the `s3bucket` object can still be used to call `listBuckets`, for instance.

redpajama_set_name: RedPajamaGithub


text:
package org.zstack.ldap;

import org.zstack.header.identity.AccountInventory;
import org.zstack.header.identity.AccountType;
import org.zstack.header.identity.SessionInventory;
import org.zstack.header.message.APIReply;
import org.zstack.header.rest.RestResponse;

import java.sql.Timestamp;

@RestResponse(fieldsTo = {"all"})
public class APILogInByLdapReply extends APIReply {
    private SessionInventory inventory;
    private AccountInventory accountInventory;

    public SessionInventory getInventory() {
        return inventory;
    }

    public void setInventory(SessionInventory inventory) {
        this.inventory = inventory;
    }

    public AccountInventory getAccountInventory() {
        return accountInventory;
    }

    public void setAccountInventory(AccountInventory accountInventory) {
        this.accountInventory = accountInventory;
    }

    public static APILogInByLdapReply __example__() {
        APILogInByLdapReply reply = new APILogInByLdapReply();
        SessionInventory inventory = new SessionInventory();
        inventory.setUuid(uuid());
        inventory.setAccountUuid(uuid());
        inventory.setExpiredDate(new Timestamp(System.currentTimeMillis()));

        AccountInventory accountInventory = new AccountInventory();
        accountInventory.setName("test");
        accountInventory.setUuid(uuid());
        accountInventory.setType(AccountType.Normal.toString());

        reply.setAccountInventory(accountInventory);
        reply.setInventory(inventory);
        return reply;
    }

}


text:
require File.expand_path('../support/helpers', __FILE__)

describe 'hadoop::hadoop_hdfs_namenode' do

  include Helpers::Hadoop

  it 'ensures HDFS name dirs exist' do
    node['hadoop']['hdfs_site']['dfs.namenode.name.dir'].split(',').each do |dir|
      directory(dir.gsub('file://', ''))
      .must_exist
      .with(:owner, 'hdfs')
      .and(:group, 'hdfs')
      .and(:mode, '0700')
    end
  end

end


text:
package com.android.foodbook.services;

import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;

import java.util.TimerTask;

/**
 * Created by libin on 12/26/13.
 */
public class TimeOutService extends Service
{
    private Handler mHandler = null;

    @Override
    public void onCreate()
    {
        super.onCreate();
    }

    @Override
    public int onStartCommand(Intent intent, int flag, int startId)
    {
        mHandler = new Handler();
        mHandler.postDelayed(runnable,300000);
        return START_STICKY;
    }

    @Override
    public void onDestroy()
    {
        if(mHandler != null)
        {
            mHandler.removeCallbacks(runnable);
            mHandler = null;
        }
    }

    private Runnable runnable = new Runnable()
    {
        @Override
        public void run()
        {
            sendNotification();
            stopSelf();
        }
    };

    private class TimerTaskExt extends TimerTask
    {
        @Override
        public void run()
        {
            sendNotification();
            stopSelf();
        }
    }

    private void sendNotification()
    {
        NotificationCompat.Builder mBuilder =
                new NotificationCompat.Builder(this)
                        .setSmallIcon(android.R.drawable.ic_notification_clear_all)
                        .setContentTitle("FoodMark Notification")
                        .setContentText("Application session timed out!");

        NotificationManager mNotificationManager =
                (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        // mId allows you to update the notification later on.
        mNotificationManager.notify(1000, mBuilder.build());
    }

    @Override
    public IBinder onBind(Intent intent)
    {
        return null;
    }

}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _header = require('./components/header');

var _header2 = _interopRequireDefault(_header);

var _menu = require('./components/menu');

var _menu2 = _interopRequireDefault(_menu);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Spotippos = function (_Component) {
    _inherits(Spotippos, _Component);

    function Spotippos(props) {
        _classCallCheck(this, Spotippos);

        return _possibleConstructorReturn(this, (Spotippos.__proto__ || Object.getPrototypeOf(Spotippos)).call(this, props));
    }

    _createClass(Spotippos, [{
        key: 'render',
        value: function render() {
            var children = this.props.children;

            return _react2.default.createElement(
                'div',
                { className: 'full-height' },
                _react2.default.createElement(_header2.default, null),
                _react2.default.createElement(_menu2.default, null),
                _react2.default.createElement(
                    'div',
                    { className: 'page' },
                    children
                )
            );
        }
    }]);

    return Spotippos;
}(_react.Component);

Spotippos.propTypes = {
    children: _react.PropTypes.object.isRequired
};

exports.default = Spotippos;


text:
/**
 * App entry point
 */

// Polyfill
import 'babel-polyfill';

// Libraries
import React from 'react';
import ReactDOM from 'react-dom';
import { match, Router, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import { trigger } from 'redial';

// Routes
import Routes from './common/components/Routes';
import { configureStore } from './common/store';
import createSaga from './common/createSaga';

// Base styling
import './common/base.css';
if (process.env.BROWSER) {
  require("loaders.css/loaders.min.css")
}

// ID of the DOM element to mount app on
const DOM_APP_EL_ID = 'app';

const initialState = window.INITIAL_STATE || {};
if (window.SERVER_MESSAGES && window.SERVER_MESSAGES.length > 0) {
  window.SERVER_MESSAGES.forEach((message) => {
    alert(message);
  })
}

const { pathname, search, hash } = window.location;
const location = `${pathname}${search}${hash}`;

const store = configureStore(initialState);
store.runSaga(createSaga(store.getState))
const { dispatch } = store;

// Pull child routes using match. Adjust Router for vanilla webpack HMR,
// in development using a new key every time there is an edit.
match({ routes: Routes, location: location }, () => {
  // Render app with Redux and router context to container element.
  // We need to have a random in development because of `match`'s dependency on
  // `routes.` Normally, we would want just one file from which we require `routes` from.
  ReactDOM.render(
    <Provider store={store}>
        <Router routes={Routes} history={browserHistory} key={Math.random()}/>
    </Provider>,
    document.getElementById(DOM_APP_EL_ID)
  );

});

browserHistory.listen(location => {
  // Match routes based on location object:
  match({ routes: Routes, location: location }, (error, redirectLocation, renderProps) => {
    // Get array of route handler components:
    const { components } = renderProps;

    // Define locals to be provided to all lifecycle hooks:
    const locals = {
        path: renderProps.location.pathname,
        query: renderProps.location.query,
        params: renderProps.params,

        // Allow lifecycle hooks to dispatch Redux actions:
        dispatch,
      };

    // Don't fetch data for initial route, server has already done the work:
    if (window.INITIAL_STATE) {
      // Delete initial data so that subsequent data fetches can occur:
      delete window.INITIAL_STATE;
    } else {
      // Fetch mandatory data dependencies for 2nd route change onwards:
      trigger('fetch', components, locals);
    }

    // Fetch deferred, client-only data dependencies:
    trigger('defer', components, locals);

    trigger('done', components, locals);
  });
});


text:
//  Copyright 2004 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry.contrib.table.model.ognl;

import org.apache.tapestry.contrib.table.model.ITableColumn;
import org.apache.tapestry.contrib.table.model.simple.SimpleTableColumnModel;

/**
 * @author mindbridge
 *
 */
public class ExpressionTableColumnModel extends SimpleTableColumnModel
{
    /**
     * Constructs a table column model containting OGNL expression columns.

     * The data for the columns is provided in the form of a string array,
     * where the info of each column is stored in two consecutive fields in
     * the array, hence its size must be even. The expected info is the following:
     *

     *
 Column Name
     *
 OGNL expression
     *

     * @param arrColumnInfo The information to construct the columns from
     * @param bSorted Whether all columns are sorted or not
     */
    public ExpressionTableColumnModel(String[] arrColumnInfo, boolean bSorted)
    {
        this(convertToDetailedArray(arrColumnInfo, bSorted));
    }

    /**
     * Constructs a table column model containting OGNL expression columns.

     * The data for the columns is provided in the form of a string array,
     * where the info of each column is stored in four consecutive fields in
     * the array, hence its size must be divisible by 4.

     * The expected info is the following:
     *

     *
 Column Name
     *
 Display Name
     *
 OGNL expression
     *
 Sorting of the column. This is either a Boolean,
     *        or a String representation of a boolean.
     *

     * @param arrColumnInfo
     */
    public ExpressionTableColumnModel(Object[] arrColumnInfo)
    {
        super(convertToColumns(arrColumnInfo));
    }

    /**
     * Method convertToDetailedArray.
     * @param arrColumnInfo
     * @param bSorted
     * @return Object[]
     */
    protected static Object[] convertToDetailedArray(String[] arrColumnInfo, boolean bSorted)
    {
        int nColumns = arrColumnInfo.length / 2;
        int nSize = nColumns * 4;
        Object[] arrDetailedInfo = new Object[nSize];

        for (int i = 0; i < nColumns; i++)
        {
            int nInputBaseIndex = 2 * i;
            String strColumnName = arrColumnInfo[nInputBaseIndex];
            String strExpression = arrColumnInfo[nInputBaseIndex + 1];

            int nOutputBaseIndex = 4 * i;
            arrDetailedInfo[nOutputBaseIndex] = strColumnName;
            arrDetailedInfo[nOutputBaseIndex + 1] = strColumnName;
            arrDetailedInfo[nOutputBaseIndex + 2] = strExpression;
            arrDetailedInfo[nOutputBaseIndex + 3] = bSorted ? Boolean.TRUE : Boolean.FALSE;
        }

        return arrDetailedInfo;
    }

    /**
     * Method convertToColumns.
     * @param arrDetailedInfo
     * @return ITableColumn[]
     */
    protected static ITableColumn[] convertToColumns(Object[] arrDetailedInfo)
    {
        int nColumns = arrDetailedInfo.length / 4;
        ITableColumn[] arrColumns = new ITableColumn[nColumns];

        for (int i = 0; i < nColumns; i++)
        {
            Object objTempValue;
            int nBaseIndex = 4 * i;

            String strColumnName = "";
            objTempValue = arrDetailedInfo[nBaseIndex];
            if (objTempValue != null)
                strColumnName = objTempValue.toString();

            String strDisplayName = "";
            objTempValue = arrDetailedInfo[nBaseIndex + 1];
            if (objTempValue != null)
                strDisplayName = objTempValue.toString();

            String strExpression = "";
            objTempValue = arrDetailedInfo[nBaseIndex + 2];
            if (objTempValue != null)
                strExpression = objTempValue.toString();

            boolean bSorted = false;
            objTempValue = arrDetailedInfo[nBaseIndex + 3];
            if (objTempValue != null)
            {
                if (objTempValue instanceof Boolean)
                    bSorted = ((Boolean) objTempValue).booleanValue();
                else
                    bSorted = Boolean.getBoolean(objTempValue.toString());
            }

            arrColumns[i] =
                new ExpressionTableColumn(strColumnName, strDisplayName, strExpression, bSorted);
        }

        return arrColumns;
    }
}


text:
#define GLM_FORCE_RADIANS
#define _USE_MATH_DEFINES
#define GLM_SWIZZLE

#define CLIENT

#include <GL/glew.h>
#include <GLFW/glfw3.h>

#include "gamewindow.h"

#include <iostream>
#include <sstream>
#include <string>
#include <chrono>

#include <boost/exception/diagnostic_information.hpp>
#include "boost_log.hpp"

#ifdef _MSC_VER
#ifndef _DEBUG
#    pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
#endif

int main(int argc, char** argv)
{
    boost::log::add_console_log(
            std::cout,
            boost::log::keywords::format = (
                boost::log::expressions::stream
                    << boost::log::expressions::format_date_time< boost::posix_time::ptime >("TimeStamp", "%H:%M:%S.%f")
                    << " "
                    << boost::log::trivial::severity
                    << " "
                    << boost::log::expressions::message
            )
    );

    boost::log::add_file_log
    (
        boost::log::keywords::file_name = "jarg_%5N.log",
        boost::log::keywords::rotation_size = 10 * 1024 * 1024,
        boost::log::keywords::time_based_rotation = boost::log::sinks::file::rotation_at_time_point(0, 0, 0),
        boost::log::keywords::format = (
            boost::log::expressions::stream
                << boost::log::expressions::format_date_time< boost::posix_time::ptime >("TimeStamp", "%H:%M:%S.%f")
                << " "
                << boost::log::trivial::severity
                << " "
                << boost::log::expressions::message
        )
    );

    boost::log::core::get()->set_filter
    (
        boost::log::trivial::severity >= boost::log::trivial::info
    );
    if(argc >= 2)
        for(int i = 1; i < argc; i++)
        {
            if(strcmp(argv[i], ("-nosound")) == 0)
                Prefecences::Instance()->no_sound = true;

            if(strcmp(argv[i], ("-t")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::trace
                );
            if(strcmp(argv[i], ("-d")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::debug
                );
            if(strcmp(argv[i], ("-i")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::info
                );
            if(strcmp(argv[i], ("-w")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::warning
                );
            if(strcmp(argv[i], ("-e")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::error
                );
            if(strcmp(argv[i], ("-f")) == 0)
                boost::log::core::get()->set_filter
                (
                    boost::log::trivial::severity >= boost::log::trivial::fatal
                );
			if (strstr(argv[i], ("-p")) != 0)
			{
				sscanf(argv[i]+2, "%d", &Prefecences::Instance()->server_port);
			}

			if (strstr(argv[i], ("-a")) != 0)
			{
				Prefecences::Instance()->server_adress = "255.255.255.255";
				sscanf(argv[i]+2, "%s", Prefecences::Instance()->server_adress.c_str());
			}
        }

    boost::log::add_common_attributes();
    //std::shared_ptr< Hive > hive( new Hive() );
    //std::shared_ptr<MyConnection> mc( new MyConnection(hive));

    try {
        GameWindow gw;
        gw.Mainloop();
    }
    catch (boost::exception &e)
    {
        LOG(fatal) << boost::diagnostic_information(e);
        throw;
    }
    catch (std::exception &e)
    {
        LOG(fatal) << e.what();
        throw;
    }

    return 0;
}
//------------------------------------------------------------------------------


text:
package org.locationtech.geomesa.convert.jdbc

import com.typesafe.config.ConfigFactory
import org.junit.runner.RunWith
import org.locationtech.geomesa.convert2.SimpleFeatureConverter
import org.locationtech.geomesa.features.ScalaSimpleFeature
import org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes
import org.locationtech.geomesa.utils.io.{PathUtils, WithClose}
import org.locationtech.jts.geom.Point
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

import java.io.ByteArrayInputStream
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.sql.{Connection, DriverManager}

@RunWith(classOf[JUnitRunner])
class JdbcConverterTest extends Specification {

  sequential

  var connection: Connection = _
  lazy val h2Dir = Files.createTempDirectory("geomesa-convert-h2").toFile

  val sft = SimpleFeatureTypes.createType("example", "name:String,dtg:Date,*geom:Point:srid=4326")
  val features = (0 until 10).map { i =>
    ScalaSimpleFeature.create(sft, s"$i", s"name$i", s"2017-02-03T00:0$i:01.000Z", s"POINT(40 6$i)")
  }

  step {
    connection = DriverManager.getConnection(s"jdbc:h2:split:${h2Dir.getAbsolutePath}/test")

    val create = "create table example(id BIGINT NOT NULL PRIMARY KEY, name VARCHAR, dtg TIMESTAMP, lat DOUBLE, lon DOUBLE);"
    val insert = "INSERT INTO example(id, name, dtg, lat, lon) VALUES (?, ?, ?, ?, ?);"

    WithClose(connection.prepareStatement(create))(_.execute)
    WithClose(connection.prepareStatement(insert)) { statement =>
      features.foreach { feature =>
        statement.setObject(1, feature.getID.toInt)
        statement.setObject(2, feature.getAttribute("name"))
        statement.setObject(3, feature.getAttribute("dtg"))
        statement.setObject(4, feature.getAttribute("geom").asInstanceOf[Point].getY)
        statement.setObject(5, feature.getAttribute("geom").asInstanceOf[Point].getX)
        statement.executeUpdate()
      }
    }
  }

  "JdbcConverter" should {

    "process select statements" >> {
      val conf = ConfigFactory.parseString(
        s"""
          | {
          |   type       = "jdbc",
          |   id-field   = "$$1::string",
          |   connection = "jdbc:h2:split:${h2Dir.getAbsolutePath}/test"
          |   fields = [
          |     { name = "name", transform = "$$2" },
          |     { name = "dtg",  transform = "$$3" },
          |     { name = "lat",  transform = "$$4" },
          |     { name = "lon",  transform = "$$5" },
          |     { name = "geom", transform = "point($$lon, $$lat)" }
          |   ]
          | }
        """.stripMargin)

      WithClose(SimpleFeatureConverter(sft, conf)) { converter =>
        converter must not(beNull)

        val sql = new ByteArrayInputStream("select * from example".getBytes(StandardCharsets.UTF_8))
        val res = WithClose(converter.process(sql))(_.toList)
        // note: comparison has to be done backwards,
        // as java.util.Date.equals(java.sql.Timestamp) != java.sql.Timestamp.equals(java.util.Date)
        features mustEqual res
      }
    }
  }

  step {
    connection.close()
    PathUtils.deleteRecursively(h2Dir.toPath)
  }
}


text:
//
// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

/**
* This sample demonstrates how multiple clients can attempt to acquire a lease in order to provide a locking mechanism
* over write operations on a given blob.
*
* To simulate N workers please run multiple instances of this sample. Each instance will :
*
* 1. Try to acquire a lease on a uploaded blob.
*
* 2. If succeed, then renew the lease, print out the current process holds the lease every 40 seconds until the process
* is killed.
*
* 3. If fail, then sleep for 10 seconds and go back to step 1.
*
*/

var fs = require('fs');
if (!fs.existsSync) {
  fs.existsSync = require('path').existsSync;
}

var azure;
if (fs.existsSync('./../../lib/azure.js')) {
  azure = require('./../../lib/azure');
} else {
  azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;

var workerWithLeaseSleepTimeInMs = 40 * 1000;
var workerWithoutLeaseSleepTimeInMs = 10 * 1000;

var container = 'leasesample';
var blob = 'leasesample';
var leaseId;

var blobClient = azure.createBlobService();

function createContainer(callback) {
  // Step 0: Check if the target container exists.
  blobClient.createContainerIfNotExists(container, function () {
    console.log('Created the container ' + container);
    callback();
  });
};

function uploadBlob(callback) {
  // Step 1: Create text blob.
  blobClient.createBlockBlobFromText(container, blob, 'Hello world!', function () {
    console.log('Created the blob ' + blob);
    callback();
  });
};

function getLease(currentLease) {
  if (currentLease == null) {
    // Step 2a: this worker doesn't hold a lease, then try to acquire the lease.
    blobClient.acquireLease(container, blob, function (leaseError, lease) {
      if (lease != null) {
        leaseId = lease.id;

        // Succeed in acquiring a lease.
        console.log('Worker acquired the lease whose ID is ' + leaseId);

        setTimeout(function () {
          getLease(lease);
        }, workerWithLeaseSleepTimeInMs);
      }
      else {
        // Fail in acquiring a lease.
        console.log('Worker failed in acquiring the lease.');

        setTimeout(function () {
          getLease(null);
        }, workerWithoutLeaseSleepTimeInMs);
      }
    });
  }
  else {
    // Step 2b: This worker holds a lease, then renew the lease.

    // Traditionally there is some work this worker must do while it
    // holds the lease on the blob prior to releasing it.
    blobClient.renewLease(container, blob, leaseId, function (leaseError, lease) {
      if (lease) {
        console.log('Worker renewed the lease whose ID is ' + lease.id);
      }
      else {
        console.log('Worker failed in renewing the lease.');
      }

      setTimeout(function () {
        getLease(lease);
      }, workerWithLeaseSleepTimeInMs);
    });
  }
};

var arguments = process.argv;

if (arguments.length > 3) {
  console.log('Incorrect number of arguments');
}
else if (arguments.length == 3) {
  // Adding a third argument on the command line, whatever it is, will delete the container before running the sample.
  blobClient.deleteContainer(container, function () {
    createContainer(function () {
      uploadBlob(function () {
        getLease(null);
      });
    });
  });
}
else {
  createContainer(function () {
    uploadBlob(function () {
      getLease(null);
    });
  });
}


text:
var webpack = require('webpack');
var path = require('path');
var CleanWebpackPlugin = require('clean-webpack-plugin');
let nodeExternals = require('webpack-node-externals');
const TerserPlugin = require('terser-webpack-plugin');
const AssetsPlugin = require('assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
var projectRoot = process.cwd();
let assetsPath = process.cwd() + "/public/build";
var publicPath = "/build/";
let distPath = path.resolve(projectRoot, './dist');

var config = [
	{
		name: "browser",
		mode: "production",
		cache: false,
		context: process.cwd(),
		entry: {
			bundle: [
				path.resolve(projectRoot, './src/client/index.js'),
				require.resolve('./util/polyfills')
			],
		},
		target: 'web',
		output: {
			path: assetsPath,
			publicPath: publicPath,
			filename: 'bundle/[name]-[chunkhash].js',
			chunkFilename: 'bundle/chunk-[name]-[chunkhash].js'
		},
		optimization: {
			splitChunks: {
				cacheGroups: {
					vendor: {
						test: /[\\/]node_modules[\\/](react|react-dom|redux|react-redux|styled-components|react-router|connected-react-router|react-intl|axios|es6-promise|history)[\\/]/,
						name: 'vendor',
						chunks: 'all'
					}
				}
			},
			minimize: true,
			minimizer: [
				new TerserPlugin()
			],
		},
		plugins: [
			new webpack.DefinePlugin({
				'process.env': {
					NODE_ENV: JSON.stringify("production"),
					BROWSER: true
				},
				__CLIENT__: true,
				__SERVER__: false,
				__DEVELOPMENT__: false,
				__DEVTOOLS__: false
			}),
			new CleanWebpackPlugin(['public/build'], {
				root: projectRoot,
				verbose: true,
				//exclude: ['shared.js']
			}),
			new CssMinimizerPlugin(),
			new MiniCssExtractPlugin({
				filename: "main.[contenthash].css"
			}),
			new AssetsPlugin({
				fullPath: true,
				path: path.join(projectRoot, './dist')
			}),
		],
		module: {
			rules: [
				{
					test: /(\.jsx)|(\.js)$/,
					exclude: /node_modules/,
					loader: 'babel-loader',
					include: [
						path.join(projectRoot, "src", "shared"),
						path.join(projectRoot, "src", "client") //important for performance!
					],
					options: {
						cacheDirectory: true,
					},
				},
				{
					test: /\.s[ac]ss$/i,
					include: [
						path.resolve(projectRoot, './src/shared/'),
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/stylesheets/'),
					],
					use: [
						{
							loader: MiniCssExtractPlugin.loader
						},
						'css-loader?url=false',
						"postcss-loader",
						'sass-loader',
					],
				},
				{
					test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
					loader: "url-loader",
					options: {
						limit: 10000,
						mimetype: 'application/font-woff',
						name: 'fonts/[name].[ext]'
					},
					include: [
						path.resolve(projectRoot, './src/shared/fonts/'),
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/fonts/'),
						path.resolve(projectRoot, './node_modules/font-awesome/fonts/'),
					],
				},
				{
					test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
					loader: "file-loader",
					options: {
						name: 'fonts/[name].[ext]'
					},
					include: [
						path.resolve(projectRoot, './src/shared/fonts/'),
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/fonts/'),
						path.resolve(projectRoot, './node_modules/font-awesome/fonts/'),
					],
				},
			]
		},
		resolveLoader: {
			modules: [
				"node_modules"
			],
		},
		resolve: {
			modules: [
				"node_modules"
			],
			unsafeCache: true,
		},
	},
	{
		// The configuration for the server-side rendering
		name: "server-side rendering",
		mode: "production",
		entry: "./src/server/server.prod.js",
		target: "node",
		context: process.cwd(),
		node: {
			__dirname: false,
			__filename: false,
			global: true
		},
		output: {
			path: distPath,
			filename: "server.generated.js",
			publicPath: publicPath,
			libraryTarget: "commonjs2"
		},
		optimization: {
			splitChunks: {
				cacheGroups: {
				  styles: {
					name: 'styles',
					type: 'css/mini-extract',
					chunks: 'all',
					enforce: true,
				  },
				},
			},
			minimizer: [
				new CssMinimizerPlugin(),
				new TerserPlugin()
			],
		},
		plugins: [
			new webpack.DefinePlugin({
				'process.env.NODE_ENV': JSON.stringify("production"),
				'process.env.BROWSER': false,
				__CLIENT__: false,
				__SERVER__: true,
				__DEVELOPMENT__: false,
				__DEVTOOLS__: false
			}),
			new MiniCssExtractPlugin()
		],
		externals: [
			{ "./webpack-assets.json": "./webpack-assets.json" },
			nodeExternals()
		],
		module: {
			rules: [
				{
					test: /\.s[ac]ss$/i,
					include: [
						path.resolve(projectRoot, './src/shared/'),
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/stylesheets/'),
					],
					use: [
						{
							loader: MiniCssExtractPlugin.loader
						},
						'css-loader?url=false',
						'sass-loader',
					],
				},
				{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
					loader: "url-loader" ,
					options: {
						limit: 10000,
						mimetype: 'application/font-woff',
						name: 'fonts/[name].[ext]'
					},
					include: [
						path.resolve(projectRoot, './src/shared/fonts/') ,
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/fonts/') ,
						path.resolve(projectRoot, './node_modules/font-awesome/fonts/') ,
					 ],
				},
				{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
					loader: "file-loader" ,
					options: {
						name: 'fonts/[name].[ext]'
					},
					include: [
						path.resolve(projectRoot, './src/shared/fonts/') ,
						path.resolve(projectRoot, './node_modules/bootstrap-sass/assets/fonts/') ,
						path.resolve(projectRoot, './node_modules/font-awesome/fonts/') ,
					 ],
				},
				{
					test: /(\.jsx)|(\.js)$/,
					exclude: /node_modules/,
					include: [
						path.join(projectRoot, "src") //important for performance!
					],
					use: [
						{
							loader: 'babel-loader',
							options: {
								cacheDirectory: false,
								babelrc: false,
								presets: [
									"@babel/preset-react",
									[
										"@babel/preset-env",
										{
											"targets": {
												"node": "10"
											}
										}
									],
								],
								plugins: [
									"@babel/plugin-syntax-dynamic-import",
									"@babel/plugin-proposal-object-rest-spread",
									"@babel/plugin-proposal-class-properties",
								],
							},
						}
					]
				},
			]
		},
	}
];

module.exports = config;


text:
// Package modulewriter writes modules to a deployment directory
package modulewriter

import (
	"embed"
	"errors"
	"fmt"
	"hpc-toolkit/pkg/config"
	"hpc-toolkit/pkg/deploymentio"
	"hpc-toolkit/pkg/sourcereader"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
)

const (
	hiddenGhpcDirName          = ".ghpc"
	prevDeploymentGroupDirName = "previous_deployment_groups"
	gitignoreTemplate          = "deployment.gitignore.tmpl"
)

// ModuleWriter interface for writing modules to a deployment
type ModuleWriter interface {
	getNumModules() int
	addNumModules(int)
	writeDeploymentGroup(
		depGroup config.DeploymentGroup,
		globalVars map[string]interface{},
		deployDir string,
	) error
	restoreState(deploymentDir string) error
}

var kinds = map[string]ModuleWriter{
	"terraform": new(TFWriter),
	"packer":    new(PackerWriter),
}

//go:embed *.tmpl
var templatesFS embed.FS

func factory(kind string) ModuleWriter {
	writer, exists := kinds[kind]
	if !exists {
		log.Fatalf(
			"modulewriter: Module kind (%s) is not valid. "+
				"kind must be in (terraform, packer).", kind)
	}
	return writer
}

// WriteDeployment writes a deployment directory using modules defined the
// environment blueprint.
func WriteDeployment(blueprint *config.Blueprint, outputDir string, overwriteFlag bool) error {
	deploymentName, err := blueprint.DeploymentName()
	if err != nil {
		return err
	}
	deploymentDir := filepath.Join(outputDir, deploymentName)

	overwrite := isOverwriteAllowed(deploymentDir, blueprint, overwriteFlag)
	if err := prepDepDir(deploymentDir, overwrite); err != nil {
		return err
	}

	if err := copySource(deploymentDir, &blueprint.DeploymentGroups); err != nil {
		return err
	}

	if err := createGroupDirs(deploymentDir, &blueprint.DeploymentGroups); err != nil {
		return err
	}

	for _, grp := range blueprint.DeploymentGroups {

		deploymentName, err := blueprint.DeploymentName()
		if err != nil {
			return err
		}

		deploymentPath := filepath.Join(outputDir, deploymentName)
		writer, ok := kinds[grp.Kind]
		if !ok {
			return fmt.Errorf(
				"Invalid kind in deployment group %s, got '%s'", grp.Name, grp.Kind)
		}

		if err := writer.writeDeploymentGroup(
			grp, blueprint.Vars, deploymentPath,
		); err != nil {
			return fmt.Errorf("error writing deployment group %s: %w", grp.Name, err)
		}
	}

	for _, writer := range kinds {
		if writer.getNumModules() > 0 {
			if err := writer.restoreState(deploymentDir); err != nil {
				return fmt.Errorf("error trying to restore terraform state: %w", err)
			}
		}
	}
	return nil
}

func createGroupDirs(deploymentPath string, deploymentGroups *[]config.DeploymentGroup) error {
	for _, grp := range *deploymentGroups {
		groupPath := filepath.Join(deploymentPath, grp.Name)
		// Create the deployment group directory if not already created.
		if _, err := os.Stat(groupPath); errors.Is(err, os.ErrNotExist) {
			if err := os.Mkdir(groupPath, 0755); err != nil {
				return fmt.Errorf("failed to create directory at %s for deployment group %s: err=%w",
					groupPath, grp.Name, err)
			}
		}
	}
	return nil
}

func copySource(deploymentPath string, deploymentGroups *[]config.DeploymentGroup) error {

	for iGrp, grp := range *deploymentGroups {
		basePath := filepath.Join(deploymentPath, grp.Name)
		for iMod, module := range grp.Modules {
			if sourcereader.IsGitPath(module.Source) {
				continue
			}

			/* Copy source files */
			moduleName := filepath.Base(module.Source)
			(*deploymentGroups)[iGrp].Modules[iMod].ModuleName = moduleName
			var destPath string
			switch module.Kind {
			case "terraform":
				destPath = filepath.Join(basePath, "modules", moduleName)
			case "packer":
				destPath = filepath.Join(basePath, module.ID)
			}
			_, err := os.Stat(destPath)
			if err == nil {
				continue
			}

			reader := sourcereader.Factory(module.Source)
			if err := reader.GetModule(module.Source, destPath); err != nil {
				return fmt.Errorf("failed to get module from %s to %s: %v", module.Source, destPath, err)
			}

			/* Create module level files */
			writer := factory(module.Kind)
			writer.addNumModules(1)
		}
	}
	return nil
}

func printInstructionsPreamble(kind string, path string) {
	fmt.Printf("%s group was successfully created in directory %s\n", kind, path)
	fmt.Println("To deploy, run the following commands:")
}

// Determines if overwrite is allowed
func isOverwriteAllowed(depDir string, overwritingConfig *config.Blueprint, overwriteFlag bool) bool {
	if !overwriteFlag {
		return false
	}

	files, err := ioutil.ReadDir(depDir)
	if err != nil {
		return false
	}

	// build list of previous and current deployment groups
	var prevGroups []string
	for _, f := range files {
		if f.IsDir() && f.Name() != hiddenGhpcDirName {
			prevGroups = append(prevGroups, f.Name())
		}
	}

	var curGroups []string
	for _, group := range overwritingConfig.DeploymentGroups {
		curGroups = append(curGroups, group.Name)
	}

	return isSubset(prevGroups, curGroups)
}

func isSubset(sub, super []string) bool {
	// build set (map keys) from slice
	superM := make(map[string]bool)
	for _, item := range super {
		superM[item] = true
	}

	for _, item := range sub {
		if _, found := superM[item]; !found {
			return false
		}
	}
	return true
}

// OverwriteDeniedError signifies when a deployment overwrite was denied.
type OverwriteDeniedError struct {
	cause error
}

func (err *OverwriteDeniedError) Error() string {
	return fmt.Sprintf("Failed to overwrite existing deployment.\n\n"+
		"Use the -w command line argument to enable overwrite.\n"+
		"If overwrite is already enabled then this may be because "+
		"you are attempting to remove a deployment group, which is not supported.\n"+
		"original error: %v",
		err.cause)
}

// Prepares a deployment directory to be written to.
func prepDepDir(depDir string, overwrite bool) error {
	deploymentio := deploymentio.GetDeploymentioLocal()
	ghpcDir := filepath.Join(depDir, hiddenGhpcDirName)
	gitignoreFile := filepath.Join(depDir, ".gitignore")

	// create deployment directory
	if err := deploymentio.CreateDirectory(depDir); err != nil {
		if !overwrite {
			return &OverwriteDeniedError{err}
		}

		// Confirm we have a previously written deployment dir before overwritting.
		if _, err := os.Stat(ghpcDir); os.IsNotExist(err) {
			return fmt.Errorf(
				"While trying to update the deployment directory at %s, the '.ghpc/' dir could not be found", depDir)
		}
	} else {
		if err := deploymentio.CreateDirectory(ghpcDir); err != nil {
			return fmt.Errorf("Failed to create directory at %s: err=%w", ghpcDir, err)
		}

		if err := deploymentio.CopyFromFS(templatesFS, gitignoreTemplate, gitignoreFile); err != nil {
			return fmt.Errorf("Failed to copy template.gitignore file to %s: err=%w", gitignoreFile, err)
		}
	}

	// clean up old dirs
	prevGroupDir := filepath.Join(ghpcDir, prevDeploymentGroupDirName)
	os.RemoveAll(prevGroupDir)
	if err := os.MkdirAll(prevGroupDir, 0755); err != nil {
		return fmt.Errorf("Failed to create directory to save previous deployment groups at %s: %w", prevGroupDir, err)
	}

	// move deployment groups
	files, err := ioutil.ReadDir(depDir)
	if err != nil {
		return fmt.Errorf("Error trying to read directories in %s, %w", depDir, err)
	}
	for _, f := range files {
		if !f.IsDir() || f.Name() == hiddenGhpcDirName {
			continue
		}
		src := filepath.Join(depDir, f.Name())
		dest := filepath.Join(prevGroupDir, f.Name())
		if err := os.Rename(src, dest); err != nil {
			return fmt.Errorf("Error while moving previous deployment groups: failed on %s: %w", f.Name(), err)
		}
	}
	return nil
}


text:
int main(int argc, const char * argv[]) {
unsigned long int hexdouble;
double a;
sscanf(argv[1], "%lX", &hexdouble);
a = *(double*)(&hexdouble);
double result = gsl_sf_bessel_K0_scaled(a);
//printf("%.15f\n", result);
VALGRIND_PRINT_ERROR("result", &result);
return 0;
}


text:
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gtk/gtk.h>

#include "diagram_tree_menu_callbacks.h"
#include "diagram_tree_menu.h"
#include "diagram_tree_window.h"
#include "preferences.h"

void
on_locate_object_activate(gpointer user_data,
			  guint action, GtkMenuItem *menuitem)

{
  diagram_tree_raise((DiagramTree *)user_data);
}

void
on_properties_activate(gpointer user_data,
		       guint action, GtkMenuItem *menuitem)
{
  diagram_tree_show_properties((DiagramTree *)user_data);
}

void
on_sort_objects_activate(gpointer user_data,
			 guint action, GtkMenuItem *menuitem)
{
  diagram_tree_sort_objects((DiagramTree *)user_data, action);
}

void
on_sort_all_objects_activate(gpointer user_data,
			     guint action, GtkMenuItem *menuitem)
{
  diagram_tree_sort_all_objects((DiagramTree *)user_data, action);
}

void
on_sort_def_activate(gpointer user_data,
		     guint action, GtkMenuItem *item)
{
  prefs.dia_tree.obj_sort = action;
  diagram_tree_set_object_sort_type((DiagramTree *)user_data, action);
}

void
on_delete_object_activate(gpointer user_data,
			  guint action, GtkMenuItem *menuitem)
{

}

void
on_locate_dia_activate(gpointer user_data,
		       guint action, GtkMenuItem *menuitem)
{
  diagram_tree_raise((DiagramTree *)user_data);
}

void
on_sort_diagrams_activate(gpointer user_data,
			  guint action, GtkMenuItem *menuitem)
{
  diagram_tree_sort_diagrams((DiagramTree *)user_data, action);
}

void
on_sort_dia_def_activate(gpointer user_data,
			 guint action, GtkMenuItem *item)
{
  prefs.dia_tree.dia_sort = action;
  diagram_tree_set_diagram_sort_type((DiagramTree *)user_data, action);
}

void
on_hide_object_activate(gpointer user_data,
			guint action, GtkMenuItem *menuitem)
{
  diagram_tree_hide_type((DiagramTree *)user_data);
}


text:
Posts = new Mongo.Collection('posts');

if (Meteor.isClient) {
  Template.post.onCreated(function() {
    var self = this;
    self.autorun(function() {
      self.subscribe('post', FlowRouter.getParam('slug'));
    });
  });

  Template.post.helpers({
    post: function() {
      return Posts.findOne({ slug: FlowRouter.getParam('slug') });
    }
  });
}

FlowRouter.route('/', {
  action: function() {
    BlazeLayout.render('layout', { main: 'home' });
  }
});

FlowRouter.route('/post/:slug', {
  action: function() {
    BlazeLayout.render('layout', { main: 'post' });
  }
});

if (Meteor.isServer) {
  if (Posts.find().count() === 0) {
    Posts.insert({ slug: 'post-1', title: 'Post 1' });
    Posts.insert({ slug: 'post-2', title: 'Post 2' });
    Posts.insert({ slug: 'post-3', title: 'Post 3' });
  }

  Meteor.publish('post', function(slug) {
    check(slug, String);
    return Posts.find({ slug: slug });
  });
}


text:
<?php

if (!defined('_PS_VERSION_')) {
    exit;
}

function upgrade_module_7_4_0(Aplazame $module)
{
    Configuration::updateValue('PRODUCT_WIDGET_ALIGN', 'center');
    Configuration::updateValue('CART_WIDGET_ALIGN', 'center');

    return true;
}


text:
<?php

namespace ZendTest\Soap\Wsdl;

require_once __DIR__."/../TestAsset/commontypes.php";

use Zend\Soap\Wsdl;
use Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex;

/**
 * @category   Zend
 * @package    Zend_Soap
 * @subpackage UnitTests
 * @group      Zend_Soap
 * @group      Zend_Soap_Wsdl
 */
class ArrayOfTypeComplexStrategyTest extends \PHPUnit_Framework_TestCase
{
    /** @var \Zend\Soap\Wsdl */
    private $wsdl;

    /** @var \Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex */
    private $strategy;

    public function setUp()
    {
        $this->strategy = new ArrayOfTypeComplex();
        $this->wsdl = new Wsdl('MyService', 'http://localhost/MyService.php', $this->strategy);
    }

    public function testNestingObjectsDeepMakesNoSenseThrowingException()
    {
        $this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'ArrayOfTypeComplex cannot return nested ArrayOfObject deeper than one level');
        $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexTest[][]');
    }

    public function testAddComplexTypeOfNonExistingClassThrowsException()
    {
        $this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Cannot add a complex type \ZendTest\Soap\TestAsset\UnknownClass that is not an object or where class');
        $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\UnknownClass[]');
    }

    /**
     * @group ZF-5046
     */
    public function testArrayOfSimpleObject()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexTest[]');
        $this->assertEquals("tns:ArrayOfComplexTest", $return);

        $wsdl = $this->wsdl->toXML();

        $this->assertContains(
            '<xsd:complexType name="ArrayOfComplexTest"><xsd:complexContent><xsd:restriction base="soap-enc:Array"><xsd:attribute ref="soap-enc:arrayType" wsdl:arrayType="tns:ComplexTest[]"/></xsd:restriction></xsd:complexContent></xsd:complexType>',
            $wsdl,
            $wsdl
        );

        $this->assertContains(
            '<xsd:complexType name="ComplexTest"><xsd:all><xsd:element name="var" type="xsd:int"/></xsd:all></xsd:complexType>',
            $wsdl
        );
    }

    public function testThatOverridingStrategyIsReset()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexTest[]');
        $this->assertEquals("tns:ArrayOfComplexTest", $return);
        // $this->assertTrue($this->wsdl->getComplexTypeStrategy() instanceof \Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplexStrategy);

        $wsdl = $this->wsdl->toXML();
    }

    /**
     * @group ZF-5046
     */
    public function testArrayOfComplexObjects()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectStructure[]');
        $this->assertEquals("tns:ArrayOfComplexObjectStructure", $return);

        $wsdl = $this->wsdl->toXML();

        $this->assertContains(
            '<xsd:complexType name="ArrayOfComplexObjectStructure"><xsd:complexContent><xsd:restriction base="soap-enc:Array"><xsd:attribute ref="soap-enc:arrayType" wsdl:arrayType="tns:ComplexObjectStructure[]"/></xsd:restriction></xsd:complexContent></xsd:complexType>',
            $wsdl,
            $wsdl
        );

        $this->assertContains(
            '<xsd:complexType name="ComplexObjectStructure"><xsd:all><xsd:element name="boolean" type="xsd:boolean"/><xsd:element name="string" type="xsd:string"/><xsd:element name="int" type="xsd:int"/><xsd:element name="array" type="soap-enc:Array"/></xsd:all></xsd:complexType>',
            $wsdl
        );
    }

    public function testArrayOfObjectWithObject()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectWithObjectStructure[]');
        $this->assertEquals("tns:ArrayOfComplexObjectWithObjectStructure", $return);

        $wsdl = $this->wsdl->toXML();

        $this->assertContains(
            '<xsd:complexType name="ArrayOfComplexObjectWithObjectStructure"><xsd:complexContent><xsd:restriction base="soap-enc:Array"><xsd:attribute ref="soap-enc:arrayType" wsdl:arrayType="tns:ComplexObjectWithObjectStructure[]"/></xsd:restriction></xsd:complexContent></xsd:complexType>',
            $wsdl
        );

        $this->assertContains(
            '<xsd:complexType name="ComplexObjectWithObjectStructure"><xsd:all><xsd:element name="object" type="tns:ComplexTest" nillable="true"/></xsd:all></xsd:complexType>',
            $wsdl,
            $wsdl
        );

        $this->assertContains(
            '<xsd:complexType name="ComplexTest"><xsd:all><xsd:element name="var" type="xsd:int"/></xsd:all></xsd:complexType>',
            $wsdl
        );
    }

    /**
     * @group ZF-4937
     */
    public function testAddingTypesMultipleTimesIsSavedOnlyOnce()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectWithObjectStructure[]');
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectWithObjectStructure[]');

        $wsdl = $this->wsdl->toXML();

        $this->assertEquals(1,
            substr_count($wsdl, 'wsdl:arrayType="tns:ComplexObjectWithObjectStructure[]"')
        );
        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ArrayOfComplexObjectWithObjectStructure">')
        );
        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ComplexTest">')
        );
    }

    /**
     * @group ZF-4937
     */
    public function testAddingSingularThenArrayTypeIsRecognizedCorretly()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectWithObjectStructure');
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexObjectWithObjectStructure[]');

        $wsdl = $this->wsdl->toXML();

        $this->assertEquals(1,
            substr_count($wsdl, 'wsdl:arrayType="tns:ComplexObjectWithObjectStructure[]"')
        );
        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ArrayOfComplexObjectWithObjectStructure">')
        );
        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ComplexTest">')
        );
    }

    /**
     * @group ZF-5149
     */
    public function testArrayOfComplexNestedObjectsIsCoveredByStrategy()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexTypeA');
        $wsdl = $this->wsdl->toXml();
        $this->assertTrue(is_string($wsdl)); // no exception was thrown
    }

    /**
     * @group ZF-5149
     */
    public function testArrayOfComplexNestedObjectsIsCoveredByStrategyAndAddsAllTypesRecursivly()
    {
        $return = $this->wsdl->addComplexType('\ZendTest\Soap\TestAsset\ComplexTypeA');
        $wsdl = $this->wsdl->toXml();

        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ComplexTypeA">'),
            'No definition of complex type A found.'
        );
        $this->assertEquals(1,
            substr_count($wsdl, '<xsd:complexType name="ArrayOfComplexTypeB">'),
            'No definition of complex type B array found.'
        );
        $this->assertEquals(1,
            substr_count($wsdl, 'wsdl:arrayType="tns:ComplexTypeB[]"'),
            'No usage of Complex Type B array found.'
        );
    }
}


text:
package p03_Shapes;

abstract class Shape {
    private double perimeter;
    private double area;

    double getPerimeter() {
        return this.perimeter;
    }

    void setPerimeter(double perimeter) {
        this.perimeter = perimeter;
    }

    double getArea() {
        return this.area;
    }

    void setArea(double area) {
        this.area = area;
    }

    abstract void calculatePerimeter();
    abstract void calculateArea();
}


text:
@implementation RZInterest (RZVinyl)

+ (NSPredicate *)rzv_stalenessPredicate
{
    // All interests with no associated people will be purged
    // when the RZCoreDataStack purges stale objects
    return [NSPredicate predicateWithFormat:@"people.@count == 0"];
}

@end


text:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include <lua.h>
#include <lauxlib.h>

#include "iup.h"
#include "iupkey.h"
#include "iup_str.h"

#include "iuplua.h"
#include "il.h"

#include "iup_str.h"

/* from iupkey.c */
void iupKeyForEach(void (*func)(char *name, int code, void* user_data), void* user_data);

static int iuplua_tag = 0;
static lua_Object iuplua_namespace;

void iuplua_call_start(Ihandle* handle, char* name)
{
  lua_beginblock();
  lua_pushstring(name);
  lua_pushusertag(handle, iuplua_tag);
}

int iuplua_call(void)
{
  lua_Object obj;

  if (lua_call("iupCallMethod"))
  {
    lua_endblock();
    return IUP_DEFAULT;  /* call failed */
  }

  obj = lua_getresult(1);
  if (obj == LUA_NOOBJECT)
  {
    lua_endblock();
    return IUP_DEFAULT; /* no return, provides IUP_DEFAULT return */
  }
  else if (lua_isnumber(obj))
  {
    int ret = (int) lua_getnumber(obj);
    lua_endblock();
    return ret;
  }
  lua_endblock();
  return IUP_DEFAULT; /* returned a non normal value. what to do? */
}

char* iuplua_call_rs(void)
{
  lua_Object obj;

  if (lua_call("iupCallMethod"))
  {
    lua_endblock();
    return NULL;  /* call failed */
  }

  obj = lua_getresult(1);
  if (obj == LUA_NOOBJECT)
  {
    lua_endblock();
    return NULL; /* no return, provides IUP_DEFAULT return */
  }
  else if (lua_isstring(obj))
  {
    char* ret = lua_getstring(obj);
    lua_endblock();
    return ret;
  }
  lua_endblock();
  return NULL; /* returned a non normal value. what to do? */
}

static void iuplua_set_callback(void)
{
  lua_Object o;
  Icallback func;

  Ihandle* ih = iuplua_checkihandle(1);
  char* name = luaL_check_string(2);

  o = lua_getparam(3);
  if (!lua_iscfunction(o))
    lua_error("invalid function when set callback");
  func = (Icallback)lua_getcfunction(o);

  o = lua_getparam(4);
  if (lua_isnil(o))
    IupSetCallback(ih, name, (Icallback)NULL);
  else
    IupSetCallback(ih, name, func);
}

/***********************************************************************************
***********************************************************************************/

static int idle_ref = 0;
static int default_idle(void)
{
  lua_Object obj;
  lua_beginblock();
  obj = lua_getref(idle_ref);
  if (lua_callfunction(obj))
  {
    lua_endblock();
    return IUP_IGNORE;
  }

  obj = lua_getresult(1);
  if (lua_isnumber(obj))
  {
    int ret = (int) lua_getnumber(obj);
    lua_endblock();
    return ret;
  }
  lua_endblock();
  return IUP_DEFAULT;
}

static void IupSetIdle(void)
{
  lua_Object obj = lua_getparam(1);
  lua_Object old;
  if (idle_ref != 0)
    old = lua_getref(idle_ref);
  else
    old = LUA_NOOBJECT;
  if (lua_isnil(obj))
  {
    lua_unref(idle_ref);
    idle_ref = 0;
    IupSetFunction("IDLE_ACTION", (Icallback) NULL);
  }
  else
  {
    if (!lua_isfunction(obj) && !lua_iscfunction(obj))
      lua_error("IupSetIdle: parameter must be a function or a cfunction");
    lua_pushobject(obj);
    idle_ref = lua_ref(1);
    IupSetFunction("IDLE_ACTION", (Icallback) default_idle);
  }

  if (old == LUA_NOOBJECT)
    lua_pushnil();
  else
    lua_pushobject(old);
}

/***********************************************************************************
***********************************************************************************/

static void iuplua_gettable(void)
{
  lua_Object t, index, tab, result;
  t = lua_getparam(1);
  index = lua_getparam(2);
  lua_pushobject(lua_getglobal("iup_handles"));
  lua_pushobject(t);
  tab = lua_gettable();
  if (lua_isnil(tab))
  {
    lua_pushnil();
    return;
  }
  else
  {
    lua_Object method;
    lua_pushobject(tab);
    lua_pushstring("get");
    method = lua_gettable();
    lua_pushobject(tab);
    lua_pushobject(index);
    if (lua_callfunction(method))
      return;
  }

  result = lua_getresult(1);
  if (result != LUA_NOOBJECT)
    lua_pushobject(result);
  else
    lua_pushnil();
}

static void iuplua_settable(void)
{
  lua_Object t, index, value, tab, result;
  t = lua_getparam(1);
  index = lua_getparam(2);
  value = lua_getparam(3);
  lua_pushobject(lua_getglobal("iup_handles"));
  lua_pushobject(t);
  tab = lua_gettable();
  if (lua_isnil(tab))
  {
    lua_pushnil();
    return;
  }
  else
  {
    lua_Object method;
    lua_pushobject(tab);
    lua_pushstring("set");
    method = lua_gettable();
    lua_pushobject(tab);
    lua_pushobject(index);
    lua_pushobject(value);
    if (lua_callfunction(method))
      return;
  }

  result = lua_getresult(1);
  if (result != LUA_NOOBJECT)
    lua_pushobject(result);
}

static void iuplua_index(void)
{
  lua_Object t, f, result;
  t = lua_getparam(1);
  f = lua_getparam(2);
  if (!(lua_isstring(f) && iupStrEqual(lua_getstring(f), "parent")))
  {
    lua_Object p;
    lua_pushobject(t);
    lua_pushstring("parent");
    p = lua_gettable();
    if (lua_istable(p))
    {
      lua_pushobject(p);
      lua_pushobject(f);
      result = lua_gettable();
      if (lua_isnil(result))
        lua_pushnil();
      else
        lua_pushobject(result);
      return;
    }
  }
  lua_pushnil();
}

/***********************************************************************************
***********************************************************************************/

static void iuplua_setnamespace(char* name, char* new_name)
{
  lua_Object obj = lua_getglobal(name);
  lua_pushobject(iuplua_namespace);
  lua_pushstring(new_name);
  lua_pushobject(obj);
  lua_settable();
}

void iuplua_register(char* name, lua_CFunction func)
{
  lua_register(name, func);
  iuplua_setnamespace(name, name+3);  /* IupXxx */
}

void iuplua_register_macro(char* name, lua_CFunction func)
{
  lua_register(name, func);
  iuplua_setnamespace(name, name);  /* xxx */
}

void iuplua_regstring_mask(char* str, char* name)
{
  lua_pushstring(str); lua_setglobal(name);
  iuplua_setnamespace(name, name+3);     /* IUPMASK_XXX */
}

void iuplua_regnumber(double num, char* name)
{
  lua_pushnumber(num); lua_setglobal(name);
  iuplua_setnamespace(name, name+4);     /* IUP_XXXX */
}

void iuplua_regstring(char* str, char* name)
{
  lua_pushstring(str); lua_setglobal(name);
  iuplua_setnamespace(name, name+4);     /* IUP_XXXX */
}

void iuplua_regihandle(Ihandle *h)
{
  if (h)
  {
    lua_pushusertag((void*)h, iuplua_tag);
    lua_pushstring(IupGetClassName(h));
    lua_call("IupRegisterHandle");
  }
}

void iuplua_pushihandle_cb(Ihandle *h)
{
  if (h)
    lua_pushusertag((void*)h, iuplua_tag);
  else
    lua_pushnil();
}

void iuplua_pushihandle(Ihandle *h)
{
  if (h)
  {
    lua_pushusertag((void*)h, iuplua_tag);
    lua_pushstring(IupGetClassName(h));
    lua_call("IupRegisterHandle");
    lua_pushobject(lua_getresult(1));
  }
  else
    lua_pushnil();
}

Ihandle* iuplua_checkihandle(int numArg)
{
  lua_Object o = lua_getparam(numArg);
  luaL_arg_check(lua_tag(o)==iuplua_tag, numArg, "handle expected");
  return (Ihandle*)lua_getuserdata(o);
}

static Ihandle* checkihandle_table(lua_Object tab, int index)
{
  Ihandle* ih;
  lua_Object o;
  lua_beginblock();
  lua_pushobject(tab);
  lua_pushnumber(index);
  o = lua_gettable();
  luaL_arg_check(lua_tag(o)==iuplua_tag, index, "handle expected");
  ih = (Ihandle*)lua_getuserdata(o);
  lua_endblock();
  return ih;
}

Ihandle** iuplua_checkihandle_array(int numArg)
{
  int i;
  lua_Object tab = luaL_tablearg(numArg);
  int count = luaL_check_int(numArg+1);

  Ihandle **params = (Ihandle **) malloc(sizeof(Ihandle *) * (count+1));

  for (i = 0; i < count; i++)
    params[i] = checkihandle_table(tab, i+1);
  params[count] = NULL;

  return params;
}

int iuplua_dofile(char *filename)
{
  if (lua_dofile(filename) != 0)
  {
    char *dir = getenv("IUPLUA_DIR");
    if (!dir)
      return 0;
    else
    {
      char* full_name = iupStrFileMakeFileName(dir, filename);
      if (!full_name)
        return 0;

      if (lua_dofile(full_name))
      {
        free(full_name);
        return 0;
      }
      free(full_name);
    }
  }
  return 1;
}

/***********************************************************************************
***********************************************************************************/

static void register_key(char *name, int code, void* user_data)
{
  (void)user_data;
  lua_pushnumber(code); lua_setglobal(name);
  iuplua_setnamespace(name, name);     /* K_xxx */
}

int iupkey_open(void)
{
  /* does nothing, kept for backward compatibility */
  return 1;
}

/***********************************************************************************
***********************************************************************************/

static void setinfo(void)
{
  iuplua_regstring_mask(IUP_COPYRIGHT, "IUP_COPYRIGHT");
  iuplua_regstring_mask("Portable toolkit for building graphical user interfaces.", "IUP_DESCRIPTION");
  iuplua_regstring_mask("IUP - Portable User Interface", "IUP_NAME");
  iuplua_regstring_mask("IUP "IUP_VERSION, "IUP_VERSION");
  iuplua_regstring_mask(LUA_COPYRIGHT, "IUP_LUA_COPYRIGHT");
}

int iuplua_open(void)
{
  struct FuncList {
    char *name;
    lua_CFunction func;
  } FuncList[] = {
    { "IupSetIdle", IupSetIdle },
  };
  int SizeFuncList = (sizeof(FuncList)/sizeof(struct FuncList));
  int i;

  iuplua_tag = lua_newtag();
  lua_pushnumber(iuplua_tag);
  lua_setglobal("iuplua_tag");

  iuplua_namespace = lua_createtable();
  lua_pushobject(iuplua_namespace); lua_setglobal ("iup");

  setinfo();

  for (i = 0; i < SizeFuncList; i++)
    iuplua_register(FuncList[i].name, FuncList[i].func);

  lua_register("iup_gettable", iuplua_gettable);
  lua_register("iup_settable", iuplua_settable);
  lua_register("iup_index", iuplua_index);
  lua_register("iupSetCallback", iuplua_set_callback);

  iupKeyForEach(register_key, NULL);

  iupluaapi_open();

#ifdef IUPLUA_USELOH
#ifdef TEC_BIGENDIAN
#ifdef TEC_64
#include "loh/iuplua_be64.loh"
#include "loh/constants_be64.loh"
#else
#include "loh/iuplua_be32.loh"
#include "loh/constants_be32.loh"
#endif
#else
#ifdef TEC_64
#ifdef WIN64
#include "loh/iuplua_le64w.loh"
#include "loh/constants_le64w.loh"
#else
#include "loh/iuplua_le64.loh"
#include "loh/constants_le64.loh"
#endif
#else
#include "loh/iuplua.loh"
#include "loh/constants.loh"
#endif
#endif
#else
  iuplua_dofile("iuplua.lua");
  iuplua_dofile("constants.lua");
#endif

  iupluawidgets_open(iuplua_tag);

  sboxlua_open();
  splitlua_open();
  spinlua_open();
  cboxlua_open();
  vallua_open();
  tabslua_open();
  gclua_open();
  getparamlua_open();
  treelua_open();

  return 1;
}


text:
/**
 * @license Highcharts JS v9.0.0 (2021-02-02)
 * @module highcharts/modules/pattern-fill
 * @requires highcharts
 *
 * Module for adding patterns and images as point fills.
 *
 * (c) 2010-2019 Highsoft AS
 * Author: Torstein Hønsi, Øystein Moseng
 *
 * License: www.highcharts.com/license
 */
'use strict';
import '../../Extensions/PatternFill.js';


text:
var app = require('../../app'),
    arduino = require('../arduino')

app.get('/api/variables', function (req, res, next) {
    arduino.request(arduino.help.commands.controlVariables, function (err, data) {
        if(err) return next(err)
        res.json(data)
    })
})


text:
template: example.html
title: WMTS HiDPI example
shortdesc: Example of a WMTS based HiDPI layer.
docs: >
  The WMTS source has a `tilePixelRatio` option. A HiDPI capable WMTS could provide tiles with 512x512 pixel tiles, but use them in a 256x256 pixel tile grid. In this case `tilePixelRatio` needs to be set to `2`.
tags: "hidpi, retina, wmts"
---


text:
// GMCZoomingMultiImageView.h
//
// Copyright (c) 2013 Hilton Campbell
//
// 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 <UIKit/UIKit.h>
#import "GMCMultiImage.h"

extern const CGSize GMCZoomingMultiImageViewPlaceholderSizeDefault;

@interface GMCZoomingMultiImageView : UIView

@property (nonatomic, strong) GMCMultiImage *multiImage;

/**
 * The underlying scroll view, for zooming and panning.
 */
@property (nonatomic, strong, readonly) UIScrollView *scrollView;

/**
 * The gesture recognizer used for zooming in/out on double tap.
 */
@property (nonatomic, strong, readonly) UITapGestureRecognizer *doubleTapGestureRecognizer;

/**
 * The underlying image view, for displaying the current image rendition.
 */
@property (nonatomic, strong, readonly) UIImageView *imageView;

/**
 * Size used to select a rendition to show immediately (if available) while waiting for the best rendition to load and decompress in the background.
 */
@property (nonatomic, assign) CGSize placeholderSize;

/**
 * Scale used to select renditions. Defaults to the screen scale.
 */
@property (nonatomic, assign) CGFloat scale;

@end


text:
const path = require('path');
const fsx = require('./fsx');
const fse = require('fs-extra');
const j79 = require('j79-utils');
const osHomeDir = require('os-homedir');

const version = require('./../../package.json').version;

const confConsts = require('../common/conf-constants');
const cmdLineArgs = require('./cmd-line-args');
const utils = require('./utils');
const logger = require('./logger');
const schemas = require('../common/schemas');
const confMigration = require('./conf-migration');
const schemaValidation = require('./schema-validation');

let NEXL_HOME_DIR;
const ALL_SETTINGS_CACHED = {};
const CONF_VERSIONS = {};
const APP_DATA_DIR = 'app-data';

// --------------------------------------------------------------------------------
// api

function getConfFileFullPath(fileName) {
	return path.join(getNexlAppDataDir(), fileName);
}

function loadDefaultValues(defValue) {
	if (j79.isPrimitive(defValue)) {
		return defValue;
	}

	if (j79.isFunction(defValue)) {
		return defValue();
	}

	if (j79.isArray(defValue)) {
		const result = [];
		for (let index in defValue) {
			let item = defValue[index];
			item = loadDefaultValues(item);
			result.push(item);
		}
		return result;
	}

	if (j79.isObject(defValue)) {
		const result = {};
		for (let key in defValue) {
			let val = defValue[key];
			val = loadDefaultValues(val);
			result[key] = val;
		}

		return result;
	}

	throw 'Bad default value';
}

function loadInner(fullPath, fileName) {
	return fsx.readFileUTF8(fullPath)
		.then(
			(fileBody) => {
				// JSONing. The JSON must be an object which contains config version and the data itself
				let conf;
				try {
					conf = JSON.parse(fileBody);
				} catch (e) {
					return Promise.reject(`The [${fullPath}] config file is damaged or broken. Reason : [${utils.formatErr(e)}]`);
				}

				const version = conf['version'];
				const data = conf['data'];

				// storing config version
				CONF_VERSIONS[fileName] = version;

				logger.log.debug('The [%s] file is loaded. Config version is [%s]', fullPath, version);

				// validating data
				const validationResult = schemaValidation(data, schemas.SCHEMAS[fileName], schemas.GROUP_VALIDATIONS[fileName]);
				if (!validationResult.isValid) {
					logger.log.error(`Config validation failed for [${fileName}] while loading, [path=${getNexlAppDataDir()}]. Reason : [${validationResult.err}]`);
					return Promise.reject(validationResult.err);
				}

				// updating cache
				ALL_SETTINGS_CACHED[fileName] = data;

				return Promise.resolve(data);
			});
}

function isConfFileDeclared(fileName) {
	for (let key in confConsts.CONF_FILES) {
		if (confConsts.CONF_FILES[key] === fileName) {
			return true;
		}
	}

	return false;
}

function load(fileName, saveIfNotExists) {
	logger.log.debug('Loading config from [%s] file', fileName);

	if (!isConfFileDeclared(fileName)) {
		return Promise.reject(`Unregistered [${fileName}] config file`);
	}

	const fullPath = getConfFileFullPath(fileName);

	return fsx.exists(fullPath).then(
		(isExists) => {
			if (isExists) {
				return loadInner(fullPath, fileName);
			}

			// file doesn't exist, loading defaults
			logger.log.debug('The [%s] file doesn\'t exist. Loading defaults', fullPath);

			// applying default values
			const result = loadDefaultValues(schemas.DEF_VALUES[fileName]);

			// updating cache
			ALL_SETTINGS_CACHED[fileName] = result;

			if (saveIfNotExists) {
				return save(result, fileName).then(_ => result);
			} else {
				return Promise.resolve(result);
			}
		});
}

function stringifyConfig(config) {
	return JSON.stringify(config, null, 2);
}

function save(data, fileName) {
	logger.log.debug('Saving config to [%s] file', fileName);

	if (!isConfFileDeclared(fileName)) {
		return Promise.reject(`Unregistered [${fileName}] config file`);
	}

	const fullPath = getConfFileFullPath(fileName);

	// validating data before save
	const validationResult = schemaValidation(data, schemas.SCHEMAS[fileName], schemas.GROUP_VALIDATIONS[fileName]);
	if (!validationResult.isValid) {
		logger.log.error(`Config validation failed for [${fileName}] while saving, [path=${getNexlAppDataDir()}]. Reason : [${validationResult.err}]`);
		return Promise.reject(validationResult.err);
	}

	// preparing for save
	let conf = {
		version: CONF_VERSIONS[fileName] || version,
		data: data
	};

	try {
		conf = stringifyConfig(conf);
	} catch (e) {
		return Promise.reject(`Failed to stringify object while saving the [${fullPath}] file. Reason : [${utils.formatErr(e)}]`);
	}

	// saving...
	return fsx.writeFileUTF8(fullPath, conf)
		.then(_ => {
			// updating cache
			ALL_SETTINGS_CACHED[fileName] = data;
			return Promise.resolve();
		});
}

function loadSettings(saveIfNotExists) {
	return load(confConsts.CONF_FILES.SETTINGS, saveIfNotExists);
}

function saveSettings(settings) {
	return save(settings, confConsts.CONF_FILES.SETTINGS);
}

function initNexlHomeDir() {
	const cmdLineOpts = cmdLineArgs.init();
	NEXL_HOME_DIR = cmdLineOpts[confConsts.NEXL_HOME_DEF] || path.join(osHomeDir(), '.nexl');

	// create dir structure if needed, preload settings and save them if needed
	return fse.mkdirs(getNexlAppDataDir()).then(_ => loadSettings(true));
}

function preloadConfs() {
	return Promise.resolve()
		.then(_ => load(confConsts.CONF_FILES.USERS, true))
		.then(_ => load(confConsts.CONF_FILES.PERMISSIONS, true))
		.then(_ => load(confConsts.CONF_FILES.ADMINS, true))
		.then(_ => load(confConsts.CONF_FILES.WEBHOOKS, true));
}

function createStorageDirIfNeeded() {
	const nexlStorageDir = ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.STORAGE_DIR];
	return fse.mkdirs(nexlStorageDir);
}

function getLDAPSettings() {
	let ldapSettings = {
		url: ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.LDAP_URL],
		baseDN: ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.LDAP_BASE_DN],
		bindDN: ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.LDAP_BIND_DN],
		bindPassword: ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.LDAP_BIND_PASSWORD],
		findBy: ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.LDAP_FIND_BY]
	};

	if (utils.isEmptyStr(ldapSettings.url)) {
		return undefined;
	}

	return ldapSettings;
}

function reloadCache() {
	const promises = [];
	for (let key in confConsts.CONF_FILES) {
		const val = confConsts.CONF_FILES[key];
		promises.push(Promise.resolve(val).then(load));
	}

	return Promise.all(promises);
}

function getNexlHomeDir() {
	return NEXL_HOME_DIR;
}

function getNexlAppDataDir() {
	return path.join(NEXL_HOME_DIR, APP_DATA_DIR);
}

// --------------------------------------------------------------------------------
module.exports.createStorageDirIfNeeded = createStorageDirIfNeeded;

module.exports.initNexlHomeDir = initNexlHomeDir;
module.exports.preloadConfs = preloadConfs;
module.exports.APP_DATA_DIR = APP_DATA_DIR;

module.exports.load = load;
module.exports.save = save;
module.exports.stringifyConfig = stringifyConfig;

module.exports.loadSettings = loadSettings;
module.exports.saveSettings = saveSettings;

module.exports.getNexlHomeDir = getNexlHomeDir;
module.exports.getNexlAppDataDir = getNexlAppDataDir;
module.exports.getNexlStorageDir = () => ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS][confConsts.SETTINGS.STORAGE_DIR];
module.exports.getNexlSettingsCached = () => ALL_SETTINGS_CACHED[confConsts.CONF_FILES.SETTINGS];

module.exports.getConfFileFullPath = getConfFileFullPath;

module.exports.getCached = (fileName) => ALL_SETTINGS_CACHED[fileName];

module.exports.reloadCache = reloadCache;

module.exports.getLDAPSettings = getLDAPSettings;
// --------------------------------------------------------------------------------


text:
layout: post
date: 2016-09-29
title: "Watters-Encore Encore Dress Bari style 6765e Sleeveless Short/Mini Aline/Princess"
category: Watters-Encore
tags: [Watters-Encore,Encore,Aline/Princess ,Illusion,Short/Mini,Sleeveless]
---
### Watters-Encore Encore Dress Bari style 6765e
Just **$309.99**
###   Sleeveless Short/Mini Aline/Princess

BRANDS	Encore

Silhouette	Aline/Princess

Neckline	Illusion

Hemline/Train	Short/Mini

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/encore/14430-watters-dress-bari-style-6765e.html](https://www.readybrides.com/en/encore/14430-watters-dress-bari-style-6765e.html)


text:
import {
  BaseDriver,
  DriverFactory,
} from 'wix-ui-core/src/common/BaseDriver.protractor';

export interface TextDriver extends BaseDriver {
  getText(): Promise<string>;
  getTagName(): Promise<string>;
}

export const textDriverFactory: DriverFactory<TextDriver> = (component) => {
  return {
    /** returns the component element */
    element: () => component,
    /** returns the component text */
    getText: async () => component.getText(),
    /** returns the component tag name */
    getTagName: async () => component.getTagName(),
  };
};


text:
package odp

import (
	"fmt"
	"syscall"
)

type GenlFamily struct {
	id       uint16
	mcGroups map[string]uint32
}

func (nlmsg *NlMsgBuilder) PutGenlMsghdr(cmd uint8, version uint8) *GenlMsghdr {
	pos := nlmsg.AlignGrow(syscall.NLMSG_ALIGNTO, SizeofGenlMsghdr)
	res := genlMsghdrAt(nlmsg.buf, pos)
	res.Cmd = cmd
	res.Version = version
	return res
}

func (nlmsg *NlMsgParser) CheckGenlMsghdr(cmd int) (*GenlMsghdr, error) {
	pos, err := nlmsg.AlignAdvance(syscall.NLMSG_ALIGNTO, SizeofGenlMsghdr)
	if err != nil {
		return nil, err
	}

	gh := genlMsghdrAt(nlmsg.data, pos)
	if cmd >= 0 && gh.Cmd != uint8(cmd) {
		return nil, fmt.Errorf("generic netlink response has wrong cmd (got %d, expected %d)", gh.Cmd, cmd)
	}

	// Deliberately ignore the version field in the genl header.
	// It's unclear exactly what its meaning is, and how we should
	// handle it.  E.g., if the version is higher than we expect,
	// should we still try to handle the message?  It's unclear,
	// but the fact that ODP bumped the kernel
	// OVS_DATAPATH_VERSION from 1 to 2 while expecting existing
	// userspace to keep working suggests that we should be
	// libreral in what we accept.

	return gh, nil
}

func (s *NetlinkSocket) LookupGenlFamily(name string) (family GenlFamily, err error) {
	req := NewNlMsgBuilder(RequestFlags, GENL_ID_CTRL)

	req.PutGenlMsghdr(CTRL_CMD_GETFAMILY, 0)
	req.PutStringAttr(CTRL_ATTR_FAMILY_NAME, name)

	resp, err := s.Request(req)
	if err != nil {
		return
	}

	_, err = resp.ExpectNlMsghdr(GENL_ID_CTRL)
	if err != nil {
		return
	}

	_, err = resp.CheckGenlMsghdr(CTRL_CMD_NEWFAMILY)
	if err != nil {
		return
	}

	attrs, err := resp.TakeAttrs()
	if err != nil {
		return
	}

	family.id, err = attrs.GetUint16(CTRL_ATTR_FAMILY_ID)
	if err != nil {
		return
	}

	mcGroupAttrs, err := attrs.GetNestedAttrs(CTRL_ATTR_MCAST_GROUPS, true)
	if err != nil || mcGroupAttrs == nil {
		return
	}

	family.mcGroups = make(map[string]uint32)
	for _, data := range mcGroupAttrs {
		groupAttrs, err := ParseNestedAttrs(data)
		if err != nil {
			return family, err
		}

		id, err := groupAttrs.GetUint32(CTRL_ATTR_MCAST_GRP_ID)
		if err != nil {
			return family, err
		}

		name, err := groupAttrs.GetString(CTRL_ATTR_MCAST_GRP_NAME)
		if err != nil {
			return family, err
		}

		family.mcGroups[name] = id
	}

	return
}


text:
package com.restfiddle.controller.rest;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.restfiddle.dao.NodeRepository;
import com.restfiddle.dto.NodeDTO;
import com.restfiddle.dto.NodeStatusResponseDTO;
import com.restfiddle.dto.ReportDTO;
import com.restfiddle.dto.TagDTO;

@RestController
@EnableAutoConfiguration
@ComponentScan
@Transactional
public class ReportController {
    Logger logger = LoggerFactory.getLogger(ReportController.class);

    @Autowired
    private NodeRepository nodeRepository;

    @Autowired
    private ApiController apiController;

    /**
     * This API can be used to generate report for "RUN PROJECT" functionality.
     */
    @RequestMapping(value = "/api/report/projects/{id}", method = RequestMethod.GET)
    public void generateRunProjectReport(@PathVariable("id") Long id) {

    }

    @RequestMapping(value = "/api/processor/projects/{id}/report", method = RequestMethod.GET)
    public void generateRunProjectReport(@PathVariable("id") String id, @RequestParam(value = "envId", required = false) String envId, HttpServletResponse response) {
	List<NodeStatusResponseDTO> nodeStatusResponse = apiController.runProjectById(id, envId);
	generateRunNodeReport(nodeStatusResponse, response);
    }

    @RequestMapping(value = "/api/processor/folders/{id}/report", method = RequestMethod.GET)
    public void generateRunFolderReport(@PathVariable("id") String id, @RequestParam(value = "envId", required = false) String envId, HttpServletResponse response) {
	List<NodeStatusResponseDTO> nodeStatusResponse = apiController.runFolderById(id, envId);
	generateRunNodeReport(nodeStatusResponse, response);
    }

    public void generateRunNodeReport(List<NodeStatusResponseDTO> nodeStatusResponse, HttpServletResponse response) {
	String reportTemplateFilePath = "report-template" + File.separator + "rf_doc_template.jasper";
	Resource resource = new ClassPathResource(reportTemplateFilePath);

	List<ReportDTO> apiNodes = new ArrayList<ReportDTO>();
	ReportDTO node = new ReportDTO();
	apiNodes.add(node);

	Map<String, Object> params = new HashMap<String, Object>();
	node.setNodeStatusResponse(nodeStatusResponse);

	JRBeanCollectionDataSource ds1 = new JRBeanCollectionDataSource(apiNodes);
	JRBeanCollectionDataSource ds2 = new JRBeanCollectionDataSource(nodeStatusResponse);
	params.put("nodeStatusResponse", ds2);

	try (InputStream inputStream = resource.getInputStream();) {
	    response.setContentType("application/pdf");
	    response.setHeader("Content-Disposition", "attachment; filename=\"report.pdf\"");
	    response.setHeader("Cache-Control", "no-cache");
	    JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, params, ds1);
	    JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
	} catch (JRException e) {
	    logger.error(e.getMessage(), e);
	} catch (IOException e) {
	    logger.error(e.getMessage(), e);
	}
    }

    /**
     * This API can be used to generate REST API documentation for a project.
     */
    @RequestMapping(value = "/api/documentation/projects/{id}", method = RequestMethod.GET)
    public void generateProjectApiDocumentation(@PathVariable("id") Long id, HttpServletResponse response) {
	String reportTemplateFilePath = "report-template" + File.separator + "rf_doc_template.jasper";
	Resource resource = new ClassPathResource(reportTemplateFilePath);

	// TODO : NodeDTO and TagDTO are used for testing purpose. Need to define a custom DTO for reports.
	// TODO : Use NodeStatusResponseDTO instead of TagDTO.
	List<NodeDTO> apiNodes = new ArrayList<NodeDTO>();

	NodeDTO node = new NodeDTO();
	apiNodes.add(node);

	List<TagDTO> tags = new ArrayList<TagDTO>();
	TagDTO tag = new TagDTO();
	//tag.setId(24);
	tag.setName("GET Workspaces");
	tag.setDescription("A workspace is a collection of projects. This API returns list of available workspaces.");
	tags.add(tag);

	TagDTO tag2 = new TagDTO();
	//tag2.setId(30L);
	tag2.setName("Post Workspace");
	tag2.setDescription("This API is used to create a new workspace.");
	tags.add(tag2);
	node.setTags(tags);

	JRBeanCollectionDataSource ds1 = new JRBeanCollectionDataSource(apiNodes);

	Map<String, Object> params = new HashMap<String, Object>();
	JRBeanCollectionDataSource ds2 = new JRBeanCollectionDataSource(tags);
	params.put("tags", ds2);

	try (InputStream inputStream = resource.getInputStream();) {
	    response.setContentType("application/pdf");
	    response.setHeader("Content-Disposition", "attachment; filename=\"report.pdf\"");
	    response.setHeader("Cache-Control", "no-cache");
	    JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, params, ds1);
	    JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
	} catch (JRException e) {
	    logger.error(e.getMessage(), e);
	} catch (IOException e) {
	    logger.error(e.getMessage(), e);
	}
    }
}


text:
/**
 * @author Mat Groves http://matgroves.com/ @Doormat23
 */

PIXI.TextureCache = {};
PIXI.FrameCache = {};

PIXI.TextureCacheIdGenerator = 0;

/**
 * A texture stores the information that represents an image or part of an image. It cannot be added
 * to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
 *
 * @class Texture
 * @uses EventTarget
 * @constructor
 * @param baseTexture {BaseTexture} The base texture source to create the texture from
 * @param frame {Rectangle} The rectangle frame of the texture to show
 */
PIXI.Texture = function(baseTexture, frame)
{
    PIXI.EventTarget.call( this );

    if(!frame)
    {
        this.noFrame = true;
        frame = new PIXI.Rectangle(0,0,1,1);
    }

    if(baseTexture instanceof PIXI.Texture)
        baseTexture = baseTexture.baseTexture;

    /**
     * The base texture of that this texture uses
     *
     * @property baseTexture
     * @type BaseTexture
     */
    this.baseTexture = baseTexture;

    /**
     * The frame specifies the region of the base texture that this texture uses
     *
     * @property frame
     * @type Rectangle
     */
    this.frame = frame;

    /**
     * The trim point
     *
     * @property trim
     * @type Rectangle
     */
    this.trim = null;

    this.scope = this;

    this._uvs = null;

    if(baseTexture.hasLoaded)
    {
        if(this.noFrame)frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);

        this.setFrame(frame);
    }
    else
    {
        var scope = this;
        baseTexture.addEventListener('loaded', function(){ scope.onBaseTextureLoaded(); });
    }
};

PIXI.Texture.prototype.constructor = PIXI.Texture;

/**
 * Called when the base texture is loaded
 *
 * @method onBaseTextureLoaded
 * @param event
 * @private
 */
PIXI.Texture.prototype.onBaseTextureLoaded = function()
{
    var baseTexture = this.baseTexture;
    baseTexture.removeEventListener( 'loaded', this.onLoaded );

    if(this.noFrame)this.frame = new PIXI.Rectangle(0,0, baseTexture.width, baseTexture.height);

    this.setFrame(this.frame);

    this.scope.dispatchEvent( { type: 'update', content: this } );
};

/**
 * Destroys this texture
 *
 * @method destroy
 * @param destroyBase {Boolean} Whether to destroy the base texture as well
 */
PIXI.Texture.prototype.destroy = function(destroyBase)
{
    if(destroyBase) this.baseTexture.destroy();
};

/**
 * Specifies the rectangle region of the baseTexture
 *
 * @method setFrame
 * @param frame {Rectangle} The frame of the texture to set it to
 */
PIXI.Texture.prototype.setFrame = function(frame)
{
    this.frame = frame;
    this.width = frame.width;
    this.height = frame.height;

    if(frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)
    {
        throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);
    }

    this.updateFrame = true;

    PIXI.Texture.frameUpdates.push(this);

    //this.dispatchEvent( { type: 'update', content: this } );
};

PIXI.Texture.prototype._updateWebGLuvs = function()
{
    if(!this._uvs)this._uvs = new PIXI.TextureUvs();

    var frame = this.frame;
    var tw = this.baseTexture.width;
    var th = this.baseTexture.height;

    this._uvs.x0 = frame.x / tw;
    this._uvs.y0 = frame.y / th;

    this._uvs.x1 = (frame.x + frame.width) / tw;
    this._uvs.y1 = frame.y / th;

    this._uvs.x2 = (frame.x + frame.width) / tw;
    this._uvs.y2 = (frame.y + frame.height) / th;

    this._uvs.x3 = frame.x / tw;
    this._uvs.y3 = (frame.y + frame.height) / th;
};

/**
 * Helper function that returns a texture based on an image url
 * If the image is not in the texture cache it will be  created and loaded
 *
 * @static
 * @method fromImage
 * @param imageUrl {String} The image url of the texture
 * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
 * @return Texture
 */
PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
{
    var texture = PIXI.TextureCache[imageUrl];

    if(!texture)
    {
        texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode));
        PIXI.TextureCache[imageUrl] = texture;
    }

    return texture;
};

/**
 * Helper function that returns a texture based on a frame id
 * If the frame id is not in the texture cache an error will be thrown
 *
 * @static
 * @method fromFrame
 * @param frameId {String} The frame id of the texture
 * @return Texture
 */
PIXI.Texture.fromFrame = function(frameId)
{
    var texture = PIXI.TextureCache[frameId];
    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
    return texture;
};

/**
 * Helper function that returns a texture based on a canvas element
 * If the canvas is not in the texture cache it will be  created and loaded
 *
 * @static
 * @method fromCanvas
 * @param canvas {Canvas} The canvas element source of the texture
 * @return Texture
 */
PIXI.Texture.fromCanvas = function(canvas, scaleMode)
{
    var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);

    return new PIXI.Texture( baseTexture );

};

/**
 * Adds a texture to the textureCache.
 *
 * @static
 * @method addTextureToCache
 * @param texture {Texture}
 * @param id {String} the id that the texture will be stored against.
 */
PIXI.Texture.addTextureToCache = function(texture, id)
{
    PIXI.TextureCache[id] = texture;
};

/**
 * Remove a texture from the textureCache.
 *
 * @static
 * @method removeTextureFromCache
 * @param id {String} the id of the texture to be removed
 * @return {Texture} the texture that was removed
 */
PIXI.Texture.removeTextureFromCache = function(id)
{
    var texture = PIXI.TextureCache[id];
    delete PIXI.TextureCache[id];
    delete PIXI.BaseTextureCache[id];
    return texture;
};

// this is more for webGL.. it contains updated frames..
PIXI.Texture.frameUpdates = [];

PIXI.TextureUvs = function()
{
    this.x0 = 0;
    this.y0 = 0;

    this.x1 = 0;
    this.y1 = 0;

    this.x2 = 0;
    this.y2 = 0;

    this.x3 = 0;
    this.y4 = 0;

};


text:
//
// This code was auto-generated by AFNOR StoredProcedureSystem, version 1.0
//

using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace Bivi.Domaine
{
    public partial class TraductionCategorieDate
    {

        [DataMember]
        public long ID { get; set; }

        [DataMember]
        public virtual Site Site { get; set; }

        [DataMember]
        public long SiteID { get; set; }

        [DataMember]
        public virtual Langue Langue { get; set; }

        [DataMember]
        public long LangueID { get; set; }

        [DataMember]
		[StringLength(250)]
        public string Libelle { get; set; }

        [DataMember]
		[StringLength(250)]
        public string LibelleCourt { get; set; }

        [DataMember]
        public int Ordre { get; set; }

        [DataMember]
        public virtual CategorieDate CategorieDate { get; set; }

        [DataMember]
        public long CategorieDateID { get; set; }
    }
}


text:
namespace spvtools {
namespace ir {

void Function::ForEachInst(const std::function<void(Instruction*)>& f,
                           bool run_on_debug_line_insts) {
  if (def_inst_) def_inst_->ForEachInst(f, run_on_debug_line_insts);
  for (auto& param : params_) param->ForEachInst(f, run_on_debug_line_insts);
  for (auto& bb : blocks_) bb->ForEachInst(f, run_on_debug_line_insts);
  if (end_inst_) end_inst_->ForEachInst(f, run_on_debug_line_insts);
}

void Function::ForEachInst(const std::function<void(const Instruction*)>& f,
                           bool run_on_debug_line_insts) const {
  if (def_inst_)
    static_cast<const Instruction*>(def_inst_.get())
        ->ForEachInst(f, run_on_debug_line_insts);

  for (const auto& param : params_)
    static_cast<const Instruction*>(param.get())
        ->ForEachInst(f, run_on_debug_line_insts);

  for (const auto& bb : blocks_)
    static_cast<const BasicBlock*>(bb.get())
        ->ForEachInst(f, run_on_debug_line_insts);

  if (end_inst_)
    static_cast<const Instruction*>(end_inst_.get())
        ->ForEachInst(f, run_on_debug_line_insts);
}

void Function::ForEachParam(const std::function<void(const Instruction*)>& f,
                            bool run_on_debug_line_insts) const {
  for (const auto& param : params_)
    static_cast<const Instruction*>(param.get())
        ->ForEachInst(f, run_on_debug_line_insts);
}

}  // namespace ir
}  // namespace spvtools