text:
package net.wisedog.android.whooing.adapter;

import java.util.ArrayList;

import net.wisedog.android.whooing.R;
import net.wisedog.android.whooing.dataset.TransactionItem;
import net.wisedog.android.whooing.db.AccountsEntity;
import net.wisedog.android.whooing.engine.GeneralProcessor;
import net.wisedog.android.whooing.utils.WhooingCurrency;
import net.wisedog.android.whooing.widget.WiTextView;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * @author Wisedog(me@wisedog.net)
 *
 */
public class TransactionAddAdapter extends BaseAdapter {
    private ArrayList<TransactionItem> mDataArray;
    private LayoutInflater mInflater;
	private Context mContext;

    public TransactionAddAdapter(Context context, ArrayList<TransactionItem> dataArray){
        mDataArray = dataArray;
        mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mContext = context;
    }

    public int getCount() {
        return mDataArray.size();
    }

    public Object getItem(int position) {
        return mDataArray.get(position);
    }

    public long getItemId(int position) {
        return position;
    }

    public void clearAdapter()
    {
    	mDataArray.clear();
        notifyDataSetChanged();
    }

    /* (non-Javadoc)
     * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)
     */
    public View getView(int position, View convertView, ViewGroup parent) {
       final int pos = position;
       if(convertView == null){
           convertView = mInflater.inflate(R.layout.transaction_list_item, parent, false);
       }
       WiTextView textDate = (WiTextView)convertView.findViewById(R.id.transaction_listitem_date);
       WiTextView textItem = (WiTextView)convertView.findViewById(R.id.transaction_listitem_item);
       WiTextView textAmount = (WiTextView)convertView.findViewById(R.id.transaction_listitem_amount);
       WiTextView textLeft = (WiTextView)convertView.findViewById(R.id.transaction_listitem_left);
       WiTextView textRight = (WiTextView)convertView.findViewById(R.id.transaction_listitem_right);
       WiTextView textHead = (WiTextView)convertView.findViewById(R.id.transaction_listitem_head);

       GeneralProcessor generic = null;
       if(parent != null){
    	   generic = new GeneralProcessor(parent.getContext());
       }

       TransactionItem item = mDataArray.get(pos);
       AccountsEntity entityLeft = generic.findAccountById(item.l_account_id);
       AccountsEntity entityRight = generic.findAccountById(item.r_account_id);

       if(entityRight != null && entityLeft != null){
    	   if(entityRight.accountType.equals("income")){
    		   textHead.setText(mContext.getString(R.string.text_income));
    	   }
    	   else if(entityLeft.accountType.equals("expenses")){
    		   textHead.setText(mContext.getString(R.string.text_expenses));
    	   }
    	   else{
    		   textHead.setText(mContext.getString(R.string.text_etc));
    	   }

           textDate.setText(item.date.subSequence(0, 8));
           textItem.setText(item.item);
           textAmount.setText(WhooingCurrency.getFormattedValue(item.money, mContext));
           textLeft.setText(entityLeft.title);
           textRight.setText(entityRight.title);
       }
        return convertView;
    }

    /**
     * @param dataArray     set data array
     */
    public void setData(ArrayList<TransactionItem> dataArray) {
        mDataArray = dataArray;
    }

}


text:
from django.db.models import signals
from django.db.backends import signals as backend_signals
from django.conf import settings
from django.utils import six

from .utils import Singleton

class ConnectionCreateHandler(six.with_metaclass(Singleton)):
    """
    Generic connection handlers manager.
    Executes attrached funcitions on connection is created.
    With facilty of attaching single execution methods.
    """

    generic_handlers = {}
    unique_handlers = {}

    def __call__(self, sender, connection, **kwargs):
        handlers = set()
        if None in self.unique_handlers:
            handlers.update(self.unique_handlers[None])
            del self.unique_handlers[None]

        if connection.vendor in self.unique_handlers:
            handlers.update(self.unique_handlers[connection.vendor])
            del self.unique_handlers[connection.vendor]

        if connection.vendor in self.generic_handlers:
            handlers.update(self.generic_handlers[connection.vendor])

        [x(connection) for x in handlers]

    def attach_handler(self, func, vendor=None, unique=False):
        if unique:
            if vendor not in self.unique_handlers:
                self.unique_handlers[vendor] = [func]
            else:
                self.unique_handlers[vendor].append(func)

        else:
            if vendor not in self.generic_handlers:
                self.generic_handlers[vendor] = [func]
            else:
                self.generic_handlers[vendor].append(func)

connection_handler = ConnectionCreateHandler()
backend_signals.connection_created.connect(connection_handler)

redpajama_set_name: RedPajamaGithub


text:
package cn.rongcloud.im.server.request;

/**
 * Created by AMing on 16/2/17.
 * Company RongCloud
 */
public class SetFriendDisplayNameRequest {

    private String friendId;
    private String displayName;

    public SetFriendDisplayNameRequest(String friendId, String displayName) {
        this.friendId = friendId;
        this.displayName = displayName;
    }

    public String getFriendId() {
        return friendId;
    }

    public void setFriendId(String friendId) {
        this.friendId = friendId;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }
}


text:
alter table ACT_RU_TASK add column TASK_DEF_ID_ varchar(64);

update ACT_GE_PROPERTY set VALUE_ = '6.3.0.1' where NAME_ = 'task.schema.version';


text:
webfw
=====

A simple collection of things for writing web stuff.

