text:
package rtdc.web.server.servlet;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rtdc.core.event.ActionCompleteEvent;
import rtdc.core.event.ErrorEvent;
import rtdc.core.event.FetchUserEvent;
import rtdc.core.event.FetchUsersEvent;
import rtdc.core.exception.ValidationException;
import rtdc.core.json.JSONObject;
import rtdc.core.model.Permission;
import rtdc.core.model.SimpleValidator;
import rtdc.core.model.User;
import rtdc.web.server.config.PersistenceConfig;
import rtdc.web.server.model.AuthenticationToken;
import rtdc.web.server.model.UserCredentials;
import rtdc.web.server.service.AsteriskRealTimeService;
import rtdc.web.server.service.AuthService;

import javax.annotation.security.RolesAllowed;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import java.sql.SQLException;
import java.util.List;
import java.util.Set;

@Path("users")
public class UserServlet {

    private static final Logger log = LoggerFactory.getLogger(UserServlet.class);

    @GET
    @RolesAllowed({Permission.USER, Permission.MANAGER, Permission.ADMIN})
    public String getUsers(@Context HttpServletRequest req){
        Session session = PersistenceConfig.getSessionFactory().openSession();
        Transaction transaction = null;
        List<User> users = null;
        try{
            transaction = session.beginTransaction();
            users = (List<User>) session.createCriteria(User.class).list();
            transaction.commit();

            // TODO: Replace string with actual username
            log.info("{}: USER: Getting all users for user.", "Username");
        } catch (RuntimeException e) {
            if(transaction != null)
                transaction.rollback();
            throw e;
        } finally{
            session.close();
        }
        return new FetchUsersEvent(users).toString();
    }

    @POST
    @Path("{username}")
    @Consumes("application/x-www-form-urlencoded")
    // Currently users with permission USER must have access to this cause it is used to get information for communications
    @RolesAllowed({Permission.USER, Permission.ADMIN})
    public String getUser(@Context HttpServletRequest req, @Context User user, @PathParam("username") String username){
        Session session = PersistenceConfig.getSessionFactory().openSession();
        Transaction transaction = null;
        User retrievedUser = null;
        try{
            transaction = session.beginTransaction();
            List<User> userList = (List<User>) session.createCriteria(User.class).add(Restrictions.eq("username", username)).list();
            if(!userList.isEmpty())
                retrievedUser = userList.get(0);
            else
                return new ErrorEvent("No user with username " + username + " found.").toString();
            transaction.commit();

            log.info("{}: USER: Getting user " + retrievedUser.getUsername() + " for user.", user.getUsername());
        } catch (RuntimeException e) {
            if(transaction != null)
                transaction.rollback();
            throw e;
        } finally{
            session.close();
        }
        return new FetchUserEvent(retrievedUser).toString();
    }

    @POST
    @Path("add")
    @Consumes("application/x-www-form-urlencoded")
    @Produces("application/json")
    @RolesAllowed({Permission.ADMIN})
    public String addUser(@Context HttpServletRequest req, @Context User user, @FormParam("user") String userString, @FormParam("password") String password){
        User newUser = new User(new JSONObject(userString));
        user.setUsername(user.getUsername().toLowerCase());
        Set<ConstraintViolation<User>> violations = Validation.buildDefaultValidatorFactory().getValidator().validate(newUser);
        if(!violations.isEmpty()) {
            log.warn("Error adding user: " + violations.toString());
            return new ErrorEvent(violations.toString()).toString();
        }

        try {
            SimpleValidator.validateUser(newUser);
            SimpleValidator.validatePassword(password);
        }catch (ValidationException e){
            log.warn("Error adding user: " + e.getMessage());
            return new ErrorEvent(e.getMessage()).toString();
        }

        Session session = PersistenceConfig.getSessionFactory().openSession();
        Transaction transaction = null;
        try{
            transaction = session.beginTransaction();
            session.saveOrUpdate(newUser);
            UserCredentials credentials = AuthService.generateUserCredentials(newUser, password);
            session.saveOrUpdate(credentials);
            AsteriskRealTimeService.addUser(newUser, credentials.getAsteriskPassword());
            transaction.commit();

            log.info("{}: USER: New user added: {}", user.getUsername(), userString);
        } catch (RuntimeException e) {
            if(transaction != null)
                transaction.rollback();
            throw e;
        } finally {
            session.close();
        }

        return new ActionCompleteEvent(newUser.getId(), "user", "add").toString();
    }

    @PUT
    @Consumes("application/x-www-form-urlencoded")
    @Produces("application/json")
    @RolesAllowed({Permission.USER, Permission.MANAGER, Permission.ADMIN})
    public String editUser(@Context HttpServletRequest req, @Context User user, @FormParam("user") String userString, @FormParam("password") String password, @FormParam("changePassword") String changePassword){
        User editedUser = new User(new JSONObject(userString));

        Set<ConstraintViolation<User>> violations = Validation.buildDefaultValidatorFactory().getValidator().validate(editedUser);
        if(!violations.isEmpty())
            return new ErrorEvent(violations.toString()).toString();

        try {
            SimpleValidator.validateUser(editedUser);
        }catch (ValidationException e){
            log.warn("Error editing user: " + e.getMessage());
            return new ErrorEvent(e.getMessage()).toString();
        }

        if(!user.getPermission().equals(User.Permission.ADMIN)){
            if(user.getId() != editedUser.getId()) {
                log.warn("Error editing user: user " + user.getUsername() + " doesn't have enough permissions");
                return new ErrorEvent("Insufficient permissions: you do not have permission to modify this user.").toString();
            }else if(!user.getPermission().equals(editedUser.getPermission()) || !user.getUnit().equals(editedUser.getUnit())
                    || !user.getRole().equals(editedUser.getRole())){
                log.warn("Error editing user: user " + user.getUsername() + " tried to change its own permission, unit or role");
                return new ErrorEvent("Insufficient permissions: to edit your permissions, unit or role, please talk to an admin.").toString();
            }
        }

        Session session = PersistenceConfig.getSessionFactory().openSession();
        Transaction transaction = null;
        try{
            transaction = session.beginTransaction();
            session.saveOrUpdate(editedUser);
            AsteriskRealTimeService.editUser(editedUser);
            transaction.commit();

            log.info("{}: USER: User updated: {}", user.getUsername(), userString);
        } catch (RuntimeException e) {
            if(transaction != null)
                transaction.rollback();
            throw e;
        } finally {
            session.close();
        }

        if(Boolean.parseBoolean(changePassword)) {
            try {
                SimpleValidator.validatePassword(password);
                AuthService.editPassword(editedUser, password);
            }catch (ValidationException e){
                log.warn("Error editing user's password: " + e.getMessage());
                return new ErrorEvent(e.getMessage()).toString();
            }
        }

        return new ActionCompleteEvent(user.getId(), "user", "update").toString();
    }

    @DELETE
    @Path("{id}")
    @Produces("application/json")
    @RolesAllowed({Permission.ADMIN})
    public String deleteUser(@Context HttpServletRequest req, @Context User user, @PathParam("id") String idString){
        Session session = PersistenceConfig.getSessionFactory().openSession();
        Transaction transaction = null;
        int id = Integer.valueOf(idString);
        try{
            log.warn("Deleting user with id " + id);
            transaction = session.beginTransaction();
            User userToDelete = (User) session.load(User.class, id);

            List<UserCredentials> userCredentialsList = (List<UserCredentials>) session.createCriteria(UserCredentials.class).add(Restrictions.eq("user", userToDelete)).list();
            if(!userCredentialsList.isEmpty()){
                session.delete(userCredentialsList.get(0));
            }

            List<AuthenticationToken> authenticationTokenList = (List<AuthenticationToken>) session.createCriteria(AuthenticationToken.class).add(Restrictions.eq("user", userToDelete)).list();
            if(!authenticationTokenList.isEmpty()){
                session.delete(authenticationTokenList.get(0));
            }

            session.delete(userToDelete);
            AsteriskRealTimeService.deleteUser(userToDelete);
            transaction.commit();

            log.warn("{}: USER: User deleted: {}", user.getUsername(), userToDelete.getUsername());
        } catch (RuntimeException e) {
            if(transaction != null)
                transaction.rollback();
            throw e;
        } finally {
            session.close();
        }
        return new ActionCompleteEvent(id, "user", "delete").toString();
    }

}


text:
package com.evalonlabs.myinbox

import org.junit._
import Assert._

@Test
class AppTest {

    @Test
    def testOK() = assertTrue(true)

//    @Test
//    def testKO() = assertTrue(false)

}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 66(4): 716 (1974)

#### Original name
Entoloma brunneum Petch

### Remarks
null


text:
package com.senseidb.search.client.json.req;

/**
 * Represents result pagination.
 * Contains :
    - the number of search results to return
      the starting offset of search results
 */
public class Paging {
    /**
     * the number of search results to return

     */
    private int count;
    /**
     * the starting offset of search results

     */
    private int offset;
    public Paging() {
        // TODO Auto-generated constructor stub
    }
    public Paging(int count, int offset) {
        super();
        this.count = count;
        this.offset = offset;
    }

}


text:
#!/usr/bin/env python

import os
import sys
import shutil
import re
from bs4 import BeautifulSoup

def file_write(file_obj, text):
    """Utility function to ensure writing with ascii."""

    file_obj.write(text.encode('utf-8'))

