text:
<?php

/*
	Section: Current Version

	xajax version 0.5
*/

/*
	Section: Copyright

	- copyright (c) 2005-2007 by Jared White & J. Max Wilson
	- copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
*/

/*
	Section: Description

	xajax is an open source PHP class library for easily creating powerful
	PHP-driven, web-based Ajax Applications. Using xajax, you can asynchronously
	call PHP functions and update the content of your your webpage without
	reloading the page.
*/

/*
	Section: License

	xajax is released under the terms of the BSD license
	http://www.xajaxproject.org/bsd_license.txt
*/

/*
	@package xajax
	@version $Id: copyright.inc.php 327 2007-02-28 16:55:26Z calltoconstruct $
	@copyright (c) 2005-2007 by Jared White & J. Max Wilson
	@copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
	@license http://www.xajaxproject.org/bsd_license.txt BSD License
*/

/*
	Section: Online documentation

	Online documentation for this class is available on the xajax wiki at:
	http://xajaxproject.org/en/docs-tutorials/
*/


text:
// vocabulary.cpp: Definition of Vocabulary class (i.e. codebook of FAB-MAP)
#include "vocabulary.h"

Vocabulary *Vocabulary::vocabInstance = 0;

/**
 * Constructor, load vocabulary and marginals
 */
Vocabulary::Vocabulary(const std::string& vocabPath, const std::string& margsPath)
{
    loadVocab(vocabPath);
    loadMargs(margsPath);
}

bool Vocabulary::writeCvStyle(const std::string &filename, const cv::Mat &vocabulary)
{
    std::cout << "Saving vocabulary..." << std::endl;
    cv::FileStorage fs( filename, cv::FileStorage::WRITE );
    if( fs.isOpened() )
    {
        fs << "vocabulary" << vocabulary;
        return true;
    }
    return false;
}

/**
 * Macro for singleton instance();
 *
 * @return Vocabulary*
 */
Vocabulary *Vocabulary::instance()
{
    if (!vocabInstance)
        vocabInstance = new Vocabulary(resources::vocabPath, resources::margsPath);

    return vocabInstance;
}

/**
 * Load vocabulary, get the id of each word and its descriptor
 *
 * vocabulary is Oxford style, it is actually the vocabulary of Cummins
 * in Fab-Map, consisting of 11000 words of 128 dim. features
 *
 * @param string vocabPath
 * @return void
 */
void Vocabulary::loadVocab(const std::string &vocabPath)
{
    std::ifstream vocabFile(vocabPath.c_str());

    if (!vocabFile.is_open())
        throw std::invalid_argument("Vocabulary file could not be opened!");

    std::string strSize;
    getline(vocabFile, strSize); // first line of the file is vocab size: "WORDS:XXXXX\n"

    // chomp string to read vocab size
    _size = atoi(strSize.substr(strSize.find(':')+1, strSize.size()-strSize.find(':')-2).c_str());

    std::string tmpString;
    char tmpChar;

    // skip second line in vocab file
    getline(vocabFile, tmpString);

    words = cv::Mat::zeros(this->size(), config::DESC_SIZE, CV_32F);

/**/
    // read each word and save it along with its descriptor
    for (size_t j=0; j<this->size() && vocabFile.good(); ++j)
    {
        getline(vocabFile, tmpString); // skip label ("WORD:XXXXX\n")

        // read descriptor
        float d;
        for (size_t i=0; i<config::DESC_SIZE; ++i)
        {
            vocabFile >> d;
            words.at<float>(j,i) = d; // Fill words
        }

        vocabFile >> tmpChar; // skip '\n'
    }

    vocabFile.close();

    // add all words and train vocabulary
    matcher.add(std::vector<cv::Mat>(1, words));
    matcher.train();
}

/**
 * Load marginal probability of the words in vocabulary.
 * This file is provided by Cummins' FabMap too.
 *
 * @param string
 * @return void
 */
void Vocabulary::loadMargs(const std::string &margsPath)
{
    std::ifstream margsFile(margsPath.c_str());

    if ( !margsFile.is_open() )
        throw std::invalid_argument("Marginals file could not be opened!");

    float d;
    char tmpChar; // used to skip '\n'

    marginals.reserve(this->size());
    invFreqs.reserve(this->size()); // use for tf-idf score

    // Read marginal probability of each word
    for (size_t i=0; i<this->size(); i++)
    {
        margsFile >> d >> tmpChar;
        marginals.push_back(d);
        invFreqs.push_back(log(1./d));
    }

    margsFile.close();
}

redpajama_set_name: RedPajamaGithub


text:
<link rel="stylesheet" type="text/css" href="bookview.css">

The Girl of My Dreams

 -by
Durjoy Dutta

We are in the car. She's looking at me. I can see the love in her eyes for me. Then a huge crash. She's flung out of the window. I'm thrown out too. A pool of blood. Her eyes are still on me... but now it's a death stare. I am Daman and I wake up to this nightmare. Every. Single. Day.

Waking up from a long coma, Daman learns that he was in a massive car crash with a girl who vanished soon after the accident, leaving him for dead.

Strangely, all he remembers is a hazy face, her hypnotic eyes, and her name—Shreyasi. To come to terms with his memory lapse he starts piecing together stories about himself and Shreyasi from his dreams, which he then turns into a hugely popular blog.

When he's offered a lucrative publishing deal to convert his blog pieces into a novel, he signs up immediately. However, he gives in to editorial pressure and agrees to corrupt the original edgy character of Shreyasi.

Big mistake.

From then on Daman is stalked and threatened by a terrifying beauty who claims to be Shreyasi and who will stop at nothing to make him pay for being a sell-out. Before Daman fights back, he needs to know: Is she really who she claims to be? What does she want from him now? What if he doesn't do what she wants him to?

The Girl of My Dreams is definitely not your usual love story.

It is available in Paperback form and can be ordered at our website.

About the author:

Durjoy Datta was born in New Delhi, India, and completed a degree in engineering and business management before embarking on a writing career. His first book—Of Course I Love You!—was published when he was twenty-one years old and was an instant bestseller. His successive novels—Now That You're Rich!; She Broke Up, I Didn't!; Ohh Yes, I Am Single!; You Were My Crush; If It's Not Forever; Till the Last Breath; Someone Like You; Hold My Hand; When Only Love Remains; World's Best Boyfriend; Our Impossible Love—have also found prominence on various bestseller lists, making him one of the highest-selling authors in India.
Durjoy also has to his credit nine television shows and has written over a thousand episodes for television.

<button id="myButton" class="float-left submit-button" >Add to cart</button>

Paperback: 288 pages
Publisher: Penguin Random House India (15 October 2016)
Language: English
ISBN-10: 0143424629
ISBN-13: 978-0143424628


text:
module.exports = {
  handler: (req, res) => {
    console.log(req.body);
    res.end(JSON.stringify(req.body));
  },
};


text:
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.jerry;

/**
 * Callback function for iterating nodes.
 */
public interface JerryFunction {

	/**
	 * Invoked on node. Returns true to continue looping.
	 */
	boolean onNode(Jerry $this, int index);
}


text:
#pragma once

#include <string>
#include <mraa/aio.hpp>
#include "grovebase.hpp"
#include <interfaces/iTemperature.hpp>

namespace upm {

/**
 * @deprecated This class is being replaced by the upm-temperature library and
 * the Temperature class.
 * @library grove
 * @sensor grovetemp
 * @comname Temperature Sensor
 * @type temp
 * @man seeed
 * @con analog
 * @kit gsk
 *
 * @brief API for the Grove Temperature Sensor
 *
 * Basic UPM module for the Grove temperature sensor on analog. This sensor
 * uses a thermistor to measure ambient temperature. The conversion formula has
 * been updated to work with versions 1.1 and 1.2 of the sensor. For the older
 * v1.0 sensor you will have to specify R0 and B values when initializing the
 * device. The range of this sensor is -40 to 125 C and accuracy is +/- 1.5 C.
 *
 * @image html grovetemp.jpg
 * @snippet grove-grovetemp.cxx Interesting
 */
class GroveTemp: public Grove, virtual public iTemperature {
    public:
        /**
         * Grove analog temperature sensor constructor
         *
         * @param pin Analog pin to use
         * @param scale Scaling factor for raw analog value from the ADC,
         * useful for mixed 3.3V/5V boards, default 1.0
         * @param r0 zero power resistance, this is 100K (default) for
         * v1.1-v1.2 and 10K for v1.0 of the sensor
         * @param b thermistor nominal B constant, this is 4275 (default) for
         * v1.1-v1.2 and 3975 for v1.0 of the sensor
         */
        GroveTemp(unsigned int pin, float scale = 1.0, int r0 = 100000, int b = 4275);
        /**
         * GroveTemp destructor
         */
        ~GroveTemp();
        /**
         * Gets the raw value from the AIO pin
         *
         * @return Raw value from the ADC
         */
        float raw_value();
        /**
         * Gets the temperature in Celsius from the sensor
         *
         * @return Normalized temperature in Celsius
         */
        int value();

        virtual float getTemperature();
    private:
        mraa_aio_context m_aio;
        float m_scale;
        int m_r0;
        int m_b;

};
}


text:
package nap

import (
	"database/sql"
)

// Stmt is an aggregate prepared statement.
// It holds a prepared statement for each underlying physical db.
type Stmt interface {
	Close() error
	Exec(...interface{}) (sql.Result, error)
	Query(...interface{}) (*sql.Rows, error)
	QueryRow(...interface{}) *sql.Row
}

type stmt struct {
	db    *DB
	stmts []*sql.Stmt
}

// Close closes the statement by concurrently closing all underlying
// statements concurrently, returning the first non nil error.
func (s *stmt) Close() error {
	return scatter(len(s.stmts), func(i int) error {
		return s.stmts[i].Close()
	})
}

// Exec executes a prepared statement with the given arguments
// and returns a Result summarizing the effect of the statement.
// Exec uses the master as the underlying physical db.
func (s *stmt) Exec(args ...interface{}) (sql.Result, error) {
	return s.stmts[0].Exec(args...)
}

