text:
// -*- C++ -*-
//
// Copyright (C) 2009-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

/** @file profile/impl/profiler_vector_to_list.h
 *  @brief diagnostics for vector to list.
 */

// Written by Lixia Liu and Silvius Rus.

#ifndef _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H
#define _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H 1

#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"

namespace __gnu_profile
{
  /** @brief A vector-to-list instrumentation line in the object table.  */
  class __vector2list_info
  : public __object_info_base
  {
  public:
    __vector2list_info()
    : _M_shift_count(0), _M_iterate(0), _M_resize(0), _M_list_cost(0),
      _M_vector_cost(0), _M_valid(true) { }

    __vector2list_info(__stack_t __stack)
    : __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
      _M_resize(0), _M_list_cost(0), _M_vector_cost(0), _M_valid(true) { }

    virtual ~__vector2list_info() { }

    __vector2list_info(const __vector2list_info& __o)
    : __object_info_base(__o), _M_shift_count(__o._M_shift_count),
      _M_iterate(__o._M_iterate), _M_resize(__o._M_resize),
      _M_list_cost(__o._M_list_cost), _M_vector_cost(__o._M_vector_cost),
      _M_valid(__o._M_valid) { }

    void
    __merge(const __vector2list_info& __o)
    {
      _M_shift_count  += __o._M_shift_count;
      _M_iterate      += __o._M_iterate;
      _M_vector_cost  += __o._M_vector_cost;
      _M_list_cost    += __o._M_list_cost;
      _M_valid        &= __o._M_valid;
      _M_resize       += __o._M_resize;
    }

    void
    __write(FILE* __f) const
    {
      std::fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n", _M_shift_count,
		   _M_resize, _M_iterate, _M_vector_cost, _M_list_cost);
    }

    float
    __magnitude() const
    { return _M_vector_cost - _M_list_cost; }

    std::string
    __advice() const
    { return "change std::vector to std::list"; }

    std::size_t
    __shift_count()
    { return _M_shift_count; }

    std::size_t
    __iterate()
    { return _M_iterate; }

    float
    __list_cost()
    { return _M_list_cost; }

    std::size_t
    __resize()
    { return _M_resize; }

    void
    __set_list_cost(float __lc)
    { _M_list_cost = __lc; }

    void
    __set_vector_cost(float __vc)
    { _M_vector_cost = __vc; }

    bool
    __is_valid()
    { return _M_valid; }

    void
    __set_invalid()
    { _M_valid = false; }

    void
    __opr_insert(std::size_t __pos, std::size_t __num)
    { _M_shift_count += __num - __pos; }

    void
    __opr_iterate(std::size_t __num)
    { _M_iterate += __num; }

    void
    __resize(std::size_t __from, std::size_t)
    { _M_resize += __from; }

    void
    __opr_find(std::size_t __size)
    {
      // Use average case complexity.
      _M_iterate += 3.0 / 4.0 * __size;
    }

  private:
    std::size_t _M_shift_count;
    std::size_t _M_iterate;
    std::size_t _M_resize;
    float _M_list_cost;
    float _M_vector_cost;
    bool  _M_valid;
  };

  /** @brief A vector-to-list instrumentation line in the stack table.  */
  class __vector2list_stack_info
  : public __vector2list_info
  {
  public:
    __vector2list_stack_info(const __vector2list_info& __o)
    : __vector2list_info(__o) { }
  };

  /** @brief Vector-to-list instrumentation producer.  */
  class __trace_vector_to_list
  : public __trace_base<__vector2list_info, __vector2list_stack_info>
  {
  public:
    __trace_vector_to_list()
    : __trace_base<__vector2list_info, __vector2list_stack_info>()
    { __id = "vector-to-list"; }

    ~__trace_vector_to_list() { }

    // Insert a new node at construct with object, callstack and initial size.
    void
    __insert(__object_t __obj, __stack_t __stack)
    { __add_object(__obj, __vector2list_info(__stack)); }

    // Call at destruction/clean to set container final size.
    void
    __destruct(const void* __obj)
    {
      if (!__is_on())
	return;

      __vector2list_info* __res = __get_object_info(__obj);
      if (!__res)
	return;

      float __vc = __vector_cost(__res->__shift_count(), __res->__iterate(),
				 __res->__resize());
      float __lc = __list_cost(__res->__shift_count(), __res->__iterate(),
			       __res->__resize());
      __res->__set_vector_cost(__vc);
      __res->__set_list_cost(__lc);

      __retire_object(__obj);
    }

    // Find the node in the live map.
    // XXX Undefined?!?
    __vector2list_info* __find(const void* __obj);

    // Collect cost of operations.
    void
    __opr_insert(const void* __obj, std::size_t __pos, std::size_t __num)
    {
      __vector2list_info* __res = __get_object_info(__obj);
      if (__res)
	__res->__opr_insert(__pos, __num);
    }

    void
    __opr_iterate(const void* __obj, std::size_t __num)
    {
      __vector2list_info* __res = __get_object_info(__obj);
      if (__res)
	__res->__opr_iterate(__num);
    }

    void
    __invalid_operator(const void* __obj)
    {
      __vector2list_info* __res = __get_object_info(__obj);
      if (__res)
	__res->__set_invalid();
    }

    void
    __resize(const void* __obj, std::size_t __from, std::size_t __to)
    {
      __vector2list_info* __res = __get_object_info(__obj);
      if (__res)
	__res->__resize(__from, __to);
    }

    float
    __vector_cost(std::size_t __shift, std::size_t __iterate,
		  std::size_t __resize)
    {
      return (__shift
	      * _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
	      + __iterate
	      * _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value
	      + __resize
	      * _GLIBCXX_PROFILE_DATA(__vector_resize_cost_factor).__value);
    }

    float
    __list_cost(std::size_t __shift, std::size_t __iterate,
		std::size_t __resize)
    {
      return (__shift
	      * _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
	      + __iterate
	      * _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value
	      + __resize
	      * _GLIBCXX_PROFILE_DATA(__list_resize_cost_factor).__value);
    }

    void
    __opr_find(const void* __obj, std::size_t __size)
    {
      __vector2list_info* __res = __get_object_info(__obj);
      if (__res)
	__res->__opr_find(__size);
    }
  };

  inline void
  __trace_vector_to_list_init()
  { _GLIBCXX_PROFILE_DATA(_S_vector_to_list) = new __trace_vector_to_list(); }

  inline void
  __trace_vector_to_list_report(FILE* __f, __warning_vector_t& __warnings)
  {
    if (_GLIBCXX_PROFILE_DATA(_S_vector_to_list))
      {
	_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->
	  __collect_warnings(__warnings);
	_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__write(__f);
      }
  }

  inline void
  __trace_vector_to_list_construct(const void* __obj)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__insert(__obj, __get_stack());
  }

  inline void
  __trace_vector_to_list_destruct(const void* __obj)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__destruct(__obj);
  }

  inline void
  __trace_vector_to_list_insert(const void* __obj, std::size_t __pos,
				std::size_t __num)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_insert(__obj, __pos,
							   __num);
  }

  inline void
  __trace_vector_to_list_iterate(const void* __obj, std::size_t __num = 1)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_iterate(__obj, __num);
  }

  inline void
  __trace_vector_to_list_invalid_operator(const void* __obj)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__invalid_operator(__obj);
  }

  inline void
  __trace_vector_to_list_resize(const void* __obj, std::size_t __from,
				std::size_t __to)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__resize(__obj, __from, __to);
  }

  inline void
  __trace_vector_to_list_find(const void* __obj, std::size_t __size)
  {
    if (!__profcxx_init())
      return;

    _GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_find(__obj, __size);
  }

} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H */


text:
// ReSharper disable All

namespace OpenTl.Schema
{
	using System;
	using System.Collections;
	using System.Text;

	using OpenTl.Schema;
	using OpenTl.Schema.Serialization.Attributes;

	[Serialize(0x23ab23d2)]
	public sealed class TInputMediaDocument : IInputMedia
	{
       [SerializationOrder(0)]
       public BitArray Flags {get; set;}

       [SerializationOrder(1)]
       public OpenTl.Schema.IInputDocument Id {get; set;}

       [SerializationOrder(2)]
       [CanSerialize("Flags", 0)]
       public int TtlSeconds {get; set;}

	}
}

redpajama_set_name: RedPajamaGithub


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#ifndef NATIVE_EXTENSION_VTK_VTKOUTPUTSTREAMWRAP_H
#define NATIVE_EXTENSION_VTK_VTKOUTPUTSTREAMWRAP_H

#include <nan.h>

#include <vtkSmartPointer.h>
#include <vtkOutputStream.h>

#include "vtkObjectWrap.h"
#include "../../plus/plus.h"

class VtkOutputStreamWrap : public VtkObjectWrap
{
	public:
		using Nan::ObjectWrap::Wrap;
		static void Init(v8::Local<v8::Object> exports);
		static void InitPtpl();
		static void ConstructorGetter(
			v8::Local<v8::String> property,
			const Nan::PropertyCallbackInfo<v8::Value>& info);

		VtkOutputStreamWrap(vtkSmartPointer<vtkOutputStream>);
		VtkOutputStreamWrap();
		~VtkOutputStreamWrap( );
		static Nan::Persistent<v8::FunctionTemplate> ptpl;

	private:
		static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);

		static void EndWriting(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void StartWriting(const Nan::FunctionCallbackInfo<v8::Value>& info);

#ifdef VTK_NODE_PLUS_VTKOUTPUTSTREAMWRAP_CLASSDEF
		VTK_NODE_PLUS_VTKOUTPUTSTREAMWRAP_CLASSDEF
#endif
};

#endif


text:
package com.connectifier.xeroclient;

import java.io.ByteArrayInputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;

import org.scribe.builder.ServiceBuilder;
import org.scribe.model.OAuthRequest;
import org.scribe.model.Response;
import org.scribe.model.Token;
import org.scribe.model.Verb;
import org.scribe.oauth.OAuthService;

