text:
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include <memory.h> /* for memset */
#include "msg.h"

/* Default timeout can be changed using clnt_control() */
static struct timeval TIMEOUT = { 25, 0 };

int *
write_1(char **argp, CLIENT *clnt)
{
	static int clnt_res;

	memset((char *)&clnt_res, 0, sizeof(clnt_res));
	if (clnt_call (clnt, write,
		(xdrproc_t) xdr_wrapstring, (caddr_t) argp,
		(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
		TIMEOUT) != RPC_SUCCESS) {
		return (NULL);
	}
	return (&clnt_res);
}


text:
package com.nepxion.thunder.console.icon;

import javax.swing.ImageIcon;

import com.nepxion.swing.icon.IconFactory;

public class ConsoleIconFactory extends IconFactory {
    public static final String ICON_FOLDER = "com/nepxion/thunder/console/icon/";

    public static ImageIcon getContextIcon(String iconName) {
        return getIcon(ICON_FOLDER + iconName);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="ExDoc v0.13.2">
    <title>Hangman.CLI.Handler – Hangman v0.9.6</title>
    <link rel="stylesheet" href="dist/app-bbdf358507.css" />

<button class="sidebar-toggle">

</button>

        Hangman

        v0.9.6

    <input type="text" class="sidebar-searchInput" placeholder="search" autocomplete="off" />

Pages

Modules

Exceptions

Protocols

        Hangman v0.9.6
        Hangman.CLI.Handler

Module drives Player.Controller, while setting up the proper Game server and Event consumer states beforehand.

Simply stated it politely nudges the player to proceed to the next course of action or make the next guess. The handler also collects input from the user as necessary and displays data back to the user.

When the game is finished it politely ends the game playing.

This module is the goto destination after all the arguments have been collected in Hangman.CLI

            Summary

      Functions

    run(name, type, secrets, log, display, guess_timeout \\ 10)

Function run connects all the player specific components together and runs the player game

            Functions

    run(name, type, secrets, log, display, guess_timeout \\ 10)

Function run connects all the player specific components together and runs the player game

            Built using
            ExDoc (v0.13.2),

            designed by
            Friedel Ziegelmayer.

        <button class="night-mode-toggle" />


text:
package org.alfresco.repo.lotus.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="path" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "id",
    "path"
})
@XmlRootElement(name = "deleteFolder")
public class DeleteFolder {

    @XmlElement(required = true, nillable = true)
    protected String id;
    @XmlElement(required = true, nillable = true)
    protected String path;

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the path property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPath() {
        return path;
    }

    /**
     * Sets the value of the path property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPath(String value) {
        this.path = value;
    }

}


text:
<!DOCTYPE html>

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

    <title>Look-I-Like - Seu estilo, sua moda</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                <img src="img/topomarca.png"

                        Serviços

                        Portfólio

                        Sobre

                        Contato

PARCERIAS

                Veja quem está conosco

Parcerias

As empresas e pessoas que fazem parte do projeto.

Fale Conosco

Mande sua mensagem que em breve entraremos em contato.

                    <form name="sentMessage" id="contactForm" novalidate>

                                    <input type="text" class="form-control" placeholder="Seu Nome *" id="name" required data-validation-required-message="Please enter your name.">

                                    <input type="email" class="form-control" placeholder="Seu Email *" id="email" required data-validation-required-message="Please enter your email address.">

                                    <input type="tel" class="form-control" placeholder="Seu Telefone *" id="phone" required data-validation-required-message="Please enter your phone number.">

                                    <textarea class="form-control" placeholder="Sua Mensagem *" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-xl">Enviar Mensagem</button>

                    </form>

                    Copyright © Look-I-Like 2016

Twitter

Facebook

Instagram

Blog


text:
namespace MassTransit.Topology.Conventions.CorrelationId
{
    using Context;

    public class SetCorrelationIdSelector<T> :
        ICorrelationIdSelector<T>
        where T : class
    {
        readonly ISetCorrelationId<T> _setCorrelationId;

        public SetCorrelationIdSelector(ISetCorrelationId<T> setCorrelationId)
        {
            _setCorrelationId = setCorrelationId;
        }

        public bool TryGetSetCorrelationId(out ISetCorrelationId<T> setCorrelationId)
        {
            setCorrelationId = _setCorrelationId;
            return true;
        }
    }
}


text:
REG_FIDDLE(Matrix_postScale, 256, 256, false, 3) {
void draw(SkCanvas* canvas) {
    SkMatrix matrix;
    SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}};
    SkRect::Make(source.bounds()).toQuad(bitmapBounds);
    matrix.setPolyToPoly(bitmapBounds, perspect, 4);
    matrix.postScale(.75f, 1.5f, source.width() / 2, source.height() / 2);
    canvas->concat(matrix);
    canvas->drawBitmap(source, 0, 0);
}
}  // END FIDDLE


text:
namespace tap {

static int bytes_traverse(PyObject *object, visitproc visit, void *arg) noexcept
{
	return 0;
}

static Py_ssize_t bytes_marshaled_size(PyObject *object) noexcept
{
	return PyBytes_GET_SIZE(object);
}

static int bytes_marshal(PyObject *object, void *buf, Py_ssize_t size, PeerObject &peer) noexcept
{
	memcpy(buf, PyBytes_AS_STRING(object), size);
	return 0;
}

static PyObject *bytes_unmarshal_alloc(const void *data, Py_ssize_t size, PeerObject &peer) noexcept
{
	return PyBytes_FromStringAndSize(nullptr, size);
}

static int bytes_unmarshal_init(PyObject *object, const void *data, Py_ssize_t size, PeerObject &peer) noexcept
{
	memcpy(PyBytes_AS_STRING(object), data, size);
	return 0;
}

const TypeHandler bytes_type_handler = {
	BYTES_TYPE_ID,
	bytes_traverse,
	bytes_marshaled_size,
	bytes_marshal,
	bytes_unmarshal_alloc,
	bytes_unmarshal_init,
};

} // namespace tap


text:
using System.Runtime.Serialization;

namespace Sitecore.Feature.LayoutSimulator.Data
{
    [DataContract]
    public class SimulateResult
    {
        [DataMember]
        public bool Success { get; set; }
        [DataMember]
        public string Message { get; set; }
        [DataMember]
        public string SimulatedHtml { get; set; }
    }
}


text:
<?php
########################################
#									   #
#   (C) 2007 by CTXtra				   #
#	http://www.ctxtra.de			   #
#									   #
#	Version: V1.5					   #
#									   #
########################################

$txt_install[1] = 'I N S T A L L A T I O N - (Basic adjustments)';

$txt_install[2] = 'Username:';
$txt_install[3] = 'Password:';

$txt_install[4] = 'E-Mail:';
$txt_install[5] = 'Please enter your correct E-Mail! User, which ips will be "inadvertently" blocked, can send you an E-Mail.';

$txt_install[6] = 'CTXtra URL';
$txt_install[7] = 'F.e.: http://your-site.com/ctracker (WITHOUT / at the end)';

$txt_install[8] = 'CTXtra path';
$txt_install[9] = 'f.e.: /ctracker (WITH / at start)';

$txt_install[10] = 'Send E-Mail if attack is blocked:';
$txt_install[11] = 'Yes';
$txt_install[12] = 'No';

$txt_install[13] = 'autom. update IP-List:';
$txt_install[14] = 'Yes (every 24 hours)';
$txt_install[15] = 'No';

$txt_install[16] = 'FTP Username:';
$txt_install[17] = 'FTP Password:';
$txt_install[18] = 'FTP Server:';
$txt_install[19] = 'FTP Path:';
$txt_install[20] = '(f.e.: /httpdocs/ctracker)';

$txt_install[21] = 'REFERENCE: If you hit the Button "Save", CTXtra writes an "htaccess-protection".

					Username and Password are the same which you select at the beginning of the Installation!';

$txt_install[22] = 'Save and go to Login';

$txt_install[23] = 'Reference:';
$txt_install[24] = 'allow_url_fopen is Off

					Without the function allow_url_fopen CTXtra doesn´t works correctly.
					We´re currently working on it so that CTXtra works without this function in the next release.

					Many users are still the meaning, that this function is an security problem. For this reason we advise to the caution to activate this function ;)
					If you like to activate allow_url_fopen, open the file php.ini with an texteditor and search for the string allow_url_fopen, change it from Off into On and save the file. After this, you can continue the installation.';

$txt_install[25] = 'Language:';

$txt_install[26] = 'Htaccess protection:';
$txt_install[27] = 'on';
$txt_install[28] = 'off';

?>


text:
"""
A simple utility to import something by its string name.

Authors:

* Brian Granger
"""

#-----------------------------------------------------------------------------
#  Copyright (C) 2008-2011  The IPython Development Team
#
#  Distributed under the terms of the BSD License.  The full license is in
#  the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------

def import_item(name):
    """Import and return bar given the string foo.bar."""
    package = '.'.join(name.split('.')[0:-1])
    obj = name.split('.')[-1]

    # Note: the original code for this was the following.  We've left it
    # visible for now in case the new implementation shows any problems down
    # the road, to make it easier on anyone looking for a problem.  This code
    # should be removed once we're comfortable we didn't break anything.

    ## execString = 'from %s import %s' % (package, obj)
    ## try:
    ##     exec execString
    ## except SyntaxError:
    ##     raise ImportError("Invalid class specification: %s" % name)
    ## exec 'temp = %s' % obj
    ## return temp

    if package:
        module = __import__(package,fromlist=[obj])
        try:
            pak = module.__dict__[obj]
        except KeyError:
            raise ImportError('No module named %s' % obj)
        return pak
    else:
        return __import__(obj)


text:
package com.google.api.ads.adwords.jaxws.v201502.o;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             {@link Attribute} type that contains a long value.
 *
 *
 *
Java class for LongAttribute complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="LongAttribute">
 *   <complexContent>
 *     <extension base="{https://adwords.google.com/api/adwords/o/v201502}Attribute">
 *       <sequence>
 *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LongAttribute", propOrder = {
    "value"
})
public class LongAttribute
    extends Attribute
{

    protected Long value;

    /**
     * Gets the value of the value property.
     *
     * @return
     *     possible object is
     *     {@link Long }
     *
     */
    public Long getValue() {
        return value;
    }

    /**
     * Sets the value of the value property.
     *
     * @param value
     *     allowed object is
     *     {@link Long }
     *
     */
    public void setValue(Long value) {
        this.value = value;
    }

}


text:
package com.infoinsightsllc.guardrest;

import java.io.IOException;
import java.io.PrintWriter;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.internal.LinkedTreeMap;
import com.infoinsightsllc.guardJSON.GuardiumRestController;

/**
 * Servlet implementation class xmlReport
 */
@WebServlet("/xmlReport")
public class xmlReport extends HttpServlet {
	private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public xmlReport() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		PrintWriter writer = response.getWriter();

		ServletContext context = request.getSession().getServletContext();

		String clientID = context.getInitParameter("client_id");
		String clientSecret = context.getInitParameter("client_secret");
		String guiUser = context.getInitParameter("gui_user");
		String guiPassword = context.getInitParameter("gui_password");
		String sqlguardAppl = context.getInitParameter("sqlguard_appl");
		String sqlguardPort = context.getInitParameter("sqlguard_port");

		GuardiumRestController rc = new GuardiumRestController(sqlguardAppl, Integer.parseInt(sqlguardPort), clientID, clientSecret, guiUser, guiPassword);

		try
		{
			rc.connectAndGetToken();
			int numResults = 1;
			String reportResults = rc.getReportResults(request.getParameterMap(), numResults);

			Gson gson = new GsonBuilder().setPrettyPrinting().create();

			response.setContentType("text/xml;charset=UTF-8");
			writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
			writer.println("<dataset xmlns=\"http://developer.cognos.com/schemas/xmldata/1/\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\">");

			boolean metadataPrinted = false;

			SimpleTypeMapper mapper = new SimpleTypeMapper();

			while(!reportResults.contains("\"ID\": 0"))
			{
				@SuppressWarnings("unchecked")
				LinkedTreeMap<String, String>[] treeArray = gson.fromJson(reportResults, LinkedTreeMap[].class);

				for(int i = 0; i < treeArray.length; i++)
				{
					LinkedTreeMap<String, String> tree = treeArray[i];

					if(!metadataPrinted)
					{
						writer.println("  <metadata>");
						for (Map.Entry<String, String> keyValuePair : tree.entrySet())
						{
							XMLTypeFormatter formatter = mapper.getFormatter(keyValuePair.getKey());
							writer.println("   <item name=\"" + keyValuePair.getKey() +
								"\" " + formatter.getType() + "/>");
						}
						writer.println("  </metadata>");

						writer.println("  <data>");
						metadataPrinted= true;
					}

					writer.print("    <row>");
					for (Map.Entry<String, String> keyValuePair : tree.entrySet())
					{
						XMLTypeFormatter formatter = mapper.getFormatter(keyValuePair.getKey());
						writer.print("<value>");

						String value = formatter.getFormattedValue(keyValuePair.getValue());
						writer.print(value);
						writer.print("</value>");
					}
					writer.println("</row>");
				}

				numResults = numResults + 20;
				reportResults = rc.getReportResults(request.getParameterMap(), numResults);

			}

			writer.println("  </data>");
			writer.println("</dataset>");
		}
		catch (KeyManagementException e)
		{
			e.printStackTrace();
		}
		catch (NoSuchAlgorithmException e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}


text:
    {!! $field['label'] !!}
    @include('crud::inc.field_translatable_icon')
    <input
    	type="time"
    	name="{{ $field['name'] }}"
        value="{{ old($field['name']) ? old($field['name']) : (isset($field['value']) ? $field['value'] : (isset($field['default']) ? $field['default'] : '' )) }}"
        @include('crud::inc.field_attributes')
    	>

    {{-- HINT --}}
    @if (isset($field['hint']))

{!! $field['hint'] !!}

    @endif


text:
solrcloud CHANGELOG
===================

This file is used to list changes made in each version of the solrcloud cookbook.

0.6.9
-----

- Virender Khatri - issue #29, added attribute node[solrcloud][install_zk_gem]

- Grzegorz Dudek - Fixed issue #30: Attribute 'configset_name' is not used in 'zkconfigset' provider

- Virender Khatri - ignore adminPath in solr.xml for v5, issue #36

- Virender Khatri - fix rubocop lint for zkconfigset resource

- Virender Khatri - fixed travis

- Virender Khatri - bump solr version to v5.1.0

- Virender Khatri - added attributes default['solrcloud']['major_version'] & default['solrcloud']['server_base_dir_name'] in avor of solr5, issue #34

- Virender Khatri - notify solr service restart on jetty config update

- Virender Khatri - remove directory resource for symlink location node[solrcloud][shared_lib]

- Virender Khatri - cookbook now supports solr 5

- Virender Khatri - fixed LWRP zkconfigset to use attribute `configset_name` instead of `name`

0.5.8
-----

- Virender Khatri - removed empty lines

- Virender Khatri - added LWRP resource attrs to recipe collections

- Virender Khatri - added LWRP resource attrs to recipe zkconfigsets

- Virender Khatri - fixed lint config

- Virender Khatri - update solr version to 4.10.3

0.5.3
-----

- Virender Khatri - added travis ci support

0.5.2
-----

- Virender Khatri - `node['solrcloud']['zkconfigsets_home']` default directory location updated to
                    `/usr/local/solr_zkconfigsets`

- Virender Khatri - bump Apache Solr version to 4.10.2

0.5.0
-----

- Timo Schmidt - added collection lwrp action :reload to perform reload action on a collection

- Timo Schmidt - fixed typo in collection lwrp for :create action parameter router.field

- Timo Schmidt -  added context path attribute and updated reference to other configuration attributes

- Virender Khatri - init ruby spec and lint, prep for travis ci and kitchen test

0.4.8
-----

- Timo Schmidt - added collection API parameter 'autoAddReplicas'

- Virender Khatri - rubocop ready

- Virender Khatri - added solr context path to collection lwrp

- Virender Khatri - added option to restore cores configuration during upgrade by default

0.4.3
-----

- Virender Khatri - bump apache solr version to 4.10.1 after a basic test run

0.4.2
-----

- Timo Schmidt - added attribute force_upload to zkconfigset lwrp to always upload
  zkconfigsets to zookeeper, useful when manage configset separately

- Timo Schmidt - create directory for JETTY_RUN if missing for debian platform family

- Virender Khatri - added attribute for jetty context configuration

0.3.9
-----

- Virender Khatri - Fixed solr key store file generation, issue #11

0.3.8
-----

- Virender Khatri - fixed cookbook for foodcritic test passed ok

- Virender Khatri - added all zkconfig lwrp options to recipe

- Virender Khatri - added gcc dep for zk gem, issue #8

- Virender Khatri - fixed zkconfigset lwrp to upload missing zk configs, issue #7

- Timo Schmidt - removed Gem.clear_path, fix for OpsWorks runtime error, issue #5

0.3.4
-----

- Virender Khatri - fixed zk gem install patch package dependency error

0.3.3
-----

- Virender Khatri - added java dependency

0.3.2
-----

- Virender Khatri - bumped solr version to 4.10.0

- Virender Khatri - removed attribute adminPath for v4.10.0, caused startup failure

- Virender Khatri - updated README.md

- Virender Khatri - fix for foodcrtic

0.3.0
-----
- Virender Khatri - made lwrp a bit better using ruby gem zk, fix #1

- Virender Khatri - added another attribute for zookeeper configSet upload

- Virender Khatri - changed failure to raise an Exception instead of Chef::Application.fatal!

- Virender Khatri - java Options attribute is now an Array

- Virender Khatri - added Auto Java Memory attribute file

- Virender Khatri - disabled default Node zkConfigSets and collections manage attribute

- Virender Khatri - added zkConfigSets source management attribute - zkconfigsets_source

- Virender Khatri - disabled CONSOLE logging in log4j.properties and added more template attributes

0.2.8
-----
- Virender Khatri - Added node java_options attribute

- Virender Khatri - Fixed Collection LWRP for stopped solr service and in why run mode

- Updated README content with correct attributes

- Updated collection LWRP to work with solr ssl, for future cases where only ssl service port is available.

0.2.6
-----
- Virender Khatri - Fixed Typo Changes in README examples

0.2.5
-----
- Virender Khatri - Renamed solr.xml node attributes convention to generic

- Virender Khatri - Added Request Log attributes

- Virender Khatri - Added Jetty JMX

- Virender Khatri - Added JMX Authentication & Authorization

- Virender Khatri - Added Jetty SSL

- Virender Khatri - Added Solr Service Startup Wait Time attribute

- Virender Khatri - Updated configSet now will notify zookeeper upconfig

- Virender Khatri - Added Jetty Server Core attributes

- Virender Khatri - Added Jetty default connector attributes

- Virender Khatri - Added Jetty SSL connector attributes

- Virender Khatri - Added SSL key store file

- Virender Khatri - Added Default key store file generation and management

- Virender Khatri - Added User defined key store file SSL

- Virender Khatri - Separated manager attribute to  collection manager, zkconfigSet managet and zkconfigSet source manager

- Virender Khatri - Fixed collection first time run failure due to solr service down, now logs a message when solr service is down

- Virender Khatri - Updated collection LWRP, now if manage_collections is disabled, LWRP would not create collection resource

- Virender Khatri - Updated zkconfigsets LWRP, now if manage_zkconfigsets is disabled, LWRP would not create zkconfigsets zookeeper upconfig resource

- Virender Khatri - Updated zkconfigsets LWRP, now if manage_zkconfigsets_source is disabled, LWRP would not create zkconfigsets source resource

0.2.1
-----
- Virender Khatri - Updated README and CHANGELOG

0.2.0
-----
- Virender Khatri - Initial release of solrcloud

- - -
[Github Source](https://github.com/Virender Khatri/solrcloud)

Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.

The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.


text:
from django.apps import AppConfig
from django.core.checks import Error, Tags, register

from .utils import get_postgresql_connections, set_weights

class PostgresSearchConfig(AppConfig):
    name = 'wagtail.contrib.postgres_search'

    def ready(self):
        @register(Tags.compatibility, Tags.database)
        def check_if_postgresql(app_configs, **kwargs):
            if get_postgresql_connections():
                return []
            return [Error('You must use a PostgreSQL database '
                          'to use PostgreSQL search.',
                          id='wagtail.contrib.postgres_search.E001')]

        set_weights()

        from .models import IndexEntry
        IndexEntry.add_generic_relations()


text:
define('crm/FileManager', ['module', 'exports', 'dojo/_base/lang', 'dojo/_base/declare', 'argos/I18n'], function (module, exports, _lang, _declare, _I18n) {
  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _lang2 = _interopRequireDefault(_lang);

  var _declare2 = _interopRequireDefault(_declare);

  var _I18n2 = _interopRequireDefault(_I18n);

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

  var resource = (0, _I18n2.default)('fileManager');

  /**
  * @module crm/FileManager
  */

  var __class = (0, _declare2.default)('crm.FileManager', null, /** @lends module:crm/FileManager.prototype */{
    unableToUploadText: resource.unableToUploadText,
    unknownSizeText: resource.unknownSizeText,
    unknownErrorText: resource.unknownErrorText,
    largeFileWarningText: resource.largeFileWarningText,
    largeFileWarningTitle: resource.largeFileWarningTitle,
    percentCompleteText: resource.percentCompleteText,
    fileUploadOptions: {
      maxFileSize: 4000000
    },
    _store: false,
    _totalProgress: 0,
    _files: null,
    _fileCount: 0,
    _filesUploadedCount: 0,
    _isUploading: false,

    /**
     * @class
     * @alias module:crm/FileManager
     */
    constructor: function constructor() {
      this._files = [];
      this.fileUploadOptions.maxFileSize = App.maxUploadFileSize;
    },
    /**
     * Checks the {@link crm.Application}'s maxFileSize to determine
     * if the file size being added exeeds this limit.
     * @param {Array}
     * @returns {Boolean}
     */
    isFileSizeAllowed: function isFileSizeAllowed(files) {
      var len = 0;
      var maxfileSize = this.fileUploadOptions.maxFileSize;

      for (var i = 0; i < files.length; i++) {
        if (files[i].size === 0) {// eslint-disable-line
          // do nothing.
        } else {
          len += files[i].size || files[i].blob.length;
        }
      }

      if (len > maxfileSize) {
        return false;
      }

      return true;
    },
    /**
     * Uploads a file to a URL.
     * @param {File} file
     * @param {String} url
     * @param {Function} progress Progress callback
     * @param {Event} progress.e
     * @param {Function} complete Complete callback
     * @param {Object} complete.request
     * @param {Function} error Error callback
     * @param {Function} error.errorText
     * @param {Object} scope
     * @param {Boolean} asPut
     */
    uploadFile: function uploadFile(file, url, progress, complete, error, scope, asPut) {
      this.uploadFileHTML5(file, url, progress, complete, error, scope, asPut);
    },
    uploadFileHTML5: function uploadFileHTML5(file, url, progress, complete, error, scope, asPut) {
      if (!this.isFileSizeAllowed([file])) {
        this._onUnableToUploadError(this.largeFileWarningText, error);
        return;
      }
      if (App.supportsFileAPI()) {
        this._uploadFileHTML5_asBinary(file, url, progress, complete, error, scope, asPut);
      } else {
        this._onUnableToUploadError(this.unableToUploadText, error);
      }
    },
    _uploadFileHTML5_asBinary: function _uploadFileHTML5_asBinary(file, _url, progress, complete, error, scope, asPut) {
      // eslint-disable-line
      var url = _url;
      var request = new XMLHttpRequest();
      var service = App.getService();
      window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
      if (!url) {
        // assume Attachment SData url
        url = 'slxdata.ashx/slx/system/-/attachments/file'; // TODO: Remove this assumption from SDK
      }

      request.open(asPut ? 'PUT' : 'POST', url);
      request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

      if (service) {
        request.setRequestHeader('Authorization', service.createBasicAuthToken());
        request.setRequestHeader('X-Authorization', service.createBasicAuthToken());
        request.setRequestHeader('X-Authorization-Mode', 'no-challenge');

        if (App.isMingleEnabled()) {
          var accessToken = App.mingleAuthResults.access_token;
          request.setRequestHeader('Authorization', 'Bearer ' + accessToken);
          request.setRequestHeader('X-Authorization', 'Bearer ' + accessToken);
        }
      }

      var reader = new FileReader();
      reader.onload = _lang2.default.hitch(this, function readerOnLoad(evt) {
        var unknownErrorText = this.unknownErrorText;
        var blobReader = new FileReader(); // read the blob as an ArrayBuffer to work around this android issue: https://code.google.com/p/android/issues/detail?id=39882
        var bb = void 0;
        var usingBlobBuilder = void 0;
        var blobData = void 0;

        try {
          bb = new Blob(); // This will throw an exception if it is not supported (android)
          bb = [];
        } catch (e) {
          bb = new window.BlobBuilder();
          usingBlobBuilder = true;
        }

        var binary = evt.target.result;
        var boundary = '---------------------------' + new Date().getTime();
        var dashdash = '--';
        var crlf = '\r\n';

        this._append(bb, dashdash + boundary + crlf);
        this._append(bb, 'Content-Disposition: attachment; ');
        this._append(bb, 'name="file_"; ');
        this._append(bb, 'filename*="' + encodeURI(file.name) + '" ');
        this._append(bb, crlf);
        this._append(bb, 'Content-Type: ' + file.type);
        this._append(bb, crlf + crlf);
        this._append(bb, binary);
        this._append(bb, crlf);
        this._append(bb, dashdash + boundary + dashdash + crlf);

        if (complete) {
          request.onreadystatechange = function onReadyStateChange() {
            if (request.readyState === 4) {
              if (Math.floor(request.status / 100) !== 2) {
                if (error) {
                  error.call(scope || this, unknownErrorText);
                  console.warn(unknownErrorText + ' ' + request.responseText); // eslint-disable-line
                }
              } else {
                complete.call(scope || this, request);
              }
            }
          };
        }

        if (progress) {
          request.upload.addEventListener('progress', function uploadProgress(e) {
            progress.call(scope || this, e);
          });
        }

        request.setRequestHeader('Content-Type', 'multipart/attachment; boundary=' + boundary);

        if (usingBlobBuilder) {
          blobData = bb.getBlob(file.type);
        } else {
          blobData = new Blob(bb);
        }

        // Read the blob back as an ArrayBuffer to work around this android issue:
        // https://code.google.com/p/android/issues/detail?id=39882
        blobReader.onload = function blobReaderOnLoad(e) {
          request.send(e.target.result);
        };

        blobReader.readAsArrayBuffer(blobData);
      });

      reader.readAsArrayBuffer(file);
    },
    _append: function _append(arrayOrBlobBuilder, data) {
      if (arrayOrBlobBuilder && arrayOrBlobBuilder.constructor === Array) {
        arrayOrBlobBuilder.push(data);
      } else {
        arrayOrBlobBuilder.append(data);
      }
    },
    _onUnableToUploadError: function _onUnableToUploadError(_msg, onError) {
      var msg = _msg;
      if (!msg) {
        msg = this.unableToUploadText;
      }
      if (onError) {
        onError([msg]);
      } else {
        console.warn([msg]); // eslint-disable-line
      }
    },
    /**
     * Formats the file size formatted in KB.
     * @param {Number} size
     * @returns {String}
     */
    formatFileSize: function formatFileSize(_size) {
      var size = _size;
      size = parseInt(size, 10);
      if (size === 0) {
        return '0 KB';
      }
      if (!size || size < 0) {
        return this.unknownSizeText;
      }
      if (size < 1024) {
        return '1 KB';
      }
      return Soho.Locale.formatNumber(Math.round(size / 1024)) + ' KB';
    },
    /**
     * Loads a remote file.
     * @param {String} fileUrl
     * @param {String} responseType
     * @param {Function} onSuccess
     * @param {Object} onSuccess.responseInfo
     */
    getFile: function getFile(fileUrl, responseType, onSuccess) {
      var request = new XMLHttpRequest();
      var service = App.getService();
      request.open('GET', fileUrl, true);

      if (responseType) {
        request.responseType = responseType;
      }
      request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

      if (service) {
        request.setRequestHeader('Authorization', service.createBasicAuthToken());
        request.setRequestHeader('X-Authorization', service.createBasicAuthToken());
        request.setRequestHeader('X-Authorization-Mode', 'no-challenge');

        if (App.isMingleEnabled()) {
          var accessToken = App.mingleAuthResults.access_token;
          request.setRequestHeader('Authorization', 'Bearer ' + accessToken);
          request.setRequestHeader('X-Authorization', 'Bearer ' + accessToken);
        }
      }

      request.addEventListener('load', function load() {
        var contentType = this.getResponseHeader('Content-Type');
        var contentInfo = this.getResponseHeader('Content-Disposition');
        var fileName = contentInfo.split('=')[1];
        var responseInfo = {
          request: this,
          responseType: responseType,
          response: this.response,
          contentType: contentType,
          fileName: fileName
        };
        if (onSuccess) {
          onSuccess(responseInfo);
        }
      }, false);
      request.send(null);
    }
  });

  exports.default = __class;
  module.exports = exports['default'];
});


text:
package org.apache.geronimo.corba.security.config.tss;

import javax.security.auth.Subject;
import java.io.Serializable;

import org.omg.CORBA.ORB;
import org.omg.CSI.EstablishContext;
import org.omg.CSIIOP.AS_ContextSec;
import org.omg.IOP.Codec;

import org.apache.geronimo.corba.security.SASException;

/**
 * @version $Rev: 503274 $ $Date: 2007-02-03 10:19:18 -0800 (Sat, 03 Feb 2007) $
 */
public abstract class TSSASMechConfig implements Serializable {

    public abstract short getSupports();

    public abstract short getRequires();

    public abstract AS_ContextSec encodeIOR(ORB orb, Codec codec) throws Exception;

    public static TSSASMechConfig decodeIOR(AS_ContextSec context) {
        TSSASMechConfig result = null;

        if (context.target_supports == 0) {
            result = new TSSNULLASMechConfig();
        } else {
            result = new TSSGSSUPMechConfig(context);
        }

        return result;
    }

    public abstract Subject check(EstablishContext msg) throws SASException;

    public abstract void toString(String spaces, StringBuffer buf);

}


text:
import math
import os
import random
import re
import sys

class SinglyLinkedListNode:
    def __init__(self, node_data):
        self.data = node_data
        self.next = None

class SinglyLinkedList:
    def __init__(self):
        self.head = None
        self.tail = None

    def insert_node(self, node_data):
        node = SinglyLinkedListNode(node_data)

        if not self.head:
            self.head = node
        else:
            self.tail.next = node

        self.tail = node

def print_singly_linked_list(node, sep, fptr):
    while node:
        fptr.write(str(node.data))

        node = node.next

        if node:
            fptr.write(sep)

# Complete the mergeLists function below.

#
# For your reference:
#
# SinglyLinkedListNode:
#     int data
#     SinglyLinkedListNode next
#
#
def mergeLists(head1, head2):

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    tests = int(input())

    for tests_itr in range(tests):
        llist1_count = int(input())

        llist1 = SinglyLinkedList()

        for _ in range(llist1_count):
            llist1_item = int(input())
            llist1.insert_node(llist1_item)

        llist2_count = int(input())

        llist2 = SinglyLinkedList()

        for _ in range(llist2_count):
            llist2_item = int(input())
            llist2.insert_node(llist2_item)

        llist3 = mergeLists(llist1.head, llist2.head)

        print_singly_linked_list(llist3, ' ', fptr)
        fptr.write('\n')

    fptr.close()


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

#include "list.h"
#include "variant.h"
#include "set.h"
#include "map.h"
#include "vmap.h"

#define VARIANT_ARG_LIST const Variant& p_arg1=Variant(),const Variant& p_arg2=Variant(),const Variant& p_arg3=Variant(),const Variant& p_arg4=Variant(),const Variant& p_arg5=Variant()
#define VARIANT_ARG_PASS p_arg1,p_arg2,p_arg3,p_arg4,p_arg5
#define VARIANT_ARG_DECLARE const Variant& p_arg1,const Variant& p_arg2,const Variant& p_arg3,const Variant& p_arg4,const Variant& p_arg5
#define VARIANT_ARG_MAX 5
#define VARIANT_ARGPTRS const Variant *argptr[5]={&p_arg1,&p_arg2,&p_arg3,&p_arg4,&p_arg5};
#define VARIANT_ARGPTRS_PASS *argptr[0],*argptr[1],*argptr[2],*argptr[3],*argptr[4]
#define VARIANT_ARGS_FROM_ARRAY(m_arr) m_arr[0],m_arr[1],m_arr[2],m_arr[3],m_arr[4]

/**
@author Juan Linietsky <reduzio@gmail.com>
*/

enum PropertyHint {
	PROPERTY_HINT_NONE, ///< no hint provided.
	PROPERTY_HINT_RANGE, ///< hint_text = "min,max,step,slider; //slider is optional"
	PROPERTY_HINT_EXP_RANGE, ///< hint_text = "min,max,step", exponential edit
	PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc"
	PROPERTY_HINT_EXP_EASING, /// exponential easing funciton (Math::ease)
	PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer)
	PROPERTY_HINT_SPRITE_FRAME,
	PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer)
	PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags)
	PROPERTY_HINT_ALL_FLAGS,
	PROPERTY_HINT_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
	PROPERTY_HINT_DIR, ///< a directort path must be passed
	PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
	PROPERTY_HINT_GLOBAL_DIR, ///< a directort path must be passed
	PROPERTY_HINT_RESOURCE_TYPE, ///< a resource object type
	PROPERTY_HINT_MULTILINE_TEXT, ///< used for string properties that can contain multiple lines
	PROPERTY_HINT_COLOR_NO_ALPHA, ///< used for ignoring alpha component when editing a color
	PROPERTY_HINT_IMAGE_COMPRESS_LOSSY,
	PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS,
	PROPERTY_HINT_OBJECT_ID,
	PROPERTY_HINT_MAX,
};