// Query executes a prepared query statement with the given
// arguments and returns the query results as a *sql.Rows.
// Query uses a slave as the underlying physical db.
func (s *stmt) Query(args ...interface{}) (*sql.Rows, error) {
	return s.stmts[s.db.slave(len(s.db.pdbs))].Query(args...)
}

// QueryRow executes a prepared query statement with the given arguments.
// If an error occurs during the execution of the statement, that error
// will be returned by a call to Scan on the returned *Row, which is always non-nil.
// If the query selects no rows, the *Row's Scan will return ErrNoRows.
// Otherwise, the *sql.Row's Scan scans the first selected row and discards the rest.
// QueryRow uses a slave as the underlying physical db.
func (s *stmt) QueryRow(args ...interface{}) *sql.Row {
	return s.stmts[s.db.slave(len(s.db.pdbs))].QueryRow(args...)
}


text:
namespace Skylight
{
    using PlayerIOClient;

    /// <summary>
    ///     Class Access.
    /// </summary>
    public class Access
    {
        #region Fields

        /// <summary>
        ///     The _receiver
        /// </summary>
        private readonly Receiver _receiver;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Access"/> class.
        /// </summary>
        /// <param name="in">
        /// The in.
        /// </param>
        public Access(Receiver @in)
        {
            this._receiver = @in;
        }

        #endregion

        #region Public Events

        /// <summary>
        ///     All events that concern the player. This includes many messages that the player
        ///     gets from the world (such as server information and leveling up). Mostly these
        ///     events are shown from the server directly to the user in the form of a dialog
        ///     box or by prefixing a chat message with *SYSTEM.
        /// </summary>
        public event Receiver.PlayerEvent GainAccessEvent = delegate { };

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// Called when the bot received elevated permission access (god mode, changing blocks) to the room.
        /// </summary>
        /// <param name="m">
        /// The message.
        /// </param>
        public void OnAccess(Message m)
        {
            // Nothing to extract from message.
            // Update relevant objects.
            this._receiver.Bot.HasAccess = true;

            // Fire the event.
            var e = new PlayerEventArgs(this._receiver.Bot, this._receiver.Source, m);

            this._receiver.Source.MainReceiver.Access.GainAccessEvent(e);
        }

        #endregion
    }
}


text:
package ch.tobiasfiechter.etherwidget;

import ch.tobiasfiechter.coinwidgetlibrary.AbstractWidgetConfigureActivity;

/**
 * Created by tobias on 07.01.2018.
 */

public class EtherWidgetConfigureActivity extends AbstractWidgetConfigureActivity {

    @Override
    protected boolean validateCoinAddress(String address) {
        String regex = "^0x[0-9a-fA-F]{40}";
        return address.matches(regex);
    }

    @Override
    protected EtherWidgetProvider createInstance() {
        return new EtherWidgetProvider();
    }
}


text:
package com.graphhopper.jsprit.core.algorithm.recreate;

import com.graphhopper.jsprit.core.problem.JobActivityFactory;
import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem;
import com.graphhopper.jsprit.core.problem.constraint.ConstraintManager;

public class ServiceInsertionCalculatorFactory implements JobInsertionCostsCalculatorFactory {
    @Override
    public JobInsertionCostsCalculator create(VehicleRoutingProblem vrp, ActivityInsertionCostsCalculator activityInsertionCostsCalculator, JobActivityFactory jobActivityFactory, ConstraintManager constraintManager) {
        return new ServiceInsertionCalculator(vrp.getTransportCosts(), vrp.getActivityCosts(), activityInsertionCostsCalculator, constraintManager, jobActivityFactory);
    }
}


text:
#region Copyright & License

// Copyright © 2012 - 2016 François Chabot, Yves Dierick
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#endregion

using System;

namespace Be.Stateless.BizTalk.Dsl.Binding.ServiceModel.Configuration
{
	public class NetMsmqRetryPolicy
	{
		static NetMsmqRetryPolicy()
		{
			_default = new NetMsmqRetryPolicy { MaxRetryCycles = 2, ReceiveRetryCount = 5, RetryCycleDelay = TimeSpan.FromMinutes(10), TimeToLive = TimeSpan.FromDays(1) };
		}

		public static NetMsmqRetryPolicy Default
		{
			get { return _default; }
		}

		/// <summary>
		/// Gets or sets the maximum number of retry cycles to attempt delivery of messages to the receiving application.
		/// </summary>
		/// <returns>
		/// The maximum number of retry cycles to attempt prior to transferring a message to the poison-message queue.
		/// </returns>
		/// <remarks>
		/// It defaults to 2.
		/// </remarks>
		/// <seealso href="https://msdn.microsoft.com/en-us/library/system.servicemodel.msmqbindingbase.maxretrycycles">MsmqBindingBase.MaxRetryCycles</seealso>
		public virtual int MaxRetryCycles { get; set; }

		/// <summary>
		/// Gets or sets the maximum number of immediate retries that the queue manager should attempt if transmission of
		/// a message from the application queue to the application fails.
		/// </summary>
		/// <returns>
		/// The maximum number of times the queue manager should attempt to send a message before transferring it to the
		/// retry queue.
		/// </returns>
		/// <remarks>
		/// It defaults to 5.
		/// </remarks>
		/// <seealso href="https://msdn.microsoft.com/en-us/library/system.servicemodel.msmqbindingbase.ReceiveRetryCount">MsmqBindingBase.ReceiveRetryCount</seealso>
		public virtual int ReceiveRetryCount { get; set; }

		/// <summary>
		/// Gets or sets a value that specifies how long to wait before attempting another retry cycle when attempting to
		/// deliver a message that could not be delivered.
		/// </summary>
		/// <returns>
		/// The <see cref="TimeSpan"/> that specifies the interval of time to wait before starting the next cycle of
		/// delivery attempts to the receiving application.
		/// </returns>
		/// <remarks>
		/// It defaults to 10 minutes.
		/// </remarks>
		/// <seealso href="https://msdn.microsoft.com/en-us/library/system.servicemodel.msmqbindingbase.retrycycledelay">MsmqBindingBase.RetryCycleDelay</seealso>
		public virtual TimeSpan RetryCycleDelay { get; set; }

		/// <summary>
		/// Gets or sets a value that specifies how long messages are valid. When this time has elapsed, the message is
		/// placed in a dead-letter queue (if available).
		/// </summary>
		/// <returns>
		/// A <see cref="TimeSpan"/> value that specifies how long messages are valid.
		/// </returns>
		/// <remarks>
		/// It defaults to 1 day.
		/// </remarks>
		/// <seealso href="https://msdn.microsoft.com/en-us/library/system.servicemodel.msmqbindingbase.timetolive">MsmqBindingBase.TimeToLive</seealso>
		public virtual TimeSpan TimeToLive { get; set; }

		private static readonly NetMsmqRetryPolicy _default;
	}
}


text:
package concretis.domain.repository;

import concretis.domain.model.Comment;
import concretis.util.PaginationRequest;
import concretis.util.SortOrder;

import java.util.Collection;
import java.util.List;

/**
 * @author Evgeniy Khyst
 */
public interface CommentRepository {

    Comment findComment(long commentId);

    List<Comment> findAllComments(SortOrder sortOrder, PaginationRequest paginationRequest, Collection<Long> excludeCommentIds);

    List<Comment> findAllComments(SortOrder sortOrder, PaginationRequest paginationRequest);

    long countAllComments(Collection<Long> excludeCommentIds);

    long countAllComments();

    List<Comment> findComments(String pageName, SortOrder sortOrder, PaginationRequest paginationRequest, Collection<Long> excludeCommentIds);

    List<Comment> findComments(String pageName, SortOrder sortOrder, PaginationRequest paginationRequest);

    long countComments(String pageName, Collection<Long> excludeCommentIds);

    long countComments(String pageName);

    void persist(Comment comment);

    public void remove(Comment comment);

}


