text:
/*
 * This file is generated by jOOQ.
*/
package top.zbeboy.isy.domain.tables.daos;

import java.util.List;

import javax.annotation.Generated;

import org.jooq.Configuration;
import org.jooq.impl.DAOImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import top.zbeboy.isy.domain.tables.Student;
import top.zbeboy.isy.domain.tables.records.StudentRecord;

/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.10.7"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
@Repository
public class StudentDao extends DAOImpl<StudentRecord, top.zbeboy.isy.domain.tables.pojos.Student, Integer> {

    /**
     * Create a new StudentDao without any configuration
     */
    public StudentDao() {
        super(Student.STUDENT, top.zbeboy.isy.domain.tables.pojos.Student.class);
    }

    /**
     * Create a new StudentDao with an attached configuration
     */
    @Autowired
    public StudentDao(Configuration configuration) {
        super(Student.STUDENT, top.zbeboy.isy.domain.tables.pojos.Student.class, configuration);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected Integer getId(top.zbeboy.isy.domain.tables.pojos.Student object) {
        return object.getStudentId();
    }

    /**
     * Fetch records that have student_id IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByStudentId(Integer... values) {
        return fetch(Student.STUDENT.STUDENT_ID, values);
    }

    /**
     * Fetch a unique record that has student_id = value
     */
    public top.zbeboy.isy.domain.tables.pojos.Student fetchOneByStudentId(Integer value) {
        return fetchOne(Student.STUDENT.STUDENT_ID, value);
    }

    /**
     * Fetch records that have student_number IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByStudentNumber(String... values) {
        return fetch(Student.STUDENT.STUDENT_NUMBER, values);
    }

    /**
     * Fetch a unique record that has student_number = value
     */
    public top.zbeboy.isy.domain.tables.pojos.Student fetchOneByStudentNumber(String value) {
        return fetchOne(Student.STUDENT.STUDENT_NUMBER, value);
    }

    /**
     * Fetch records that have birthday IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByBirthday(String... values) {
        return fetch(Student.STUDENT.BIRTHDAY, values);
    }

    /**
     * Fetch records that have sex IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchBySex(String... values) {
        return fetch(Student.STUDENT.SEX, values);
    }

    /**
     * Fetch records that have family_residence IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByFamilyResidence(String... values) {
        return fetch(Student.STUDENT.FAMILY_RESIDENCE, values);
    }

    /**
     * Fetch records that have political_landscape_id IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByPoliticalLandscapeId(Integer... values) {
        return fetch(Student.STUDENT.POLITICAL_LANDSCAPE_ID, values);
    }

    /**
     * Fetch records that have nation_id IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByNationId(Integer... values) {
        return fetch(Student.STUDENT.NATION_ID, values);
    }

    /**
     * Fetch records that have dormitory_number IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByDormitoryNumber(String... values) {
        return fetch(Student.STUDENT.DORMITORY_NUMBER, values);
    }

    /**
     * Fetch records that have parent_name IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByParentName(String... values) {
        return fetch(Student.STUDENT.PARENT_NAME, values);
    }

    /**
     * Fetch records that have parent_contact_phone IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByParentContactPhone(String... values) {
        return fetch(Student.STUDENT.PARENT_CONTACT_PHONE, values);
    }

    /**
     * Fetch records that have place_origin IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByPlaceOrigin(String... values) {
        return fetch(Student.STUDENT.PLACE_ORIGIN, values);
    }

    /**
     * Fetch records that have organize_id IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByOrganizeId(Integer... values) {
        return fetch(Student.STUDENT.ORGANIZE_ID, values);
    }

    /**
     * Fetch records that have username IN (values)
     */
    public List<top.zbeboy.isy.domain.tables.pojos.Student> fetchByUsername(String... values) {
        return fetch(Student.STUDENT.USERNAME, values);
    }
}


text:
import os
import sys
import subprocess
from multiprocessing import Pool, Process
from time import  sleep
# Get the git root directory
root_dir=repo_dir = subprocess.Popen(['git'
                                      ,'rev-parse'
                                      , '--show-toplevel']
                                     , stdout=subprocess.PIPE
                                     ).communicate()[0].rstrip()
sys.path.append(root_dir)

def func(arg):
  sleep(0.1)
  return arg**2

def info(title):
    print title
    print 'module name:', __name__
    if hasattr(os, 'getppid'):  # only available on Unix
        print 'parent process:', os.getppid()
    print 'process id:', os.getpid()

def f(name):
    info('function f')
    print 'hello', name

if __name__=="__main__":
  # info('main line')
  # p = Process(target=f, args=('bob',))
  # p.start()
  # p.join()

  p=Pool(processes=5)
  p.apply_async(func, range(100))
  ret = p.map(func, range(100), chunksize=10)
  print ret

redpajama_set_name: RedPajamaGithub


text:
#ifndef QDECLARATIVECUSTOMPARSER_H
#define QDECLARATIVECUSTOMPARSER_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include "private/qdeclarativemetatype_p.h"
#include "qdeclarativeerror.h"
#include "private/qdeclarativeparser_p.h"
#include "private/qdeclarativebinding_p.h"

#include <QtCore/qbytearray.h>
#include <QtCore/qxmlstream.h>

QT_BEGIN_NAMESPACE

QT_MODULE(Declarative)

class QDeclarativeCompiler;

class QDeclarativeCustomParserPropertyPrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserProperty
{
public:
    QDeclarativeCustomParserProperty();
    QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &);
    QDeclarativeCustomParserProperty &operator=(const QDeclarativeCustomParserProperty &);
    ~QDeclarativeCustomParserProperty();

    QByteArray name() const;
    QDeclarativeParser::Location location() const;

    bool isList() const;
    // Will be one of QDeclarativeParser::Variant, QDeclarativeCustomParserProperty or
    // QDeclarativeCustomParserNode
    QList<QVariant> assignedValues() const;

private:
    friend class QDeclarativeCustomParserNodePrivate;
    friend class QDeclarativeCustomParserPropertyPrivate;
    QDeclarativeCustomParserPropertyPrivate *d;
};

class QDeclarativeCustomParserNodePrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserNode
{
public:
    QDeclarativeCustomParserNode();
    QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &);
    QDeclarativeCustomParserNode &operator=(const QDeclarativeCustomParserNode &);
    ~QDeclarativeCustomParserNode();

    QByteArray name() const;
    QDeclarativeParser::Location location() const;

    QList<QDeclarativeCustomParserProperty> properties() const;

private:
    friend class QDeclarativeCustomParserNodePrivate;
    QDeclarativeCustomParserNodePrivate *d;
};

class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser
{
public:
    enum Flag {
        NoFlag                    = 0x00000000,
        AcceptsAttachedProperties = 0x00000001
    };
    Q_DECLARE_FLAGS(Flags, Flag)

    QDeclarativeCustomParser() : compiler(0), object(0), m_flags(NoFlag) {}
    QDeclarativeCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {}
    virtual ~QDeclarativeCustomParser() {}

    void clearErrors();
    Flags flags() const { return m_flags; }

    virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &)=0;
    virtual void setCustomData(QObject *, const QByteArray &)=0;

    QList<QDeclarativeError> errors() const { return exceptions; }

protected:
    void error(const QString& description);
    void error(const QDeclarativeCustomParserProperty&, const QString& description);
    void error(const QDeclarativeCustomParserNode&, const QString& description);

    int evaluateEnum(const QByteArray&) const;

    const QMetaObject *resolveType(const QByteArray&) const;

    QDeclarativeBinding::Identifier rewriteBinding(const QString&, const QByteArray&);

private:
    QList<QDeclarativeError> exceptions;
    QDeclarativeCompiler *compiler;
    QDeclarativeParser::Object *object;
    Flags m_flags;
    friend class QDeclarativeCompiler;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeCustomParser::Flags);

#if 0
#define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \
            qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN, #NAME, #TYPE, new CUSTOMTYPE)
#endif

QT_END_NAMESPACE

Q_DECLARE_METATYPE(QDeclarativeCustomParserProperty)
Q_DECLARE_METATYPE(QDeclarativeCustomParserNode)

#endif


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.InteropServices;

namespace DPStressHarness
{
    static class MemApi
    {
#pragma warning disable BCL0015 // Invalid Pinvoke call
        [DllImport("KERNEL32")]
        public static extern IntPtr GetCurrentProcess();
#pragma warning restore BCL0015 // Invalid Pinvoke call

#pragma warning disable BCL0015 // Invalid Pinvoke call
        [DllImport("KERNEL32")]
        public static extern bool SetProcessWorkingSetSize(IntPtr hProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);
#pragma warning restore BCL0015 // Invalid Pinvoke call
    }
}


text:
using System;
using Azure.Core;

namespace Azure.ResourceManager.MySql.Models
{
    /// <summary> The properties to create a new replica. </summary>
    public partial class MySqlServerPropertiesForReplica : MySqlServerPropertiesForCreate
    {
        /// <summary> Initializes a new instance of MySqlServerPropertiesForReplica. </summary>
        /// <param name="sourceServerId"> The master server id to create replica from. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="sourceServerId"/> is null. </exception>
        public MySqlServerPropertiesForReplica(ResourceIdentifier sourceServerId)
        {
            Argument.AssertNotNull(sourceServerId, nameof(sourceServerId));

            SourceServerId = sourceServerId;
            CreateMode = MySqlCreateMode.Replica;
        }

        /// <summary> The master server id to create replica from. </summary>
        public ResourceIdentifier SourceServerId { get; }
    }
}


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//! Code for invalidations due to state or attribute changes.

use {Atom, LocalName, Namespace};
use context::QuirksMode;
use element_state::ElementState;
use fallible::FallibleVec;
use hashglobe::FailedAllocationError;
use selector_map::{MaybeCaseInsensitiveHashMap, SelectorMap, SelectorMapEntry};
use selector_parser::SelectorImpl;
use selectors::attr::NamespaceConstraint;
use selectors::parser::{Combinator, Component};
use selectors::parser::{Selector, SelectorIter, SelectorMethods};
use selectors::visitor::SelectorVisitor;
use smallvec::SmallVec;

#[cfg(feature = "gecko")]
/// Gets the element state relevant to the given `:dir` pseudo-class selector.
pub fn dir_selector_to_state(s: &[u16]) -> ElementState {
    use element_state::{IN_LTR_STATE, IN_RTL_STATE};

    // Jump through some hoops to deal with our Box<[u16]> thing.
    const LTR: [u16; 4] = [b'l' as u16, b't' as u16, b'r' as u16, 0];
    const RTL: [u16; 4] = [b'r' as u16, b't' as u16, b'l' as u16, 0];

    if LTR == *s {
        IN_LTR_STATE
    } else if RTL == *s {
        IN_RTL_STATE
    } else {
        // :dir(something-random) is a valid selector, but shouldn't
        // match anything.
        ElementState::empty()
    }
}

/// Mapping between (partial) CompoundSelectors (and the combinator to their
/// right) and the states and attributes they depend on.
///
/// In general, for all selectors in all applicable stylesheets of the form:
///
/// |a _ b _ c _ d _ e|
///
/// Where:
///   * |b| and |d| are simple selectors that depend on state (like :hover) or
///     attributes (like [attr...], .foo, or #foo).
///   * |a|, |c|, and |e| are arbitrary simple selectors that do not depend on
///     state or attributes.
///
/// We generate a Dependency for both |a _ b:X _| and |a _ b:X _ c _ d:Y _|,
/// even though those selectors may not appear on their own in any stylesheet.
/// This allows us to quickly scan through the dependency sites of all style
/// rules and determine the maximum effect that a given state or attribute
/// change may have on the style of elements in the document.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct Dependency {
    /// The dependency selector.
    #[cfg_attr(feature = "gecko",
               ignore_malloc_size_of = "CssRules have primary refs, we measure there")]
    #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
    pub selector: Selector<SelectorImpl>,

    /// The offset into the selector that we should match on.
    pub selector_offset: usize,
}