enum PropertyUsageFlags {

	PROPERTY_USAGE_STORAGE=1,
	PROPERTY_USAGE_EDITOR=2,
	PROPERTY_USAGE_NETWORK=4,
	PROPERTY_USAGE_EDITOR_HELPER=8,
	PROPERTY_USAGE_CHECKABLE=16, //used for editing global variables
	PROPERTY_USAGE_CHECKED=32, //used for editing global variables
	PROPERTY_USAGE_INTERNATIONALIZED=64, //hint for internationalized strings
	PROPERTY_USAGE_BUNDLE=128, //used for optimized bundles
	PROPERTY_USAGE_CATEGORY=256,
	PROPERTY_USAGE_STORE_IF_NONZERO=512, //only store if nonzero
	PROPERTY_USAGE_STORE_IF_NONONE=1024, //only store if false
	PROPERTY_USAGE_NO_INSTANCE_STATE=2048,
	PROPERTY_USAGE_RESTART_IF_CHANGED=4096,

	PROPERTY_USAGE_DEFAULT=PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_NETWORK,
	PROPERTY_USAGE_DEFAULT_INTL=PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_NETWORK|PROPERTY_USAGE_INTERNATIONALIZED,
	PROPERTY_USAGE_NOEDITOR=PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_NETWORK,
};