text:
namespace aura {

WindowTargeter::WindowTargeter() {}
WindowTargeter::~WindowTargeter() {}

Window* WindowTargeter::FindTargetForLocatedEvent(Window* window,
                                                  ui::LocatedEvent* event) {
  if (!window->parent()) {
    Window* target = FindTargetInRootWindow(window, *event);
    if (target) {
      window->ConvertEventToTarget(target, event);
      return target;
    }
  }
  return FindTargetForLocatedEventRecursively(window, event);
}

bool WindowTargeter::SubtreeCanAcceptEvent(
    Window* window,
    const ui::LocatedEvent& event) const {
  if (!window->IsVisible())
    return false;
  if (window->ignore_events())
    return false;
  client::EventClient* client = client::GetEventClient(window->GetRootWindow());
  if (client && !client->CanProcessEventsWithinSubtree(window))
    return false;

  Window* parent = window->parent();
  if (parent && parent->delegate_ && !parent->delegate_->
      ShouldDescendIntoChildForEventHandling(window, event.location())) {
    return false;
  }
  return true;
}

bool WindowTargeter::EventLocationInsideBounds(
    Window* window,
    const ui::LocatedEvent& event) const {
  gfx::Point point = event.location();
  if (window->parent())
    Window::ConvertPointToTarget(window->parent(), window, &point);
  return gfx::Rect(window->bounds().size()).Contains(point);
}

ui::EventTarget* WindowTargeter::FindTargetForEvent(ui::EventTarget* root,
                                                    ui::Event* event) {
  Window* window = static_cast<Window*>(root);
  Window* target = event->IsKeyEvent()
                       ? FindTargetForKeyEvent(window, *event->AsKeyEvent())
                       : FindTargetForNonKeyEvent(window, event);
  if (target && !window->parent() && !window->Contains(target)) {
    // |window| is the root window, but |target| is not a descendent of
    // |window|. So do not allow dispatching from here. Instead, dispatch the
    // event through the WindowEventDispatcher that owns |target|.
    Window* new_root = target->GetRootWindow();
    DCHECK(new_root);
    if (event->IsLocatedEvent()) {
      // The event has been transformed to be in |target|'s coordinate system.
      // But dispatching the event through the EventProcessor requires the event
      // to be in the host's coordinate system. So, convert the event to be in
      // the root's coordinate space, and then to the host's coordinate space by
      // applying the host's transform.
      ui::LocatedEvent* located_event = static_cast<ui::LocatedEvent*>(event);
      located_event->ConvertLocationToTarget(target, new_root);
      located_event->UpdateForRootTransform(
          new_root->GetHost()->GetRootTransform());
    }
    ignore_result(
        new_root->GetHost()->event_processor()->OnEventFromSource(event));

    target = nullptr;
  }
  return target;
}

ui::EventTarget* WindowTargeter::FindNextBestTarget(
    ui::EventTarget* previous_target,
    ui::Event* event) {
  return nullptr;
}

bool WindowTargeter::SubtreeShouldBeExploredForEvent(
    Window* window,
    const ui::LocatedEvent& event) {
  return SubtreeCanAcceptEvent(window, event) &&
         EventLocationInsideBounds(window, event);
}

Window* WindowTargeter::FindTargetForKeyEvent(Window* window,
                                              const ui::KeyEvent& key) {
  Window* root_window = window->GetRootWindow();
  client::FocusClient* focus_client = client::GetFocusClient(root_window);
  Window* focused_window = focus_client->GetFocusedWindow();
  if (!focused_window)
    return window;

  client::EventClient* event_client = client::GetEventClient(root_window);
  if (event_client &&
      !event_client->CanProcessEventsWithinSubtree(focused_window)) {
    focus_client->FocusWindow(nullptr);
    return nullptr;
  }
  return focused_window ? focused_window : window;
}

Window* WindowTargeter::FindTargetForNonKeyEvent(Window* root_window,
                                                 ui::Event* event) {
  if (!event->IsLocatedEvent())
    return root_window;
  return FindTargetForLocatedEvent(root_window,
                                   static_cast<ui::LocatedEvent*>(event));
}

Window* WindowTargeter::FindTargetInRootWindow(Window* root_window,
                                               const ui::LocatedEvent& event) {
  DCHECK_EQ(root_window, root_window->GetRootWindow());

  // Mouse events should be dispatched to the window that processed the
  // mouse-press events (if any).
  if (event.IsScrollEvent() || event.IsMouseEvent()) {
    WindowEventDispatcher* dispatcher = root_window->GetHost()->dispatcher();
    if (dispatcher->mouse_pressed_handler())
      return dispatcher->mouse_pressed_handler();
  }

  // All events should be directed towards the capture window (if any).
  Window* capture_window = client::GetCaptureWindow(root_window);
  if (capture_window)
    return capture_window;

  if (event.IsTouchEvent()) {
    // Query the gesture-recognizer to find targets for touch events.
    const ui::TouchEvent& touch = *event.AsTouchEvent();
    ui::GestureConsumer* consumer =
        ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch);
    if (consumer)
      return static_cast<Window*>(consumer);
    consumer = ui::GestureRecognizer::Get()->GetTargetForLocation(
        event.location_f(), touch.source_device_id());
    if (consumer)
      return static_cast<Window*>(consumer);

    // If the initial touch is outside the root window, target the root.
    if (!root_window->bounds().Contains(event.location()))
      return root_window;
  }

  return nullptr;
}

Window* WindowTargeter::FindTargetForLocatedEventRecursively(
    Window* root_window,
    ui::LocatedEvent* event) {
  std::unique_ptr<ui::EventTargetIterator> iter =
      root_window->GetChildIterator();
  if (iter) {
    ui::EventTarget* target = root_window;
    for (ui::EventTarget* child = iter->GetNextTarget(); child;
         child = iter->GetNextTarget()) {
      WindowTargeter* targeter =
          static_cast<WindowTargeter*>(child->GetEventTargeter());
      if (!targeter)
        targeter = this;
      if (!targeter->SubtreeShouldBeExploredForEvent(
              static_cast<Window*>(child), *event)) {
        continue;
      }
      target->ConvertEventToTarget(child, event);
      target = child;
      Window* child_target_window =
          static_cast<Window*>(targeter->FindTargetForEvent(child, event));
      if (child_target_window)
        return child_target_window;
    }
    target->ConvertEventToTarget(root_window, event);
  }
  return root_window->CanAcceptEvent(*event) ? root_window : nullptr;
}

}  // namespace aura


text:
#include <qwidget.h>

#include "qeventdispatcher_s60_p.h"

QT_BEGIN_NAMESPACE

QEventDispatcherS60::QEventDispatcherS60(QObject *parent)
    : QEventDispatcherSymbian(parent),
      m_noInputEvents(false)
{
}

QEventDispatcherS60::~QEventDispatcherS60()
{
    for (int c = 0; c < m_deferredInputEvents.size(); ++c) {
        delete m_deferredInputEvents[c].event;
    }
}

bool QEventDispatcherS60::processEvents ( QEventLoop::ProcessEventsFlags flags )
{
    bool ret = false;

    QT_TRY {
        bool oldNoInputEventsValue = m_noInputEvents;
        if (flags & QEventLoop::ExcludeUserInputEvents) {
            m_noInputEvents = true;
        } else {
            m_noInputEvents = false;
            ret = sendDeferredInputEvents() || ret;
        }

        ret = QEventDispatcherSymbian::processEvents(flags) || ret;

        m_noInputEvents = oldNoInputEventsValue;
    } QT_CATCH (const std::exception& ex) {
#ifndef QT_NO_EXCEPTIONS
        CActiveScheduler::Current()->Error(qt_symbian_exception2Error(ex));
#endif
    }

    return ret;
}

bool QEventDispatcherS60::hasPendingEvents()
{
    return !m_deferredInputEvents.isEmpty() || QEventDispatcherSymbian::hasPendingEvents();
}

void QEventDispatcherS60::saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event)
{
    DeferredInputEvent inputEvent = {control, widget, event};
    m_deferredInputEvents.append(inputEvent);
    connect(widget, SIGNAL(destroyed(QObject*)), SLOT(removeInputEventsForWidget(QObject*)));
}

bool QEventDispatcherS60::sendDeferredInputEvents()
{
    bool eventsSent = false;
    while (!m_deferredInputEvents.isEmpty()) {
        DeferredInputEvent inputEvent = m_deferredInputEvents.takeFirst();
#ifndef QT_NO_EXCEPTIONS
        try {
#endif
            inputEvent.control->sendInputEvent(inputEvent.widget, inputEvent.event);
#ifndef QT_NO_EXCEPTIONS
        } catch (...) {
            delete inputEvent.event;
            throw;
        }
#endif
        delete inputEvent.event;
        eventsSent = true;
    }

    return eventsSent;
}

void QEventDispatcherS60::removeInputEventsForWidget(QObject *object)
{
    for (int c = 0; c < m_deferredInputEvents.size(); ++c) {
        if (m_deferredInputEvents[c].widget == object) {
            delete m_deferredInputEvents[c].event;
            m_deferredInputEvents.removeAt(c--);
        }
    }
}

QT_END_NAMESPACE


text:
package guru.mmp.application.web.template.components;

//~--- non-JDK imports --------------------------------------------------------

import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.markup.html.navigation.paging.IPageable;
import org.apache.wicket.markup.html.panel.Panel;

/**
 * The PagingNavigator class provides a Wicket component to draw and maintain a
 * complete page navigator.
 *
 * @author Marcus Portmann
 */
public class PagingNavigator extends Panel
{
  private static final long serialVersionUID = 1000000;
  private boolean isVisible;
  private IPageable pageable;

  /**
   * Constructor.
   *
   * @param id       the non-null id of this component
   * @param pageable the pageable component the page links are referring to
   */
  public PagingNavigator(String id, IPageable pageable)
  {
    super(id);
    this.pageable = pageable;
    setRenderBodyOnly(false);
  }

  /**
   * @return true if the component is visible or false otherwise
   *
   * @see org.apache.wicket.Component#isVisible()
   */
  @Override
  public boolean isVisible()
  {
    return isVisible;
  }

  /**
   * Create a new PagingNavigation instance.
   *

   * May be subclassed to make use of specialized PagingNavigation.
   *
   * @param id       the id of the navigation component
   * @param pageable the pageable component
   *
   * @return the navigation object
   */
  protected PagingNavigation newNavigation(String id, IPageable pageable)
  {
    return new PagingNavigation(id, pageable);
  }

  /**
   * Create a new increment link.
   *

   * May be sub-classed to make use of specialized links, e.g. Ajaxian links.
   *
   * @param id        the link id
   * @param pageable  the pageable to control
   * @param increment the increment
   *
   * @return the increment link
   */
  protected AbstractLink newPagingNavigationIncrementLink(String id, IPageable pageable,
      int increment)
  {
    return new PagingNavigationIncrementLink<Void>(id, pageable, increment);
  }

  /**
   * Create a new page number link.
   *

   * May be sub-classed to make use of specialized links, e.g. Ajax-based links.
   *
   * @param id         the link id
   * @param pageable   the pageable to control
   * @param pageNumber the page to jump to
   *
   * @return the page number link
   */
  protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber)
  {
    return new PagingNavigationLink<Void>(id, pageable, pageNumber);
  }

  /**
   * @see org.apache.wicket.Component#onConfigure()
   */
  @Override
  protected void onConfigure()
  {
    super.onConfigure();

    isVisible = pageable.getPageCount() > 1;
  }

  /**
   * @see org.apache.wicket.Component#onInitialize()
   */
  @Override
  protected void onInitialize()
  {
    super.onInitialize();

    // Setup the navigation bar and add it to the hierarchy
    PagingNavigation pagingNavigation = newNavigation("navigation", pageable);

    add(pagingNavigation);

    // Add the additional navigation links
    AbstractLink firstLink = newPagingNavigationLink("first", pageable, 0);

    add(firstLink);

    AbstractLink previousLink = newPagingNavigationIncrementLink("prev", pageable, -1);

    add(previousLink);

    AbstractLink nextLink = newPagingNavigationIncrementLink("next", pageable, 1);

    add(nextLink);

    AbstractLink lastLink = newPagingNavigationLink("last", pageable, -1);

    add(lastLink);
  }
}


