text:
var imageCommon = require("./image-common");
var style = require("ui/styling/style");
var background = require("ui/styling/background");
var utils = require("utils/utils");
global.moduleMerge(imageCommon, exports);
var enums;
function ensureEnums() {
    if (!enums) {
        enums = require("ui/enums");
    }
}
function onStretchPropertyChanged(data) {
    var image = data.object;
    if (!image.android) {
        return;
    }
    ensureEnums();
    switch (data.newValue) {
        case enums.Stretch.aspectFit:
            image.android.setScaleType(android.widget.ImageView.ScaleType.FIT_CENTER);
            break;
        case enums.Stretch.aspectFill:
            image.android.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
            break;
        case enums.Stretch.fill:
            image.android.setScaleType(android.widget.ImageView.ScaleType.FIT_XY);
            break;
        case enums.Stretch.none:
        default:
            image.android.setScaleType(android.widget.ImageView.ScaleType.MATRIX);
            break;
    }
}
function onImageSourcePropertyChanged(data) {
    var image = data.object;
    if (!image.android) {
        return;
    }
    image._setNativeImage(data.newValue ? data.newValue.android : null);
}
imageCommon.Image.imageSourceProperty.metadata.onSetNativeValue = onImageSourcePropertyChanged;
imageCommon.Image.stretchProperty.metadata.onSetNativeValue = onStretchPropertyChanged;
var Image = (function (_super) {
    __extends(Image, _super);
    function Image() {
        _super.apply(this, arguments);
    }
    Object.defineProperty(Image.prototype, "android", {
        get: function () {
            return this._android;
        },
        enumerable: true,
        configurable: true
    });
    Image.prototype._createUI = function () {
        this._android = new org.nativescript.widgets.ImageView(this._context);
    };
    Image.prototype._setNativeImage = function (nativeImage) {
        this.android.setImageBitmap(nativeImage);
    };
    return Image;
}(imageCommon.Image));
exports.Image = Image;
var ImageStyler = (function () {
    function ImageStyler() {
    }
    ImageStyler.setBorderRadiusProperty = function (v, newValue, defaultValue) {
        if (!v._nativeView) {
            return;
        }
        var val = Math.round(newValue * utils.layout.getDisplayDensity());
        v._nativeView.setCornerRadius(val);
        background.ad.onBackgroundOrBorderPropertyChanged(v);
    };
    ImageStyler.resetBorderRadiusProperty = function (v, nativeValue) {
        if (!v._nativeView) {
            return;
        }
        v._nativeView.setCornerRadius(0);
        background.ad.onBackgroundOrBorderPropertyChanged(v);
    };
    ImageStyler.setBorderWidthProperty = function (v, newValue, defaultValue) {
        if (!v._nativeView) {
            return;
        }
        var val = Math.round(newValue * utils.layout.getDisplayDensity());
        v._nativeView.setBorderWidth(val);
        background.ad.onBackgroundOrBorderPropertyChanged(v);
    };
    ImageStyler.resetBorderWidthProperty = function (v, nativeValue) {
        if (!v._nativeView) {
            return;
        }
        v._nativeView.setBorderWidth(0);
        background.ad.onBackgroundOrBorderPropertyChanged(v);
    };
    ImageStyler.registerHandlers = function () {
        style.registerHandler(style.borderRadiusProperty, new style.StylePropertyChangedHandler(ImageStyler.setBorderRadiusProperty, ImageStyler.resetBorderRadiusProperty), "Image");
        style.registerHandler(style.borderWidthProperty, new style.StylePropertyChangedHandler(ImageStyler.setBorderWidthProperty, ImageStyler.resetBorderWidthProperty), "Image");
    };
    return ImageStyler;
}());
exports.ImageStyler = ImageStyler;
ImageStyler.registerHandlers();
//# sourceMappingURL=image.android.js.map


text:
package edu.autonomic.beta.controller.smartVehicleBehavior;

/**
* @author Edith Zavala
*/

public interface ISensor {
	public Object getValue(String var);
}

redpajama_set_name: RedPajamaGithub


text:
package com.alachisoft.sample.hibernate.factory;

public class OrderDetailsFactory
{
}


text:
if(DRACO_CMAKE_TOOLCHAINS_X86_ANDROID_NDK_LIBCPP_CMAKE_)
  return()
endif()
set(DRACO_CMAKE_TOOLCHAINS_X86_ANDROID_NDK_LIBCPP_CMAKE_ 1)

include("${CMAKE_CURRENT_LIST_DIR}/android-ndk-common.cmake")

if(NOT ANDROID_PLATFORM)
  set(ANDROID_PLATFORM android-18)
endif()

if(NOT ANDROID_ABI)
  set(ANDROID_ABI x86)
endif()

include("${DRACO_ANDROID_NDK_PATH}/build/cmake/android.toolchain.cmake")


text:
package com.viewsforandroid.randomuserforandroid.core.binder;

public interface RandomUserBinder {
}


text:
package base

import (
	"github.com/andreaskoch/dotman/modules"
	"github.com/andreaskoch/dotman/ui"
	"regexp"
	"strings"
)

type ForEachModuleFunc func(module *modules.Module, executeADryRunOnly bool)

type ModulesProviderFunc func() *modules.Collection

type Action struct {
	name                     string
	description              string
	moduleCollectionProvider ModulesProviderFunc
	forEachModule            ForEachModuleFunc
}

func New(name, description string, moduleCollectionProvider ModulesProviderFunc, forEachModule ForEachModuleFunc) *Action {
	return &Action{
		name:                     name,
		description:              description,
		moduleCollectionProvider: moduleCollectionProvider,
		forEachModule:            forEachModule,
	}
}

func (action *Action) Name() string {
	return action.name
}

func (action *Action) Description() string {
	return action.description
}

func (action *Action) Execute(arguments []string) {
	action.execute(false, arguments)
}

func (action *Action) DryRun(arguments []string) {
	action.execute(true, arguments)
}

func (action *Action) execute(executeADryRunOnly bool, arguments []string) {

	// extract the module filter from the arguments
	moduleFilter := regexp.MustCompile(`.*`)
	if len(arguments) > 0 && strings.TrimSpace(arguments[0]) != "" {

		// get the custom module filter from the command arguments
		moduleFilterText := strings.TrimSpace(arguments[0])

		// try to compile the filter
		customModuleFilter, err := regexp.Compile(moduleFilterText)
		if err != nil {
			ui.Fatal("%q is not a valid module filter. Error: %s", moduleFilterText, err.Error())
		}

		// assign the supplied custom filter
		moduleFilter = customModuleFilter
	}

	modules := action.moduleCollectionProvider()
	for _, module := range modules.Collection {

		// skip modules which don't match the filter
		if !moduleFilter.MatchString(module.String()) {
			continue
		}

		action.forEachModule(module, executeADryRunOnly)
	}

}


text:
export enum DirectionalHint {
  topLeftEdge,
  topCenter,
  topRightEdge,
  topAutoEdge,
  bottomLeftEdge,
  bottomCenter,
  bottomRightEdge,
  bottomAutoEdge,
  leftTopEdge,
  leftCenter,
  leftBottomEdge,
  rightTopEdge,
  rightCenter,
  rightBottomEdge
}


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

namespace BadMishka.DocumentFormat.LuceneIndex.Tests
{
    public class StopWatch
    {
        private DateTime start;
        private DateTime snapshot;

        public void Start()
        {
            var now = DateTime.UtcNow;
            this.start = now;
            this.snapshot = now;
        }

        public void CaptureInterval(string message)
        {
            var end = DateTime.UtcNow;
            var diff = end.Ticks - snapshot.Ticks;
            Console.WriteLine($"{message} took { diff } milliseconds.");

            this.StartInterval();
        }

        public void StartInterval()
        {
            this.snapshot = DateTime.UtcNow;
        }

        public void Stop(string message)
        {
            var end = DateTime.UtcNow;
            var diff = end.Ticks - start.Ticks;
            Console.WriteLine($"{message} took a total of { diff } milliseconds.");
        }
    }
}


text:
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Netprav extends Mycontroller {

	public $template = 'basic';

	public function action_index()
	{

		$this->template->content = View::factory('netpravview');
	}

} // End Welcome


text:
package com.koch.ambeth.audit;

import com.koch.ambeth.merge.proxy.PersistenceContext;
import com.koch.ambeth.security.audit.model.Audited;
import com.koch.ambeth.security.audit.model.AuditedArg;

@Audited(false)
@PersistenceContext
public class TestAuditService implements ITestAuditService {
	@Audited
	@Override
	public String auditedServiceCall(Integer myArg) {
		return myArg.toString();
	}

	@Audited(false)
	@Override
	public String auditedAnnotatedServiceCall_NoAudit(Integer myArg) {
		return myArg.toString();
	}

	@Override
	public String notAuditedServiceCall(Integer myArg) {
		return myArg.toString();
	}

	@Audited
	@Override
	public String auditedServiceCallWithAuditedArgument(@AuditedArg Integer myAuditedArg,
			@AuditedArg(false) String myNotAuditedPassword) {
		return myAuditedArg.toString();
	}
}


text:
typedef struct {
  uint16_t window_width;
  uint16_t window_height;
  char* window_title;
} MVEconfig;

MVEconfig* mveInitConfig(const char* filename);

#endif  // CONFIG_H_


text:
<?php

namespace Supinfo\WebBundle\Repository;