#define ADD_SIGNAL( m_signal ) ObjectTypeDB::add_signal( get_type_static(), m_signal )
#define ADD_PROPERTY( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), m_property, m_setter, m_getter )
#define ADD_PROPERTYI( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), m_property, m_setter, m_getter, m_index )
#define ADD_PROPERTYNZ( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter )
#define ADD_PROPERTYINZ( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter, m_index )
#define ADD_PROPERTYNO( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter )
#define ADD_PROPERTYINO( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter, m_index )

struct PropertyInfo {

	Variant::Type type;
	String name;
	PropertyHint hint;
	String hint_string;
	uint32_t usage;

	_FORCE_INLINE_ PropertyInfo added_usage(int p_fl) const { PropertyInfo pi=*this; pi.usage|=p_fl; return pi; }

	PropertyInfo() { type=Variant::NIL; hint=PROPERTY_HINT_NONE; usage = PROPERTY_USAGE_DEFAULT; }
	PropertyInfo( Variant::Type p_type, const String p_name, PropertyHint p_hint=PROPERTY_HINT_NONE, const String& p_hint_string="",uint32_t p_usage=PROPERTY_USAGE_DEFAULT) {
		type=p_type; name=p_name; hint=p_hint; hint_string=p_hint_string; usage=p_usage;
	}
	bool operator<(const PropertyInfo& p_info) const {
		return name<p_info.name;
	}
};