import com.connectifier.xeroclient.models.Account;
import com.connectifier.xeroclient.models.ApiException;
import com.connectifier.xeroclient.models.ArrayOfInvoice;
import com.connectifier.xeroclient.models.ArrayOfBankTransaction;
import com.connectifier.xeroclient.models.ArrayOfManualJournal;
import com.connectifier.xeroclient.models.ArrayOfReceipt;
import com.connectifier.xeroclient.models.BankTransaction;
import com.connectifier.xeroclient.models.BankTransfer;
import com.connectifier.xeroclient.models.BrandingTheme;
import com.connectifier.xeroclient.models.Contact;
import com.connectifier.xeroclient.models.CreditNote;
import com.connectifier.xeroclient.models.Currency;
import com.connectifier.xeroclient.models.Employee;
import com.connectifier.xeroclient.models.ExpenseClaim;
import com.connectifier.xeroclient.models.Invoice;
import com.connectifier.xeroclient.models.Item;
import com.connectifier.xeroclient.models.Journal;
import com.connectifier.xeroclient.models.ManualJournal;
import com.connectifier.xeroclient.models.ObjectFactory;
import com.connectifier.xeroclient.models.Organisation;
import com.connectifier.xeroclient.models.Payment;
import com.connectifier.xeroclient.models.Receipt;
import com.connectifier.xeroclient.models.RepeatingInvoice;
import com.connectifier.xeroclient.models.TaxRate;
import com.connectifier.xeroclient.models.TrackingCategory;
import com.connectifier.xeroclient.models.User;
import com.connectifier.xeroclient.oauth.XeroOAuthService;

public class XeroClient {

  protected static final String BASE_URL = "https://api.xero.com/api.xro/2.0/";
  protected static final DateFormat utcFormatter;
  static {
    utcFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
  }
  protected static final Pattern MESSAGE_PATTERN = Pattern.compile("<Message>(.*)</Message>");

  protected final OAuthService service;
  protected final Token token;
  protected final ObjectFactory objFactory = new ObjectFactory();

  public XeroClient(Reader pemReader, String consumerKey, String consumerSecret) {
    service = new ServiceBuilder()
        .provider(new XeroOAuthService(pemReader))
        .apiKey(consumerKey)
        .apiSecret(consumerSecret)
        .build();
    token = new Token(consumerKey, consumerSecret);
  }

  protected XeroApiException newApiException(Response response) {
    ApiException exception = null;
    try {
      exception = unmarshallResponse(response.getBody(), ApiException.class);
    } catch (Exception e) {
    }
    // Jibx doesn't support xsi:type, so we pull out errors this somewhat-hacky way
    Matcher matcher = MESSAGE_PATTERN.matcher(response.getBody());
    StringBuilder messages = new StringBuilder();
    while (matcher.find()) {
      if (messages.length() > 0) {
        messages.append(", ");
      }
      messages.append(matcher.group(1));
    }
    if (exception == null) {
      if (messages.length() > 0) {
        return new XeroApiException(response.getCode(), messages.toString());
      }
      return new XeroApiException(response.getCode());
    }
    return new XeroApiException(response.getCode(), "Error number " + exception.getErrorNumber() + ". " + messages);
  }

  protected com.connectifier.xeroclient.models.Response get(String endPoint) {
    return get(endPoint, null, null);
  }

  protected com.connectifier.xeroclient.models.Response get(String endPoint, Date modifiedAfter, Map<String,String> params) {
    OAuthRequest request = new OAuthRequest(Verb.GET, BASE_URL + endPoint);
    if (modifiedAfter != null) {
      request.addHeader("If-Modified-Since", utcFormatter.format(modifiedAfter));
    }
    if (params != null) {
      for (Map.Entry<String,String> param : params.entrySet()) {
        request.addQuerystringParameter(param.getKey(), param.getValue());
      }
    }
    service.signRequest(token, request);
    Response response = request.send();
    if (response.getCode() != 200) {
      throw newApiException(response);
    }
    return unmarshallResponse(response.getBody(), com.connectifier.xeroclient.models.Response.class);
  }

  protected com.connectifier.xeroclient.models.Response put(String endPoint, JAXBElement<?> object) {
    OAuthRequest request = new OAuthRequest(Verb.PUT, BASE_URL + endPoint);
    String contents = marshallRequest(object);
    request.setCharset("UTF-8");
    request.addBodyParameter("xml", contents);
    service.signRequest(token, request);
    Response response = request.send();
    if (response.getCode() != 200) {
      throw newApiException(response);
    }
    return unmarshallResponse(response.getBody(), com.connectifier.xeroclient.models.Response.class);
  }

  protected com.connectifier.xeroclient.models.Response post(String endPoint, JAXBElement<?> object) {
    OAuthRequest request = new OAuthRequest(Verb.POST, BASE_URL + endPoint);
    String contents = marshallRequest(object);
    request.setCharset("UTF-8");
    request.addBodyParameter("xml", contents);
    service.signRequest(token, request);
    Response response = request.send();
    if (response.getCode() != 200) {
      throw newApiException(response);
    }
    return unmarshallResponse(response.getBody(), com.connectifier.xeroclient.models.Response.class);
  }

  protected <T> String marshallRequest(JAXBElement<?> object) {
    try {
      JAXBContext context = JAXBContext.newInstance(object.getValue().getClass());
      Marshaller marshaller = context.createMarshaller();
      StringWriter writer = new StringWriter();
      marshaller.marshal(object, writer);
      return writer.toString();
    } catch (JAXBException e) {
      throw new IllegalStateException("Error marshalling request object " + object.getClass(), e);
    }
  }

  protected static <T> T unmarshallResponse(String responseBody, Class<T> clazz) {
    try {
      JAXBContext context = JAXBContext.newInstance(clazz);
      Unmarshaller unmarshaller = context.createUnmarshaller();
      Source source = new StreamSource(new ByteArrayInputStream(responseBody.getBytes()));
      return unmarshaller.unmarshal(source, clazz).getValue();
    } catch (JAXBException e) {
      throw new IllegalStateException("Error unmarshalling response: " + responseBody, e);
    }
  }

  protected void addToMapIfNotNull(Map<String,String> map, String key, Object value) {
    if (value != null) {
      map.put(key, value.toString());
    }
  }

  protected <T> T singleResult(List<T> list) {
    if (list.isEmpty()) {
      return null;
    }
    if (list.size() > 1) {
      throw new IllegalStateException("Got multiple results for query");
    }
    return list.get(0);
  }

  public Account getAccount(String id) {
    return singleResult(get("Accounts/" + id).getAccounts());
  }

  public List<Account> getAccounts() {
    return get("Accounts").getAccounts();
  }

  public List<Account> getAccounts(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Accounts", modifiedAfter, params).getAccounts();
  }

  public BankTransaction getBankTransaction(String id) {
    return singleResult(get("BankTransactions/" + id).getBankTransactions());
  }

  public List<BankTransaction> getBankTransactions() {
    return get("BankTransactions").getBankTransactions();
  }

  public List<BankTransaction> getBankTransactions(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("BankTransactions", modifiedAfter, params).getBankTransactions();
  }

  public List<BankTransaction> createBankTransactions(List<BankTransaction> bankTransactions) {
    ArrayOfBankTransaction array = new ArrayOfBankTransaction();
    array.getBankTransaction().addAll(bankTransactions);
    return put("BankTransactions", objFactory.createBankTransactions(array)).getBankTransactions();
  }

  public List<BankTransaction> createBankTransaction(BankTransaction bankTransaction) {
    return createBankTransactions(Arrays.asList(bankTransaction));
  }

  public List<BankTransfer> getBankTransfers() {
    return get("BankTransfers").getBankTransfers();
  }

  public List<BrandingTheme> getBrandingThemes() {
    return get("BrandingThemes").getBrandingThemes();
  }