Docs and examples are avaiable at [godoc](http://godoc.org/github.com/urandom/webfw)

A quick example, straight from the docs (the later is always up-to-date):

1. The code
    ```go
    package main

    import (
    	"net/http"

    	"github.com/urandom/webfw"
    	"github.com/urandom/webfw/context"
    )

    type Hello struct {
            webfw.BasePatternController
    }

    func NewHello(pattern string) Hello {
            return Hello{webfw.NewBasePatternController(pattern, MethodAll, "")}
    }

    func (con Hello) Handler(c *context.Context) http.HandlerFunc {
            return func(w http.ResponseWriter, r *http.Request) {
                    params := webfw.GetParams(c, r)
                    d := renderer.RenderData{"name": params["name"]}

                    err := webfw.GetRenderCtx(c, r)(w, d, "hello.tmpl")
                    if err != nil {
                            webfw.GetLogger(c, r).Print(err)
                    }
            }
    }

    func Example() {
    	s := webfw.NewServer()

    	dispatcher := s.Dispatcher("/")

    	dispatcher.Handle(NewHello("/hello/:name"))
    	if err := s.ListenAndServe(); err != nil {
    		panic(err)
    	}
    }

    func main() {
    	Example()
    }
    ```
2. The templates, in a directory "templates"

    2.1 "base.tmpl":
    ```html
    <!doctype html>
    <html>
        <body>{{ template "content" . }}</body>
    </html>
    {{ define "content" }}{{ end }}
    ```
    2.2 "hello.tmpl"
    ```html
    {{ define "content" }}
    <h1>Hello {{ .name }}</h1>
    {{ end }}
    ```


text:
"use strict";
const path = require('path');
const tl = require('vsts-task-lib/task');
tl.setResourcePath(path.join(__dirname, 'task.json'));
var isWin = /^win/.test(process.platform);
var exePath = path.join(__dirname, 'tools/PackageBuddy.exe');
var packageBuddyTool;
if (isWin) {
    packageBuddyTool = tl.createToolRunner(exePath);
}
else {
    packageBuddyTool = tl.createToolRunner(tl.which('mono', true));
    packageBuddyTool.arg(exePath);
}
var projectPath = tl.getInput('projectPath', true);
var platform = tl.getInput('platform', true);
var appName = tl.getInput('appName', false);
var build = tl.getInput('build', false);
var versionName = tl.getInput('versionName', false);
var packageName = tl.getInput('packageName', false);
if (projectPath) {
    packageBuddyTool.arg("-projectPath='" + projectPath + "' ");
}
if (platform) {
    packageBuddyTool.arg("-platform=" + platform + " ");
}
if (build) {
    packageBuddyTool.arg("-build='" + build + "' ");
}
if (versionName) {
    packageBuddyTool.arg("-versionName='" + versionName + "' ");
}
if (packageName) {
    packageBuddyTool.arg("-packageName='" + packageName + "' ");
}
if (appName) {
    packageBuddyTool.arg("-appName='" + appName + "' ");
}
var cwd = tl.getPathInput('cwd', false);
// will error and fail task if it doesn't exist
tl.checkPath(cwd, 'cwd');
tl.cd(cwd);
packageBuddyTool.exec({ failOnStdErr: false })
    .then(function (code) {
    tl.exit(code);
})
    .fail(function (err) {
    console.error(err.message);
    tl.debug('taskRunner fail');
    tl.exit(1);
});
//# sourceMappingURL=packageBuddy.js.map


text:
<settings-animated-pages id="pages" section="crostini"
    focus-config="[[focusConfig_]]">

        $i18n{crostiniPageLabel}

          <localized-link
              localized-string="[[i18nAdvanced('crostiniSubtext')]]">
          </localized-link>

      <template is="dom-if" if="[[!allowCrostini]]" restamp>
        <cr-policy-indicator indicator-type="userPolicy">
        </cr-policy-indicator>
      </template>
      <template is="dom-if" if="[[prefs.crostini.enabled.value]]">
        <cr-icon-button class="subpage-arrow"
            aria-label="$i18n{crostiniPageTitle}"
            aria-describedby="secondaryText"
            aria-roledescription="$i18n{subpageArrowRoleDescription}">
        </cr-icon-button>
      </template>
      <template is="dom-if" if="[[!prefs.crostini.enabled.value]]">

        <cr-button id="enable"
            disabled$="[[disableCrostiniInstall_]]"
            on-click="onEnableTap_"
            aria-describedby="secondaryText"
            deep-link-focus-id$="[[Setting.kSetUpCrostini]]">
          $i18n{crostiniEnable}
        </cr-button>
      </template>

  <template is="dom-if" route-path="/crostini/details">
    <settings-subpage page-title="$i18n{crostiniPageLabel}">
      <settings-crostini-subpage prefs="{{prefs}}">
      </settings-crostini-subpage>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/androidAdb">
    <settings-subpage page-title="$i18n{crostiniArcAdbTitle}">
      <settings-crostini-arc-adb prefs="{{prefs}}">
      </settings-crostini-arc-adb>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/portForwarding">
    <settings-subpage page-title="$i18n{crostiniPortForwarding}">
      <settings-crostini-port-forwarding prefs="{{prefs}}">
      </settings-crostini-port-forwarding>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/exportImport">
    <settings-subpage page-title="$i18n{crostiniExportImportTitle}">
      <settings-crostini-export-import prefs="{{prefs}}">
      </settings-crostini-export-import>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/sharedPaths">
    <settings-subpage page-title="$i18n{guestOsSharedPaths}">
      <settings-guest-os-shared-paths
          guest-os-type="crostini" prefs="{{prefs}}">
      </settings-guest-os-shared-paths>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/sharedUsbDevices">
    <settings-subpage page-title="$i18n{guestOsSharedUsbDevicesLabel}">
      <settings-guest-os-shared-usb-devices guest-os-type="crostini">
      </settings-guest-os-shared-usb-devices>
    </settings-subpage>
  </template>

  <template is="dom-if" route-path="/crostini/extraContainers">
    <settings-subpage page-title="$i18n{crostiniExtraContainersLabel}">
      <settings-crostini-extra-containers guest-os-type="crostini">
      </settings-crostini-extra-containers>
    </settings-subpage>
  </template>
</settings-animated-pages>


text:
<?php

declare(strict_types=1);

namespace Kerox\Messenger\Model\Common\Button;

class PhoneNumber extends AbstractButton
{
    /**
     * @var string
     */
    protected $title;

    /**
     * @var string
     */
    protected $payload;

    /**
     * PhoneNumber constructor.
     *
     * @throws \Kerox\Messenger\Exception\MessengerException
     */
    public function __construct(string $title, string $payload)
    {
        parent::__construct(self::TYPE_PHONE_NUMBER);

        $this->isValidString($title, 20);
        $this->isValidString($payload, 1000);

        $this->title = $title;
        $this->payload = $payload;
    }

    /**
     * @throws \Kerox\Messenger\Exception\MessengerException
     *
     * @return \Kerox\Messenger\Model\Common\Button\PhoneNumber
     */
    public static function create(string $title, string $payload): self
    {
        return new self($title, $payload);
    }

    public function toArray(): array
    {
        $array = parent::toArray();
        $array += [
            'title' => $this->title,
            'payload' => $this->payload,
        ];

        return $array;
    }
}


text:
<?php

class Controller_api_travisci extends Crunchbutton_Controller_Rest {
	public function init() {
		switch (c::getPagePiece(2)) {
			case 'build':
				// just send an event telling us to refresh
				$res = Event::create([
					'room' => [
						'travisci.builds'
					]
				], 'update');
				break;
		}

	}
}


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

using AutoMapper;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Commands.Compute.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute
{
    [Cmdlet(VerbsCommon.Remove, ProfileNouns.VirtualMachineExtension)]
    [OutputType(typeof(PSAzureOperationResponse))]
    public class RemoveAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
    {
        [Parameter(
           Mandatory = true,
           Position = 0,
           ValueFromPipelineByPropertyName = true,
           HelpMessage = "The resource group name.")]
        [ResourceGroupCompleter()]
        [ValidateNotNullOrEmpty]
        public string ResourceGroupName { get; set; }

        [Alias("ResourceName")]
        [Parameter(
            Mandatory = true,
            Position = 1,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The virtual machine name.")]
        [ValidateNotNullOrEmpty]
        public string VMName { get; set; }

        [Alias("ExtensionName")]
        [Parameter(
            Mandatory = true,
            Position = 2,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "The extension name.")]
        [ValidateNotNullOrEmpty]
        public string Name { get; set; }

        [Parameter(HelpMessage = "To force the removal.")]
        [ValidateNotNullOrEmpty]
        public SwitchParameter Force { get; set; }

        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            ExecuteClientAction(() =>
            {
                if (this.Force.IsPresent
                    || this.ShouldContinue(Properties.Resources.VirtualMachineExtensionRemovalConfirmation, Properties.Resources.VirtualMachineExtensionRemovalCaption))
                {
                    var op = this.VirtualMachineExtensionClient.DeleteWithHttpMessagesAsync(
                        this.ResourceGroupName,
                        this.VMName,
                        this.Name).GetAwaiter().GetResult();
                    var result = Mapper.Map<PSAzureOperationResponse>(op);
                    WriteObject(result);
                }
            });
        }
    }
}


text:
//===--------------------------------------------------------------------------------*- C++ -*-===//
//                          _
//                         | |
//                       __| | __ ___      ___ ___
//                      / _` |/ _` \ \ /\ / / '_  |
//                     | (_| | (_| |\ V  V /| | | |
//                      \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain
//
//
//  This file is distributed under the MIT License (MIT).
//  See LICENSE.txt for details.
//
//===------------------------------------------------------------------------------------------===//

#pragma once

#ifndef DAWN_GENERATED
#error "This file should only be used in generated code!"
#endif

#include "defs.hpp"

#define GRIDTOOLS_DAWN_META_DATA_T_DEFINED
#define GRIDTOOLS_DAWN_STORAGE_T_DEFINED

#include <gridtools/stencil_composition/stencil_composition.hpp>
#include <gridtools/stencil_composition/stencil_functions.hpp>
#include <gridtools/storage/storage_facility.hpp>

namespace gridtools {
namespace dawn {

/**
 * @name Runtime storage environment
 * @ingroup gridtools_dawn
 * @{
 */

#ifdef GRIDTOOLS_DAWN_HALO_EXTENT
using halo_ijk_t = gridtools::halo<halo::value, halo::value, 0>;
using halo_ij_t = gridtools::halo<halo::value, halo::value, 0>;
using halo_i_t = gridtools::halo<halo::value, 0, 0>;
using halo_j_t = gridtools::halo<0, halo::value, 0>;
#else
using halo_ijk_t = gridtools::halo<0, 0, 0>;
using halo_ij_t = gridtools::halo<0, 0, 0>;
using halo_i_t = gridtools::halo<0, 0, 0>;
using halo_j_t = gridtools::halo<0, 0, 0>;
#endif

/**
 * @brief Backend type
 */
#ifdef DAWN_GT_BACKEND
// This is a temporary fix for enabling gt4py (and other consumers) of generated code with the
// GridTools backend. A proper solution would be to remove backend specific code from the API of the
// generated code, e.g. by introducing the GridTools SID concept.
// A less-hacky solution could be to template all generated code on the backend, which would be a
// lot of effort, which would be meaningless, if we go with the proper solution as outlined above.
using backend_t = DAWN_GT_BACKEND;
#else
#ifdef __CUDACC__
using backend_t = gridtools::backend::cuda;
#else
using backend_t = gridtools::backend::mc;
#endif
#endif

using storage_traits_t = gridtools::storage_traits<backend_t>;
/**
 * @brief Meta-data types
 * @{
 */
using meta_data_ijk_t = storage_traits_t::storage_info_t<0, 3, halo_ij_t>;
using meta_data_ij_t =
    storage_traits_t::special_storage_info_t<1, gridtools::selector<1, 1, 0>, halo_ij_t>;
using meta_data_i_t =
    storage_traits_t::special_storage_info_t<2, gridtools::selector<1, 0, 0>, halo_i_t>;
using meta_data_j_t =
    storage_traits_t::special_storage_info_t<3, gridtools::selector<0, 1, 0>, halo_j_t>;
using meta_data_k_t = storage_traits_t::special_storage_info_t<4, gridtools::selector<0, 0, 1>>;
using meta_data_scalar_t =
    storage_traits_t::special_storage_info_t<5, gridtools::selector<0, 0, 0>>;
using meta_data_t = meta_data_ijk_t;
/** @} */

/**
 * @brief Storage types
 * @{
 */
using storage_ijk_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_ijk_t>;
using storage_ij_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_ij_t>;
using storage_i_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_i_t>;
using storage_j_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_j_t>;
using storage_k_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_k_t>;
using storage_scalar_t = storage_traits_t::data_store_t<::dawn::float_type, meta_data_scalar_t>;
using storage_t = storage_ijk_t;
/** @} */

/** @} */

#if DAWN_STORAGE_TYPE == DAWN_STORAGE_HOST
#define GT_BACKEND_DECISION_viewmaker(x) make_host_view(x)
#define GT_BACKEND_DECISION_bcapply gridtools::boundary_apply
#elif DAWN_STORAGE_TYPE == DAWN_STORAGE_CUDA
#define GT_BACKEND_DECISION_viewmaker(x) make_device_view(x)
#define GT_BACKEND_DECISION_bcapply gridtools::boundary_apply_gpu
#endif
} // namespace dawn
} // namespace gridtools


text:
package org.kuali.rice.krad.service;

import org.kuali.rice.krad.document.Document;
import org.kuali.rice.krad.rule.BusinessRule;
import org.kuali.rice.krad.rule.event.AddAdHocRoutePersonEvent;
import org.kuali.rice.krad.rule.event.AddAdHocRouteWorkgroupEvent;
import org.kuali.rice.krad.rule.event.KualiDocumentEvent;

import java.util.List;

/**
 * Defines the interface to the business-rule evaluation service, used to evauluate document-type-specific business rules using
 * document-related events to drive the process.
 */
public interface KualiRuleService {

    /**
     * Retrieves and instantiates the businessRulesClass associated with the event's document type (if any), and calls the
     * appropriate process* method of that businessRule for handling the given event type. This is a helper method that takes in the
     * generic KualiDocumentEvent class and determines which event call to make.
     *
     * @param event
     * @return true if no rule is applied, or all rules are applied successfully, false otherwise
     */
    public boolean applyRules(KualiDocumentEvent event);

    /**
     * Builds a list containing ad hoc route person events appropriate for the context.
     *
     * @param document
     * @return List
     */
    public List<AddAdHocRoutePersonEvent> generateAdHocRoutePersonEvents(Document document);

    /**
     * Builds a list containing ad hoc route workgroup events appropriate for the context.
     *
     * @param document
     * @return List
     */
    public List<AddAdHocRouteWorkgroupEvent> generateAdHocRouteWorkgroupEvents(Document document);

    /**
     * Allows code in actions or business objects to directly access rule methods in the class.
     *
     * @param document
     * @param ruleInterface
     * @return BusinessRule
     */
    public BusinessRule getBusinessRulesInstance(Document document, Class<? extends BusinessRule> ruleInterface);
}


text:
<?php

return array(

    /*
    |--------------------------------------------------------------------------
    | Language Lines for kolekcie.blade.php template
    |--------------------------------------------------------------------------
    */

    'title'                         => 'kolekcie',
    'collections_found_collections' => 'nájdené kolekcie pre',
    'collections_collections'       => 'kolekcií',
    'collections_no_collections'    => 'momentálne žiadne kolekcie',
    'collections_artworks'          => 'diel',

);


text:
using System;

namespace gate
{
	public class centerproxy
	{
		public centerproxy(juggle.Ichannel ch)
		{
			is_reg_center_sucess = false;
			_hub_call_center = new caller.center(ch);
		}

		public void reg_gate(String ip, short port, String uuid)
		{
			Console.WriteLine("begin connect center server");
			_hub_call_center.reg_server("gate", ip, port, uuid);
		}

		public bool is_reg_center_sucess;

		private caller.center _hub_call_center;
	}
}


text:
package org.metaworks.common;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;

import org.metaworks.FieldDescriptor;
import org.metaworks.ObjectInstance;
import org.metaworks.WebObjectType;
import org.metaworks.dwr.MetaworksRemoteService;

import org.metaworks.Refresh;

public class MetaworksUtil {

	static public void copyStream(InputStream sourceInputStream, OutputStream targetOutputStream) throws Exception{
		int length = 1024;
		byte[] bytes = new byte[length];
		int c;
		int total_bytes=0;

		try{
			while ((c = sourceInputStream.read(bytes)) != -1) {
					total_bytes +=c;
					targetOutputStream.write(bytes,0,c);
			}
		}finally{
			if (sourceInputStream != null) try { sourceInputStream.close(); } catch (Exception e) {}
			if (targetOutputStream != null) try { targetOutputStream.close(); } catch (Exception e) {}
		}
	}

	static public Object[] makeRefreshObjectArray(Object[] array){
		for (int i = 0; i < array.length; i++) {
			array[i] = new Refresh(array[i]);
		}

		return array;
	}

	static public Object[] putObjectArray(Object[] array, Object object){
		Object[] returnObject = new Object[ array.length + 1];

		for (int i = 0; i < array.length; i++) {
			returnObject[i] = array[i];
		}
		returnObject[returnObject.length - 1] = object;

		return returnObject;
	}

	public static Class getDesiredTypeByTypeSelector(Object object) throws Exception{
		WebObjectType wot = MetaworksRemoteService.getInstance().getMetaworksType(object.getClass().getName());
		for(FieldDescriptor fd : wot.metaworks2Type().getFieldDescriptors()){
			Map<String, String> typeSelector = (Map<String, String>) fd.getAttribute("typeSelector");
			if(typeSelector!=null){
				ObjectInstance objInst = (ObjectInstance) wot.metaworks2Type().createInstance();
				objInst.setObject(object);

				String typeName = (String) objInst.getFieldValue(fd.getName());
				String selectedTypeClassName = typeSelector.get(typeName);

				if(selectedTypeClassName==null)
					return null;

				return Thread.currentThread().getContextClassLoader().loadClass(selectedTypeClassName);
			}
		}

		return null;
	}

	public static Object cast(Object object, Class<?> desiredType) throws Exception{

		WebObjectType wot = MetaworksRemoteService.getInstance().getMetaworksType(object.getClass().getName());
		WebObjectType desiredWot = MetaworksRemoteService.getInstance().getMetaworksType(desiredType.getName());

		ObjectInstance desiredInstance = (ObjectInstance) desiredWot.metaworks2Type().createInstance();

		ObjectInstance objInst = (ObjectInstance) wot.metaworks2Type().createInstance();
		objInst.setObject(object);

		for(FieldDescriptor fd : desiredWot.metaworks2Type().getFieldDescriptors()){
			if(fd.getAttribute("ormapping")==null)
				desiredInstance.setFieldValue(fd.getName(), objInst.getFieldValue(fd.name));
		}

		return desiredInstance.getObject();
	}
}


text:
C.prettyPrintAST =
C.prettyPrintValue = function(node) {
  var ctxt = Object.create(new IndentingOutputStream(), { visited: { value: [] } });
  _prettyPrint(node, ctxt);
  return ctxt.contents();
}

function _prettyPrint(node, ctxt) {
  if (node instanceof Array) {
    if (ctxt.visited.indexOf(node) >= 0) {
      ctxt.write('...');
    } else {
      ctxt.visited.push(node);
      var tag = node[0];
      _prettyPrint[tag].apply(ctxt, node.slice(1));
    }
  } else {
    ctxt.write(JSON.stringify(node));
  }
}

function prettyPrintBinop(op) {
  return function(x, y) {
    this.indentFromHere();
    this.write("['" + op + "',");
    this.nl();
    _prettyPrint(x, this);
    this.write(",");
    this.nl();
    _prettyPrint(y, this);
    this.write("]");
    this.dedent();
  };
}

_prettyPrint["+"] = prettyPrintBinop("+");
_prettyPrint["-"] = prettyPrintBinop("-");
_prettyPrint["*"] = prettyPrintBinop("*");
_prettyPrint["/"] = prettyPrintBinop("/");
_prettyPrint["^"] = prettyPrintBinop("^");

_prettyPrint.id = function(name) {
  this.write("['id', '" + name + "']");
};

_prettyPrint.set = function(name, value) {
  this.write("['set', '" + name + "', ");
  _prettyPrint(value, this);
  this.write("]");
};

_prettyPrint.seq = function(x, y) {
  this.indentFromHere();
  this.write("['seq',");
  this.nl();
  _prettyPrint(x, this);
  this.write(",");
  this.nl();
  _prettyPrint(y, this);
  this.write("]");
  this.dedent();
}


text:
package jira.tool.db;

import dbtools.common.utils.StrUtils;
import jira.tool.db.mapper.JiraMapper;
import jira.tool.db.model.Story;
import jira.tool.db.model.User;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DBUtil {
    private static List<User> userList = null;
    private static List<User> teamList = null;
    private static List<User> teamMemberCountList = null;
    private static Map<Long, Story> customerOptionMap = null;

    public static List<User> getUserList() {
        synchronized ("getUserList") {
            if (userList == null || userList.size() <= 0) {
                userList = DB.getDb().getMapper(JiraMapper.class).getUserList();
            }
        }
        return userList;
    }

    public static List<User> getTeamList() {
        synchronized ("getTeamList") {
            if (teamList == null || teamList.size() <= 0) {
                teamList = DB.getDb().getMapper(JiraMapper.class).getTeamList();
            }
        }
        return teamList;
    }

    public static List<User> getTeamMembersCountList() {
        synchronized ("getTeamMembersCountList") {
            if (teamMemberCountList == null || teamMemberCountList.size() <= 0) {
                teamMemberCountList = DB.getDb().getMapper(JiraMapper.class).getTeamMembersCountList();
            }
        }
        return teamMemberCountList;
    }

    public static List<Story> getNoDueDateStoryList() {
        List<Story> storyList = null;
        synchronized ("getNoDueDateStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getNoDueDateStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getDevelopedStoryList() {
        List<Story> storyList = null;
        synchronized ("getDevelopedStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getDevelopedStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getQAStoryList() {
        List<Story> storyList = null;
        synchronized ("getQAStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getQAStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getUnDevelopedStoryList() {
        List<Story> storyList = null;
        synchronized ("getUnDevelopedStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getUnDevelopedStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getReleasePlanStoryList() {
        List<Story> storyList = null;
        synchronized ("getReleasePlanStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getReleasePlanStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getStartPlanStoryList() {
        List<Story> storyList = null;
        synchronized ("getStartPlanStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getStartPlanStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getReleasedStoryList() {
        List<Story> storyList = null;
        synchronized ("getReleasedStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getReleasedStoryList();
        }
        return updateStoryList(storyList, true);
    }

    public static List<Story> getPMOStoryList() {
        List<Story> storyList = null;
        synchronized ("getPMOStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getPMOStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getStoryList() {
        List<Story> storyList = null;
        synchronized ("getStoryList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getStoryList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> getEpicList() {
        List<Story> storyList = null;
        synchronized ("getEpicList") {
            storyList = DB.getDb().getMapper(JiraMapper.class).getEpicList();
        }
        return updateStoryList(storyList);
    }

    public static List<Story> updateStoryList(List<Story> storyList) {
        return updateStoryList(storyList, false);
    }

    public static List<Story> updateStoryList(List<Story> storyList, boolean checkReleaseDate) {
        if (storyList == null || storyList.size() <= 0) {
            return storyList;
        }

        // Combine the information, which is better than querying db from multiple tables.
        JiraMapper mapper = DB.getDb().getMapper(JiraMapper.class);
        Map<Long, Story> guidMap = toMap(mapper.getEAGUIDList());
        Map<Long, Story> labelMap = toMap(mapper.getPMOLabelList());
        Map<Long, Story> startDateMap = toMap(mapper.getStartDateList());
        Map<Long, Story> releaseDateMap = toMap(mapper.getReleaseDateList());
        Map<Long, Story> customer = toMap(getCustomerList());

        for (Story story : storyList) {
            long id = story.getId();
            if (guidMap != null && guidMap.containsKey(id)) {
                story.setEAGUID(guidMap.get(id).getEAGUID());
            }

            if (labelMap != null && labelMap.containsKey(id)) {
                story.setLabel(labelMap.get(id).getLabel());
            }

            if (startDateMap != null && startDateMap.containsKey(id)) {
                story.setStartDate(startDateMap.get(id).getStartDate());
            }

            if (releaseDateMap != null && releaseDateMap.containsKey(id)) {
                story.setReleaseDate(releaseDateMap.get(id).getReleaseDate());
            }

            if (customer != null && customer.containsKey(id)) {
                story.setCustomer(customer.get(id).getCustomer());
            }

            // Update release date if it's closed but has no value.
            if (checkReleaseDate && story.getReleaseDate() == null) {
                if ("YuYan".equalsIgnoreCase(story.getProjectKey()) || "史泰博".equalsIgnoreCase(story.getProjectKey())) {
                    story.setReleaseDate(story.getResolveDate());
                }
            }
        }
        return storyList;
    }

    public static List<Story> getCustomerOptionListOnlyEnabled() {
        synchronized ("getCustomerOptionListOnlyEnabled") {
            return DB.getDb().getMapper(JiraMapper.class).getCustomerOptionListOnlyEnabled();
        }
    }

    public static List<Story> getCustomerOptionList() {
        synchronized ("getCustomerOptionList") {
            return DB.getDb().getMapper(JiraMapper.class).getCustomerOptionList();
        }
    }

    /**
     * Return the customer list, which has been updated with customer option.
     * @return
     */
    public static List<Story> getCustomerList() {
        synchronized ("getCustomerOptionList") {
            if (customerOptionMap == null || customerOptionMap.size() <= 0) {
                List<Story> customerOptionList = DB.getDb().getMapper(JiraMapper.class).getCustomerOptionList();
                customerOptionMap = toMap(customerOptionList);
            }
        }

        List<Story> customerList = DB.getDb().getMapper(JiraMapper.class).getCustomerList();
        if (customerList == null || customerList.size() <= 0) {
            return null;
        }

        for (Story customer : customerList) {
            long customerId = customer.getCustomerId();
            if (customerId > 0 && customerOptionMap.containsKey(customerId)) {
                customer.setCustomer(customerOptionMap.get(customerId).getCustomer());
            } else {
                System.out.printf("Error when find customer option: %d\r\n", customerId);
            }
        }
        return customerList;
    }

    private static Map<Long, Story> toMap(List<Story> list) {
        if (list == null || list.size() <= 0) {
            return null;
        }

        Map<Long, Story> map = new HashMap<Long, Story>(list.size());
        for (Story item : list) {
            map.put(item.getId(), item);
        }
        return map;
    }
}


text:
package water

import (
	"os"
	"strings"
	"syscall"
	"unsafe"
)

const (
	cIFF_TUN   = 0x0001
	cIFF_TAP   = 0x0002
	cIFF_NO_PI = 0x1000
)

type ifReq struct {
	Name  [0x10]byte
	Flags uint16
	pad   [0x28 - 0x10 - 2]byte
}

func ioctl(fd uintptr, request int, argp uintptr) error {
	_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(request), argp)
	if errno != 0 {
		return os.NewSyscallError("ioctl", errno)
	}
	return nil
}

func newTAP(config Config) (ifce *Interface, err error) {
	file, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0)
	if err != nil {
		return nil, err
	}
	name, err := createInterface(file.Fd(), config.Name, cIFF_TAP|cIFF_NO_PI)
	if err != nil {
		return nil, err
	}

	if err = setDeviceOptions(file.Fd(), config); err != nil {
		return nil, err
	}

	ifce = &Interface{isTAP: true, ReadWriteCloser: file, name: name}
	return
}

func newTUN(config Config) (ifce *Interface, err error) {
	file, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0)
	if err != nil {
		return nil, err
	}
	name, err := createInterface(file.Fd(), config.Name, cIFF_TUN|cIFF_NO_PI)
	if err != nil {
		return nil, err
	}

	if err = setDeviceOptions(file.Fd(), config); err != nil {
		return nil, err
	}

	ifce = &Interface{isTAP: false, ReadWriteCloser: file, name: name}
	return
}

func createInterface(fd uintptr, ifName string, flags uint16) (createdIFName string, err error) {
	var req ifReq
	req.Flags = flags
	copy(req.Name[:], ifName)

	err = ioctl(fd, syscall.TUNSETIFF, uintptr(unsafe.Pointer(&req)))
	if err != nil {
		return
	}

	fd2, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_IP)
	if err != nil {
		return
	}
	err = ioctl(uintptr(fd2), syscall.SIOCGIFFLAGS, uintptr(unsafe.Pointer(&req)))
	if err != nil {
		err = nil
		return
	}
	req.Flags |= syscall.IFF_UP | syscall.IFF_RUNNING
	err = ioctl(uintptr(fd2), syscall.SIOCSIFFLAGS, uintptr(unsafe.Pointer(&req)))
	if err != nil {
		err = nil
		return
	}

	createdIFName = strings.Trim(string(req.Name[:]), "\x00")
	return
}

func setDeviceOptions(fd uintptr, config Config) (err error) {

	// Device Permissions
	if config.Permissions != nil {

		// Set Owner
		if err = ioctl(fd, syscall.TUNSETOWNER, uintptr(config.Permissions.Owner)); err != nil {
			return
		}

		// Set Group
		if err = ioctl(fd, syscall.TUNSETGROUP, uintptr(config.Permissions.Group)); err != nil {
			return
		}
	}

	// Set/Clear Persist Device Flag
	value := 0
	if config.Persist {
		value = 1
	}
	return ioctl(fd, syscall.TUNSETPERSIST, uintptr(value))

}


text:
package com.seleniumtests.it.stubclasses;

import java.lang.reflect.Method;

import org.openqa.selenium.WebDriverException;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import com.seleniumtests.core.SeleniumTestsContext;
import com.seleniumtests.core.SeleniumTestsContextManager;
import com.seleniumtests.core.TestTasks;
import com.seleniumtests.driver.BrowserType;
import com.seleniumtests.it.driver.support.pages.DriverModalTestPage;
import com.seleniumtests.it.driver.support.pages.DriverTestPage;
import com.seleniumtests.it.driver.support.pages.DriverTestPageNativeActions;
import com.seleniumtests.it.driver.support.pages.ImageDetectorPage;

public class StubTestClassForDriverTest extends StubParentClass {

	@BeforeMethod(groups="stub")
	public void init(Method method) {
		SeleniumTestsContextManager.getThreadContext().setBrowser("chrome");
		SeleniumTestsContextManager.getThreadContext().setOverrideSeleniumNativeAction(true);
		if (System.getProperty(SeleniumTestsContext.TEST_RETRY_COUNT) == null) {
			SeleniumTestsContextManager.getThreadContext().setTestRetryCount(0);
		}
	}

	/**
	 * added for issue #287 where we need to fail on configuration method to reproduce the bug
	 * @param method
	 */
	@AfterMethod(groups="stub")
	public void reset(Method method) {
		TestTasks.killProcess("foobar");
	}

	@Test(groups="stub")
	public void testDriver() throws Exception {

		new DriverTestPage(true)
			._writeSomething()
			._reset()
			._sendKeysComposite()
			._clickPicture();
	}

	/**
	 * issue #414
	 * @throws Exception
	 */
	@Test(groups="stub")
	public void testDriverWithFailureAfterSwitchToFrame() throws Exception {

		new DriverTestPage(true)
		._goToFrame();
	}

	@Test(groups="stub")
	public void testMultipleDriver() throws Exception {

		new DriverTestPage(true)
		._writeSomething()
		._reset();
		new DriverTestPage(true, BrowserType.FIREFOX)
		._writeSomething()
		._reset();
	}

	@Test(groups="stub")
	public void testDriverIsDisplayedRetry() throws Exception {
		new DriverTestPage(true)._isElementNotPresentDisplayed();
	}

	@Test(groups="stub")
	public void testDriverShort() throws Exception {
		new DriverTestPage(true);
	}

	@Test(groups="stub")
	public void testDriverShort2() throws Exception {
		new DriverTestPage(true);
	}

	@Test(groups="stub")
	public void testDriverShort3() throws Exception {
		new DriverTestPage(true);
	}

	@Test(groups="stub")
	public void testDriverShort4() throws Exception {
		new DriverTestPage(true);
	}

	@Test(groups="stub")
	public void testDriverMultipleSnapshot() throws Exception {
		new DriverTestPage(true)
			._goToNewPage();
	}

	@Test(groups="stub")
	public void testDriverShortKo() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setReplayTimeout(1);

		new DriverTestPage(true)
			._writeSomethingOnNonExistentElement();
	}

	@Test(groups="stub")
	public void testDriverWithAssert() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setReplayTimeout(1);

		DriverTestPage page = new DriverTestPage(true);
		page._reset();
		Assert.assertTrue(false);
		page._writeSomething();
	}

	@Test(groups="stub")
	public void testDriverShortKoWithCatchException() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setReplayTimeout(1);

		new DriverTestPage(true)
			._writeSomethingOnNonExistentElementWithCatch()
			._writeSomething();

	}

	@Test(groups="stub")
	public void testDriverCustomSnapshot() throws Exception {

		new DriverTestPage(true)
		._writeSomething()
		._captureSnapshot("my snapshot")
		._reset();
	}

	@Test(groups="stub")
	public void testDriverModalSnapshot() throws Exception {

		new DriverModalTestPage(true)
			._openModal()
			._captureSnapshot("my snapshot");
	}

	@Test(groups="stub")
	public void testDriverWithFailure() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setReplayTimeout(1);

		new DriverTestPage(true)
		._writeSomething()
		._writeSomethingOnNonExistentElement();
	}

	@Test(groups="stub")
	public void testDriverManualSteps() throws Exception {

		SeleniumTestsContextManager.getThreadContext().setManualTestSteps(true);

		addStep("Write");
		DriverTestPage page = new DriverTestPage(true)
			._writeSomething();
		addStep("Reset");
		page._reset();
	}

	/**
	 * check that with selenium override, logging is done
	 * @throws Exception
	 */
	@Test(groups="stub")
	public void testDriverNativeActions() throws Exception {
		new DriverTestPageNativeActions(true)
		.sendKeys()
		.reset()
		.select();
	}

	/**
	 * check that without selenium override, logging is not done
	 * @throws Exception
	 */
	@Test(groups="stub")
	public void testDriverNativeActionsWithoutOverride() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setOverrideSeleniumNativeAction(false);
		SeleniumTestsContextManager.getThreadContext().setReplayTimeout(1);
		SeleniumTestsContextManager.getThreadContext().setImplicitWaitTimeout(1);

		new DriverTestPageNativeActions(true)
		.sendKeys()
		.reset()
		.select();
	}

	@Test(groups="stub")
	public void testDriverWithHtmlElementWithoutOverride() throws Exception {
		SeleniumTestsContextManager.getThreadContext().setOverrideSeleniumNativeAction(false);

		new DriverTestPage(true)
			._writeSomething()
			._reset()
			._clickPicture()
			._sendKeysComposite();
	}

	@Test(groups="stub")
	public void testImageDetection() throws Exception {

		new ImageDetectorPage()
			._clickErrorButtonInError();// force test to fail
	}

	@Test(groups="stub")
	public void testImageDetectionAssertionError() throws Exception {

		new ImageDetectorPage()
		._clickErrorButton();
		Assert.assertTrue(false);
	}

	@Test(groups="stub")
	public void testImageDetectionNoError() throws Exception {

		new ImageDetectorPage()
		._clickErrorButton();
	}

}


text:
<!DOCTYPE html>

    <meta charset='utf-8'>
    <title>
      Data Agored Cysylltiedig y Gofrestrfa Tir
    </title>
    <link rel="stylesheet" href="stylesheets/landing.css" type="text/css">
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" type="text/css">
    <link href="images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
    <meta name="Description" content="Linked Open Data resources from the Land Registry"/>
    <meta name="Monitoring" content="Confirming site availability." />

                Data Agored Cysylltiedig y Gofrestrfa Tir

                  beta

                    Mynegai Prisiau Tai

                    Data Pris a Dalwyd

                    Ymholiad SPARQL

            English

            Data Agored

            Fel rhan o'n hymrwymiad i flaenoriaethau'r Llywodraeth i dwf economaidd a thryloywder data mae'r Gofrestrfa Tir yn cyhoeddi'r setiau data cyhoeddus canlynol:

              Tablau cefndir y Mynegai Prisiau Tai – ar gael oddi ar fis Ionawr 1995 ac wedi'i ddiweddaru'n llawn bob mis.

              Data pris a dalwyd – ar gael oddi ar fis Ionawr 1995 ac wedi'i ddiweddaru'n llawn bob mis.

              Data Trafodiad – ar gael oddi ar fis Rhagfyr 2011.

            Mae'r setiau data uchod ar gael ar ffurfiau
            csv
             a
             data cysylltiedig
              gyda Data Pris a Dalwyd ar gael ar ffurf txt hefyd. Gellir llwytho'r setiau data hyn i lawr yn llawn trwy fynd i'n
            Data Cyhoeddus.
            I gael rhagor o wybodaeth am ein data cysylltiedig, gweler
            isod.

            I'n cwsmeriaid Pris a Dalwyd a Mynegai Prisiau Tai nad oes angen y set data lawn arnynt, ond sydd â
            diddordeb mewn creu adroddiadau pwrpasol, rydym wedi datblygu'r dewisiadau canlynol:

            Chwilio'r Mynegai Prisiau Tai

            Defnyddiwch y chwiliad hwn i ganfod prisiau cyfartalog, nifer y gwerthiannau a'r math o eiddo ar gyfer lleoliad penodedig dros gyfnod penodol. Mae'r Mynegai Prisiau Tai yn cymharu pris cyfartalog tai heddiw â'r hyn oedd ei bris ym mis Ionawr 1995, gyda'r mynegai wedi'i osod ar 100. Mae'n cynnwys ffigurau ar lefel genedlaethol, ranbarthol, sir ac Awdurdod Lleol. I gael rhagor o wybodaeth ewch i
            Ein Mynegai Prisiau Tai.

            Lluniwr Adroddiad Data Pris a Dalwyd

            Defnyddiwch y chwiliad hwn i greu adroddiadau pwrpasol gan ddefnyddio ein data pris a dalwyd. Gellir seilio adroddiadau ar leoliad, daliadaeth, pris a dalwyd neu fath o eiddo dros gyfnod penodol.

            Mae ein data pris a dalwyd yn olrhain gwerthiannau eiddo preswyl yng Nghymru a Lloegr a gyflwynir i ni i'w cofrestru. Mae'r set ddata yn ffynhonnell ddibynadwy o wybodaeth prisiau tai ac mae'n cynnwys dros 18.5 miliwn o gofnodion yn dyddio yn ôl i fis Ionawr 1995. I gael rhagor o wybodaeth am y set ddata hon a'r hyn mae'n ei gynnwys a'r hyn nad yw'n ei chynnwys, gweler y
            COA Data Pris a Dalwyd.

            Rydym yn ceisio sicrhau bod ein data cyhoeddus mor gywir â phosibl, ond ni allwn warantu na fydd yn cynnwys gwallau neu'n addas at eich dibenion neu eich defnydd. Mae adroddiadau'n seiliedig ar ddata a gasglwyd ar yr adeg y cofrestrwyd y trafodiad eiddo gyda ni ac ni fydd o reidrwydd yn gyfredol gyda'r wybodaeth fwyaf diweddar. Gweler
            y COA hwn
            am ragor o wybodaeth.

Data cysylltiedig

            Yn ogystal, rydym yn cyhoeddi'r data hwn ar ffurf data cysylltiedig.

            Os hoffech roi cynnig ar eich ymholiadau SPARQL eich hun yn erbyn ein cyhoeddiadau data cysylltiedig, defnyddiwch
            y ffurflen SPARQL hon.
            Rydym wedi cynnwys rhai enghreifftiau o ymholiadau gyda'r ffurflen a gallwch greu'r allborth fel tabl, fel testun plaen, ffeil JSON neu ar ffurf XML.

            Os hoffech weld yr ymholiad SPARQL a ddefnyddir i greu'r adroddiadau yn yr offer adrodd Mynegai Prisiau Tai a Data Pris a Dalwyd a ddisgrifiwyd uchod, gallwch wneud hyn trwy ddewis y camau 'view SPARQL query' o'r golwg 'download data' ym mhob offer chwilio. Gallwch hyd yn oed ddiwygio ac ail-redeg yr ymholiad SPARQL yn ôl yr angen.

              Mynegai Prisiau Tai

              set ddata cysylltiedig 5★ gyda chysylltau i
              ONS a'r
              Arolwg Ordnans
              i ddisgrifio'r rhanbarthau a gofnodwyd o fewn data'r Mynegai Prisiau Tai. Gweler
              diffiniadau data ar gyfer y set ddata hon.

              DS: Sylwer nad yw'r Gofrestrfa Tir yn gyfrifol am gynnwys na dibynadwyedd gwefannau cysylltiedig sy'n ffynonellau eraill o ddata agored na thrwyddedau y mae'r data hwn ar gael trwyddynt.

              Data pris a dalwyd

               set ddata cysylltiedig 4★ sy'n cynnwys dros 400 miliwn o driawdau. Gweler
              diffiniadau data ar gyfer y set ddata hon.

              Data Trafodiad

              set ddata cysylltiedig 4★ Gweler
              diffiniadau data ar gyfer y set ddata hon.

            Â phwy i gysylltu

            Os na allwch gael mynediad i'r set ddata,

            llenwch ein ffurflen gysylltu.

            Anfonwch ebost mewn perthynas ag ymholiadau data trafodiad at  DRO@landregistry.gov.uk

            Ar gyfer ymholiadau cyffredinol am y Mynegai Prisiau Tai neu Ddata Pris a Dalwyd cysylltwch â
            commercial.services@landregistry.gov.uk.

          Support links

            © Crown copyright 2014–2016

            Personal Information Charter

            Terms and Conditions

            Land Registry Public Data

            All content is available under the Open Government Licence v3.0 except where otherwise stated


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
<link rel="import" href="../../bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html">
<link rel="import" href="../../bower_components/paper-dialog-behavior/paper-dialog-behavior.html">

<dom-module id="write-dialog">
  <link rel="import" type="css" href="../../bower_components/paper-dialog-behavior/paper-dialog-common.css">
  <template>

Add a new item for the shopping list

    <iron-pages selected="{{state}}" class="vertical layout">

        <paper-dialog-scrollable>

            <video class="fit-contain"></video>

            Write the name of the shopping item to add, or write the UPC/EAN of the item to
            look up the name. You can also directly scan the barcode of the product.

          <paper-input id="input" label="Item name or barcode numbers" value="{{value}}"
            autocapitalize maxlength="20">
          </paper-input>

        </paper-dialog-scrollable>

          <paper-button on-tap="scan" disabled="{{!supportsBarcodeScanner}}">SCAN BARCODE</paper-button>
          <paper-button on-tap="action" disabled="{{!value}}">{{actionButtonText(isProductCode)}}</paper-button>

        <paper-dialog-scrollable>

            Touch the NFC tag with the device, and the system will store the new information
            on it. Afterwards, the tag can be used for adding items to the shopping list, by
            simply tapping it.

        </paper-dialog-scrollable>

          <paper-button on-tap="reset">REGISTER ANOTHER ITEM</paper-button>

        <paper-dialog-scrollable>

            Content was written successfully to the tag.

        </paper-dialog-scrollable>

          <paper-button on-tap="reset">REGISTER ANOTHER ITEM</paper-button>
          <paper-button on-tap="close">DONE</paper-button>

        <paper-dialog-scrollable>

            Error writing content, please try again.

        </paper-dialog-scrollable>

          <paper-button on-tap="close">CANCEL</paper-button>
          <paper-button on-tap="write">TRY AGAIN</paper-button>

        <paper-dialog-scrollable>
        Dummy element workaround!
        </paper-dialog-scrollable>

    </iron-pages>
  </template>

</dom-module>


text:
using System;
using UnityEngine;
using System.Collections;

namespace KEngine
{
    /// <summary>
    /// KEngine's Android Plugins is a jar.
    ///
    /// Load sync from android asset folder.
    /// Unity3D's WWW class can only load async from asset folder, disgusting.
    /// </summary>
    public class KEngineAndroidPlugin
    {
#if !KENGINE_DLL && UNITY_ANDROID
        private static AndroidJavaClass _helper;

        /// <summary>
        /// Get AndroidHelper from Java jar
        /// </summary>
        private static AndroidJavaClass AndroidHelper
        {
            get
            {
                if (_helper != null) return _helper;

                _helper = new AndroidJavaClass("com.github.KEngine.AndroidHelper");

                if (_helper == null)
                    ErrorNotSupport();

                return _helper;
            }
        }
#endif

        private static void ErrorNotSupport()
        {
            throw new Exception("[KEngineAndroidPlugin.cs]Error on Android Plugin. Check if KEngine.Android.jar file exist in your Plugins/Android/libs? KEngine DLL mode also not support.");
        }

        /// <summary>
        /// Check if path exist in asset folder?
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static bool IsAssetExists(string path)
        {
#if !KENGINE_DLL && UNITY_ANDROID
            return AndroidHelper.CallStatic<bool>("isAssetExists", path);
#else
            ErrorNotSupport();
            return false;
#endif
        }

        /// <summary>
        /// Call from java get asset file bytes and convert to string
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string GetAssetString(string path)
        {
#if !KENGINE_DLL && UNITY_ANDROID
            return AndroidHelper.CallStatic<string>("getAssetString", path);
#else
            ErrorNotSupport();
            return null;
#endif
        }

        /// <summary>
        /// Call from java get asset file bytes
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static byte[] GetAssetBytes(string path)
        {
#if !KENGINE_DLL && UNITY_ANDROID
            return AndroidHelper.CallStatic<byte[]>("getAssetBytes", path);
#else
            ErrorNotSupport();
            return null;
#endif
        }
    }
}


text:
_BASE_WORK_HOME=/disk1/javaserver
export _BASE_WORK_HOME


text:
<?php
namespace PhpDDD\PhpDDDBundle;

use PhpDDD\Command\Bus\CommandBusInterface;

interface CommandBusAwareInterface
{
    /**
     * @param CommandBusInterface $commandBus
     *
     * @return void
     */
    public function setCommandBus(CommandBusInterface $commandBus);
}


text:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if((itemEx.itemid == 7915 or itemEx.itemid == 7916) and itemEx.actionid == 100) then
		local player = Player(cid)
		if item.itemid == 9744 and player:getStorageValue(Storage.InServiceofYalahar.MatrixState) < 1 then
			player:setStorageValue(Storage.InServiceofYalahar.MatrixState, 1)
			doRemoveItem(item.uid, 1)
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			player:say("The machine was activated.", TALKTYPE_MONSTER_SAY)
			player:setStorageValue(Storage.InServiceofYalahar.Questline, 46)
			player:setStorageValue(Storage.InServiceofYalahar.Mission08, 3) -- StorageValue for Questlog "Mission 08: Dangerous Machinations"
		elseif item.itemid == 9743 and player:getStorageValue(Storage.InServiceofYalahar.MatrixState) < 1 then
			player:setStorageValue(Storage.InServiceofYalahar.MatrixState, 2)
			doRemoveItem(item.uid, 1)
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			player:say("The machine was activated.", TALKTYPE_MONSTER_SAY)
			player:setStorageValue(Storage.InServiceofYalahar.Questline, 46)
			player:setStorageValue(Storage.InServiceofYalahar.Mission08, 3) -- StorageValue for Questlog "Mission 08: Dangerous Machinations"
		end
	end
	return true
end


text:
package org.muckebox.android.net;

public class RefreshAlbumsTask extends RefreshTask<Void> {
	@Override
	protected Integer doInBackground(Void... nothing)
	{
	    return RefreshHelper.refreshAlbums();
	}
}


text:
import {
  join,
  block,
  wrap,
  indent
} from '../utilities/printing';

import { camelCase } from 'change-case';

import {
  GraphQLString,
  GraphQLInt,
  GraphQLFloat,
  GraphQLBoolean,
  GraphQLID,
  GraphQLList,
  GraphQLNonNull,
  GraphQLScalarType,
  GraphQLEnumType
} from 'graphql';

const builtInScalarMap = {
  [GraphQLString.name]: 'string',
  [GraphQLInt.name]: 'number',
  [GraphQLFloat.name]: 'number',
  [GraphQLBoolean.name]: 'boolean',
  [GraphQLID.name]: 'string',
}

export function typeNameFromGraphQLType(context, type, bareTypeName, nullable = true) {
  if (type instanceof GraphQLNonNull) {
    return typeNameFromGraphQLType(context, type.ofType, bareTypeName, false)
  }

  let typeName;
  if (type instanceof GraphQLList) {
    typeName = `Array< ${typeNameFromGraphQLType(context, type.ofType, bareTypeName, true)} >`;
  } else if (type instanceof GraphQLScalarType) {
    typeName = builtInScalarMap[type.name] || (context.passthroughCustomScalars ? context.customScalarsPrefix + type.name : 'any');
  } else {
    typeName = bareTypeName || type.name;
  }

  return nullable ? '?' + typeName : typeName;
}


text:
/**
   \file  multisensor_fusion_class.cpp
   \brief MultisensorFusion class methods
   \author David Silva
   \date   June, 2016
 */

#include "multisensor_fusion/multisensor_fusion_class.h"

/**
   @brief MultisensorFusion constructor. Reads geometric transformations to an eigen matrix and converts it to cvMat.
   @param[in] files is a vector of strings where each element is the filepath to a geometric transformation
 */
MultisensorFusion::MultisensorFusion(const std::vector<std::string> files)
{
	transformations.resize(files.size());
	tf_transforms.resize(files.size());
	tf_broadcasters.resize(files.size());

	for (int i=0; i < files.size(); i++)
	{
		readFile(transformations[i], files[i]);
	}

	eigenVector2cvVector(transformations);
}

/**
   @brief Read a file with geometric transformations
   @param[out] geometric transformation matrix
   @param[in] filepath and filename with extension
   @return void
 */
void MultisensorFusion::readFile( Eigen::Matrix4f &transformation, const std::string filepath)
{
	const char *file_path_dir = filepath.c_str(); // converts to char*

	int nrows = 4, ncols = 4;

	std::ifstream myfile;
	myfile.open (file_path_dir);
	if (myfile.is_open())
	{
		for (int row = 0; row < nrows; row++)
			for (int col = 0; col < ncols; col++)
			{
				float num = 0.0;
				myfile >> num;
				transformation(row, col) = num;
			}
		myfile.close();
	}

	std::cout << "Read file: " << filepath << std::endl;
	std::cout << transformation << std::endl;

}

/**
   @brief Converts a vector of Eigen matrices to a vector of cvMat.
   @param[in] eigenVector vector of geometric transformations in Eigen matrices
   @return void
 */
void MultisensorFusion::eigenVector2cvVector(std::vector<Eigen::Matrix4f> eigenVector)
{
	cv::Mat cvTransf_tmp(4,4,CV_32FC1);
	for (int i=0; i < eigenVector.size(); i++)
	{
		cv::eigen2cv(eigenVector[i], cvTransf_tmp);
		cvTransf.push_back(cvTransf_tmp.clone());
		std::cout << cvTransf[i] << std::endl;
	}
}

/**
   @brief Gets transformations in TF format from transformations in Eigen format
   @param void
   @return tf_transforms is a vector of transformations in TF format
 */
std::vector<tf::Transform> MultisensorFusion::getTFTranforms()
{
	tf::Matrix3x3 T;
	tf::Quaternion q;
	for (int i=0; i < tf_transforms.size(); i++)
	{
		tf_transforms[i].setOrigin(tf::Vector3(transformations[i](0,3),
		                                       transformations[i](1,3),
		                                       transformations[i](2,3)));

		T.setValue(transformations[i](0,0),transformations[i](0,1),transformations[i](0,2),
		           transformations[i](1,0),transformations[i](1,1),transformations[i](1,2),
		           transformations[i](2,0),transformations[i](2,1),transformations[i](2,2));

		T.getRotation(q);

		tf_transforms[i].setRotation(q);
	}

	return tf_transforms;
}

/**
   @brief Gets the vector of TF broadcasters.
   @param void
   @return tf_broadcasters is the vector of TF broadcasters
 */
std::vector<tf::TransformBroadcaster> MultisensorFusion::getTFBroadcasters()
{
	return tf_broadcasters;
}

/**
   @brief Gets transformations in Eigen format.
   @param void
   @return transformations vector of Eigen transformations
 */
std::vector<Eigen::Matrix4f> MultisensorFusion::getEigenTransformations ()
{
	return transformations;
}

/**
   @brief Gets transformations in cvMat format.
   @param void
   @return cvTransf vector of cvMat transformations
 */
std::vector<cv::Mat> MultisensorFusion::getCVTransformations ()
{
	return cvTransf;
}

/**
   @brief Projects 3D world points (from lasers, Kinect, Swissranger, etc) to an image.
   @param[in] img initial image
   @param[in] cvTransformation geometric transformation between the sensor and the camera
   @param[in] points_3D 3D points acquired by the sensor
   @param[in] intrinsic_matrix intrinc camera parameters
   @param[in] distortion_coeffs tangential and radial lens distortion coefficients
   @param[in] color is the color used to draw the 3D points on the image
   @return imgClone is the initial image with the projected 3D points
 */
cv::Mat MultisensorFusion::project3DtoImage(const cv::Mat img, cv::Mat cvTransformation,
	std::vector<cv::Point3f> points_3D, cv::Mat intrinsic_matrix, cv::Mat distortion_coeffs, cv::Scalar color)
{
	cv::Mat rotation_vector(1,3,cv::DataType<double>::type);
	cv::Mat translation_vector(1,3,cv::DataType<double>::type);

	// Computes Rodrigues rotation vector for cvTransformation
	cv::Mat R(3,3,cv::DataType<double>::type);
	R = cvTransformation(cv::Range(0,3), cv::Range(0,3));
	cv::Rodrigues(R, rotation_vector);

	//std::cout << "Rodrigues rotation vector = " << rotation_vector << std::endl;

	// Computes translation vector for cvTransformation
	translation_vector = cvTransformation(cv::Range(0,3), cv::Range(3,4));

	//std::cout << "Translation vector = " << translation_vector << std::endl;

	// Project objectPoints to the image to check if solvePnP results are good ===
	std::vector<cv::Point2f> reprojectPoints;

	cv::projectPoints(points_3D, rotation_vector, translation_vector,
	                  intrinsic_matrix,
	                  distortion_coeffs,
	                  reprojectPoints);

	cv::Mat imgClone = img.clone();
	int myradius=2;
	for (int i=0; i<reprojectPoints.size(); i++)
	{
		if (reprojectPoints[i].x >= 0 && reprojectPoints[i].x <= imgClone.cols && reprojectPoints[i].y >= 0 && reprojectPoints[i].y <= imgClone.rows)
			cv::circle(imgClone, cv::Point(reprojectPoints[i].x, reprojectPoints[i].y), myradius, color,-1,8,0); // Red reprojected points
	}

	return imgClone;
}

/**
   @brief Creates a marker of the 3D car model to be displayed in Rviz
   @param[in] RPY vector containing (Roll, Pitch, Yaw) angles to rotate de model
   @param[in] translation vector containing (x, y, z) translations to translate the model
   @param[in] frameID Rviz frame name
   @return marker is the 3D car model to displayed
 */
visualization_msgs::Marker MultisensorFusion::addCar(const std::vector<double> RPY, const std::vector<double> translation, const std::string frameID)
{
  tf::Quaternion q;
	tf::Vector3 trans;

	if (translation.empty() && RPY.empty()) //user does not want to translate/rotate clouds and sensors.
	{
		trans = tf::Vector3( tfScalar(0), tfScalar(0), tfScalar(0) ); // no translation is done
		q = tf::createQuaternionFromRPY(0.0, 0.0, 0.0 ); // no rotation
	}
	else if (translation.empty()) // only rotation given by the user, no translation
	{
		trans = tf::Vector3( tfScalar(0), tfScalar(0), tfScalar(0) ); // no translation
		q = tf::createQuaternionFromRPY( RPY[0], RPY[1], RPY[2] ); // quaternion computation from given angles
	}
	else // rotation and translation given by the user
	{
		trans = tf::Vector3( tfScalar(translation[0]), tfScalar(translation[1]), tfScalar(translation[2]) ); // translation given by the user
		q = tf::createQuaternionFromRPY( RPY[0], RPY[1], RPY[2] ); // quaternion computation from given angles
	}

	visualization_msgs::Marker marker;
	// Set the frame ID and timestamp.  See the TF tutorials for information on these.
	marker.header.frame_id = frameID;
	marker.header.stamp = ros::Time();
	// Set the namespace and id for this marker.  This serves to create a unique ID
	// Any marker sent with the same namespace and id will overwrite the old one
	marker.ns = "ATLASCAR1";
	marker.id = 0;
	// Set the marker type
	marker.type = visualization_msgs::Marker::MESH_RESOURCE;
	// Set the marker action.  Options are ADD and DELETE
	marker.action = visualization_msgs::Marker::ADD;
	// Set the pose of the marker.  This is a full 6DOF pose relative to the frame/time specified in the header
	marker.pose.position.x = trans[0];
	marker.pose.position.y = trans[1];
	marker.pose.position.z = trans[2];
	marker.pose.orientation.x = q[0];
	marker.pose.orientation.y = q[1];
	marker.pose.orientation.z = q[2];//0.8836;
	marker.pose.orientation.w = q[3];//0.466;
	// Set the scale of the marker -- 1x1x1 here means 1m on a side
	marker.scale.x = 0.01;
	marker.scale.y = 0.01;
	marker.scale.z = 0.01;
	// Set the color
	marker.color.a = 1.0; // Don't forget to set the alpha!
	marker.color.r = 0.50;
	marker.color.g = 0.50;
	marker.color.b = 0.50;
	// Publish the marker
	marker.mesh_resource = "package://multisensor_fusion/STL/ford_escort_atlascar1.stl";
	//car_pub.publish( marker );
  return marker;
}


text:
package org.seasar.doma.jdbc.entity;

import java.lang.reflect.Field;
import org.seasar.doma.DomaNullPointerException;
import org.seasar.doma.OriginalStates;
import org.seasar.doma.internal.WrapException;
import org.seasar.doma.internal.util.ClassUtil;
import org.seasar.doma.internal.util.FieldUtil;

/**
 * An accessor that is access to the field that is annotated with {@link OriginalStates}.
 *
 * @param <E> the entity type
 */
public class OriginalStatesAccessor<E> {

  protected final Class<? super E> entityClass;

  protected final String name;

  protected final Field field;

  /**
   * Creates an instance.
   *
   * @param entityClass the entity class
   * @param name the name of field that is annotated with {@link OriginalStates}
   */
  public OriginalStatesAccessor(Class<? super E> entityClass, String name) {
    if (entityClass == null) {
      throw new DomaNullPointerException("entityClass");
    }
    if (name == null) {
      throw new DomaNullPointerException("name");
    }
    this.entityClass = entityClass;
    this.name = name;
    this.field = getField();
  }

  private Field getField() {
    Field field;
    try {
      field = ClassUtil.getDeclaredField(entityClass, name);
    } catch (WrapException wrapException) {
      throw new OriginalStatesNotFoundException(
          wrapException.getCause(), entityClass.getName(), name);
    }
    if (!FieldUtil.isPublic(field)) {
      try {
        FieldUtil.setAccessible(field, true);
      } catch (WrapException wrapException) {
        throw new OriginalStatesNotFoundException(
            wrapException.getCause(), entityClass.getName(), name);
      }
    }
    return field;
  }

  /**
   * Retrieves the original states from the entity.
   *
   * @param entity the entity
   * @return the original states
   */
  @SuppressWarnings("unchecked")
  public E get(E entity) {
    if (entity == null) {
      throw new DomaNullPointerException("entity");
    }
    try {
      return (E) FieldUtil.get(field, entity);
    } catch (WrapException wrapException) {
      throw new OriginalStatesAccessException(
          wrapException.getCause(), entityClass.getName(), name);
    }
  }

  /**
   * Set the original states to the entity.
   *
   * @param entity the entity
   * @param states the original states
   */
  public void set(E entity, E states) {
    if (entity == null) {
      throw new DomaNullPointerException("entity");
    }
    try {
      FieldUtil.set(field, entity, states);
    } catch (WrapException wrapException) {
      throw new OriginalStatesAccessException(
          wrapException.getCause(), entityClass.getName(), name);
    }
  }
}


text:
require "spec_helper"

describe "Profile page" do

  it "should show profile" do
    user = create :user
    user.activate!

    login_as_user user
    visit root_path
    click_link "profile"

    expect(page).to have_content user.email
  end

  it "should edit profile and delete avatar" do
    user = create :user
    user.activate!

    login_as_user user
    visit profile_path
    click_link "edit_profile"
    fill_in "user_name",    with: "Name Changed"
    attach_file "user_avatar", File.join(Rails.root, "spec", "fixtures", "avatar_test.png")
    click_button "submit_user"

    expect(page).to have_content "Profile was successfully updated."
    user.reload
    expect(page).to_not have_xpath "//img[@src='#{view_context.image_path("avatar/medium/missing.png")}']"
    expect(page).to have_xpath "//img[@src='#{view_context.image_path(user.avatar_url(style: "medium"))}']"
    expect(page).to have_content "Name Changed"

    click_link "delete_avatar"

    expect(page).to have_content "Avatar was successfully deleted."
    expect(page).to have_xpath "//img[@src='#{view_context.image_path("avatar/medium/missing.png")}']"
  end

  it "should show latest urls from user" do
    user = create :user
    url1 = create :url, user: user
    url2 = create :url, user: user
    user.activate!

    login_as_user user
    visit profile_path

    within "#user_urls_list" do
      expect(page).to have_content url1.original
      expect(page).to have_content url1.mini
      expect(page).to have_content url2.original
      expect(page).to have_content url2.mini
    end
  end

end


text:
<?php

namespace PHPHearthSim\Exception\HeroPower;

/**
 * Exception for hero power already used this turn
 *
 * @class HeroPowerAlreadyUsedThisTurnException
 */
class HeroPowerAlreadyUsedThisTurnException extends \Exception {

}


text:
===
FAQ
===

Does Guzzle require cURL?
=========================

No. Guzzle can use any HTTP handler to send requests. This means that Guzzle
can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries
like `React <http://reactphp.org/>`_. You just need to configure an HTTP handler
to use a different method of sending requests.

.. note::

    Guzzle has historically only utilized cURL to send HTTP requests. cURL is
    an amazing HTTP client (arguably the best), and Guzzle will continue to use
    it by default when it is available. It is rare, but some developers don't
    have cURL installed on their systems or run into version specific issues.
    By allowing swappable HTTP handlers, Guzzle is now much more customizable
    and able to adapt to fit the needs of more developers.

Can Guzzle send asynchronous requests?
======================================

Yes. You can use the ``requestAsync``, ``sendAsync``, ``getAsync``,
``headAsync``, ``putAsync``, ``postAsync``, ``deleteAsync``, and ``patchAsync``
methods of a client to send an asynchronous request. The client will return a
``GuzzleHttp\Promise\PromiseInterface`` object. You can chain ``then``
functions off of the promise.

.. code-block:: php

    $promise = $client->requestAsync('GET', 'http://httpbin.org/get');
    $promise->then(function ($response) {
        echo 'Got a response! ' . $response->getStatusCode();
    });

You can force an asynchronous response to complete using the ``wait()`` method
of the returned promise.

.. code-block:: php

    $promise = $client->requestAsync('GET', 'http://httpbin.org/get');
    $response = $promise->wait();

How can I add custom cURL options?
==================================

cURL offer a huge number of `customizable options <http://us1.php.net/curl_setopt>`_.
While Guzzle normalizes many of these options across different handlers, there
are times when you need to set custom cURL options. This can be accomplished
by passing an associative array of cURL settings in the **curl** key of a
request.

For example, let's say you need to customize the outgoing network interface
used with a client.

.. code-block:: php

    $client->request('GET', '/', [
        'curl' => [
            CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'
        ]
    ]);

How can I add custom stream context options?
============================================

You can pass custom `stream context options <http://www.php.net/manual/en/context.php>`_
using the **stream_context** key of the request option. The **stream_context**
array is an associative array where each key is a PHP transport, and each value
is an associative array of transport options.

For example, let's say you need to customize the outgoing network interface
used with a client and allow self-signed certificates.

.. code-block:: php

    $client->request('GET', '/', [
        'stream' => true,
        'stream_context' => [
            'ssl' => [
                'allow_self_signed' => true
            ],
            'socket' => [
                'bindto' => 'xxx.xxx.xxx.xxx'
            ]
        ]
    ]);

Why am I getting an SSL verification error?
===========================================

You need to specify the path on disk to the CA bundle used by Guzzle for
verifying the peer certificate. See :ref:`verify-option`.

What is this Maximum function nesting error?
============================================

    Maximum function nesting level of '100' reached, aborting

You could run into this error if you have the XDebug extension installed and
you execute a lot of requests in callbacks. This error message comes
specifically from the XDebug extension. PHP itself does not have a function
nesting limit. Change this setting in your php.ini to increase the limit::

    xdebug.max_nesting_level = 1000

Why am I getting a 417 error response?
======================================

This can occur for a number of reasons, but if you are sending PUT, POST, or
PATCH requests with an ``Expect: 100-Continue`` header, a server that does not
support this header will return a 417 response. You can work around this by
setting the ``expect`` request option to ``false``:

.. code-block:: php

    $client = new GuzzleHttp\Client();

    // Disable the expect header on a single request
    $response = $client->request('PUT', '/', ['expect' => false]);

    // Disable the expect header on all client requests
    $client = new GuzzleHttp\Client(['expect' => false]);

How can I track a redirected requests?
======================================

You can enable tracking of redirected URIs and status codes via the
`track_redirects` option. Each redirected URI and status code will be stored in the
``X-Guzzle-Redirect-History`` and the ``X-Guzzle-Redirect-Status-History``
header respectively.

The initial request's URI and the final status code will be excluded from the results.
With this in mind you should be able to easily track a request's full redirect path.

For example, let's say you need to track redirects and provide both results
together in a single report:

.. code-block:: php

    // First you configure Guzzle with redirect tracking and make a request
    $client = new Client([
        RequestOptions::ALLOW_REDIRECTS => [
            'max'             => 10,        // allow at most 10 redirects.
            'strict'          => true,      // use "strict" RFC compliant redirects.
            'referer'         => true,      // add a Referer header
            'track_redirects' => true,
        ],
    ]);
    $initialRequest = '/redirect/3'; // Store the request URI for later use
    $response = $client->request('GET', $initialRequest); // Make your request

    // Retrieve both Redirect History headers
    $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History'); // retrieve Redirect URI history
    $redirectCodeHistory = $response->getHeader('X-Guzzle-Redirect-Status-History'); // retrieve Redirect HTTP Status history

    // Add the initial URI requested to the (beginning of) URI history
    array_unshift($redirectUriHistory, $initialRequest);

    // Add the final HTTP status code to the end of HTTP response history
    array_push($redirectCodeHistory, $response->getStatusCode());

    // (Optional) Combine the items of each array into a single result set
    $fullRedirectReport = [];
    foreach ($redirectUriHistory as $key => $value) {
        $fullRedirectReport[$key] = ['location' => $value, 'code' => $redirectCodeHistory[$key]];
    }
    echo json_encode($fullRedirectReport);


text:
DROP TABLE `[prefix]users_social_integration`;
DROP TABLE `[prefix]users_social_integration_contacts`;


text:
require 'mkmf'

dir_config('atomic_ops')
have_func('mmap', 'sys/mman.h') or abort 'mmap() not found'
have_func('munmap', 'sys/mman.h') or abort 'munmap() not found'

$CPPFLAGS += " -D_GNU_SOURCE "
have_func('mremap', 'sys/mman.h')
have_header('linux/tcp.h')

$CPPFLAGS += " -D_BSD_SOURCE "
have_func("getpagesize", "unistd.h")
have_func('rb_thread_blocking_region')
have_func('rb_thread_io_blocking_region')

checking_for "GCC 4+ atomic builtins" do
  # we test CMPXCHG anyways even though we don't need it to filter out
  # ancient i386-only targets without CMPXCHG
  src = <<SRC
int main(int argc, char * const argv[]) {
        unsigned long i = 0;
        __sync_lock_test_and_set(&i, 0);
        __sync_lock_test_and_set(&i, 1);
        __sync_bool_compare_and_swap(&i, 0, 1);
        __sync_add_and_fetch(&i, argc);
        __sync_sub_and_fetch(&i, argc);
        return 0;
}
SRC

  if try_link(src)
    $defs.push(format("-DHAVE_GCC_ATOMIC_BUILTINS"))
    true
  else
    # some compilers still target 386 by default, but we need at least 486
    # to run atomic builtins.
    prev_cflags = $CFLAGS
    $CFLAGS += " -march=i486 "
    if try_link(src)
      $defs.push(format("-DHAVE_GCC_ATOMIC_BUILTINS"))
      true
    else
      prev_cflags = $CFLAGS
      false
    end
  end
end or have_header('atomic_ops.h') or abort <<-SRC

libatomic_ops is required if GCC 4+ is not used.
See https://github.com/ivmai/libatomic_ops

Users of Debian-based distros may run:

  apt-get install libatomic-ops-dev
SRC
create_makefile('raindrops_ext')