text:
from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^submissions/$', views.submissions, name='submissions'),
    url(r'^submissions/(?P<submission_id>[0-9]+)/remove/$', views.submissions_remove, name='submissions_remove'),
    url(r'^submissions/(?P<submission_id>[0-9]+)/download/(?P<resource>log)/$', views.submissions_download, name='submissions_delete'),
    url(r'^submissions/(?P<submission_id>[0-9]+)/download/(?P<resource>kb)/$', views.submissions_download, name='submissions_delete'),
    url(r'^submissions/(?P<submission_id>[0-9]+)/download/(?P<resource>mfile)/$', views.submissions_download, name='submissions_delete'),

    url(r'^explore/corpus/(?P<corpus_tag>[a-zA-Z_0-9.-]+)/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.explore_corpus, name='explore_corpus'),
    url(r'^explore/corpus/(?P<corpus_tag>[a-zA-Z_0-9.-]+)/$', views.explore_corpus, name='explore_corpus'),

    url(r'^explore/submission/(?P<submission_id>[a-zA-Z_0-9.]+)/$', views.explore_submission, name='explore_submission'),

    url(r'tasks/do/$', views.do_task, name="do_task"),

    url(r'^api/document/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_document, name='api_document'),
    url(r'^api/suggested-mentions/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_suggested_mentions, name='api_suggested_mentions'),
    url(r'^api/suggested-mention-pairs/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_suggested_mention_pairs, name='api_suggested_mention_pairs'),
    url(r'^api/suggested-mention-pairs/(?P<doc_id>[a-zA-Z_0-9.]+)/(?P<subject_id>[0-9]+-[0-9]+):(?P<object_id>[0-9]+-[0-9]+)/$', views.api_suggested_mention_pairs, name='api_suggested_mention_pairs'),

    url(r'^api/evaluation-mentions/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_evaluation_mentions, name='api_evaluation_mentions'),
    url(r'^api/evaluation-mention-pairs/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_evaluation_mention_pairs, name='api_evaluation_mention_pairs'),
    url(r'^api/evaluation-mention-pairs/(?P<doc_id>[a-zA-Z_0-9.]+)/(?P<subject_id>[0-9]+-[0-9]+):(?P<object_id>[0-9]+-[0-9]+)/$', views.api_evaluation_mention_pairs, name='api_evaluation_mention_pairs'),
    url(r'^api/evaluation-relations/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.api_evaluation_relations, name='api_evaluation_relations'),

    url(r'^api/submission/(?P<submission_id>[0-9]+)/$', views.api_submission_entries, name='api_submission_entries'),
    url(r'^api/corpus/(?P<corpus_tag>[0-9a-zA-Z._]+)/$', views.api_corpus_listing, name='api_corpus_listing'),

    url(r'^api/leaderboard/$', views.api_leaderboard, name='api_leaderboard'),

    # These are all test interfaces.
    url(r'^interface/entity/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.interface_entity, name='interface_entity'),
    url(r'^interface/entity/$', views.interface_entity, name='interface_entity'),
    url(r'^interface/relation/(?P<doc_id>[a-zA-Z_0-9.]+)/$', views.interface_relation, name='interface_relation'),
    url(r'^interface/relation/(?P<submission_id>[0-9.]+)/(?P<doc_id>[a-zA-Z_0-9.]+)/(?P<subject_id>[0-9]+-[0-9]+):(?P<object_id>[0-9]+-[0-9]+)/$', views.interface_relation, name='interface_relation'),
    url(r'^interface/relation/$', views.interface_relation, name='interface_relation'),
    url(r'^interface/submission/(?P<submission_id>[0-9]+)/$', views.interface_submission, name='interface_submission'),
    url(r'^interface/submission/$', views.interface_submission, name='interface_submission'),

    url(r'^$', views.home, name='home'),
]


text:
<!doctype html>

		<meta charset="utf-8">
		<title>Data Platform - Gamesys</title>
		<meta name="description" content="Where we are going with data warehousing, analytics, BI and Big Data">
		<meta name="author" content="Toby O'Rourke">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/theme/default.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Data Platform

The future for Data at Gamesys

						Toby O'Rourke

What is the Vision?

Not here to talk about tools & technology (yet)

Supercharge our use of data

Become the data driven business we aspire to be

Put people, process and technology in place to achieve it

Ultimately, it's about a great entertainment experience

the bottom line will take care of itself

One size fits all?

Separation of DW and BI teams

Canned reports, retrospective analysis

Huge lead times delivering through DW

Data Prospecting

Multi-disciplinary team(s) formed to answer business questions

Aligned to measurable business outcomes

Grab data where they find it

Wide variety tools & techniques

Why?

Deliver insight when and where it is needed

Remove delays

Quickly test hypotheses

For Example

board: We want playing JPJ to be our member's top leisure activity

team: OK, we could measure our share of member's entertainment spending

team: Let's estimate total entertainment budgets, mash demographics & wager history

team: Oh, we get 20% less overall share of budget from mid-value members

team: We recommend this new promotion mechanic

board: Thanks, we've made 5% more from mid-value members this quarter, what's next?

Executing on the Vision

Quick Win: RPLV

Proof of Data Prospector concept

Model owned & implemented by people who understand it

Live within 2 months

Great new measure of effectiveness

Long Term: Prospector Teams

Organised around top priorities

Poker, Acquisition, Player Lifecycle

Empowered to explore and recommend

Create IP, become a competitive advantage

Resourcing

Seed with Insights & PMP

Must add technical expertise

grow 4 teams of 6 over 2014-15

Hiring now

Long Term: DW

Home of accurate, reliable regulatory & financial reporting

Reduce churn, increase stability

Redeploy people to more valuable work

Long Term: A Platform?

Will evolve as we learn from prospecting

Flexibility & Time to Market key attributes

redpajama_set_name: RedPajamaGithub


text:
                Phone Book

                Authorization

                My phone book

                Edit phone book

                Logout


text:
import os
import platform
from . import linker
from . import config
from . import patcher
import subprocess
import pygccxml.utils

try:  # select the faster xml parser
    from .etree_scanner import etree_scanner_t as scanner_t
except:
    from .scanner import scanner_t

from . import declarations_cache
from pygccxml import utils
from pygccxml import declarations

def bind_aliases(decls):
    """
    This function binds between class and it's typedefs.

    :param decls: list of all declarations
    :type all_classes: list of :class:`declarations.declaration_t` items

    :rtype: None

    """

    visited = set()
    typedefs = [
        decl for decl in decls if isinstance(decl, declarations.typedef_t)]
    for decl in typedefs:
        type_ = declarations.remove_alias(decl.type)
        if not isinstance(type_, declarations.declarated_t):
            continue
        cls_inst = type_.declaration
        if not isinstance(cls_inst, declarations.class_types):
            continue
        if id(cls_inst) not in visited:
            visited.add(id(cls_inst))
            del cls_inst.aliases[:]
        cls_inst.aliases.append(decl)

class source_reader_t(object):
    """
    This class reads C++ source code and returns the declarations tree.

    This class is the only class that works directly with GCC-XML or CastXML.

    It has only one responsibility: it calls GCC-XML with a source file
    specified by the user and creates declarations tree. The implementation of
    this class is split to two classes:

    1. `scanner_t` - this class scans the "XML" file, generated by GCC-XML
        or CastXML and creates :mod:`pygccxml` declarations and types classes.
        After the XML file has been processed declarations and type class
        instances keeps references to each other using GCC-XML or CastXML
        generated id's.

    2. `linker_t` - this class contains logic for replacing GCC-XML or CastXML
        generated ids with references to declarations or type class instances.
    """

    def __init__(self, config, cache=None, decl_factory=None, join_decls=True):
        """
        :param config: Instance of :class:`xml_generator_configuration_t`
                       class, that contains GCC-XML or CastXML configuration.

        :param cache: Reference to cache object, that will be updated after a
                      file has been parsed.
        :type cache: Instance of :class:`cache_base_t` class

        :param decl_factory: Declarations factory, if not given default
                             declarations factory( :class:`decl_factory_t` )
                             will be used.

        :param join_decls: Skip the joining of the declarations for the file.
                           This can then be done once, in the case where
                           there are multiple files, for example in the
                           project_reader. Is True per default.
        :type boolean

        """

        self.logger = utils.loggers.cxx_parser
        self.__join_decls = join_decls
        self.__search_directories = []
        self.__config = config
        self.__search_directories.append(config.working_directory)
        self.__search_directories.extend(config.include_paths)
        if not cache:
            cache = declarations_cache.dummy_cache_t()
        self.__dcache = cache
        self.__config.raise_on_wrong_settings()
        self.__decl_factory = decl_factory
        if not decl_factory:
            self.__decl_factory = declarations.decl_factory_t()

    def __create_command_line(self, source_file, xml_file):
        """
        Generate the command line used to build xml files.

        Depending on the chosen xml_generator a different command line
        is built. The gccxml option may be removed once gccxml
        support is dropped (this was the original c++ xml_generator,
        castxml is replacing it now).

        """

        if self.__config.xml_generator == "gccxml":
            return self.__create_command_line_gccxml(source_file, xml_file)
        elif self.__config.xml_generator == "castxml":
            return self.__create_command_line_castxml(source_file, xml_file)

    def __create_command_line_castxml(self, source_file, xmlfile):
        assert isinstance(self.__config, config.xml_generator_configuration_t)

        cmd = []

        # first is gccxml executable
        if platform.system() == 'Windows':
            cmd.append('"%s"' % os.path.normpath(
                self.__config.xml_generator_path))
        else:
            cmd.append('%s' % os.path.normpath(
                self.__config.xml_generator_path))

        # Add all cflags passed
        if self.__config.cflags != "":
            cmd.append(" %s " % self.__config.cflags)

        # Add additional includes directories
        dirs = self.__search_directories
        cmd.append(''.join([' -I%s' % search_dir for search_dir in dirs]))

        # Clang option: -c Only run preprocess, compile, and assemble steps
        cmd.append("-c")
        # Clang option: make sure clang knows we want to parse c++
        cmd.append("-x c++")

        # Platform specific options
        if platform.system() == 'Windows':

            if "mingw" in self.__config.compiler_path.lower():
                # Look at the compiler path. This is a bad way
                # to find out if we are using mingw; but it
                # should probably work in most of the cases
                cmd.append('--castxml-cc-gnu ' + self.__config.compiler_path)
            else:
                # We are using msvc
                cmd.append('--castxml-cc-msvc cl')
                if 'msvc9' == self.__config.compiler:
                    cmd.append('-D"_HAS_TR1=0"')
        else:

            # On mac or linux, use gcc or clang (the flag is the same)
            cmd.append('--castxml-cc-gnu ')

            # Check for -std=xx flags passed to the compiler.
            # A regex could be used but this is a moving target.
            # See c++1z for example. It is preferable to have a defined
            # list of what is allowed. http://clang.llvm.org/cxx_status.html
            #
            # Version 98 and 03 are only there in the case somebody is using
            # these flags; this is the equivalent to not passing these flags.
            standards = [
                "-std=c++98",
                "-std=c++03",
                "-std=c++11",
                "-std=c++14",
                "-std=c++1z"]

            std_flag = ""
            for standard in standards:
                if standard in self.__config.cflags:
                    std_flag = " " + standard + " "

            # A -std= flag was passed, but is not in the list
            if "-std=" in self.__config.cflags and std_flag == "":
                raise(RuntimeError("Unknown -std=c++xx flag used !"))

            if std_flag != "":
                cmd.append(
                    '"(" ' + self.__config.compiler_path + std_flag + '")"')
            else:
                cmd.append(self.__config.compiler_path)

        # Tell castxml to output xml compatible files with gccxml
        # so that we can parse them with pygccxml
        cmd.append('--castxml-gccxml')

        # Add symbols
        cmd = self.__add_symbols(cmd)

        # The destination file
        cmd.append('-o %s' % xmlfile)
        # The source file
        cmd.append('%s' % source_file)
        # Where to start the parsing
        if self.__config.start_with_declarations:
            cmd.append(
                '--castxml-start "%s"' %
                ','.join(self.__config.start_with_declarations))
        cmd_line = ' '.join(cmd)
        self.logger.debug('castxml cmd: %s' % cmd_line)
        return cmd_line

    def __create_command_line_gccxml(self, source_file, xmlfile):
        assert isinstance(self.__config, config.xml_generator_configuration_t)
        # returns
        cmd = []
        # first is gccxml executable
        if 'nt' == os.name:
            cmd.append('"%s"' % os.path.normpath(
                self.__config.xml_generator_path))
        else:
            cmd.append('%s' % os.path.normpath(
                self.__config.xml_generator_path))

        # Add all cflags passed
        if self.__config.cflags != "":
            cmd.append(" %s " % self.__config.cflags)
        # second all additional includes directories
        dirs = self.__search_directories
        cmd.append(''.join([' -I"%s"' % search_dir for search_dir in dirs]))

        # Add symbols
        cmd = self.__add_symbols(cmd)

        # fourth source file
        cmd.append('"%s"' % source_file)
        # five destination file
        cmd.append('-fxml="%s"' % xmlfile)
        if self.__config.start_with_declarations:
            cmd.append(
                '-fxml-start="%s"' %
                ','.join(
                    self.__config.start_with_declarations))
        # Specify compiler if asked to
        if self.__config.compiler:
            cmd.append(" --gccxml-compiler %s" % self.__config.compiler)
        cmd_line = ' '.join(cmd)
        self.logger.debug('gccxml cmd: %s' % cmd_line)
        return cmd_line

    def __add_symbols(self, cmd):
        """
        Add all additional defined and undefined symbols.

        """

        if self.__config.define_symbols:
            symbols = self.__config.define_symbols
            cmd.append(''.join(
                [' -D"%s"' % defined_symbol for defined_symbol in symbols]))

        if self.__config.undefine_symbols:
            un_symbols = self.__config.undefine_symbols
            cmd.append(
                ''.join([' -U"%s"' % undefined_symbol for
                        undefined_symbol in un_symbols]))

        return cmd

    def create_xml_file(self, source_file, destination=None):
        """
        This method will generate a xml file using an external tool.

        The external tool can be either gccxml or castxml. The method will
        return the file path of the generated xml file.

        :param source_file: path to the source file that should be parsed.
        :type source_file: str

        :param destination: if given, will be used as target file path for
                            GCC-XML or CastXML.
        :type destination: str

        :rtype: path to xml file.

        """

        xml_file = destination
        # If file specified, remove it to start else create new file name
        if xml_file:
            pygccxml.utils.remove_file_no_raise(xml_file, self.__config)
        else:
            xml_file = pygccxml.utils.create_temp_file_name(suffix='.xml')
        try:
            ffname = source_file
            if not os.path.isabs(ffname):
                ffname = self.__file_full_name(source_file)
            command_line = self.__create_command_line(ffname, xml_file)

            process = subprocess.Popen(
                args=command_line,
                shell=True,
                stdin=subprocess.PIPE,
                stdout=subprocess.PIPE)
            process.stdin.close()

            gccxml_reports = []
            while process.poll() is None:
                line = process.stdout.readline()
                if line.strip():
                    gccxml_reports.append(line.rstrip())
            for line in process.stdout.readlines():
                if line.strip():
                    gccxml_reports.append(line.rstrip())

            exit_status = process.returncode
            gccxml_msg = os.linesep.join([str(s) for s in gccxml_reports])
            if self.__config.ignore_gccxml_output:
                if not os.path.isfile(xml_file):
                    raise RuntimeError(
                        "Error occured while running " +
                        self.__config.xml_generator.upper() +
                        ": %s status:%s" %
                        (gccxml_msg, exit_status))
            else:
                if gccxml_msg or exit_status or not \
                        os.path.isfile(xml_file):
                    raise RuntimeError(
                        "Error occured while running " +
                        self.__config.xml_generator.upper() + ": %s" %
                        gccxml_msg)
        except Exception:
            pygccxml.utils.remove_file_no_raise(xml_file, self.__config)
            raise
        return xml_file

    def create_xml_file_from_string(self, content, destination=None):
        """
        Creates XML file from text.

        :param content: C++ source code
        :type content: str

        :param destination: file name for GCC-XML generated file
        :type destination: str

        :rtype: returns file name of GCC-XML generated file
        """
        header_file = pygccxml.utils.create_temp_file_name(suffix='.h')

        try:
            header_file_obj = open(header_file, 'w+')
            header_file_obj.write(content)
            header_file_obj.close()
            xml_file = self.create_xml_file(header_file, destination)
        finally:
            pygccxml.utils.remove_file_no_raise(header_file, self.__config)
        return xml_file

    def read_file(self, source_file):
        return self.read_cpp_source_file(source_file)

    def read_cpp_source_file(self, source_file):
        """
        Reads C++ source file and returns declarations tree

        :param source_file: path to C++ source file
        :type source_file: str

        """

        xml_file = ''
        try:
            ffname = self.__file_full_name(source_file)
            self.logger.debug("Reading source file: [%s]." % ffname)
            declarations = self.__dcache.cached_value(ffname, self.__config)
            if not declarations:
                self.logger.debug(
                    "File has not been found in cache, parsing...")
                xml_file = self.create_xml_file(ffname)
                declarations, files = self.__parse_xml_file(xml_file)
                self.__dcache.update(
                    ffname, self.__config, declarations, files)
            else:
                self.logger.debug(
                    ("File has not been changed, reading declarations " +
                        "from cache."))
        except Exception:
            if xml_file:
                pygccxml.utils.remove_file_no_raise(xml_file, self.__config)
            raise
        if xml_file:
            pygccxml.utils.remove_file_no_raise(xml_file, self.__config)

        return declarations

    def read_xml_file(self, xml_file):
        """
        Read generated XML file.

        :param xml_file: path to xml file
        :type xml_file: str

        :rtype: declarations tree

        """

        assert(self.__config is not None)

        ffname = self.__file_full_name(xml_file)
        self.logger.debug("Reading xml file: [%s]" % xml_file)
        declarations = self.__dcache.cached_value(ffname, self.__config)
        if not declarations:
            self.logger.debug("File has not been found in cache, parsing...")
            declarations, files = self.__parse_xml_file(ffname)
            self.__dcache.update(ffname, self.__config, declarations, [])
        else:
            self.logger.debug(
                "File has not been changed, reading declarations from cache.")

        return declarations

    def read_string(self, content):
        """
        Reads a Python string that contains C++ code, and return
        the declarations tree.

        """

        header_file = pygccxml.utils.create_temp_file_name(suffix='.h')
        with open(header_file, "w+") as f:
            f.write(content)

        try:
            declarations = self.read_file(header_file)
        except Exception:
            pygccxml.utils.remove_file_no_raise(header_file, self.__config)
            raise
        pygccxml.utils.remove_file_no_raise(header_file, self.__config)

        return declarations

    def __file_full_name(self, file):
        if os.path.isfile(file):
            return file
        for path in self.__search_directories:
            file_path = os.path.join(path, file)
            if os.path.isfile(file_path):
                return file_path
        raise RuntimeError("pygccxml error: file '%s' does not exist" % file)

    def __produce_full_file(self, file_path):
        if os.name in ['nt', 'posix']:
            file_path = file_path.replace(r'\/', os.path.sep)
        if os.path.isabs(file_path):
            return file_path
        try:
            abs_file_path = os.path.realpath(
                os.path.join(
                    self.__config.working_directory,
                    file_path))
            if os.path.exists(abs_file_path):
                return os.path.normpath(abs_file_path)
            return file_path
        except Exception:
            return file_path

    def __parse_xml_file(self, xml_file):
        scanner_ = scanner_t(xml_file, self.__decl_factory, self.__config)
        scanner_.read()
        decls = scanner_.declarations()
        types = scanner_.types()
        files = {}
        for file_id, file_path in scanner_.files().items():
            files[file_id] = self.__produce_full_file(file_path)
        linker_ = linker.linker_t(
            decls=decls,
            types=types,
            access=scanner_.access(),
            membership=scanner_.members(),
            files=files)
        for type_ in list(types.values()):
            # I need this copy because internaly linker change types collection
            linker_.instance = type_
            declarations.apply_visitor(linker_, type_)
        for decl in decls.values():
            linker_.instance = decl
            declarations.apply_visitor(linker_, decl)
        bind_aliases(iter(decls.values()))

        # Join declarations
        if self.__join_decls:
            for ns in iter(decls.values()):
                if isinstance(ns, pygccxml.declarations.namespace_t):
                    self.join_declarations(ns)

        # some times gccxml report typedefs defined in no namespace
        # it happens for example in next situation
        # template< typename X>
        # void ddd(){ typedef typename X::Y YY;}
        # if I will fail on this bug next time, the right way to fix it may be
        # different
        patcher.fix_calldef_decls(scanner_.calldefs(), scanner_.enums())
        decls = [
            inst for inst in iter(
                decls.values()) if isinstance(
                inst,
                declarations.namespace_t) and not inst.parent]
        return decls, list(files.values())

    def join_declarations(self, declref):
        self._join_namespaces(declref)
        for ns in declref.declarations:
            if isinstance(ns, pygccxml.declarations.namespace_t):
                self.join_declarations(ns)

    @staticmethod
    def _join_namespaces(nsref):
        assert isinstance(nsref, pygccxml.declarations.namespace_t)
        ddhash = {}
        decls = []

        for decl in nsref.declarations:
            if decl.__class__ not in ddhash:
                ddhash[decl.__class__] = {decl._name: [decl]}
                decls.append(decl)
            else:
                joined_decls = ddhash[decl.__class__]
                if decl._name not in joined_decls:
                    decls.append(decl)
                    joined_decls[decl._name] = [decl]
                else:
                    if isinstance(decl, pygccxml.declarations.calldef_t):
                        if decl not in joined_decls[decl._name]:
                            # functions has overloading
                            decls.append(decl)
                            joined_decls[decl._name].append(decl)
                    elif isinstance(decl, pygccxml.declarations.enumeration_t):
                        # unnamed enums
                        if not decl.name and decl not in \
                                joined_decls[decl._name]:
                            decls.append(decl)
                            joined_decls[decl._name].append(decl)
                    elif isinstance(decl, pygccxml.declarations.class_t):
                        # unnamed classes
                        if not decl.name and decl not in \
                                joined_decls[decl._name]:
                            decls.append(decl)
                            joined_decls[decl._name].append(decl)
                    else:
                        assert 1 == len(joined_decls[decl._name])
                        if isinstance(decl, pygccxml.declarations.namespace_t):
                            joined_decls[decl._name][0].take_parenting(decl)

        class_t = pygccxml.declarations.class_t
        class_declaration_t = pygccxml.declarations.class_declaration_t
        if class_t in ddhash and class_declaration_t in ddhash:
            # if there is a class and its forward declaration - get rid of the
            # second one.
            class_names = set()
            for name, same_name_classes in ddhash[class_t].items():
                if not name:
                    continue
                if "GCC" in utils.xml_generator:
                    class_names.add(same_name_classes[0].mangled)
                elif "CastXML" in utils.xml_generator:
                    class_names.add(same_name_classes[0].name)

            class_declarations = ddhash[class_declaration_t]
            for name, same_name_class_declarations in \
                    class_declarations.items():
                if not name:
                    continue
                for class_declaration in same_name_class_declarations:
                    if "GCC" in utils.xml_generator:
                        if class_declaration.mangled and \
                                class_declaration.mangled in class_names:
                                decls.remove(class_declaration)
                    elif "CastXML" in utils.xml_generator:
                        if class_declaration.name and \
                                class_declaration.name in class_names:
                                decls.remove(class_declaration)

        nsref.declarations = decls


text:
// Original code dervied from:
// https://github.com/thelinuxlich/starwarrior_CSharp/blob/master/StarWarrior/StarWarrior/Systems/EnemyShipMovementSystem.cs

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EnemyShipMovementSystem.cs" company="GAMADU.COM">
//     Copyright © 2013 GAMADU.COM. All rights reserved.
//
//     Redistribution and use in source and binary forms, with or without modification, are
//     permitted provided that the following conditions are met:
//
//        1. Redistributions of source code must retain the above copyright notice, this list of
//           conditions and the following disclaimer.
//
//        2. Redistributions in binary form must reproduce the above copyright notice, this list
//           of conditions and the following disclaimer in the documentation and/or other materials
//           provided with the distribution.
//
//     THIS SOFTWARE IS PROVIDED BY GAMADU.COM 'AS IS' AND ANY EXPRESS OR IMPLIED
//     WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
//     FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GAMADU.COM OR
//     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
//     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
//     ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
//     ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//     The views and conclusions contained in the software and documentation are those of the
//     authors and should not be interpreted as representing official policies, either expressed
//     or implied, of GAMADU.COM.
// </copyright>
// <summary>
//   The enemy ship movement system.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using Demo.StarWarrior.Components;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Entities;

namespace Demo.StarWarrior.Systems
{
    [Aspect(AspectType.All, typeof(TransformComponent), typeof(PhysicsComponent), typeof(EnemyComponent))]
    [EntitySystem(GameLoopType.Update, Layer = 0)]
    public class EnemyShipMovementSystem : EntityProcessingSystem
    {
        protected override void Process(GameTime gameTime, Entity entity)
        {
            var transform = entity.Get<TransformComponent>();
            var physics = entity.Get<PhysicsComponent>();

            var worldPosition = transform.WorldPosition;
            var viewport = GraphicsDevice.Viewport;
            if (worldPosition.X < 0 || worldPosition.X > viewport.Width)
                physics.AddAngle(180);
        }
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="slider.css">


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

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.elasticsearch.plugin</groupId>
    <artifactId>plugins</artifactId>
    <version>2.1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Plugin: Parent POM</name>
    <inceptionYear>2009</inceptionYear>
    <description>A parent project for Elasticsearch plugins</description>

    <parent>
        <groupId>org.elasticsearch</groupId>
        <artifactId>parent</artifactId>
        <version>2.1.0-SNAPSHOT</version>
    </parent>

    <properties>
        <elasticsearch.assembly.descriptor>${elasticsearch.tools.directory}/plugin-metadata/plugin-assembly.xml</elasticsearch.assembly.descriptor>
        <elasticsearch.assembly.appendId>false</elasticsearch.assembly.appendId>
        <elasticsearch.plugin.name>${project.artifactId}</elasticsearch.plugin.name>
        <elasticsearch.plugin.jvm>true</elasticsearch.plugin.jvm>
        <elasticsearch.plugin.isolated>true</elasticsearch.plugin.isolated>
        <elasticsearch.plugin.site>false</elasticsearch.plugin.site>
    </properties>

    <dependencies>
        <!-- elasticsearch and its test framework -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-test-framework</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <!-- Provided dependencies by elasticsearch itself  -->
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-backward-codecs</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queries</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-memory</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-suggest</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-join</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-spatial</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-expressions</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.spatial4j</groupId>
            <artifactId>spatial4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vividsolutions</groupId>
            <artifactId>jts</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.spullara.mustache.java</groupId>
            <artifactId>compiler</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.carrotsearch</groupId>
            <artifactId>hppc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.joda</groupId>
            <artifactId>joda-convert</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-smile</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-cbor</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.ning</groupId>
            <artifactId>compress-lzf</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.tdunning</groupId>
            <artifactId>t-digest</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <classifier>indy</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>apache-log4j-extras</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Required by the REST test framework -->
        <!-- TODO: remove this dependency when we will have a REST Test module -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- typical layout for plugins -->
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.json</include>
                    <include>**/*.txt</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <excludes>
                    <exclude>elasticsearch.yml</exclude>
                    <exclude>**/*.properties</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>elasticsearch.yml</include>
                    <include>**/*.properties</include>
                </includes>
            </testResource>
            <!-- REST API specification and test suites -->
            <testResource>
                <directory>${project.basedir}/rest-api-spec</directory>
                <targetPath>rest-api-spec</targetPath>
                <includes>
                    <include>api/*.json</include>
                    <include>test/**/*.yaml</include>
                </includes>
            </testResource>
            <!-- REST API specifications copied from main Elasticsearch specs
                 because they are required to execute the REST tests in plugins  -->
            <testResource>
                <directory>${elasticsearch.tools.directory}/rest-api-spec</directory>
                <targetPath>rest-api-spec</targetPath>
                <includes>
                    <!-- required by the test framework -->
                    <include>api/info.json</include>
                    <include>api/cluster.health.json</include>
                    <include>api/cluster.state.json</include>
                    <!-- used in plugin REST tests -->
                    <include>api/index.json</include>
                    <include>api/get.json</include>
                    <include>api/update.json</include>
                    <include>api/search.json</include>
                    <include>api/indices.analyze.json</include>
                    <include>api/indices.create.json</include>
                    <include>api/indices.refresh.json</include>
                    <include>api/nodes.info.json</include>
                    <include>api/count.json</include>
                    <!-- used in repository plugin REST tests -->
                    <include>api/snapshot.create_repository.json</include>
                    <include>api/snapshot.get_repository.json</include>
                </includes>
            </testResource>
            <!-- shared test resources like log4j.properties -->
            <testResource>
                <directory>${elasticsearch.tools.directory}/shared-test-resources</directory>
                <filtering>false</filtering>
            </testResource>
        </testResources>

        <plugins>
           <!-- integration tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <!-- start up external cluster -->
                        <execution>
                            <id>integ-setup</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <skip>${skip.integ.tests}</skip>
                                <target>
                                    <ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-with-plugin">
                                        <property name="tests.jvm.argline" value="${tests.jvm.argline}"/>
                                    </ant>
                                </target>
                            </configuration>
                        </execution>
                        <!-- shut down external cluster -->
                        <execution>
                            <id>integ-teardown</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <skip>${skip.integ.tests}</skip>
                                <target>
                                    <ant antfile="${elasticsearch.integ.antfile}" target="stop-external-cluster"/>
                                </target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <appendAssemblyId>${elasticsearch.assembly.appendId}</appendAssemblyId>
                        <outputDirectory>${project.build.directory}/releases/</outputDirectory>
                        <descriptors>
                            <descriptor>${elasticsearch.assembly.descriptor}</descriptor>
                        </descriptors>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>enforce-plugin-classname</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireProperty>
                                        <property>elasticsearch.plugin.classname</property>
                                        <property>elasticsearch.plugin.name</property>
                                    </requireProperty>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>integ-setup-dependencies</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <skip>${skip.integ.tests}</skip>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>org.elasticsearch.distribution.zip</groupId>
                                        <artifactId>elasticsearch</artifactId>
                                        <version>${elasticsearch.version}</version>
                                        <type>zip</type>
                                        <overWrite>true</overWrite>
                                    </artifactItem>
                                </artifactItems>
                                <useBaseVersion>true</useBaseVersion>
                                <outputDirectory>${integ.deps}</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.carrotsearch.randomizedtesting</groupId>
                    <artifactId>junit4-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>integ-tests</id>
                            <configuration>
                                <!-- currently only 1 cpu works, because integ tests don't make "unique" test directories? -->
                                <parallelism>1</parallelism>
                                <systemProperties>
                                    <!-- use external cluster -->
                                    <tests.cluster>localhost:${integ.transport.port}</tests.cluster>
                                </systemProperties>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <modules>
        <module>analysis-kuromoji</module>
        <module>analysis-smartcn</module>
        <module>analysis-stempel</module>
        <module>analysis-phonetic</module>
        <module>analysis-icu</module>
        <module>cloud-gce</module>
        <module>cloud-azure</module>
        <module>cloud-aws</module>
        <module>delete-by-query</module>
        <module>lang-python</module>
        <module>lang-javascript</module>
        <module>mapper-murmur3</module>
        <module>mapper-size</module>
        <module>jvm-example</module>
        <module>site-example</module>
    </modules>
</project>


text:
/*
 * SIDEBAR MENU
 * ------------
 * This is a custom plugin for the sidebar menu. It provides a tree view.
 *
 * Usage:
 * $(".sidebar).tree();
 *
 * Note: This plugin does not accept any options. Instead, it only requires a class
 *       added to the element that contains a sub-menu.
 *
 * When used with the sidebar, for example, it would look something like this:
 *

 *

 *          Menu
 *

 *
Level 1

 *

 *

 *

 *
 * Add .active class to
 elements if you want the menu to be open automatically
 * on page load. See above for an example.
 */
(function($) {
    "use strict";

    $.fn.tree = function() {

        return this.each(function() {
            var btn = $(this).children("a").first();
            var menu = $(this).children(".treeview-menu").first();
            var isActive = $(this).hasClass('active');

            //initialize already active menus
            if (isActive) {
                menu.show();
                btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
            }
            //Slide open or close the menu on link click
            btn.click(function(e) {
                e.preventDefault();
                if (isActive) {
                    //Slide up to close menu
                    menu.slideUp();
                    isActive = false;
                    btn.children(".fa-angle-down").first().removeClass("fa-angle-down").addClass("fa-angle-left");
                    btn.parent("li").removeClass("active");
                } else {
                    //Slide down to open menu
                    menu.slideDown();
                    isActive = true;
                    btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
                    btn.parent("li").addClass("active");
                }
            });

            /* Add margins to submenu elements to give it a tree look */
            menu.find("li > a").each(function() {
                var pad = parseInt($(this).css("margin-left")) + 10;

                $(this).css({"margin-left": pad + "px"});
            });

        });

    };
}(jQuery));


text:
import test_framework.loginit
import os
import os.path
import time
import sys
if sys.version_info[0] < 3:
    raise "Use Python 3"
import logging
from binascii import unhexlify
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import NetworkThread
from test_framework.nodemessages import *
from test_framework.bumessages import *
from test_framework.bunode import BasicBUCashNode, VersionlessProtoHandler

class MyTest(BitcoinTestFramework):
    def __init__(self):
        self.nodes = []
        BitcoinTestFramework.__init__(self)

    def setup_chain(self):
        pass

    def setup_network(self, split=False):
        pass

    def restart_node(self, send_initial_version = True):
        # remove any potential banlist
        banlist_fn = os.path.join(
            node_regtest_dir(self.options.tmpdir, 0),
            "banlist.dat")
        print("Banlist file name:", banlist_fn)
        try:
            os.remove(banlist_fn)
            print("Removed old banlist %s.")
        except:
                pass
        stop_nodes(self.nodes)
        wait_bitcoinds()
        print("Initializing test directory " + self.options.tmpdir)
        initialize_chain_clean(self.options.tmpdir, 1)
        self.nodes = [ start_node(0, self.options.tmpdir, ["-debug"]) ]
        self.pynode = pynode = BasicBUCashNode()

        self.hndlr = pynode.connect(0, '127.0.0.1', p2p_port(0), self.nodes[0],
                       protohandler =VersionlessProtoHandler(),
                       send_initial_version = send_initial_version)

        return pynode.cnxns[0]

    def network_and_finish(self):
        nt = NetworkThread()
        nt.start()
        nt.join()

    def run_test(self):
        logging.info("Testing xversion handling")

        # test regular set up including xversion
        def chksumTest(chksum_zero_recv, chksum_zero_recv_advertise, chksum_zero_send):
            conn = self.restart_node()
            self.hndlr.allow0Checksum = chksum_zero_recv
            self.hndlr.produce0Checksum = chksum_zero_send
            nt = NetworkThread()
            nt.start()

            conn.wait_for_verack()
            conn.send_message(msg_verack())

            # now it is time for xversion
            conn.send_message(msg_xversion({0x00020002 : int(chksum_zero_recv_advertise)}))

            conn.wait_for(lambda : conn.remote_xversion)
            if len(self.hndlr.exceptions):
                return
            conn.send_message(msg_ping())
            conn.wait_for(lambda : conn.pong_counter)
            # check that we are getting 0-value checksums from the BU node
            if chksum_zero_recv:
                assert(self.hndlr.num0Checksums > 0)
            else:
                assert(self.hndlr.num0Checksums == 0)
            conn.connection.disconnect_node()
            return nt

        for x in [False, True]:
            for y in [False, True]:
                print("At test:", x, y)
                nt = chksumTest(x, x, y)
                nt.join()
                assert not len(self.hndlr.exceptions)

        # test mininode itself
        nt = chksumTest(False, True, True)
        assert len(self.hndlr.exceptions) > 0
        print("(Above exceptions are expected)")

if __name__ == '__main__':
    xvt = MyTest()
    xvt.main()

# Create a convenient function for an interactive python debugging session
def Test():
    t = MyTest()
    bitcoinConf = {
        "debug": ["blk", "mempool", "net", "req"],
        "blockprioritysize": 2000000,  # we don't want any transactions rejected due to insufficient fees...
        "net.ignoreTimeouts": 1,
        "logtimemicros": 1
    }

    # you may want these flags:
    flags = standardFlags()
    flags.extend(["--nocleanup", "--noshutdown"])
    t.main(flags, bitcoinConf, None)


text:
$(function () {
    if (typeof getEmbeddedConfig !== 'function') {
        return;
    }

    var CARD_TYPE_OLD = 'old';
    var CART_TYPE_NEW = 'new';
    var PAYMENT_CODE = 'simplifycommerce_embedded';

    /**
     * Elements registry
     */
    var elements = {
        conditionApproveElement: $('[id="conditions_to_approve[terms-and-conditions]"]'),
        paymentContainer: $('#simplify_embedded_payment_container'),
        ajaxLoader: $('#simplify_embedded_ajax_loader'),
        noKeysMsg: $('#simplify_embedded_no_keys_msg'),
        errorsContainer: $('#simplify_embedded_errors_container'),
        paymentForm: $('#simplify_embedded_payment_form'),
        savedCardDeletedConfirmation: $('#simplify_embedded_saved_card_deleted_confirmation'),
        savedCardRadio: $('#simplify_embedded_saved_card_radio'),
        savedCardSelector: $('#simplify_embedded_saved_card_selector'),
        newCardRadio: $('#simplify_embedded_new_card_radio'),
        newCardSelector: $('#simplify_embedded_new_card_selector'),
        cardDeletionAlert: $('#simplify_embedded_card_deletion_alert'),
        cardDeletionConfirmation: $('#simplify_embedded_card_deletion_confirmation'),
        deleteSavedCardAction: $('#simplify_embedded_delete_saved_card_action'),
        savedCardDeletionUndoAction: $('#simplify_embedded_saved_card_deletion_undo_action'),
        savedCardConfirmDeletionAction: $('#simplify_embedded_saved_card_confirm_deletion_action'),
        savedCardCancelDeletionAction: $('#simplify_embedded_saved_card_cancel_deletion_action'),
        newCardForm: $('#simplify_embedded_new_card_form'),
        saveCustomerLabel: $('#simplify_embedded_save_customer_label'),
        updateCustomerLabel: $('#simplify_embedded_update_customer_label'),
        ccDetails: $('#simplify_embedded_cc_details'),
        testModeMessage: $('#simplify_embedded_test_mode_msg'),
        paymentTermsOfServiceNotice: $('#simplify_embedded_payment_terms_of_service_notice'),
        globalPaymentButton: $('#payment-confirmation button'),
        paymentOptions: $('[name=payment-option]'),
        paymentButtonContainer: $('#simplify_embedded_payment_button_container'),
        paymentSubmitAction: $('#simplify_embedded_payment_submit_action'),
    };

    /**
     * State Initialization
     */
    var state = {
        hasSavedCard: window.simplifyHasSavedCard,
        paymentError: false,
        chosenCardType: CARD_TYPE_OLD,
        isCardDeletionInProgress: false,
        isCardDeleted: false,
        conditionsApproved: elements.conditionApproveElement.prop('checked'),
        currentMethod: $('[name=payment-option]:checked').data('module-name'),
        prevMethod: $('[name=payment-option]:checked').data('module-name'),
        isRequestSubmitted: false,
        isTestPayment: (window.simplifyPublicKey.indexOf('sbpb_') !== -1),
        showMissedCredentialsErrors: (window.simplifyPublicKey == undefined || window.simplifyPublicKey.length == 0),
    };

    /**
     * Actions
     */
    elements.conditionApproveElement.on('change', function () {
        setState({
            conditionsApproved: $(this).is(":checked")
        })
    });

    elements.paymentOptions.on('click', function () {
        setState({
            currentMethod: $('[name=payment-option]:checked').data('module-name'),
            prevMethod: state.currentMethod,
        });
    });

    elements.savedCardSelector.on('click', function () {
        setState({
            chosenCardType: CARD_TYPE_OLD
        });
    });

    elements.newCardSelector.on('click', function () {
        setState({
            chosenCardType: CART_TYPE_NEW,
            isCardDeletionInProgress: false
        });
    });

    elements.savedCardRadio.on('change', function () {
        setState({
            chosenCardType: $(this).is(":checked") ? CARD_TYPE_OLD : CART_TYPE_NEW
        })
    });

    elements.newCardRadio.on('change', function () {
        setState({
            chosenCardType: $(this).is(":checked") ? CART_TYPE_NEW : CARD_TYPE_OLD
        })
    });

    elements.deleteSavedCardAction.on('click', function (e) {
        e.stopPropagation();
        setState({
            isCardDeletionInProgress: true,
            isCardDeleted: false,
        });
        return false;
    });

    elements.savedCardDeletionUndoAction.on('click', function (e) {
        e.stopPropagation();
        setState({
            isCardDeletionInProgress: false,
            isCardDeleted: false,
        });
        return false;
    });

    elements.savedCardCancelDeletionAction.on('click', function (e) {
        e.stopPropagation();
        setState({
            isCardDeletionInProgress: false,
            isCardDeleted: false,
        });
        return false;
    });

    elements.savedCardConfirmDeletionAction.on('click', function (e) {
        e.stopPropagation();
        setState({
            isCardDeletionInProgress: true,
            isCardDeleted: true,
            chosenCardType: CART_TYPE_NEW,
        });
        return false;
    });

    elements.paymentSubmitAction.on('click', function (e) {
        e.stopPropagation();
        setState({
            isRequestSubmitted: true,
        });

        elements
            .paymentForm
            .append('<input type="hidden" name="chargeCustomerCard" value="true"/>');

        elements.paymentForm.submit();
    })

    /**
     * This function renders the view based on the state variable.
     * If we want to change the view, we need to update the state variable and
     * trigger this function.
     */
    function renderView() {
        /** Handle Missed Credentials Error */
        if (state.showMissedCredentialsErrors) {
            elements.noKeysMsg.removeClass('hidden');
        } else {
            elements.noKeysMsg.addClass('hidden');
        }

        /** Handle Payment Errors */
        if (state.paymentError) {
            if (state.paymentError.code === "gateway") {
                elements.errorsContainer.html(state.paymentError.message);
            } else {
                elements.errorsContainer.html(
                    "An error occurred while processing payment. Please get in touch with support."
                );
            }

            elements.errorsContainer.removeClass('hidden');
        } else {
            elements.errorsContainer.addClass('hidden');
        }

        /** Handle terms of usage checkbox */
        if (state.conditionsApproved) {
            elements.paymentContainer.removeClass('hidden');
            elements.paymentTermsOfServiceNotice.addClass('hidden');
        } else {
            elements.paymentContainer.addClass('hidden');
            elements.paymentTermsOfServiceNotice.removeClass('hidden');
        }

        /** Handle Payment Methods choose */
        if (state.prevMethod === PAYMENT_CODE && state.currentMethod !== PAYMENT_CODE) {
            elements.globalPaymentButton.show();
        } else if (state.currentMethod === PAYMENT_CODE) {
            elements.globalPaymentButton.hide();
        }

        /** Handle Saving Card Label */
        if (state.hasSavedCard && !state.isCardDeleted) {
            elements.saveCustomerLabel.addClass('hidden');
            elements.updateCustomerLabel.removeClass('hidden');
        } else {
            elements.saveCustomerLabel.removeClass('hidden');
            elements.updateCustomerLabel.addClass('hidden');
        }

        /** Handle Payment Option */
        if (state.hasSavedCard && state.chosenCardType === CARD_TYPE_OLD) {
            elements.newCardForm.addClass('hidden');
            elements.savedCardSelector.addClass('selected');
            elements.newCardSelector.removeClass('selected');
            elements.savedCardRadio.prop("checked", true);
            elements.newCardRadio.prop("checked", false);
            elements.paymentButtonContainer.show();
        } else if (state.hasSavedCard && state.chosenCardType === CART_TYPE_NEW) {
            elements.newCardForm.removeClass('hidden');
            elements.newCardSelector.addClass('selected');
            elements.savedCardSelector.removeClass('selected');
            elements.savedCardRadio.prop("checked", false);
            elements.newCardRadio.prop("checked", true);
            elements.paymentButtonContainer.hide();
        } else {
            elements.newCardForm.removeClass('hidden');
            elements.paymentButtonContainer.hide();
        }

        /** Handle Deleted Cards */
        if (state.isCardDeleted) {
            elements.savedCardSelector.addClass('hidden')
            elements.savedCardDeletedConfirmation.removeClass('hidden');
        } else {
            elements.savedCardSelector.removeClass('hidden')
            elements.savedCardDeletedConfirmation.addClass('hidden');
        }

        /** Handle Card Deletion Confirmation Widget */
        if (state.isCardDeletionInProgress) {
            elements.cardDeletionAlert.removeClass('hidden');
        } else {
            elements.cardDeletionAlert.addClass('hidden');
        }

        /** Handle Test Notice */
        if (state.isTestPayment) {
            elements.testModeMessage.removeClass('hidden');
        } else {
            elements.testModeMessage.addClass('hidden');
        }

        /** Handle Loading Message */
        if (state.isRequestSubmitted) {
            elements.ajaxLoader.removeClass('hidden');
            elements.paymentSubmitAction.prop('disabled', true);
        } else {
            elements.ajaxLoader.addClass('hidden');
            elements.paymentSubmitAction.prop('disabled', false);
        }
    }

    /**
     * This function updates some properties of the state and triggers
     * the renderView function to rebuild the view using an updated version
     * of the state.
     *
     * @param newState
     */
    function setState(newState) {
        state = $.extend(state, newState);
        renderView();
    }

    /**
     * Payment initialization
     */
    var hostedPaymentsObject = SimplifyCommerce.hostedPayments(
        paymentCallback,
        window.getEmbeddedConfig()
    );
    hostedPaymentsObject.closeOnCompletion();

    function paymentCallback(response) {
        if (response && response.cardToken) {
            elements
                .paymentForm
                .append('<input type="hidden" name="simplifyToken" value="' + response.cardToken + '"/>');

            if (state.isCardDeleted) {
                elements
                    .paymentForm
                    .append('<input type="hidden" name="deleteCustomerCard" value="true"/>');
            }

            elements.paymentForm.submit();
        }
    }

    /**
     * Function to get url get parameter from window's location
     * @returns {*}
     * @param name
     * @param url
     */
    function getUrlParam(name, url) {
        var results, res;

        if (!url) {
            url = window.location.href;
        }
        results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
        res = (results && results[1]) || undefined;
        return res;
    }

    /**
     * This function should be used in the case of error happened with Payment on Backend
     */
    function showSimplifyPaymentForm() {

        var id = elements.paymentForm.parents(".js-payment-option-form").attr("id");
        var match = id && id.match("pay-with-payment-option-([0-9]+)-form");
        var number = match && match[1];
        $("#payment-option-" + number).click();

        elements.conditionApproveElement.prop('checked', true);
        setState({
            conditionsApproved: elements.conditionApproveElement.is(":checked")
        })
    }

    var simplifyError = getUrlParam('simplify_error');
    if (simplifyError) {
        showSimplifyPaymentForm();
        setState({
            paymentError: {
                code: "gateway",
                message: decodeURI(simplifyError)
            }
        });
    }

    /**
     * View initialization
     */
    renderView();
})


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.11
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.badlogic.gdx.physics.bullet.dynamics;

import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.physics.bullet.linearmath.*;
import com.badlogic.gdx.physics.bullet.collision.*;
import com.badlogic.gdx.math.Vector3;

public class btTranslationalLimitMotor extends BulletBase {
	private long swigCPtr;

	protected btTranslationalLimitMotor (final String className, long cPtr, boolean cMemoryOwn) {
		super(className, cPtr, cMemoryOwn);
		swigCPtr = cPtr;
	}

	/** Construct a new btTranslationalLimitMotor, normally you should not need this constructor it's intended for low-level
	 * usage. */
	public btTranslationalLimitMotor (long cPtr, boolean cMemoryOwn) {
		this("btTranslationalLimitMotor", cPtr, cMemoryOwn);
		construct();
	}

	@Override
	protected void reset (long cPtr, boolean cMemoryOwn) {
		if (!destroyed) destroy();
		super.reset(swigCPtr = cPtr, cMemoryOwn);
	}

	public static long getCPtr (btTranslationalLimitMotor obj) {
		return (obj == null) ? 0 : obj.swigCPtr;
	}

	@Override
	protected void finalize () throws Throwable {
		if (!destroyed) destroy();
		super.finalize();
	}

	@Override
	protected synchronized void delete () {
		if (swigCPtr != 0) {
			if (swigCMemOwn) {
				swigCMemOwn = false;
				DynamicsJNI.delete_btTranslationalLimitMotor(swigCPtr);
			}
			swigCPtr = 0;
		}
		super.delete();
	}

	public void setLowerLimit (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_lowerLimit_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getLowerLimit () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_lowerLimit_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setUpperLimit (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_upperLimit_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getUpperLimit () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_upperLimit_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setAccumulatedImpulse (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_accumulatedImpulse_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getAccumulatedImpulse () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_accumulatedImpulse_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setLimitSoftness (float value) {
		DynamicsJNI.btTranslationalLimitMotor_limitSoftness_set(swigCPtr, this, value);
	}

	public float getLimitSoftness () {
		return DynamicsJNI.btTranslationalLimitMotor_limitSoftness_get(swigCPtr, this);
	}

	public void setDamping (float value) {
		DynamicsJNI.btTranslationalLimitMotor_damping_set(swigCPtr, this, value);
	}

	public float getDamping () {
		return DynamicsJNI.btTranslationalLimitMotor_damping_get(swigCPtr, this);
	}

	public void setRestitution (float value) {
		DynamicsJNI.btTranslationalLimitMotor_restitution_set(swigCPtr, this, value);
	}

	public float getRestitution () {
		return DynamicsJNI.btTranslationalLimitMotor_restitution_get(swigCPtr, this);
	}

	public void setNormalCFM (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_normalCFM_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getNormalCFM () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_normalCFM_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setStopERP (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_stopERP_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getStopERP () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_stopERP_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setStopCFM (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_stopCFM_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getStopCFM () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_stopCFM_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setEnableMotor (boolean[] value) {
		DynamicsJNI.btTranslationalLimitMotor_enableMotor_set(swigCPtr, this, value);
	}

	public boolean[] getEnableMotor () {
		return DynamicsJNI.btTranslationalLimitMotor_enableMotor_get(swigCPtr, this);
	}

	public void setTargetVelocity (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_targetVelocity_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getTargetVelocity () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_targetVelocity_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setMaxMotorForce (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_maxMotorForce_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getMaxMotorForce () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_maxMotorForce_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setCurrentLimitError (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_currentLimitError_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getCurrentLimitError () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_currentLimitError_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setCurrentLinearDiff (btVector3 value) {
		DynamicsJNI.btTranslationalLimitMotor_currentLinearDiff_set(swigCPtr, this, btVector3.getCPtr(value), value);
	}

	public btVector3 getCurrentLinearDiff () {
		long cPtr = DynamicsJNI.btTranslationalLimitMotor_currentLinearDiff_get(swigCPtr, this);
		return (cPtr == 0) ? null : new btVector3(cPtr, false);
	}

	public void setCurrentLimit (int[] value) {
		DynamicsJNI.btTranslationalLimitMotor_currentLimit_set(swigCPtr, this, value);
	}

	public int[] getCurrentLimit () {
		return DynamicsJNI.btTranslationalLimitMotor_currentLimit_get(swigCPtr, this);
	}

	public btTranslationalLimitMotor () {
		this(DynamicsJNI.new_btTranslationalLimitMotor__SWIG_0(), true);
	}

	public btTranslationalLimitMotor (btTranslationalLimitMotor other) {
		this(DynamicsJNI.new_btTranslationalLimitMotor__SWIG_1(btTranslationalLimitMotor.getCPtr(other), other), true);
	}

	public boolean isLimited (int limitIndex) {
		return DynamicsJNI.btTranslationalLimitMotor_isLimited(swigCPtr, this, limitIndex);
	}

	public boolean needApplyForce (int limitIndex) {
		return DynamicsJNI.btTranslationalLimitMotor_needApplyForce(swigCPtr, this, limitIndex);
	}

	public int testLimitValue (int limitIndex, float test_value) {
		return DynamicsJNI.btTranslationalLimitMotor_testLimitValue(swigCPtr, this, limitIndex, test_value);
	}

	public float solveLinearAxis (float timeStep, float jacDiagABInv, btRigidBody body1, Vector3 pointInA, btRigidBody body2,
		Vector3 pointInB, int limit_index, Vector3 axis_normal_on_a, Vector3 anchorPos) {
		return DynamicsJNI.btTranslationalLimitMotor_solveLinearAxis(swigCPtr, this, timeStep, jacDiagABInv,
			btRigidBody.getCPtr(body1), body1, pointInA, btRigidBody.getCPtr(body2), body2, pointInB, limit_index, axis_normal_on_a,
			anchorPos);
	}

}


text:
#include "Client.h"
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
/*
What does client do?
1) At startup perform a full sync with the remote server
2) React to file edition/creation/deletion updating the remote server

*/

int CALLBACK WinMain(
	HINSTANCE   hInstance,
	HINSTANCE   hPrevInstance,
	LPSTR       lpCmdLine,
	int         nCmdShow
	)
{

	return(0);
}


text:
using Poco::Timestamp;
using Poco::Timespan;
using Poco::DateTimeFormatter;
using Poco::DateTimeFormat;
using Poco::DateTimeParser;
using Poco::DateTime;
using Poco::Net::NameValueCollection;
using Poco::Net::HTTPCookie;

HTTPCookieTest::HTTPCookieTest(const std::string& name): CppUnit::TestCase(name)
{
}

HTTPCookieTest::~HTTPCookieTest()
{
}

void HTTPCookieTest::testCookie()
{
	HTTPCookie cookie("name", "value");
	assert (cookie.getName() == "name");
	assert (cookie.getValue() == "value");
	assert (cookie.toString() == "name=value");
	cookie.setPath("/");
	assert (cookie.toString() == "name=value; path=/");
	cookie.setComment("comment");
	assert (cookie.toString() == "name=value; path=/");
	cookie.setDomain("appinf.com");
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/");
	cookie.setSecure(true);
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure");
	cookie.setHttpOnly(true);
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure; HttpOnly");
	cookie.setPriority("Low");
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=Low; secure; HttpOnly");
	cookie.setPriority("Medium");
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=Medium; secure; HttpOnly");
	cookie.setPriority("High");
	assert (cookie.toString() == "name=value; domain=appinf.com; path=/; Priority=High; secure; HttpOnly");
	cookie.setPriority("");
	cookie.setHttpOnly(false);

	cookie.setVersion(1);
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; secure; Version=\"1\"");

	cookie.setSecure(false);
	cookie.setMaxAge(100);
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Max-Age=\"100\"; Version=\"1\"");

	cookie.setHttpOnly(true);
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Max-Age=\"100\"; HttpOnly; Version=\"1\"");

	cookie.setPriority("Low");
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"Low\"; Max-Age=\"100\"; HttpOnly; Version=\"1\"");
	cookie.setPriority("Medium");
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"Medium\"; Max-Age=\"100\"; HttpOnly; Version=\"1\"");
	cookie.setPriority("High");
	assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Priority=\"High\"; Max-Age=\"100\"; HttpOnly; Version=\"1\"");
}

void HTTPCookieTest::testEscape()
{
	std::string escaped = HTTPCookie::escape("this is a test!");
	assert (escaped == "this%20is%20a%20test!");

	escaped = HTTPCookie::escape("\n\t@,;\"'");
	assert (escaped == "%0A%09@%2C%3B%22%27");
}

void HTTPCookieTest::testUnescape()
{
	std::string unescaped = HTTPCookie::unescape("this%20is%20a%20test!");
	assert (unescaped == "this is a test!");

	unescaped = HTTPCookie::unescape("%0a%09@%2c%3b%22%27");
	assert (unescaped == "\n\t@,;\"'");
}

void HTTPCookieTest::testExpiryFuture()
{
	DateTime future;
	//1 year from now
	future.assign(future.year() + 1,
		future.month(),
		future.day(),
		future.hour(),
		future.minute(),
		future.second(),
		future.millisecond(),
		future.microsecond());
	testCookieExpiry(future);
}

void HTTPCookieTest::testExpiryPast()
{
	DateTime past;
	// 1 year ago
	past.assign(past.year() - 1,
		past.month(),
		past.day(),
		past.hour(),
		past.minute(),
		past.second(),
		past.millisecond(),
		past.microsecond());
	testCookieExpiry(past);
}

void HTTPCookieTest::testCookieExpiry(DateTime expiryTime)
{
	NameValueCollection nvc;
	nvc.add("name", "value");
	std::string expiryString = DateTimeFormatter::format(expiryTime.timestamp(),DateTimeFormat::HTTP_FORMAT);
	nvc.add("expires", expiryString);

	Timestamp before; //start of cookie lifetime
	HTTPCookie cookie(nvc); //cookie created
	std::string cookieStringV0 = cookie.toString();
	cookie.setVersion(1);
	std::string cookieStringV1 = cookie.toString();
	Timestamp now;
	//expected number of seconds until expiryTime - should be close to cookie._maxAge
	int expectedMaxAge = (int) ((expiryTime.timestamp() - now) / Timestamp::resolution()); //expected number of seconds until expiryTime
	Timestamp after; //end of cookie lifetime

	//length of lifetime of the cookie
	Timespan delta = after - before;

	//pull out cookie expire time string
	size_t startPos = cookieStringV0.find("expires=") + 8;
	std::string cookieExpireTimeStr = cookieStringV0.substr(startPos, cookieStringV0.find(";", startPos));
	//convert to a DateTime
	int tzd;
	DateTime cookieExpireTime = DateTimeParser::parse(cookieExpireTimeStr, tzd);
	//pull out cookie max age
	int cookieMaxAge;
	startPos = cookieStringV1.find("Max-Age=\"") + 9;
	std::string cookieMaxAgeStr = cookieStringV1.substr(startPos, cookieStringV1.find("\"", startPos));
	//convert to integer
	std::istringstream(cookieMaxAgeStr) >> cookieMaxAge;

	//assert that the cookie's expiry time reflects the time passed to
	//its constructor, within a delta of the lifetime of the cookie
	assert (cookieExpireTime - expiryTime <= delta);
	//assert that the cookie's max age is the number of seconds between
	//the creation of the cookie and the expiry time passed to its
	//constuctor, within a delta of the lifetime of the cookie
	assert (cookieMaxAge - expectedMaxAge <= delta.seconds());
}

void HTTPCookieTest::setUp()
{
}

void HTTPCookieTest::tearDown()
{
}

CppUnit::Test* HTTPCookieTest::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPCookieTest");

	CppUnit_addTest(pSuite, HTTPCookieTest, testCookie);
	CppUnit_addTest(pSuite, HTTPCookieTest, testEscape);
	CppUnit_addTest(pSuite, HTTPCookieTest, testUnescape);
	CppUnit_addTest(pSuite, HTTPCookieTest, testExpiryFuture);
	CppUnit_addTest(pSuite, HTTPCookieTest, testExpiryPast);

	return pSuite;
}


text:
/**
 *
 */
package com.uesocc.sicmec.framework.general;

import java.text.ParseException;

/**
 * @author xtiyo
 *
 */

public interface BaseAdapter <T,DTO>
{

	public T dtoToEntity(DTO obj) throws ParseException;

	public DTO entityToDto(T obj);

}


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

</beans>


text:
@interface YYBBSDK_PGY : YYBBPlugin<YYBBOther>

@end


text:
'use strict';

import {Selection} from 'vs/editor/common/core/selection';
import {SortLinesCommand} from 'vs/editor/contrib/linesOperations/common/sortLinesCommand';
import {testCommand} from 'vs/editor/test/common/commands/commandTestUtils';

function testSortLinesAscendingCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
	testCommand(lines, null, selection, (sel) => new SortLinesCommand(sel, false), expectedLines, expectedSelection);
}

function testSortLinesDescendingCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
	testCommand(lines, null, selection, (sel) => new SortLinesCommand(sel, true), expectedLines, expectedSelection);
}

suite('Editor Contrib - Sort Lines Command', () => {

	test('no op unless at least two lines selected 1', function () {
		testSortLinesAscendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 3, 1, 1),
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 3, 1, 1)
		);
	});

	test('no op unless at least two lines selected 2', function () {
		testSortLinesAscendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 3, 2, 1),
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 3, 2, 1)
		);
	});

	test('sorting two lines ascending', function () {
		testSortLinesAscendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(3, 3, 4, 2),
			[
				'first',
				'second line',
				'fourth line',
				'third line',
				'fifth'
			],
			new Selection(3, 3, 4, 2)
		);
	});

	test('sorting first 4 lines ascending', function () {
		testSortLinesAscendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 1, 5, 1),
			[
				'first',
				'fourth line',
				'second line',
				'third line',
				'fifth'
			],
			new Selection(1, 1, 5, 1)
		);
	});

	test('sorting all lines ascending', function () {
		testSortLinesAscendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 1, 5, 6),
			[
				'fifth',
				'first',
				'fourth line',
				'second line',
				'third line',
			],
			new Selection(1, 1, 5, 6)
		);
	});

	test('sorting first 4 lines desscending', function () {
		testSortLinesDescendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 1, 5, 1),
			[
				'third line',
				'second line',
				'fourth line',
				'first',
				'fifth'
			],
			new Selection(1, 1, 5, 1)
		);
	});

	test('sorting all lines descending', function () {
		testSortLinesDescendingCommand(
			[
				'first',
				'second line',
				'third line',
				'fourth line',
				'fifth'
			],
			new Selection(1, 1, 5, 6),
			[
				'third line',
				'second line',
				'fourth line',
				'first',
				'fifth',
			],
			new Selection(1, 1, 5, 6)
		);
	});
});