text:
package synergynet3.web.commons.client.ui;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * The Class SimpleListBox.
 */
public class SimpleListBox extends VerticalPanel
{

	/** The allows selection. */
	private boolean allowsSelection = true;

	/** The multiple select. */
	private boolean multipleSelect = false;

	/**
	 * Instantiates a new simple list box.
	 */
	public SimpleListBox()
	{
		super();
		setStylePrimaryName("simpleListBox");
	}

	// *** managing items ***

	/**
	 * Adds the click handler.
	 *
	 * @param handler
	 *            the handler
	 * @return the handler registration
	 */
	public HandlerRegistration addClickHandler(final ClickHandler handler)
	{
		return addDomHandler(new ClickHandler()
		{
			@Override
			public void onClick(ClickEvent event)
			{
				if (allowsSelection)
				{
					handler.onClick(event);
				}
			}

		}, ClickEvent.getType());
	}

	/**
	 * Adds the item.
	 *
	 * @param item
	 *            the item
	 */
	public void addItem(String item)
	{
		addLabel(item);
	}

	/**
	 * Gets the item at index.
	 *
	 * @param index
	 *            the index
	 * @return the item at index
	 */
	public String getItemAtIndex(int index)
	{
		Label labelForIndex = getLabelAtIndex(index);
		return labelForIndex.getText();
	}

	/**
	 * Gets the item count.
	 *
	 * @return the item count
	 */
	public int getItemCount()
	{
		return getWidgetCount();
	}

	// *** item selection ***

	/**
	 * Gets the selected index.
	 *
	 * @return the selected index
	 */
	public int getSelectedIndex()
	{
		for (int i = 0; i < getItemCount(); i++)
		{
			if (isItemSelectedAtIndex(i))
			{
				return i;
			}
		}
		return -1;
	}

	/**
	 * Gets the selected item.
	 *
	 * @return the selected item
	 */
	public String getSelectedItem()
	{
		int selectedIndex = getSelectedIndex();
		if (selectedIndex == -1)
		{
			return null;
		}
		return getItemAtIndex(selectedIndex);
	}

	/**
	 * Gets the selected items.
	 *
	 * @return the selected items
	 */
	public List<String> getSelectedItems()
	{
		List<String> list = new ArrayList<String>();
		for (int i = 0; i < getItemCount(); i++)
		{
			if (isItemSelectedAtIndex(i))
			{
				list.add(getItemAtIndex(i));
			}
		}
		return list;
	}

	/**
	 * Checks if is multiple select.
	 *
	 * @return true, if is multiple select
	 */
	public boolean isMultipleSelect()
	{
		return this.multipleSelect;
	}

	/**
	 * Checks if is selected.
	 *
	 * @param index
	 *            the index
	 * @return true, if is selected
	 */
	public boolean isSelected(int index)
	{
		return isItemSelectedAtIndex(index);
	}

	/**
	 * Removes the all items.
	 */
	public void removeAllItems()
	{
		removeAllWidgets();
	}

	/**
	 * Select all.
	 */
	public void selectAll()
	{
		if (!allowsSelection)
		{
			return;
		}
		if (!multipleSelect)
		{
			return;
		}
		makeAllLabelsSelected();
	}

	/**
	 * Sets the allows selection.
	 *
	 * @param allowsSelection
	 *            the new allows selection
	 */
	public void setAllowsSelection(boolean allowsSelection)
	{
		this.allowsSelection = allowsSelection;
		if (!allowsSelection)
		{
			makeAllLabelsUnselected();
		}
	}

	// *** handlers ***

	/**
	 * Sets the multiple select.
	 *
	 * @param isMultipleSelect
	 *            the new multiple select
	 */
	public void setMultipleSelect(boolean isMultipleSelect)
	{
		this.multipleSelect = isMultipleSelect;
		makeAllLabelsUnselected();
	}

	// *** private methods ***

	/**
	 * Adds the label.
	 *
	 * @param item
	 *            the item
	 */
	private void addLabel(String item)
	{
		final Label label = new Label(item);
		label.setStylePrimaryName("simpleListBoxItem");
		label.addClickHandler(new ClickHandler()
		{
			@Override
			public void onClick(ClickEvent event)
			{
				itemClicked(label);
			}
		});
		this.add(label);
	}

	/**
	 * Gets the label at index.
	 *
	 * @param index
	 *            the index
	 * @return the label at index
	 */
	private Label getLabelAtIndex(int index)
	{
		return (Label) this.getWidget(index);
	}

	/**
	 * Checks if is item selected at index.
	 *
	 * @param i
	 *            the i
	 * @return true, if is item selected at index
	 */
	private boolean isItemSelectedAtIndex(int i)
	{
		Label labelAtIndex = getLabelAtIndex(i);
		return labelIsSelected(labelAtIndex);
	}

	// *** private event handling ***

	/**
	 * Label is selected.
	 *
	 * @param label
	 *            the label
	 * @return true, if successful
	 */
	private boolean labelIsSelected(Label label)
	{
		return label.getStyleName().contains("selected");
	}

	/**
	 * Make all labels selected.
	 */
	private void makeAllLabelsSelected()
	{
		for (int i = 0; i < getItemCount(); i++)
		{
			Label labelAtIndex = getLabelAtIndex(i);
			makeLabelSelected(labelAtIndex);
		}
	}

	/**
	 * Make all labels unselected.
	 */
	private void makeAllLabelsUnselected()
	{
		for (int i = 0; i < getItemCount(); i++)
		{
			Label labelAtIndex = getLabelAtIndex(i);
			makeLabelUnselected(labelAtIndex);
		}
	}

	/**
	 * Make label selected.
	 *
	 * @param label
	 *            the label
	 */
	private void makeLabelSelected(Label label)
	{
		label.setStyleDependentName("selected", true);
	}

	/**
	 * Make labels unselected except for.
	 *
	 * @param label
	 *            the label
	 */
	private void makeLabelsUnselectedExceptFor(Label label)
	{
		for (int i = 0; i < getItemCount(); i++)
		{
			Label labelAtIndex = getLabelAtIndex(i);
			if (labelAtIndex != label)
			{
				makeLabelUnselected(labelAtIndex);
			}
		}
	}

	/**
	 * Make label unselected.
	 *
	 * @param label
	 *            the label
	 */
	private void makeLabelUnselected(Label label)
	{
		label.removeStyleDependentName("selected");
	}

	/**
	 * Removes the all widgets.
	 */
	private void removeAllWidgets()
	{
		this.clear();
	}

	/**
	 * Item clicked.
	 *
	 * @param label
	 *            the label
	 */
	protected void itemClicked(Label label)
	{
		if (!this.allowsSelection)
		{
			return;
		}

		if (!labelIsSelected(label))
		{
			makeLabelSelected(label);
		}
		else
		{
			makeLabelUnselected(label);
		}
		if (!multipleSelect)
		{
			makeLabelsUnselectedExceptFor(label);
		}
	}

}


text:
/**
 * @file util/logger.h
 *
 * Interface definitions for the logger.
 */
#ifndef MLEARN_UTIL_LOGGER_H
#define MLEARN_UTIL_LOGGER_H

namespace mlearn {

enum class LogLevel {
	Error   = 0,
	Warn    = 1,
	Info    = 2,
	Verbose = 3,
	Debug   = 4
};

class Logger {
public:
	static LogLevel LEVEL;

	static bool test(LogLevel level) { return (level <= LEVEL); }
	static void log(LogLevel level, const char *format, ...);
};

}

#endif


text:
from __future__ import unicode_literals

from django.contrib import admin

from plataforma.forms import NodosForm, ObjetoForm
from plataforma.models import Nodo, Nodos, Objeto, Saldo

@admin.register(Nodo)
class NodoAdmin(admin.ModelAdmin):

    list_display = ("id", "user", "nome", "carteira",)

@admin.register(Nodos)
class NodosAdmin(admin.ModelAdmin):

    form = NodosForm
    list_display = ("id", "nome")

@admin.register(Objeto)
class ObjetoAdmin(admin.ModelAdmin):

    form = ObjetoForm
    list_display = ("id", "nodos", "nome")

@admin.register(Saldo)
class SaldoAdmin(admin.ModelAdmin):

    list_display = ("carteira", "total", )

admin.site.site_header = u"Administração Prospera"
admin.site.site_title = u"Administração Prospera"
admin.site.index_title = u"Administração"


text:
require_dependency "tenant/application_controller"

module Tenant
  class Account::DashboardController < Tenant::ApplicationController
    before_filter :authenticate_user!
  end
end


text:
<!doctype html>

        <title>Socket.IO chat</title>

        <form action="">
            <input id="m" autocomplete="off" /><button>Send</button>
        </form>


text:
using UnityEngine;

public class Popup {
	static int popupListHash = "PopupList".GetHashCode();

	public static bool List (Rect position, ref bool showList, ref int listEntry, GUIContent buttonContent, GUIContent[] listContent,
							 GUIStyle listStyle) {
		return List(position, ref showList, ref listEntry, buttonContent, listContent, "button", "box", listStyle);
	}

	public static bool List (Rect position, ref bool showList, ref int listEntry, GUIContent buttonContent, GUIContent[] listContent,
							 GUIStyle buttonStyle, GUIStyle boxStyle, GUIStyle listStyle) {
		int controlID = GUIUtility.GetControlID(popupListHash, FocusType.Passive);
		bool done = false;
		switch (Event.current.GetTypeForControl(controlID)) {
			case EventType.mouseDown:
				if (position.Contains(Event.current.mousePosition)) {
					GUIUtility.hotControl = controlID;
					showList = true;
				}
				break;
			case EventType.mouseUp:
				if (showList) {
					done = true;
				}
				break;
		}

		GUI.Label(position, buttonContent, buttonStyle);
		if (showList)
		{
			Rect listRect = new Rect(position.x, position.y, position.width, position.height*listContent.Length);
			GUI.Box(listRect, "", boxStyle);
			listEntry = GUI.SelectionGrid(listRect, listEntry, listContent, 1, listStyle);
		}
		if (done)
		{
			showList = false;
		}
		return done;
	}
}