Array convert_property_list(const List<PropertyInfo> * p_list);

struct MethodInfo {

	String name;
	List<PropertyInfo> arguments;
	Vector<Variant> default_arguments;
	PropertyInfo return_val;
	uint32_t flags;
	int id;

	inline bool  operator<(const MethodInfo& p_method) const { return id==p_method.id?(name < p_method.name):(id<p_method.id); }

	MethodInfo();
	MethodInfo(const String& p_name);
	MethodInfo(const String& p_name, const PropertyInfo& p_param1);
	MethodInfo(const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2);
	MethodInfo(const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3);
	MethodInfo(const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3,const PropertyInfo& p_param4);
	MethodInfo(const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3,const PropertyInfo& p_param4,const PropertyInfo& p_param5);
	MethodInfo(Variant::Type ret);
	MethodInfo(Variant::Type ret,const String& p_name);
	MethodInfo(Variant::Type ret,const String& p_name, const PropertyInfo& p_param1);
	MethodInfo(Variant::Type ret,const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2);
	MethodInfo(Variant::Type ret,const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3);
	MethodInfo(Variant::Type ret,const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3,const PropertyInfo& p_param4);
	MethodInfo(Variant::Type ret,const String& p_name, const PropertyInfo& p_param1,const PropertyInfo& p_param2,const PropertyInfo& p_param3,const PropertyInfo& p_param4,const PropertyInfo& p_param5);
};

// old cast_to
//if ( is_type(T::get_type_static()) )
//return static_cast<T*>(this);
////else
//return NULL;

/*
   the following is an uncomprehensible blob of hacks and workarounds to compensate for many of the fallencies in C++. As a plus, this macro pretty much alone defines the object model.
*/

#define REVERSE_GET_PROPERTY_LIST \
public:\
_FORCE_INLINE_ bool _is_gpl_reversed() const { return true; };\
private:

#define UNREVERSE_GET_PROPERTY_LIST \
public:\
_FORCE_INLINE_ bool _is_gpl_reversed() const { return false; };\
private:

#define OBJ_TYPE( m_type, m_inherits )\
private:\
	void operator=(const m_type& p_rval) {}\
	mutable StringName _type_name;\
	friend class ObjectTypeDB;\