def prepare_name(text):
    """
        Utility function to remove colons and commas from to be created
        directory and fileneames.
    """

    for punc in [',', ':', '(', ')', ';']:
        text = text.replace(punc, '')

    return text

def parse_index(index_path):
    """Parses index.html file for chapters and sections."""

    soup = BeautifulSoup(open(index_path))
    scrape = {}
    chapters = [chap for chap in soup.ul.contents if chap != '\n']
    # chapters now contains a list of chapters (bs4 li elements)

    for chapter in chapters: # loop through chapters
        chapter_string = chapter.a.string
        if 'Chapter' in chapter_string:
            chapter_string = chapter_string.replace('Chapter ', '') # get ride of 'Chapter'
            chapter_string = chapter_string.replace(' ', '', 1) # delete space after colon
        chapter_file = chapter.a['href']
        chapter_tuple = (chapter_string, chapter_file)
        scrape[chapter_tuple] = []
        if chapter.li: # filter out non-content chapters
                               # (Preface, Acknowledgements, etc)
            for section in chapter.find_all('li'):
                section_string = section.a.string
                section_file = section.a['href']
                section_tuple = (section_string, section_file)
                scrape[chapter_tuple].append(section_tuple)

    return scrape

def create_structure(index_scrape):
    """
        Creates directory structure based off of data passed from the scraped
        index.html file.
    """

    global keywords # if you can think of a better way, let me know :/
    keywords = {}
    os.mkdir(NEW_DIR)
    os.mkdir(NEW_DIR + '/media')
    os.chdir(NEW_DIR)
    generate_template('.', 'index.md', NEW_DIR.replace('_', ' '), 'course')
    generate_chapters(index_scrape)
    generate_keywords()
    os.chdir('..')

def generate_template(location, filename, title, layout):
    """Generates general template with header."""

    with open('%s/%s' % (location, filename), 'w') as index:
        index.write('/*\n')
        file_write(index, 'Title: %s\n' % title)
        file_write(index, 'layout: %s\n' % layout)
        index.write('*/\n\n')

        if layout == 'chapter':
            index.write('## Chapter Learning Objectives\n\n')
        elif layout == 'review':
            index.write('## Key Takeaways\n\n')
        elif layout == 'questions':
            index.write('## Exercises\n\n')

def generate_chapters(index_scrape):
    """Generates directories and content for each course chapter."""

    for tuple in index_scrape: # for each chapter
        (chapter, chapter_file) = tuple
        if re.search('^[0-9]+:', chapter): # if it's actual content (has #:)
            chapter = chapter.replace(' ', '_')
            try: # get number of chapter from title
                chapter_num = int(chapter[:2])
                offset = 3
            except ValueError:
                chapter_num = int(chapter[:1])
                offset = 2
            chapter_name = chapter[offset:]
            chapter_dir = '%d.%s' % (chapter_num, chapter_name)
            chapter_dir = prepare_name(chapter_dir)
            os.mkdir(chapter_dir)
            generate_template(chapter_dir, 'index.md',
                              chapter_name.replace('_', ' '), 'chapter')
            generate_template(chapter_dir, '%s_review.md' % chapter_dir,
                              chapter_name.replace('_', ' '), 'review')
            generate_chapter_content(chapter_dir, index_scrape[tuple])
        else: # non-content
            try:
                os.mkdir('Non-Content')
            except OSError:
                pass

            chapter = chapter.replace(' ', '_')
            chapter_md = '%s.md' % chapter
            non_content = parse_section(tuple)
            if not non_content: # if there is nothing to write, write nothing
                continue
            with open('Non-Content/%s' % chapter_md, 'w') as non:
                file_write(non, non_content[0])

def generate_chapter_content(chapter_dir, sections):
    """Populate chapter directories with content."""

    for i, section in enumerate(sections, 1):
        section_file = '%d.%s' % (i, section[0].replace(' ', '_'))
        section_file = prepare_name(section_file)
        lesson_content, learning_obj, key_take, exercises \
            = parse_section(section)
        with open('%s/%s.md' % (chapter_dir, section_file), 'w') as lesson:
            file_write(lesson, lesson_content)
        with open('%s/index.md' % chapter_dir, 'a') as index:
            file_write(index, '### Section %d - %s\n\n' % (i, section[0]))
            file_write(index, learning_obj)
            index.write('\n\n')
        with open('%s/%s_review.md' % (chapter_dir, chapter_dir), 'a') as rev:
            file_write(rev, '### Section %d - %s\n\n' % (i, section[0]))
            file_write(rev, key_take)
            rev.write('\n\n')
        if exercises != '*None*':
            generate_template(chapter_dir, '%s_questions.md' % section_file,
                              section[0], 'questions')
            with open('%s/%s_questions.md' % (chapter_dir, section_file),
                      'a') as ques:
                file_write(ques, exercises)

def parse_section(section):
    """
        Parse relevant information out of the original section html file,
        such as learning objectives, actual educational content,
        key takeaways, exercises, and keywords.
    """

    with open('../%s/%s' % (DIR, section[1]), 'r') as lesson:
        soup = BeautifulSoup(lesson.read())

        learning_obj = parse_learning_objectives(soup)
        parse_keywords(soup)
        lesson_content = parse_lesson_content(soup)
        key_take = parse_key_takeaways(soup)
        exercises = parse_exercises(soup)

        # put it all together
    lesson_full = """/*
Title: %s
layout: article
*/

# %s

## Learning Objectives

%s

---

## Content

%s

---

## Key Takeaways

%s
""" % (section[0], section[0], learning_obj, lesson_content, key_take)

    return lesson_full, learning_obj, key_take, exercises

def generate_keywords():
    """
        Generates keywords.xml files based off of global 'keywords'
        dictionary containing term/definition pairs.
    """

    with open('keywords.xml', 'w') as keyw:
        keyw.write('<data>\n')
        for term in sorted(keywords.keys()):
            file_write(keyw, '<title>%s</title>' % term)
            file_write(keyw, '<text>%s</text>\n' % keywords[term])
        keyw.write('</data>')

def parse_learning_objectives(soup):
    """
        Given a BeautifulSoup object of an html file, parse out the
        "learning objectives" section and return in as a string.

        Since parse_key_takeaways performs essentially identical
        behavior, we'll just piggyback off it.
    """
    return parse_key_takeaways(soup, 'learning_objectives')

def parse_keywords(soup):
    """
        Given a BeautifulSoup object of an html file, parse out the
        keywords and add to the ever unfortunate global keywords dictionary
        for this course.
    """

    try:
        words = soup.find_all(class_='margin_term')
        for word in words:
            term = word.a.text
            definition = word.span.text
            keywords[term] = definition
    except AttributeError:
        pass

def parse_lesson_content(soup):
    """
        Given a BeautifulSoup object of an html file, parse out the
        lesson content and return as a string.
    """

    lesson_content = []

    # I need to get every tag whose class is either "title editable block"
    # or "para editable block"
    content_scrape = soup.find_all(class_='block') # gets us close
    del content_scrape[0]
    content_scrape_2 = []

    # this is a really bad way of doing this but I can't figure out another
    # way right now :(
    for element in content_scrape:
        element_class = element['class'][0]
        if element_class in [u'para', u'title', u'itemizedlist',
                             u'orderedlist']:
            content_scrape_2.append(element) # finishes off the job
        elif element_class in [u'callout', u'blockquote']:
            content_scrape_2.append('```\n')
            content_scrape_2.append(element)
            content_scrape_2.append('\n```')
        elif element_class in [u'informalfigure', u'figure']:
            img_filename_full = element.img['src']
            img_filename = img_filename_full.split('/')[1]
            if element.p:
                img_description = element.p.text
            else:
                img_description = '*No Description*'
            shutil.copy('../%s/%s' % (DIR, img_filename_full), 'media')
            content_scrape_2.append('\n\n\n![](%s)\n> %s\n\n\n' % \
                                    ('../media/%s' % img_filename,
                                     img_description))
        elif element_class in [u'informalequation']:
            content_scrape_2.append('```\n*cannot display equation*\n```\n')
        elif element_class in [u'table']:
            try:
                content_scrape_2.append(str(element).encode('utf-8'))
            except UnicodeError:
                pass

    for element in content_scrape_2: # assemble the list with strings
        try:
            # remove special definition tag for vocab words
            element.find(class_='glossdef').decompose()
        except (AttributeError, TypeError):
            pass
        try:
            if 'title' in element['class']:
                lesson_content.append('\n### ')
        except (AttributeError, TypeError):
            pass

        try:
            if 'list' in element['class'][0]:
                for li in element.find_all('li'):
                    li_text = li.text.replace('\n', '')
                    lesson_content.append('- %s\n' % li_text)
            else:
                lesson_content.append(element.text)
        except (AttributeError, TypeError):
            lesson_content.append(element)
        lesson_content.append('\n\n')

    lesson_content = ''.join(lesson_content)
    if not lesson_content:
        lesson_content = '*None*'
    else:
        lesson_content = lesson_content.replace('\n\n\n\n', '\n\n')

    return lesson_content

def parse_key_takeaways(soup, clas='key_takeaways editable block'):
    """
        Given a BeautifulSoup object of an html file, parse out the
        "key takeaways" section and return as a string.

        Since parse_learnings_objectives, and parse_exercises
        are basically the same function, there is an optional parameter
        for what class to parse by.
    """

    try:
        key_take = soup.find(class_=clas).p.text
        if soup.find(class_=clas).li: # if there's a list too, it's probably
                                      # what we want
            raise Exception
    except (AttributeError, Exception):
        kt = soup.find(class_=clas)

        if kt:
            kt = kt.find_all('li')
        else:
            return '*None*'

        key_take = []
        for li in kt:
            li_text = li.text.replace('\n', '')
            key_take.append('- %s\n' % li_text)
        key_take.append('\n')
        key_take = ''.join(key_take)

    return key_take