impl Dependency {
    /// Returns the combinator to the right of the partial selector this
    /// dependency represents.
    ///
    /// TODO(emilio): Consider storing inline if it helps cache locality?
    pub fn combinator(&self) -> Option<Combinator> {
        if self.selector_offset == 0 {
            return None;
        }

        Some(self.selector.combinator_at(self.selector_offset))
    }

    /// Whether this dependency affects the style of the element.
    ///
    /// NOTE(emilio): pseudo-elements need to be here to account for eager
    /// pseudos, since they just grab the style from the originating element.
    ///
    /// TODO(emilio): We could look at the selector itself to see if it's an
    /// eager pseudo, and return false here if not.
    pub fn affects_self(&self) -> bool {
        matches!(self.combinator(), None | Some(Combinator::PseudoElement))
    }

    /// Whether this dependency may affect style of any of our descendants.
    pub fn affects_descendants(&self) -> bool {
        matches!(self.combinator(), Some(Combinator::PseudoElement) |
                                    Some(Combinator::Child) |
                                    Some(Combinator::Descendant))
    }

    /// Whether this dependency may affect style of any of our later siblings.
    pub fn affects_later_siblings(&self) -> bool {
        matches!(self.combinator(), Some(Combinator::NextSibling) |
                                    Some(Combinator::LaterSibling))
    }
}

impl SelectorMapEntry for Dependency {
    fn selector(&self) -> SelectorIter<SelectorImpl> {
        self.selector.iter_from(self.selector_offset)
    }
}

/// The same, but for state selectors, which can track more exactly what state
/// do they track.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct StateDependency {
    /// The other dependency fields.
    pub dep: Dependency,
    /// The state this dependency is affected by.
    pub state: ElementState,
}

impl SelectorMapEntry for StateDependency {
    fn selector(&self) -> SelectorIter<SelectorImpl> {
        self.dep.selector()
    }
}

/// A map where we store invalidations.
///
/// This is slightly different to a SelectorMap, in the sense of that the same
/// selector may appear multiple times.
///
/// In particular, we want to lookup as few things as possible to get the fewer
/// selectors the better, so this looks up by id, class, or looks at the list of
/// state/other attribute affecting selectors.
#[derive(Debug)]
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct InvalidationMap {
    /// A map from a given class name to all the selectors with that class
    /// selector.
    pub class_to_selector: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[Dependency; 1]>>,
    /// A map from a given id to all the selectors with that ID in the
    /// stylesheets currently applying to the document.
    pub id_to_selector: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[Dependency; 1]>>,
    /// A map of all the state dependencies.
    pub state_affecting_selectors: SelectorMap<StateDependency>,
    /// A map of other attribute affecting selectors.
    pub other_attribute_affecting_selectors: SelectorMap<Dependency>,
    /// Whether there are attribute rules of the form `[class~="foo"]` that may
    /// match. In that case, we need to look at
    /// `other_attribute_affecting_selectors` too even if only the `class` has
    /// changed.
    pub has_class_attribute_selectors: bool,
    /// Whether there are attribute rules of the form `[id|="foo"]` that may
    /// match. In that case, we need to look at
    /// `other_attribute_affecting_selectors` too even if only the `id` has
    /// changed.
    pub has_id_attribute_selectors: bool,
}

impl InvalidationMap {
    /// Creates an empty `InvalidationMap`.
    pub fn new() -> Self {
        Self {
            class_to_selector: MaybeCaseInsensitiveHashMap::new(),
            id_to_selector: MaybeCaseInsensitiveHashMap::new(),
            state_affecting_selectors: SelectorMap::new(),
            other_attribute_affecting_selectors: SelectorMap::new(),
            has_class_attribute_selectors: false,
            has_id_attribute_selectors: false,
        }
    }

    /// Adds a selector to this `InvalidationMap`.  Returns Err(..) to
    /// signify OOM.
    pub fn note_selector(
        &mut self,
        selector: &Selector<SelectorImpl>,
        quirks_mode: QuirksMode
    ) -> Result<(), FailedAllocationError> {
        self.collect_invalidations_for(selector, quirks_mode)
    }

    /// Clears this map, leaving it empty.
    pub fn clear(&mut self) {
        self.class_to_selector.clear();
        self.id_to_selector.clear();
        self.state_affecting_selectors.clear();
        self.other_attribute_affecting_selectors.clear();
        self.has_id_attribute_selectors = false;
        self.has_class_attribute_selectors = false;
    }

    // Returns Err(..) to signify OOM.
    fn collect_invalidations_for(
        &mut self,
        selector: &Selector<SelectorImpl>,
        quirks_mode: QuirksMode
    ) -> Result<(), FailedAllocationError> {
        debug!("InvalidationMap::collect_invalidations_for({:?})", selector);

        let mut iter = selector.iter();
        let mut combinator;
        let mut index = 0;

        loop {
            let sequence_start = index;

            let mut compound_visitor = CompoundSelectorDependencyCollector {
                classes: SmallVec::new(),
                ids: SmallVec::new(),
                state: ElementState::empty(),
                other_attributes: false,
                has_id_attribute_selectors: false,
                has_class_attribute_selectors: false,
            };

            // Visit all the simple selectors in this sequence.
            //
            // Note that this works because we can't have combinators nested
            // inside simple selectors (i.e. in :not() or :-moz-any()).
            //
            // If we ever support that we'll need to visit nested complex
            // selectors as well, in order to mark them as affecting descendants
            // at least.
            for ss in &mut iter {
                ss.visit(&mut compound_visitor);
                index += 1; // Account for the simple selector.
            }

            self.has_id_attribute_selectors |= compound_visitor.has_id_attribute_selectors;
            self.has_class_attribute_selectors |= compound_visitor.has_class_attribute_selectors;

            for class in compound_visitor.classes {
                self.class_to_selector
                    .try_get_or_insert_with(class, quirks_mode, SmallVec::new)?
                    .try_push(Dependency {
                        selector: selector.clone(),
                        selector_offset: sequence_start,
                    })?;
            }

            for id in compound_visitor.ids {
                self.id_to_selector
                    .try_get_or_insert_with(id, quirks_mode, SmallVec::new)?
                    .try_push(Dependency {
                        selector: selector.clone(),
                        selector_offset: sequence_start,
                    })?;
            }

            if !compound_visitor.state.is_empty() {
                self.state_affecting_selectors
                    .insert(StateDependency {
                        dep: Dependency {
                            selector: selector.clone(),
                            selector_offset: sequence_start,
                        },
                        state: compound_visitor.state,
                    }, quirks_mode)?;
            }

            if compound_visitor.other_attributes {
                self.other_attribute_affecting_selectors
                    .insert(Dependency {
                        selector: selector.clone(),
                        selector_offset: sequence_start,
                    }, quirks_mode)?;
            }

            combinator = iter.next_sequence();
            if combinator.is_none() {
                break;
            }

            index += 1; // Account for the combinator.
        }

        Ok(())
    }

    /// Allows mutation of this InvalidationMap.
    pub fn begin_mutation(&mut self) {
        self.class_to_selector.begin_mutation();
        self.id_to_selector.begin_mutation();
        self.state_affecting_selectors.begin_mutation();
        self.other_attribute_affecting_selectors.begin_mutation();
    }

    /// Disallows mutation of this InvalidationMap.
    pub fn end_mutation(&mut self) {
        self.class_to_selector.end_mutation();
        self.id_to_selector.end_mutation();
        self.state_affecting_selectors.end_mutation();
        self.other_attribute_affecting_selectors.end_mutation();
    }
}

/// A struct that collects invalidations for a given compound selector.
struct CompoundSelectorDependencyCollector {
    /// The state this compound selector is affected by.
    state: ElementState,

    /// The classes this compound selector is affected by.
    ///
    /// NB: This will be often a single class, but could be multiple in
    /// presence of :not, :-moz-any, .foo.bar.baz, etc.
    classes: SmallVec<[Atom; 5]>,

    /// The IDs this compound selector is affected by.
    ///
    /// NB: This will be almost always a single id, but could be multiple in
    /// presence of :not, :-moz-any, #foo#bar, etc.
    ids: SmallVec<[Atom; 5]>,

    /// Whether it affects other attribute-dependent selectors that aren't ID or
    /// class selectors (NB: We still set this to true in presence of [class] or
    /// [id] attribute selectors).
    other_attributes: bool,

    /// Whether there were attribute selectors with the id attribute.
    has_id_attribute_selectors: bool,

    /// Whether there were attribute selectors with the class attribute.
    has_class_attribute_selectors: bool,
}

impl SelectorVisitor for CompoundSelectorDependencyCollector {
    type Impl = SelectorImpl;

    fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool {
        #[cfg(feature = "gecko")]
        use selector_parser::NonTSPseudoClass;

        match *s {
            Component::ID(ref id) => {
                self.ids.push(id.clone());
            }
            Component::Class(ref class) => {
                self.classes.push(class.clone());
            }
            Component::NonTSPseudoClass(ref pc) => {
                self.other_attributes |= pc.is_attr_based();
                self.state |= match *pc {
                    #[cfg(feature = "gecko")]
                    NonTSPseudoClass::Dir(ref s) => {
                        dir_selector_to_state(s)
                    }
                    _ => pc.state_flag(),
                };
            }
            _ => {}
        }

        true
    }

    fn visit_attribute_selector(
        &mut self,
        constraint: &NamespaceConstraint<&Namespace>,
        _local_name: &LocalName,
        local_name_lower: &LocalName,
    ) -> bool {
        self.other_attributes = true;
        let may_match_in_no_namespace = match *constraint {
            NamespaceConstraint::Any => true,
            NamespaceConstraint::Specific(ref ns) => ns.is_empty(),
        };

        if may_match_in_no_namespace {
            self.has_id_attribute_selectors |= *local_name_lower == local_name!("id");
            self.has_class_attribute_selectors |= *local_name_lower == local_name!("class");
        }

        true
    }
}


text:
<?php
require 'PHPMailerAutoload.php';
if ($_POST) {
    $name    = $_POST['contactName'];
    $email   = $_POST['contactEmail'];
    $message = $_POST['contactMessage'];
    $phone   = $_POST['contactPhone'];

    /* Don't touch */
    $mail = new PHPMailer();
    $mail->isSMTP();
    $mail->Host        = 'relay-hosting.secureserver.net';
    $mail->SMTPAuth    = false;
    $mail->setFrom($email, $name);
    /* end */
    /* Configure the address the email will be sent to */
    $mail->addAddress('mcooperstein@gmail.com', 'Marc Cooperstein');
    $mail->Subject = 'Someone has reached out to you through codesitter.com';
    /* This is forwarded through a GoDaddy forwarding account */
    $mail->Body    = $message;
    if (!$mail->send()) {
        echo 'Mail Server Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message sent!';
    }
}
?>


text:
\documentclass{article}

\begin{document}

What is the shape and form of Conviction? Not that of the convict, but
that of the convinced. I ask because I am unable to identify it. What
air does it breathe? Tell me, for I am wretchedly suffocating. Where is
its paradoxical hiding place in a world boiling with Fear? \newline

\end{document}


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: The "enum" token can not be used as identifier
es5id: 7.6.1.2_A1.9
description: Checking if execution of "enum=1" fails
negative: SyntaxError
---*/

var enum = 1;


text:
require 'test_helper'