/**
 * SubFamilyFieldRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SubFamilyFieldRepository extends EntityRepository
{

    public function createSubFamilyFieldValues(\Supinfo\WebBundle\Entity\SubFamilyField $subFamilyField)
    {
        foreach ($subFamilyField->getSubFamily()->getArticles() as $article) {
            foreach ($article->getFieldValues() as $fieldValue) {
                foreach ($subFamilyField->getFieldValues() as $fieldValue) {
                    if ($fieldValue->getSubFamilyField() == $subFamilyField) {
                        break 2;
                    }
                }
            }

            $options = array(
                'article' => $article,
                'subFamilyField' => $subFamilyField,
            );
            $newFieldValue = new \Supinfo\WebBundle\Entity\SubFamilyFieldValue($options);

            $subFamilyField->getFieldValues()->add($newFieldValue);
        }

        $this->getEntityManager()->flush();
    }

}


text:
package networking;

import android.util.Log;

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class ConnectionHandler {

    private static final String baseURL = "http://raok.stevex86.com/";
    private static final String phoneURL = baseURL + "phone";
    private static final String msgURL = baseURL + "msg_to";
    private static final String donateURL = baseURL + "donate";
    private static final String mailURL = baseURL + "mail";
    private static final String registerURL = baseURL + "register";
    private static final String checkUserStats = baseURL + "user_click_data";

    private static HttpURLConnection buildGetRequest(String url, HashMap<String, String> params) throws IOException {
        int count = 0;
        StringBuilder urlParametersBuilder = new StringBuilder();

        for (Map.Entry<String, String> entry : params.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            if (count > 0) {
                urlParametersBuilder.append("&");
            }
            urlParametersBuilder.append(key).append("=").append(value);
            count++;
        }

        url = url + urlParametersBuilder.toString();
        URL requestURL = new URL(url);
        HttpURLConnection connection = (HttpURLConnection) requestURL.openConnection();
        connection.setDoInput(true);
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        connection.setRequestProperty("charset", "utf-8");
        connection.setUseCaches(false);

        return connection;
    }

    private static HttpURLConnection buildPostRequest(String url, String content) throws IOException {
        URL requestURL = new URL(url);
        HttpURLConnection connection = (HttpURLConnection) requestURL.openConnection();
        connection.setDoInput(true);
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Content-Type", "application/json");
        connection.setRequestProperty("charset", "utf-8");

        connection.setRequestProperty("Content-Length", "" + content.getBytes().length);
        connection.setUseCaches (false);
        OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
        writer.write(content);
        writer.flush();
        writer.close();

        return connection;
    }

    private static String buildResponse(HttpURLConnection connection) throws IOException {
        int responseCode = connection.getResponseCode();
        if (responseCode == 200 || responseCode == 201 || responseCode >= 400) {
            BufferedReader in;
            if (responseCode >= 400) {
                in = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
            }
            else {
                in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            }
            String inputLine;
            StringBuilder response = new StringBuilder();
            response.append(responseCode);
            response.append(":");

            while((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();
            Log.d("ConnectionHandler", response.toString());
            return response.toString();
        }
        else {
            throw new IOException("Received bad response from server.");
        }
    }

    public static String addMinutes(String id, int seconds) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);
        jsonObject.put("call-time", seconds);

        HttpURLConnection connection = buildPostRequest(phoneURL, jsonObject.toString());
        return buildResponse(connection);
    }

    public static String incrementMsg(String id) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);

        HttpURLConnection connection = buildPostRequest(msgURL, jsonObject.toString());
        return buildResponse(connection);
    }

    public static String addDonation(String id, int amount) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);
        jsonObject.put("donated", amount);

        HttpURLConnection connection = buildPostRequest(donateURL, jsonObject.toString());
        return buildResponse(connection);
    }

    public static String incrementCard(String id) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);

        HttpURLConnection connection = buildPostRequest(mailURL, jsonObject.toString());
        return buildResponse(connection);
    }

    public static String register(String guid) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("guid", guid);

        HttpURLConnection connection = buildPostRequest(registerURL, jsonObject.toString());
        return buildResponse(connection);
    }

    public static String getUserStats(String id) throws IOException, JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", id);

        HttpURLConnection connection = buildPostRequest(checkUserStats, jsonObject.toString());
        return buildResponse(connection);
    }

}


text:
import React from 'react';
import ReactDom from 'react-dom';

import { Provider } from 'react-redux';
import { Router, Route, Link, IndexRoute } from 'react-router';

import { configureStore } from './store/configureStore';
import App from './containers/App';

import NoMatch from './components/NoMatch';
import Welcome from './containers/Welcome';

import ZuoYeRenPage from './containers/ZuoYeRenPage';

const store = configureStore();
ReactDom.render(
  <Provider store={store}>
    <ZuoYeRenPage />
  </Provider>,
  document.getElementById('root')
);


text:
<!DOCTYPE html>

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

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Toggle navigation

            </button>
            Fiscopoly

            <svg id="board" width="768" height="768">
                <field ng-repeat="field in fieldsExceptCorners | filter: {orientation: 'S'}" field="field"></field>
                <field-west ng-repeat="field in fieldsExceptCorners | filter: {orientation: 'W'}"
                            field="field"></field-west>
                <field ng-repeat="field in fieldsExceptCorners | filter: {orientation: 'N'}" field="field"></field>
                <field-east ng-repeat="field in fieldsExceptCorners | filter: {orientation: 'E'}"
                            field="field"></field-east>
                <corner ng-repeat="field in fields | filter: {type: 'corner'}" field="field"></corner>
                <player ng-repeat="player in players" player="player"></player>
            </svg>

Spieler

                    Farbe
                    Name
                    Manntage
                    Feld

                    {{player.name}}
                    {{player.money | number}} MT
                    {{player.fieldNumber}}

                <button type="button" class="btn btn-default" ng-click="rollDiceAndMove()">Würfeln</button>
                Würfel: {{lastDices.die1}}+{{lastDices.die2}}={{lastDices.die1 + lastDices.die2}}


text:
package com.mypurecloud.sdk.v2;

public enum DetailLevel {
    NONE,
    MINIMAL,
    HEADERS,
    FULL
}


text:
<?php

class BaseZF_Service_CornerGenerator_Exception extends BaseZF_Exception
{

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
	default-lazy-init="false">

	<bean id="statMbeanServer" class="com.alibaba.druid.support.spring.MBeanServerFactoryBean" />

	<bean id="statManager" class="com.alibaba.druid.stat.JdbcStatManagerFactoryBean" />

	<bean id="statExporter" class="org.springframework.jmx.export.MBeanExporter"
		lazy-init="false">
		<property name="beans">
			<map>
				<entry key="com.alibaba.druid:type=JdbcStatManager"
					value-ref="statManager" />
			</map>
		</property>
		<property name="server" ref="statMbeanServer" />
	</bean>
</beans>


text:
package org.apache.commons.math4.legacy.ml.distance;

import org.junit.Assert;
import org.junit.Test;

/**
 * Tests for {@link ManhattanDistance} class.
 */
public class ManhattanDistanceTest {
    private final DistanceMeasure distance = new ManhattanDistance();

    @Test
    public void testZero() {
        final double[] a = { 0, 1, -2, 3.4, 5, -6.7, 89 };
        Assert.assertEquals(0, distance.compute(a, a), 0d);
    }

    @Test
    public void test() {
        final double[] a = { 1, -2, 3, 4 };
        final double[] b = { -5, -6, 7, 8 };
        final double expected = 18;
        Assert.assertEquals(expected, distance.compute(a, b), 0d);
        Assert.assertEquals(expected, distance.compute(b, a), 0d);
    }
}


text:
<?php

/**
 * The class abstracts CI's Encryption class.
 *
 * @package     Nails
 * @subpackage  common
 * @category    Library
 * @author      Nails Dev Team
 * @link
 */

namespace Nails\Common\Service;

use Defuse\Crypto\Crypto;
use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
use Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException;
use Nails\Common\Exception\Encrypt\DecodeException;
use Nails\Common\Exception\EnvironmentException;
use Nails\Factory;

class Encrypt
{
    /**
     * Encodes a given value using the supplied key
     *
     * @param mixed  $mValue The value to encode
     * @param string $sSalt  The salt to add to the key
     *
     * @return string
     * @throws EnvironmentException
     */
    public static function encode($mValue, $sSalt = '')
    {
        try {
            return Crypto::encryptWithPassword(
                $mValue,
                static::getKey($sSalt)
            );
        } catch (EnvironmentIsBrokenException $e) {
            throw new EnvironmentException(
                $e->getMessage(),
                $e->getCode()
            );
        }
    }

    // --------------------------------------------------------------------------

    /**
     * Decodes a given value using the supplied key
     *
     * @param mixed  $sCipher The value to decode
     * @param string $sSalt   The salt to add to the key
     *
     * @return string
     * @throws DecodeException
     * @throws EnvironmentException
     */
    public static function decode($sCipher, $sSalt = '')
    {
        try {
            return Crypto::decryptWithPassword(
                $sCipher,
                static::getKey($sSalt)
            );
        } catch (EnvironmentIsBrokenException $e) {
            throw new EnvironmentException(
                $e->getMessage(),
                $e->getCode()
            );
        } catch (WrongKeyOrModifiedCiphertextException $e) {
            throw new DecodeException(
                $e->getMessage(),
                $e->getCode()
            );
        }
    }

    // --------------------------------------------------------------------------

    /**
     * Returns the key to use, salted
     *
     * @param string $sSalt The salt to add to the key
     *
     * @return string
     */
    public static function getKey($sSalt = '')
    {
        return \Nails\Config::get('APP_PRIVATE_KEY') . $sSalt;
    }

    // --------------------------------------------------------------------------

    /**
     * Migrates a cipher from CI encrypt library, to Defuse\Crypto library
     *
     * @param string $sCipher  The cipher to migrate
     * @param string $sOldKey  The key used to encode originally
     * @param string $sNewSalt The salt to add to the new key
     *
     * @return string
     */
    public static function migrate($sCipher, $sOldKey, $sNewSalt = '')
    {
        require_once NAILS_CI_SYSTEM_PATH . 'libraries/Encrypt.php';

        $oEncryptCi = new \CI_Encrypt();
        $oEncrypt   = Factory::service('Encrypt');

        return $oEncrypt::encode(
            $oEncryptCi->decode(
                $sCipher,
                $sOldKey
            ),
            $sNewSalt
        );
    }
}


text: <pagination class="pagination-three" total-items="totalItems" ng-model="currentPage"></pagination>


text:
import socket

from core.actionModule import actionModule
from core.keystore import KeyStore as kb

class scan_gethostname(actionModule):
    def __init__(self, config, display, lock):
        super(scan_gethostname, self).__init__(config, display, lock)
        self.title = "Determine the hostname for each IP"
        self.shortName = "GetHostname"
        self.description = "execute [gethostbyaddr(ip)] on each target"

        self.requirements = []
        self.triggers = ["newIP"]

        self.safeLevel = 5

    def getTargets(self):
        #get all hosts
        self.targets = kb.get('host')

    def process(self):
        # load any targets we are interested in
        self.getTargets()

        # loop over each target
        for t in self.targets:
            # verify we have not tested this host before
            if not self.seentarget(t):
                # add the new IP to the already seen list
                self.addseentarget(t)
                self.display.verbose(self.shortName + " - Connecting to " + t)
                try:
                    results = socket.gethostbyaddr(t)
                    self.fire("newHostname")
                    kb.add('host/' + t + '/hostname/' + results[0])
                except:
                    pass

        return