text:
package com.roche.rogetmf.client.service;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.extjs.gxt.ui.client.widget.Info;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.roche.rogetmf.shared.oah.OpenAjaxHub;
import com.roche.rogetmf.shared.oah.OpenAjaxMessage;
import com.roche.rogetmf.shared.oah.OpenAjaxMessageFactory;
import com.roche.rogetmf.shared.oah.ServiceCallback;

public class SearchService implements ISearchService {
	private final Logger logger = Logger.getLogger(getClass().getName());

	private OpenAjaxHub openAjaxHub;

	public SearchService(OpenAjaxHub openAjaxHub) {
		logger.log(Level.FINE, "Creating SearchService");

		this.openAjaxHub = openAjaxHub;

		logger.log(Level.FINE, "Subscribing D2_EVENT_DIALOG_HIDE");

		openAjaxHub.subscribe("D2_EVENT_DIALOG_HIDE", new AsyncCallback<OpenAjaxMessage>() {
			public void onSuccess(OpenAjaxMessage result) {
				logger.log(Level.INFO, "showSearchScreenCallback::onSuccess");
				if(result.getParameter("callerManagerId")==null || !result.getParameter("callerManagerId").equals("DestroyManager")){
					runPreparedSearch();
				}
			}

			public void onFailure(Throwable caught) {
				logger.log(Level.WARNING, "showSearchScreenCallback::onFailure: " + caught.getMessage());
			}
		});
	}