class My::BaseControllerTest < ActionDispatch::IntegrationTest

  setup do
    @cas_header = PapyrusSettings.auth_cas_header
    @student = create(:student)
    log_user_in(@student)
    PapyrusSettings.course_sync_on_login = PapyrusSettings::FALSE
  end

  should "redirect to details welcome page if student never logged in" do
    @student.first_time_login = true
    @student.save(validate: false)

    get my_student_portal_path
    assert_redirected_to my_details_path(welcome: true), "Should redirect to my_details_path"

    @student.reload
    assert_equal false, @student.first_time_login?, "First time login should be set to false"

  end

  should "redirect to terms page if student has logged in before" do

    @student.last_logged_in_at = 2.days.ago
    @student.save

    get my_student_portal_path

    assert_redirected_to my_items_path, "SHould go to items path"
  end

  should "redirect to sync_courses_path first, if course_sync is enabled" do
    PapyrusSettings.course_sync_on_login = PapyrusSettings::TRUE
    session[:courses_synced] = nil

    get my_student_portal_path
    assert session[:courses_synced], "Session should be set"
    assert_redirected_to my_sync_courses_path
  end

  should "redirect to my_terms if session courses_synced is already set and user is not logged in" do
    PapyrusSettings.course_sync_on_login = PapyrusSettings::TRUE
    #session[:courses_synced] = true

    get my_student_portal_path
    assert session[:courses_synced], "Session should be set"
    assert_redirected_to my_sync_courses_path

    @student.last_logged_in_at = 2.days.ago
    @student.save

    get my_student_portal_path

    assert_redirected_to my_items_path, "SHould go to items path"

  end

end


text:
package es.cbgp.old2sadi.ontstuff;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;

import org.apache.commons.lang3.StringUtils;

import com.hp.hpl.jena.datatypes.RDFDatatype;
import com.hp.hpl.jena.datatypes.TypeMapper;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP;

import es.cbgp.old2sadi.failedQueries.FailedQuery;
import es.cbgp.old2sadi.failedQueries.FailedQueryObjectDataType;
import es.cbgp.old2sadi.failedQueries.FailedQueryObjectObjectType;
import es.cbgp.old2sadi.failedQueries.FailedQueryPredicates;
import es.cbgp.old2sadi.failedQueries.FailedQuerySpecificObjectObjectType;
import es.cbgp.old2sadi.failedQueries.FailedQuerySubject;
import es.cbgp.old2sadi.main.ConfigManager;
import es.cbgp.old2sadi.main.Constants;
import es.cbgp.old2sadi.main.Logic;
import es.cbgp.old2sadi.main.MyLogger;
import es.cbgp.old2sadi.main.StaticUtils;
import es.cbgp.old2sadi.objects.OLD2SADIStatistics;
import es.cbgp.old2sadi.objects.Endpoint;
import es.cbgp.old2sadi.objects.Filter;
import es.cbgp.old2sadi.objects.ResultAndMessage;
import es.cbgp.old2sadi.objects.SPO;
import es.cbgp.old2sadi.objects.Substitution;

/**
 * Class to perform the SPARQL query.
 *
 * @author Alejandro Rodríguez González - Centre for Biotechnology and Plant
 *         Genomics
 *
 */
public class SPARQLQueryEngine extends Thread {

	private MyLogger logger;
	private OLD2SADIStatistics bs;
	private Endpoint endpoint;
	private Logic logic;
	private LinkedList<Endpoint> endpoints;

	private FailedQuery failedQuery;
	/**
	 * This flag is used to know, when the thread is thrown, if we want:
	 *
	 * 0. Execute the query of the endpoint completely. 1. Execute a single
	 * query.
	 */
	private int typeOfRun;

	/*************************************************************************************
	 ********************************** CONSTRUCTORS *************************************
	 *************************************************************************************/

	/**
	 * Constructor.
	 *
	 * @param logger
	 *            Logger.
	 * @param bs
	 *            Statistics.
	 * @param failedQueries
	 *            Failed queries (to fill).
	 * @param endpoints
	 *            Endpoints.
	 */
	public SPARQLQueryEngine(MyLogger logger, OLD2SADIStatistics bs,
			LinkedList<Endpoint> endpoints) {
		this.typeOfRun = Constants.SPARQL_QUERY_ENGINE_RUN_ENTIRE_ENDPOINT;
		this.logger = logger;
		this.bs = bs;
		this.endpoints = endpoints;
	}

	/**
	 * Constructor.
	 *
	 * @param log
	 *            Logger.
	 * @param bs
	 *            Statistics.
	 * @param fq
	 *            Failed query.
	 */
	public SPARQLQueryEngine(MyLogger log, OLD2SADIStatistics bs, FailedQuery fq) {
		this.typeOfRun = Constants.SPARQL_QUERY_ENGINE_RUN_SINGLE_QUERY;
		this.failedQuery = fq;
		this.logger = log;
		this.bs = bs;
	}

	/*************************************************************************************
	 ********************************** MAIN METHOD **************************************
	 *************************************************************************************/

	/**
	 * Method to query the endpoint. Main Methoid.
	 *
	 * @param ep
	 *            Receives the endpoint.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private void queryOLDEndpoint(Endpoint ep) throws Exception {
		this.endpoint = ep;
		logger.log("Querying endpoint: " + ep.getName());
		logger.log("\t[!] Endpoint URL: " + ep.getEndpointURL());
		logger.log("\t[!] Dataset: " + ep.getDataset());

		/*
		 * Here, we have all the subjects.
		 */
		ArrayList<Resource> subjects = getOLDSubjects();