public:\
virtual String get_type() const { \
	return String(#m_type);\
}\
virtual const StringName* _get_type_namev() const { \
	if (!_type_name)\
		_type_name=get_type_static();\
	return &_type_name;\
}\
static _FORCE_INLINE_ void* get_type_ptr_static() { \
	static int ptr;\
	return &ptr;\
}\
static _FORCE_INLINE_ String get_type_static() { \
	return String(#m_type);\
}\
static _FORCE_INLINE_ String get_parent_type_static() { \
	return m_inherits::get_type_static();\
}\
static void get_inheritance_list_static(List<String>* p_inheritance_list) { \
	m_inherits::get_inheritance_list_static(p_inheritance_list);\
	p_inheritance_list->push_back(String(#m_type));\
}\
static String get_category_static() { \
	String category = m_inherits::get_category_static();\
	if (_get_category!=m_inherits::_get_category) {\
		if (category!="")\
			category+="/";\
		category+=_get_category();\
	}\
	return category;\
}\
static String inherits_static() {\
	return String(#m_inherits);\
}\
virtual bool is_type(const String& p_type) const { return (p_type==(#m_type))?true:m_inherits::is_type(p_type); }\
virtual bool is_type_ptr(void *p_ptr) const { return (p_ptr==get_type_ptr_static())?true:m_inherits::is_type_ptr(p_ptr); }\
\
\
static void get_valid_parents_static(List<String> *p_parents) {\
\
	if (m_type::_get_valid_parents_static!=m_inherits::_get_valid_parents_static) {	\
		m_type::_get_valid_parents_static(p_parents);\
	}\
\
	m_inherits::get_valid_parents_static(p_parents);\
}\
protected:\
_FORCE_INLINE_ static void (*_get_bind_methods())() {\
	return &m_type::_bind_methods;\
}\
public:\
static void initialize_type() {\
	static bool initialized=false;\
	if (initialized)\
		return;\
	m_inherits::initialize_type();\
	ObjectTypeDB::_add_type<m_type>();\
	if (m_type::_get_bind_methods() != m_inherits::_get_bind_methods())\
		_bind_methods();\
	initialized=true;\
}\
protected:\
virtual void _initialize_typev() {\
	initialize_type();\
}\
_FORCE_INLINE_ bool (Object::* (_get_get() const))(const StringName& p_name,Variant&) const {\
	return (bool (Object::*)(const StringName&,Variant&)const) &m_type::_get;\
}\
virtual bool _getv(const StringName& p_name, Variant& r_ret) const { \
	if (m_type::_get_get() != m_inherits::_get_get()) {\
		if (_get(p_name,r_ret))\
			return true;\
	}\
	return m_inherits::_getv(p_name,r_ret);\
}\
_FORCE_INLINE_ bool (Object::* (_get_set() const))(const StringName& p_name,const Variant &p_property) {\
	return (bool (Object::*)(const StringName&, const Variant&))&m_type::_set;\
}\
virtual bool _setv(const StringName& p_name,const Variant &p_property) { \
	if (m_inherits::_setv(p_name,p_property)) return true;\
	if (m_type::_get_set() != m_inherits::_get_set()) {\
		return _set(p_name,p_property);\
		\
	}\
	return false;\
}\
_FORCE_INLINE_ void (Object::* (_get_get_property_list() const))(List<PropertyInfo> *p_list) const{\
	return (void (Object::*)(List<PropertyInfo>*)const)&m_type::_get_property_list;\
}\
virtual void _get_property_listv(List<PropertyInfo> *p_list,bool p_reversed) const { \
	if (!p_reversed) {\
		m_inherits::_get_property_listv(p_list,p_reversed);\
	}\
	p_list->push_back( PropertyInfo(Variant::NIL,get_type_static(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_CATEGORY));\
	if (!_is_gpl_reversed())\
		ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\
	if (m_type::_get_get_property_list() != m_inherits::_get_get_property_list()) {\
		_get_property_list(p_list);\
	}\
	if (_is_gpl_reversed())\
		ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\
	if (p_reversed) {\
		m_inherits::_get_property_listv(p_list,p_reversed);\
	}\
\
}\
_FORCE_INLINE_ void (Object::* (_get_notification() const))(int){\
	return (void (Object::*)(int)) &m_type::_notification;\
}\
virtual void _notificationv(int p_notification,bool p_reversed) { \
	if (!p_reversed) \
		m_inherits::_notificationv(p_notification,p_reversed);\
	if (m_type::_get_notification() != m_inherits::_get_notification()) {\
		_notification(p_notification);\
	}\
	if (p_reversed)\
		m_inherits::_notificationv(p_notification,p_reversed);\
}\
\
private:

#define OBJ_CATEGORY(m_category)\
protected:\
_FORCE_INLINE_ static String _get_category() { return m_category; }\
private:

#define OBJ_SAVE_TYPE(m_type) \
public: \
virtual String get_save_type() const { return #m_type; }\
private:

class ScriptInstance;
typedef uint32_t ObjectID;

class Object {
public:

	enum ConnectFlags {

		CONNECT_DEFERRED=1,
		CONNECT_PERSIST=2, // hint for scene to save this connection
		CONNECT_ONESHOT=4
	};

	struct Connection {

		Object *source;
		StringName signal;
		Object *target;
		StringName method;
		uint32_t flags;
		Vector<Variant> binds;
		bool operator<(const Connection& p_conn) const;

		operator Variant() const;
		Connection() { source=NULL; target=NULL; flags=0; }
		Connection(const Variant& p_variant);
	};
private:
#ifdef DEBUG_ENABLED
friend class _ObjectDebugLock;
#endif
friend bool predelete_handler(Object*);
friend void postinitialize_handler(Object*);

	struct Signal {

		struct Target {

			ObjectID _id;
			StringName method;

			_FORCE_INLINE_ bool operator<(const Target& p_target) const { return (_id==p_target._id)?(method<p_target.method):(_id<p_target._id); }

			Target(const ObjectID& p_id, const StringName& p_method) { _id=p_id; method=p_method; }
			Target() { _id=0; }
		};

		struct Slot {

			Connection conn;
			List<Connection>::Element *cE;
		};

		MethodInfo user;
		VMap<Target,Slot> slot_map;
		int lock;
		Signal() { lock=0; }

	};

	HashMap< StringName, Signal, StringNameHasher> signal_map;
	List<Connection> connections;
#ifdef DEBUG_ENABLED
	SafeRefCount _lock_index;
#endif
	bool _block_signals;
	int _predelete_ok;
	Set<Object*> change_receptors;
	uint32_t _instance_ID;
	bool _predelete();
	void _postinitialize();
	bool _can_translate;
#ifdef TOOLS_ENABLED
	bool _edited;
	uint32_t _edited_version;
#endif
	ScriptInstance *script_instance;
	RefPtr script;
	Dictionary metadata;
	mutable StringName _type_name;
	mutable const StringName* _type_ptr;

	void _add_user_signal(const String& p_name, const Array& p_pargs=Array());
	bool _has_user_signal(const StringName& p_name) const;
	Variant _emit_signal(const Variant** p_args, int p_argcount, Variant::CallError& r_error);
	Array _get_signal_list() const;
	Array _get_signal_connection_list(const String& p_signal) const;
	void _set_bind(const String& p_set,const Variant& p_value);
	Variant _get_bind(const String& p_name) const;

	void property_list_changed_notify();

protected:

	virtual bool _use_builtin_script() const { return false; }
	virtual void _initialize_typev() { initialize_type(); }
	virtual bool _setv(const StringName& p_name,const Variant &p_property) { return false; };
	virtual bool _getv(const StringName& p_name,Variant &r_property) const { return false; };
	virtual void _get_property_listv(List<PropertyInfo> *p_list,bool p_reversed) const {};
	virtual void _notificationv(int p_notification,bool p_reversed) {};

	static String _get_category() { return ""; }
	static void _bind_methods();
	bool _set(const StringName& p_name,const Variant &p_property) { return false; };
	bool _get(const StringName& p_name,Variant &r_property) const { return false;  };
	void _get_property_list(List<PropertyInfo> *p_list) const {};
	void _notification(int p_notification) {};

	_FORCE_INLINE_ static void (*_get_bind_methods())() {
		return &Object::_bind_methods;
	}
	_FORCE_INLINE_ bool (Object::* (_get_get() const))(const StringName& p_name,Variant &r_ret) const {
		return &Object::_get;
	}
	_FORCE_INLINE_ bool (Object::* (_get_set() const))(const StringName& p_name,const Variant &p_property) {
			return &Object::_set;
	}
	_FORCE_INLINE_ void (Object::* (_get_get_property_list() const))(List<PropertyInfo> *p_list) const{
			return &Object::_get_property_list;
	}
	_FORCE_INLINE_ void (Object::* (_get_notification() const))(int){
			return &Object::_notification;
	}
	static void get_valid_parents_static(List<String> *p_parents);
	static void _get_valid_parents_static(List<String> *p_parents);

	void cancel_delete();

	virtual void _changed_callback(Object *p_changed,const char *p_prop);

	//Variant _call_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant());
	//void _call_deferred_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant());

	Variant _call_bind(const Variant** p_args, int p_argcount, Variant::CallError& r_error);
	Variant _call_deferred_bind(const Variant** p_args, int p_argcount, Variant::CallError& r_error);

	virtual const StringName* _get_type_namev() const {
		if (!_type_name)
			_type_name=get_type_static();
		return &_type_name;
	}

	DVector<String> _get_meta_list_bind() const;
	Array _get_property_list_bind() const;
	Array _get_method_list_bind() const;

	void _clear_internal_resource_paths(const Variant &p_var);

friend class ObjectTypeDB;
	virtual void _validate_property(PropertyInfo& property) const;

public: //should be protected, but bug in clang++
	static void initialize_type();
	_FORCE_INLINE_ static void register_custom_data_to_otdb() {};

public:

#ifdef TOOLS_ENABLED
	_FORCE_INLINE_ void _change_notify(const char *p_property="") { _edited=true; for(Set<Object*>::Element *E=change_receptors.front();E;E=E->next()) ((Object*)(E->get()))->_changed_callback(this,p_property); }
#else
	_FORCE_INLINE_ void _change_notify(const char *p_what="") {  }
#endif
	static void* get_type_ptr_static() {
		static int ptr;
		return &ptr;
	}

	bool _is_gpl_reversed() const { return false; }

	_FORCE_INLINE_ ObjectID get_instance_ID() const { return _instance_ID; }
	// this is used for editors

	void add_change_receptor( Object *p_receptor );
	void remove_change_receptor( Object *p_receptor );

	template<class T>
	T *cast_to() {

#ifndef NO_SAFE_CAST
		return SAFE_CAST<T*>(this);
#else
		if (!this)
			return NULL;
		if (is_type_ptr(T::get_type_ptr_static()))
			return static_cast<T*>(this);
		else
			return NULL;
#endif
	}

	template<class T>
	const T *cast_to() const {

#ifndef NO_SAFE_CAST
		return SAFE_CAST<const T*>(this);
#else
		if (!this)
			return NULL;
		if (is_type_ptr(T::get_type_ptr_static()))
			return static_cast<const T*>(this);
		else
			return NULL;
#endif
	}

	enum {

		NOTIFICATION_POSTINITIALIZE=0,
		NOTIFICATION_PREDELETE=1
	};

	/* TYPE API */
	static void get_inheritance_list_static(List<String>* p_inheritance_list) {  p_inheritance_list->push_back("Object"); }

	static String get_type_static() { return "Object"; }
	static String get_parent_type_static() { return String(); }
	static String get_category_static() { return String(); }

	virtual String get_type() const { return "Object"; }
	virtual String get_save_type() const { return get_type(); } //type stored when saving

	virtual bool is_type(const String& p_type) const { return (p_type=="Object"); }
	virtual bool is_type_ptr(void *p_ptr) const { return get_type_ptr_static()==p_ptr; }

	_FORCE_INLINE_ const StringName& get_type_name() const {
		if (!_type_ptr) {
			return *_get_type_namev();
		} else {
			return *_type_ptr;
		}
	}

	/* IAPI */
//	void set(const String& p_name, const Variant& p_value);
//	Variant get(const String& p_name) const;

	void set(const StringName& p_name, const Variant& p_value, bool *r_valid=NULL);
	Variant get(const StringName& p_name, bool *r_valid=NULL) const;

	void get_property_list(List<PropertyInfo> *p_list,bool p_reversed=false) const;

	bool has_method(const StringName& p_method) const;
	void get_method_list(List<MethodInfo> *p_list) const;
	Variant callv(const StringName& p_method,const Array& p_args);
	virtual Variant call(const StringName& p_method,const Variant** p_args,int p_argcount,Variant::CallError &r_error);
	virtual void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount);
	virtual void call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount);
	Variant call(const StringName& p_name, VARIANT_ARG_LIST); // C++ helper
	void call_multilevel(const StringName& p_name, VARIANT_ARG_LIST); // C++ helper

	void notification(int p_notification,bool p_reversed=false);

	//used mainly by script, get and set all INCLUDING string
	virtual Variant getvar(const Variant& p_key, bool *r_valid=NULL) const;
	virtual void setvar(const Variant& p_key, const Variant& p_value,bool *r_valid=NULL);

	/* SCRIPT */

	void set_script(const RefPtr& p_script);
	RefPtr get_script() const;

	/* SCRIPT */

	bool has_meta(const String& p_name) const;
	void set_meta(const String& p_name, const Variant& p_value );
	Variant get_meta(const String& p_name) const;
	void get_meta_list(List<String> *p_list) const;

#ifdef TOOLS_ENABLED
	void set_edited(bool p_edited);
	bool is_edited() const;
	uint32_t get_edited_version() const; //this function is used to check when something changed beyond a point, it's used mainly for generating previews
#endif

	void set_script_instance(ScriptInstance *p_instance);
	_FORCE_INLINE_ ScriptInstance* get_script_instance() const { return script_instance; }

	void add_user_signal(const MethodInfo& p_signal);
	void emit_signal(const StringName& p_name,VARIANT_ARG_LIST);
	void emit_signal(const StringName& p_name, const Variant** p_args, int p_argcount);
	void get_signal_list(List<MethodInfo> *p_signals ) const;
	void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const;
	void get_all_signal_connections(List<Connection> *p_connections) const;

	Error connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds=Vector<Variant>(),uint32_t p_flags=0);
	void disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method);
	bool is_connected(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method) const;

	void call_deferred(const StringName& p_method,VARIANT_ARG_LIST);

	void set_block_signals(bool p_block);
	bool is_blocking_signals() const;

	Variant::Type get_static_property_type(const StringName& p_property,bool *r_valid=NULL) const;

	virtual void get_translatable_strings(List<String> *p_strings) const;

	virtual void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const;

	StringName XL_MESSAGE(const StringName& p_message) const; //translate message (internationalization)
	StringName tr(const StringName& p_message) const; //translate message (alternative)

	bool _is_queued_for_deletion; // set to true by SceneTree::queue_delete()
	bool is_queued_for_deletion() const;

	_FORCE_INLINE_ void set_message_translation(bool p_enable) { _can_translate=p_enable; }
	_FORCE_INLINE_ bool can_translate_messages() const { return _can_translate; }

	void clear_internal_resource_paths();

	Object();
	virtual ~Object();

};

bool predelete_handler(Object *p_object);
void postinitialize_handler(Object *p_object);

class ObjectDB {

	struct ObjectPtrHash {

		static _FORCE_INLINE_ uint32_t hash(const Object *p_obj) {

			union {
				const Object*p;
				unsigned long i;
			} u;
			u.p=p_obj;
			return HashMapHahserDefault::hash((uint64_t)u.i);
		}
	};

	static HashMap<uint32_t,Object*> instances;
	static HashMap<Object*,ObjectID,ObjectPtrHash> instance_checks;

	static uint32_t instance_counter;
friend class Object;
friend void unregister_core_types();

	static void cleanup();
	static uint32_t add_instance(Object *p_object);
	static void remove_instance(Object *p_object);
public:

	typedef void (*DebugFunc)(Object *p_obj);

	static Object *get_instance(uint32_t p_instance_ID);
	static void debug_objects(DebugFunc p_func);
	static int get_object_count();

#ifdef DEBUG_ENABLED
	_FORCE_INLINE_ static bool instance_validate(Object* p_ptr) {

		return instance_checks.has(p_ptr);
	}
#else
	_FORCE_INLINE_ static bool instance_validate(Object* p_ptr) { return true; }

#endif

};

//needed by macros
#include "object_type_db.h"

#endif


text:
class StoryUser < ActiveRecord::Base
  belongs_to :story
  belongs_to :user
end


text:
package de.hub.emffrag.mongodb;

import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

import org.eclipse.core.runtime.Plugin;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.osgi.framework.BundleContext;

import com.mongodb.DB;
import com.mongodb.MongoClient;
import com.mongodb.ReadPreference;

import de.hub.emffrag.datastore.DataStoreImpl;
import de.hub.emffrag.datastore.IDataStore;
import de.hub.emffrag.datastore.ScanningDataStore;
import de.hub.emffrag.fragmentation.FragmentedModelFactory;

public class EmfFragMongoDBActivator extends Plugin {

	public static EmfFragMongoDBActivator instance = null;
	public boolean useScanning = false;

	private Map<String, DB> dataBases = new HashMap<String, DB>();

	@Override
	public void start(BundleContext context) throws Exception {
		super.start(context);
		instance = this;
		init();
	}

	public DB getDataBase(String host, int port) {
		DB dataBase = dataBases.get(host + port);
		if (dataBase == null) {
			MongoClient dbClient;
			try {
				ReadPreference.nearest();
				if (port != -1) {
					dbClient = new MongoClient(host, port);
				} else {
					dbClient = new MongoClient(host);
				}
			} catch (UnknownHostException e) {
				throw new IllegalArgumentException("Given host does not exists or DB is not running: " + host);
			}
			dataBase = dbClient.getDB("emffrag");
			dataBases.put(host+port, dataBase);
		}
		return dataBase;
	}

	private void init() {
		Map<String, Object> protocolToFactoryMap = Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap();
		protocolToFactoryMap.put("mongodb", new FragmentedModelFactory() {
			@Override
			protected IDataStore createDataStore(URI uri) {
				MongoDBDataStore baseDataStore = new MongoDBDataStore(uri.authority(), uri.path().substring(1));
				if (useScanning) {
					return new DataStoreImpl(new ScanningDataStore(baseDataStore, baseDataStore), uri);
				} else {
					return new DataStoreImpl(baseDataStore, uri);
				}
			}
		});
	}

	public static void standalone() {
		if (instance == null) {
			instance = new EmfFragMongoDBActivator();
			instance.init();
		}
	}

}


text:
<?php

// TODO catch possible exceptions from impl methods and rethrow them in the wrapped RateLimiterException

namespace GodsDev\RateLimiter;

/**
 * Description of RateLimiterAdapter
 *
 * @author Tomáš Kraus
 */
abstract class AbstractRateLimiter implements \GodsDev\RateLimiter\RateLimiterInterface {

    /**
     * Initiated in __construct
     * @var int
     */
    private $rate;

    /**
     * Initiated in __construct
     * MAY be in seconds or any other time unit
     *
     * @var int
     */
    private $period;

    /**
     *
     * @var \GodsDev\RateLimiter\TimeWindow
     */
    private $window;

    /**
     * Time to wait until the next window is active, against the $timestamp given.
     * Calculated by \GodsDev\RateLimiter\TimeWindow\getTimeToNext($timestamp)
     * While waiting no more hits are allowed as the quota was depleted.
     *
     * @var int
     */
    private $timeToWait;

    /**
     *
     * @var int
     */
    private $hits;

    /**
     * new instance
     *
     * @param int $rate
     * @param int $period MAY be denominated in seconds or any other time unit
     */
    public function __construct($rate, $period) {
        $this->rate = $rate;
        $this->period = $period;
    }

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

    /**
     * sets actual $hits and $startTime values from implementation's data source (db, for example)
     *
     * @param integer $hits a variable where to store the number of hits read from implementation's data source
     * @param integer $startTime a variable where to store the start time read from implementation's data source
     *
     *
     * Implement a fail-safe logic if data is not found.
     *
     * @see createDataImpl
     */
    abstract protected function readDataImpl(&$hits, &$startTime);

    /**
     * resets the limiter. Should set hits to 0.
     *
     * Implement a fail-safe logic if data is not found.
     *
     * @param integer $startTime
     *
     * @return integer modified startTime. Can be aligned down, for example to the current whole hour
     */
    abstract protected function resetDataImpl($startTime);

    /**
     * does the incremetation of hits
     *
     * Abstract limiter assures that a call of readDataImpl was called before this method
     *
     * @param int $lastKnownHitCount number of hits retrieved by a readDataImpl method
     * @param int $lastKnownStartTime start time retrieved by a readDataImpl method
     * @param int $sanitizedIncrement number of hits to be consumed. It is safe: $lastKnownHitCount + $sanitizedIncrement <= rate
     *
     * @return int number of hits consumed. Always to be less or equal than $sanitizedIncrement
     */
    abstract protected function incrementHitImpl($lastKnownHitCount, $lastKnownStartTime, $sanitizedIncrement);

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

    /**
     * Period getter
     *
     * @return int
     */
    public function getPeriod() {
        return $this->period;
    }

    /**
     * Rate getter
     *
     * @return int
     */
    public function getRate() {
        return $this->rate;
    }

    /**
     * Return number of consumed hits during the period e.g. for quota notification calculation
     *
     * @param int $timestamp
     * @return int
     */
    public function getHits($timestamp) {
        $this->refreshState($timestamp);
        return $this->hits;
    }

    /**
     * Returns number of time units (seconds) remaining for a next hit allowed
     *
     * @param int $timestamp
     * @return int
     */
    public function getTimeToWait($timestamp) {
        $this->refreshState($timestamp);
        return $this->timeToWait;
    }

    /**
     *
     * @param int $timestamp
     * @return type
     */
    public function getStartTime($timestamp) {
        $this->refreshState($timestamp);
        return $this->window->getStartTime();
    }

    /**
     * Increments usage in time and returns number of hits allowed (compared to increment)
     *
     * @param int $timestamp
     * @param int $increment [optional]
     * @return int
     */
    public function inc($timestamp, $increment = 1) {
        $this->refreshState($timestamp);
        if ($this->timeToWait == 0 && $this->hits < $this->rate) {

            if ($this->hits + $increment > $this->rate) {
                $sanitizedIncrement = $this->rate - $this->hits;
            } else {
                $sanitizedIncrement = $increment;
            }
            return $this->incrementHitImpl($this->hits, $this->window->getStartTime(), $sanitizedIncrement);
        } else {
            return 0;
        }
        /* can be shortened as:
        return ($this->timeToWait == 0 && $this->hits < $this->rate)?(
                //increment value guard as not all the quota was depleted yet
                $this->incrementHitImpl($this->hits, $this->window->getStartTime(),
                        //sanitizedIncrement
                        ($this->hits + $increment > $this->rate)?($this->rate - $this->hits):$increment
                        )
                ):0;
        */
    }

    /**
     *
     * @param integer $timestamp
     * @return integer startTime
     */
    public function reset($timestamp) {
        $startTime = $this->resetDataImpl($timestamp);
        if (is_null($startTime)) {
            throw new RateLimiterException("null startTime returned by resetDataImpl()");
        }
        $this->hits = 0;
        $this->timeToWait = 0;

        return $startTime;
    }

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

    /**
     * Refresh hits and timeToWait
     *
     * @param int $timestamp
     */
    private function refreshState($timestamp) {
        $startTime = $timestamp;
        $this->hits = 0;
        $this->timeToWait = 0;
        $this->readDataImpl($this->hits, $startTime);
        $this->window = new \GodsDev\RateLimiter\TimeWindow($startTime, $this->period);

        if ($this->window->isActive($timestamp) == false) {
            //a new, clean period
            $startTime = $this->reset($timestamp);
            $this->window = new \GodsDev\RateLimiter\TimeWindow($startTime, $this->period);
        } else if ($this->hits >= $this->rate) {
            //within the period, and there are no remaining hits to use
            $this->timeToWait = $this->window->getTimeToNext($timestamp);
        }
    }

}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2017-2-15 13:44:41 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
 <class name="com.fang.hibernate.po.TestUser" table="testuser" lazy="true">
  <id name="id" type="java.lang.Long">
   <column name="id" />
   <generator class="native" />
  </id>
  <property name="name" type="java.lang.String">
   <column name="name" length="50" not-null="true" />
  </property>
  <property name="age" type="java.lang.Integer">
   <column name="age" />
  </property>
 </class>
</hibernate-mapping>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using AccessIO;

namespace asvn {
    internal class CommandLineExport: CommandLine {

        private CommandLine baseCommandLine;

        internal CommandLineExport(CommandLine baseCommandLine) {
            this.baseCommandLine = baseCommandLine;
            Objects = new List<IObjecOptions>();
        }

        internal override CommandLine Parse(string[] args) {
            if (args.Length < 2) {
                throw new CommandLineException(Properties.Resources.InvalidNumberOfOptions);
            }

            CheckDatabase(args[0]);
            DatabaseFile = args[0];

            CheckRootPath(args[1]);
            RootPath = args[1];

            if (args.Length >= 3) {
                //3rd argument can be an Access object or a script file
                if (args[2][0] == '@') {
                    if (args.Length > 3)
                        throw new CommandLineException(Properties.Resources.InvalidNumberOfOptions);
                    ProcessResponseFile(args[2].Substring(1));
                } else {
                    if (args.Length == 3 && args[2].IndexOf('*') >= 0)
                        ProcessObjectsWithWildcards(args[2]);
                    else {
                        for (int i = 2; i < args.Length; i++) {
                            ProcessAccessObject(args[i]);
                        }
                    }
                }
            } else {
                //3rd argument is stdin
                Console.WriteLine(Properties.Resources.TypeObjectName);
                ProcessResponseFile(Console.In);
            }
            return this;
        }

        internal override CommandLine Run() {
            if (App == null && Objects.Count > 0)
                InitializeAccessApplication();
            foreach (IObjecOptions currentObject in Objects) {
                ObjectTypeExtension ote = App.AllowedContainers.Find(currentObject.ObjectType);

                Console.Write(Properties.Resources.Exporting, ote.FileExtension, currentObject);
                AccessObject accessObject = AccessObject.CreateInstance(App, currentObject.ObjectType, currentObject.ToString());
                accessObject.Options = currentObject.Options;
                string outputFile = Path.Combine(RootPath, ote.Container.InvariantName, currentObject.ToString()) +
                                    String.Concat(".", ote.FileExtension, ".txt");
                accessObject.Save(outputFile);
                Console.WriteLine(Properties.Resources.ColonOk);
            }
            App.Dispose();
            return this;
        }

        /// <summary>
        /// Find and process matched objects
        /// </summary>
        /// <param name="namePattern"></param>
        /// <remarks>
        /// patterns have 2 parts: xxx.nnn, where xxx is the object type (equivalent to file extension)
        /// and nnn is the name.
        /// <list type="bullet">
        /// <item>
        /// <description><c>object type</c>: can be * or a supported file extension for the Access file format</description>
        /// <description><c>name</c>: the name of an object or name with one or more asterix</description>
        /// </item>
        /// </list>
        /// </remarks>
        private void ProcessObjectsWithWildcards(string namePattern) {
            Regex regex = new Regex(@"(\*|\w{3})\.(.+)", RegexOptions.IgnoreCase);
            Match match = regex.Match(namePattern);
            if (match == null) {
                throw new CommandLineException(Properties.Resources.InvalidObjectName);
            }

            InitializeAccessApplication();

            string pattern = match.Groups[2].Value;
            if (pattern == "*")
                pattern = "^" + pattern.Replace("*", ".*") + "$";

            if (match.Groups[1].Value == "*") {
                foreach (ContainerNames container in App.AllowedContainers) {
                    Objects.AddRange(App.LoadObjectNames(container.InvariantName).
                                            Where(x => Regex.IsMatch(x.Name, pattern, RegexOptions.IgnoreCase)));
                }
            } else {
                FileExtensions fileExtension;
                Enum.TryParse<FileExtensions>(match.Groups[1].Value, true, out fileExtension);
                string containerInvariantName = App.AllowedContainers.Find(fileExtension).Container.InvariantName;
                Objects.AddRange(App.LoadObjectNames(containerInvariantName).
                                            Where(x => Regex.IsMatch(x.Name, pattern, RegexOptions.IgnoreCase)));
            }

        }

        private void ProcessAccessObject(string accessObjectName) {
            Regex regex = new Regex(@"([a-z]{3})\.(.+)", RegexOptions.IgnoreCase);
            Match match = regex.Match(accessObjectName);
            if (!match.Success)
                throw new CommandLineException(Properties.Resources.InvalidObjectName);

            AccessIO.FileExtensions fileExtension;
            if (!Enum.TryParse<AccessIO.FileExtensions>(match.Groups[1].Value, out fileExtension))
                throw new CommandLineException(Properties.Resources.InvalidObjectName);

            Containers containers = AccessApp.ContainersFactory(DatabaseFile);
            Objects.Add(new AccessIO.ObjectOptions(match.Groups[2].Value, containers.Find(fileExtension).ObjectType));

        }

        protected override void ProcessResponseFile(TextReader sr) {
            int i = 1;
            try {
                string line = sr.ReadLine();
                while (!String.IsNullOrEmpty(line)) {
                    ProcessAccessObject(line);
                    line = sr.ReadLine();
                    i++;
                }
            } catch (Exception ex) {
                throw new CommandLineException(String.Format(Properties.Resources.ErrorProcessingResponseFile, i, ex.Message), ex);
            }
        }

        /// <summary>
        /// Check existence for the path
        /// </summary>
        /// <param name="rootPath">absolute or relative path w/out wildcards</param>
        private void CheckRootPath(string rootPath) {
            if (!Directory.Exists(rootPath))
                Directory.CreateDirectory(rootPath);
        }

    }
}


text:
import requests
from urlparse import urljoin
import sys
import time

def fetch_result(base_url, route):
  # clearing memcache
  requests.post(urljoin(base_url, "/flush_memcache"))
  t1 = time.time()
  response = requests.get(urljoin(base_url, route)).json()
  t2 = time.time()
  response['request_time'] = (t2 - t1) / 1000.
  response['route'] = route
  return response

def fetch_results(base_url):
  print "Fetching root ..."
  assert requests.get(urljoin(base_url, '/')).status_code == 200

  print "Fetching sitemap ..."
  site_map = requests.get(urljoin(base_url, '/site-map')).json()
  seeds = [route.strip() for route in site_map if 'seed' in route]
  queries = sorted([route.strip() for route in site_map if 'query' in route])

  print "Seeding data ..."
  for route in seeds:
    assert requests.post(urljoin(base_url, route)).status_code == 200

  print "Querying ..."
  return [fetch_result(base_url, route) for route in queries]

if __name__ == '__main__':
  # seed website
  base_url = sys.argv[1]
  results = fetch_results(base_url)

  for result in results:
    print "%.6f - %.6f - %.6f - %10d - %s" % (
      result['request_time'],
      result['time'],
      result['clock'],
      result['length'],
      result['route']
    )


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/stllike/string.h>

#include <vector>

namespace vespalib::net::tls {

/**
 * Returns the OpenSSL cipher suite name for a given IANA cipher suite name, or nullptr if
 * there is no known mapping.
 *
 * Note that this only covers a very restricted subset of the existing IANA ciphers.
 */
const char* iana_cipher_suite_to_openssl(vespalib::stringref iana_name);

/**
 * Returns a vector of all IANA cipher suite names that we support internally.
 * It is guaranteed that any cipher suite name returned from this function will
 * have a non-nullptr return value from iana_cipher_suite_to_openssl(name).
 */
std::vector<vespalib::string> modern_iana_cipher_suites();

}


text:
namespace Food.Food.Interfaces
{
    interface IFood
    {
        /// <summary>
        /// Gets the amount of calories per 100 grams.
        /// </summary>
        /// <returns></returns>
        float GetCalories();
        /// <summary>
        /// Gets the amount of calories for the specified amount of food.
        /// </summary>
        /// <param name="grams">Amount of grams to calculate calories value for</param>
        /// <returns></returns>
        float GetCalories(int grams);
    }
}


text:
package org.kaazing.gateway.server.context.resolve;

import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import org.kaazing.gateway.resource.address.ResourceAddress;
import org.kaazing.gateway.security.RealmContext;
import org.kaazing.gateway.server.context.GatewayContext;
import org.kaazing.gateway.server.context.SchemeContext;
import org.kaazing.gateway.server.context.ServiceDefaultsContext;
import org.kaazing.gateway.server.context.TransportContext;
import org.kaazing.gateway.server.service.ServiceRegistry;
import org.kaazing.gateway.service.ServiceContext;
import org.kaazing.gateway.service.cluster.ClusterContext;
import org.kaazing.gateway.util.scheduler.SchedulerProvider;

public class DefaultGatewayContext implements GatewayContext {

    // private static final Logger LOG = LoggerFactory.getLogger(Gateway.class);
    private final ClusterContext cluster;

    private final Map<String, DefaultSchemeContext> schemes;
    private final Map<String, DefaultTransportContext> schemeTransports;
    private final RealmsContext realms;
    private final ServiceRegistry servicesByURI;
    private final Collection<ServiceContext> services;
    private final File webDir;
    private final File tempDir;
    private final SchedulerProvider schedulerProvider;
    private final ServiceDefaultsContext serviceDefaults;

    // TODO: remove this from here when the launcher goes away and the GatewayContext, Launcher,
    // and Gateway become one class that can keep track of injectables itself
    private final Map<String, Object> injectables = new HashMap<>();

    public DefaultGatewayContext(Map<String, DefaultSchemeContext> schemes,
                                 Map<String, DefaultTransportContext> schemeTransports /* by scheme name */,
                                 RealmsContext realms,
                                 ServiceDefaultsContext serviceDefaults,
                                 Collection<ServiceContext> services,
                                 ServiceRegistry servicesByURI,
                                 File webDir,
                                 File tempDir,
                                 ClusterContext cluster,
                                 SchedulerProvider schedulerProvider) {

        this.schemes = schemes;
        this.schemeTransports = schemeTransports;
        this.realms = realms;
        this.serviceDefaults = serviceDefaults;
        this.services = services;
        this.servicesByURI = servicesByURI;
        this.webDir = webDir;
        this.tempDir = tempDir;
        this.cluster = cluster;
        this.schedulerProvider = schedulerProvider;
    }

    @Override
    public Collection<ServiceContext> getServices() {
        return services;
    }

    @Override
    public DefaultSchemeContext getScheme(String name) {
        return schemes.get(name);
    }

    @Override
    public DefaultTransportContext getTransportForScheme(String schemeName) {
        return schemeTransports.get(schemeName);
    }

    @Override
    public ServiceRegistry getServiceRegistry() {
        return servicesByURI;
    }

    @Override
    public RealmContext getRealm(String name) {
        return realms.getRealmContext(name);
    }

    @Override
    public Collection<? extends RealmContext> getRealms() {
        return realms.getRealms();
    }

    @Override
    public void dispose() {
        HashSet<TransportContext<ResourceAddress>> transports = new HashSet<>();

        for (SchemeContext scheme : schemes.values()) {
            TransportContext<ResourceAddress> transport = getTransportForScheme(scheme.getName());
            if (transport != null) {
                transports.add(transport);
            }
        }

        for (TransportContext<?> transport : transports) {
            transport.dispose();
        }

        cluster.dispose();

        schedulerProvider.shutdownNow();
    }

    @Override
    public File getTempDirectory() {
        return tempDir;
    }

    public File getWebDirectory() {
        return webDir;
    }

    @Override
    public ClusterContext getCluster() {
        return cluster;
    }

    @Override
    public ServiceDefaultsContext getServiceDefaults() {
        return serviceDefaults;
    }

    @Override
    public Map<String, Object> getInjectables() {
        return injectables;
    }

}


text:
.dropdown-list,
.dropdown-multiselect {
  width: 100%;
  position: relative;
}

.dropdown-list button,
.dropdown-multiselect button {
  min-width: 100%;
  background: #fff;
  /* padding: 8px 20px; */
  padding-left: 20px;
  font-size: 16px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0;
  border: none;
  outline: none;
  box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
}

.dropdown-list button {
  line-height: 38px;
}

.dropdown-list button:active,
.dropdown-list button:focus,
.dropdown-multiselect button:active,
.dropdown-multiselect button:focus {
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
}

.dropdown-list button span {
  color: #4a5c89;
}

.dropdown-multiselect button span {
  color: #999;
  font-weight: 300;
  display: inline-block;
  max-width: 80%;
}

.dropdown-multiselect button .selected-items {
  color: #4eaf3e;
}

.selected-items strong {
  font-weight: 300;
}

.dropdown-list .caret-btn,
.dropdown-multiselect .caret-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  text-align: center;
  padding: 7px;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-left: 1px solid #ececec;
  background: #fff;
  color: #36afd5;
}

.dropdown-list .list-menu,
.dropdown-multiselect .list-menu {
  width: 100%;
  max-height: 260px;
  left: 0;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.dropdown-list .list-menu li,
.dropdown-multiselect .list-menu li {
  padding: 0;
  margin: 0;
}

.dropdown-multiselect.statuses .list-menu .list-item,
.dropdown-multiselect.resources .list-menu .list-item {
  text-transform: capitalize;
}

.dropdown-list .list-menu a,
.dropdown-multiselect .list-menu li a {
  display: block;
  padding: 10px;
  padding-left: 15px;
  position: relative;
  font-weight: 300;
  cursor: pointer;
  color: #4a5c89;
  text-decoration: none;
}

.dropdown-multiselect .list-menu li a {
  padding-left: 45px;
  transition: all .45s ease-in-out;
}

.dropdown-list .list-menu a:hover,
.dropdown-multiselect .list-menu a:hover {
  background: #f7f7f7;
  color: #35afd5;
}

.dropdown-multiselect .list-menu .filter-actions {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid #ececec;
}

.dropdown-multiselect .list-menu .filter-actions a {
  width: 50%;
  /* padding: 10px; */
  color: #35afd5;
  display: block;
  padding: 0;
  line-height: 40px;
  text-align: center;
}

.dropdown-list .list-menu span,
.dropdown-list .title span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 300;
}

.dropdown-list .title em,
.dropdown-list .list-menu li em {
  font-size: 13px;
  color: #35afd5;
  margin-right: 0px;
  font-style: normal;
}
.dropdown-list .title em {
  margin-right: 50px;
}
.dropdown-list .list-menu li span.caption {
  display: block;
  padding: 10px 15px;
  cursor: default;
}
.dropdown-list .list-menu li i,
.dropdown-list .list-menu li strong {
  display: inline-block;
  width: 30px;
  text-align: center;
  vertical-align: middle;
  color: #35afd5;
  line-height: 26px;
}
.dropdown-list .list-menu li i {
  vertical-align: sub;
  font-size: 18px;
}

.dropdown-list .list-menu a {
  padding: 12px;
  padding-left: 15px;
  position: relative;
  font-weight: 300;
  cursor: pointer;
}
.dropdown-list .list-menu a.empty {
  height: 36px;
}

.dropdown-multiselect .list-menu .filter-actions i {
    vertical-align: sub;
    color: #35afd5;
    font-size: 18px;
    line-height: 26px;
    transition: all .45s ease-in-out;
}

.dropdown-multiselect .list-menu .select_all:hover,
.dropdown-multiselect .list-menu .select_all:hover i {
  color: #4eaf3e;
  background: #f9fafb;
}

.dropdown-multiselect .list-menu .deselect_all:hover,
.dropdown-multiselect .list-menu .deselect_all:hover i {
  color: #f1696e;
  background: #f9fafb;
}

.dropdown-multiselect .list-menu a span {
  position: absolute;
  top: 8px;
  left: 12px;
  color: #35afd5;
}

.dropdown-multiselect.btn-group.open .dropdown-toggle {
  box-shadow: none;
}


text:
package loader

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// https://github.com/golang/go/blob/master/LICENSE

// This file contains utilities to check for Windows absolute paths on Linux.
// The code in this file was largely copied from the Golang filepath package
// https://github.com/golang/go/blob/1d0e94b1e13d5e8a323a63cd1cc1ef95290c9c36/src/path/filepath/path_windows.go#L12-L65

func isSlash(c uint8) bool {
	return c == '\\' || c == '/'
}

// isAbs reports whether the path is a Windows absolute path.
func isAbs(path string) (b bool) {
	l := volumeNameLen(path)
	if l == 0 {
		return false
	}
	path = path[l:]
	if path == "" {
		return false
	}
	return isSlash(path[0])
}

// volumeNameLen returns length of the leading volume name on Windows.
// It returns 0 elsewhere.
//
//nolint:gocyclo
func volumeNameLen(path string) int {
	if len(path) < 2 {
		return 0
	}
	// with drive letter
	c := path[0]
	if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
		return 2
	}
	// is it UNC? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
	if l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) &&
		!isSlash(path[2]) && path[2] != '.' {
		// first, leading `\\` and next shouldn't be `\`. its server name.
		for n := 3; n < l-1; n++ {
			// second, next '\' shouldn't be repeated.
			if isSlash(path[n]) {
				n++
				// third, following something characters. its share name.
				if !isSlash(path[n]) {
					if path[n] == '.' {
						break
					}
					for ; n < l; n++ {
						if isSlash(path[n]) {
							break
						}
					}
					return n
				}
				break
			}
		}
	}
	return 0
}


text:
<?php
include_once "PHPFrame.php";

$array_obj = new PHPFrame_Array(array(1,2,3));
$assoc_array_obj = new PHPFrame_Array(array("first"=>1,"second"=>2,3, "array"=>array(1,2,3)));

print_r($array_obj);
print_r($assoc_array_obj);

if ($array_obj->isAssoc()) {
    echo "\$array_obj is an associative array\n";
} else {
    echo "\$array_obj is NOT an associative array\n";
}

if ($assoc_array_obj->isAssoc()) {
    echo "\$assoc_array_obj is an associative array\n";
} else {
    echo "\$assoc_array_obj is NOT an associative array\n";
}

echo "\$array_obj has a depth of ".$array_obj->depth()."\n";
echo "\$assoc_array_obj has a depth of ".$assoc_array_obj->depth()."\n";


text:
//----------------------------------------------------------------------------
/** @file SgPlatform.h */
//----------------------------------------------------------------------------

#ifndef SG_PLATFORM_H
#define SG_PLATFORM_H

#include <cstddef>

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

/** Get information about the current computer. */
namespace SgPlatform
{

    /** Get total amount of memory available on the system.
        @return The total memory in bytes or 0 if the memory cannot be
        determined. */
    std::size_t TotalMemory();

}

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

#endif // SG_PLATFORM_H


text:
class CFX_DefaultRenderDevice;
class CFX_RenderDevice;
class CPDF_PageObject;
class CPDF_RenderContext;
class CPDF_RenderOptions;

class CPDF_ScaledRenderBuffer {
 public:
  CPDF_ScaledRenderBuffer();
  ~CPDF_ScaledRenderBuffer();

  bool Initialize(CPDF_RenderContext* pContext,
                  CFX_RenderDevice* pDevice,
                  const FX_RECT& rect,
                  const CPDF_PageObject* pObj,
                  const CPDF_RenderOptions* pOptions,
                  int max_dpi);

  CFX_RenderDevice* GetDevice() const;
  const CFX_Matrix& GetMatrix() const { return m_Matrix; }
  void OutputToDevice();

 private:
  UnownedPtr<CFX_RenderDevice> m_pDevice;
  UnownedPtr<CPDF_RenderContext> m_pContext;
  FX_RECT m_Rect;
  UnownedPtr<const CPDF_PageObject> m_pObject;
  std::unique_ptr<CFX_DefaultRenderDevice> m_pBitmapDevice;
  CFX_Matrix m_Matrix;
};

#endif  // CORE_FPDFAPI_RENDER_CPDF_SCALEDRENDERBUFFER_H_


text:
module ApiBrowser
  module Helpers
    module Session

      def logout!
        session[:oauth_token] = nil
      end

      def authenticate!
        callback_url = "#{base_url}/login/callback"
        request_token = oauth_consumer.get_request_token(:oauth_callback => callback_url)
        session[:request_token] = request_token.token
        session[:request_token_secret] = request_token.secret
        redirect request_token.authorize_url
      end

      def authenticated?
        !!session[:oauth_token]
      end

    end
  end
end