text:
where my stuff for android  hackathon stuff

![alt-text](/Android-Logo-2.jpg)


text:
import unittest
from django.test import TestCase
from django.contrib.auth.models import User
from django.db import connection

from cacheops import invalidate_all
from .models import *  # noqa

class BaseTestCase(TestCase):
    def setUp(self):
        super(BaseTestCase, self).setUp()
        invalidate_all()
        print('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\invalidation done///////////////////////////////////////////////')

class BasicTests(BaseTestCase):
    fixtures = ['basic']

    def test_it_works(self):
        with self.assertNumQueries(1):
            cnt1 = Category.objects.cache().count()
            cnt2 = Category.objects.cache().count()
            self.assertEqual(cnt1, cnt2)

    def test_invalidation(self):
        post = Post.objects.cache().get(pk=1)
        post.title += ' changed'
        post.save()

        with self.assertNumQueries(1):
            changed_post = Post.objects.cache().get(pk=1)
            self.assertEqual(post.title, changed_post.title)

    def test_invalidate_by_foreign_key(self):
        posts = list(Post.objects.cache().filter(category=1))
        Post.objects.create(title='New Post', category_id=1)

        with self.assertNumQueries(1):
            changed_posts = list(Post.objects.cache().filter(category=1))
            self.assertEqual(len(changed_posts), len(posts) + 1)

    def test_invalidate_by_one_to_one(self):
        extras = list(Extra.objects.cache().filter(post=3))
        Extra.objects.create(post_id=3, tag=0)

        with self.assertNumQueries(1):
            changed_extras = list(Extra.objects.cache().filter(post=3))
            self.assertEqual(len(changed_extras), len(extras) + 1)

    def test_invalidate_by_boolean(self):
        count = Post.objects.cache().filter(visible=True).count()

        post = Post.objects.get(pk=1, visible=True)
        post.visible = False
        post.save()

        with self.assertNumQueries(1):
            new_count = Post.objects.cache().filter(visible=True).count()
            self.assertEqual(new_count, count - 1)

    def test_invalidate_by_m2m(self):
        with self.assertNumQueries(1):
            mb = MachineBrand.objects.cache().get(id=1)

        with self.assertNumQueries(1):
            cat = Category.objects.cache().get(id=1)
        with self.assertNumQueries(0):
            cat = Category.objects.cache().get(id=1)
        with self.assertNumQueries(1):
            cat = Category.objects.cache().get(id=2)