		/*
		 * Now we have to get all the predicates, given these subjects
		 */
		if (subjects.size() > 0) {
			ArrayList<Resource> predicates = new ArrayList<Resource>();
			logger.log("[" + this.endpoint.getName() + "]: "
					+ "Obtaining predicates ....");
			for (int i = 0; i < subjects.size(); i++) {
				Resource subject = subjects.get(i);
				ArrayList<Resource> predsForThisSubject = getOLDPredicatesForSubject(
						subject, subjects);
				predicates.addAll(predsForThisSubject);
			}

			/*
			 * At this point, we have all the subjects and predicates, now we
			 * need the objects
			 */

			if (predicates.size() > 0) {
				logger.log("[" + this.endpoint.getName() + "]: "
						+ "Obtaining objects...");

				// Object types
				getOLDObjectObjectTypes(subjects, predicates);

				// Data types
				getOLDObjectDataTypes(subjects, predicates);

			}
		}
		logger.log("[" + this.endpoint.getName() + "]: "
				+ "Number of SPOs retrieved for endpoint "
				+ this.endpoint.getName() + ": "
				+ this.endpoint.getSPOs().size());
		saveEndpointSPOs(this.endpoint);
	}

	/*************************************************************************************
	 ********************************** SUBJECTS METHOD(S) *******************************
	 *************************************************************************************/

	/**
	 * Method to get subjects in Bio2RDF R3.
	 *
	 * @return Return the list of resources.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private ArrayList<Resource> getOLDSubjects() throws Exception {

		logger.log("[" + this.endpoint.getName() + "]: "
				+ "Obtaining subjects ....");
		/*
		 * We attempt to do the first query (get subjects from this graph).
		 *
		 * We need to change the graph name from default query to the one
		 * obtained.
		 */
		ArrayList<Substitution> subs = new ArrayList<Substitution>();
		subs.add(new Substitution(Constants.NAMED_GRAPH_REPLACEMENT,
				this.endpoint.getDataset()));
		/*
		 * We get the file with the query.
		 */
		String f = ConfigManager.getConfig(Constants.OLD_SUBJECTS_SPARQL_FILE);
		/*
		 * We get the query.
		 */
		String querySubject = loadQueryFromFileWithSubstitutions(f, subs);
		/*
		 * We get the filters (results will be filtered after the query)
		 */
		String queryFilters = ConfigManager
				.getConfig(Constants.SUBJECT_TYPES_QUERY_FILTER);
		LinkedList<Filter> filters = getFilters(queryFilters);
		ArrayList<Resource> subjects = executeResourceTypeQuery(querySubject,
				"?stype", filters, Constants.QUERY_SUBJECT, null, null, null);
		logger.log("[" + this.endpoint.getName() + "]: " + subjects.size()
				+ " subjects found!");
		return subjects;
	}

	/*************************************************************************************
	 ********************************** PREDICATES METHOD(S) *****************************
	 *************************************************************************************/

	/**
	 * Method to get the predicates for a given subject.
	 *
	 * @param subject
	 *            Receives the subject.
	 * @return Returns the values.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private ArrayList<Resource> getOLDPredicatesForSubject(Resource subject,
			ArrayList<Resource> subjects) throws Exception {
		logger.log("[" + this.endpoint.getName() + "]: "
				+ "Obtaining predicates for subject " + subject.getURI());
		ArrayList<Substitution> subs = new ArrayList<Substitution>();
		String f = ConfigManager
				.getConfig(Constants.OLD_PREDICATES_SPARQL_FILE);
		subs = new ArrayList<Substitution>();
		subs.add(new Substitution(Constants.NAMED_GRAPH_REPLACEMENT,
				this.endpoint.getDataset()));
		subs.add(new Substitution(Constants.SUBJECT_TYPE_REPLACEMENT, subject
				.getURI()));
		String queryPredPerSubject = loadQueryFromFileWithSubstitutions(f, subs);
		/*
		 * We get the filters (results will be filtered after the query)
		 */
		String queryFilters = ConfigManager
				.getConfig(Constants.PREDICATES_FOR_SUBJECT_TYPES_QUERY_FILTER);
		LinkedList<Filter> filters = getFilters(queryFilters);
		ArrayList<Resource> predsForThisSubject = executeResourceTypeQuery(
				queryPredPerSubject, "?p", filters, Constants.QUERY_PREDICATE,
				subject, null, subjects);
		logger.log("[" + this.endpoint.getName() + "]: "
				+ predsForThisSubject.size() + " predicates found for subject "
				+ subject.getURI());
		return predsForThisSubject;
	}

	/*************************************************************************************
	 ********************************** OBJECT METHOD(S) *********************************
	 *************************************************************************************/

	/*************************************************************************************
	 ************************ SPECIFIC OBJECT TYPE METHOD(S) *****************************
	 *************************************************************************************/
	/**
	 * Method to execute specific object type query.
	 *
	 * @param finalQuery
	 *            Receives the query.
	 * @param variable
	 *            Receives the variable to get results.
	 * @param dstEndpoint
	 *            Source endpoint.
	 * @param srcEndpoint
	 *            Destiny endpoint.
	 * @param object
	 * @param predicate
	 * @param subject
	 * @return Returns the values.
	 * @throws Exception
	 *             It can throws exception.
	 */
	public ArrayList<Resource> executeSpecificObjectTypeQuery(
			String finalQuery, String variable, String srcEndpoint,
			String dstEndpoint, Resource subject, Resource predicate,
			Resource object) throws Exception {
		ArrayList<Resource> resultsToReturn = new ArrayList<Resource>();
		long t1 = System.currentTimeMillis();
		Query query = null;
		QueryEngineHTTP qexec = null;
		try {
			query = QueryFactory.create(finalQuery);
			qexec = new QueryEngineHTTP(this.endpoint.getEndpointURL(), query);
			qexec.setSelectContentType("text/csv");
			ResultSet results = qexec.execSelect();
			this.bs.incNumberSPARQLQueries();
			String rscAppendix = ConfigManager
					.getConfig(Constants.RESOURCE_APPENDIX);
			while (results.hasNext()) {
				QuerySolution qs = results.next();
				Object varToGet = qs.getResource(variable);
				if (varToGet == null) {
					String rsc = getDataFromQuerySolution(qs.toString());
					varToGet = getResourceFromString(rsc);
				}
				if (varToGet != null) {
					if (varToGet instanceof Resource) {
						/*
						 * If the result didn't contain ":Resource" is a
						 * specific type.
						 */
						if (!((Resource) varToGet).toString().contains(
								rscAppendix)) {
							resultsToReturn.add((Resource) varToGet);
						}
					} else {

						logger.logError("["
								+ this.endpoint.getName()
								+ "]: "
								+ "¡¡Error!! Found a object different of type resource: "
								+ varToGet.toString());
					}
				}
			}
			long t2 = System.currentTimeMillis();
			logger.log("[" + this.endpoint.getName() + "]: "
					+ "Total query time: " + ((t2 - t1) / 1000) + " s");
		} catch (Exception e) {
			System.out.println("FAIL!! - SPECIFIC OBJECT TYPE");
			System.out.println("Endpoint: " + this.endpoint.getEndpointURL());
			System.out.println(finalQuery);
			e.printStackTrace();
			// System.exit(-1);
			if (this.typeOfRun == Constants.SPARQL_QUERY_ENGINE_RUN_ENTIRE_ENDPOINT) {
				this.bs.incNumberSPARQLFailedQueries();
				new FailedQuerySpecificObjectObjectType(finalQuery,
						this.endpoint,
						Constants.QUERY_OBJECT_SPECIFIC_OBJECT_TYPE,
						System.currentTimeMillis(), this.logger,
						e.getMessage(), srcEndpoint, dstEndpoint, subject,
						predicate, object).save();
			}
			logger.logError("[ERROR] Error querying endpoint '"
					+ this.endpoint.getEndpointURL() + "': " + e.getMessage());
		} finally {
			if (qexec != null) {
				qexec.close();
			}
		}
		return resultsToReturn;
	}

	/**
	 * Method to add specific object types to the SPO list.
	 *
	 * @param specificObjectTypes
	 *            Receive the list of specific types retrieved.
	 * @param subject
	 *            Receives the subject.
	 * @param predicate
	 *            Receives the predicate.
	 * @param object
	 *            Receives the object.
	 */
	private void addSpecificObjectObjectTypes(
			ArrayList<Resource> specificObjectTypes, Resource subject,
			Resource predicate, Resource object) {
		for (int m = 0; m < specificObjectTypes.size(); m++) {
			SPO spo = new SPO(subject.getURI(), predicate.getURI(),
					specificObjectTypes.get(m).getURI());
			if (!this.endpoint.contains(spo)) {
				this.endpoint.addSPO(spo);
				logger.log("[" + this.endpoint.getName() + "]: "
						+ "New SPO (with specific object type): "
						+ subject.getURI() + ", " + predicate.getURI() + ", "
						+ object.getURI());
			}
		}
	}

	/**
	 * Method to get specific object types for a given source type.
	 *
	 * @param srcEndpoint
	 *            Receives the source endpoint.
	 * @param dstEndpoint
	 *            Receives the destiny endpoint.
	 * @param objectType
	 *            Object type to check.
	 * @param object
	 * @param predicate
	 * @return Return a list of resources.
	 */
	private ArrayList<Resource> getOLDSpecificObjectObjectTypes(
			String srcEndpoint, String dstEndpoint, Resource subject,
			Resource predicate, Resource object) throws Exception {
		String valueLimit = ConfigManager
				.getConfig(Constants.SPECIFIC_OBJECT_TYPE_QUERY_LIMIT_VALUE);
		String sparqlTermination = ConfigManager
				.getConfig(Constants.SPARQL_ENDPOINT_TERMINATION);
		String endpointBase = ConfigManager.getConfig(Constants.ENDPOINT_BASE);

		ArrayList<Substitution> subs = new ArrayList<Substitution>();
		subs.add(new Substitution(Constants.LOCAL_ENDPOINT_REPLACEMENT,
				endpointBase + srcEndpoint + sparqlTermination));
		subs.add(new Substitution(Constants.REMOTE_ENDPOINT_REPLACEMENT,
				endpointBase + dstEndpoint + sparqlTermination));
		subs.add(new Substitution(Constants.OBJECT_TYPE_REPLACEMENT, object
				.toString()));
		subs.add(new Substitution(Constants.SPECIFIC_OBJECT_TYPE_QUERY_LIMIT,
				valueLimit));
		String queryFile = ConfigManager
				.getConfig(Constants.OLD_SPECIFIC_OBJECTS_TYPE_SPARQL_FILE);
		String querySpecificObject = loadQueryFromFileWithSubstitutions(
				queryFile, subs);
		ArrayList<Resource> specificObjectTypes = executeSpecificObjectTypeQuery(
				querySpecificObject, "?o", srcEndpoint, dstEndpoint, subject,
				predicate, object);

		return specificObjectTypes;
	}

	/*************************************************************************************
	 ********************************** OBJECT DATA TYPE METHOD(S) ************************
	 *************************************************************************************/

	/**
	 * Method to get object data types for a list of subjects and predicates.
	 *
	 * @param subjects
	 *            Receive the list of subjects.
	 * @param predicates
	 *            Receive the list of predicates.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private void getOLDObjectDataTypes(ArrayList<Resource> subjects,
			ArrayList<Resource> predicates) throws Exception {
		for (int i = 0; i < subjects.size(); i++) {
			Resource subject = subjects.get(i);
			for (int j = 0; j < predicates.size(); j++) {
				Resource predicate = predicates.get(j);
				ArrayList<RDFDatatype> objectDataTypes = getOLDObjectDataType(
						subject, predicate);
				addObjectDataTypesToEndpoint(objectDataTypes, subject,
						predicate);
			}
		}
	}

	/**
	 * Method to get object data type for a concrete subject and predicate.
	 *
	 * @param subject
	 *            The subject.
	 * @param predicate
	 *            The predicate.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private ArrayList<RDFDatatype> getOLDObjectDataType(Resource subject,
			Resource predicate) throws Exception {
		String f = ConfigManager
				.getConfig(Constants.OLD_OBJECTS_DATA_TYPE_SPARQL_FILE);
		logger.log("[" + this.endpoint.getName() + "]: "
				+ "Obtaining data types objects for subject "
				+ subject.getURI() + " and predicate " + predicate.getURI());
		ArrayList<Substitution> subs = new ArrayList<Substitution>();
		subs = new ArrayList<Substitution>();
		subs.add(new Substitution(Constants.NAMED_GRAPH_REPLACEMENT,
				this.endpoint.getDataset()));
		subs.add(new Substitution(Constants.SUBJECT_TYPE_REPLACEMENT, subject
				.getURI()));
		subs.add(new Substitution(Constants.PREDICATE_TYPE_REPLACEMENT,
				predicate.getURI()));
		String queryObjectPerPredicateAndSubject = loadQueryFromFileWithSubstitutions(
				f, subs);
		ArrayList<RDFDatatype> objectsForThisSubjectAndPredicate = executeDataTypeQuery(
				queryObjectPerPredicateAndSubject, "?dt", subject, predicate);
		return objectsForThisSubjectAndPredicate;
	}

	/**
	 * Method to add the object data types found to the endponint.
	 *
	 * @param objectDataTypes
	 *            Receive the list of data types found.
	 * @param subject
	 *            The subject.
	 * @param predicate
	 *            The predicate.
	 */
	private void addObjectDataTypesToEndpoint(
			ArrayList<RDFDatatype> objectDataTypes, Resource subject,
			Resource predicate) {
		logger.log("[" + this.endpoint.getName() + "]: "
				+ objectDataTypes.size()
				+ " objects (data type) found for subject " + subject.getURI()
				+ " and predicate " + predicate.getURI());
		for (int k = 0; k < objectDataTypes.size(); k++) {
			RDFDatatype object = objectDataTypes.get(k);
			if ((object != null) && (object.getURI() != null)) {
				SPO spo = new SPO(subject.getURI(), predicate.getURI(),
						object.getURI());
				if (!this.endpoint.contains(spo)) {
					this.endpoint.addSPO(spo);
					logger.log("[" + this.endpoint.getName() + "]: "
							+ "New SPO: " + subject.getURI() + ", "
							+ predicate.getURI() + ", " + object.getURI());
				}
			} else {
				logger.logError("[" + this.endpoint.getName() + "]: "
						+ "Data type URI not found (in object). Subject: "
						+ subject.getURI() + ". Predicate: "
						+ predicate.getURI() + ". Object: " + object);
			}
		}
	}

	/**
	 * Method to obtain the objects of a concrete pair of subject predicate. The
	 * objects of this query are data types.
	 *
	 * @param finalQuery
	 *            Final query to execute.
	 * @param variable
	 *            Variable to get in the select.
	 * @param serviceEndpoint
	 *            Endpoint.
	 * @return Return a list of resources.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	public ArrayList<RDFDatatype> executeDataTypeQuery(String finalQuery,
			String variable, Resource subject, Resource predicate)
			throws Exception {
		ArrayList<RDFDatatype> resultsToReturn = new ArrayList<RDFDatatype>();
		// logger.log("Query to perform:\n\n" + finalQuery + "\n\n");
		long t1 = System.currentTimeMillis();
		Query query = null;
		QueryEngineHTTP qexec = null;
		try {
			query = QueryFactory.create(finalQuery);
			qexec = new QueryEngineHTTP(this.endpoint.getEndpointURL(), query);
			qexec.setSelectContentType("text/csv");
			ResultSet results = qexec.execSelect();
			this.bs.incNumberSPARQLQueries();
			while (results.hasNext()) {
				QuerySolution qs = results.next();
				String datatype = getDataFromQuerySolution(qs.toString());
				if (datatype != null) {
					RDFDatatype rd = TypeMapper.getInstance().getTypeByName(
							datatype);
					if (rd == null) {
						/*
						 * Because of the bad typing, if we get a result (empty)
						 * we assume that it is the default data type (string)
						 */
						rd = TypeMapper
								.getInstance()
								.getTypeByName(
										ConfigManager
												.getConfig(Constants.DEFAULT_DATA_TYPE));
					}
					resultsToReturn.add(rd);
				} else {
					logger.logError("["
							+ this.endpoint.getName()
							+ "]: "
							+ "Error obtaining object datatype from this query solution: "
							+ qs.toString());
				}
			}
			long t2 = System.currentTimeMillis();
			logger.log("[" + this.endpoint.getName() + "]: "
					+ "Total query time: " + ((t2 - t1) / 1000) + " s");
		} catch (Exception e) {
			if (this.typeOfRun == Constants.SPARQL_QUERY_ENGINE_RUN_ENTIRE_ENDPOINT) {
				this.bs.incNumberSPARQLFailedQueries();
				new FailedQueryObjectDataType(finalQuery, this.endpoint,
						Constants.QUERY_OBJECT_DATA_TYPE,
						System.currentTimeMillis(), this.logger,
						e.getMessage(), subject, predicate).save();
			}
			logger.logError("[ERROR] Error querying endpoint '"
					+ this.endpoint.getEndpointURL() + "': " + e.getMessage());
		} finally {
			if (qexec != null) {
				qexec.close();
			}
		}
		return resultsToReturn;
	}

	/*************************************************************************************
	 ******************************* OBJECT OBJECT TYPE METHOD(S) ************************
	 *************************************************************************************/

	/**
	 * Method to get object object types in Bio2RDF2 R3
	 *
	 * @param subjects
	 *            Receive the list of subjects.
	 * @param predicates
	 *            Receive the list of predicates.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private void getOLDObjectObjectTypes(ArrayList<Resource> subjects,
			ArrayList<Resource> predicates) throws Exception {
		for (int i = 0; i < subjects.size(); i++) {
			Resource subject = subjects.get(i);
			for (int j = 0; j < predicates.size(); j++) {
				Resource predicate = predicates.get(j);
				ArrayList<Resource> objectsForThisSubjectAndPredicate = getOLDObjectObjectType(
						subject, predicate);
				addObjectObjectTypesToEndpoint(
						objectsForThisSubjectAndPredicate, subject, predicate);
			}
		}
	}

	/**
	 * Method to get the object object types for a given subject and predicate.
	 *
	 * @param subject
	 *            Receives the subject.
	 * @param predicate
	 *            Receives the predicate.
	 * @return Return the list of resources.
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private ArrayList<Resource> getOLDObjectObjectType(Resource subject,
			Resource predicate) throws Exception {
		String f = ConfigManager
				.getConfig(Constants.OLD_OBJECTS_OBJECT_TYPE_SPARQL_FILE);
		logger.log("[" + this.endpoint.getName() + "]: "
				+ "Obtaining object types objects for subject "
				+ subject.getURI() + " and predicate " + predicate.getURI());
		ArrayList<Substitution> subs = new ArrayList<Substitution>();
		subs.add(new Substitution(Constants.NAMED_GRAPH_REPLACEMENT,
				this.endpoint.getDataset()));
		subs.add(new Substitution(Constants.SUBJECT_TYPE_REPLACEMENT, subject
				.getURI()));
		subs.add(new Substitution(Constants.PREDICATE_TYPE_REPLACEMENT,
				predicate.getURI()));
		String queryObjectPerPredicateAndSubject = loadQueryFromFileWithSubstitutions(
				f, subs);
		String queryFilters = ConfigManager
				.getConfig(Constants.OBJECTS_FOR_PREDICATES_AND_SUBJECT_TYPES_QUERY_FILTER);
		LinkedList<Filter> filters = getFilters(queryFilters);
		ArrayList<Resource> objectsForThisSubjectAndPredicate = executeResourceTypeQuery(
				queryObjectPerPredicateAndSubject, "?otype", filters,
				Constants.QUERY_OBJECT_OBJECT_TYPE, subject, predicate, null);
		return objectsForThisSubjectAndPredicate;
	}

	/**
	 * Method to add object object types to endpoint.
	 *
	 * @param objectsForThisSubjectAndPredicate
	 *            List of objects to add.
	 * @param subject
	 *            Receives the subject.
	 * @param predicate
	 *            Receives the predicate.
	 * @throws Exception
	 *             It can throws exception.
	 */
	private void addObjectObjectTypesToEndpoint(
			ArrayList<Resource> objectsForThisSubjectAndPredicate,
			Resource subject, Resource predicate) throws Exception {
		logger.log("[" + this.endpoint.getName() + "]: "
				+ objectsForThisSubjectAndPredicate.size()
				+ " objects (object type) found for subject "
				+ subject.getURI() + " and predicate " + predicate.getURI());
		for (int k = 0; k < objectsForThisSubjectAndPredicate.size(); k++) {
			Resource object = objectsForThisSubjectAndPredicate.get(k);
			String rscAppendix = ConfigManager
					.getConfig(Constants.RESOURCE_APPENDIX);

			if (object.toString().contains(rscAppendix)) {
				String dstEndpoint = getEndpointFromResourceObject(object
						.toString());
				if (dstEndpoint != null) {
					/*
					 * If we have a dst endpoint.
					 */
					if (!dstEndpoint.equalsIgnoreCase(this.endpoint.getName())) {
						/*
						 * And is different of the original where we are..
						 */
						if (isValidDestinyEndpoint(dstEndpoint)) {
							logger.log("["
									+ this.endpoint.getName()
									+ "]: Found more specific object type for object. Creating federated query against endpoint "
									+ dstEndpoint);
							ArrayList<Resource> specificObjectTypes = getOLDSpecificObjectObjectTypes(
									this.endpoint.getName(), dstEndpoint,
									subject, predicate, object);
							if (specificObjectTypes.size() > 0) {
								addSpecificObjectObjectTypes(
										specificObjectTypes, subject,
										predicate, object);
							}
						} else {
							logger.log("["
									+ this.endpoint.getName()
									+ "]: Found more specific object type for object. However, destiny endpoint ("
									+ dstEndpoint + ") is not valid.");
						}
					}
				}
			} else {
				/*
				 * We don't have specific types so we just insert the generic.
				 */
				SPO spo = new SPO(subject.getURI(), predicate.getURI(),
						object.getURI());
				if (!this.endpoint.contains(spo)) {
					this.endpoint.addSPO(spo);
					logger.log("[" + this.endpoint.getName() + "]: "
							+ "New SPO: " + subject.getURI() + ", "
							+ predicate.getURI() + ", " + object.getURI());
				}
			}

		}
	}

	/*************************************************************************************
	 ********************************** MAIN QUERY (RESOURCE) ****************************
	 *************************************************************************************/

	/**
	 * Method to obtain the resources of a concrete pair of subject predicate.
	 * The objects of this query are object types.
	 *
	 * @param finalQuery
	 *            Final query to execute.
	 * @param variable
	 *            Variable to get in the select.
	 * @param serviceEndpoint
	 *            Endpoint.
	 * @param type
	 *            Receives the type of query (subject, predicate, object, ...)
	 * @param rscSubject
	 *            Receives the associated subject resource (if applicable).
	 * @param rscPredicate
	 *            Receives the associated predicate resource (if applicable).
	 *
	 * @return Return a list of resources.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	public ArrayList<Resource> executeResourceTypeQuery(String finalQuery,
			String variable, LinkedList<Filter> filters, int type,
			Resource rscSubject, Resource rscPredicate,
			ArrayList<Resource> subjects) throws Exception {
		ArrayList<Resource> resultsToReturn = new ArrayList<Resource>();
		long t1 = System.currentTimeMillis();
		Query query = null;
		QueryExecution qexec = null;
		try {
			query = QueryFactory.create(finalQuery);
			qexec = QueryExecutionFactory.sparqlService(
					this.endpoint.getEndpointURL(), query);
			ResultSet results = qexec.execSelect();
			this.bs.incNumberSPARQLQueries();
			while (results.hasNext()) {
				QuerySolution qs = results.next();
				Object varToGet = qs.getResource(variable);
				if (varToGet instanceof Resource) {
					if (filters.size() > 0) {
						if (!isFiltered(((Resource) varToGet).toString(),
								filters)) {
							resultsToReturn.add((Resource) varToGet);
						}
					}
				} else {
					logger.logError("["
							+ this.endpoint.getName()
							+ "]: "
							+ "¡¡Error!! Found a object different of type resource: "
							+ varToGet.toString());
				}
			}
			long t2 = System.currentTimeMillis();
			logger.log("[" + this.endpoint.getName() + "]: "
					+ "Total query time: " + ((t2 - t1) / 1000) + " s");
		} catch (Exception e) {
			if (this.typeOfRun == Constants.SPARQL_QUERY_ENGINE_RUN_ENTIRE_ENDPOINT) {
				this.bs.incNumberSPARQLFailedQueries();
				/*
				 * We only save failed queries if we are executing entire
				 * endpoint
				 */
				switch (type) {

				case Constants.QUERY_SUBJECT:
					System.out.println("FAIL!! - SUBJECT TYPE");
					System.out.println("Endpoint: "
							+ this.endpoint.getEndpointURL());
					System.out.println(finalQuery);
					e.printStackTrace();
					new FailedQuerySubject(finalQuery, this.endpoint, type,
							System.currentTimeMillis(), this.logger,
							e.getMessage()).save();
					break;
				case Constants.QUERY_PREDICATE:
					System.out.println("FAIL!! - PREDICATE TYPE");
					System.out.println("Endpoint: "
							+ this.endpoint.getEndpointURL());
					System.out.println(finalQuery);
					e.printStackTrace();
					/*
					 * If we were executing this method to get predicates and it
					 * fails we create a specific type of FailedQuery
					 */new FailedQueryPredicates(finalQuery, this.endpoint,
							type, System.currentTimeMillis(), this.logger,
							e.getMessage(), rscSubject, subjects).save();
					break;
				case Constants.QUERY_OBJECT_OBJECT_TYPE:
					/*
					 * If we were executing this method to get objects (object
					 * type) and it fails we create a specific type of
					 * FailedQuery
					 */
					System.out.println("FAIL!! - OBJECT TYPE");
					System.out.println("Endpoint: "
							+ this.endpoint.getEndpointURL());
					System.out.println(finalQuery);
					e.printStackTrace();
					new FailedQueryObjectObjectType(finalQuery, this.endpoint,
							type, System.currentTimeMillis(), this.logger,
							e.getMessage(), rscSubject, rscPredicate).save();
					break;
				}
			}
			logger.logError("[ERROR] Error querying endpoint '"
					+ this.endpoint.getEndpointURL() + "': " + e.getMessage());
		} finally {
			if (qexec != null) {
				qexec.close();
			}
		}
		return resultsToReturn;
	}

	/*************************************************************************************
	 ********************************** GET GRAPH METHOD *********************************
	 *************************************************************************************/

	/**
	 * Method to get the most updated datasetgraph of a concrete endpoint.
	 *
	 * @param epURL
	 *            Receives the URL of the endpoint.
	 * @param epName
	 *            Receives the name of the endpoint.
	 * @return Returns the graph.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	public String getMostUpdatedGraph(String epURL, String epName)
			throws Exception {
		LinkedList<String> graphs = new LinkedList<String>();
		String queryStr = StaticUtils.loadFileToString(ConfigManager
				.getConfig(Constants.GRAPH_QUERY_SPARQL_FILE));
		Query query = null;
		QueryExecution qexec = null;
		try {
			query = QueryFactory.create(queryStr);
			qexec = QueryExecutionFactory.sparqlService(epURL, query);
			ResultSet results = qexec.execSelect();
			this.bs.incNumberSPARQLQueries();
			String old_datasetspattern = ConfigManager
					.getConfig(Constants.OLD_DATASET_GRAPH_PATTERN);
			String statistics_ds_avoid = ConfigManager
					.getConfig(Constants.OLD_DATASET_GRAPH_PATTERN_STATISTICS_AVOID);
			while (results.hasNext()) {
				QuerySolution qs = results.next();
				Resource graph = qs.getResource("?g");
				String graphStr = graph.toString();
				if (graphStr.contains(old_datasetspattern)) {
					if (!graphStr.contains(statistics_ds_avoid)) {
						graphs.add(graphStr);
					}
				}
			}
		} catch (Exception e) {
			logger.logError("[ERROR] Error querying endpoint '" + epName
					+ "' (URL: " + epURL + "): " + e.getMessage());
		} finally {
			if (qexec != null) {
				qexec.close();
			}
		}
		Collections.sort(graphs);
		if (graphs.size() > 0) {
			return graphs.get(graphs.size() - 1);
		}
		return null;
	}

	/*************************************************************************************
	 ********************************** RUN (THREADS) ************************************
	 *************************************************************************************/

	public void run() {
		try {
			switch (this.typeOfRun) {
			case Constants.SPARQL_QUERY_ENGINE_RUN_ENTIRE_ENDPOINT:
				this.runEntireEndpoint();
				break;
			case Constants.SPARQL_QUERY_ENGINE_RUN_SINGLE_QUERY:
				this.runFailedQuery();
				break;
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Method to execute the class behaviour on a given endpoint to execute all
	 * the possible queries.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private void runEntireEndpoint() throws Exception {
		long timeEndpointStart = System.currentTimeMillis();
		this.queryOLDEndpoint(this.endpoint);
		long timeEndpointEnd = System.currentTimeMillis();
		logger.log("Time to process endpoint "
				+ this.endpoint.getName()
				+ ": "
				+ StaticUtils.convertSecondsToTime(new BigDecimal(
						((timeEndpointEnd - timeEndpointStart) / 1000))));
		this.endpoint.setSPOsRetrieved(true);
		this.logic.executeDumpJoiner();

	}

	/*************************************************************************************
	 ********************************** FAILED QUERIES METHODS ***************************
	 *************************************************************************************/

	/**
	 * Method to run the failed queries.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private void runFailedQuery() throws Exception {
		logger.log("Running failed query ["
				+ failedQuery.getEndpoint().getName() + "]["
				+ failedQuery.getStringType() + "].");
		this.endpoint = this.failedQuery.getEndpoint();
		ResultAndMessage result = null;
		switch (this.failedQuery.getType()) {
		case Constants.QUERY_SUBJECT:
			/*
			 * If the query failed obtaining the subjects, that mean that we
			 * have to query the entire endpoint.
			 */
			this.queryOLDEndpoint(this.failedQuery.getEndpoint());
			break;
		case Constants.QUERY_PREDICATE:
			result = runFailedQueryPredicates();
			break;
		case Constants.QUERY_OBJECT_DATA_TYPE:
			result = runFailedQueryObjectDataType();
			break;
		case Constants.QUERY_OBJECT_OBJECT_TYPE:
			result = runFailedQueryObjectObjectType();
			break;
		case Constants.QUERY_OBJECT_SPECIFIC_OBJECT_TYPE:
			result = runFailedQuerySpecificObjectType();
			break;
		}
		if (result.getResult()) {
			logger.log("Failed query ' " + this.failedQuery.getFileFailedQuery().getAbsoluteFile().toString() + "' executed correctly. Deleting..");
			this.failedQuery.getFileFailedQuery().delete();
			/*
			 * Si se ha ejecutado correctamente..
			 */
		}
		else {
			logger.log("Failed query ' " + this.failedQuery.getFileFailedQuery().getAbsoluteFile().toString() + "' was not executed correctly.");
			logger.log("Reason: " + result.getMessage());
		}
	}

	/**
	 * Method to query the endpoint to retrieve endpoints.. and continue.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private ResultAndMessage runFailedQueryPredicates() {
		try {
			FailedQueryPredicates fqp = (FailedQueryPredicates) this.failedQuery;
			ArrayList<Resource> predicates = this.getOLDPredicatesForSubject(
					fqp.getAssociatedSubject(),
					fqp.getAssociatedListOfSubjects());
			if (predicates.size() > 0) {
				logger.log("[" + this.endpoint.getName() + "]: "
						+ "Obtaining objects...");

				// Data types
				getOLDObjectDataTypes(fqp.getAssociatedListOfSubjects(),
						predicates);

				// Object types
				getOLDObjectObjectTypes(fqp.getAssociatedListOfSubjects(),
						predicates);
				return new ResultAndMessage(true);

			}
		} catch (Exception e) {
			String msg = "[" + this.endpoint.getName()
					+ "] Error running failed query predicates: "
					+ e.getMessage();
			logger.log(msg);
			return new ResultAndMessage(false, msg);
		}
		return new ResultAndMessage(true);
	}

	/**
	 * Method to query the endpoint to retrieve specific object types.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private ResultAndMessage runFailedQuerySpecificObjectType() {
		try {
			FailedQuerySpecificObjectObjectType fqsoot = (FailedQuerySpecificObjectObjectType) this.failedQuery;
			ArrayList<Resource> objectSpecificObjectTypes = getOLDSpecificObjectObjectTypes(
					fqsoot.getSourceEndpoint(), fqsoot.getDestinyEndpoint(),
					fqsoot.getAssociatedSubject(),
					fqsoot.getAssociatedPredicate(),
					fqsoot.getAssociatedObject());
			addSpecificObjectObjectTypes(objectSpecificObjectTypes,
					fqsoot.getAssociatedSubject(),
					fqsoot.getAssociatedPredicate(),
					fqsoot.getAssociatedObject());
		} catch (Exception e) {
			String msg = "[" + this.endpoint.getName()
					+ "] Error running failed query specific object type: "
					+ e.getMessage();
			logger.log(msg);
			return new ResultAndMessage(false, msg);
		}
		return new ResultAndMessage(true);
	}

	/**
	 * Method to query the endpoint to retrieve object object types.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private ResultAndMessage runFailedQueryObjectObjectType() {
		try {
			FailedQueryObjectObjectType fqoot = (FailedQueryObjectObjectType) this.failedQuery;
			ArrayList<Resource> objectObjectTypes = getOLDObjectObjectType(
					fqoot.getAssociatedSubject(),
					fqoot.getAssociatedPredicate());
			addObjectObjectTypesToEndpoint(objectObjectTypes,
					fqoot.getAssociatedSubject(),
					fqoot.getAssociatedPredicate());
		} catch (Exception e) {
			String msg = "[" + this.endpoint.getName()
					+ "] Error running failed query object object type: "
					+ e.getMessage();
			logger.log(msg);
			return new ResultAndMessage(false, msg);
		}
		return new ResultAndMessage(true);
	}

	/**
	 * Method to query the endpoint to retrieve object data types.
	 *
	 * @throws Exception
	 *             It can throws an exception.
	 */
	private ResultAndMessage runFailedQueryObjectDataType() {
		try {
			FailedQueryObjectDataType fqodt = (FailedQueryObjectDataType) this.failedQuery;
			ArrayList<RDFDatatype> objectDataTypes = getOLDObjectDataType(
					fqodt.getAssociatedSubject(),
					fqodt.getAssociatedPredicate());
			addObjectDataTypesToEndpoint(objectDataTypes,
					fqodt.getAssociatedSubject(),
					fqodt.getAssociatedPredicate());
		} catch (Exception e) {
			String msg = "[" + this.endpoint.getName()
					+ "] Error running failed query object data type: "
					+ e.getMessage();
			logger.log(msg);
			return new ResultAndMessage(false, msg);
		}
		return new ResultAndMessage(true);
	}

	/*************************************************************************************
	 ********************************** AUXILIAR METHODS *********************************
	 *************************************************************************************/

	/**
	 * Method to get a resource from string.
	 *
	 * @param v
	 *            Receives the string.
	 * @return Returns the object.
	 */
	private Resource getResourceFromString(String v) {
		OntModel om = ModelFactory.createOntologyModel();
		Resource r = om.createResource(v);
		return r;
	}

	/**
	 * Method to check if a query contains a filtered string.
	 *
	 * @param query
	 *            Result Query value.
	 * @param filters
	 *            The filters.
	 * @return Return a boolean.
	 */
	private boolean isFiltered(String queryResult, LinkedList<Filter> filters) {
		for (int i = 0; i < filters.size(); i++) {
			if (queryResult.contains(filters.get(i).getFilterField())) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Method to get the datatype from Querysolution toString() value
	 *
	 * @param qs
	 *            Receives the string
	 * @return Returns the value
	 */
	private String getDataFromQuerySolution(String qs) {
		String parts[] = qs.split("=");
		if (parts.length == 2) {
			String dt = parts[1];
			return StringUtils.substringBetween(dt, Character.toString('"'));
		}
		return null;
	}

	/**
	 * Method to check if the destiny endpoint is valid.
	 *
	 * @param dstEndpoint
	 *            Receives the endpoint.
	 * @return Returns true or false.
	 */
	private boolean isValidDestinyEndpoint(String dstEndpoint) {
		for (int i = 0; i < this.endpoints.size(); i++) {
			if (this.endpoints.get(i).getName().equalsIgnoreCase(dstEndpoint)) {
				return true;
			}
		}
		return false;
	}

	/**
	 * This method is for, given a resource object (in this form:
	 * http://openlifedata.org/merops_vocabulary:Resource) obtain the endpoint
	 * to the one which is pointing (in this case: merops).
	 *
	 * @param rsc
	 *            Receive the resource.
	 * @return Returns the value.
	 */
	private String getEndpointFromResourceObject(String rsc) {
		String partsRsc[] = rsc.split("/");
		if (partsRsc.length == 4) {
			String epAndRsc = partsRsc[3];
			// epAndRsc = merops_vocabulary:Resource
			String epAndRscParts[] = epAndRsc.split("_");
			if (epAndRscParts.length == 2) {
				return epAndRscParts[0];
			}
		}
		return null;
	}

	/**
	 * Method to get the filters from the string (csv format).
	 *
	 * @param queryFilters
	 *            The string.
	 * @return The list of filters.
	 */
	private LinkedList<Filter> getFilters(String queryFilters) {
		LinkedList<Filter> filters = new LinkedList<Filter>();
		if (!StaticUtils.isEmpty(queryFilters)) {
			String parts[] = queryFilters.split(Constants.COMMA_SEPARATOR);
			for (int i = 0; i < parts.length; i++) {
				filters.add(new Filter(parts[i]));
			}
		}
		return filters;
	}

	/**
	 * Method to save a dump of the SPOs of an endpoint
	 *
	 * @param ep
	 *            Receives the endpoint
	 * @throws Exception
	 *             Throws exception.
	 */
	private void saveEndpointSPOs(Endpoint ep) throws Exception {
		String file = "endpointsdump/" + ep.getName() + ".dump";
		BufferedWriter bW = new BufferedWriter(new FileWriter(file));
		if (ep.getSPOs().size() > 0) {
			for (int i = 0; i < ep.getSPOs().size(); i++) {
				SPO spo = ep.getSPOs().get(i);
				bW.write(ep.getName() + "\t" + spo.getSubject() + "\t"
						+ spo.getPredicate() + "\t" + spo.getObject());
				bW.newLine();
			}
		} else {
			bW.write("NO SPOS");
			bW.newLine();
		}
		bW.close();
	}

	/**
	 * Method to load a query from an external file doing some replacements on
	 * the data.
	 *
	 * @param f
	 *            Receives the file.
	 * @param subs
	 *            List of replacements.
	 * @return Return the final query.
	 * @throws Exception
	 *             It can throw an exception.
	 */
	private String loadQueryFromFileWithSubstitutions(String f,
			ArrayList<Substitution> subs) throws Exception {
		String query = "";
		BufferedReader bL = new BufferedReader(new FileReader(f));
		while (bL.ready()) {
			String read = bL.readLine();
			Substitution sub = getSubstituion(read, subs);
			if (sub != null) {
				read = read.replace(sub.getOriginalString(),
						sub.getReplacedString());
			}
			query += read + "\r\n";
		}
		bL.close();
		return query;
	}

	/**
	 * Method to, given a concrete string readed in the file, knows if contains
	 * the pattern that needs to be replaced.
	 *
	 * @param read
	 *            Original string readed.
	 * @param subs
	 *            List of possible replacements.
	 * @return Return the object with the replacement (if found)
	 */
	private Substitution getSubstituion(String read,
			ArrayList<Substitution> subs) {
		// System.out.println("read: " + read);
		for (int i = 0; i < subs.size(); i++) {
			String origStr = subs.get(i).getOriginalString();
			// System.out.println("\t to replace: " + origStr);
			if (read.trim().contains(origStr.trim())) {
				// System.out.println("\t REPLACE!: " + origStr);
				return subs.get(i);
			}
		}
		return null;
	}

	public void setSPOQuery(Endpoint endpoint) {
		this.endpoint = endpoint;
	}

	public void setLogic(Logic l) {
		this.logic = l;
	}
}


text:
export type SaveObjectsOptions = {
  /**
   * If the object id should be generated when does not exists.
   */
  readonly autoGenerateObjectIDIfNotExist?: boolean;
};


text:
import styles from './styles';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import routerStore from 'stores/routerStore';
import localize from 'hocs/localize';
import { Icon } from 'antd';
import { Form, Input, Submit } from 'components/Form';

@localize('LoginForm')
@observer
export default class LoginForm extends Component {
	static propTypes = {
		localeStore: PropTypes.object.isRequired,
		fields: PropTypes.arrayOf(
			PropTypes.shape({
				name: PropTypes.string.isRequired,
				icon: PropTypes.string,
				placeholder: PropTypes.string,
				required: PropTypes.bool,
			})
		),
	};

	static defaultProps = {
		fields: [],
	};

	static contextTypes = {
		appConfig: PropTypes.object,
		authStore: PropTypes.object,
	};

	state = { isValid: true, isPosting: false };

	async _submit(data) {
		const {
			context: {
				authStore,
				appConfig: {
					auth: { defaultLoginRedirection },
				},
			},
		} = this;

		this.setState({ isPosting: true });
		const isOk = await authStore.login(data);
		this.setState({ isPosting: false });

		if (isOk) {
			const { ref } = routerStore.location.query;
			const url = ref || defaultLoginRedirection;
			routerStore.history.replace(url);
		}
	}

	_handleValid = () => {
		this.setState({ isValid: true });
	};

	_handleInvalid = () => {
		this.setState({ isValid: false });
	};

	_handleSubmit = (data) => {
		this._submit(data);
	};

	render() {
		const {
			state: { isValid, isPosting },
			props: { localeStore, fields, ...props },
		} = this;
		return (
			<Form
				onSubmit={this._handleSubmit}
				onValid={this._handleValid}
				onInvalid={this._handleInvalid}
				{...props}
			>
				{fields.length > 0 ? (
					fields.map(({ icon, ...restProps }, index) => (
						<Input
							key={index}
							{...restProps}
							prefix={<Icon type={icon} style={styles.icon} />}
						/>
					))
				) : (
					<Input
						required
						name="username"
						prefix={<Icon type="user" style={styles.icon} />}
						placeholder={localeStore.data.usernamePlaceholder}
					/>
				)}
				<Input
					required
					name="password"
					type="password"
					prefix={<Icon type="lock" style={styles.icon} />}
					placeholder={localeStore.data.passwordPlaceholder}
				/>
				<Submit
					type="primary"
					style={styles.button}
					wrapperStyle={styles.buttonWrapper}
					disabled={!isValid}
					loading={isPosting}
				>
					{localeStore.data.login}
				</Submit>
			</Form>
		);
	}
}


text:
package pl.altkom.ogoreczek.model;

import java.util.Date;

/**
 *
 * @author Your Name <Ewa Milewska>
 */
public class Platnosc {
    private Date data;
    private double kwota;
    private Zamowienie Zamowienie;
    private Waluta waluta;
    private SposobPlatnosci sposobPlatnosci;
    private boolean czyPrzeterminowana;

    public Date getData() {
        return data;
    }

    public double getKwota() {
        return kwota;
    }

    public pl.altkom.ogoreczek.model.Zamowienie getZamowienie() {
        return Zamowienie;
    }

    public Waluta getWaluta() {
        return waluta;
    }

    public SposobPlatnosci getSposobPlatnosci() {
        return sposobPlatnosci;
    }

    public boolean isCzyPrzeterminowana() {
        return czyPrzeterminowana;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public void setKwota(double kwota) {
        this.kwota = kwota;
    }

    public void setZamowienie(Zamowienie Zamowienie) {
        this.Zamowienie = Zamowienie;
    }

    public void setWaluta(Waluta waluta) {
        this.waluta = waluta;
    }

    public void setSposobPlatnosci(SposobPlatnosci sposobPlatnosci) {
        this.sposobPlatnosci = sposobPlatnosci;
    }

    public void setCzyPrzeterminowana(boolean czyPrzeterminowana) {
        this.czyPrzeterminowana = czyPrzeterminowana;
    }

}


text:
package org.qirx.cms.machinery

import scala.language.higherKinds
import org.qirx.cms.construction.Branch

trait BranchEnhancements {

  private type Lift[F[_], B] = Branch[B]#T ~> F

  def branch[F[_], A, B, O[_]](p1: Program[F, A], p2: => Program[F, B])(
    stayLeft: A => Boolean)(implicit lift: Lift[F, B]): Program[F, A] = {
    val value: Program[F, Either[A, B]] =
      p1.flatMap {
        case a if stayLeft(a) => Result(Left(a))
        case _ => p2 map Right.apply
      }
    value.flatMap(value => Program(lift(Branch[B].Instance(value))))
  }

  implicit class BooleanContinuation[P, F[_]](program1: P)(
    implicit p: ProgramType[F],
    asBooleanProgram: P => Program[F, Boolean]) {

    def ifFalse[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      branch(program1, program2)(stayLeft = identity)

    def ifTrue[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      branch(program1, program2)(stayLeft = !_)
  }

  implicit class OptionContinuation[P, F[_], O, A](program1: P)(
    implicit p: ProgramType[F],
    asOptionProgram: P => Program[F, O],
    isOption: O => Option[A]) {

    def ifNone[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      for {
        result <- branch(program1, program2)(stayLeft = _.isDefined)
      } yield result.get

    def ifSome[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      for {
        result <- branch(program1, program2)(stayLeft = _.isEmpty)
      } yield result
  }

  implicit class IterableContinuation[P, F[_], I, A](program1: P)(
    implicit p: ProgramType[F],
    asIterableProgram: P => Program[F, I],
    isIterable: I => Iterable[A]) {

    def ifNonEmpty[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      branch(program1, program2)(stayLeft = _.isEmpty)

    def ifEmpty[B](program2: => Program[F, B])(implicit l: Lift[F, B]) =
      branch(program1, program2)(stayLeft = _.nonEmpty)
  }

  /**
   * It is now required that the branch is located at the head of the Coproduct.
   * Theoretically we could write a transformation that moves the branch to the
   * front of the Coproduct or alternatively a way where it does not matter
   * where the branch is located. For now it was too complicated and not a real
   * anoying problem.
   */
  implicit class CoproductWithBranchEnhancements[F[_], A, In[_], Out[_]](
    program: Program[In, A])(implicit withBranchAtHead: In ~> Co[Branch[A]#T, Out]#T) {

    def mergeBranch: Program[Out, A] =
      program match {
        case Result(a) => Result(a)
        case x @ SuspendedAndThen(fa, f) =>
          withBranchAtHead(fa).value match {
            case Left(branch) =>
              branch.value match {
                case Left(any) => f(any).mergeBranch
                case Right(t) => Result(t)
              }
            case Right(withoutBranch) =>
              Program(withoutBranch).flatMap(f andThen (_.mergeBranch))
          }
      }
  }
}


text:
import babel from 'rollup-plugin-babel';
import babelrc from 'babelrc-rollup';
import istanbul from 'rollup-plugin-istanbul';

let pkg = require('./package.json');
let external = Object.keys(pkg.dependencies);

export default {
  entry: 'lib/index.js',
  plugins: [
    babel(babelrc()),
    istanbul({
      exclude: ['test/**/*', 'node_modules/**/*']
    })
  ],
  globals: {
    bottlejs: 'Bottle'
  },
  external: external,
  targets: [
    {
      dest: pkg.main,
      format: 'umd',
      moduleName: 'lanternCore',
      sourceMap: true
    },
    {
      dest: pkg.module,
      format: 'es',
      sourceMap: true
    }
  ]
};


text:
using System;
using Gtk;

namespace Hyena.Widgets
{
    public class WrapLabel : Widget
    {
        private string text;
        private bool use_markup = false;
        private bool wrap = true;
        private Pango.Layout layout;

        public WrapLabel ()
        {
            WidgetFlags |= WidgetFlags.NoWindow;
        }

        private void CreateLayout ()
        {
            if (layout != null) {
                layout.Dispose ();
            }

            layout = new Pango.Layout (PangoContext);
            layout.Wrap = Pango.WrapMode.Word;
        }

        private void UpdateLayout ()
        {
            if (layout == null) {
                CreateLayout ();
            }

            layout.Ellipsize = wrap ? Pango.EllipsizeMode.None : Pango.EllipsizeMode.End;

            if (text == null) {
                text = "";
            }

            if (use_markup) {
                layout.SetMarkup (text);
            } else {
                layout.SetText (text);
            }

            QueueResize ();
        }

        protected override void OnStyleSet (Style previous_style)
        {
            CreateLayout ();
            UpdateLayout ();
            base.OnStyleSet (previous_style);
        }

        protected override void OnRealized ()
        {
            GdkWindow = Parent.GdkWindow;
            base.OnRealized ();
        }

        protected override void OnSizeAllocated (Gdk.Rectangle allocation)
        {
            int lw, lh;

            layout.Width = (int)(allocation.Width * Pango.Scale.PangoScale);
            layout.GetPixelSize (out lw, out lh);

            HeightRequest = lh;

            base.OnSizeAllocated (allocation);
        }

        protected override bool OnExposeEvent (Gdk.EventExpose evnt)
        {
            if (evnt.Window == GdkWindow) {
                // Center the text vertically
                int lw, lh;
                layout.GetPixelSize (out lw, out lh);
                int y = Allocation.Y + (Allocation.Height - lh) / 2;

                Gtk.Style.PaintLayout (Style, GdkWindow, State, false,
                    evnt.Area, this, null, Allocation.X, y, layout);
            }

            return true;
        }

        public void MarkupFormat (string format, params object [] args)
        {
            if (args == null || args.Length == 0) {
                Markup = format;
                return;
            }

            for (int i = 0; i < args.Length; i++) {
                if (args[i] is string) {
                    args[i] = GLib.Markup.EscapeText ((string)args[i]);
                }
            }

            Markup = String.Format (format, args);
        }

        public bool Wrap {
            get { return wrap; }
            set {
                wrap = value;
                UpdateLayout ();
            }
        }

        public string Markup {
            get { return text; }
            set {
                use_markup = true;
                text = value;
                UpdateLayout ();
            }
        }

        public string Text {
            get { return text; }
            set {
                use_markup = false;
                text = value;
                UpdateLayout ();
            }
        }
    }
}


text:
using namespace std;

int t , num_node , num_edge, k, x, y;
map<int, map<int, int> > edges;
map<int, int> searched_vertex;
vector<int> cover;
int minimum;

void addEdge(int v, int w){
    edges[v][w] = 1;
    edges[w][v] = 1;
}
void remove_degree_one(map<int, map<int, int> > &edges, map<int, int> &searched_vertex, int &checked_vertex, int &checked_edge){

    int length = 0;
    int temp = 0;
    bool flag = true;
    while (flag){
        flag = false;

        for (map<int, map<int, int> >::iterator iter = edges.begin(); iter != edges.end(); ){
            length = int(iter->second.size());
            if (length == 1){
                temp = iter->second.begin()->first;
                //若该点没被检查过,则检查过的点数加1
                if (searched_vertex.count(temp) == 0){
                    checked_vertex ++;
                }
                searched_vertex[temp] = 1;

                //删除相关的边
                for (map<int, int>::iterator iter1 = edges[temp].begin(); iter1 != edges[temp].end();){
                    edges[iter1->first].erase(temp);
                    checked_edge ++;
                    edges[temp].erase(iter1 ++);
                }

                //删除该边和该点
                edges.erase(iter++);
                flag = true;
            }else if(length == 0) {
                edges.erase(iter ++);
            }else {
                ++ iter;
            }
        }
    }

}

void dfs(int start, int *minimum, map<int, int> &searched_vertex, map<int, map<int, int> > &edges,int checked_vertex, int checked_edge){
    searched_vertex[start] = 1;
    //剪枝:如果加上该点已经比minimum多,则不可能比minimum更优
    if( checked_vertex + 1 >= *minimum){
        searched_vertex.erase(start);
        return ;
    }

    //若加入该点后覆盖了所有的边
    if(checked_edge + edges[start].size() == num_edge){
        if (checked_vertex + 1 < *minimum) {
            *minimum = checked_vertex + 1;
            cover.clear();
            for (map<int, int>::iterator iter = searched_vertex.begin(); iter != searched_vertex.end(); iter ++) {
                cover.push_back(iter->first);
            }
        }
        searched_vertex.erase(start);
        return;
    }
    //存储修改后的变量
    map<int, map<int, int> > temp_edges, temp_edges_not;
    map<int, int> temp_searched, temp_searched_not;

    int temp_checked_vertex = checked_vertex, temp_checked_vertex_not = checked_vertex;
    int temp_checked_edge = checked_edge, temp_checked_edge_not = checked_edge;

    for (map<int, map<int, int> >::iterator iter = edges.begin(); iter != edges.end(); iter ++) {
        temp_edges[iter->first] = iter->second;
        temp_edges_not[iter->first] = iter->second;
    }
    for (map<int, int>::iterator iter = searched_vertex.begin(); iter != searched_vertex.end(); iter ++) {
        temp_searched[iter->first] = iter->second;
        temp_searched_not[iter->first] = iter->second;
    }

    //若使用该点
    ++temp_checked_vertex;
    temp_checked_edge += edges[start].size();
    //删除所有与该点相连的边
    for (map<int, int>::iterator iter = edges[start].begin(); iter != edges[start].end(); iter ++) {
        temp_edges[iter->first].erase(start);
    }
    temp_edges.erase(start);

    remove_degree_one(temp_edges, temp_searched, temp_checked_vertex, temp_checked_edge);
    //如果找到了所有的边
    if (temp_checked_edge == num_edge) {
        if (temp_checked_vertex < *minimum) {
            *minimum = temp_checked_vertex;
            cover.clear();
            for (map<int, int>::iterator iter = temp_searched.begin(); iter != temp_searched.end(); iter ++) {
                cover.push_back(iter->first);
            }
        }
        searched_vertex.erase(start);
        return;
    }
    //寻找下一个度数最大的点
    int temp_start = 0, temp_max_degree = 0, temp_second_max_degree = 0;
    for (map<int, map<int, int> >::iterator iter = temp_edges.begin(); iter != temp_edges.end(); iter ++) {
        if (temp_searched.count(iter->first) == 0) {
            int temp_degree = int(iter->second.size());
            if (temp_degree > temp_max_degree) {
                temp_start = iter->first;
                temp_second_max_degree = temp_max_degree;
                temp_max_degree = temp_degree;
            }else if (temp_degree > temp_second_max_degree){
                temp_second_max_degree = temp_degree;
            }
        }
    }
    //如果当前最大的结点的度,加上(当前第二大结点的度*(当前最优解-当前已探索过的结点-2))仍然小于未消除过的边的数目,那么就不用继续探索了,因为不可能得到更优解了。
    int temp;
    if (*minimum - temp_checked_vertex <= 2) {
        temp = temp_max_degree * (*minimum - temp_checked_vertex - 1);
    }else{
        temp = temp_max_degree + temp_second_max_degree * (*minimum - temp_checked_vertex - 2);
    }
    if (temp >= num_edge - temp_checked_edge) {
        dfs(temp_start, minimum, temp_searched, temp_edges, temp_checked_vertex, temp_checked_edge);
    }

    //若不用该点,则所有与该点相邻的点都要使用
    temp_searched_not.erase(start);

    for (map<int, int>::iterator iter = edges[start].begin(); iter != edges[start].end(); iter++){
        temp_searched_not[iter->first] = 1;
        ++temp_checked_vertex_not;

        for (map<int, int>::iterator iter1 = edges[iter->first].begin(); iter1 != edges[iter->first].end(); iter1 ++){
            // 如果该边还未在之前其他点的时候被删除
            if (temp_edges_not.count(iter1->first) > 0){
                temp_edges_not[iter1->first].erase(iter->first);
                temp_edges_not[iter->first].erase(iter1->first);
                ++temp_checked_edge_not;
            }
        }
        temp_edges_not.erase(iter->first);
    }
    // 处理度为1的点
    remove_degree_one(temp_edges_not, temp_searched_not, temp_checked_vertex_not, temp_checked_edge_not);

    // 如果找到了所需要的边数
    if (temp_checked_edge_not == num_edge){
        if (temp_checked_vertex_not < *minimum){
            *minimum = temp_checked_vertex_not;
            cover.clear();
            for (map<int, int>::iterator iter = temp_searched_not.begin(); iter != temp_searched_not.end(); iter++)
                cover.push_back(iter->first);
        }
        searched_vertex.erase(start);
        return;
    }
    // 寻找下一个最大度数的点
    temp_start = 0, temp_max_degree = 0, temp_second_max_degree = 0;
    for (map<int, map<int, int> >::iterator iter = temp_edges_not.begin(); iter != temp_edges_not.end(); iter++){
        if (temp_searched_not.count(iter->first) == 0){
            int temp_degree = int(iter->second.size());
            if (temp_degree > temp_max_degree){
                temp_start = iter->first;
                temp_second_max_degree = temp_max_degree;
                temp_max_degree = temp_degree;
            } else if (temp_degree > temp_second_max_degree) {
                temp_second_max_degree = temp_degree;
            }
        }
    }
    if (*minimum - temp_checked_vertex <= 2)
    {
        temp = temp_max_degree * (*minimum - temp_checked_vertex -1);
    }
    else
    {
        temp = temp_max_degree + temp_second_max_degree * (*minimum - temp_checked_vertex - 2);
    }
    if (temp >= num_edge - temp_checked_edge){
        dfs(temp_start, minimum, temp_searched_not, temp_edges_not, temp_checked_vertex_not, temp_checked_edge_not);

    }
    searched_vertex.erase(start);
    return;

}

int main()
{

    cin >> t;
    int checked_vertex, checked_edge;

    for(int i = 0; i < t; i++){
	//cout << t << endl;
		edges.clear();
		searched_vertex.clear();
		minimum = 0;
		checked_vertex = 0;
		checked_edge = 0;

		cin >> num_node;
		cin >> num_edge;
		cin >> k;
		for(int j = 0; j < num_edge; j++){
		    cin >> x;
		    cin >> y;

		    addEdge(x, y);
		}

		//remove one degree node
        remove_degree_one(edges, searched_vertex, checked_vertex, checked_edge);

        int minimum = k + 1;

        //如果所有的边都已经去掉了
        if(checked_edge == num_edge){
            if (checked_vertex < minimum){
                minimum = checked_vertex;
                cover.clear();
                for (map<int, int>::iterator iter = searched_vertex.begin(); iter != searched_vertex.end(); iter ++ ) {
                    cover.push_back(iter->first);
                }
            }
        }else{
            //还有边没有覆盖,找到度最大的点,进行处理
            int tmp_start = 0;
            int tmp_max_degree = 0;
            for (map<int, map<int, int> >::iterator iter = edges.begin(); iter != edges.end(); iter ++){
                if (searched_vertex.count(iter->first) == 0) {
                    int tmp_degree = int(iter->second.size());
                    if (tmp_degree > tmp_max_degree){
                        tmp_max_degree = tmp_degree;
                        tmp_start = iter->first;
                    }
                }
            }
            //从度最大的点开始做dfs
            dfs(tmp_start, &minimum, searched_vertex, edges, checked_vertex, checked_edge);

        }
        if (minimum > k) {
            cout<<"-1"<<endl;
        }else{
            cout<<minimum <<endl;
            vector<int>::iterator iter;
            for(iter = cover.begin(); iter != cover.end(); iter ++){
                cout << *iter << " ";
            }
            cout << endl;
        }

	}
    return 0;
}


text:
var app = angular.module('disasterMaps', ['ui.router', 'appControllers',
    'appServices', 'uiGmapgoogle-maps',
    'geolocation']);

app.config(function($stateProvider, $urlRouterProvider,$httpProvider) {

    $urlRouterProvider.otherwise('/');

    $stateProvider
        .state('home', {
            url: '/',
            templateUrl: 'static/partials/partial-map.html',
            controller: 'mapController'
        });

});


text:
'use strict';

import React from 'react'
import { Route, IndexRoute } from 'react-router'
import Layout from './components/Layout';
import IndexPage from './components/IndexPage';
import Lookup from './components/Lookup';

const routes = (
  <Route path="/" component={Layout}>
    <IndexRoute component={IndexPage}/>
    <Route path="/lookup" component={Lookup} />
  </Route>
);

export default routes;


text:
name        "elasticsearch_peer"
description "[Infochimps internal] Data esnode (holds and indexes data) for elasticsearch cluster."

# List of recipes and roles to apply
run_list(*%w[
  cluster_chef::dedicated_server_tuning
  elasticsearch::build_raid
  elasticsearch::default
  elasticsearch::install_from_release
  elasticsearch::install_plugins
  elasticsearch::server
  elasticsearch::http
])


text:
title: Predictive text input in Web applications
sidebar: flexberry-aspnet_sidebar
keywords: Flexberry ASP-NET
toc: true
permalink: en/fa_predict-input-web.html
lang: en
autotranslated: true
hash: 4e2014c4044c4f01d4d4c0b18116b977629e9d937dce2df60e0a54f2f3a95a48
---

## setting predictive LookUp's

To add to the LookUp predictive, you must:

1. [E-view](fd_e-view.html) object to specify the master type LookUp'a `standart` and specify the property of the master, which will be the search for predictive
2. To generate objects
3. To compile the objects
4. Generate ASP.NET app

__Note__: [method](fw_predict-input.html), is described for Windows-based applications will work for the Web.

## configuring E-class representation

To turn a regular LookUp in the LookUp with predictive input, you must specify the master type used LookUp'a.

1.Open the E-representation of the object and highlight the added master, to be used with predictive

![](/images/pages/products/flexberry-aspnet/controls/lookup/select-master-web.png)

2.In the field `Тип лукапа` specify `standart`

![](/images/pages/products/flexberry-aspnet/controls/lookup/select-type-web.png)

3.In the field `Свойство мастера` to specify the name of the property which will be the search for predictive.

__Note__: the property master should be in view. The name of the property is entered from the keyboard.

![](/images/pages/products/flexberry-aspnet/controls/lookup/select-property-web.png)

4.Save changes

### Result

![](/images/pages/products/flexberry-aspnet/controls/lookup/predict-lookup-web.gif)

## Principles of selection values

Values are selected from a field of the wizard, you selected when setting up. Searched for values containing the substring entered by the user. Implemented advanced search for occurrences of the words.

Suppose that we are given a list:

```csharp
1) слово
2) пара слов
3) целых три слова
4) триангуляция слова
5) парад слов
```

The user enters `три слов` is 3), 4)

In fact, the request of like `%three words%` looks like `%three%words%`.

![](/images/pages/products/flexberry-aspnet/controls/lookup/predict.png)

Read more about search by a substring you can see [in MasterEditorAjaxLookUp] (fa_master-editor-ajax-lookup.html).

## Predictive in Windows applications

[Predictive typing in Windows applications](fw_predict-input.html)


text:
<?php

namespace Gpupo\SubmarinoSdk\Entity\Product;

use Gpupo\CommonSdk\Entity\FactoryAbstract;

class Factory extends FactoryAbstract
{
    public static function factorySku($data = null)
    {
        return new Sku\Sku($data);
    }

    public static function factoryPrice($data = null)
    {
        return new Sku\Price($data);
    }
}


text:
namespace Binsor.Presentation.Framework.Interfaces
{
	public interface IPresenter
	{
	}
}


text:
TheGame
=======

Information system


text:
Workshops should consist of two primary pieces:

1. A README.md.
2. Link to public Google Slides deck.

## README.md

This is the core "lab" section of the workshop. This will contain all
the steps and commands needed to complete the module. The lab should
be concise and easy to skim to the actions you need to take. Feel
free to have explanatory text, but limit text using:

* Don't cover information not relevant to the actual commands or
  activities being run in the workshop. Avoid notes directing people
  to other places, etc.
* Try to guide people through one known good path leading to where we
  are going, not covering all the options for alternate paths.
* Text should have limited explanation of new concepts to
  progress through the workshop.

## Slides

The slides are supplemental to completing the module, but essential to
learning the concepts. This is where the teaching part of the workshop
happens. Here you can explain in more detail the actions of the
workshop, have diagrams of the deployment, and explain concepts.

## Orthogonal

The lab and slides should be somewhat orthogonal, One could go through
the lab successfully on its on, but maybe not understand fully what is
happening. Also, one could present the slides on their own as a lecture
to teach the concepts and architecture explored in the workshop
module.

# Delivery Guidelines

* The workshop modules can be put together in various combinations, so
  you'll need your own introduction and agenda slides.
* Create a slack channel for the workshop to allow feedback and collaboration.
* People can create github issues and/or PRs during the event.


text:
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainTestWindow w;
    w.show();

    QTextOption l_opt;
    l_opt.setAlignment(Qt::AlignCenter);

    QLabel myLabel1;
    myLabel1.setPixmap(APPSHOT::AppShot::generateImageFromQProperty( &w, "objectName", l_opt ));

    myLabel1.show();

    QLabel myLabel2;
    myLabel2.setPixmap(APPSHOT::AppShot::generateImageFromQProperty( &w, "testProperty" ));

    myLabel2.show();

    QLabel myLabel;

    APPSHOT::AppShotToolTip t;
    QPen l_Pen;
    l_Pen.setWidth(2);
    l_Pen.setColor(QColor("grey"));
    l_Pen.setStyle(Qt::DashDotDotLine);
    t.setPen(l_Pen);
    t.setTextPen(l_Pen);
    myLabel.setPixmap(t.generate(&w));

    myLabel.show();

    return a.exec();
}


text: @import url(https://rawgit.com/intrnl/discordAdditions/master/betterCategories/themefile.css);