	public void handleRunSearch(String id, String type) {

		if (type != null && !type.equals("d2c_query_category")) {
			if (type.equals("node_last_search")) {
				runLastSearch();
			} else if (type.equals("d2_facet_definition")) {
				String facet = id;
				String facetName = facet.split(SEPARATOR_VALUE)[1];

				resetFacetSearch(facet, facetName);
			} else if (type.equals("d2_facet_value")) {
				String facet = id;
				String[] facetParts = facet.split(SEPARATOR_VALUE);
				String facetName = facetParts[1];
				String facetValue = facetParts[2];

				runFacetSearch(facet, facetName, facetValue);
			} else if (type.equals("d2c_query_form") || type.equals("d2_queryform_config")) {
				// OOTB D2 Query forms are executed regular way
				showQueryForm(id);
			} else if (type.equals("rog_query_form") || type.equals("rog_queryform_config")) {
				// Custom FreeMarker forms require custom flow of execution
				prepareSearch(id);
			} else if (type.equals("d2c_query_wizard")) {
				runAdvancedSearch(id);
			} else if (type.equals("d2c_query")) {
				runSearch(id, type);
			} else {
				runSearch(id, type);
			}
		}

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#prepareSearch(java.lang.String)
	 */
	public void prepareSearch(String queryFormId) {
		logger.log(Level.INFO, "Preparing search for query form: " + queryFormId);

		prepareQueryDqlObject(queryFormId, new ServiceCallback<OpenAjaxMessage>() {
			@Override
			public void onSuccess(OpenAjaxMessage result) {
				String queryDqlObjectId = result.getValue();
				String queryFormObjectId = result.getParameter("query_form_object_id");

				logger.log(Level.FINE, "Search object " + queryDqlObjectId + " prepared for Query form: " + queryFormObjectId);

				if (queryFormObjectId != null && queryDqlObjectId != null)
					displaySearchScreen(queryFormObjectId);
			}

			@Override
			public void onFailure(Throwable caught) {
				logger.log(Level.WARNING, "prepareSearch::onFailure: " + caught.getMessage());
			}
		});
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#runPreparedSearch()
	 */
	public void runPreparedSearch() {
		logger.log(Level.FINE, "Retiving Id of prepared search");

		getQueryDqlObject(new ServiceCallback<OpenAjaxMessage>() {
			@Override
			public void onSuccess(OpenAjaxMessage result) {
				String queryDqlObjectId = result.getValue();

				logger.log(Level.INFO, "Running prepared Public search: " + queryDqlObjectId);

				if (queryDqlObjectId != null && queryDqlObjectId != DF_NULL_ID)
					runSearch(queryDqlObjectId, D2C_QUERY_DQL);
			}

			@Override
			public void onFailure(Throwable caught) {
				logger.log(Level.WARNING, "getQueryDqlCallback::onFailure: " + caught.getMessage());
			}
		});
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#runLastSearch()
	 */
	public void runLastSearch() {
		logger.log(Level.FINE, "Retiving data of last executed search");

		getLastQueryDqlObjectData(new ServiceCallback<OpenAjaxMessage>() {
			@Override
			public void onSuccess(OpenAjaxMessage result) {
				String queryDqlObjectId = result.getParameter("r_object_id");
				String queryDqlObjectType = result.getParameter("r_object_type");

				logger.log(Level.INFO, "Running last search: " + queryDqlObjectId + ", " + queryDqlObjectType);

				if (D2C_QUERY_FORM.equalsIgnoreCase(queryDqlObjectType))
					runSearch("node_last_search", null);
				else if (queryDqlObjectId != null)
					runSearch(queryDqlObjectId, queryDqlObjectType);
			}

			@Override
			public void onFailure(Throwable caught) {
				logger.log(Level.WARNING, "getLastQueryDqlObjectDataCallback::onFailure: " + caught.getMessage());
			}
		});
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#runQuickSearch(java.lang.String)
	 */
	public void runCustomQuickSearch(String quickSearchTerm) {
		logger.log(Level.INFO, "SearchToolbar - Quick search term:" + quickSearchTerm);

		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setParameter("quick_search_term", quickSearchTerm);
		openAjaxHub.callService("QueryDqlObjectService", "getQueryDqlObjectForQuickSearch", message,
				new ServiceCallback<OpenAjaxMessage>() {
					@Override
					public void onSuccess(OpenAjaxMessage result) {
						String queryDqlObjectId = result.getValue();
						logger.log(Level.INFO, "SearchToolbar::queryDqlObjectId: " + queryDqlObjectId);

						if (queryDqlObjectId != null && queryDqlObjectId != DF_NULL_ID)
							runSearch(queryDqlObjectId, D2C_QUERY_DQL);
					}

					@Override
					public void onFailure(Throwable caught) {
						logger.log(Level.WARNING, "SearchService::getQueryDqlObjectForQuickSearch::onFailure: " + caught.getMessage());

					}
				});

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#showAdvancedSearch(java.lang.String)
	 */
	public void runAdvancedSearch(String advancedSearchId) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(advancedSearchId);
		openAjaxHub.send("D2_ACTION_ADVANCED_SEARCH", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#showQueryForm(java.lang.String)
	 */
	public void showQueryForm(String queryFormId) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(queryFormId);

		openAjaxHub.send("D2_ACTION_QUERYFORM_SHOW", message);
		openAjaxHub.send("D2_EVENT_SELECT_QUERYFORM", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#showAdvancedSearchCriteria(java.lang.String)
	 */
	public void showQueryFormParameters() {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setParameter("widgetType", "SearchWidget");
		message.setParameter("MANAGER", "QueryFormManager");
		message.setParameter("type", NODE_LAST_SEARCH);
		message.setId(NODE_LAST_SEARCH);
		openAjaxHub.send("D2_ACTION_EXECUTE_MANAGER", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#showAdvancedSearchCriteria(java.lang.String)
	 */
	public void showAdvancedSearchCriteria(String advancedSearchId) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(advancedSearchId);
		message.setParameter("widgetType", "SearchWidget");
		message.setParameter("MANAGER", "AdvancedSearchManager");
		message.setParameter("type", "d2c_query");
		openAjaxHub.send("D2_ACTION_EXECUTE_MANAGER", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#showAdvancedSearchCriteria(java.lang.String)
	 */
	public void deleteSearchCriteria(String searchId) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(searchId);
		message.setParameter("MANAGER", "DestroyManager");
		openAjaxHub.send("D2_ACTION_EXECUTE_MANAGER", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#runSearch(java.lang.String, java.lang.String)
	 */
	public void runSearch(String searchObjectId, String searchObjecType) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		if (searchObjectId != null)
			message.setId(searchObjectId);

		if (searchObjecType != null)
			message.setParameter("searched_type", searchObjecType);

		openAjaxHub.send("D2_ACTION_SEARCH_DOCUMENT", message);
		openAjaxHub.send("D2_EVENT_SELECT_SEARCH", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#runFacetSearch(java.lang.String, java.lang.String, java.lang.String,
	 * java.lang.String)
	 */
	public void runFacetSearch(String facetObjectId, String facetName, String facetValue) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(facetObjectId);
		message.setParameter("facet_attr_name", facetName);
		message.setParameter("facet_attr_value", facetValue);

		openAjaxHub.send("D2_ACTION_SEARCH_DOCUMENT", message);
		openAjaxHub.send("D2_EVENT_SELECT_FACET", message);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.roche.rogetmf.client.service.ISearchService#resetFacetSearch(java.lang.String, java.lang.String, java.lang.String)
	 */
	public void resetFacetSearch(String facetObjectId, String facetName) {
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setId(facetObjectId);
		message.setParameter("reset_facet_attr_name", facetName);

		openAjaxHub.send("D2_ACTION_SEARCH_DOCUMENT", message);
		openAjaxHub.send("D2_EVENT_SELECT_FACET", message);
	}

	private void prepareQueryDqlObject(String queryFormId, ServiceCallback<OpenAjaxMessage> callback) {
		logger.log(Level.INFO, "initQueryDqlObject");

		OpenAjaxMessage msg = OpenAjaxMessageFactory.create();
		msg.setId(queryFormId);

		openAjaxHub.callService("QueryDqlObjectService", "initQueryDqlObject", msg, callback);
	}

	private void displaySearchScreen(String queryFormId) {
		logger.log(Level.INFO, "showSearchScreen");

		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setParameter("DIALOG_NAME", "RogPublicSearchDialog");
		message.setId(queryFormId);

		openAjaxHub.send("D2_ACTION_DISPLAY_DIALOG", message);
	}

	public void displayLastSearchScreen() {

		logger.log(Level.FINE, "Retiving data of last executed search");

		getLastQueryDqlObjectData("ROG_PUBLIC_SEARCH", new ServiceCallback<OpenAjaxMessage>() {
			@Override
			public void onSuccess(OpenAjaxMessage result) {
				String queryDqlObjectId = result.getParameter("r_object_id");
				String queryDqlObjectType = result.getParameter("r_object_type");

				logger.log(Level.INFO, "Displaying last search parameters: " + queryDqlObjectId + ", " + queryDqlObjectType);

				if (D2C_QUERY_FORM.equalsIgnoreCase(queryDqlObjectType)) {
					logger.log(Level.INFO, "Displaying last " + D2C_QUERY_FORM + " search parameters");
					showQueryFormParameters();
				} else if (D2C_QUERY_DQL.equalsIgnoreCase(queryDqlObjectType)) {
					logger.log(Level.INFO, "Displaying last " + D2C_QUERY_DQL + " search parameters");

					OpenAjaxMessage message = OpenAjaxMessageFactory.create();
					message.setParameter("DIALOG_NAME", "RogLastSearchDialog");
					message.setId(queryDqlObjectId);

					openAjaxHub.send("D2_ACTION_DISPLAY_DIALOG", message);
				} else {
					Info.display("Query form parameters", "Cannot find last search object");
				}
			}

			@Override
			public void onFailure(Throwable caught) {
				logger.log(Level.WARNING, "getLastQueryDqlObjectDataCallback::onFailure: " + caught.getMessage());
			}
		});
	}

	private void getQueryDqlObject(ServiceCallback<OpenAjaxMessage> callback) {
		logger.log(Level.INFO, "getQueryDqlObject");

		openAjaxHub.callService("QueryDqlObjectService", "getQueryDqlObject", callback);
	}

	public void getLastQueryDqlObjectData(ServiceCallback<OpenAjaxMessage> callback) {

		logger.log(Level.INFO, "getLastQueryDqlObjectData");
		openAjaxHub.callService("QueryDqlObjectService", "getLastQueryDqlObjectData", callback);

	}

	public void getLastQueryDqlObjectData(String specialAppFilter, ServiceCallback<OpenAjaxMessage> callback) {

		logger.log(Level.INFO, "getLastQueryDqlObjectData");
		OpenAjaxMessage message = OpenAjaxMessageFactory.create();
		message.setParameter("a_special_app", specialAppFilter);
		openAjaxHub.callService("QueryDqlObjectService", "getLastQueryDqlObjectData", message, callback);

	}

}


text: DochiveMysql::Application.config.session_store :cookie_store, key: '_dochive_mysql_session'


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;

using JetBrains.Annotations;

namespace LinqToDB.Data
{
	/// <summary>
	/// Contains extension methods for merge API.
	/// </summary>
	[PublicAPI]
	public static class MergeExtensions
	{
		#region source/target configuration
		/// <summary>
		/// Starts merge operation definition from target table.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <param name="target">Target table.</param>
		/// <returns>Returns merge command builder, that contains only target.</returns>
		public static IMergeableUsing<TTarget> Merge<TTarget>(this ITable<TTarget> target)
				where TTarget : class
		{
			if (target == null)
				throw new ArgumentNullException(nameof(target));

			return new MergeDefinition<TTarget, TTarget>(target);
		}

		/// <summary>
		/// Starts merge operation definition from source query.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="source">Source data query.</param>
		/// <param name="target">Target table.</param>
		/// <returns>Returns merge command builder with source and target set.</returns>
		public static IMergeableOn<TTarget, TSource> MergeInto<TTarget, TSource>(
			this IQueryable<TSource> source,
			ITable<TTarget> target)
				where TTarget : class
				where TSource : class
		{
			if (source == null) throw new ArgumentNullException(nameof(source));
			if (target == null) throw new ArgumentNullException(nameof(target));

			return new MergeDefinition<TTarget, TSource>(target, source);
		}

		/// <summary>
		/// Adds source query to merge command definition.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <param name="source">Source data query.</param>
		/// <returns>Returns merge command builder with source and target set.</returns>
		public static IMergeableOn<TTarget, TSource> Using<TTarget, TSource>(
			this IMergeableUsing<TTarget> merge,
			IQueryable<TSource> source)
				where TTarget : class
				where TSource : class
		{
			if (merge  == null) throw new ArgumentNullException(nameof(merge));
			if (source == null) throw new ArgumentNullException(nameof(source));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddSource(source);
		}

		/// <summary>
		/// Adds source collection to merge command definition.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <param name="source">Source data collection.</param>
		/// <returns>Returns merge command builder with source and target set.</returns>
		public static IMergeableOn<TTarget, TSource> Using<TTarget, TSource>(
			this IMergeableUsing<TTarget> merge,
			IEnumerable<TSource> source)
				where TTarget : class
				where TSource : class
		{
			if (merge  == null) throw new ArgumentNullException(nameof(merge));
			if (source == null) throw new ArgumentNullException(nameof(source));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddSource(source);
		}

		/// <summary>
		/// Sets target table as merge command source.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <returns>Returns merge command builder with source and target set.</returns>
		public static IMergeableOn<TTarget, TTarget> UsingTarget<TTarget>(this IMergeableUsing<TTarget> merge)
			where TTarget : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			var builder = (MergeDefinition<TTarget,TTarget>)merge;
			return builder.AddSource(builder.Target);
		}
		#endregion

		#region On predicate
		/// <summary>
		/// Adds definition of matching of target and source records using key value.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <typeparam name="TKey">Source and target records join/match key type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <param name="targetKey">Target record match key definition.</param>
		/// <param name="sourceKey">Source record match key definition.</param>
		/// <returns>Returns merge command builder with source, target and match (ON) set.</returns>
		public static IMergeable<TTarget, TSource> On<TTarget, TSource, TKey>(
			this IMergeableOn<TTarget, TSource> merge,
			Expression<Func<TTarget, TKey>> targetKey,
			Expression<Func<TSource, TKey>> sourceKey)
				where TTarget : class
				where TSource : class
		{
			if (merge     == null) throw new ArgumentNullException(nameof(merge));
			if (targetKey == null) throw new ArgumentNullException(nameof(targetKey));
			if (sourceKey == null) throw new ArgumentNullException(nameof(sourceKey));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOnKey(targetKey, sourceKey);
		}

		/// <summary>
		/// Adds definition of matching of target and source records using match condition.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <param name="matchCondition">Rule to match/join target and source records.</param>
		/// <returns>Returns merge command builder with source, target and match (ON) set.</returns>
		public static IMergeable<TTarget, TSource> On<TTarget, TSource>(
			this IMergeableOn<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, bool>> matchCondition)
				where TTarget : class
				where TSource : class
		{
			if (merge          == null) throw new ArgumentNullException(nameof(merge));
			if (matchCondition == null) throw new ArgumentNullException(nameof(matchCondition));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOnPredicate(matchCondition);
		}

		/// <summary>
		/// Adds definition of matching of target and source records using primary key columns.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <param name="merge">Merge command builder.</param>
		/// <returns>Returns merge command builder with source, target and match (ON) set.</returns>
		public static IMergeable<TTarget, TTarget> OnTargetKey<TTarget>(this IMergeableOn<TTarget, TTarget> merge)
				where TTarget : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			return (MergeDefinition<TTarget, TTarget>)merge;
		}
		#endregion

		#region Insert
		/// <summary>
		/// Adds new insert operation to merge and returns new merge command with added operation.
		/// This operation inserts new record to target table using data from the same fields of source record
		/// for each new record from source, not processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> InsertWhenNotMatched<TTarget>(this IMergeableSource<TTarget, TTarget> merge)
				where TTarget : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.Insert(null, null));
		}

		/// <summary>
		/// Adds new insert operation to merge and returns new merge command with added operation.
		/// This operation inserts new record to target table using data from the same fields of source record
		/// for each new record from source that passes filtering with specified predicate, if it wasn't
		/// processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over source record.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> InsertWhenNotMatchedAnd<TTarget>(
			this IMergeableSource<TTarget, TTarget> merge,
			Expression<Func<TTarget, bool>> searchCondition)
				where TTarget : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.Insert(searchCondition, null));
		}

		/// <summary>
		/// Adds new insert operation to merge and returns new merge command with added operation.
		/// This operation inserts new record to target table using user-defined values for target columns
		/// for each new record from source, not processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="setter">Create record expression using source record. Expression should be a call to target
		/// record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> InsertWhenNotMatched<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TSource, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge  == null) throw new ArgumentNullException(nameof(merge));
			if (setter == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Insert(null, setter));
		}

		/// <summary>
		/// Adds new insert operation to merge and returns new merge command with added operation.
		/// This operation inserts new record to target table using user-defined values for target columns
		/// for each new record from source that passes filtering with specified predicate, if it wasn't
		/// processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over source record.</param>
		/// <param name="setter">Create record expression using source record. Expression should be a call to target
		/// record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> InsertWhenNotMatchedAnd<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TSource, bool>> searchCondition,
			Expression<Func<TSource, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));
			if (setter          == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Insert(searchCondition, setter));
		}
		#endregion

		#region Update
		/// <summary>
		/// Adds new update operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using data from the same fields of source record
		/// for each record that was matched in source and target, if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> UpdateWhenMatched<TTarget>(this IMergeableSource<TTarget, TTarget> merge)
				where TTarget : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.Update(null, null));
		}

		/// <summary>
		/// Adds new update operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using data from the same fields of source record
		/// for each record that was matched in source and target and passes filtering with specified predicate,
		/// if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> UpdateWhenMatchedAnd<TTarget>(
			this IMergeableSource<TTarget, TTarget> merge,
			Expression<Func<TTarget, TTarget, bool>> searchCondition)
				where TTarget : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.Update(searchCondition, null));
		}

		/// <summary>
		/// Adds new update operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using user-defined values for target columns
		/// for each record that was matched in source and target, if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="setter">Update record expression using target and source records.
		/// Expression should be a call to target record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenMatched<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge  == null) throw new ArgumentNullException(nameof(merge));
			if (setter == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Update(null, setter));
		}

		/// <summary>
		/// Adds new update operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using user-defined values for target columns
		/// for each record that was matched in source and target and passes filtering with specified predicate,
		/// if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over target and source records.</param>
		/// <param name="setter">Update record expression using target and source records.
		/// Expression should be a call to target record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenMatchedAnd<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, bool>> searchCondition,
			Expression<Func<TTarget, TSource, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));
			if (setter          == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Update(searchCondition, setter));
		}
		#endregion

		#region UpdateThenDelete
		/// <summary>
		/// IMPORTANT: This operation supported only by Oracle Database.
		/// Adds new update with delete operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using data from the same fields of source record
		/// for each record that was matched in source and target, if it wasn't processed by previous operations.
		/// After that it removes updated records if they are matched by delete predicate.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="deleteCondition">Delete execution condition over updated target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> UpdateWhenMatchedThenDelete<TTarget>(
			this IMergeableSource<TTarget, TTarget> merge,
			Expression<Func<TTarget, TTarget, bool>> deleteCondition)
				where TTarget : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (deleteCondition == null) throw new ArgumentNullException(nameof(deleteCondition));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.UpdateWithDelete(null, null, deleteCondition));
		}

		/// <summary>
		/// IMPORTANT: This operation supported only by Oracle Database.
		/// Adds new update with delete operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using data from the same fields of source record
		/// for each record that was matched in source and target and passes filtering with specified predicate,
		/// if it wasn't processed by previous operations.
		/// After that it removes updated records if they are matched by delete predicate.
		/// </summary>
		/// <typeparam name="TTarget">Target and source records type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Update execution condition over target and source records.</param>
		/// <param name="deleteCondition">Delete execution condition over updated target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TTarget> UpdateWhenMatchedAndThenDelete<TTarget>(
			this IMergeableSource<TTarget, TTarget> merge,
			Expression<Func<TTarget, TTarget, bool>> searchCondition,
			Expression<Func<TTarget, TTarget, bool>> deleteCondition)
				where TTarget : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));
			if (deleteCondition == null) throw new ArgumentNullException(nameof(deleteCondition));

			return ((MergeDefinition<TTarget, TTarget>)merge).AddOperation(
				MergeDefinition<TTarget, TTarget>.Operation.UpdateWithDelete(searchCondition, null, deleteCondition));
		}

		/// <summary>
		/// IMPORTANT: This operation supported only by Oracle Database.
		/// Adds new update with delete operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using user-defined values for target columns
		/// for each record that was matched in source and target, if it wasn't processed by previous operations.
		/// After that it removes updated records if they matched by delete predicate.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="setter">Update record expression using target and source records.
		/// Expression should be a call to target record constructor with field/properties initializers to be recognized by API.</param>
		/// <param name="deleteCondition">Delete execution condition over updated target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenMatchedThenDelete<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, TTarget>> setter,
			Expression<Func<TTarget, TSource, bool>> deleteCondition)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (setter          == null) throw new ArgumentNullException(nameof(setter));
			if (deleteCondition == null) throw new ArgumentNullException(nameof(deleteCondition));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.UpdateWithDelete(null, setter, deleteCondition));
		}

		/// <summary>
		/// IMPORTANT: This operation supported only by Oracle Database.
		/// Adds new update with delete operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table using user-defined values for target columns
		/// for each record that was matched in source and target and passes filtering with specified predicate,
		/// if it wasn't processed by previous operations.
		/// After that it removes updated records if they matched by delete predicate.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Update execution condition over target and source records.</param>
		/// <param name="setter">Update record expression using target and source records.
		/// Expression should be a call to target record constructor with field/properties initializers to be recognized by API.</param>
		/// <param name="deleteCondition">Delete execution condition over updated target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenMatchedAndThenDelete<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, bool>> searchCondition,
			Expression<Func<TTarget, TSource, TTarget>> setter,
			Expression<Func<TTarget, TSource, bool>> deleteCondition)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));
			if (setter          == null) throw new ArgumentNullException(nameof(setter));
			if (deleteCondition == null) throw new ArgumentNullException(nameof(deleteCondition));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.UpdateWithDelete(searchCondition, setter, deleteCondition));
		}
		#endregion

		#region Delete
		/// <summary>
		/// Adds new delete operation to merge and returns new merge command with added operation.
		/// This operation removes record in target table for each record that was matched in source and target,
		/// if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> DeleteWhenMatched<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge)
				where TTarget : class
				where TSource : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Delete(null));
		}

		/// <summary>
		/// Adds new delete operation to merge and returns new merge command with added operation.
		/// This operation removes record in target table for each record that was matched in source and target,
		/// if it was matched by operation predicate and wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over target and source records.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> DeleteWhenMatchedAnd<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TSource, bool>> searchCondition)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.Delete(searchCondition));
		}
		#endregion

		#region UpdateBySource
		/// <summary>
		/// IMPORTANT: This operation supported only by Microsoft SQL Server.
		/// Adds new update by source operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table for each record that was matched only in target
		/// using user-defined values for target columns, if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="setter">Update record expression using target record. Expression should be a call to
		/// target record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenNotMatchedBySource<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge  == null) throw new ArgumentNullException(nameof(merge));
			if (setter == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.UpdateBySource(null, setter));
		}

		/// <summary>
		/// IMPORTANT: This operation supported only by Microsoft SQL Server.
		/// Adds new update by source operation to merge and returns new merge command with added operation.
		/// This operation updates record in target table for each record that was matched only in target
		/// using user-defined values for target columns, if it passed filtering by operation predicate and
		/// wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over target record.</param>
		/// <param name="setter">Update record expression using target record. Expression should be a call to
		/// target record constructor with field/properties initializers to be recognized by API.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> UpdateWhenNotMatchedBySourceAnd<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, bool>> searchCondition,
			Expression<Func<TTarget, TTarget>> setter)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));
			if (setter          == null) throw new ArgumentNullException(nameof(setter));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.UpdateBySource(searchCondition, setter));
		}
		#endregion

		#region DeleteBySource
		/// <summary>
		/// IMPORTANT: This operation supported only by Microsoft SQL Server.
		/// Adds new delete by source operation to merge and returns new merge command with added operation.
		/// This operation removes record in target table for each record that was matched only in target
		/// and wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> DeleteWhenNotMatchedBySource<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge)
				where TTarget : class
				where TSource : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.DeleteBySource(null));
		}

		/// <summary>
		/// IMPORTANT: This operation supported only by Microsoft SQL Server.
		/// Adds new delete by source operation to merge and returns new merge command with added operation.
		/// This operation removes record in target table for each record that was matched only in target
		/// and passed filtering with operation predicate, if it wasn't processed by previous operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command builder interface.</param>
		/// <param name="searchCondition">Operation execution condition over target record.</param>
		/// <returns>Returns new merge command builder with new operation.</returns>
		public static IMergeable<TTarget, TSource> DeleteWhenNotMatchedBySourceAnd<TTarget, TSource>(
			this IMergeableSource<TTarget, TSource> merge,
			Expression<Func<TTarget, bool>> searchCondition)
				where TTarget : class
				where TSource : class
		{
			if (merge           == null) throw new ArgumentNullException(nameof(merge));
			if (searchCondition == null) throw new ArgumentNullException(nameof(searchCondition));

			return ((MergeDefinition<TTarget, TSource>)merge).AddOperation(
				MergeDefinition<TTarget, TSource>.Operation.DeleteBySource(searchCondition));
		}
		#endregion

		#region Merge
		/// <summary>
		/// Executes merge command and returns total number of target records, affected by merge operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command definition.</param>
		/// <returns>Returns number of target table records, affected by merge comand.</returns>
		public static int Merge<TTarget, TSource>(this IMergeable<TTarget, TSource> merge)
			where TTarget : class
			where TSource : class
		{
			if (merge == null) throw new ArgumentNullException(nameof(merge));

			var definition = (MergeDefinition<TTarget, TSource>)merge;

			DataConnection dataConnection;

			switch (definition.Target.DataContext)
			{
				case DataConnection dcon : dataConnection = dcon;                     break;
				case DataContext    dctx : dataConnection = dctx.GetDataConnection(); break;
				default:
					throw new ArgumentException("DataContext must be of DataConnection or DataContext type.");
			}

			return dataConnection.DataProvider.Merge(dataConnection, definition);
		}
		#endregion

		#region MergeAsync
		/// <summary>
		/// Executes merge command and returns total number of target records, affected by merge operations.
		/// </summary>
		/// <typeparam name="TTarget">Target record type.</typeparam>
		/// <typeparam name="TSource">Source record type.</typeparam>
		/// <param name="merge">Merge command definition.</param>
		/// <param name="token">Asynchronous operation cancellation token.</param>
		/// <returns>Returns number of target table records, affected by merge comand.</returns>
		public static async Task<int> MergeAsync<TTarget, TSource>(
			this IMergeable<TTarget, TSource> merge,
			CancellationToken token = default)
				where TTarget : class
				where TSource : class
		{
			if (merge == null)
				throw new ArgumentNullException(nameof(merge));

			var definition = (MergeDefinition<TTarget, TSource>)merge;

			DataConnection dataConnection;

			switch (definition.Target.DataContext)
			{
				case DataConnection dcon : dataConnection = dcon;                     break;
				case DataContext    dctx : dataConnection = dctx.GetDataConnection(); break;
				default:
					throw new ArgumentException("DataContext must be of DataConnection or DataContext type.");
			}

			return await dataConnection.DataProvider.MergeAsync(dataConnection, definition, token);
		}
		#endregion
	}

	/// <summary>
	/// Merge command builder that have only target table configured.
	/// Only operation available for this type of builder is source configuration.
	/// </summary>
	/// <typeparam name="TTarget">Target record type.</typeparam>
	public interface IMergeableUsing<TTarget>
	{
	}

	/// <summary>
	/// Merge command builder that have only target table and source configured.
	/// Only operation available for this type of builder is match (ON) condition configuration.
	/// </summary>
	/// <typeparam name="TTarget">Target record type.</typeparam>
	/// <typeparam name="TSource">Source record type.</typeparam>
	public interface IMergeableOn<TTarget, TSource>
	{
	}

	/// <summary>
	/// Merge command builder that have target table, source and match (ON) condition configured.
	/// You can only add operations to this type of builder.
	/// </summary>
	/// <typeparam name="TTarget">Target record type.</typeparam>
	/// <typeparam name="TSource">Source record type.</typeparam>
	public interface IMergeableSource<TTarget, TSource>
	{
	}

	/// <summary>
	/// Merge command builder that have target table, source, match (ON) condition and at least one operation configured.
	/// You can add more operations to this type of builder or execute command.
	/// </summary>
	/// <typeparam name="TTarget">Target record type.</typeparam>
	/// <typeparam name="TSource">Source record type.</typeparam>
	public interface IMergeable<TTarget, TSource> : IMergeableSource<TTarget, TSource>
	{
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2015 Google Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<resources>
    <string name="app_name">Project Tango Plane Fitting</string>
    <string name="drawer_header">Main panel header</string>
    <string name="key_debug_point_cloud">key_debug_point_cloud</string>
    <string name="menu_name">Plane Fitting</string>
    <string name="open_drawer_button">Open drawer button</string>
    <string name="settings">Settings</string>
</resources>


text:
def main():
    """The range() function

    Demonstrating how range() function works.

    """
    print(range(10))

    print(list(range(5)))

if __name__ == '__main__':
    main()


text:
package balan

import (
	"bytes"
	"encoding/json"
	"errors"
	"github.com/san-lab/banketh-quorum/lib/bank/sangermany/lib/uriuti"
)

type MethodResponseBalance struct {
	Currency          string  `json:"currency"`
	AvailableBalance  float64 `json:"availableBalance"`
	ReferenceStandard string  `json:"referenceStandard"`
	CreationDate      string  `json:"creationDate"`
	SubproductCode    string  `json:"subproductCode"`
	BalanceWittholded float64 `json:"balanceWittholded"`
	Balance           float64 `json:"balance"`
	ContractStatus    string  `json:"contractStatus"`
	AccountNumber     struct {
		Iban            string `json:"iban"`
		LocalAccount    string `json:"localAccount"`
		PartenonAccount string `json:"partenonAccount"`
	} `json:"accountNumber"`
}

//Function to get the balance of the informed account
func GetBalance(BANKWSURL string, BANKEMPRESA string, BANKCENTRO string, BANKPRODUCTO string, BANKCONTRATO string, BANKUSER string, BANKPWD string) (balance float64, err error) {

	//Avoind Panic Crashing
	defer func() {
		if err := recover(); err != nil {
			errMsg := err.(string) + " : Panic recovered in GeBalance"
			err = errors.New(errMsg)
		}
	}()

	// Build xml SOAP request with headers providing PTN contractNumber
	company := BANKEMPRESA
	centre := BANKCENTRO
	product := BANKPRODUCTO
	contract := BANKCONTRATO

	server := BANKWSURL
	user := BANKUSER
	pass := BANKPWD

	urlParameter := map[string]interface{}{
		"server":   server,
		"company":  company,
		"centre":   centre,
		"product":  product,
		"contract": contract,
	}

	urlString := "{{.server}}/{{.company}}-{{.centre}}-{{.product}}-{{.contract}}"

	//Replacing values in REST URL
	url, err := uriuti.BuildURL(urlString, urlParameter)
	if err != nil {

		return 0, errors.New(err.Error() + ": method GetBalance")

	}

	//Delegating URL rest call to uriuti pachage
	in, err := uriuti.CallURLREST(url, user, pass, "GET")

	if err != nil {
		return 0, errors.New(err.Error() + ": method GetBalance")
	}

	//Creating parser to parse response
	parser := json.NewDecoder(bytes.NewBufferString(in))

	// Fill the record with the response
	var record MethodResponseBalance

	// Use json.Decode for reading streams of JSON
	//data and adding values to go object
	if err := parser.Decode(&record); err != nil {
		err = errors.New(err.Error() + ": GetBalance")
		return 0, err
	}

	return record.AvailableBalance, err

}


text:
import React from 'react';
import Example from '../components/example';

class Grid extends React.Component {
  render() {
    const { brand } = this.props;
    const height = window.innerHeight;

    const styles = {
      cell: {
        color: 'white',
        border: '1px solid white',
        padding: '5px 0',
        textAlign: 'center',
        width: '100%'
      }
    }

    return (

 Grid

                    <div className={ `background-${brand}` } style={ styles.cell }>0

                    <div className={ `background-${brand}` } style={ styles.cell }>12

                    <div className={ `background-${brand}` } style={ styles.cell }>1

                    <div className={ `background-${brand}` } style={ styles.cell }>11

                    <div className={ `background-${brand}` } style={ styles.cell }>2

                    <div className={ `background-${brand}` } style={ styles.cell }>10

                    <div className={ `background-${brand}` } style={ styles.cell }>3

                    <div className={ `background-${brand}` } style={ styles.cell }>9

                    <div className={ `background-${brand}` } style={ styles.cell }>4

                    <div className={ `background-${brand}` } style={ styles.cell }>8

                    <div className={ `background-${brand}` } style={ styles.cell }>5

                    <div className={ `background-${brand}` } style={ styles.cell }>7

                    <div className={ `background-${brand}` } style={ styles.cell }>6

                    <div className={ `background-${brand}` } style={ styles.cell }>6

                    <div className={ `background-${brand}` } style={ styles.cell }>7

                    <div className={ `background-${brand}` } style={ styles.cell }>5

                    <div className={ `background-${brand}` } style={ styles.cell }>8

                    <div className={ `background-${brand}` } style={ styles.cell }>4

                    <div className={ `background-${brand}` } style={ styles.cell }>9

                    <div className={ `background-${brand}` } style={ styles.cell }>3

                    <div className={ `background-${brand}` } style={ styles.cell }>10

                    <div className={ `background-${brand}` } style={ styles.cell }>2

                    <div className={ `background-${brand}` } style={ styles.cell }>11

                    <div className={ `background-${brand}` } style={ styles.cell }>1

                    <div className={ `background-${brand}` } style={ styles.cell }>12

                    <div className={ `background-${brand}` } style={ styles.cell }>0

            <Example>

            </Example>

                the grid also has breakpoint options for

(xs, sm, md, lg, xl)

                using these options can be done as follows

col-|size|-|column|-|width|

    );
  }
}

export default Grid;


text:
class Vertex2D : public TObject{

public:
    Vertex2D();

    std::vector<Line*>v_lines;
    double weight;
    static TMatrixD I22;
    double chi2;
    double nhits;
    int iside;

    bool has3D;
    bool isremoved;

    double dir();

    void Add(Line *line);

    int GetNTracks(){return v_lines.size();}

    void Solve();

    TMatrixD p;

    void SolveOnce();

    void Draw();

    void SetP0andSlopes(double x, double z, double* slope);

    void SetP0(double x, double z);

    double GetTotalChi2();

    double GetTotalNHits();

    bool Contains(Line* line);

    bool ContainsAll(Vertex2D *vv);

    bool BelongsTo(Vertex2D* vv);

    int Merge(Vertex2D *vv);

    int Distance(Vertex2D *vv){
        return sqrt((p-vv->p).E2Norm());
    }

    void Print();

    double x,z;
    double x_err,z_err;

    double V; //probability in arbitrary unit

    double Z(){return z;}
    double XY(){return x;}

    static bool DEBUG;

    static TMinuit *gMinuit;

    static void fcn_CombinedFit(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);

    double fun_GetCombinedFitChi2(Double_t *par);

    void RemoveOutliers();

    void CombineFit();

    double fun_GetCombinedFitChi2_New(Double_t *par);
    static void fcn_CombinedFit_New(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);

    void CombineFit_New();

    void CombineFit_New_Adaptive();

};

class VertexFinder2D_ZVTOP : public TObject{

public:

    VertexFinder2D_ZVTOP(){
        v_track=new std::vector<Line*>;
        Niteration=0;
        iside=-1;
        x=0;
        z=0;
    }

    VertexFinder2D_ZVTOP( int side){
        v_track=new std::vector<Line*>;
        Niteration=0;
        iside=side;
        x=0;
        z=0;
    }

    ~VertexFinder2D_ZVTOP(){
        delete v_track;
    }

    void SetLineColection(std::vector<Line*> *v){

        *v_track=*v;
        return;
        //        v_track=v;
    }

    void SetVertexColection(std::vector<Vertex2D*> *v){
        v_v2d=v;
    }

    int iside;
    int Niteration;
    static bool DEBUG;

    void FindBestVertex();
    void FindVertex();

    double fun_ZVTOP_V(double* x,double* par);
    double fun_ZVTOP_f(Line* line, double *x);

    static void fcn_ZVTOP(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
    {
        VertexFinder2D_ZVTOP *v=(VertexFinder2D_ZVTOP*)gMinuit->GetObjectFit();
        f=v->fun_ZVTOP_V(par,NULL);
    }

    std::vector<Line*> *v_track;

    double x,z;
    double x_err,z_err;

    static TMinuit *gMinuit;

    std::vector<Vertex2D*> *v_v2d;

};

#endif // VERTEX2D_H