#        with self.assertNumQueries(0):
#            cat = Category.objects.cache().get(id=2)

        with self.assertNumQueries(2):
            mb.categories.remove(cat)

        with self.assertNumQueries(1):
            cat = Category.objects.cache().get(id=1)
        with self.assertNumQueries(0):
            cat = Category.objects.cache().get(id=1)

#        with self.assertNumQueries(1):
#            cat = Category.objects.cache().get(id=2)
#        with self.assertNumQueries(0):
#            cat = Category.objects.cache().get(id=2)

        with self.assertNumQueries(2):
            mb.categories.remove(cat)

        with self.assertNumQueries(1):
            print(mb.categories.cache().all())
        with self.assertNumQueries(0):
            cats = mb.categories.cache().all()
            print(cats)

        with self.assertNumQueries(3):
            mb.categories.remove(cats[0])

        with self.assertNumQueries(1):
            print(mb.categories.cache().all())
        with self.assertNumQueries(0):
            cats = mb.categories.cache().all()
            print(cats)

        with self.assertNumQueries(1):
            cat = Category.objects.cache().create(title='Erlang')

        with self.assertNumQueries(2):
            mb.categories.add(cat)

        with self.assertNumQueries(1):
            print(mb.categories.cache().all())
        with self.assertNumQueries(0):
            cats = mb.categories.cache().all()
            print(cats)

    def test_db_column(self):
        e = Extra.objects.cache().get(tag=5)
        e.save()

    def test_fk_to_db_column(self):
        e = Extra.objects.cache().get(to_tag__tag=5)
        e.save()

        with self.assertNumQueries(1):
            Extra.objects.cache().get(to_tag=5)