  public List<BankTransaction> getBrandingThemes(String name, Integer sortOrder, Date createdDateUTC) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Name", name);
    addToMapIfNotNull(params, "sortOrder", sortOrder);
    if (createdDateUTC != null) {
      params.put("CreatedDateUTC", utcFormatter.format(createdDateUTC));
    }
    return get("BankTransactions", null, params).getBankTransactions();
  }

  public Contact getContact(String id) {
    return singleResult(get("Contacts/" + id).getContacts());
  }

  public List<Contact> getContacts() {
    return get("Contacts").getContacts();
  }

  public List<Contact> getContacts(Date modifiedAfter, String where, String order, Integer page, Boolean includedArchive) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    addToMapIfNotNull(params, "page", page);
    addToMapIfNotNull(params, "includeArchived", includedArchive);
    return get("Contacts", modifiedAfter, params).getContacts();
  }

  public CreditNote getCreditNote(String id) {
    return singleResult(get("CreditNotes/" + id).getCreditNotes());
  }

  public List<CreditNote> getCreditNotes() {
    return get("CreditNotes").getCreditNotes();
  }

  public List<CreditNote> getCreditNotes(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("CreditNotes", modifiedAfter, params).getCreditNotes();
  }

  public List<Currency> getCurrencies() {
    return get("Currencies").getCurrencies();
  }

  public Employee getEmployee(String id) {
    return singleResult(get("Employees/" + id).getEmployees());
  }

  public List<Employee> getEmployees() {
    return get("Employees").getEmployees();
  }

  public List<Employee> getEmployees(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Employees", modifiedAfter, params).getEmployees();
  }

  public List<ExpenseClaim> getExpenseClaim(String id) {
    return get("ExpenseClaims/" + id).getExpenseClaims();
  }

  public List<ExpenseClaim> getExpenseClaims() {
    return get("ExpenseClaims").getExpenseClaims();
  }

  public List<ExpenseClaim> getExpenseClaims(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("ExpenseClaims", modifiedAfter, params).getExpenseClaims();
  }

  public Invoice getInvoice(String id) {
    return singleResult(get("Invoices/" + id).getInvoices());
  }

  public List<Invoice> getInvoices() {
    return get("Invoices").getInvoices();
  }

  public List<Invoice> getInvoices(Date modifiedAfter, String where, String order, Integer page) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    addToMapIfNotNull(params, "page", page);
    return get("Invoices", modifiedAfter, params).getInvoices();
  }

  public List<Invoice> createInvoice(Invoice invoice) {
    return put("Invoices", objFactory.createInvoice(invoice)).getInvoices();
  }

  public List<Invoice> updateInvoice(Invoice invoice) {
    return post("Invoices", objFactory.createInvoice(invoice)).getInvoices();
  }

  public List<Receipt> createReceipts(List<Receipt> receipts) {
    ArrayOfReceipt array = new ArrayOfReceipt();
    array.getReceipt().addAll(receipts);
    return put("Receipts", objFactory.createReceipts(array)).getReceipts();
  }

  public List<Receipt> createReceipt(Receipt receipt) {
    return createReceipts(Arrays.asList(receipt));
  }

  public List<Invoice> createInvoices(List<Invoice> invoices) {
    ArrayOfInvoice array = new ArrayOfInvoice();
    array.getInvoice().addAll(invoices);
    return put("Invoices", objFactory.createInvoices(array)).getInvoices();
  }

  public List<Invoice> updateInvoices(List<Invoice> invoices) {
    ArrayOfInvoice array = new ArrayOfInvoice();
    array.getInvoice().addAll(invoices);
    return post("Invoices", objFactory.createInvoices(array)).getInvoices();
  }

  public Item getItem(String id) {
    return singleResult(get("Items/" + id).getItems());
  }

  public List<Item> getItems() {
    return get("Items").getItems();
  }

  public List<Item> getItems(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Items", modifiedAfter, params).getItems();
  }

  public Journal getJournal(String id) {
    return singleResult(get("Journal").getJournals());
  }

  public List<Journal> getJournals() {
    return get("Journals").getJournals();
  }

  public List<Journal> getJournals(Date modifiedAfter, Integer offset, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "offset", offset);
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Journals", modifiedAfter, params).getJournals();
  }

  public ManualJournal getManualJournal(String id) {
    return singleResult(get("ManualJournals/" + id).getManualJournals());
  }

  public List<ManualJournal> getManualJournals() {
    return get("ManualJournals").getManualJournals();
  }

  public List<ManualJournal> getManualJournals(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("ManualJournal", modifiedAfter, params).getManualJournals();
  }

  public List<ManualJournal> createManualJournals(List<ManualJournal> manualJournals) {
    ArrayOfManualJournal array = new ArrayOfManualJournal();
    array.getManualJournal().addAll(manualJournals);
    return put("ManualJournals", objFactory.createManualjournals(array)).getManualJournals();
  }

  public Organisation getOrganisation() {
    return singleResult(get("Organisation").getOrganisations());
  }

  public Payment getPayments(String id) {
    return singleResult(get("Payments/" + id).getPayments());
  }

  public List<Payment> getPayments() {
    return get("Payments").getPayments();
  }

  public List<Payment> getPayments(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Payments", modifiedAfter, params).getPayments();
  }

  public Receipt getReceipt(String id) {
    return singleResult(get("Receipts/" + id).getReceipts());
  }

  public List<Receipt> getReceipts() {
    return get("Receipts").getReceipts();
  }

  public List<Receipt> getReceipts(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Receipts", modifiedAfter, params).getReceipts();
  }

  public List<RepeatingInvoice> getRepeatingInvoices() {
    return get("RepeatingInvoices").getRepeatingInvoices();
  }

  public List<TaxRate> getTaxRates() {
    return get("TaxRates").getTaxRates();
  }

  public List<TaxRate> getTaxRates(String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("TaxRates", null, params).getTaxRates();
  }

  public TrackingCategory getTrackingCategory(String id) {
    return singleResult(get("TrackingCategories/" + id).getTrackingCategories());
  }

  public List<TrackingCategory> getTrackingCategories() {
    return get("TrackingCategories").getTrackingCategories();
  }

  public List<TrackingCategory> getTrackingCategories(String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("TrackingCategories", null, params).getTrackingCategories();
  }

  public User getUser(String id) {
    return singleResult(get("Users/" + id).getUsers());
  }

  public List<User> getUsers() {
    return get("Users").getUsers();
  }

  public List<User> getUsers(Date modifiedAfter, String where, String order) {
    Map<String, String> params = new HashMap<>();
    addToMapIfNotNull(params, "Where", where);
    addToMapIfNotNull(params, "order", order);
    return get("Users", modifiedAfter, params).getUsers();
  }

}