def parse_exercises(soup):
    """
        Given a BeautifulSoup object of an html file, parse out the
        "exercises" section and return as a string.

        Since parse_key_takeaways performs essentially identical
        behavior, we'll just piggyback off it.
    """
    return parse_key_takeaways(soup, 'exercises editable block')

def main():
    if len(sys.argv) != 2:
        print 'Usage: ./scraper.py [directory]'
        sys.exit()

    global DIR, NEW_DIR
    DIR = sys.argv[1]
    NEW_DIR = DIR.replace('-', '_')

    index_scrape = parse_index(DIR + '/index.html')
    create_structure(index_scrape)

if __name__ == '__main__':
    main()


text:
<?php

namespace Symfony\Component\Messenger\Transport\RedisExt;

use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;

/**
 * @author Alexander Schranz <alexander@suluio>
 * @author Antoine Bluchet <soyuka@gmail.com>
 */
class RedisTransportFactory implements TransportFactoryInterface
{
    public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
    {
        return new RedisTransport(Connection::fromDsn($dsn, $options), $serializer);
    }

    public function supports(string $dsn, array $options): bool
    {
        return 0 === strpos($dsn, 'redis://');
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Subscriptions/2013-07-01">
   <GetServiceStatusResult>
        <Status>String</Status>
        <Timestamp>1969-07-21T02:56:03Z</Timestamp>
    </GetServiceStatusResult>
   <ResponseMetadata>
        <RequestId>String</RequestId>
    </ResponseMetadata>
</GetServiceStatusResponse>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Adding indexes to large tables. These indexes should be created concurrently,
    #   unfortunately we can't run migrations outside of a transaction until Django
    #   1.10. So until then these should be run manually.
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = False

    dependencies = [
        ('sentry', '0009_auto_20191101_1608'),
    ]

    operations = [
        migrations.AlterUniqueTogether(
            name='pagerdutyservice',
            unique_together=set([]),
        ),
    ]


text:
require 'rspec-puppet'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

$: << File.join(fixture_path, 'modules/module-data/lib')

RSpec.configure do |c|
  c.mock_framework = :rspec
  c.module_path = File.join(fixture_path, 'modules')
  c.manifest_dir = File.join(fixture_path, 'manifests')
end


text:
package org.gobiiproject.gobiidao.resultset.access.impl;

import org.gobiiproject.gobiidao.GobiiDaoException;
import org.gobiiproject.gobiidao.resultset.access.RsDisplayDao;
import org.gobiiproject.gobiidao.resultset.core.SpRunnerCallable;
import org.gobiiproject.gobiidao.resultset.core.StoredProcExec;
import org.gobiiproject.gobiidao.resultset.sqlworkers.modify.SpInsDisplay;
import org.gobiiproject.gobiidao.resultset.sqlworkers.modify.SpUpdDisplay;
import org.gobiiproject.gobiidao.resultset.sqlworkers.read.SpGetTableDisplayDetailByDisplayId;
import org.gobiiproject.gobiidao.resultset.sqlworkers.read.SpGetTableDisplayNames;
import org.hibernate.exception.SQLGrammarException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Phil on 4/8/2016.
 */
public class RsDisplayDaoImpl implements RsDisplayDao {

    Logger LOGGER = LoggerFactory.getLogger(RsDisplayDaoImpl.class);

    @Autowired
    private StoredProcExec storedProcExec = null;

    @Autowired
    private SpRunnerCallable spRunnerCallable;

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public ResultSet getTableDisplayNames() throws GobiiDaoException {

        ResultSet returnVal = null;

        try {

            SpGetTableDisplayNames spGetTableDisplayNames = new SpGetTableDisplayNames();
            storedProcExec.doWithConnection(spGetTableDisplayNames);
            returnVal = spGetTableDisplayNames.getResultSet();

        } catch (SQLGrammarException e) {

            LOGGER.error("Error retrieving display names", e.getSQL(), e.getSQLException());
            throw (new GobiiDaoException(e));

        }

        return returnVal;
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public Integer createDisplay(Map<String, Object> parameters) throws GobiiDaoException {

        Integer returnVal = null;

        try {

            spRunnerCallable.run(new SpInsDisplay(), parameters);
            returnVal = spRunnerCallable.getResult();

        } catch (SQLGrammarException e) {

            LOGGER.error("Error creating display with SQL ", e.getSQL(), e.getSQLException());
            throw (new GobiiDaoException(e.getSQLException()));

        }

        return returnVal;
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public void updateDisplay(Map<String, Object> parameters) throws GobiiDaoException {

        try {

            spRunnerCallable.run(new SpUpdDisplay(), parameters);

        } catch (SQLGrammarException e) {

            LOGGER.error("Error creating display with SQL ", e.getSQL(), e.getSQLException());
            throw (new GobiiDaoException(e.getSQLException()));
        }
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public ResultSet getTableDisplayDetailByDisplayId(Integer displayId) throws GobiiDaoException {

        ResultSet returnVal;

        try {
            Map<String, Object> parameters = new HashMap<>();
            parameters.put("displayId", displayId);

            SpGetTableDisplayDetailByDisplayId spGetTableDisplayDetailByDisplayId = new SpGetTableDisplayDetailByDisplayId(parameters);
            storedProcExec.doWithConnection(spGetTableDisplayDetailByDisplayId);
            returnVal = spGetTableDisplayDetailByDisplayId.getResultSet();

        } catch (SQLGrammarException e) {
            LOGGER.error("Error retreiving table display details with SQL " + e.getSQL(), e.getSQLException());
            throw new GobiiDaoException(e.getSQLException());
        }

        return returnVal;
    }
} // RsProjectDaoImpl


text:
package aeronicamc.libs.mml.readers.ms2mml;

import aeronicamc.libs.mml.readers.AbstractMmlFileReader;
import org.jetbrains.annotations.NotNull;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.InputStream;
import java.nio.file.Path;

public class Ms2MmlReader extends AbstractMmlFileReader
{
    public Ms2MmlReader() { /* NOP*/ }

    @Override
    public String getFileExtension()
    {
        return "ms2mml";
    }

    @Override
    public boolean parseFile(@NotNull Path path)
    {
        readMs2Mml(getFile(path));
        return !hasErrors();
    }

    @Override
    public boolean parseStream(InputStream is)
    {
        readMs2Mml(is);
        return !hasErrors();
    }

    @Override
    public String getMML()
    {
        return mml;
    }

    private void readMs2Mml(InputStream is)
    {
        Ms2 ms2;
        try
        {
            JAXBContext jaxbContext = JAXBContext.newInstance("aeronicamc.libs.mml.readers.ms2mml");
            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
            ms2 = (Ms2) unmarshaller.unmarshal(is);

            if (ms2 != null)
            {
                StringBuilder builder = new StringBuilder("MML@");
                String melodyValue = ms2.melody;
                if (!melodyValue.equals(""))
                    builder.append(melodyValue);

                if (ms2.chord != null)
                {
                    for (Ms2.Chord chord : ms2.chord)
                    {
                        String chordValue = chord.value;
                        if ((chordValue.equals("")))
                            continue;
                        builder.append(",");
                        builder.append(chordValue);
                    }
                }
                builder.append(";");
                mml = builder.toString();
            }
        } catch (JAXBException e)
        {
            addError(e.getLocalizedMessage());
            mml = "";
        }
    }
}


text:
#include "common.h"
#include "common/string.h"
#include "mud/caffect.h"

std::string CreatureAffectType::names[] = {
	"unknown",
	"toxin",
	"disease",
	"innate",
	"magic",
	"psionic",
	"tech",
};

CreatureAffectType CreatureAffectType::lookup(const std::string& name)
{
	for (uint i = 0; i < COUNT; ++i)
		if (strEq(name, names[i]))
			return i;
	return UNKNOWN;
}

CreatureAffectGroup::CreatureAffectGroup(const std::string& s_title, CreatureAffectType s_type, uint s_duration) : title(s_title), type(s_type), duration(s_duration)
{
}

int CreatureAffectGroup::addAffect(ICreatureAffect* affect)
{
	affects.push_back(affect);
	return 0;
}

int CreatureAffectGroup::apply(Creature* creature) const
{
	for (AffectList::const_iterator i = affects.begin(); i != affects.end(); ++i)
		if ((*i)->apply(creature))
			return -1;
	return 0;
}

void CreatureAffectGroup::remove(Creature* creature) const
{
	for (AffectList::const_iterator i = affects.begin(); i != affects.end(); ++i)
		(*i)->remove(creature);
}

void CreatureAffectGroup::update(Creature* creature)
{
	if (duration > 0)
		--duration;

	for (AffectList::const_iterator i = affects.begin(); i != affects.end(); ++i)
		(*i)->update(creature);
}


text:
namespace gfx {

static const size_t kMinProfileLength = 128;
static const size_t kMaxProfileLength = 4 * 1024 * 1024;

class GFX_EXPORT ColorProfile {
 public:
  // On Windows, this reads a file from disk so it should not be run on the UI
  // or IO thread.
  ColorProfile();
  ~ColorProfile();

  const std::vector<char>& profile() const { return profile_; }

 private:
  std::vector<char> profile_;

  DISALLOW_COPY_AND_ASSIGN(ColorProfile);
};

inline bool InvalidColorProfileLength(size_t length) {
  return (length < kMinProfileLength) || (length > kMaxProfileLength);
}

// Return the color profile of the display nearest the screen bounds. On Win32,
// this may read a file from disk so it should not be run on the UI/IO threads.
// If the given bounds are empty, or are off-screen, return false meaning there
// is no color profile associated with the bounds.  Otherwise return true after
// storing the display's color profile in |profile|, which will be empty if the
// standard sRGB color profile should be assumed.
GFX_EXPORT bool GetDisplayColorProfile(const gfx::Rect& bounds,
                                       std::vector<char>* profile);
#if defined(OS_MACOSX)
// Return the color profile of the native window. If the window is null, or has
// empty bounds, return false meaning there is no color profile associated with
// the window.  Otherwise return true after storing the window color profile in
// |profile|, which will be empty if the sRGB color profile should be assumed.
GFX_EXPORT bool GetDisplayColorProfile(gfx::NativeWindow window,
                                       std::vector<char>* profile);
#endif
}  // namespace gfx

#endif  // UI_GFX_COLOR_PROFILE_H_


text:
These are my random dotfiles for bash, vim and a bunch of other
programs. They are mostly for my own use. However, I like to keep this
repo well factored and commented, so in case you're interested the code
should be quite readable.

The typical environment I use these files in:

* Debian sid
* bash 4.2
* vim 7.3

# A few things that may be worth of your attention

1.  bash prompt with wall-clock-runtime and exit code of last command.

    See `bashrc.d/prompt.sh`.

2.  A 256-color vim colorscheme.

    See `vim/colors/experiment.vim`.

3.  Per screen scrolling in GNU screen by mouse wheel or
    by shift+page{up,down} without messing up the scrollback buffer.

    See `screenrc` and `Xresources`.

# Credits

Almost all the ideas found in these dotfiles came from some hidden corner
of the web during the last decade. I tried to always mention the source
of my inspriation where it is due, but I'm sure I missed a few places. If
you find an omission, let me know and I happily add it.

# See also

* http://dotfiles.github.com/


text:
package com.sct.descubriendoturuta.service;

import java.util.List;

import com.sct.descubriendoturuta.model.Invitacion;
import com.sct.descubriendoturuta.model.APIUsuario;
import com.sct.descubriendoturuta.model.Ruta;
import com.sct.descubriendoturuta.model.RutaPoi;
import com.sct.descubriendoturuta.model.Usuario;
import com.sct.descubriendoturuta.model.Votacion;

public interface UsuarioService {

	/**
	 * Almacena la información del usuario.
	 * @param usuario
	 */
	public boolean agregarUsuario(Usuario usuario);

	/**
	 * Obtiene la información del usuario que coincida
	 * con el parametro especificado.
	 * @param id Identificador primario del usuario.
	 */
	public Usuario buscarUsuario(Integer id);

	public Usuario buscarFacebookId(String facebookId);

	public boolean agregarRuta(Usuario usuario, Ruta ruta);

	public boolean agregarPoi(RutaPoi poi);

	public List<Ruta> obtenerRutas(int usuarioId);

	public Ruta obtenerRuta(int idRuta);

	public boolean aceptarInvitacion(Invitacion invitacion);

	public List<Invitacion> obtenerRutasInvitadas(int usuarioId);

	public List<Invitacion> obtenerUsuariosInvitados(int rutaId);

	public List<APIUsuario> apiObtenerUsuarios();

	public boolean votarRuta(Votacion votar);

	public boolean usuarioVotoRuta(int usuarioId, int rutaId);

	List<Ruta> obtenerRutasPopulares();

}


text:
package com.dremio.exec.store.ischema.writers;

import java.util.Iterator;
import java.util.Set;

import com.dremio.exec.store.ischema.metadata.InformationSchemaMetadata;
import com.dremio.sabot.op.scan.OutputMutator;
import com.dremio.service.catalog.Schema;

/**
 * Writes "INFORMATION_SCHEMA"."SCHEMATA" table.
 */
public class SchemataTableWriter extends TableWriter<Schema> {
  private final String catalogNameOverride;

  public SchemataTableWriter(
    Iterator<Schema> messageIterator,
    Set<String> selectedFields,
    String catalogNameOverride
  ) {
    super(messageIterator, selectedFields);

    this.catalogNameOverride = catalogNameOverride;
  }

  @Override
  public void init(OutputMutator outputMutator) {
    addStringWriter(InformationSchemaMetadata.CATALOG_NAME, outputMutator,
      catalogNameOverride != null ? ignored -> catalogNameOverride : Schema::getCatalogName);
    addStringWriter(InformationSchemaMetadata.SCHEMA_NAME, outputMutator, Schema::getSchemaName);
    addStringWriter(InformationSchemaMetadata.SCHEMA_OWNER, outputMutator, Schema::getSchemaOwner);
    addStringWriter(InformationSchemaMetadata.TYPE, outputMutator, schema -> schema.getSchemaType().name());
    addStringWriter(InformationSchemaMetadata.IS_MUTABLE, outputMutator,
      schema -> schema.getIsMutable() ? "YES" : "NO");
  }
}


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

#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_node.h"
#include "scene/3d/multimesh_instance.h"
#include "scene/gui/spin_box.h"

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

class MultiMeshEditor : public Control {

	OBJ_TYPE(MultiMeshEditor, Control );

        friend class MultiMeshEditorPlugin;

	AcceptDialog *err_dialog;
        MenuButton * options;
	MultiMeshInstance *_last_pp_node;
	bool browsing_source;

	Panel *panel;
	MultiMeshInstance *node;

	LineEdit *surface_source;
	LineEdit *mesh_source;

	SceneTreeDialog *std;

	ConfirmationDialog *populate_dialog;
	OptionButton *populate_axis;
	HScrollBar *populate_rotate_random;
	HScrollBar *populate_tilt_random;
	SpinBox *populate_scale_random;
	SpinBox *populate_scale;
	SpinBox *populate_amount;

	enum Menu {

		MENU_OPTION_POPULATE
	};

	void _browsed(const NodePath& p_path);
	void _menu_option(int);
	void _populate();
	void _browse(bool p_source);

protected:
	void _node_removed(Node *p_node);
	static void _bind_methods();
public:

	void edit(MultiMeshInstance *p_multimesh);
	MultiMeshEditor();
};

class MultiMeshEditorPlugin : public EditorPlugin {

	OBJ_TYPE( MultiMeshEditorPlugin, EditorPlugin );

	MultiMeshEditor *multimesh_editor;
	EditorNode *editor;

public:

	virtual String get_name() const { return "MultiMesh"; }
	bool has_main_screen() const { return false; }
	virtual void edit(Object *p_node);
	virtual bool handles(Object *p_node) const;
	virtual void make_visible(bool p_visible);

	MultiMeshEditorPlugin(EditorNode *p_node);
	~MultiMeshEditorPlugin();

};

#endif // MULTIMESH_EDITOR_PLUGIN_H


text:
class ClientModuleCounterSystem: public EntitySystem
{
public:
	ClientModuleCounterSystem();
	void processEntities( const vector<Entity*>& p_entities ) final;
	void initialize() final;

	void destroyAllModules();
private:
	unsigned int m_numberOfModules;
};


text:
layout: page
title: Valley Basic Entertainment Conference
date: 2016-05-24
author: Sean Beasley
tags: weekly links, java
status: published
summary: Pellentesque efficitur porta ante consectetur iaculis. Ut.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 10/04/2019
  endDate: 10/05/2019
  ctyhocn: ONTNPHX
  groupCode: VBEC
published: true
---
Cras feugiat nibh dignissim, fringilla dui ac, iaculis dui. Curabitur at sodales orci, a aliquet justo. Vestibulum at facilisis ipsum, id lobortis ante. Suspendisse egestas hendrerit nisi quis cursus. Nam elit turpis, placerat ultricies mattis a, molestie at erat. Maecenas neque mi, porttitor nec blandit sit amet, volutpat mattis elit. Fusce ornare ornare tellus, nec malesuada ligula facilisis eu.

1 Pellentesque imperdiet purus eu mollis iaculis
1 Cras gravida nisi ac turpis suscipit condimentum
1 Proin id diam sit amet sapien laoreet ultricies non eget ante.

Nullam mi felis, vestibulum at quam a, placerat fringilla neque. Nam consectetur porttitor egestas. Quisque at porttitor sapien. Suspendisse pharetra nec sem id posuere. Nullam posuere ipsum nisi, non aliquet orci eleifend non. Proin at nibh odio. Sed nec lobortis ex, sit amet sagittis orci. Suspendisse potenti. Aenean varius pulvinar bibendum. Duis et tristique purus, at ornare risus. Quisque tempor mi nisl, ut fermentum odio mattis quis. Ut orci eros, aliquet ac ultricies eu, commodo quis mauris. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Phasellus aliquet placerat odio, non semper ex convallis nec. Nullam non scelerisque lacus, sed sagittis augue. Maecenas turpis eros, malesuada sed mi vestibulum, accumsan efficitur mi. Pellentesque tempor pretium semper. Donec arcu odio, aliquam aliquet ex id, efficitur dignissim diam. Integer quis viverra sapien. Sed id ligula sed quam gravida aliquam. Curabitur accumsan et neque nec pharetra.


text:
package widget

import (
	"fmt"
	"github.com/ungerik/go-cairo"
	"github.com/yogischogi/ui2go/event"
	"image"
)

// BlankWidget is a simple widget that is used as a default in Combigridlayout.
// It draws a frame and implements the Widget interface.
type BlankWidget struct {
	event.Sender
	event.Receiver
	area    image.Rectangle
	minSize image.Point
	surface *cairo.Surface
}

func NewBlankWidget() *BlankWidget {
	widget := BlankWidget{
		Sender:   event.NewSender(),
		Receiver: event.NewReceiver(),
		minSize:  image.Point{80, 40}}
	return &widget
}

func (w *BlankWidget) Draw() {
	drawDummyWidget(w.surface, w.area)
}

func (w *BlankWidget) SetArea(drawRect image.Rectangle) {
	w.area = drawRect
}

func (w *BlankWidget) Area() image.Rectangle {
	return w.area
}

func (w *BlankWidget) SetSurface(surface *cairo.Surface) {
	w.surface = surface
}

func (w *BlankWidget) Surface() *cairo.Surface {
	return w.surface
}

func (w *BlankWidget) MinSize() image.Point {
	return w.minSize
}

// ReceiveEvent receives a single event.
// It overwrites event.Receiver.ReceiveEvent().
func (w *BlankWidget) ReceiveEvent(evt interface{}) {
	fmt.Printf("BlankWidget.ReceiveEvent: %v\n", evt)
	// forward event
	//w.SendEvent(evt)
}


text:
<?php

namespace AppBundle\Form\Type;

use AppBundle\Entity\GeoCode;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormBuilderInterface;

class GeoCodeType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('latitude', 'number', [
                'label' => 'Home latitude:',
                'attr' => [
                    'class' => 'form-group form-control',
                ]
            ])
            ->add('longitude', 'number', [
                    'label' => 'Home longitude:',
                'attr' => [
                    'class' => 'form-group form-control',
                ]
            ])
            ->add('submit', 'submit', [
                'attr' => [ 'class' => 'form-group btn btn-success']
            ]);
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'Geo_Code';
    }

    /**
     * Configures the options for this type.
     *
     * @param OptionsResolver $resolver The resolver for the options.
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => GeoCode::class,
        ]);
    }

}


text:
package org.apache.phoenix.compile;

import java.util.Collections;
import java.util.List;

import com.google.common.collect.ImmutableList;

public class ExplainPlan {
    public static final ExplainPlan EMPTY_PLAN = new ExplainPlan(Collections.<String>emptyList());

    private final List<String> planSteps;

    public ExplainPlan(List<String> planSteps) {
        this.planSteps = ImmutableList.copyOf(planSteps);
    }

    public List<String> getPlanSteps() {
        return planSteps;
    }
}


text:
cask 'remembear' do
  version '1.4.13'
  sha256 '2ce98faa5469727ea9a9ea969c816f72b96570ba6023204143fca482055095af'

  # remembear.s3.amazonaws.com was verified as official when first introduced to the cask
  url "https://remembear.s3.amazonaws.com/app/release/downloads/macOS/RememBear-#{version}.dmg"
  appcast 'https://remembear.s3.amazonaws.com/app/release/downloads/macOS/appcast.xml'
  name 'RememBear'
  homepage 'https://www.remembear.com/'

  app 'RememBear.app'
end


text:
package storage

import (
	"github.com/containers/storage/pkg/lockfile"
)

type Locker = lockfile.Locker

func GetLockfile(path string) (lockfile.Locker, error) {
	return lockfile.GetLockfile(path)
}

func GetROLockfile(path string) (lockfile.Locker, error) {
	return lockfile.GetROLockfile(path)
}


text:
<?php

namespace Cyvelnet\LaravelBillplz\Facades;

use Illuminate\Support\Facades\Facade;

/**
 * Class Billplz.
 */
class Billplz extends Facade
{
    /**
     * @return string
     */
    protected static function getFacadeAccessor()
    {
        return 'billplz';
    }
}


text:
"""Main setup script."""

from setuptools import setup, find_packages

NAME = "bcubed"
VERSION = "1.5"
DESCRIPTION = "Simple extended BCubed implementation in Python for clustering evaluation"
AUTHOR = "Hugo Hromic"
AUTHOR_EMAIL = "hhromic@gmail.com"
URL = "https://github.com/hhromic/python-bcubed"
DOWNLOAD_URL = URL + "/tarball/" + VERSION

def _read_file(filename):
    with open(filename) as reader:
        return reader.read()

setup(
    name=NAME, version=VERSION, description=DESCRIPTION,
    author=AUTHOR, author_email=AUTHOR_EMAIL,
    maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL,
    url=URL, download_url=DOWNLOAD_URL,
    requires=["numpy"],
    install_requires=["numpy"],
    provides=["bcubed"],
    keywords=["bcubed", "clustering", "evaluation"],
    classifiers=[
        "Environment :: Console",
        "Topic :: System :: Clustering",
        "Intended Audience :: Science/Research"
    ],
    license="Apache-2.0",
    platforms=["all"],
    long_description=_read_file("README.md"),
    long_description_content_type="text/markdown",
    packages=find_packages()
)


text:
require 'transit/rails/railtie'

module Transit
  module Rails
  end
end


text:
import { isLeft } from 'fp-ts/Either';
import { Emit } from 'nova_ecs/arg_types';
import { EcsEvent } from 'nova_ecs/events';
import { Plugin } from 'nova_ecs/plugin';
import { EcsKeyboardEvent } from 'nova_ecs/plugins/keyboard_plugin';
import { Resource } from 'nova_ecs/resource';
import { System } from 'nova_ecs/system';
import { SingletonComponent } from 'nova_ecs/world';
import { Subject } from 'rxjs';
import { GameData } from '../client/gamedata/GameData';
import { ControlAction, Controls, getActions, SavedControls } from './controls';
import { GameDataResource } from './game_data_resource';
import { PlatformResource } from './platform_plugin';

export interface ControlEvent {
    action: ControlAction,
    state: false | 'start' | 'repeat',
}

export const ControlsResource = new Resource<Controls>('ControlsResource');
export const EcsControlEvent = new EcsEvent<ControlEvent[]>('ControlEvent');
export const ControlsSubject = new Resource<Subject<ControlEvent>>('ControlsObservable');

const ControlEventSystem = new System({
    name: 'ControlEventSystem',
    events: [EcsKeyboardEvent],
    args: [EcsKeyboardEvent, ControlsSubject, ControlsResource,
        Emit, SingletonComponent] as const,
    step(keyboardEvent, controlsSubject, controls, emit) {
        const actions = getActions(controls, keyboardEvent);

        const controlEvents: ControlEvent[] = [];
        for (const action of actions) {
            const controlEvent: ControlEvent = {
                action,
                state: keyboardEvent.type === 'keyup' ? false
                    : keyboardEvent.repeat ? 'repeat' : 'start',
            }

            controlEvents.push(controlEvent);
        }
        emit(EcsControlEvent, controlEvents);
        for (const event of controlEvents) {
            controlsSubject.next(event);
        }
    }
});

export const ControlsPlugin: Plugin = {
    name: 'ControlsPlugin',
    async build(world) {
        world.resources.set(ControlsSubject, new Subject());

        const platform = world.resources.get(PlatformResource);
        if (platform === 'browser') {
            const gameData = world.resources.get(GameDataResource) as GameData;
            if (!gameData) {
                throw new Error('Expected world to have gameData');
            }
            const controlsJson = await gameData.getSettings('controls.json');
            const decoded = SavedControls.pipe(Controls).decode(controlsJson);
            if (isLeft(decoded)) {
                console.error(decoded.left);
                throw new Error('Failed to parse controls');
            }
            world.resources.set(ControlsResource, decoded.right);
            world.addSystem(ControlEventSystem);
        }
    }
}


text:
[![](http://www.apache.org/images/asf-logo.gif)](http://www.apache.org/) [![](images/struts.gif)]()

------------------------------------------------------------------------

Last Published: 2008-11-29

[Apache](http://www.apache.org/) | [Struts 2](2.x/) | [Struts 1](1.x/) | [Struts 1](1.x/) | [Struts 2](2.x/)

------------------------------------------------------------------------

##### Struts Scripting

-   [Welcome](index.html.md)
-   [User Guide](user-guide.html.md)
-   [Source Guide](source-guide.html.md)

##### Components

-   [Struts Apps](../struts-apps/index.html.md)
-   [Struts EL](../struts-el/index.html.md)
-   [Struts Extras](../struts-extras/index.html.md)
-   [Struts Faces](../struts-faces/index.html.md)
-   [Struts Scripting](../struts-scripting/index.html.md)
-   [Struts Taglib](../struts-taglib/index.html.md)
-   [Struts Tiles](../struts-tiles/index.html.md)

##### Quick Links

-   [Javadoc](apidocs/index.html.md)
-   [Struts 1](../index.html.md)

##### Project Documentation

-   [Project Information](project-info.html.md)
    -   [Continuous Integration](integration.html.md)
    -   [Dependencies](dependencies.html.md)
    -   **Dependency Convergence**
    -   [Issue Tracking](issue-tracking.html.md)
    -   [Mailing Lists](mail-lists.html.md)
    -   [Plugin Management](plugin-management.html.md)
    -   [Project License](license.html.md)
    -   [Project Plugins](plugins.html.md)
    -   [Project Summary](project-summary.html.md)
    -   [Project Team](team-list.html.md)
    -   [Source Repository](source-repository.html.md)
-   [Project Reports](project-reports.html.md)

[![Built by Maven](./images/logos/maven-feather.png)](http://maven.apache.org/ "Built by Maven")

Reactor Dependency Convergence
------------------------------

|-----------------------------------------|-----------------------------------------------------------------|
| ![success](images/icon_success_sml.gif) | All projects share one version of the dependency.               |
| ![error](images/icon_error_sml.gif)     | At least one project has a differing version of the dependency. |

**Statistics:**
Number of sub-projects:
18
Number of dependencies (NOD):
28
Number of unique artifacts (NOA):
29
Number of SNAPSHOT artifacts (NOS):
0
Convergence (NOD/NOA):
![error](images/icon_error_sml.gif) **96%**
Ready for Release (100% Convergence and no SNAPSHOTS):
![error](images/icon_error_sml.gif) **Error**
 You do not have 100% convergence.

### Dependencies used in sub-projects

#### antlr:antlr

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

2.7.2

org.apache.struts:struts-core

#### bsf:bsf

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

2.3.0

org.apache.struts:struts-scripting

#### commons-beanutils:commons-beanutils

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.8.0

org.apache.struts:struts-core

#### commons-chain:commons-chain

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.2

org.apache.struts:struts-core

#### commons-codec:commons-codec

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.2

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

#### commons-digester:commons-digester

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.8

org.apache.struts:struts-core

org.apache.struts:struts-mailreader-dao

#### commons-el:commons-el

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

#### commons-fileupload:commons-fileupload

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.1.1

org.apache.struts:struts-core

org.apache.struts:struts-examples

#### commons-logging:commons-logging

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.4

org.apache.struts:struts-core

org.apache.struts:struts-mailreader-dao

#### commons-validator:commons-validator

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.1

org.apache.struts:struts-core

#### groovy:groovy-all

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0-jsr-04

org.apache.struts:struts-scripting-mailreader

#### javax.servlet:jsp-api

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

2.0

org.apache.struts:struts-faces

#### javax.servlet:jstl

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.2

org.apache.struts:struts-el

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

1.0.6

org.apache.struts:struts-examples

#### javax.servlet:servlet-api

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

2.3

org.apache.struts:struts-blank

org.apache.struts:struts-cookbook

org.apache.struts:struts-core

org.apache.struts:struts-el-example

org.apache.struts:struts-el

org.apache.struts:struts-examples

org.apache.struts:struts-extras

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

org.apache.struts:struts-faces

org.apache.struts:struts-mailreader

org.apache.struts:struts-scripting-mailreader

org.apache.struts:struts-scripting

org.apache.struts:struts-taglib

org.apache.struts:struts-tiles

#### junit:junit

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

3.8.1

org.apache.struts:struts-core

org.apache.struts:struts-extras

org.apache.struts:struts-faces

org.apache.struts:struts-mailreader-dao

org.apache.struts:struts-scripting

org.apache.struts:struts-taglib

org.apache.struts:struts-tiles

#### myfaces:myfaces-extensions

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.9

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

#### myfaces:myfaces-impl

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.9

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

#### myfaces:myfaces-jsf-api

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.9

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

org.apache.struts:struts-faces

#### org.apache.struts:struts-core

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-cookbook

org.apache.struts:struts-el

org.apache.struts:struts-extras

org.apache.struts:struts-faces

org.apache.struts:struts-scripting

org.apache.struts:struts-taglib

org.apache.struts:struts-tiles

#### org.apache.struts:struts-el

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-el-example

#### org.apache.struts:struts-extras

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-examples

org.apache.struts:struts-mailreader

org.apache.struts:struts-scripting-mailreader

#### org.apache.struts:struts-faces

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

#### org.apache.struts:struts-mailreader-dao

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-mailreader

org.apache.struts:struts-scripting-mailreader

#### org.apache.struts:struts-scripting

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-scripting-mailreader

#### org.apache.struts:struts-taglib

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-blank

org.apache.struts:struts-cookbook

org.apache.struts:struts-el

org.apache.struts:struts-examples

org.apache.struts:struts-faces

org.apache.struts:struts-mailreader

org.apache.struts:struts-scripting-mailreader

#### org.apache.struts:struts-tiles

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.3.10

org.apache.struts:struts-blank

org.apache.struts:struts-el

org.apache.struts:struts-faces-example2

org.apache.struts:struts-faces

#### oro:oro

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

2.0.8

org.apache.struts:struts-core

#### taglibs:standard

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

1.0.6

org.apache.struts:struts-el

org.apache.struts:struts-examples

org.apache.struts:struts-faces-example1

org.apache.struts:struts-faces-example2

------------------------------------------------------------------------

© 2000-2008 Apache Software Foundation

------------------------------------------------------------------------


text:
#ifndef HEALTH_H
#define HEALTH_H

#include <Engine/Attribute/IAttribute.hpp>
#include <Engine/Window.hpp>
#include <Engine/ResourceManager.hpp>
#include <Engine/EventDispatcher.hpp>

#include "Event/InflictDamageEvent.hpp"

namespace Attribute
{
	class Health : public Engine::Attribute::IAttribute
	{
	public:
		/**
		 * Constructor.
		 *
		 * @param window Shared pointer to the window.
		 * @param resourceManager Shared pointer to the resource manager.
		 * @param sceneEventDispatcher Shared pointer to the scene's Event
		 * Dispatcher.
		 * @param gameObjectEventDispatcher Shared pointer to the Game
		 * Object's Event Dispatcher.
		 * @param gameObject Weak pointer to the Game Object that the
		 * attribute is attached to.
		 * @param initialHealth Initial amount of health.
		 */
		Health(std::shared_ptr<Engine::Window> window,
			std::shared_ptr<Engine::ResourceManager> resourceManager,
			std::shared_ptr<Engine::EventDispatcher> sceneEventDispatcher,
			std::shared_ptr<Engine::EventDispatcher> gameObjectEventDispatcher,
			std::weak_ptr<Engine::GameObject> gameObject,
			float initialHealth);

		/**
		 * Destructor.
		 */
		~Health();

		/**
		 * Returns the current amount of health.
		 *
		 * @return Amount of health.
		 */
		float GetHealth() const;

		/**
		 * Handles InflictDamageEvents.
		 * A DestroyGameObjectEvent will be raised in the event that is no
		 * health left after inflicting damage.
		 *
		 * @param event Reference to the event.
		 */
		void HandleInflictDamageEvent(const Event::InflictDamageEvent& event);

	private:
		/**
		 * The current health.
		 */
		float m_health;

		/**
		 * Dead flag - used to ensure that we don't publish multiple
		 * EnemyDestroyedEvents if there are multiple requests to inflict damage
		 * in a single state update.
		 */
		bool m_dead;

		/**
		 * Subscription identifier for the InflictDamageEvent subscription
		 */
		Engine::EventDispatcher::SubscriptionID m_inflictDamageSubscription;
	};
}

#endif


text:
function [f, g] = fgplvmSequenceObjectiveGradient(xvec, model, Y)

% FGPLVMSEQUENCEOBJECTIVEGRADIENT Wrapper function for objective
% and gradient of a single sequence in latent space and the corresponding output sequence.
% FORMAT
% DESC provides a wrapper function for the negative log probability
% of a given data sequence under the posterior distribution of the
% Gaussian process induced by the training data..
% ARG vecx : time ordered locations in input space for the sequence
% placed as a vector using the matlab X(:)' notation.
% ARG model : the model structure for which the negative log
% probability of the given data under the posterior is to be computed.
% ARG Y : time ordered locations in data spaces for the sequence.
% RETURN f : the negative of the log probability of the given data
% sequence under the posterior distribution induced by the training data.
% RETURN g : the gradient of the negative of the returned log probability
% with respect to the latent sequence.
%
% SEEALSO : fgplvmCreate, fgplvmSequenceLogLikelihood, fgplvmOptimiseSequence
%
% COPYRIGHT : Neil D. Lawrence, 2006

% GPMAT

% Check how the optimiser has given the parameters
if size(xvec, 1) > size(xvec, 2)
  % As a column vector ... transpose everything.
  transpose = true;
  X = reshape(xvec', size(Y, 1), model.q);
else
  transpose = false;
  X = reshape(xvec, size(Y, 1), model.q);
end
f = - fgplvmSequenceLogLikelihood(model, X, Y);

if nargout > 1
  g = - fgplvmSequenceLogLikeGradient(model, X, Y);
  g = g(:)';
end
if transpose
  g = g';
end


text:
class LifeSamplesDialog : public wxDialog
{
public:
    // ctor and dtor
    LifeSamplesDialog(wxWindow *parent);
    virtual ~LifeSamplesDialog();

    // members
    const LifePattern& GetPattern();

    // event handlers
    void OnListBox(wxCommandEvent &event);

private:
    // any class wishing to process wxWidgets events must use this macro
    wxDECLARE_EVENT_TABLE();

    int         m_value;
    wxListBox  *m_list;
    wxTextCtrl *m_text;
    LifeCanvas *m_canvas;
    Life       *m_life;
};

// --------------------------------------------------------------------------
// LifeAboutDialog
// --------------------------------------------------------------------------

class LifeAboutDialog : public wxDialog
{
public:
    // ctor
    LifeAboutDialog(wxWindow *parent);
};

#endif  // _LIFE_DIALOGS_H_


text:
"""Copyright 2018 Roger R Labbe Jr.

FilterPy library.
http://github.com/rlabbe/filterpy

Documentation at:
https://filterpy.readthedocs.org

Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python

This is licensed under an MIT license. See the readme.MD file
for more information.
"""

import math
import numpy as np
import scipy as sp
from filterpy.kalman import KalmanFilter

def kinematic_state_transition(order, dt):
    """ create a state transition matrix of a given order for a given time
    step `dt`.
    """
    assert order >= 0 and int(order) == order, "order must be an int >= 0"

    # hard code common cases for computational efficiency
    if order == 0:
        return np.array([[1.]])
    if order == 1:
        return np.array([[1., dt],
                         [0., 1.]])
    if order == 2:
        return np.array([[1., dt, 0.5*dt*dt],
                         [0., 1., dt],
                         [0., 1., dt]])

    # grind it out computationally....
    N = order + 1

    F = np.zeros((N, N))
    # compute highest order row
    for n in range(N):
        F[0, n] = float(dt**n) / math.factorial(n)

    # copy with a shift to get lower order rows
    for j in range(1, N):
        F[j, j:] = F[0, 0:-j]

    return F

def kinematic_kf(dim, order, dt=1., order_by_dim=True):
    """ Returns a KalmanFilter using newtonian kinematics for an arbitrary
    number of dimensions and order. So, for example, a constant velocity
    filter in 3D space would be created with

    kinematic_kf(3, 1)

    which will set the state `x` to be interpreted as

    [x, x', y, y', z, z'].T

    If you set `order_by_dim` to False, then `x` is assumed to be

    [x y z x' y' z'].T

    As another example, a 2D constant jerk is created with

    kinematic_kf(2, 3)

    Assumes that the measurement z is position in each dimension. If this is not
    true you will have to alter the H matrix by hand.

    P, Q, R are all set to the Identity matrix.

    H is assigned assuming the measurement is position, one per dimension `dim`.

    Parameters
    ----------

    dim : int
        number of dimensions

    order : int, >= 1
        order of the filter. 2 would be a const acceleration model.

    dim_z : int, default 1
        size of z vector *per* dimension `dim`. Normally should be 1

    dt : float, default 1.0
        Time step. Used to create the state transition matrix

    """

    dim_x = order + 1

    kf = KalmanFilter(dim_x=dim * dim_x, dim_z=dim)
    F = kinematic_state_transition(order, dt)
    if order_by_dim:
        diag = [F] * dim
        kf.F = sp.linalg.block_diag(*diag)

    else:
        kf.F.fill(0.0)
        for i, x in enumerate(F.ravel()):
            f = np.eye(dim) * x

            ix, iy = (i // dim_x) * dim,  (i % dim_x) * dim
            kf.F[ix:ix+dim, iy:iy+dim] = f

    if order_by_dim:
        for i in range(dim):
            kf.H[i, i * dim_x] = 1.
    else:
        for i in range(dim):
            kf.H[i, i] = 1.

    return kf

if __name__ == "__main__":
    kf = kinematic_kf(2, 1, dt = 3, order_by_dim=False)
    print(kf.F)
    print('\n\n')
    kf = kinematic_kf(3, 1, dt = 3, order_by_dim=False)
    print(kf.F)


text:
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import TemplateView

from openstack_auth.utils import patch_middleware_get_user

patch_middleware_get_user()

urlpatterns = patterns('',
    url(r"", include('openstack_auth.urls')),
    url(r"^$", TemplateView.as_view(template_name="auth/blank.html"))
)


text:
package com.amazonaws.services.applicationinsights;

import javax.annotation.Generated;

import com.amazonaws.services.applicationinsights.model.*;

/**
 * Interface for accessing Application Insights asynchronously. Each asynchronous method will return a Java Future
 * object representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
 * notification when an asynchronous operation completes.
 *

 * Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
 * {@link com.amazonaws.services.applicationinsights.AbstractAmazonApplicationInsightsAsync} instead.
 *

 *

 * <fullname>Amazon CloudWatch Application Insights for .NET and SQL Server</fullname>
 *

 * Amazon CloudWatch Application Insights for .NET and SQL Server is a service that helps you detect common problems
 * with your .NET and SQL Server-based applications. It enables you to pinpoint the source of issues in your
 * applications (built with technologies such as Microsoft IIS, .NET, and Microsoft SQL Server), by providing key
 * insights into detected problems.
 *

 *

 * After you onboard your application, CloudWatch Application Insights for .NET and SQL Server identifies, recommends,
 * and sets up metrics and logs. It continuously analyzes and correlates your metrics and logs for unusual behavior to
 * surface actionable problems with your application. For example, if your application is slow and unresponsive and
 * leading to HTTP 500 errors in your Application Load Balancer (ALB), Application Insights informs you that a memory
 * pressure problem with your SQL Server database is occurring. It bases this analysis on impactful metrics and log
 * errors.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface AmazonApplicationInsightsAsync extends AmazonApplicationInsights {

    /**
     *

     * Adds an application that is created from a resource group.
     *

     *
     * @param createApplicationRequest
     * @return A Java Future containing the result of the CreateApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.CreateApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<CreateApplicationResult> createApplicationAsync(CreateApplicationRequest createApplicationRequest);

    /**
     *

     * Adds an application that is created from a resource group.
     *

     *
     * @param createApplicationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the CreateApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.CreateApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<CreateApplicationResult> createApplicationAsync(CreateApplicationRequest createApplicationRequest,
            com.amazonaws.handlers.AsyncHandler<CreateApplicationRequest, CreateApplicationResult> asyncHandler);

    /**
     *

     * Creates a custom component by grouping similar standalone instances to monitor.
     *

     *
     * @param createComponentRequest
     * @return A Java Future containing the result of the CreateComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.CreateComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<CreateComponentResult> createComponentAsync(CreateComponentRequest createComponentRequest);

    /**
     *

     * Creates a custom component by grouping similar standalone instances to monitor.
     *

     *
     * @param createComponentRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the CreateComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.CreateComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<CreateComponentResult> createComponentAsync(CreateComponentRequest createComponentRequest,
            com.amazonaws.handlers.AsyncHandler<CreateComponentRequest, CreateComponentResult> asyncHandler);

    /**
     *

     * Removes the specified application from monitoring. Does not delete the application.
     *

     *
     * @param deleteApplicationRequest
     * @return A Java Future containing the result of the DeleteApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DeleteApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DeleteApplicationResult> deleteApplicationAsync(DeleteApplicationRequest deleteApplicationRequest);

    /**
     *

     * Removes the specified application from monitoring. Does not delete the application.
     *

     *
     * @param deleteApplicationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DeleteApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DeleteApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DeleteApplicationResult> deleteApplicationAsync(DeleteApplicationRequest deleteApplicationRequest,
            com.amazonaws.handlers.AsyncHandler<DeleteApplicationRequest, DeleteApplicationResult> asyncHandler);

    /**
     *

     * Ungroups a custom component. When you ungroup custom components, all applicable monitors that are set up for the
     * component are removed and the instances revert to their standalone status.
     *

     *
     * @param deleteComponentRequest
     * @return A Java Future containing the result of the DeleteComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DeleteComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DeleteComponentResult> deleteComponentAsync(DeleteComponentRequest deleteComponentRequest);

    /**
     *

     * Ungroups a custom component. When you ungroup custom components, all applicable monitors that are set up for the
     * component are removed and the instances revert to their standalone status.
     *

     *
     * @param deleteComponentRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DeleteComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DeleteComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DeleteComponentResult> deleteComponentAsync(DeleteComponentRequest deleteComponentRequest,
            com.amazonaws.handlers.AsyncHandler<DeleteComponentRequest, DeleteComponentResult> asyncHandler);

    /**
     *

     * Describes the application.
     *

     *
     * @param describeApplicationRequest
     * @return A Java Future containing the result of the DescribeApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeApplicationResult> describeApplicationAsync(DescribeApplicationRequest describeApplicationRequest);

    /**
     *

     * Describes the application.
     *

     *
     * @param describeApplicationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeApplicationResult> describeApplicationAsync(DescribeApplicationRequest describeApplicationRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeApplicationRequest, DescribeApplicationResult> asyncHandler);

    /**
     *

     * Describes a component and lists the resources that are grouped together in a component.
     *

     *
     * @param describeComponentRequest
     * @return A Java Future containing the result of the DescribeComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentResult> describeComponentAsync(DescribeComponentRequest describeComponentRequest);

    /**
     *

     * Describes a component and lists the resources that are grouped together in a component.
     *

     *
     * @param describeComponentRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentResult> describeComponentAsync(DescribeComponentRequest describeComponentRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeComponentRequest, DescribeComponentResult> asyncHandler);

    /**
     *

     * Describes the monitoring configuration of the component.
     *

     *
     * @param describeComponentConfigurationRequest
     * @return A Java Future containing the result of the DescribeComponentConfiguration operation returned by the
     *         service.
     * @sample AmazonApplicationInsightsAsync.DescribeComponentConfiguration
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentConfigurationResult> describeComponentConfigurationAsync(
            DescribeComponentConfigurationRequest describeComponentConfigurationRequest);

    /**
     *

     * Describes the monitoring configuration of the component.
     *

     *
     * @param describeComponentConfigurationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeComponentConfiguration operation returned by the
     *         service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeComponentConfiguration
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentConfigurationResult> describeComponentConfigurationAsync(
            DescribeComponentConfigurationRequest describeComponentConfigurationRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeComponentConfigurationRequest, DescribeComponentConfigurationResult> asyncHandler);

    /**
     *

     * Describes the recommended monitoring configuration of the component.
     *

     *
     * @param describeComponentConfigurationRecommendationRequest
     * @return A Java Future containing the result of the DescribeComponentConfigurationRecommendation operation
     *         returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeComponentConfigurationRecommendation
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentConfigurationRecommendationResult> describeComponentConfigurationRecommendationAsync(
            DescribeComponentConfigurationRecommendationRequest describeComponentConfigurationRecommendationRequest);

    /**
     *

     * Describes the recommended monitoring configuration of the component.
     *

     *
     * @param describeComponentConfigurationRecommendationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeComponentConfigurationRecommendation operation
     *         returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeComponentConfigurationRecommendation
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeComponentConfigurationRecommendationResult> describeComponentConfigurationRecommendationAsync(
            DescribeComponentConfigurationRecommendationRequest describeComponentConfigurationRecommendationRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeComponentConfigurationRecommendationRequest, DescribeComponentConfigurationRecommendationResult> asyncHandler);

    /**
     *

     * Describes an anomaly or error with the application.
     *

     *
     * @param describeObservationRequest
     * @return A Java Future containing the result of the DescribeObservation operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeObservation
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeObservationResult> describeObservationAsync(DescribeObservationRequest describeObservationRequest);

    /**
     *

     * Describes an anomaly or error with the application.
     *

     *
     * @param describeObservationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeObservation operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeObservation
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeObservationResult> describeObservationAsync(DescribeObservationRequest describeObservationRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeObservationRequest, DescribeObservationResult> asyncHandler);

    /**
     *

     * Describes an application problem.
     *

     *
     * @param describeProblemRequest
     * @return A Java Future containing the result of the DescribeProblem operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeProblem
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeProblemResult> describeProblemAsync(DescribeProblemRequest describeProblemRequest);

    /**
     *

     * Describes an application problem.
     *

     *
     * @param describeProblemRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeProblem operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeProblem
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeProblemResult> describeProblemAsync(DescribeProblemRequest describeProblemRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeProblemRequest, DescribeProblemResult> asyncHandler);

    /**
     *

     * Describes the anomalies or errors associated with the problem.
     *

     *
     * @param describeProblemObservationsRequest
     * @return A Java Future containing the result of the DescribeProblemObservations operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.DescribeProblemObservations
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeProblemObservationsResult> describeProblemObservationsAsync(
            DescribeProblemObservationsRequest describeProblemObservationsRequest);

    /**
     *

     * Describes the anomalies or errors associated with the problem.
     *

     *
     * @param describeProblemObservationsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeProblemObservations operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.DescribeProblemObservations
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeProblemObservationsResult> describeProblemObservationsAsync(
            DescribeProblemObservationsRequest describeProblemObservationsRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeProblemObservationsRequest, DescribeProblemObservationsResult> asyncHandler);

    /**
     *

     * Lists the IDs of the applications that you are monitoring.
     *

     *
     * @param listApplicationsRequest
     * @return A Java Future containing the result of the ListApplications operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.ListApplications
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListApplicationsResult> listApplicationsAsync(ListApplicationsRequest listApplicationsRequest);

    /**
     *

     * Lists the IDs of the applications that you are monitoring.
     *

     *
     * @param listApplicationsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the ListApplications operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.ListApplications
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListApplicationsResult> listApplicationsAsync(ListApplicationsRequest listApplicationsRequest,
            com.amazonaws.handlers.AsyncHandler<ListApplicationsRequest, ListApplicationsResult> asyncHandler);

    /**
     *

     * Lists the auto-grouped, standalone, and custom components of the application.
     *

     *
     * @param listComponentsRequest
     * @return A Java Future containing the result of the ListComponents operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.ListComponents
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListComponentsResult> listComponentsAsync(ListComponentsRequest listComponentsRequest);

    /**
     *

     * Lists the auto-grouped, standalone, and custom components of the application.
     *

     *
     * @param listComponentsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the ListComponents operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.ListComponents
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListComponentsResult> listComponentsAsync(ListComponentsRequest listComponentsRequest,
            com.amazonaws.handlers.AsyncHandler<ListComponentsRequest, ListComponentsResult> asyncHandler);

    /**
     *

     * Lists the problems with your application.
     *

     *
     * @param listProblemsRequest
     * @return A Java Future containing the result of the ListProblems operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.ListProblems
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListProblemsResult> listProblemsAsync(ListProblemsRequest listProblemsRequest);

    /**
     *

     * Lists the problems with your application.
     *

     *
     * @param listProblemsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the ListProblems operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.ListProblems
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<ListProblemsResult> listProblemsAsync(ListProblemsRequest listProblemsRequest,
            com.amazonaws.handlers.AsyncHandler<ListProblemsRequest, ListProblemsResult> asyncHandler);

    /**
     *

     * Updates the application.
     *

     *
     * @param updateApplicationRequest
     * @return A Java Future containing the result of the UpdateApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.UpdateApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateApplicationResult> updateApplicationAsync(UpdateApplicationRequest updateApplicationRequest);

    /**
     *

     * Updates the application.
     *

     *
     * @param updateApplicationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the UpdateApplication operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.UpdateApplication
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateApplicationResult> updateApplicationAsync(UpdateApplicationRequest updateApplicationRequest,
            com.amazonaws.handlers.AsyncHandler<UpdateApplicationRequest, UpdateApplicationResult> asyncHandler);

    /**
     *

     * Updates the custom component name and/or the list of resources that make up the component.
     *

     *
     * @param updateComponentRequest
     * @return A Java Future containing the result of the UpdateComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsync.UpdateComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateComponentResult> updateComponentAsync(UpdateComponentRequest updateComponentRequest);

    /**
     *

     * Updates the custom component name and/or the list of resources that make up the component.
     *

     *
     * @param updateComponentRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the UpdateComponent operation returned by the service.
     * @sample AmazonApplicationInsightsAsyncHandler.UpdateComponent
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateComponentResult> updateComponentAsync(UpdateComponentRequest updateComponentRequest,
            com.amazonaws.handlers.AsyncHandler<UpdateComponentRequest, UpdateComponentResult> asyncHandler);

    /**
     *

     * Updates the monitoring configurations for the component. The configuration input parameter is an escaped JSON of
     * the configuration and should match the schema of what is returned by
     * DescribeComponentConfigurationRecommendation.
     *

     *
     * @param updateComponentConfigurationRequest
     * @return A Java Future containing the result of the UpdateComponentConfiguration operation returned by the
     *         service.
     * @sample AmazonApplicationInsightsAsync.UpdateComponentConfiguration
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateComponentConfigurationResult> updateComponentConfigurationAsync(
            UpdateComponentConfigurationRequest updateComponentConfigurationRequest);

    /**
     *

     * Updates the monitoring configurations for the component. The configuration input parameter is an escaped JSON of
     * the configuration and should match the schema of what is returned by
     * DescribeComponentConfigurationRecommendation.
     *

     *
     * @param updateComponentConfigurationRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the UpdateComponentConfiguration operation returned by the
     *         service.
     * @sample AmazonApplicationInsightsAsyncHandler.UpdateComponentConfiguration
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateComponentConfigurationResult> updateComponentConfigurationAsync(
            UpdateComponentConfigurationRequest updateComponentConfigurationRequest,
            com.amazonaws.handlers.AsyncHandler<UpdateComponentConfigurationRequest, UpdateComponentConfigurationResult> asyncHandler);

}


text:
namespace WorkWithNortwnd
{
    using System;
    using System.Collections.Generic;

    public partial class Order_Detail
    {
        public int OrderID { get; set; }
        public int ProductID { get; set; }
        public decimal UnitPrice { get; set; }
        public short Quantity { get; set; }
        public float Discount { get; set; }

        public virtual Order Order { get; set; }
        public virtual Product Product { get; set; }
    }
}


text:
@interface UITestCaseTracking : UITestCaseTestBed

@end

@implementation UITestCaseTracking

- (void)setUp {
    [super setUp];
}

- (void)tearDown {
}

- (void)testTracking {
    XCUIApplication *app = [[XCUIApplication alloc] init];
    [app launch];
    // Tap Tracking button
    XCUIElement *trackingButton = app.buttons[@"tracking"];
    if (![trackingButton waitForExistenceWithTimeout:10]) {
        [app.navigationBars[@"Branch-TestBed"].buttons[@"Branch-TestBed"] tap];
        if (![trackingButton waitForExistenceWithTimeout:5]) {
                XCTFail("Timeout : Tracking button not found.");
        }
    }

    [trackingButton tap];
    // Send Event
    [self sendEvent:BranchStandardEventAddToCart];
    [app.navigationBars[@"Branch-TestBed"].buttons[@"Branch-TestBed"] tap];
    // Tap Tracking button again
    [trackingButton tap];
    // Send Event again
    [self sendEvent:BranchStandardEventAddToCart];
    [app.navigationBars[@"Branch-TestBed"].buttons[@"Branch-TestBed"] tap];
    [self disableTracking:FALSE];
}

@end