class IssueTests(BaseTestCase):
    def setUp(self):
        user = User.objects.create(username='Suor')
        Profile.objects.create(pk=2, user=user, tag=10)
        super(IssueTests, self).setUp()

    def test_16(self):
        p = Profile.objects.cache().get(user__id__exact=1)
        p.save()

        with self.assertNumQueries(1):
            Profile.objects.cache().get(user=1)

    def test_29(self):
        MachineBrand.objects.exclude(categories__in=[1, 2, 3]).cache().count()

    def test_39(self):
        list(Point.objects.filter(x=7).cache())

# Tests for proxy models, see #30
class ProxyTests(BaseTestCase):
    def test_30(self):
        proxies = list(VideoProxy.objects.cache())  # noqa
        Video.objects.create(title='Pulp Fiction')

        with self.assertNumQueries(1):
            list(VideoProxy.objects.cache())

    def test_30_reversed(self):
        proxies = list(Video.objects.cache())  # noqa
        VideoProxy.objects.create(title='Pulp Fiction')

        with self.assertNumQueries(1):
            list(Video.objects.cache())

    @unittest.expectedFailure
    def test_interchange(self):
        proxies = list(Video.objects.cache())  # noqa

        with self.assertNumQueries(0):
            list(VideoProxy.objects.cache())