text:
<?php
class ModelCatalogReview extends Model {
	public function addReview($product_id, $data) {
		$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW()");

		$review_id = $this->db->getLastId();

		if (in_array('review', (array)$this->config->get('config_mail_alert'))) {
			$this->load->language('mail/review');
			$this->load->model('catalog/product');

			$product_info = $this->model_catalog_product->getProduct($product_id);

			$subject = sprintf($this->language->get('text_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));

			$message  = $this->language->get('text_waiting') . "\n";
			$message .= sprintf($this->language->get('text_product'), html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8')) . "\n";
			$message .= sprintf($this->language->get('text_reviewer'), html_entity_decode($data['name'], ENT_QUOTES, 'UTF-8')) . "\n";
			$message .= sprintf($this->language->get('text_rating'), $data['rating']) . "\n";
			$message .= $this->language->get('text_review') . "\n";
			$message .= html_entity_decode($data['text'], ENT_QUOTES, 'UTF-8') . "\n\n";

			$mail = new Mail();
			$mail->protocol = $this->config->get('config_mail_protocol');
			$mail->parameter = $this->config->get('config_mail_parameter');
			$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
			$mail->smtp_username = $this->config->get('config_mail_smtp_username');
			$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
			$mail->smtp_port = $this->config->get('config_mail_smtp_port');
			$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

			$mail->setTo($this->config->get('config_email'));
			$mail->setFrom($this->config->get('config_email'));
			$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
			$mail->setSubject($subject);
			$mail->setText($message);
			$mail->send();

			// Send to additional alert emails
			$emails = explode(',', $this->config->get('config_alert_email'));

			foreach ($emails as $email) {
				if ($email && filter_var($email, FILTER_VALIDATE_EMAIL)) {
					$mail->setTo($email);
					$mail->send();
				}
			}
		}
	}

	public function getReviewsByProductId($product_id, $start = 0, $limit = 20) {
		if ($start < 0) {
			$start = 0;
		}

		if ($limit < 1) {
			$limit = 20;
		}

		$query = $this->db->query("SELECT r.review_id, r.author, r.rating, r.text, p.product_id, pd.name, p.price, p.image, r.date_added FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY r.date_added DESC LIMIT " . (int)$start . "," . (int)$limit);

		return $query->rows;
	}

	public function getTotalReviewsByProductId($product_id) {
		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r LEFT JOIN " . DB_PREFIX . "product p ON (r.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND p.date_available <= NOW() AND p.status = '1' AND r.status = '1' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");

		return $query->row['total'];
	}
}


text:
using namespace boost::python;
using namespace Gaffer;
using namespace GafferUI;

namespace
{

class ViewWrapper : public GafferBindings::NodeWrapper<View>
{

	public :

		ViewWrapper( PyObject *self, const std::string &name, PlugPtr input )
			:	GafferBindings::NodeWrapper<View>( self, name, input )
		{
		}

};

struct ViewCreator
{
	ViewCreator( object fn )
		:	m_fn( fn )
	{
	}

	ViewPtr operator()( Gaffer::PlugPtr plug )
	{
		IECorePython::ScopedGILLock gilLock;
		ViewPtr result = extract<ViewPtr>( m_fn( plug ) );
		return result;
	}

	private :

		object m_fn;

};

void registerView1( IECore::TypeId plugType, object creator )
{
	View::registerView( plugType, ViewCreator( creator ) );
}

void registerView2( IECore::TypeId nodeType, const std::string &plugPath, object creator )
{
	View::registerView( nodeType, plugPath, ViewCreator( creator ) );
}

ViewPtr create( Gaffer::PlugPtr input )
{
	IECorePython::ScopedGILRelease gilRelease;
	return View::create( input );
}

} // namespace

namespace GafferUIModule
{

Gaffer::NodePtr getPreprocessor( View &v )
{
	return v.getPreprocessor();
}

void bindView()
{
	GafferBindings::NodeClass<View, ViewWrapper>( nullptr, no_init )
		.def( init<const std::string &, PlugPtr>() )
		.def( "editScope", (EditScope *(View::*)())&View::editScope, return_value_policy<IECorePython::CastToIntrusivePtr>() )
		.def( "getContext", (Context *(View::*)())&View::getContext, return_value_policy<IECorePython::CastToIntrusivePtr>() )
		.def( "setContext", &View::setContext )
		.def( "contextChangedSignal", &View::contextChangedSignal, return_internal_reference<1>() )
		.def( "viewportGadget", (ViewportGadget *(View::*)())&View::viewportGadget, return_value_policy<IECorePython::CastToIntrusivePtr>() )
		.def( "_setPreprocessor", &View::setPreprocessor )
		.def( "_getPreprocessor", &getPreprocessor )
		.def( "create", &create )
		.staticmethod( "create" )
		.def( "registerView", &registerView1 )
		.def( "registerView", &registerView2 )
		.staticmethod( "registerView" )
	;
}

} // namespace GafferUIModule


text:
package org.jetbrains.plugins.scala
package lang
package findUsages

import com.intellij.lang.cacheBuilder.WordsScanner
import com.intellij.lang.findUsages.FindUsagesProvider
import com.intellij.psi._
import com.intellij.psi.util.{PsiFormatUtil, PsiFormatUtilBase}
import org.jetbrains.annotations.{NotNull, Nullable}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScNamedElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition
import org.jetbrains.plugins.scala.lang.psi.impl.toplevel.PsiClassFake

class ScalaFindUsagesProvider extends FindUsagesProvider {
  @Nullable
  override def getWordsScanner: WordsScanner = new ScalaWordsScanner()

  override def canFindUsagesFor(element: PsiElement): Boolean = {
    element match {
      case _: ScNamedElement | _: PsiMethod | _: PsiClass | _: PsiVariable => true
      case _ => false
    }
  }

  @Nullable
  override def getHelpId(psiElement: PsiElement): String = null

  @NotNull
  override def getType(element: PsiElement): String = ScalaFindUsagesUtil.getType(element)

  @NotNull
  override def getDescriptiveName(element: PsiElement): String = {
    val name = element match {
      case x: PsiMethod =>
        var res = PsiFormatUtil.formatMethod(x, PsiSubstitutor.EMPTY,
        PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS,
        PsiFormatUtilBase.SHOW_TYPE)
        if (x.containingClass != null) res = res + " of " + getDescriptiveName(x.containingClass)
        res
      case x: PsiVariable => x.name
      case x: PsiFile => x.name
      case x: ScTypeDefinition => x.qualifiedName
      case x: ScNamedElement => x.name
      case c: PsiClass if !c.isInstanceOf[PsiClassFake] => c.qualifiedName
      case _ => element.getText
    }
    Option(name) getOrElse "anonymous"
  }

  @NotNull
  override def getNodeText(element: PsiElement, useFullName: Boolean): String = {
    val name = element match {
      case c: PsiMethod => PsiFormatUtil.formatMethod(c, PsiSubstitutor.EMPTY,
              PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS,
              PsiFormatUtilBase.SHOW_TYPE)
      case c: PsiVariable => c.name
      case c: PsiFile => c.name
      case c: ScTypeDefinition => if (useFullName) c.qualifiedName else c.name
      case c: ScNamedElement => c.name
      case c: PsiClass if !c.isInstanceOf[PsiClassFake] => if (useFullName) c.qualifiedName else c.name
      case _ => element.getText
    }
    Option(name) getOrElse "anonymous"
  }
}


text:
function svgSave(){
  try {
    var isFileSaverSupported = !!new Blob;
    var d = $('#gview');
    var blob = new Blob([d.html()], {type: "text/plain;charset=utf-8"});
    saveAs(blob, "network.svg");
  } catch (e) {
    w2alert('FileSaver.js is not supported! Use a modern browser...
'+
            'FileSaver.js is supported by Firefox 20+, Chrome, Chrome
'+
            'for Android, IE 10+, Opera 15+ and Safari 6.1+',
            'File Save Failed!');
  }
}


text:
/* global $:true */

'use strict';

// conversation variables
var conversation_id, client_id,contextid,username;
console.log('usernamelog='+$("#username").val());
username = $("#username").val();

var inputHistory = [];
var inputHistoryPointer = -1

var $chatInput = $('.chat-window--message-input'),
$jsonPanel = $('#json-panel .base--textarea'),
$information = $('.data--information'),
$profile = $('.data--profile'),
$loading = $('.loader');
//Further changes
var $infoConfidence = $('.data--info_confidence');

$chatInput.keyup(function(event){
if(event.keyCode === 13) {
  converse($(this).val());
}
});

$chatInput.keydown(function(event){
switch(event.which){
	case 13: // enter
	  inputHistory.push($chatInput.val());
	  inputHistory.push($leaveBtn.val());
	  inputHistoryPointer = inputHistory.length;
	break;
	case 38: // up
	if(inputHistoryPointer > 0){
	   inputHistoryPointer--;
	   $chatInput.val(inputHistory[inputHistoryPointer]);
	}

	break;
	case 40: // down
	if(inputHistory.length > 0 && inputHistoryPointer < inputHistory.length - 1){
	   inputHistoryPointer++;
	   $chatInput.val(inputHistory[inputHistoryPointer]);
	}
  else if(inputHistoryPointer == inputHistory.length - 1){
    $chatInput.val("");
    inputHistoryPointer++;
  }
	break;
}

});

var converse = function(userText) {
	console.log("In converse:", userText);

$loading.show();
// $chatInput.hide();

// check if the user typed text or not
if (typeof(userText) !== undefined && $.trim(userText) !== '')
  submitMessage(userText);

// build the conversation parameters
var params = { input : userText,contextid : contextid,username : username};

// check if there is a conversation in place and continue that
// by specifing the conversation_id and client_id
if (conversation_id) {
  params.conversation_id = conversation_id;
  params.client_id = client_id;
}

//call NLC here first
//If we get something not related to BYOD then return

$.post('mainflow.do', params)//dialog
  .done(function onSuccess(result) {

	  var dialog = "";

		try {
			  result = JSON.parse(result);
			  dialog = result.text;
			  contextid = result.contextid;
			  console.info(result.contextid);
		} catch (e) {
			dialog = result;
		}

	$chatInput.val(''); // clear the text input
	var response =  dialog;
	if(dialog.conversation)
		$jsonPanel.html(JSON.stringify(dialog.conversation, null, 2));

    // update conversation variables
	if(dialog.conversation)
	{
		conversation_id = dialog.conversation.conversation_id;
		client_id = dialog.conversation.client_id;
		var texts = dialog.conversation.response;
		response = texts.join('
'); // <br/> is

	}
    $chatInput.show();
    $chatInput[0].focus();

    $information.empty();
    $infoConfidence.empty();

	if(dialog.conversation)
	{
		addProperty($information, 'Dialog ID: ', dialog.dialog_id);
		addProperty($information, 'Conversation ID: ', conversation_id);
		addProperty($information, 'Client ID: ', client_id);
		addProperty($infoConfidence, 'Confidence: ', dialog.confidence);
	}
	talk('WATSON', response); // show

	if(dialog.conversation)
		getProfile();
  })
  .fail(function(error){
    talk('WATSON', error.responseJSON ? error.responseJSON.error : error.statusText);
  })
  .always(function always(){

    $loading.hide();
    scrollChatToBottom();
    $chatInput.focus();
  });

};

var getProfile = function() {
var params = {
  conversation_id: conversation_id,
  client_id: client_id
};

$.post('/profile', params).done(function(data) {
  $profile.empty();
  data.name_values.forEach(function(par) {
    if (par.value !== '')
      addProperty($profile, par.name + ':', par.value);
  });
}).fail(function(error){
  talk('WATSON', error.responseJSON ? error.responseJSON.error : error.statusText);
});
};

var scrollChatToBottom = function() {
var element = $('.chat-box--pane');
element.animate({
  scrollTop: element[0].scrollHeight
}, 420);
};

var scrollToInput = function() {
  var element = $('.chat-window--message-input');
  $('body, html').animate({
    scrollTop: (element.offset().top - window.innerHeight + element[0].offsetHeight) + 20 + 'px'
  });
};

function getTagContent(text, tagName){

var linkRegexp = new RegExp("<"+tagName+">(((?!<\/"+tagName+">).)*)</"+tagName+">", "g")
var arr = [];
var matchedLinks;

while(matchedLinks = linkRegexp.exec(text)){
arr.push(matchedLinks[1]);
}
return arr;
}

function replaceMctLinksByHtmlLinks(text){
var text = text;
var linksContent = getTagContent(text, "mct:link");

linksContent.forEach(function(item){
var url = getTagContent(item, "mct:url")[0];
var label = getTagContent(item, "mct:label")[0];

var link = ""+label+"";

var regExp = new RegExp("<mct:link>"+item+"</mct:link>", "g");

text = text.replace(regExp, link);

});

return text;
}

function replaceAutolearnItemsByButtons(text){
var output = text;
var itemsContent = getTagContent(text, "mct:autolearnitems");

itemsContent.forEach(function(itemGroup){
var itemsText = getTagContent(itemGroup, "mct:item");

itemsText.forEach(function(innerText){
    var regExp = new RegExp("<mct:item>"+innerText+"</mct:item>", "g");
    var button = "<button class=\"wds-input\">"+innerText+"</button>
";
    output = output.replace(regExp, button);
});

});

output = output.replace(/<mct:autolearnitems>/g, "");
output = output.replace(/<\/mct:autolearnitems>/g, "");

return output;
}

var postProcessOutput = function(text) {
  var output = text.replace(/<mct:input>/g, "<button class=\"wds-input\">");
  output = output.replace(/<\/mct:input>/g, "</button>");
  output = replaceMctLinksByHtmlLinks(output);
  output = replaceAutolearnItemsByButtons(output);
  return output;
};

var talk = function(origin, text) {
var $chatBox = $('.chat-box--item_' + origin).first().clone();
var $loading = $('.loader');
var text = postProcessOutput(text);
$chatBox.find('p').html($('
').html(text).html());
// $('.chat-box--pane').append($chatBox);
$chatBox.insertBefore($loading);
setTimeout(function() {
  $chatBox.removeClass('chat-box--item_HIDDEN');
}, 100);

$chatBox.find('button.wds-input').click(function(){
  var text = $(this).text();
  converse(text);
  inputHistory.push(text);
  inputHistoryPointer = inputHistory.length;
});

};

var addProperty = function($parent, name, value) {
var $property = $('.data--variable').last().clone();
$property.find('.data--variable-title').text(name);
$property.find('.data--variable-value').text(value);
$property.appendTo($parent);
setTimeout(function() {
  $property.removeClass('hidden');
}, 100);
};

var submitMessage = function(text) {
talk('YOU', text);
scrollChatToBottom();
clearInput();
};

var clearInput = function() {
$('.chat-window--message-input').val('');
};

$('.tab-panels--tab').click(function(e){
e.preventDefault();
var self = $(this);
var inputGroup = self.closest('.tab-panels');
var idName = null;

inputGroup.find('.active').removeClass('active');
self.addClass('active');
idName = self.attr('href');
$(idName).addClass('active');
});

$(document).ready(function () {
  // Initialize the conversation
  converse();
  scrollToInput();
});


text:
class GuardInvestigateState :
	public GuardState
{
public:
	GuardInvestigateState();
	~GuardInvestigateState();

	void Enter();
	void Exit();
	void Init(int number, sf::Vector2f* p_position, AnimatedSprite* sprite);
	bool Update();
	std::string Next();
	bool IsType(const std::string &c_type);
	void Cleanup();
	void UpdateAnimation();
	void AddWaypointToFront(sf::Vector2f waypoint);
	bool Detected(sf::Vector2f player_detected, CollisionManager* p_collisionManager);

private:
	void Movement();
};


text:
<?php

namespace DJBlaster\BlasterBundle\Entity;

use Doctrine\ORM\EntityRepository;

use DJBlaster\BlasterBundle\Entity\AdShowSponsorship;

/**
 * DJReadShowSponsorshipRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class DJReadShowSponsorshipRepository extends EntityRepository
{
    public function findAllForShow(AdShowSponsorship $show)
    {
        return $this->findBy(array('showSponsorship' => $show), array('time_read' => 'ASC'));
    }

    public function getRecentReads($numToGet)
    {
        $fields = array(
            'r.dj_initials',
            'r.time_read',
            's.ad_name',
            'u.id as customer_id',
            'u.name as customer_name',
            'c.campaign_id',
            'c.campaign_name'
        );

        $qb = $this->createQueryBuilder('r');
        $query = $qb->select($fields)
            ->innerJoin('DJBlasterBundle:AdShowSponsorship', 's', 'WITH', 's.sponsorship_id = r.showSponsorship')
            ->innerJoin('DJBlasterBundle:CustomerCampaign', 'c', 'WITH', 'c.campaign_id = s.campaign')
            ->innerJoin('DJBlasterBundle:Customer', 'u', 'WITH', 'u.id = s.customer')
            ->orderBy('r.time_read', 'DESC')
            ->setMaxResults($numToGet)
            ->getQuery();

        $result =  $query->getResult();
        //echo $query->getSql();var_dump($query->getParameters());die;
        return $result;
    }
}


text:
#ifndef _SYS_STACKSHOT_H
#define _SYS_STACKSHOT_H

#include <stdint.h>

#define STACKSHOT_CONFIG_TYPE 1

typedef struct stackshot_config {
	/* Input options */
	int		sc_pid;			/* PID to trace, or -1 for the entire system */
	uint32_t	sc_flags;		/* Stackshot flags */
	uint64_t	sc_delta_timestamp;	/* Retrieve a delta stackshot of system state that has changed since this time */

	/* Stackshot results */
	uint64_t	sc_buffer;		/* Pointer to stackshot buffer */
	uint32_t	sc_size;		/* Length of the stackshot buffer */

	/* Internals */
	uint64_t	sc_out_buffer_addr;	/* Location where the kernel should copy the address of the newly mapped buffer in user space */
	uint64_t	sc_out_size_addr;	/* Location where the kernel should copy the size of the stackshot buffer */
} stackshot_config_t;

stackshot_config_t * stackshot_config_create(void);
int stackshot_config_set_pid(stackshot_config_t * stackshot_config, int pid);
int stackshot_config_set_flags(stackshot_config_t * stackshot_config, uint32_t flags);
int stackshot_capture_with_config(stackshot_config_t * stackshot_config);
void * stackshot_config_get_stackshot_buffer(stackshot_config_t * stackshot_config);
uint32_t stackshot_config_get_stackshot_size(stackshot_config_t * stackshot_config);
int stackshot_config_set_size_hint(stackshot_config_t * stackshot_config, uint32_t suggested_size);
int stackshot_config_set_delta_timestamp(stackshot_config_t * stackshot_config, uint64_t delta_timestamp);
int stackshot_config_dealloc_buffer(stackshot_config_t * stackshot_config);
int stackshot_config_dealloc(stackshot_config_t * stackshot_config);

#endif /* _SYS_STACKSHOT_H */


text:
1. Fork the repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch to the **master** branch

It is very important to separate new features or improvements into separate feature branches, and to send a
pull request for each branch. This allows me to review and pull in new features or improvements individually.

## Style Guide

All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).

## Unit Testing

All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses phpunit for testing.

[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/)


text:
	<title>Tim Key's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Tim Key's panel show appearances

Tim Key (born 1976-09-02[ref]) has appeared in 9 episodes between 2010-2015.  Tim Key on IMDB. Tim Key on Wikipedia. Tim Key on Chortle.

2010

2011

2012

2013

2014

2015

2015-09-01 / Taskmaster

2015-08-25 / Taskmaster

2015-08-18 / Taskmaster

2015-08-11 / Taskmaster

2015-08-04 / Taskmaster

2015-07-28 / Taskmaster

2014-06-27 / 8 Out of 10 Cats Does Countdown

2013-04-12 / 8 Out of 10 Cats Does Countdown

2010-11-25 / Never Mind The Buzzcocks


text:
Pizza SimplePizzaFactory::createPizza(std::string type) {

    if (type == "cheese") {
        return CheesePizza();
    } else if (type == "pepperoni") {
        return PepperoniPizza();
    } else if (type == "clam") {
        return ClamPizza();
    } else if (type == "veggie") {
        return VeggiePizza();
    }
}


text:
from . import _import

from ..node import Node
from ..expr.nameexpr import NameExpr

class VariableDeclarator(Node):
    def __init__(self, kwargs={}, id_str="", type_obj=None, init_obj=None):
        if kwargs.get(u'id', id_str):
            super(VariableDeclarator, self).__init__(kwargs)
            locs = _import()

            # VariableDeclaratorId
            if id_str:
                self._id = locs[u'VariableDeclaratorId'](name_str=id_str)
            else:
                self._id = locs[u'VariableDeclaratorId'](kwargs.get(u'id'))

            # Type type
            if type_obj:
                self._typ = type_obj
            else:
                typ = kwargs.get(u'type')
                self._typ = locs[typ[u'@t']](typ) if typ else None

            # Expression
            if init_obj:
                self._init = init_obj
            else:
                i = kwargs.get('init')

                self._init = locs[i[u'@t']](i) if i else None
            # if self._init and self.parentNode and not self._typ:
            #     self._init.typee = self.parentNode.typee

            self.add_as_parent([self.idd, self.init])

    def to_name_expr(self):
        expr = NameExpr()
        expr.name = self.name
        return expr

    @property
    def idd(self): return self._id
    @idd.setter
    def idd(self, v): self._id = v

    @property
    def name(self): return self._id.name
    @name.setter
    def name(self, v): self._id.name = v

    @property
    def init(self): return self._init
    @init.setter
    def init(self, v): self._init = v

    @property
    def lbl(self): return (self.name, self.ati)
    @lbl.setter
    def lbl(self, v): self._lbl = v

    @property
    def typee(self): return self._typ if self._typ else self.parentNode.typee
    @typee.setter
    def typee(self, v): self._typ = v

    def gen(self): return set([self.lbl]) if self.init else set([])

    def __str__(self): return str(self.idd)


text:
#ifndef YTUIWOWFOOJAF_VN_TYPE_LIST_DETAIL_H_
#define YTUIWOWFOOJAF_VN_TYPE_LIST_DETAIL_H_

/*-----------------------------------------------------------------------------
    Mikel Negugogor (http://github.com/mikelneg)

    Implementation details for vn::type_list -- shouldn't be used directly..
-----------------------------------------------------------------------------*/

#include <type_traits> // for std::true_type/std::false_type

namespace vn {

template <typename... Args>
struct type_list;

namespace detail {

    template <typename... Args>
    struct discharge_ {
        template <template <typename...> typename TT>
        using into = TT<Args...>;
    };

    template <typename... Args, template <typename...> typename XX>
    struct discharge_<XX<Args...>> {
        template <template <typename...> typename TT>
        using into = TT<Args...>;
    };

    inline namespace filter {
        template <typename, typename... Args>
        struct filter_;

        template <typename F, typename H, typename... Args>
        struct filter_<F, H, Args...> {
            template <typename... TArgs>
            using type = typename filter_<F, Args...>::template type<TArgs..., H>;
        };

        template <typename F, typename... Args>
        struct filter_<F, F, Args...> {
            template <typename... TArgs>
            using type = typename filter_<F, Args...>::template type<TArgs...>;
        };

        template <typename T>
        struct filter_<T> {
            template <typename... TArgs>
            using type = type_list<TArgs...>;
        };

        template <typename... Args> // compatibility_helper used to avoid ICE in msvc...
        struct compatibility_helper_filter_ {
            using type = typename filter_<Args...>::template type<>;
        };

        template <typename... Args> // generalizes filter_<> to work with none-or-many filter types
        struct filter_list_;

        template <>
        struct filter_list_<> {
            template <typename... TArgs>
            using type = type_list<TArgs...>;
        };

        template <typename T, typename... Args>
        struct filter_list_<T, Args...> {
            template <typename... TArgs>
            using type =
                typename discharge_<typename compatibility_helper_filter_<T, TArgs...>::type>::template into<typename filter_list_<Args...>::template type>;
        };

        template <typename F, typename L> // compatibility_helper used to avoid ICE in msvc...
        struct compatibility_helper_filter_list_ {
            using type = typename discharge_<L>::template into<typename discharge_<F>::template into<filter_list_>::template type>;
        };
    }

    inline namespace unique {
        template <typename T>
        struct unique_;

        template <typename T, typename... Args>
        struct unique_<type_list<T, Args...>> {
            template <typename... TArgs>
            using type = typename unique_<typename filter_list_<T>::template type<Args...>>::template type<TArgs..., T>;
        };

        template <>
        struct unique_<type_list<>> {
            template <typename... TArgs>
            using type = type_list<TArgs...>;
        };

        template <typename... Args>
        struct compatibility_helper_unique_ {
            using type = typename unique_<type_list<Args...>>::template type<>;
        };
    }

    inline namespace merge {
        template <typename...>
        struct merge_lists_;

        template <typename... TArgs>
        struct merge_lists_<type_list<TArgs...>> {
            using type = type_list<TArgs...>;
        };

        template <typename... TArgs, typename... RArgs>
        struct merge_lists_<type_list<TArgs...>, type_list<RArgs...>> {
            using type = type_list<TArgs..., RArgs...>;
        };

        template <typename... TArgs, typename... RArgs, typename... Args>
        struct merge_lists_<type_list<TArgs...>, type_list<RArgs...>, Args...> {
            using type = typename merge_lists_<type_list<TArgs..., RArgs...>, Args...>::type;
        };

        template <typename... Args>
        struct merge_ {
            using type = typename merge_lists_<typename discharge_<Args>::template into<type_list>...>::type;
        };
    }

    inline namespace apply_op {
        template <template <typename> typename TT, typename PairwiseOp, typename... Args>
        struct apply_;

        template <template <typename> typename TT, typename PairwiseOp, typename T, typename H, typename P, typename... Args>
        struct apply_<TT, PairwiseOp, T, H, P, Args...> {
            using result = decltype(PairwiseOp{}(TT<T>{}, typename apply_<TT, PairwiseOp, H, P, Args...>::result{}));
        };

        template <template <typename> typename TT, typename PairwiseOp, typename T, typename H>
        struct apply_<TT, PairwiseOp, T, H> {
            using result = decltype(PairwiseOp{}(TT<T>{}, TT<H>{}));
        };

        template <template <typename> typename TT, typename PairwiseOp, typename T>
        struct apply_<TT, PairwiseOp, T> {
            using result = TT<T>;
        };

        template <typename Pred, typename ONE = std::true_type, typename ZERO = std::false_type>
        struct bool_op {
            template <typename T, typename R>
            std::enable_if_t<(Pred{}(T{}, R{})), ONE> operator()(T, R) const;

            template <typename T, typename R>
            std::enable_if_t<!(Pred{}(T{}, R{})), ZERO> operator()(T, R) const;
        };

        struct both {
            template <typename T, typename R>
            constexpr bool operator()(T, R) const
            {
                return T::value && R::value;
            }
        };

        struct either {
            template <typename T, typename R>
            constexpr bool operator()(T, R) const
            {
                return T::value || R::value;
            }
        };

        struct if_then {
            template <typename T, typename R>
            constexpr bool operator()(T, R) const
            {
                return !T::value || R::value;
            }
        };

        struct only_one {
            template <typename T, typename R>
            constexpr bool operator()(T, R) const
            {
                return !(T::value && R::value) && (T::value || R::value);
            }
        };

        using conj = bool_op<both>;
        using disj = bool_op<either>;
        using impl = bool_op<if_then>;
        using xor_ = bool_op<only_one>;

        template <template <typename> typename TT, typename PairwiseOp>
        struct apply_op_ {
            template <typename... Args>
            using to = typename apply_<TT, PairwiseOp, Args...>::result;
        };
    }
} // namespace detail
} // namespace vn
#endif


text:
class ProfilesController < ApplicationController
  def new
    # form where a user can fill out their own profile.
    @user = User.find( params[:user_id] )
    @profile = @user.build_profile
  end

  def create
  	@user = User.find(params[:user_id])
  	@profile = @user.build_profile(profile_params)
  	if @profile.save
      flash[:sucess] = 'Profile has been updated successfully'
  		redirect_to user_path(params[:user_id])
  	else
  		render action: :new
  	end
  end

  private
  	def profile_params
  		params.require(:profile).permit(:first_name, :last_name, :job_title, :phone_number, :contact_email, :description)

  	end
end


text:
% Solve a set of ordinary differential equations using the 6th order Butcher's method.
% The method is described at:
% http://www.mymathlib.com/c_source/diffeq/runge_kutta/runge_kutta_butcher.c
%
% Function's input and output parameters should conform to the general integ
% "interface" as described at https://github.com/jkovacic/cont-sim/wiki/Basic-instructions.
%
% Input:
%   model - name of a function that implements the mathematical model as a state-space representation
%   initial_condition - states at t = t_start
%   t_start - start time of the simulation run
%   t_stop - stop time of the simulation run
%   t_step - fixed time step
%   inputf - name of the function that returns the external input at the specified time
%   outputf - name of the function that calculates the desired output values from the internal states
%   param - vector parameter values, passed to 'model' and 'outputf'
%
% Output:
%   output - vector of output values (as defined by 'outputf'), prepended by time stamps

function output = integ_butcher6(model, initial_condition, t_start, t_stop, t_step, inputf, outputf, param)

% Elements of the Butcher tableau:
A = [ 0, 0, 0, 0, 0, 0, 0; ...
      1/3, 0, 0, 0, 0, 0, 0; ...
      0, 2/3, 0, 0, 0, 0, 0; ...
      1/12, 1/3, -1/12, 0, 0, 0, 0; ...
      -0.0625,  1.125, -0.1875, -0.375, 0, 0, 0; ...
      0, 1.125, -0.375, -0.75, 0.5, 0, 0; ...
      9/44, -9/11, 63/44, 18/11, -16/11, 0, 0 ];
B = [11, 0, 81, 81, -32, -32, 11] / 120;
C = [0, 1/3, 2/3, 1/3, 0.5, 0.5, 1]';

% passed to the general implementation of explicit Runge - Kutta methods
output = aux_rk_expl(model, initial_condition, t_start, t_stop, t_step, inputf, outputf, param, A, B, C);

end % function


text:
"""
A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='django-extreme-tdd',

    version='0.1.0',

    description='Testing toolkit to advocate real and fast TDD (testing first!) in Django applications, eXtremeProgramming like!',
    long_description=long_description,

    url='https://github.com/flaviamissi/django-extreme-tdd',

    author='Flavia Missi',
    author_email='flaviamissi@gmail.com',

    license='BSD',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'Topic :: Software Development :: Testing',

        'License :: OSI Approved :: BSD License',

        # 'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        # 'Programming Language :: Python :: 3',
        # 'Programming Language :: Python :: 3.2',
        # 'Programming Language :: Python :: 3.3',
        # 'Programming Language :: Python :: 3.4',
    ],

    keywords='testing tdd development django',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['docs', 'tests*']),

    # https://packaging.python.org/en/latest/requirements.html
    # TODO: get from file
    install_requires=['django>=1.4'],

    # $ pip install -e .[dev,test]
    # TODO: get from file
    extras_require={
        'dev': ['mkdocs'],
        'test': ['nose'],
    },

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    # entry_points={
    #     'console_scripts': [
    #         'sample=sample:main',
    #     ],
    # },
)


text:
<?php
/**
 * Informations de traçage de Fast
 *
 * @filesource src/Resources/Views/Trace.view.php
 * @version 0.2.0
 * @author Frédéric BAYLE
 */

use Fast\Localization;
use Fast\Views\View;
use Fast\_S;

/* @var $view View */

Localization::loadResources(__DIR__ . '/L10n/Trace.php');
?>

<?php $view->beginAjaxContent('FastTraceInformation'); ?>
	<?php if(count($traceData) > 0): ?>

<?php _w(Localization::getL10n('Trace.view', 'trace')); ?>

            		<?php _w(Localization::getL10n('Trace.view', 'message')); ?>
            		<?php _w(Localization::getL10n('Trace.view', 'timecode')); ?>

            	<?php
                $lineNumber = 0;
                foreach ($traceData as $traceValue): ?>
                	<tr style="background-color:<?php _w($lineNumber % 2 == 1 ? '#D9EEF7' : '#fff'); ?>;">
                		<td style="text-align:left; word-wrap: break-word; color:<?php _w($traceValue['s'] == 1 ? '#f00' : '#000'); ?>;">
                			<?php _w(print_r($traceValue['m'], true)); ?>

                		<td style="text-align:left; color:<?php _w($traceValue['s'] == 1 ? '#f00' : '#000'); ?>;">
                			<?php _w($traceValue['t']); ?>

                    <?php
                    $lineNumber++;
                endforeach; ?>

    <?php endif; ?>
    <?php
    if(isset($_GET)):
    	(new View(__FASTDIR__ . '/Resources/Views/TraceCollection.view.php', [
    			'collectionData' => &$_GET, 'collectionTitle' => Localization::getL10n('Trace.view', 'getData')
    	]))->render();
	endif;
	if(isset($_POST)):
    	(new View(__FASTDIR__ . '/Resources/Views/TraceCollection.view.php', [
    			'collectionData' => &$_POST, 'collectionTitle' => Localization::getL10n('Trace.view', 'postData')
    	]))->render();
	endif;
    if(isset($_COOKIE)):
    	(new View(__FASTDIR__ . '/Resources/Views/TraceCollection.view.php', [
    			'collectionData' => &$_COOKIE, 'collectionTitle' => Localization::getL10n('Trace.view', 'cookies')
    	]))->render();
    endif;
    if(isset($_SESSION)):
    	(new View(__FASTDIR__ . '/Resources/Views/TraceCollection.view.php', [
    			'collectionData' => &$_SESSION, 'collectionTitle' => Localization::getL10n('Trace.view', 'sessionData')
    	]))->render();
    endif;
    if(isset($_SERVER)):
    	(new View(__FASTDIR__ . '/Resources/Views/TraceCollection.view.php', [
    			'collectionData' => &$_SERVER, 'collectionTitle' => Localization::getL10n('Trace.view', 'serverVariables')
    	]))->render();
    endif;
    ?>

		<?php _w(_S::format(Localization::getL10n('Trace.view', 'footer'), __FASTVERSION__, phpversion(), microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'])); ?>

<?php $view->endAjaxContent(); ?>


text:
package org.knowm.xchange.huobi.dto.marketdata;

import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.HOURS;
import static java.util.concurrent.TimeUnit.MINUTES;

public enum KlineInterval {
  m1("1min", MINUTES.toMillis(1)),
  m5("5min", MINUTES.toMillis(5)),
  m15("15min", MINUTES.toMillis(15)),
  m30("30min", MINUTES.toMillis(30)),
  h1("60min", HOURS.toMillis(1)),
  h4("4hour", HOURS.toMillis(4)),

  d1("1day", DAYS.toMillis(1)),
  w1("1week", DAYS.toMillis(7)),
  M1("1mon", DAYS.toMillis(30)),
  Y1("1year", DAYS.toMillis(365));

  private final String code;
  private final Long millis;

  private KlineInterval(String code, Long millis) {
    this.millis = millis;
    this.code = code;
  }

  public Long getMillis() {
    return millis;
  }

  public String code() {
    return code;
  }
}


text:
$(document).ready(function() {
  if (!(sessionStorage.getItem("username") === null || sessionStorage.getItem("username") === "null" ||
	 sessionStorage.getItem("username") === "undefined" || sessionStorage.getItem("username") === undefined))
    username = sessionStorage.getItem("username")
  else if (!(getCookie("username") === null || getCookie("username") === "null" ||
	    getCookie("username") === "undefined" || getCookie("username") === undefined))
    username = getCookie("username");

  recommendersInfo = client.getRecommenders(username);
  recommenders = {};
  var trash_button_1 = '<button class="close" aria-hidden="true" data-dismiss="alert" type="button" onclick="process_delete_rec(\''
  var trash_button_2 = '\');"></button>';

  $("#todo tbody").empty();

  for (i in recommendersInfo) {
    recommenders[recommendersInfo[i].clientKey] = recommendersInfo[i];

    var entry = '
' + recommendersInfo[i].recommenderName + '' + trash_button_1
                + recommendersInfo[i].clientKey + trash_button_2 + '
	';
    $("#todo tbody").append(entry);
  }
});


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

import org.kuali.rice.core.framework.persistence.dao.GenericDao;
import org.kuali.rice.kcb.api.service.MessagingService;
import org.quartz.JobDetail;
import org.springframework.transaction.PlatformTransactionManager;

/**
 * Service locator interface for the KCB module.
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public interface KCBServiceLocator {
    public JobDetail getMessageProcessingJobDetail();
    public PlatformTransactionManager getTransactionManager();
    public MessageDeliveryService getMessageDeliveryService();
    public MessageService getMessageService();
    public MessagingService getMessagingService();
    public MessageDelivererRegistryService getMessageDelivererRegistryService();
    public EmailService getEmailService();
    public RecipientPreferenceService getRecipientPreferenceService();
    public KENIntegrationService getKenIntegrationService();
}


text:
/*
Sphinx-Gallery has compatible CSS to fix default sphinx themes
Tested for Sphinx 1.3.1 for all themes: default, alabaster, sphinxdoc,
scrolls, agogo, traditional, nature, haiku, pyramid
Tested for Read the Docs theme 0.1.7 */
.sphx-glr-thumbcontainer {
  background: #fff;
  border: solid #fff 1px;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  box-shadow: none;
  float: left;
  margin: 5px;
  min-height: 230px;
  padding-top: 5px;
  position: relative;
}
.sphx-glr-thumbcontainer:hover {
  border: solid #b4ddfc 1px;
  box-shadow: 0 0 15px rgba(142, 176, 202, 0.5);
}
.sphx-glr-thumbcontainer a.internal {
  bottom: 0;
  display: block;
  left: 0;
  padding: 150px 10px 0;
  position: absolute;
  right: 0;
  top: 0;
}
/* Next one is to avoid Sphinx traditional theme to cover all the
thumbnail with its default link Background color */
.sphx-glr-thumbcontainer a.internal:hover {
  background-color: transparent;
}

.sphx-glr-thumbcontainer p {
  margin: 0 0 .1em 0;
}
.sphx-glr-thumbcontainer .figure {
  margin: 10px;
  width: 160px;
}
.sphx-glr-thumbcontainer img {
  display: inline;
  max-height: 160px;
  width: 160px;
}
.sphx-glr-thumbcontainer[tooltip]:hover:after {
  background: rgba(0, 0, 0, 0.8);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  color: #fff;
  content: attr(tooltip);
  left: 95%;
  padding: 5px 15px;
  position: absolute;
  z-index: 98;
  width: 220px;
  bottom: 52%;
}
.sphx-glr-thumbcontainer[tooltip]:hover:before {
  border: solid;
  border-color: #333 transparent;
  border-width: 18px 0 0 20px;
  bottom: 58%;
  content: '';
  left: 85%;
  position: absolute;
  z-index: 99;
}

.highlight-pytb pre {
  background-color: #ffe4e4;
  border: 1px solid #f66;
  margin-top: 10px;
  padding: 7px;
}

.sphx-glr-script-out {
  color: #888;
  margin: 0;
}
.sphx-glr-script-out .highlight {
  background-color: transparent;
  margin-left: 2.5em;
  margin-top: -1.4em;
}
.sphx-glr-script-out .highlight pre {
  background-color: #fafae2;
  border: 0;
  max-height: 30em;
  overflow: auto;
  padding-left: 1ex;
  margin: 0px;
  word-break: break-word;
}
.sphx-glr-script-out + p {
  margin-top: 1.8em;
}
blockquote.sphx-glr-script-out {
  margin-left: 0pt;
}

div.sphx-glr-footer {
    text-align: center;
}

div.sphx-glr-download {
  display: inline-block;
  margin: 1em auto 1ex 2ex;
  vertical-align: middle;
}

div.sphx-glr-download a {
  background-color: #ffc;
  background-image: linear-gradient(to bottom, #FFC, #d5d57e);
  border-radius: 4px;
  border: 1px solid #c2c22d;
  color: #000;
  display: inline-block;
  /* Not valid in old browser, hence we keep the line above to override */
  display: table-caption;
  font-weight: bold;
  padding: 1ex;
  text-align: center;
}

/* The last child of a download button is the file name */
div.sphx-glr-download a span:last-child {
    font-size: smaller;
}

@media (min-width: 20em) {
    div.sphx-glr-download a {
	min-width: 10em;
    }
}

@media (min-width: 30em) {
    div.sphx-glr-download a {
	min-width: 13em;
    }
}

@media (min-width: 40em) {
    div.sphx-glr-download a {
	min-width: 16em;
    }
}

div.sphx-glr-download code.download {
  display: inline-block;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  /* border and background are given by the enclosing 'a' */
  border: none;
  background: none;
}

div.sphx-glr-download a:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25);
  text-decoration: none;
  background-image: none;
  background-color: #d5d57e;
}

ul.sphx-glr-horizontal {
  list-style: none;
  padding: 0;
}
ul.sphx-glr-horizontal li {
  display: inline;
}
ul.sphx-glr-horizontal img {
  height: auto !important;
}

p.sphx-glr-signature a.reference.external {
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  padding: 3px;
  font-size: 75%;
  text-align: right;
  margin-left: auto;
  display: table;
}

a.sphx-glr-code-links:hover{
    text-decoration: none;
}

a.sphx-glr-code-links[tooltip]:hover:before{
    background: rgba(0,0,0,.8);
    border-radius: 5px;
    color: white;
    content: attr(tooltip);
    padding: 5px 15px;
    position: absolute;
    z-index: 98;
    width: 16em;
    word-break: normal;
    white-space: normal;
    display: inline-block;
    text-align: center;
    text-indent: 0;
    margin-left: -5em;
    margin-top: 1.2em;
}


text:
<?php

return array(
    'title' => 'Your first account',
    'description' => 'Oh, we\'re so tantalisingly close!
            All we need now is a username and password to log in to the admin area with.',
    'username' => 'Username',
    'username_description' => 'You use this to log in.',
    'email' => 'Email address',
    'email_description' => 'Needed if you can't log in.',
    'password' => 'Password',
    'password_description' => 'Make sure to pick a secure password.',
);


text:
/**
 * @fileoverview Contains the SplitPane component
 * @suppress {visibility}
 */

goog.provide('jsh.SplitPane');

goog.require('goog.ui.SplitPane');

/**
 * A left/right up/down Container SplitPane.
 * Create SplitPane with two goog.ui.Component opjects to split.
 *
 * @param {goog.ui.Component} firstComponent Left or Top component.
 * @param {goog.ui.Component} secondComponent Right or Bottom component.
 * @param {goog.ui.SplitPane.Orientation} orientation SplitPane orientation.
 * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
 * @extends {goog.ui.SplitPane}
 * @constructor
 */
jsh.SplitPane = function(firstComponent, secondComponent,
                         orientation, opt_domHelper) {
  goog.base(this, firstComponent, secondComponent, orientation, opt_domHelper);
};
goog.inherits(jsh.SplitPane, goog.ui.SplitPane);

/**
 * The size of the second component.
 * @type {number}
 * @private
 */
jsh.SplitPane.prototype.secondComponentSize_ = 0;

/**
 * If the size of the second component should remain the same when the
 * component is resized.
 * @type {boolean}
 * @private
 */
jsh.SplitPane.prototype.secondComponentStatic_ = false;

/**
 * Setup all events and do an initial resize.
 * @override
 */
jsh.SplitPane.prototype.enterDocument = function() {
  goog.base(this, 'enterDocument');

  this.getHandler().
      unlisten(this.splitpaneHandle_, goog.events.EventType.DBLCLICK,
          this.handleDoubleClick_).
      listen(this.splitpaneHandle_, goog.events.EventType.DBLCLICK,
          this.staticComponentAwareHandleDoubleClick_);

  if (this.secondComponentStatic_) {
    this.secondComponentSize_ = this.initialSize_ ? this.initialSize_ : 0;
    this.setFirstComponentSize();
  }
};

/**
 * Set the size of the left/top component, and resize the other component based
 * on that size and handle size.
 * @param {?number=} opt_size The size of the top or left, in pixels.
 * @override
 */
jsh.SplitPane.prototype.setFirstComponentSize = function(opt_size) {
  var splitpaneSize = goog.style.getBorderBoxSize(this.getElement());

  var componentSpace;
  if (this.isVertical()) {
    componentSpace = splitpaneSize.height - this.handleSize_;
  } else {
    componentSpace = splitpaneSize.width - this.handleSize_;
  }

  if (goog.isNumber(opt_size) || !this.secondComponentStatic_) {
    goog.base(this, 'setFirstComponentSize', opt_size);
    this.secondComponentSize_ = componentSpace - this.getFirstComponentSize();
  } else {
    goog.base(this, 'setFirstComponentSize',
        componentSpace - this.secondComponentSize_);
  }

};

/**
 * Sets the size of the right/bottom component. and resize the other component
 * based on that size and handle size.
 * @param {?number=} opt_size The size of the bottom or right, in pixels.
 */
jsh.SplitPane.prototype.setSecondComponentSize = function(opt_size) {
  if (goog.isNumber(opt_size)) {
    this.secondComponentSize_ = opt_size;
  }
  this.setFirstComponentSize();
};

/**
 * Returns the size of the right/bottom component.
 * @return {number} The size of the right/bottom component.
 */
jsh.SplitPane.prototype.getSecondComponentSize = function() {
  return this.secondComponentSize_;
};

/**
 * Gets if the second component remains static during resizing.
 * @return {?boolean} True if the second component is static.
 */
jsh.SplitPane.prototype.isSecondComponentStatic = function() {
  return this.secondComponentStatic_;
};

/**
 * Sets if the second component should remain static during resizing.
 * @param {boolean} isstatic If true, the second component will remain the same
 * width/height during resizing.
 */
jsh.SplitPane.prototype.setSecondComponentStatic = function(isstatic) {
  this.secondComponentStatic_ = isstatic;
};

/**
 * Snap the container to the left or top on a Double-click.
 *
 * @private
 */
jsh.SplitPane.prototype.staticComponentAwareSnapIt_ = function() {
  var handlePos = goog.style.getRelativePosition(this.splitpaneHandle_,
      this.firstComponentContainer_);
  var firstBorderBoxSize =
      goog.style.getBorderBoxSize(this.firstComponentContainer_);
  var firstContentBoxSize =
      goog.style.getContentBoxSize(this.firstComponentContainer_);
  var splitPaneContentBoxSize =
      goog.style.getContentBoxSize(this.getElement());

  var isVertical = this.isVertical();

  // Where do we snap the handle (what size to make the component) and what
  // is the current handle position.
  var snapSize;
  var handlePosition;
  if (isVertical) {
    if (!this.secondComponentStatic_) {
      snapSize = firstBorderBoxSize.height - firstContentBoxSize.height;
    } else {
      snapSize = splitPaneContentBoxSize.height - this.handleSize_;
    }
    handlePosition = handlePos.y;
  } else {
    if (!this.secondComponentStatic_) {
      snapSize = firstBorderBoxSize.width - firstContentBoxSize.width;
    } else {
      snapSize = splitPaneContentBoxSize.width;
    }
    handlePosition = handlePos.x;
  }

  if (snapSize == handlePosition) {
    // This means we're 'unsnapping', set it back to where it was.
    this.setFirstComponentSize(this.savedSnapSize_);
  } else {
    // This means we're 'snapping', set the size to snapSize, and hide the
    // first component.
    if (isVertical) {
      this.savedSnapSize_ = goog.style.getBorderBoxSize(
          this.firstComponentContainer_).height;
    } else {
      this.savedSnapSize_ = goog.style.getBorderBoxSize(
          this.firstComponentContainer_).width;
    }
    this.setFirstComponentSize(snapSize);
  }
};

/**
 * Handle the Double-click. Call the snapIt method which snaps the container
 * to the top or left.
 * @param {goog.events.Event} e The event.
 * @private
 */
jsh.SplitPane.prototype.staticComponentAwareHandleDoubleClick_ = function(e) {
  this.staticComponentAwareSnapIt_();
};


text:
using UnityEngine;
using System.Collections;

public class RandomMatchMaker : MonoBehaviour {

	// Use this for initialization
    void Start()
    {
        PhotonNetwork.ConnectUsingSettings("0.1");
    }

    void OnGUI()
    {
        GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
    }

    void OnJoinedLobby()
    {
        PhotonNetwork.JoinRandomRoom();
    }

    void OnPhotonRandomJoinFailed()
    {
        Debug.Log("Can't join random room!");
        PhotonNetwork.CreateRoom(null);
    }

    void OnJoinedRoom()
    {
        GameObject fighter = PhotonNetwork.Instantiate("Fighter", Vector3.zero, Quaternion.identity, 0);
        PlayerController controller = fighter.GetComponent<PlayerController>();
        controller.enabled = true;
    }

	// Update is called once per frame
	void Update () {

	}
}


text:
// Provides default renderer for the sap.ui.ux3.ThingInspector
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Renderer', './OverlayRenderer'],
	function(jQuery, Renderer, OverlayRenderer) {
	"use strict";

	/**
	 * ThingInspector renderer.
	 * @namespace
	 */
	var ThingInspectorRenderer = Renderer.extend(OverlayRenderer);

	/**
	 * Renders the ThingInspector content
	 *
	 * @param {sap.ui.core.RenderManager}
	 *            oRenderManager the RenderManager that can be used for writing to
	 *            the Render-Output-Buffer
	 * @param {sap.ui.core.Control}
	 *            oControl an object representation of the control that should be
	 *            rendered
	 */
	ThingInspectorRenderer.renderContent = function(oRenderManager, oControl) {
		// convenience variable
		var rm = oRenderManager;
		rm.write("
");
		rm.renderControl(oControl._oThingViewer);
		rm.write("
");
	};

	/**
	 * Add root class to ThingInspector
	 *
	 * @param {sap.ui.core.RenderManager}
	 *            oRenderManager the RenderManager that can be used for writing to
	 *            the Render-Output-Buffer
	 * @param {sap.ui.core.Control}
	 *            oControl an object representation of the control that should be
	 *            rendered
	 */
	ThingInspectorRenderer.addRootClasses = function(oRenderManager, oControl) {
		var rm = oRenderManager;
		rm.addClass("sapUiUx3TI");
	};

	/**
	 * Add class to ThingInspector
	 *
	 * @param {sap.ui.core.RenderManager}
	 *            oRenderManager the RenderManager that can be used for writing to
	 *            the Render-Output-Buffer
	 * @param {sap.ui.core.Control}
	 *            oControl an object representation of the control that should be
	 *            rendered
	 */
	ThingInspectorRenderer.addOverlayClasses = function(oRenderManager, oControl) {
		var rm = oRenderManager;
		rm.addClass("sapUiUx3TIOverlay");
	};

	return ThingInspectorRenderer;

}, /* bExport= */ true);


text:
using SharpBox2D.Pooling;

namespace SharpBox2D.Dynamics.Contacts
{

    public class ContactRegister
    {
        public IDynamicStack<Contact> creator;
        public bool primary;
    }
}


text:
<!DOCTYPE html>

    <title>Strategy Report: KK13 NZDCAD H4</title>

Strategy Report

KK13 NZDCAD H4

Long and Short

Total net profit	-6.89	Gross profit	7.99	Gross loss	-14.88

Profit factor	0.54	Expected payoff	-0.57

Absolute drawdown	-7.33	Maximal drawdown (%)	8.59 (681.75%)

Total trades	12	Profit trades (% of total)	5 (41.67%)	Loss trades (% of total)	7 (58.33%)

	Long positions (won %)	1 (100.0%)	Short positions (won %)	11 (36.36%)

Largest	profit trade	4.18	loss trade	-2.37

Average	profit trade	1.6	loss trade	-2.13

Minimum	profit trade	0.44	loss trade	-1.85

Maximum	take profit in pips	127.7	stop loss in pips	-34.0

Average	take profit in pips	32.9	stop loss in pips	-28.8

Minimum	take profit in pips	5.8	stop loss in pips	-24.0

Maximum	Reward-Risk	4.9	Duration in minutes	3496

Average	Reward-Risk	1.2	Duration in minutes	546.3

Minimum	Reward-Risk	0.2	Duration in minutes	14

Maximum	consecutive wins (profit in money)	2.0 (1.99)	consecutive losses (loss in money)	4.0 (-8.5)

Average	consecutive wins	1.0	consecutive losses	1.0

Long

Total net profit	1.38	Gross profit	1.38	Gross loss	0.0

Profit factor	0.0	Expected payoff	1.38

Absolute drawdown	0.0	Maximal drawdown (%)	0.0 (0.0%)

Total trades	1	Profit trades (% of total)	1 (100.0%)	Loss trades (% of total)	0 (0.0%)

Largest	profit trade	1.38	loss trade	0.0

Average	profit trade	1.38	loss trade	0.0

Minimum	profit trade	1.38	loss trade	0.0

Maximum	take profit in pips	17.9	stop loss in pips	-34.0

Average	take profit in pips	17.9	stop loss in pips	-34.0

Minimum	take profit in pips	17.9	stop loss in pips	-34.0

Maximum	Reward-Risk	0.5	Duration in minutes	556.0

Average	Reward-Risk	0.5	Duration in minutes	556.0

Minimum	Reward-Risk	0.5	Duration in minutes	556.0

Maximum	consecutive wins (profit in money)	1.0 (1.38)	consecutive losses (loss in money)	0.0 (0.0)

Average	consecutive wins	1.0	consecutive losses	0.0

Short

Total net profit	-8.27	Gross profit	6.61	Gross loss	-14.88

Profit factor	0.44	Expected payoff	-0.75

Absolute drawdown	-8.71	Maximal drawdown (%)	8.59 (-7158.33%)

Total trades	11	Profit trades (% of total)	4 (36.36%)	Loss trades (% of total)	7 (63.64%)

Largest	profit trade	4.18	loss trade	-2.37

Average	profit trade	1.65	loss trade	-2.13

Minimum	profit trade	0.44	loss trade	-1.85

Maximum	take profit in pips	127.7	stop loss in pips	-33.6

Average	take profit in pips	34.2	stop loss in pips	-28.3

Minimum	take profit in pips	5.8	stop loss in pips	-24.0

Maximum	Reward-Risk	4.9	Duration in minutes	3496.0

Average	Reward-Risk	1.2	Duration in minutes	545.4

Minimum	Reward-Risk		Duration in minutes	14.0

Maximum	consecutive wins (profit in money)	2.0 (1.99)	consecutive losses (loss in money)	4.0 (-8.5)

Average	consecutive wins	1.0	consecutive losses	2.0

Home


text:
class Event < ActiveRecord::Base
  belongs_to :subject, ->() { unscope(where: :deleted) }, polymorphic: true
  belongs_to :originating_user, foreign_key: :originating_user_id, class_name: 'User'
  belongs_to :organization
  validates :action, :originating_user_id, :subject, presence: true
  validate :subject_is_subscribable

  serialize :state_params, JSON

  after_commit :queue_feed_updates, on: [:create]
  before_save :store_state_params
  before_create :capture_event_and_organization

  private
  def subject_is_subscribable
    unless subject.is_a?(Subscribable)
      errors.add(:subject, 'Subject must be a Subscribable object')
    end
  end

  def store_state_params
    unless subject.nil? || (subject.respond_to?(:deleted) && subject.deleted)
      self.state_params = (self.state_params || {}).merge(subject.state_params)
    end
  end

  def queue_feed_updates
    NotifySubscribers.perform_later(self)
  end

  def capture_event_and_organization
    self.user_role = originating_user.role
  end
end