text:
package org.dizon.lcfrmobile;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.dizon.LCFRCAD.CADData;

import com.google.gson.*;

import android.os.AsyncTask;

public class HttpTeste extends AsyncTask<String, Integer, String> {

	@Override
	protected String doInBackground(String... urls) {
		int count = urls.length;
		if(count!=1)
		{
			//bad stuff happens
		}
		long epoch=System.currentTimeMillis();
		urls[0]+=String.valueOf(epoch);
		HttpClient client = new DefaultHttpClient();
		HttpGet request = new HttpGet(urls[0]);
		HttpResponse response = null;
		try {
			response = client.execute(request);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}

		// Get the response
		BufferedReader rd = null;
		try {
			rd = new BufferedReader
			  (new InputStreamReader(response.getEntity().getContent()));
		} catch (IllegalStateException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		StringBuilder sb = new StringBuilder();
		String line = "";
		try {
			while ((line = rd.readLine()) != null) {
			  sb.append(line);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		String cadstring = sb.toString();
		Gson gson = new Gson();
		CADData cad = gson.fromJson(cadstring, CADData.class);
		return null;
	}

}


text:
package com.github.twitch4j.graphql.command;

import com.apollographql.apollo.ApolloCall;
import com.apollographql.apollo.ApolloClient;
import com.github.twitch4j.graphql.internal.CancelPredictionEventMutation;
import com.github.twitch4j.graphql.internal.type.CancelPredictionEventInput;
import lombok.NonNull;

public class CommandCancelPrediction extends BaseCommand<CancelPredictionEventMutation.Data> {
    private final String predictionEventId;

    /**
     * Constructor
     *
     * @param apolloClient      Apollo Client
     * @param predictionEventId The id of the prediction to be cancelled
     */
    public CommandCancelPrediction(@NonNull ApolloClient apolloClient, @NonNull String predictionEventId) {
        super(apolloClient);
        this.predictionEventId = predictionEventId;
    }

    @Override
    protected ApolloCall<CancelPredictionEventMutation.Data> getGraphQLCall() {
        return apolloClient.mutate(
            CancelPredictionEventMutation.builder()
                .input(CancelPredictionEventInput.builder().id(predictionEventId).build())
                .build()
        );
    }
}


text:
'use strict';
var rfr = require('rfr');
var lib = rfr('lib');
var Roles = rfr('lib/services/roles');

// Lambda Handler
module.exports.handler = function(event, context) {
  lib.respond(event, context, Roles.List, __dirname);
};


text: export RHOS_RELEASE=${RHOS_RELEASE:-5}


text:
#include "Logging.h"

#ifndef ANDROID
#include <iostream>
#endif

namespace logging {

std::atomic<Level> MinLevel = Level::Debug;

const char* LevelToString(Level level)
{
    static_assert((int)Level::Count == 5, "Update this switch");
    switch (level)
    {
    case Level::Trace: return "Trace";
    case Level::Debug: return "Debug";
    case Level::Info: return "Info";
    case Level::Warning: return "Warning";
    case Level::Error: return "Error";
    default: break;
    }
    DEBUG_BREAK;
    return "Unknown";
}

char LevelToChar(Level level)
{
    static_assert((int)Level::Count == 5, "Update this switch");
    switch (level)
    {
    case Level::Trace: return 't';
    case Level::Debug: return 'd';
    case Level::Info: return 'I';
    case Level::Warning: return 'W';
    case Level::Error: return '!';
    default: break;
    }
    DEBUG_BREAK;
    return '?';
}

OutputWorker& OutputWorker::GetInstance()
{
    static OutputWorker worker;
    return worker;
}

extern "C" void AtExitWrapper()
{
    OutputWorker::GetInstance().Stop();
}

OutputWorker::OutputWorker()
{
    Terminated = true;

    Start();

    std::atexit(AtExitWrapper);
}

void OutputWorker::Start()
{
    Stop();

    QueuePublic.clear();
    QueuePrivate.clear();
    Overrun = 0;
    Terminated = false;
    Thread = std::make_unique<std::thread>(&OutputWorker::Loop, this);
}

void OutputWorker::Stop()
{
    if (Thread)
    {
        Terminated = true;
        Condition.notify_all();

        try
        {
            Thread->join();
        }
        catch (std::system_error& /*err*/)
        {
        }
    }
    Thread = nullptr;
}

void OutputWorker::Write(LogStringBuffer& buffer)
{
    std::string str = buffer.LogStream.str();

    {
        std::lock_guard<std::mutex> locker(QueueLock);
        if (static_cast<int>(QueuePublic.size()) >= WorkQueueLimit)
            Overrun++;
        else
            QueuePublic.emplace_back(buffer.LogLevel, buffer.ChannelName, str);
    }

    Condition.notify_all();
}

void OutputWorker::Loop()
{
    while (!Terminated)
    {
        int overrun;
        {
            std::unique_lock<std::mutex> locker(QueueLock);
            Condition.wait(locker);

            std::swap(QueuePublic, QueuePrivate);
            overrun = Overrun;
        }

        for (auto& log : QueuePrivate)
        {
            Log(log);
        }

        QueuePrivate.clear();
    }
}

void OutputWorker::Log(QueuedMessage& message)
{
    std::stringstream ss;
    ss << '{' << LevelToChar(message.LogLevel) << '-' << message.ChannelName << "} " << message.Message;

#ifdef ANDROID
    std::string fmtstr = ss.str();
    __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "%s", fmtstr.c_str());
#else
    ss << std::endl;
    std::string fmtstr = ss.str();
    std::cout << fmtstr;
    #ifdef _WIN32
        ::OutputDebugStringA(fmtstr.c_str());
    #endif
#endif
}

Channel::Channel(const char* name)
{
    ChannelName = name;
}

std::string Channel::GetPrefix() const
{
    Locker locker(PrefixLock);
    return Prefix;
}

void Channel::SetPrefix(const std::string& prefix)
{
    Locker locker(PrefixLock);
    Prefix = prefix;
}

} // namespace logging


text:
#include "sociplusmodelcell.h"
#include "sociplusmodel.h"

namespace SociPlus
{
    SociPlusModelCell::SociPlusModelCell(SociPlusModelRow *parent)
    {
        //ctor
        m_parent = parent;
        m_data = "";
        m_origData = "";
        m_firstData = true;
    }

    SociPlusModelCell::~SociPlusModelCell()
    {
        //dtor
        Clear();
    }

    bool SociPlusModelCell::AddModel(SociPlusModel *model)
    {
        m_models.push_back(model);
        model->SetParent(this);
        return true;
    }

    void SociPlusModelCell::SetData(string data)
    {
        m_data = data;
        if (m_firstData == true)
        {
            m_origData = m_data;
            m_firstData = false;
        }
    }

    string SociPlusModelCell::GetData()
    {
        return m_data;
    }

    string SociPlusModelCell::GetOrigData()
    {
        return m_origData;
    }

    void SociPlusModelCell::RestoreOrigData()
    {
        m_data = m_origData;
    }

    bool SociPlusModelCell::DataChanged()
    {
        if (m_data != m_origData)
            return true;

        return false;
    }

    SociPlusModel *SociPlusModelCell::GetModelAt(int pos)
    {
        return m_models.at(pos);
    }

    SociPlusModel *SociPlusModelCell::DetachModelAt(int pos)
    {
        SociPlusModel *model = m_models.at(pos);
        m_models.erase(m_models.begin() + pos);
        model->SetParent(0);

        return model;
    }

    int SociPlusModelCell::GetModelCount()
    {
        return m_models.size();
    }

    void SociPlusModelCell::Clear()
    {
        while (!m_models.empty())
        {
            SociPlusModel *lastModel = m_models.back();

            if (lastModel != 0)
            {
                delete lastModel;
            }

            lastModel = 0;
            m_models.pop_back();
        }
    }

    int SociPlusModelCell::FindModelPos(SociPlusModel* model)
    {
        for (size_t x = 0; x < m_models.size(); x++)
        {
            if (model == m_models.at(x))
            {
                return x;
            }
        }

        return -1;
    }
}


text:
"use strict";

var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var env = process.env.NODE_ENV || 'development';
var config = require(path.join(__dirname, '../config'));
var connectionString = config.db.connectionString[env];
var sequelize = new Sequelize(connectionString, {logging: false});
var db = {};

fs
  .readdirSync(__dirname)
  .filter(function(file) {
  	return (file.indexOf('.') !== 0) && (file !== 'index.js') && (file !== 'scripts') && file !== ('task-pg.js');
  })
  .forEach(function(file) {
  	var model = sequelize.import(path.join(__dirname, file));
  	db[model.name] = model;
  });

 Object.keys(db).forEach(function(modelName) {
 	if ('associate' in db[modelName]) {
 		db[modelName].associate(db);
 	}
 });

db.sequelize = sequelize;
db.Sequelize = Sequelize;

module.exports = db;


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

    <string name="app_name">Adaptable Layout</string>

</resources>


text:
//noinspection JSUnusedGlobalSymbols
var onRequest = function () {
    return {"name": "arduino","tags":['uno','rev2']};
};


text:
class O2Reply: public QTimer {
    Q_OBJECT

public:
    O2Reply(QNetworkReply *reply, int timeOut = 60 * 1000, QObject *parent = 0);

signals:
    void error(QNetworkReply::NetworkError);

public slots:
    /// When time out occurs, the QNetworkReply's error() signal is triggered.
    void onTimeOut();

public:
    QNetworkReply *reply;
};

/// List of O2Replies.
class O2ReplyList {
public:
    /// Destructor.
    /// Deletes all O2Reply instances in the list.
    virtual ~O2ReplyList();

    /// Create a new O2Reply from a QNetworkReply, and add it to this list.
    void add(QNetworkReply *reply);

    /// Add an O2Reply to the list, while taking ownership of it.
    void add(O2Reply *reply);

    /// Remove item from the list that corresponds to a QNetworkReply.
    void remove(QNetworkReply *reply);

    /// Find an O2Reply in the list, corresponding to a QNetworkReply.
    /// @return Matching O2Reply or NULL.
    O2Reply *find(QNetworkReply *reply);

protected:
    QList<O2Reply *> replies_;
};

#endif // O2TIMEDREPLYLIST_H


text:
package org.stellasql.stella.query;

public class Token
{
  public Location loc = null;
  public Object tokenType = null;
  public String text = null;

  public Token(Location loc, Object tokenType, String text)
  {
    this.loc = loc;
    this.tokenType = tokenType;
    this.text = text;
  }

  @Override
  public String toString()
  {
    return loc + " " + tokenType + " '" + text + "'";
  }

  public boolean isKeyword()
  {
    return tokenType == TokenScanner.KEYWORD;
  }

  public boolean isComment()
  {
    return (tokenType == TokenScanner.BLOCKCOMMENT || tokenType == TokenScanner.LINECOMMENT);
  }

  public boolean isWhitespace()
  {
    return (tokenType == TokenScanner.WHITESPACE);
  }
}


text:
layout: page
weight: 0
title: Joomla
navigation:
  show: true
---

Joomla supports sending email over SMTP. To have Joomla relay email through SendGrid go to *Site \> Global Configuration* and change:

-   **SMTP Auth** - Yes
-   **SMTP User** - sendgrid_username
-   **SMTP Pass** - sendgrid_password
-   **SMTP Host** - smtp.sendgrid.net


text:
import gulp from 'gulp'
import rs from 'run-sequence'

let runProduction = ( cb ) => {
    rs(
        ['clean', 'svgstore'],
        ['copy-imagemin', 'copy-fonts', 'html', 'styles', 'browserify', 'credits'],
        cb
    )
}

gulp.task('production', runProduction)


text:
<?php
Class Adv_model extends MY_Model
{
    var $table = 'adv';

    function get_adv_by_position($position){
        $this->db->where('position',$position);
        $this->db->order_by('orderNo','DESC');
        $query = $this->db->get($this->table);
        if($query->result())
        {
            return $query->result();
        }else{
            return FALSE;
        }
    }
}


text:
from src.Main_ import Main
from src.ImageCropper_ import ImageCropper
import argparse

def create_model():
	parser = argparse.ArgumentParser()
	parser.add_argument("Model_Name", help="What would you"
			+ "like your model to be called")
	args = parser.parse_args()

	Main.create_model(args.Model_Name)
	return

def crop():
	parser = argparse.ArgumentParser()
	parser.add_argument("Source_Folder", help="The path to the folder"
			+ " you want cropped")
	parser.add_argument("Destination", help="The path to destination location")
	args = parser.parse_args()
	ImageCropper.crop_all_images(args.Source_Folder, args.Destination)
	return

def predict():
	parser = argparse.ArgumentParser()
	parser.add_argument("Set_Name", help="The name of the set of wells to predict")
	parser.add_argument("Model_Name", help="The name of the neural network to use")
	args = parser.parse_args()
	Main.predict(args.Set_Name, args.Model_Name)
	return

def test_individual():
	parser = argparse.ArgumentParser()
	parser.add_argument("Set_Name", help="The name of the test set")
	parser.add_argument("Model_Name", help="The name of the neural network to use")
	args = parser.parse_args()
	Main.test_individual(args.Set_Name, args.Model_Name)
	return

def test_wells():
	parser = argparse.ArgumentParser()
	parser.add_argument("Set_Name", help="The name of the test set")
	parser.add_argument("Model_Name", help="The name of the neural network to use")
	args = parser.parse_args()
	Main.test_wells(args.Set_Name, args.Model_Name)
	return

def train():
	parser = argparse.ArgumentParser()
	parser.add_argument("Training_Set", help="The name of the training set"
			+ " that you want to train on")
	parser.add_argument("Model_Name", help="The model you want to train")
	parser.add_argument("Epochs", help="The number of epochs you want to train on",
			type=int)
	args = parser.parse_args()
	Main.train(args.Training_Set, args.Model_Name, args.Epochs)
	return


text:
package com.javarush.task.task15.task1525;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/*
Файл в статическом блоке
*/

public class Solution {
    public static List<String> lines = new ArrayList<String>();

    public static void main(String[] args) {
        System.out.println(lines);
    }
}


text:
require 'spec_helper'

describe RedboothRuby::Person, vcr: 'person' do
  include_context 'authentication'

  let(:create_params) do
    { project_id: 1,
      user_id: 3,
      role: 'participant' }
  end
  let(:endpoint_name) { 'people' }
  let(:new_person) { client.person(:create, create_params.merge(session: session)) }
  let(:person) do
    client.person(:show, id: 1)
  end

  describe '#initialize' do
    subject { person }

    it { expect(subject.id).to eql 1 }
    it { expect(subject.user_id).to eql 1 }
    it { expect(subject.role).to eql 'admin' }
  end

  describe '.show' do
    subject { person }

    it 'makes a new GET request using the correct API endpoint to receive a specific person' do
      expect(RedboothRuby).to receive(:request).with(:get, nil, "#{ endpoint_name }/1", {}, { session: session }).and_call_original
      subject
    end

    it { expect(subject.id).to eql 1 }
    it { expect(subject.user_id).to eql 1 }
    it { expect(subject.role).to eql 'admin' }
  end

  describe '.update' do
    subject { client.person(:update, id: 6, role: 'admin') }

    it 'makes a new PUT request using the correct API endpoint to receive a specific person' do
      expect(RedboothRuby).to receive(:request).with(:put, nil, "#{ endpoint_name }/6", { role: 'admin' }, { session: session }).and_call_original
      subject
    end

    it { expect(subject.role).to eql 'admin' }
    it { expect(subject.id).to eql 6 }
  end

  describe '.create' do
    subject { new_person }
    let(:response) { double(:response, data: {} )}

    it 'makes a new POST request using the correct API endpoint to create a specific person' do
      expect(RedboothRuby).to receive(:request).with(:post, nil, endpoint_name, create_params, { session: session }).and_return(response)
      subject
    end

    context 'integration' do
      after { client.person(:delete, id: subject.id) }

      it { expect(subject.user_id).to eql 3 }
    end
  end

  describe '.delete' do
    subject { client.person(:delete, id: new_person.id) }

    it 'makes a new DELETE request using the correct API endpoint to delete a specific person' do
      expect(RedboothRuby).to receive(:request).with(:delete, nil, "#{ endpoint_name }/#{ new_person.id }", {}, { session: session }).and_call_original
      subject
    end
  end

  describe '.index' do
    subject { client.person(:index) }

    it 'makes a new PUT request using the correct API endpoint to receive a specific person' do
      expect(RedboothRuby).to receive(:request).with(:get, nil, endpoint_name, {}, { session: session }).and_call_original
      subject
    end

    it { expect(subject.class).to eql RedboothRuby::Request::Collection }
  end
end


text:
class MQ
  class Queue
    include AMQP

    # Queues store and forward messages.  Queues can be configured in the server
    # or created at runtime.  Queues must be attached to at least one exchange
    # in order to receive messages from publishers.
    #
    # Like an Exchange, queue names starting with 'amq.' are reserved for
    # internal use. Attempts to create queue names in violation of this
    # reservation will raise MQ:Error (ACCESS_REFUSED).
    #
    # When a queue is created without a name, the server will generate a
    # unique name internally (not currently supported in this library).
    #
    # == Options
    # * :passive => true | false (default false)
    # If set, the server will not create the exchange if it does not
    # already exist. The client can use this to check whether an exchange
    # exists without modifying  the server state.
    #
    # * :durable => true | false (default false)
    # If set when creating a new queue, the queue will be marked as
    # durable.  Durable queues remain active when a server restarts.
    # Non-durable queues (transient queues) are purged if/when a
    # server restarts.  Note that durable queues do not necessarily
    # hold persistent messages, although it does not make sense to
    # send persistent messages to a transient queue (though it is
    # allowed).
    #
    # If the queue has already been declared, any redeclaration will
    # ignore this setting. A queue may only be declared durable the
    # first time when it is created.
    #
    # * :exclusive => true | false (default false)
    # Exclusive queues may only be consumed from by the current connection.
    # Setting the 'exclusive' flag always implies 'auto-delete'. Only a
    # single consumer is allowed to remove messages from this queue.
    #
    # The default is a shared queue. Multiple clients may consume messages
    # from this queue.
    #
    # Attempting to redeclare an already-declared queue as :exclusive => true
    # will raise MQ:Error.
    #
    # * :auto_delete = true | false (default false)
    # If set, the queue is deleted when all consumers have finished
    # using it. Last consumer can be cancelled either explicitly or because
    # its channel is closed. If there was no consumer ever on the queue, it
    # won't be deleted.
    #
    # The server waits for a short period of time before
    # determining the queue is unused to give time to the client code
    # to bind an exchange to it.
    #
    # If the queue has been previously declared, this option is ignored
    # on subsequent declarations.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def initialize mq, name, opts = {}
      @mq = mq
      @opts = opts
      @bindings ||= {}
      @mq.queues[@name = name] ||= self
      unless opts[:no_declare]
        @mq.callback{
          @mq.send Protocol::Queue::Declare.new({ :queue => name,
                                                  :nowait => true }.merge(opts))
        }
      end
    end
    attr_reader :name

    # This method binds a queue to an exchange.  Until a queue is
    # bound it will not receive any messages.  In a classic messaging
    # model, store-and-forward queues are bound to a dest exchange
    # and subscription queues are bound to a dest_wild exchange.
    #
    # A valid exchange name (or reference) must be passed as the first
    # parameter. Both of these are valid:
    #  exch = MQ.direct('foo exchange')
    #  queue = MQ.queue('bar queue')
    #  queue.bind('foo.exchange') # OR
    #  queue.bind(exch)
    #
    # It is not valid to call #bind without the +exchange+ parameter.
    #
    # It is unnecessary to call #bind when the exchange name and queue
    # name match exactly (for +direct+ and +fanout+ exchanges only).
    # There is an implicit bind which will deliver the messages from
    # the exchange to the queue.
    #
    # == Options
    # * :key => 'some string'
    # Specifies the routing key for the binding.  The routing key is
    # used for routing messages depending on the exchange configuration.
    # Not all exchanges use a routing key - refer to the specific
    # exchange documentation.  If the routing key is empty and the queue
    # name is empty, the routing key will be the current queue for the
    # channel, which is the last declared queue.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def bind exchange, opts = {}
      exchange = exchange.respond_to?(:name) ? exchange.name : exchange
      @bindings[exchange] = opts

      @mq.callback{
        @mq.send Protocol::Queue::Bind.new({ :queue => name,
                                             :exchange => exchange,
                                             :routing_key => opts[:key],
                                             :nowait => true }.merge(opts))
      }
      self
    end

    # Remove the binding between the queue and exchange. The queue will
    # not receive any more messages until it is bound to another
    # exchange.
    #
    # Due to the asynchronous nature of the protocol, it is possible for
    # "in flight" messages to be received after this call completes.
    # Those messages will be serviced by the last block used in a
    # #subscribe or #pop call.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def unbind exchange, opts = {}
      exchange = exchange.respond_to?(:name) ? exchange.name : exchange
      @bindings.delete exchange

      @mq.callback{
        @mq.send Protocol::Queue::Unbind.new({ :queue => name,
                                               :exchange => exchange,
                                               :routing_key => opts[:key],
                                               :nowait => true }.merge(opts))
      }
      self
    end

    # This method deletes a queue.  When a queue is deleted any pending
    # messages are sent to a dead-letter queue if this is defined in the
    # server configuration, and all consumers on the queue are cancelled.
    #
    # == Options
    # * :if_unused => true | false (default false)
    # If set, the server will only delete the queue if it has no
    # consumers. If the queue has consumers the server does does not
    # delete it but raises a channel exception instead.
    #
    # * :if_empty => true | false (default false)
    # If set, the server will only delete the queue if it has no
    # messages. If the queue is not empty the server raises a channel
    # exception.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def delete opts = {}
      @mq.callback{
        @mq.send Protocol::Queue::Delete.new({ :queue => name,
                                               :nowait => true }.merge(opts))
      }
      @mq.queues.delete @name
      nil
    end

    # Purge all messages from the queue.
    #
    def purge opts = {}
      @mq.callback{
        @mq.send Protocol::Queue::Purge.new({ :queue => name,
                                              :nowait => true }.merge(opts))
      }
      nil
    end

    # This method provides a direct access to the messages in a queue
    # using a synchronous dialogue that is designed for specific types of
    # application where synchronous functionality is more important than
    # performance.
    #
    # The provided block is passed a single message each time pop is called.
    #
    #  EM.run do
    #    exchange = MQ.direct("foo queue")
    #    EM.add_periodic_timer(1) do
    #      exchange.publish("random number #{rand(1000)}")
    #    end
    #
    #    # note that #bind is never called; it is implicit because
    #    # the exchange and queue names match
    #    queue = MQ.queue('foo queue')
    #    queue.pop { |body| puts "received payload [#{body}]" }
    #
    #    EM.add_periodic_timer(1) { queue.pop }
    #  end
    #
    # If the block takes 2 parameters, both the +header+ and the +body+ will
    # be passed in for processing. The header object is defined by
    # AMQP::Protocol::Header.
    #
    #  EM.run do
    #    exchange = MQ.direct("foo queue")
    #    EM.add_periodic_timer(1) do
    #      exchange.publish("random number #{rand(1000)}")
    #    end
    #
    #    queue = MQ.queue('foo queue')
    #    queue.pop do |header, body|
    #      p header
    #      puts "received payload [#{body}]"
    #    end
    #
    #    EM.add_periodic_timer(1) { queue.pop }
    #  end
    #
    # == Options
    # * :ack => true | false (default false)
    # If this field is set to false the server does not expect acknowledgments
    # for messages.  That is, when a message is delivered to the client
    # the server automatically and silently acknowledges it on behalf
    # of the client.  This functionality increases performance but at
    # the cost of reliability.  Messages can get lost if a client dies
    # before it can deliver them to the application.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def pop opts = {}, &blk
      if blk
        @on_pop = blk
        @on_pop_opts = opts
      end

      @mq.callback{
        @mq.get_queue{ |q|
          q.push(self)
          @mq.send Protocol::Basic::Get.new({ :queue => name,
                                              :consumer_tag => name,
                                              :no_ack => !opts[:ack],
                                              :nowait => true }.merge(opts))
        }
      }

      self
    end

    # Subscribes to asynchronous message delivery.
    #
    # The provided block is passed a single message each time the
    # exchange matches a message to this queue.
    #
    #  EM.run do
    #    exchange = MQ.direct("foo queue")
    #    EM.add_periodic_timer(1) do
    #      exchange.publish("random number #{rand(1000)}")
    #    end
    #
    #    queue = MQ.queue('foo queue')
    #    queue.subscribe { |body| puts "received payload [#{body}]" }
    #  end
    #
    # If the block takes 2 parameters, both the +header+ and the +body+ will
    # be passed in for processing. The header object is defined by
    # AMQP::Protocol::Header.
    #
    #  EM.run do
    #    exchange = MQ.direct("foo queue")
    #    EM.add_periodic_timer(1) do
    #      exchange.publish("random number #{rand(1000)}")
    #    end
    #
    #    # note that #bind is never called; it is implicit because
    #    # the exchange and queue names match
    #    queue = MQ.queue('foo queue')
    #    queue.subscribe do |header, body|
    #      p header
    #      puts "received payload [#{body}]"
    #    end
    #  end
    #
    # == Options
    # * :ack => true | false (default false)
    # If this field is set to false the server does not expect acknowledgments
    # for messages.  That is, when a message is delivered to the client
    # the server automatically and silently acknowledges it on behalf
    # of the client.  This functionality increases performance but at
    # the cost of reliability.  Messages can get lost if a client dies
    # before it can deliver them to the application.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    # * :confirm => proc (default nil)
    # If set, this proc will be called when the server confirms subscription
    # to the queue with a ConsumeOk message. Setting this option will
    # automatically set :nowait => false. This is required for the server
    # to send a confirmation.
    #
    def subscribe opts = {}, &blk
      @consumer_tag = "#{name}-#{Kernel.rand(999_999_999_999)}"
      @mq.consumers[@consumer_tag] = self

      raise Error, 'already subscribed to the queue' if subscribed?

      @on_msg = blk
      @on_msg_opts = opts
      opts[:nowait] = false if (@on_confirm_subscribe = opts[:confirm])

      @mq.callback{
        @mq.send Protocol::Basic::Consume.new({ :queue => name,
                                                :consumer_tag => @consumer_tag,
                                                :no_ack => !opts[:ack],
                                                :nowait => true }.merge(opts))
      }
      self
    end

    # Removes the subscription from the queue and cancels the consumer.
    # New messages will not be received by the queue. This call is similar
    # in result to calling #unbind.
    #
    # Due to the asynchronous nature of the protocol, it is possible for
    # "in flight" messages to be received after this call completes.
    # Those messages will be serviced by the last block used in a
    # #subscribe or #pop call.
    #
    # Additionally, if the queue was created with _autodelete_ set to
    # true, the server will delete the queue after its wait period
    # has expired unless the queue is bound to an active exchange.
    #
    # The method accepts a block which will be executed when the
    # unsubscription request is acknowledged as complete by the server.
    #
    # * :nowait => true | false (default true)
    # If set, the server will not respond to the method. The client should
    # not wait for a reply method.  If the server could not complete the
    # method it will raise a channel or connection exception.
    #
    def unsubscribe opts = {}, &blk
      @on_cancel = blk
      @mq.callback{
        @mq.send Protocol::Basic::Cancel.new({ :consumer_tag => @consumer_tag }.merge(opts))
      }
      self
    end

    def publish data, opts = {}
      exchange.publish(data, opts)
    end

    # Boolean check to see if the current queue has already been subscribed
    # to an exchange.
    #
    # Attempts to #subscribe multiple times to any exchange will raise an
    # Exception. Only a single block at a time can be associated with any
    # one queue for processing incoming messages.
    #
    def subscribed?
      !!@on_msg
    end

    # Passes the message to the block passed to pop or subscribe.
    #
    # Performs an arity check on the block's parameters. If arity == 1,
    # pass only the message body. If arity != 1, pass the headers and
    # the body to the block.
    #
    # See AMQP::Protocol::Header for the hash properties available from
    # the headers parameter. See #pop or #subscribe for a code example.
    #
    def receive headers, body
      headers = MQ::Header.new(@mq, headers)

      if cb = (@on_msg || @on_pop)
        cb.call *(cb.arity == 1 ? [body] : [headers, body])
      end
    end

    # Get the number of messages and consumers on a queue.
    #
    #  MQ.queue('name').status{ |num_messages, num_consumers|
    #   puts num_messages
    #  }
    #
    def status opts = {}, &blk
      @on_status = blk
      @mq.callback{
        @mq.send Protocol::Queue::Declare.new({ :queue => name,
                                                :passive => true }.merge(opts))
      }
      self
    end

    def receive_status declare_ok
      if @on_status
        m, c = declare_ok.message_count, declare_ok.consumer_count
        @on_status.call *(@on_status.arity == 1 ? [m] : [m, c])
        @on_status = nil
      end
    end

    def confirm_subscribe
      @on_confirm_subscribe.call if @on_confirm_subscribe
      @on_confirm_subscribe = nil
    end

    def cancelled
      @on_cancel.call if @on_cancel
      @on_cancel = @on_msg = nil
      @mq.consumers.delete @consumer_tag
      @consumer_tag = nil
    end

    def reset
      @deferred_status = nil
      initialize @mq, @name, @opts

      binds = @bindings
      @bindings = {}
      binds.each{|ex,opts| bind(ex, opts) }

      if blk = @on_msg
        @on_msg = nil
        subscribe @on_msg_opts, &blk
      end

      if @on_pop
        pop @on_pop_opts, &@on_pop
      end
    end

    private

    def exchange
      @exchange ||= Exchange.new(@mq, :direct, '', :key => name)
    end
  end
end


text:
namespace schema {

	namespace action_ {

		struct Title {
			struct _alias_t {
				static constexpr const char _literal[] ="title";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T title;
						T &operator()() { return title; }
						const T &operator()() const { return title; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::text, sqlpp::tag::require_insert>;
		};

		struct Apply_object {
			struct _alias_t {
				static constexpr const char _literal[] ="apply_object";
				using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
				template<typename T>
					struct _member_t {
						T apply_object;
						T &operator()() { return apply_object; }
						const T &operator()() const { return apply_object; }
					};
			};

			using _traits = ::sqlpp::make_traits<::sqlpp::boolean, sqlpp::tag::require_insert>;
		};
	}

	struct action : sqlpp::table_t<action,
				action_::Title,
				action_::Apply_object> {
		using _value_type = sqlpp::no_value_t;
		struct _alias_t {
			static constexpr const char _literal[] = "action";
			using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
			template<typename T>
				struct _member_t {
					T action;
					T &operator()() { return action; }
					const T &operator()() const { return action; }
				};
		};
	};
}

#endif


text:
function [ TangoPosesRGB_SS, TangoPosesRGB_AL, tangoTimesRGB ] = getRGBPoses( folder,tangoPose,validFiles )
%GETRGBPOSES Summary of this function goes here
%   Detailed explanation goes here

%% List images
imageFiles = dir([folder filesep '*.jpg']);
imageFiles = cat(1,{imageFiles(:).name})';

TangoPosesRGB_SS = cell(length(imageFiles),1);
TangoPosesRGB_AL = cell(length(imageFiles),1);
tangoTimesRGB = zeros(length(imageFiles),1);

poseTimes = tangoPose(:,5);

if nargin<3
   validFiles = true(length(imageFiles),1);
end

idx = 1:length(imageFiles);
idx = idx(validFiles);

%% Get poses
parfor i=idx

   imageFile = imageFiles{i};
   %[~,strFile] = fileparts(pointFile);

   % Find image file
   %idxImage = strfind(imageFiles,strFile);
   %idx = cellfun(@(x) ~isempty(x), idxImage);

   % Get pose number
   %imageFile = imageFiles{idx};
   [~,strFile] = fileparts(imageFile);
   poseNumber = strsplit(strFile,'_');
   poseNumber = str2num(poseNumber{end}) + 1;

   % Get corresponding pose
   time = -double(tangoPose(poseNumber,5));
   Q = double(tangoPose(poseNumber,[4 1 2 3]));
   trans = double(tangoPose(poseNumber,6:8));

   % Get transformation (SS)
   T_ss = quaternion2matrix(Q);
   T_ss(1:3,end) = trans;

   TangoPosesRGB_SS{i} = T_ss;
   tangoTimesRGB(i) = time;

   % Find closest AL pose based on timestamps
   diff_al = abs(poseTimes-time);
   [~,inds] = sort(diff_al,'ascend');

   idx = inds(1);

   % Get transformation (AL)
   Q = double(tangoPose(idx,[4 1 2 3]));
   trans = double(tangoPose(idx,6:8));

   T_al = quaternion2matrix(Q);
   T_al(1:3,end) = trans;

   TangoPosesRGB_AL{i} = T_al;
end

end


text:
-- MySQL dump 10.13  Distrib 5.6.30, for debian-linux-gnu (i686)
--
-- Host: localhost    Database: magixsurvey
-- ------------------------------------------------------
-- Server version	5.6.30-1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accomplished`
--

DROP TABLE IF EXISTS `accomplished`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accomplished` (
  `acid` int(11) NOT NULL AUTO_INCREMENT,
  `cid` int(11) NOT NULL,
  `sid` int(11) NOT NULL,
  `qid` int(11) NOT NULL,
  `aid` int(11) NOT NULL,
  PRIMARY KEY (`acid`),
  KEY `sid` (`sid`),
  KEY `cid` (`cid`),
  KEY `qid` (`qid`),
  KEY `aid` (`aid`),
  CONSTRAINT `accomplished_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `surveys` (`sid`),
  CONSTRAINT `accomplished_ibfk_2` FOREIGN KEY (`cid`) REFERENCES `user` (`cid`),
  CONSTRAINT `accomplished_ibfk_3` FOREIGN KEY (`qid`) REFERENCES `questions` (`qid`),
  CONSTRAINT `accomplished_ibfk_4` FOREIGN KEY (`aid`) REFERENCES `answers` (`aid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `answers`
--

DROP TABLE IF EXISTS `answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `answers` (
  `aid` int(11) NOT NULL AUTO_INCREMENT,
  `paid` int(11) DEFAULT NULL,
  `qid` int(11) NOT NULL,
  `atype` int(11) NOT NULL,
  PRIMARY KEY (`aid`),
  KEY `atype` (`atype`),
  KEY `qid` (`qid`),
  CONSTRAINT `answers_ibfk_1` FOREIGN KEY (`qid`) REFERENCES `questions` (`qid`),
  CONSTRAINT `answers_ibfk_2` FOREIGN KEY (`atype`) REFERENCES `atypes` (`atid`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `atypes`
--

DROP TABLE IF EXISTS `atypes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `atypes` (
  `atid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY (`atid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `langtext`
--

DROP TABLE IF EXISTS `langtext`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `langtext` (
  `ltid` int(11) NOT NULL AUTO_INCREMENT,
  `lab` char(2) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`ltid`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `language`
--

DROP TABLE IF EXISTS `language`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `language` (
  `lab` char(2) NOT NULL,
  `text` varchar(30) NOT NULL,
  PRIMARY KEY (`lab`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `questions`
--

DROP TABLE IF EXISTS `questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `questions` (
  `qid` int(11) NOT NULL AUTO_INCREMENT,
  `sid` int(11) NOT NULL,
  PRIMARY KEY (`qid`),
  KEY `sid` (`sid`),
  CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `surveys` (`sid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `r_langtext`
--

DROP TABLE IF EXISTS `r_langtext`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `r_langtext` (
  `ltid` int(11) NOT NULL,
  `sid` int(11) DEFAULT NULL,
  `qid` int(11) DEFAULT NULL,
  `aid` int(11) DEFAULT NULL,
  `rid` int(11) DEFAULT NULL,
  KEY `sid` (`sid`),
  KEY `qid` (`qid`),
  KEY `aid` (`aid`),
  KEY `ltid` (`ltid`),
  KEY `rid` (`rid`),
  CONSTRAINT `r_langtext_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `surveys` (`sid`),
  CONSTRAINT `r_langtext_ibfk_2` FOREIGN KEY (`qid`) REFERENCES `questions` (`qid`),
  CONSTRAINT `r_langtext_ibfk_3` FOREIGN KEY (`aid`) REFERENCES `answers` (`aid`),
  CONSTRAINT `r_langtext_ibfk_4` FOREIGN KEY (`ltid`) REFERENCES `langtext` (`ltid`),
  CONSTRAINT `r_langtext_ibfk_5` FOREIGN KEY (`rid`) REFERENCES `roles` (`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `r_roles`
--

DROP TABLE IF EXISTS `r_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `r_roles` (
  `cid` int(11) NOT NULL,
  `rid` int(11) NOT NULL,
  UNIQUE KEY `cid` (`cid`,`rid`),
  KEY `rid` (`rid`),
  CONSTRAINT `r_roles_ibfk_1` FOREIGN KEY (`cid`) REFERENCES `user` (`cid`),
  CONSTRAINT `r_roles_ibfk_2` FOREIGN KEY (`rid`) REFERENCES `roles` (`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `rid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `rank` int(11) NOT NULL,
  PRIMARY KEY (`rid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `surveys`
--

DROP TABLE IF EXISTS `surveys`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `surveys` (
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
  `cid` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(30) NOT NULL DEFAULT '',
  `lastname` varchar(30) NOT NULL DEFAULT '',
  `email` varchar(80) NOT NULL,
  `password` char(32) NOT NULL,
  PRIMARY KEY (`cid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-05-24 10:08:26


text:
package coursier.cli.resolve

import caseapp.{ExtraName => Short, HelpMessage => Help, ValueDescription => Value, _}
import coursier.cli.install.SharedChannelOptions
import coursier.cli.options.{
  CacheOptions,
  DependencyOptions,
  OutputOptions,
  RepositoryOptions,
  ResolutionOptions
}
import coursier.install.RawAppDescriptor

// format: off
@ArgsName("org:name:version|app-name[:version]*")
final case class ResolveOptions(

  @Help("Print the duration of each iteration of the resolution (if negative, doesn't print per iteration benchmark -> less overhead)")
  @Short("B")
  @Value("# warm-up resolutions")
    benchmark: Int = 0,

  benchmarkCache: Boolean = false,

  @Help("Print dependencies as a tree")
  @Short("t")
    tree: Boolean = false,
  @Help("Print dependencies as a reversed tree (dependees as children)")
  @Short("T")
    reverseTree: Boolean = false,
  @Help("Print what depends on the passed modules")
  @Value("org:name")
    whatDependsOn: List[String] = Nil,
  @Help("Print candidate artifact URLs")
    candidateUrls: Boolean = false,

  @Help("Print conflicts")
    conflicts: Boolean = false,

  @Recurse
    sharedResolveOptions: SharedResolveOptions = SharedResolveOptions(),
  @Recurse
    channelOptions: SharedChannelOptions = SharedChannelOptions(),

  @Help("Force printing / generating results, even if errored")
  @Short("F")
    forcePrint: Boolean = false,

  retry: Option[String] = None,
  attempts: Option[Int] = None

) {
  // format: on
  def addApp(app: RawAppDescriptor): ResolveOptions =
    copy(sharedResolveOptions = sharedResolveOptions.addApp(app))
}

object ResolveOptions {
  implicit val parser = Parser[ResolveOptions]
  implicit val help   = caseapp.core.help.Help[ResolveOptions]
}


text:
module Pvcglue
  class Nodes
    def self.build(roles_filter)
      Pvcglue::Nodes.new(roles_filter).run
    end

    def initialize(roles_filter)
      @roles_filter = roles_filter
    end

    def apply_role?(role)
      @roles_filter == 'all' || role == @roles_filter
    end

    def run
      puts "This is where it should configure the nodes for #{@roles_filter}.  :)"

      %w(lb db web caching redis).each do |role|
        if apply_role?(role)
          Pvcglue::Packages.apply(role.to_sym, :build, Pvcglue.cloud.minions_filtered(role))
        end
      end

      Pvcglue::Pvcify.run

    end

  end
end


text:
* [wpmltm-1189] Implemented new design for translation editor.
* [wpmlcore-2774] Implemented new design for taxonomy translation.
* [wpmlcore-2773] Added ability to export all/filtered jobs in WPML -> Translations (Translations Queue)

# Fixes
* [wpmltm-1442] Resolved SQL errors when sending a job to a translation service fails
* [wpmltm-1401] Fixed caching issue on WP-Engine when new terms are created.
* [wpmltm-1400] Fixed issue when translation job wrongly updated when sending batch failed.
* [wpmltm-1395] Fixed creation of slug when "Copy from original language if translation language uses encoded URLs" is selected.
* [wpmltm-1351] Fixed `\WPML_Admin_Post_Actions::get_trid_from_referer`function to get trid form refferer only if needed
* [wpmltm-1343] Keep translation status when it's updated.
* [wpmlst-817] Fixed XSS issue with unescaped output.
* [wpmlst-778] CPT archive slug wrongly translated when `has_archive` starts with the rewrite slug of CPT
* [wpmlcore-3015] Raised z-index of language switcher, to solve a compatibility issue with the twenty-six theme.
* [wpmlcore-3002] Escape Preserve url parameters on Languages page.
* [wpmlcore-3000] Fixed issue with translation of "Uncategorized" term when not using English as default language
* [wpmlcore-2998] Fixed widget language switcher preview to show the current native language correctly
* [wpmlcore-2989] Fixed color presets for the footer language switcher.
* [wpmlcore-2988] Removed unneeded dependencies checks in admin pages: this now runs only once and later only when activating/deactivating plugins
* [wpmlcore-2972] Minor improvement to how WPML fetch updated translations of WordPress strings.
* [wpmlcore-2967] Display custom posts as disabled on the multilingual content page if they are set as don't translate in wpml-config.xml files.
* [wpmlcore-2951] Fixed Menus Sync so the links to menu strings are now only displayed for already existing menus
* [wpmlcore-2948] Fixed issue where unexpected menu items were created on page duplication with "Auto add pages" option enabled.
* [wpmlcore-2929] Fixed compatibility issue with `hyperdb` which prevents from populating `icl_languages` table
* [wpmlcore-2918] Resolved issue with autoloader class when brackets are used in the website's path
* [wpmlcore-2916] Fixed notice shown on "Inactive content" section, after changing the default language and removing it from the active languages
* [wpmlcore-2899] Replaced use of `$HTTP_RAW_POST_DATA` with `php://input`
* [wpmlcore-2897] Fixed duplication of featured image where the flag "Duplicate featured image to translations" was ignored
* [wpmlcore-2878] Queries are not altered when browser redirection is enabled
* [wpmlcore-2841] `parse_url` was returning inconsistent results depending on PHP version
* [wpmlcore-2840] Fixed issue with missing cron job to publish future posts for translations when "Sync publishing date" is enabled.
* [wpmlcore-2803] Form input labels are properly linked to their inputs in WPML > Languages
* [wpmlcore-2797] 301 redirects on product page with non-ASCII characters in slug
* [wpmlcore-2795] `is_front_page()` did not work with "lang" parameter and another parameter
* [wpmlcore-2789] Deep nested taxonomy queries were not adjusted
* [wpmlcore-2731] Display the hreflang meta even if the post has no translations, as long as it's set to be translatable
* [wpmlcore-2728] Removed the language directory for media files links attached to root page
* [wpmlcore-2727] Setup Wizard - Default language was ignored after changing it
* [wpmlcore-2720] Avoid language parameter for search when language negotiation is not set to language as a parameter
* [wpmlcore-2704] Fixed language links position in Appearance -> Menus for RTL admin languages
* [wpmlcore-2701] Yoast SEO Premium - stop it from automatically creating a redirect when a duplicated post is updated.
* [wpmlcore-2658] The query is now parsed by WPML on AJAX requests (for 3rd part compatibility)
* [wpmlcore-2647] Added a new hook `wpml_url_converter_get_abs_home` (for third part plugins compatibility)
* [wpmlcore-2619] Improved speed of the archive page when many languages are active
* [wpmlcore-2595] Improved URL conversion when posts or terms translations have different slugs than the original
* [wpmlcore-2589] Show language switcher if CPT is set to do nothing
* [wpmlcore-2447] A warning was thrown when saving WPML language switcher options and `ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS` set to `true`
* [wpmlcore-2246] Fixed text orientation for RTL languages in install wizard step 2
* [wpmlcore-2198] When mixing parameter and slug for custom taxonomies, an error was thrown in WP 4.4
* [wpmlcore-1861] Fixed hook "wpml_make_post_duplicates" to duplicates custom post fields.
* [wpmlcore-1269] Strings are now translated in step 2 of the install wizard


text:
var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var concat = require('gulp-concat');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var reactify = require('reactify');
var robocopy = require('robocopy');
var livereload = require('gulp-livereload');
var es6ify = require('es6ify');

var report = function(err){
  gutil.log(
        gutil.colors.red('Browserify compile error:'),
        err.message
    );
    this.emit('end');
};

var vendorLibs = [
  'es6-shim',
  'react',
  'react-router',
  'react-bootstrap',
  'underscore',
  'griddle-react'
];

gulp.task('default', ['build']);

gulp.task('css', function () {
  return gulp
        .src('node_modules/bootstrap/dist/css/bootstrap.min.css')
        .pipe(concat('fx.css'))
        .pipe(gulp.dest('./public/stylesheets/'));

});

gulp.task('jsx', function () {

  return browserify('./client/app.js')
    .external(vendorLibs)
    .transform(reactify)
    .transform(es6ify)
    .bundle()
    .on('error', report)
    .pipe(source('client.js'))
    .pipe(gulp.dest('./public/javascripts/'));

});

gulp.task('js', function () {

  browserify({
      require: vendorLibs,
      expose: vendorLibs
    })
    .bundle()
    .on('error', report)
    .pipe(source('fx.js'))
    .pipe(gulp.dest('./public/javascripts/'));
});

gulp.task('build', ['jsx', 'css', 'js']);

gulp.task('test', function () {
  return gulp.src('specs/**/*-spec.js')
      .pipe(jasmine());
});

gulp.task('dev', function () {
  livereload.listen();
  gulp
    .watch('client/**/*.js', ['jsx', 'test']);
});


text:
var express = require('express');
var poweredBy = require('connect-powered-by');

module.exports = function () {
    // Use middleware.  Standard [Connect](http://www.senchalabs.org/connect/)
    // middleware is built-in, with additional [third-party](https://github.com/senchalabs/connect/wiki)
    // middleware available as separate modules.
    if ('development' == this.env) {
        this.use(express.logger());
    }

    this.use(poweredBy('ConSol Software GmbH'));
    this.use(express.favicon());
    this.use(express.static(__dirname + '/../../public'));
    this.use(express.bodyParser());
    this.use(express.methodOverride());
    this.use(this.router);
    this.use(express.errorHandler());
}


text:
<?php

namespace ScContentTest\Controller\Back;

use ScContent\Controller\Back\CategoryController,
    ScContent\Exception\RuntimeException,
    //
    Zend\Mvc\Router\Http\TreeRouteStack as HttpRouter,
    Zend\Mvc\Router\RouteMatch,
    Zend\Mvc\MvcEvent,
    Zend\Http\Response,
    Zend\Http\Request,
    //
    ScContentTest\Bootstrap,
    //
    PHPUnit_Framework_TestCase;

/**
 * @author Dolphin <work.dolphin@gmail.com>
 *
 * @coversDefaultClass \ScContent\Controller\Back\CategoryController
 */
class CategoryControllerTest extends PHPUnit_Framework_TestCase
{
    protected $controller;
    protected $routeMatch;
    protected $response;
    protected $request;
    protected $event;

    protected $fakeForm;
    protected $fakeCategoryService;

    protected function setUp()
    {
        $serviceManager = Bootstrap::getServiceManager();
        $this->controller = new CategoryController();
        $pluginManager = $this->controller->getPluginManager();
        $plugin = $this
            ->getMockBuilder('ScContent\Controller\Plugin\TranslatorProxy')
            ->disableOriginalConstructor()
            ->setMethods(['__invoke'])
            ->getMock();

        $pluginManager->setFactory(
            'scTranslate',
            function() use ($plugin) {
                return $plugin;
            }
        );

        $this->fakeForm = $this
            ->getMockBuilder('ScContent\Form\Back\CategoryForm')
            ->disableOriginalConstructor()
            ->setMethods(['bind', 'isValid', 'getData'])
            ->getMock();

        $this->controller->setCategoryForm($this->fakeForm);

        $this->fakeCategoryService = $this
            ->getMockBuilder('ScContent\Service\Back\CategoryService')
            ->setMethods(['makeCategory', 'getCategory', 'saveContent'])
            ->getMock();

        $this->controller->setCategoryService($this->fakeCategoryService);

        $this->routeMatch = new RouteMatch([
            'controller' => 'ScController.Back.Category',
        ]);
        $this->request = new Request();
        $this->event = new MvcEvent();

        $config = $serviceManager->get('Config');
        $routerConfig = isset($config['router']) ? $config['router'] : [];
        $router = HttpRouter::factory($routerConfig);

        $this->event->setRouter($router);
        $this->event->setRouteMatch($this->routeMatch);
        $this->controller->setEvent($this->event);
        $this->controller->setServiceLocator($serviceManager);
    }

    /**
     * @covers ::addAction
     */
    public function testAddActionWithoutParentIdentifier()
    {
        $this->routeMatch->setParam('action', 'add');

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(303, $response->getStatusCode());
    }

    /**
     * @covers ::addAction
     */
    public function testAddActionOnCreationError()
    {
        $exception = new RuntimeException();

        $this->fakeCategoryService->expects($this->once())
            ->method('makeCategory')
            ->will($this->throwException($exception));

        $this->routeMatch->setParam('action', 'add');
        $this->routeMatch->setParam('parent', 1);

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(303, $response->getStatusCode());
    }

    /**
     * @covers ::addAction
     */
    public function testAddActionSuccess()
    {
        $this->fakeCategoryService->expects($this->once())
            ->method('makeCategory')
            ->will($this->returnValue(1));

        $this->routeMatch->setParam('action', 'add');
        $this->routeMatch->setParam('parent', 1);

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(302, $response->getStatusCode());
    }

    /**
     * @covers ::editAction
     */
    public function testEditActionWithoutCategoryIdentifier()
    {
        $this->routeMatch->setParam('action', 'edit');

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(303, $response->getStatusCode());
    }

    /**
     * @covers ::editAction
     */
    public function testEditActionWithBadCategoryIdentifier()
    {
        $exception = new RuntimeException();

        $this->fakeCategoryService->expects($this->once())
            ->method('getCategory')
            ->will($this->throwException($exception));

        $this->routeMatch->setParam('action', 'edit');
        $this->routeMatch->setParam('id', 1);

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(303, $response->getStatusCode());
    }

    /**
     * @covers ::editAction
     */
    public function testEditActionSuccess()
    {
        $fakeCategory = $this->getMock('ScContent\Entity\Back\Article');

        $this->fakeCategoryService->expects($this->once())
            ->method('getCategory')
            ->will($this->returnValue($fakeCategory));

        $this->fakeCategoryService->expects($this->once())
            ->method('saveContent');

        $this->fakeForm->expects($this->once())
            ->method('bind');

        $this->fakeForm->expects($this->once())
            ->method('isValid')
            ->will($this->returnValue(true));

        $this->fakeForm->expects($this->once())
            ->method('getData')
            ->will($this->returnValue($fakeCategory));

        $this->request->setMethod(Request::METHOD_POST);
        $this->routeMatch->setParam('action', 'edit');
        $this->routeMatch->setParam('id', 1);

        $result   = $this->controller->dispatch($this->request);
        $response = $this->controller->getResponse();

        $this->assertEquals(200, $response->getStatusCode());
    }
}


text:
package hudson.model;

import com.thoughtworks.xstream.converters.UnmarshallingContext;
import hudson.diagnosis.OldDataMonitor;
import hudson.model.Queue.Task;
import hudson.model.queue.FoldableAction;
import hudson.util.XStream2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import jenkins.model.RunAction2;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

@ExportedBean
public class CauseAction implements FoldableAction, RunAction2 {
    /**
     * @deprecated since 2009-02-28
     */
    @Deprecated
    // there can be multiple causes, so this is deprecated
    private transient Cause cause;

    /** @deprecated JENKINS-33467 inefficient */
    @Deprecated
    private transient List<Cause> causes;

    private Map<Cause, Integer> causeBag = new LinkedHashMap<>();

    public CauseAction(Cause c) {
        this.causeBag.put(c, 1);
    }

    private void addCause(Cause c) {
        synchronized (causeBag) {
            Integer cnt = causeBag.get(c);
            causeBag.put(c, cnt == null ? 1 : cnt + 1);
        }
    }

    private void addCauses(Collection<? extends Cause> causes) {
        for (Cause cause : causes) {
            addCause(cause);
        }
    }

    public CauseAction(Cause... c) {
        this(Arrays.asList(c));
    }

    @SuppressWarnings("CopyConstructorMissesField") // does not initialize the deprecated #cause field
    public CauseAction(Collection<? extends Cause> causes) {
        addCauses(causes);
    }

    public CauseAction(CauseAction ca) {
        addCauses(ca.getCauses());
    }

    /**
     * Lists all causes of this build.
     * Note that the current implementation does not preserve insertion order of duplicates.
     * @return an immutable list;
     *         to create an action with multiple causes use either of the constructors that support this;
     *         to append causes retroactively to a build you must create a new {@link CauseAction} and replace the old
     */
    @Exported(visibility = 2)
    public List<Cause> getCauses() {
        List<Cause> r = new ArrayList<>();
        for (Map.Entry<Cause, Integer> entry : causeBag.entrySet()) {
            r.addAll(Collections.nCopies(entry.getValue(), entry.getKey()));
        }
        return Collections.unmodifiableList(r);
    }

    /**
     * Finds the cause of the specific type.
     */
    public <T extends Cause> T findCause(Class<T> type) {
        for (Cause c : causeBag.keySet())
            if (type.isInstance(c))
                return type.cast(c);
        return null;
    }

    @Override
    public String getDisplayName() {
        return "Cause";
    }

    @Override
    public String getIconFileName() {
        // no icon
        return null;
    }

    @Override
    public String getUrlName() {
        return "cause";
    }

    /**
     * Get list of causes with duplicates combined into counters.
     * @return Map of Cause to number of occurrences of that Cause
     */
    public Map<Cause, Integer> getCauseCounts() {
        return Collections.unmodifiableMap(causeBag);
    }

    /**
     * @deprecated as of 1.288
     *      but left here for backward compatibility.
     */
    @Deprecated
    public String getShortDescription() {
        if (causeBag.isEmpty()) {
            return "N/A";
        }
        return causeBag.keySet().iterator().next().getShortDescription();
    }

    @Override public void onLoad(Run<?, ?> owner) {
        for (Cause c : causeBag.keySet()) {
            if (c != null) {
                c.onLoad(owner);
            }
        }
    }

    /**
     * When hooked up to build, notify {@link Cause}s.
     */
    @Override public void onAttached(Run<?, ?> owner) {
        for (Cause c : causeBag.keySet()) {
            if (c != null) {
                c.onAddedTo(owner);
            }
        }
    }

    @Override
    public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) {
        CauseAction existing = item.getAction(CauseAction.class);
        if (existing != null) {
            existing.addCauses(getCauses());
            return;
        }
        // no CauseAction found, so add a copy of this one
        item.addAction(new CauseAction(this));
    }

    public static class ConverterImpl extends XStream2.PassthruConverter<CauseAction> {
        public ConverterImpl(XStream2 xstream) { super(xstream); }

        @Override protected void callback(CauseAction ca, UnmarshallingContext context) {
            // if we are being read in from an older version
            if (ca.cause != null) {
                if (ca.causeBag == null) {
                    ca.causeBag = new LinkedHashMap<>();
                }
                ca.addCause(ca.cause);
                OldDataMonitor.report(context, "1.288");
                ca.cause = null;
            } else if (ca.causes != null) {
                if (ca.causeBag == null) {
                    ca.causeBag = new LinkedHashMap<>();
                }
                ca.addCauses(ca.causes);
                OldDataMonitor.report(context, "1.653");
                ca.causes = null;
            }
        }
    }
}


text:
<?php
$host='localhost';
$user='root';
$pass='';
$database='reqdb';
$con=mysql_connect("$host","$user","$pass");
if(!$con) { echo "Database connection is not."; }

mysql_select_db("$database");
mysql_query("SET character_set_results=UTF8");
mysql_query("SET character_set_client=UTF8");
mysql_query("SET character_set_connection=UTF8");

/*require 'connectdb.php';
$login_username = mysqli_real_escape_string($dbcon,$_POST['username']);
$login_password = mysqli_real_escape_string($dbcon,$_POST['password']);

$sql = "SELECT * FROM users WHERE username=? AND password=?";
$stmt = mysqli_prepare($dbcon,$sql);
mysqli_stmt_bind_param($stmt,"ss",$login_username,$login_password);
mysqli_execute($stmt);
$result_user = mysqli_stmt_get_result($stmt);
if ($result_user->num_rows == 1) {
	session_start();
	$row_user = mysqli_fetch_array($result_user,MYSQLI_ASSOC);
	$_SESSION['login_id'] = $row_user['username'];
	$_SESSION['extension'] = $row_user['extension'];
	header("Location: main.php");
	}
	else{
	  echo "Wrong Username or Password";
	}*/
?>


text:
var firebaseRef = new Firebase('https://firetodo.firebaseio.com/');

$(function() {

// Setup the login button; illustrates making a call to your super secret
// enterprise LDAP database mainframe supercomputer using zero-factor auth.
// This example is designed to show the use of server-side signed tokens; not
// the best practices in authenticating users. The examples makes it easy to
// switch between users by simply swapping out the username in the 'login'
// field.
$('#login').on('click', function() {
  // XXX: If you want to use your own node server, change the URL!
  var url = 'http://misc.firebase.com:22222/?user=' + $('#username').val();
  $.getJSON(url, function(data) {
    if (data != null && data.firebaseAuthToken != null) {
      firebaseRef.unauth();
      firebaseRef.auth(data.firebaseAuthToken);
      // Display the token payload for debug purposes.
      var payload = atob(data.firebaseAuthToken.split('.')[1]);
      $('#token').text('Logged in: ' + payload);
    }
  });
});

// Setup the todo lists.
var names = ['alice', 'bob', 'carol' ];
for (var i = 0; i < names.length; i++) {
  var name = names[i];

  // Register for additions to each user's todo lists.
  firebaseRef.child(name).on('child_added', function(name){
    // Remember, we're in a loop so we need a closure to make sure name is
    // the right value.
    return function(snapshot) {
      var todo = snapshot.val();
      var item = $('<li>').text(todo.todo + ' (' + todo.from + ')');
      item.attr("id", name + '-' + snapshot.name())
      $('#' + name + '-list').append(item);
    }
  }(name));

  // We need to handle remove events when Firebase security rules rollbacks
  // an addition.
  firebaseRef.child(name).on('child_removed', function(name){
    return function(snapshot) {
      $('#' + name + '-' + snapshot.name()).remove();
    }
  }(name));

  // Setup additions to the todo lists. We read from the #username field - this
  // allows us to spoof the 'from' to test the validation rules for Alice and
  // Bob and ensure that the rules we've specified are enforced.
  $('#' + name + '-add').on('click', function(name){
    return function() {
      var item = {
        from: $('#username').val(),
        todo: $('#' + name + '-todo').val()
      };
      firebaseRef.child(name).push(item);
      $('#' + name + '-todo').val('');
    }
  }(name));
}

});


text:
<?php

class VoteTable extends Doctrine_Table
{
}


text:
// Underscore.js 1.3.3
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore


text:
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.psi;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * JEP
 *

 * Represents record pattern, for example: {@code Point(int x, int y) p }
 */
public interface PsiDeconstructionPattern extends PsiPrimaryPattern {
  /**
   * @return element representing code inside '(...)' inclusive parenthesis
   */
  @NotNull
  PsiDeconstructionList getDeconstructionList();

  /**
   * @return type of the pattern, for example in {@code Point(int x, int y) p } it is {@code Point }
   */
  @NotNull
  PsiTypeElement getTypeElement();

  /**
   * @return pattern variable if the pattern has a name, {@code null} otherwise
   */
  @Nullable
  PsiPatternVariable getPatternVariable();
}