class MultitableInheritanceTests(BaseTestCase):
    @unittest.expectedFailure
    def test_sub_added(self):
        media_count = Media.objects.cache().count()
        Movie.objects.create(name="Matrix", year=1999)

        with self.assertNumQueries(1):
            self.assertEqual(Media.objects.cache().count(), media_count + 1)

    @unittest.expectedFailure
    def test_base_changed(self):
        matrix = Movie.objects.create(name="Matrix", year=1999)
        list(Movie.objects.cache())

        media = Media.objects.get(pk=matrix.pk)
        media.name = "Matrix (original)"
        media.save()

        with self.assertNumQueries(1):
            list(Movie.objects.cache())


text:
package migrations

import "github.com/BurntSushi/migration"

func AddHostPathVersionToVolumes(tx migration.LimitedTx) error {
	_, err := tx.Exec(`
		ALTER TABLE volumes
		ADD COLUMN host_path_version text;
`)
	return err
}


text:
package com.phloc.commons.typeconvert;

import javax.annotation.Nonnull;

/**
 * Callback interface for registering new type converters.
 *
 * @author Philip Helger
 */
public interface ITypeConverterRegistry
{
  /**
   * Register a type converter.
   *
   * @param aSrcClass
   *        A non-null source class to convert from. Must be an
   *        instancable class.
   * @param aDstClass
   *        A non-null destination class to convert to. Must be an
   *        instancable class. May not equal the source class.
   * @param aConverter
   *        The convert to use. May not be null.
   */
  void registerTypeConverter (@Nonnull Class <?> aSrcClass,
                              @Nonnull Class <?> aDstClass,
                              @Nonnull ITypeConverter aConverter);

  /**
   * Register a type converter.
   *
   * @param aSrcClasses
   *        A non-null collection of source classes to convert
   *        from. Must be an instancable class.
   * @param aDstClass
   *        A non-null destination class to convert to. Must be an
   *        instancable class. May not equal the source class.
   * @param aConverter
   *        The convert to use. May not be null.
   */
  void registerTypeConverter (@Nonnull Class <?> [] aSrcClasses,
                              @Nonnull Class <?> aDstClass,
                              @Nonnull ITypeConverter aConverter);

  /**
   * Register a flexible type converter rule.
   *
   * @param aTypeConverterRule
   *        The type converter rule to be registered. May not be
   *        null.
   */
  void registerTypeConverterRule (@Nonnull ITypeConverterRule aTypeConverterRule);
}