text:
#ifndef UTIL_FUNCTIONAL_H
#define UTIL_FUNCTIONAL_H
/**
 * @file util/functional.h
 * @author Ian Yang
 * @date Created <2009-10-12 12:20:03>
 * @date Updated <2009-10-12 12:28:55>
 * @brief helper functions for std algorithms
 */
#include <functional>

namespace izenelib {
namespace util {

template<typename T>
struct first_equal_to : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.first == y.first;
    }
};

template<typename T>
struct first_not_equal_to : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return !(x.first == y.first);
    }
};

template<typename T>
struct first_less : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.first < y.first;
    }
};

template<typename T>
struct first_less_equal : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.first < y.first || x.first == y.first;
    }
};

template<typename T>
struct first_greater : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return y.first < x.first;
    }
};

template<typename T>
struct first_greater_equal : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return y.first < x.first || y.first == x.first;
    }
};

template<typename T>
struct second_equal_to : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.second == y.second;
    }
};

template<typename T>
struct second_not_equal_to : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return !(x.second == y.second);
    }
};

template<typename T>
struct second_less : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.second < y.second;
    }
};

template<typename T>
struct second_less_equal : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return x.second < y.second || x.second == y.second;
    }
};

template<typename T>
struct second_greater : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return y.second < x.second;
    }
};

template<typename T>
struct second_greater_equal : public std::binary_function<T, T, bool>
{
    bool operator()(const T& x, const T& y) const
    {
        return y.second < x.second || y.second == x.second;
    }
};

}} // namespace izenelib::util

#endif // UTIL_FUNCTIONAL_H


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

#ifndef Patternist_ReturnOrderBy_H
#define Patternist_ReturnOrderBy_H

#include "qorderby_p.h"
#include "qunlimitedcontainer_p.h"

QT_BEGIN_HEADER

QT_BEGIN_NAMESPACE

namespace QPatternist
{
    /**
     * @short Together with OrderBy, it implements XQuery 1.0's <tt>order by</tt> expression.
     *
     * ReturnOrderBy evaluates the sort keys and values, and hands it over to
     * OrderBy, which is an AST ancestor, using SortTuples.
     *
     * @author Frans Englich <frans.englich@nokia.com>
     * @ingroup Patternist_expressions
     */
    class ReturnOrderBy : public UnlimitedContainer
    {
    public:
        /**
         * In @p operands the first item is the return expression, and the
         * rest, which is at least one, are the sort keys.
         */
        ReturnOrderBy(const OrderBy::Stability stability,
                      const OrderBy::OrderSpec::Vector &oSpecs,
                      const Expression::List &operands);

        virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
        virtual bool evaluateEBV(const DynamicContext::Ptr &context) const;
        virtual SequenceType::Ptr staticType() const;
        virtual SequenceType::List expectedOperandTypes() const;
        virtual Expression::Ptr compress(const StaticContext::Ptr &context);
        virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const;
        virtual ID id() const;

        inline OrderBy::OrderSpec::Vector orderSpecs() const
        {
            return m_orderSpecs;
        }

        inline OrderBy::Stability stability() const
        {
            return m_stability;
        }

        /**
         * In the case of that we don't have a for-expression beloning us, but
         * only a let clause, this ReturnOrderBy breaks if it stays in the AST.
         * So, by default we assume that we should write ourselves away, unless
         * this function is called. The associated ForClause will call it
         * during typeCheck(), if it exists.
         */
        inline void setStay(const bool a)
        {
            m_flyAway = !a;
        }

        virtual Properties properties() const;
    private:
        /**
         * This variable is unfortunately only used at compile time. However,
         * it's tricky to get rid of it due to how QueryTransformParser would
         * have to be adapted.
         */
        const OrderBy::Stability    m_stability;

        OrderBy::OrderSpec::Vector  m_orderSpecs;

        /**
         * @see stay()
         */
        bool                        m_flyAway;
    };
}

QT_END_NAMESPACE

QT_END_HEADER

#endif

redpajama_set_name: RedPajamaGithub


text:
<a href="<?php print $front_page; ?>"><img src="<?php print $logo; ?>" alt="Activate"> Apptivate

      <?php print render($page['navigation']); ?>

    <?php print render($page['home_welcome']); ?>

Filtrar por
      <?php print render($page['filter_items']); ?>

    <?php print render($page['home_activities']); ?>

      <?php print render($page['footer']); ?>


text:
<?php
/**
     * Created by PhpStorm.
     * User: salmah
     * Date: 03/20/16
     * Time: 11:07 PM
     */

namespace UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity()
 * @ORM\Table(name="user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @Assert\Choice({"male", "female", "other"})
     * @ORM\Column(type="string")
     */
    protected $gender;
    /**
     * @var
     * @ORM\Column(type="string",name="first_name")
     * @Assert\NotBlank()
     * @Assert\Length(min=3)
     */
    protected $firstName;
    /**
     * @var
     * @ORM\Column(name="last_name",type="string")
     * @Assert\Length(min=3)
     * @Assert\NotBlank()
     */
    protected $lastName;

    /**
     * @ORM\ManyToOne(targetEntity="UserBundle\Entity\Group")
     * @ORM\JoinTable(name="group",
     *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
     * )
     */
    protected $group;

    /**
     * @ORM\OneToOne(targetEntity="Invitation")
     * @ORM\JoinColumn(referencedColumnName="code",nullable=false)
     * @Assert\NotNull(message="Your invitation is wrong")
     */
    protected $invitation;

    public function __construct()
    {
        parent::__construct();
        // your own logic
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * @param mixed $gender
     */
    public function setGender($gender)
    {
        $this->gender = $gender;
    }

    /**
     * @return mixed
     */
    public function getFirstName()
    {
        return $this->firstName;
    }

    /**
     * @param mixed $firstName
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
    }

    /**
     * @return mixed
     */
    public function getLastName()
    {
        return $this->lastName;
    }

    /**
     * @param mixed $lastName
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;
    }

    public function setUsername($username)
    {
        return $this->username = $this->email;
    }

    /**
     * @return mixed
     */
    public function getGroup()
    {
        return $this->group;
    }

    /**
     * @param mixed $group
     */
    public function setGroup($group)
    {
        $this->group = $group;
    }

    /**
     * @return mixed
     */
    public function getInvitation()
    {
        return $this->invitation;
    }

    /**
     * @param mixed $invitation
     */
    public function setInvitation($invitation)
    {
        $this->invitation = $invitation;
    }

    public function setUsernameCanonical($usernameCanonical)
    {
        $this->username = $this->email;
        $this->usernameCanonical = $this->email;
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8"></meta>
		<meta name="generator" content="JsDoc Toolkit"></meta>
		<title>enchant.WebAudioSound | JsDoc Reference</title>

		<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"></meta>
		<meta name="mobileoptimized" content="0"></meta>

		<link rel="stylesheet" href="../css/all.css" media="all"></link>
		<link rel="stylesheet" href="../css/handheld.css" media="only screen and (max-width: 660px)"></link>
		<link rel="stylesheet" href="../css/handheld.css" media="handheld"></link>
		<link rel="stylesheet" href="../css/screen.css" media="screen and (min-width: 661px)"></link>

			Classes
			Files

Classes

		<input type="text" name="classFilter" class="classFilter" id="ClassFilter" placeholder="Filter"></input>

_global_

enchant . Action

enchant . ActionEventTarget

enchant . BinaryInputManager

enchant . BinaryInputSource

enchant . CanvasLayer

enchant . CanvasScene

enchant . Class

enchant . Core

enchant . Deferred

enchant . DOMScene

enchant . DOMSound

enchant . Easing

enchant . Entity

enchant . ENV

enchant . Event

enchant . EventTarget

enchant . Game

enchant . Group

enchant . InputManager

enchant . InputSource

enchant . KeyboardInputManager

enchant . KeyboardInputSource

enchant . Label

enchant . LoadingScene

enchant . Map

enchant . Node

enchant . ParallelAction

enchant . Scene

enchant . Sprite

enchant . Surface

enchant . Timeline

enchant . Tween

enchant . WebAudioSound

		Documentation generator: JsDoc Toolkit 2.4.0

		Template: Codeview 1.2

		Generated on: 2016-0-4 21:08

			Class enchant.WebAudioSound

Defined in: enchant.js

Extends
						enchant.EventTarget

Class Summary

							Constructor Attributes
							Constructor Name and Description

									enchant.WebAudioSound()

Field Summary

								Field Attributes
								Field Name and Description

										currentTime

Aktuelle Wiedergabeposition (seconds).

										duration

Die länge der Sounddatei in Sekunden.

										volume

Lautstärke.

Method Summary

								Method Attributes
								Method Name and Description

clone()

Erstellt eine Kopie dieses Soundobjektes.

									<static>

enchant.WebAudioSound.load(src, type, callback, onerror)

Läd eine Audio Datei und erstellt ein WebAudioSound objekt.

pause()

Pausiert die Wiedergabe.

play(dup)

Startet die Wiedergabe.

stop()

Stoppt die Wiedergabe.

Methods borrowed from class enchant.EventTarget:

addEventListener

clearEventListener

dispatchEvent

on

removeEventListener

						Class Detail

						enchant.WebAudioSound()

						Field Detail

							{Number}

							currentTime

							Aktuelle Wiedergabeposition (seconds).

							{Number}

							duration

							Die länge der Sounddatei in Sekunden.

							{Number}

							volume

							Lautstärke. 0 (stumm) ~ 1 (volle Lautstärke).

						Method Detail

									{enchant.WebAudioSound}

									clone()

									Erstellt eine Kopie dieses Soundobjektes.

Returns:

{enchant.WebAudioSound} Kopiertes Sound Objekt.

									<static>

									{enchant.WebAudioSound}

									enchant.WebAudioSound.load(src, type, callback, onerror)

									Läd eine Audio Datei und erstellt ein WebAudioSound objekt.

Parameters:

												{String} src

Pfad zu der zu ladenden Audiodatei.

												{String} type
												Optional

MIME Type der Audtiodatei.

												{Function} callback
												Optional

												{Function} onerror
												Optional

Returns:

{enchant.WebAudioSound} WebAudioSound

									pause()

									Pausiert die Wiedergabe.

									play(dup)

									Startet die Wiedergabe.

Parameters:

												{Boolean} dup
												Optional, Default: false

Wenn true, Objekt spielt neuen Sound während im letzten Ton hält.

									stop()

									Stoppt die Wiedergabe.


text:
@extends('uiadmin::layouts.master')

@section('content')

                    {{ $module_action }} menu

            {!! Form::open(array('method' => 'post', 'role' => 'form')) !!}
                <input type="hidden" name="id" value="{{ $ui_menu->id }}">

                            Nome

{{ $ui_menu->name }}

Tem certeza que deseja remover?

                    <button type="submit" class="btn btn-primary">
                          Sim
                    </button>

                          Não

            {!! Form::close() !!}

@stop


text:
"""Imports conversion adjustments for conversions that already exist.

To set up a conversion tracker, run the add_conversion_tracker.py example.

"""

from googleads import adwords

CONVERSION_NAME = 'INSERT_CONVERSION_NAME_HERE'

GCLID = 'INSERT_GCLID_HERE'

ADJUSTMENT_TYPE = 'INSERT_ADJUSTMENT_TYPE_HERE'

CONVERSION_TIME = 'INSERT_CONVERSION_TIME_HERE'

ADJUSTMENT_TIME = 'INSERT_ADJUSTMENT_TIME_HERE'

ADJUSTED_VALUE = 'INSERT_ADJUST_VALUE_HERE'

def main(client, conversion_name, gclid, adjustment_type, conversion_time,
         adjustment_time, adjusted_value):
  # Initialize appropriate services.
  offline_conversion_service = client.GetService(
      'OfflineConversionAdjustmentFeedService', version='v201809')

  # Associate conversion adjustments with the existing named conversion tracker.
  # The GCLID should have been uploaded before with a conversion.
  feed = {
      'xsi_type': 'GclidOfflineConversionAdjustmentFeed',
      'conversionName': conversion_name,
      'googleClickId': gclid,
      'conversionTime': conversion_time,
      'adjustmentType': adjustment_type,
      'adjustmentTime': adjustment_time,
      'adjustedValue': adjusted_value
  }

  offline_conversion_operation = {'operator': 'ADD', 'operand': feed}

  offline_conversion_response = offline_conversion_service.mutate(
      [offline_conversion_operation])

  new_feed = offline_conversion_response['value'][0]

  print ('Uploaded offline conversion adjustment value of "%s" for Google '
         'Click ID "%s"' % (new_feed['adjustedValue'],
                            new_feed['googleClickId']))

if __name__ == '__main__':
  # Initialize client object.
  adwords_client = adwords.AdWordsClient.LoadFromStorage()

  main(adwords_client, CONVERSION_NAME, GCLID, ADJUSTMENT_TYPE, CONVERSION_TIME,
       ADJUSTMENT_TIME, ADJUSTED_VALUE)


text:
#region Apache License Version 2.0

#endregion Apache License Version 2.0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SF.Sys.Collections.Generic
{
	public enum PositionModifyAction
	{
		First,
		Previous,
		Next,
		Last,
		Insert
	}
	public static class ListExtension
	{
		public static bool ModifyPosition<I>(
			this IList<I> List,
			I Model,
			PositionModifyAction Action,
			Predicate<I> IsCurItem,
			Func<I, int> GetPosition,
			Action<I, int> SetPosition
			)
		{
			var curIndex = List.IndexOf(Model);
			switch (Action)
			{
				case PositionModifyAction.Insert:
					if (curIndex == GetPosition(Model))
						return false;
					if (curIndex != -1)
						List.RemoveAt(curIndex);
					var newPos = GetPosition(Model);
					if (newPos < List.Count)
						List.Insert(newPos, Model);
					else
						List.Add(Model);
					break;
				case PositionModifyAction.First:
					if (curIndex != -1)
					{
						if (curIndex == 0)
							return false;
						List.RemoveAt(curIndex);
					}
					List.Insert(0, Model);
					break;
				case PositionModifyAction.Last:
					if (curIndex != -1)
					{
						if (curIndex == List.Count - 1)
							return false;
						List.RemoveAt(curIndex);
					}
					List.Add(Model);
					break;
				case PositionModifyAction.Next:
					if (curIndex != -1)
					{
						if (curIndex == List.Count - 1)
							return false;
						List.RemoveAt(curIndex);
					}
					if (curIndex == -1 || curIndex >= List.Count - 1)
						List.Add(Model);
					else
						List.Insert(curIndex + 1, Model);
					break;
				case PositionModifyAction.Previous:
					if (curIndex != -1)
					{
						if (curIndex == 0)
							return false;
						List.RemoveAt(curIndex);
					}
					if (curIndex == -1)
						List.Insert(0, Model);
					else
						List.Insert(curIndex - 1, Model);
					break;
			}
			for (var i = 0; i < List.Count; i++)
				if (GetPosition(List[i]) != i)
					SetPosition(List[i], i);
			return true;
		}
	}
}


text:
namespace SingItService
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;

    [Table("singitdb.song")]
    public partial class song
    {
        public song()
        {
            ratings = Utilities.JSON_EMPTY_OBJECT;
        }

        [Key]
        [StringLength(255)]
        public string songfilename { get; set; }

        [Required]
        [StringLength(16)]
        public string username { get; set; }

        [Required]
        [StringLength(255)]
        public string songtitle { get; set; }

        [Required]
        [StringLength(255)]
        public string songgenre { get; set; }

        [StringLength(1073741823)]
        public string ratings { get; set; }

        public virtual user user { get; set; }
    }
}


text:
class SkPictureRecord;
class SkStream;
class SkWStream;

class SkPicturePlayback {
public:
    SkPicturePlayback();
    SkPicturePlayback(const SkPicturePlayback& src);
    explicit SkPicturePlayback(const SkPictureRecord& record);
    explicit SkPicturePlayback(SkStream*);

    virtual ~SkPicturePlayback();

    void draw(SkCanvas& canvas);

    void serialize(SkWStream*) const;

    void dumpSize() const;

    // Can be called in the middle of playback (the draw() call). WIll abort the
    // drawing and return from draw() after the "current" op code is done
    void abort();

private:

    class TextContainer {
    public:
        size_t length() { return fByteLength; }
        const void* text() { return (const void*) fText; }
        size_t fByteLength;
        const char* fText;
    };

    const SkBitmap& getBitmap() {
        int index = getInt();
        SkASSERT(index > 0);
        return fBitmaps[index - 1];
    }

    int getIndex() { return fReader.readInt(); }
    int getInt() { return fReader.readInt(); }

    const SkMatrix* getMatrix() {
        int index = getInt();
        if (index == 0) {
            return NULL;
        }
        SkASSERT(index > 0 && index <= fMatrixCount);
        return &fMatrices[index - 1];
    }

    const SkPath& getPath() {
        return (*fPathHeap)[getInt() - 1];
    }

    SkPicture& getPicture() {
        int index = getInt();
        SkASSERT(index > 0 && index <= fPictureCount);
        return *fPictureRefs[index - 1];
    }

    SkShape* getShape() {
        int index = getInt();
        SkASSERT(index > 0 && index <= fShapeCount);
        return fShapes[index - 1];
    }

    const SkPaint* getPaint() {
        int index = getInt();
        if (index == 0) {
            return NULL;
        }
        SkASSERT(index > 0 && index <= fPaintCount);
        return &fPaints[index - 1];
    }

    const SkRect* getRectPtr() {
        if (fReader.readBool()) {
            return fReader.skipRect();
        } else {
            return NULL;
        }
    }

    const SkIRect* getIRectPtr() {
        if (fReader.readBool()) {
            return (const SkIRect*)fReader.skip(sizeof(SkIRect));
        } else {
            return NULL;
        }
    }

    const SkRegion& getRegion() {
        int index = getInt();
        SkASSERT(index > 0);
        return fRegions[index - 1];
    }

    SkScalar getScalar() { return fReader.readScalar(); }

    void getText(TextContainer* text) {
        size_t length = text->fByteLength = getInt();
        text->fText = (const char*)fReader.skip(length);
    }

    void init();

#ifdef SK_DEBUG_SIZE
public:
    int size(size_t* sizePtr);
    int bitmaps(size_t* size);
    int paints(size_t* size);
    int paths(size_t* size);
    int regions(size_t* size);
#endif

#ifdef SK_DEBUG_DUMP
private:
    void dumpBitmap(const SkBitmap& bitmap) const;
    void dumpMatrix(const SkMatrix& matrix) const;
    void dumpPaint(const SkPaint& paint) const;
    void dumpPath(const SkPath& path) const;
    void dumpPicture(const SkPicture& picture) const;
    void dumpRegion(const SkRegion& region) const;
    int dumpDrawType(char* bufferPtr, char* buffer, DrawType drawType);
    int dumpInt(char* bufferPtr, char* buffer, char* name);
    int dumpRect(char* bufferPtr, char* buffer, char* name);
    int dumpPoint(char* bufferPtr, char* buffer, char* name);
    void dumpPointArray(char** bufferPtrPtr, char* buffer, int count);
    int dumpPtr(char* bufferPtr, char* buffer, char* name, void* ptr);
    int dumpRectPtr(char* bufferPtr, char* buffer, char* name);
    int dumpScalar(char* bufferPtr, char* buffer, char* name);
    void dumpText(char** bufferPtrPtr, char* buffer);
    void dumpStream();

public:
    void dump() const;
#endif

private:
    SkPathHeap* fPathHeap;  // reference counted
    SkBitmap* fBitmaps;
    int fBitmapCount;
    SkMatrix* fMatrices;
    int fMatrixCount;
    SkPaint* fPaints;
    int fPaintCount;
    SkRegion* fRegions;
    int fRegionCount;
    mutable SkFlattenableReadBuffer fReader;

    SkPicture** fPictureRefs;
    int fPictureCount;
    SkShape** fShapes;
    int fShapeCount;

    SkRefCntPlayback fRCPlayback;
    SkTypefacePlayback fTFPlayback;
    SkFactoryPlayback*   fFactoryPlayback;
#ifdef ANDROID
    SkMutex fDrawMutex;
#endif
};

#endif


text:
package org.seasar.doma.internal.apt.processor.entity;

import org.seasar.doma.Entity;

@Entity
public class NameUnsafeEntity_ {}


text:
/*
 * Parser.h
 *
 *  Created on: Nov 11, 2013
 *      Author: dan
 */

#ifndef TOKENIZER_PARSER_H_
#define TOKENIZER_PARSER_H_

#include <string>
#include <sstream>
#include <map>
#include <vector>

using namespace std;

namespace Parser{

inline string str(char c){
    stringstream s;
    if(c<20) s<<(int)c;
    else s<<c;
    return s.str();
}

template<class TokenType>
struct Token{
    TokenType type;
    string text;
    size_t start, end;
    Token(TokenType type=TokenType(0), string text=""):type(type),text(text),start(0),end(0){}
    size_t size()const{ if(end<start) return 0; return end-start; }
};
template<class TokenType>
static ostream& operator<<(ostream& out, const Token<TokenType>& t){
    out<<t.type;
    if(t.type==1) return out<<"{"<<t.start<<":"<<t.text<<":"<<t.end<<"}";
    return out;
}

struct tstream_state{
	size_t i;
	tstream_state(size_t i):i(i){}
};
template<class TokenType>
struct TokenStream{
	vector< Token<TokenType> > st;
	size_t i;
	size_t end;
	TokenStream():i(0),end((size_t)-1){}
	void clear(){ i=0;st.clear(); }
	void reset(){ i=0; }
	TokenStream<TokenType>& operator<<(Token<TokenType> tkn){st.push_back(tkn);return *this;}
	TokenStream<TokenType>& operator>>(Token<TokenType>& tkn){if(eof()) return *this; tkn=st[i++]; return *this;}
	TokenStream<TokenType>& operator<<(TokenType tkn){st.push_back(Token<TokenType>(tkn,""));return *this;}
	TokenStream<TokenType>& operator>>(TokenType& tkn){if(eof()) return *this; tkn=st[i++].type; return *this;}
	TokenStream<TokenType>& operator<<(string tkn){st.push_back(Token<TokenType>(1,tkn));return *this;}
	TokenStream<TokenType>& operator>>(string& tkn){if(eof()) return *this; tkn=st[i++].text; return *this;}
	const Token<TokenType>& first()const{ return st[i]; }
	const Token<TokenType>& last()const{ return st[st.size()-1]; }
	size_t count()const{ return st.size()-i; }
	bool eof()const{ if(end==(size_t)-1) return i>=st.size(); else return i>=end; }
	void setEnd(size_t e = (size_t)-1){ if(e<=st.size() or e==size_t(-1)) end=e; }
	size_t getEnd()const{return end;}
	tstream_state state()const{ return tstream_state(i); }
	void state(tstream_state t){ i=t.i; }
};

template<class TokenType>
class TokenizerData{
public:
	map<string,TokenType> string_token;
	map<char,TokenType> spec_token;
};
template<class TokenType, class Init>
class Tokenizer:public TokenizerData<TokenType>{
public:
	Init p;
	bool in_string;
	bool prev_slash;

	template<class T,class B>
	bool contains(const map<T,B>& m, const T& t){ return m.find(t)!=m.end(); }
	Tokenizer():in_string(false), prev_slash(false){
		p.init(*this);
	}
	void searchToken(size_t index, stringstream& buf, size_t& start_index, char c, TokenStream<TokenType>& tkn_stream){
	    const bool verb = false;
	    if(verb) cout<<"Proc ["<<str(c)<<"]"<<endl;
	    Token<TokenType> tkn;
	    if( (!in_string and p.isDelimiter(c)) or (in_string and c=='\"' and !prev_slash) ){
	        if(verb) cout<<"... is delimiter"<<endl;
	        if(contains(this->string_token, buf.str())){
	            if(verb) cout<<"... ... token found"<<endl;
	            tkn = this->string_token[buf.str()];
	        }else{
	            if(verb) cout<<"... ... token is not found. select as text"<<endl;
	            tkn = Token<TokenType>((TokenType)1, buf.str());
	        }
	        tkn.start = start_index;
	        tkn.end = index;
	        if(tkn.size()>0){
	            if(verb){ cout<<"... ... add token "<<tkn; cout <<std::endl; }
	            tkn_stream<<tkn;
	        }else{
	            if(verb) cout<<"... ... ignore token"<<endl;
	        }
	        buf.str("");
	        start_index = index;
	        if(contains(this->spec_token, c)){
	            if(verb) cout<<"... ...  is special token"<<endl;
	            tkn = this->spec_token[c];
	            stringstream tmp; tmp<<c;
	            tkn.text = tmp.str();
	            tkn.start=index;
	            tkn.end = index+1;
	            tkn_stream<<tkn;
	        }
            if( c == '\"' ){
                in_string = !in_string;
            }

	        start_index+=1;
	    }else{
	        if(verb) cout<<"... is not delimiter"<<endl;
	        buf<<c;
	    }
	    if(verb) cout<<"... current buffer is ["<<buf.str()<<"]"<<endl;
        prev_slash = c == '\\';
	}
};

#define ADD_ERROR( tkn, X )\
		{int l,p; searchLineInfo(tkn.end, l,p);\
		errors<<"In "<<filename<<":"<<l<<":"<<p<<" "<<tkn<<endl<<"    "<<X<<endl;}

#define TKN_SEARCH_CLOSE_PARENT(END, stream, topen, tclose, X) tkn_search_close_parent(stream, topen, tclose);\
    if(END==size_t(-1)){\
    	PRINT("Unexpected end of file during " X ".");\
    	int l,p; searchLineInfo(tkn.end, l,p);\
        errors<<"In "<<filename<<":"<<l<<":"<<p<<" "<<tkn<<endl<<"    Unexpected end of structure during " X " parsing."<<endl;\
        return false;\
    }

#define TKN_SEARCH_OPTIONAL(TKN, RET) if(not (TKN)) RET;
#define TKN_NEXT_SEARCH_OPTIONAL(TKN, RET) stream >> tkn; if(not (TKN)) RET;
#define TKN_NEXT_OPTIONAL(TKN, RET) TKN_NEXT_SEARCH_OPTIONAL(tkn.type==TKN, RET)

#define TKN_NEXT(TKN) TKN_NEXT_OPTIONAL(TKN, return false)
#define TKN_SEARCH(TKN) TKN_SEARCH_OPTIONAL(TKN, return false)
#define TKN_NEXT_SEARCH(TKN) TKN_NEXT_SEARCH_OPTIONAL(TKN, return false)

template<class TokenType>
size_t tkn_search_close_parent(TokenStream<TokenType>& stream, TokenType topen, TokenType tclose){
    tstream_state state = stream.state();
    int c = 0;
    Token<TokenType> tkn;
    while(c>=0 and not stream.eof()){
        stream >> tkn;
        if(tkn.type == topen) c++;
        if(tkn.type == tclose)c--;
    }
    size_t res = size_t(-1);
    if(c<0) res = stream.i;
    stream.state(state);
    return res;
}

}

#endif /* PARSER_H_ */


text:
static NSString *const kParameterAmountDue = @"amount_due";
static NSString *const kParameterFee = @"fee";
static NSString *const kParameterSender = @"sender";
static NSString *const kParameterRecipient = @"recipient";
static NSString *const kParameterRecipientType = @"recipient_type";
static NSString *const kParameterMessage = @"message";
static NSString *const kParameterComment = @"comment";
static NSString *const kParameterCodePro = @"codepro";
static NSString *const kParameterProtectionCode = @"protection_code";
static NSString *const kParameterExpires = @"expires";
static NSString *const kParameterAnswerDatetime = @"answer_datetime";
static NSString *const kParameterDetails = @"details";
static NSString *const kParameterRepeatable = @"repeatable";
static NSString *const kParameterPaymentParameters = @"payment_parameters";
static NSString *const kParameterDigitalGoods = @"digital_goods";

@implementation YMAOperationDetailsResponse

#pragma mark - Overridden methods

- (BOOL)parseJSONModel:(id)responseModel headers:(NSDictionary *)headers error:(NSError * __autoreleasing *)error
{
    NSString *errorKey = responseModel[YMAErrorParameter];
    if (errorKey != nil) {
        if (error == nil) return NO;

        NSError *unknownError = [NSError errorWithDomain:YMAErrorDomainUnknown code:0 userInfo:@{ YMAErrorKeyResponse : self }];
        *error = errorKey ? [NSError errorWithDomain:YMAErrorDomainYooMoneyAPI code:0 userInfo:@{YMAErrorKey : errorKey, YMAErrorKeyResponse : self }] : unknownError;

        return NO;
    }

    YMAHistoryOperationModel *historyOperation = [YMAHistoryOperationsResponse historyOperationByModel:responseModel];

    NSString *amountDue = [responseModel[kParameterAmountDue] stringValue];
    NSString *fee = [responseModel[kParameterFee] stringValue];
    NSString *sender = responseModel[kParameterSender];
    NSString *recipient = responseModel[kParameterRecipient];

    NSString *recipientTypeString = responseModel[kParameterRecipientType];
    YMARecipientType recipientType = [YMAOperationDetailsModel recipientTypeByString:recipientTypeString];

    NSString *message = responseModel[kParameterMessage];
    NSString *comment = responseModel[kParameterComment];
    BOOL codePro = [responseModel[kParameterCodePro] boolValue];
    NSString *protectionCode = responseModel[kParameterProtectionCode];

    NSString *expiresString = responseModel[kParameterExpires];
    NSDate *expires = [[self class] dateFromIsoTimeStamp:expiresString];

    NSString *answerDatetimeString = responseModel[kParameterAnswerDatetime];
    NSDate *answerDatetime = [[self class] dateFromIsoTimeStamp:answerDatetimeString];

    NSString *details = responseModel[kParameterDetails];
    BOOL repeatable = [responseModel[kParameterRepeatable] boolValue];

    NSDictionary *paymentParameters = responseModel[kParameterPaymentParameters];

    id digitalGoodsModel = responseModel[kParameterDigitalGoods];
    YMADigitalGoodsModel *digitalGoods = [YMAProcessPaymentResponse digitalGoodsByModel:digitalGoodsModel];

    _operationDetails = [YMAOperationDetailsModel operationDetailsWithOperation:historyOperation
                                                                      amountDue:amountDue
                                                                            fee:fee
                                                                         sender:sender
                                                                      recipient:recipient
                                                                  recipientType:recipientType
                                                                        message:message
                                                                        comment:comment
                                                                        codepro:codePro
                                                                 protectionCode:protectionCode
                                                                        expires:expires
                                                                 answerDatetime:answerDatetime
                                                                        details:details
                                                                     repeatable:repeatable
                                                              paymentParameters:paymentParameters
                                                                   digitalGoods:digitalGoods];

    return YES;
}

@end


text:
require 'vcr'

VCR.configure do |config|
  config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
  config.hook_into :webmock

  config.filter_sensitive_data('<UPHOLD_AUTH_TOKEN>') { ENV['UPHOLD_AUTH_TOKEN'] }
end


text:
/*     */ package edu.drexel.cis.dragon.ir.summarize;
/*     */
/*     */ import edu.drexel.cis.dragon.ir.clustering.docdistance.CosineDocDistance;
/*     */ import edu.drexel.cis.dragon.ir.clustering.docdistance.DocDistance;
/*     */ import edu.drexel.cis.dragon.ir.index.IRCollection;
/*     */ import edu.drexel.cis.dragon.ir.index.IRDoc;
/*     */ import edu.drexel.cis.dragon.ir.index.IndexReader;
/*     */ import edu.drexel.cis.dragon.ir.index.sentence.OnlineSentenceIndexReader;
/*     */ import edu.drexel.cis.dragon.ir.index.sentence.OnlineSentenceIndexer;
/*     */ import edu.drexel.cis.dragon.ir.kngbase.DocRepresentation;
/*     */ import edu.drexel.cis.dragon.matrix.DoubleDenseMatrix;
/*     */ import edu.drexel.cis.dragon.matrix.DoubleFlatDenseMatrix;
/*     */ import edu.drexel.cis.dragon.matrix.vector.DoubleVector;
/*     */ import edu.drexel.cis.dragon.matrix.vector.PowerMethod;
/*     */ import edu.drexel.cis.dragon.onlinedb.CollectionReader;
/*     */ import java.util.ArrayList;
/*     */
/*     */ public class LexRankSummarizer extends AbstractSentenceSum
/*     */   implements GenericMultiDocSummarizer
/*     */ {
/*     */   protected OnlineSentenceIndexReader indexReader;
/*     */   protected OnlineSentenceIndexer indexer;
/*     */   protected CollectionReader collectionReader;
/*     */   protected DocDistance distanceMetric;
/*     */   protected PowerMethod powerMethod;
/*     */   protected double threshold;
/*     */   protected boolean useContinuousValue;
/*     */   protected boolean useTFIDF;
/*     */
/*     */   public LexRankSummarizer(OnlineSentenceIndexer indexer)
/*     */   {
/*  31 */     this(indexer, true);
/*     */   }
/*     */
/*     */   public LexRankSummarizer(OnlineSentenceIndexer indexer, boolean useTFIDF) {
/*  35 */     this.indexer = indexer;
/*  36 */     this.threshold = 0.1D;
/*  37 */     this.useContinuousValue = true;
/*  38 */     this.useTFIDF = useTFIDF;
/*  39 */     this.powerMethod = new PowerMethod(0.0001D, 0.15D);
/*  40 */     this.powerMethod.setMessageOption(false);
/*  41 */     this.powerMethod.setMaxIteration(50);
/*     */   }
/*     */
/*     */   public void setSimilarityThreshold(double threshold) {
/*  45 */     this.threshold = threshold;
/*     */   }
/*     */
/*     */   public void setContinuousScoreOpiton(boolean option) {
/*  49 */     this.useContinuousValue = option;
/*     */   }
/*     */
/*     */   public String summarize(CollectionReader collectionReader, int maxLength)
/*     */   {
/*  57 */     this.collectionReader = collectionReader;
/*  58 */     this.indexReader = new OnlineSentenceIndexReader(this.indexer, collectionReader);
/*  59 */     this.indexReader.initialize();
/*  60 */     ArrayList sentSet = getSentenceSet(this.indexReader);
/*  61 */     DoubleVector vector = this.powerMethod.getEigenVector(buildWeightMatrix(sentSet));
/*  62 */     String summary = buildSummary(this.indexReader, sentSet, maxLength, vector);
/*  63 */     this.indexReader.close();
/*  64 */     this.distanceMetric = null;
/*  65 */     return summary;
/*     */   }
/*     */
/*     */   protected DoubleDenseMatrix buildWeightMatrix(ArrayList docSet)
/*     */   {
/*  74 */     DoubleFlatDenseMatrix matrix = new DoubleFlatDenseMatrix(docSet.size(), docSet.size());
/*  75 */     for (int i = 0; i < docSet.size(); i++) {
/*  76 */       matrix.setDouble(i, i, 1.0D);
/*  77 */       IRDoc first = (IRDoc)docSet.get(i);
/*  78 */       for (int j = i + 1; j < docSet.size(); j++) {
/*  79 */         IRDoc second = (IRDoc)docSet.get(j);
/*  80 */         double similarity = computeSimilarity(first, second);
/*  81 */         if (!this.useContinuousValue) {
/*  82 */           if (similarity <= this.threshold)
/*  83 */             similarity = 0.0D;
/*     */           else
/*  85 */             similarity = 1.0D;
/*     */         }
/*  87 */         matrix.setDouble(i, j, similarity);
/*  88 */         matrix.setDouble(j, i, similarity);
/*     */       }
/*     */     }
/*  91 */     return matrix;
/*     */   }
/*     */
/*     */   protected double computeSimilarity(IRDoc firstSent, IRDoc secondSent)
/*     */   {
/* 103 */     if (this.distanceMetric == null)
/* 104 */       if (this.useTFIDF) {
/* 105 */         DocRepresentation docRepresentation = new DocRepresentation(this.indexReader);
/* 106 */         docRepresentation.setMessageOption(false);
/* 107 */         this.distanceMetric = new CosineDocDistance(docRepresentation.genTFIDFMatrix());
/*     */       }
/*     */       else {
/* 110 */         this.distanceMetric = new CosineDocDistance(this.indexReader.getDocTermMatrix());
/*     */       }
/* 112 */     return 1.0D - this.distanceMetric.getDistance(firstSent, secondSent);
/*     */   }
/*     */
/*     */   protected ArrayList getSentenceSet(IndexReader indexReader)
/*     */   {
/* 119 */     int docNum = indexReader.getCollection().getDocNum();
/* 120 */     ArrayList list = new ArrayList(docNum);
/* 121 */     for (int i = 0; i < docNum; i++)
/* 122 */       list.add(indexReader.getDoc(i));
/* 123 */     return list;
/*     */   }
/*     */ }

/* Location:           C:\dragontoolikt\dragontool.jar
 * Qualified Name:     dragon.ir.summarize.LexRankSummarizer
 * JD-Core Version:    0.6.2
 */


text:
package host

import "periph.io/x/periph"

// Init calls periph.Init() and returns it as-is.
//
// The only difference is that by calling host.Init(), you are guaranteed to
// have all the drivers implemented in this library to be implicitly loaded.
func Init() (*periph.State, error) {
	return periph.Init()
}


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

#include "node_http_parser.h"

#include "v8.h"
#include "node.h"
#include "node_buffer.h"

#include <string.h>  /* strdup() */
#if !defined(_MSC_VER)
#include <strings.h>  /* strcasecmp() */
#else
#define strcasecmp _stricmp
#endif
#include <stdlib.h>  /* free() */

// This is a binding to http_parser (https://github.com/joyent/http-parser)
// The goal is to decouple sockets from parsing for more javascript-level
// agility. A Buffer is read from a socket and passed to parser.execute().
// The parser then issues callbacks with slices of the data
//     parser.onMessageBegin
//     parser.onPath
//     parser.onBody
//     ...
// No copying is performed when slicing the buffer, only small reference
// allocations.

namespace node {

using namespace v8;

static Persistent<String> on_headers_sym;
static Persistent<String> on_headers_complete_sym;
static Persistent<String> on_body_sym;
static Persistent<String> on_message_complete_sym;

static Persistent<String> method_sym;
static Persistent<String> status_code_sym;
static Persistent<String> http_version_sym;
static Persistent<String> version_major_sym;
static Persistent<String> version_minor_sym;
static Persistent<String> should_keep_alive_sym;
static Persistent<String> upgrade_sym;
static Persistent<String> headers_sym;
static Persistent<String> url_sym;

static Persistent<String> unknown_method_sym;

#define X(num, name, string) static Persistent<String> name##_sym;
HTTP_METHOD_MAP(X)
#undef X

static struct http_parser_settings settings;

// This is a hack to get the current_buffer to the callbacks with the least
// amount of overhead. Nothing else will run while http_parser_execute()
// runs, therefore this pointer can be set and used for the execution.
static Local<Value>* current_buffer;
static char* current_buffer_data;
static size_t current_buffer_len;

#define HTTP_CB(name)                                                         \
  static int name(http_parser* p_) {                                          \
    Parser* self = container_of(p_, Parser, parser_);                         \
    return self->name##_();                                                   \
  }                                                                           \
  int name##_()

#define HTTP_DATA_CB(name)                                                    \
  static int name(http_parser* p_, const char* at, size_t length) {           \
    Parser* self = container_of(p_, Parser, parser_);                         \
    return self->name##_(at, length);                                         \
  }                                                                           \
  int name##_(const char* at, size_t length)

static inline Persistent<String>
method_to_str(unsigned short m) {
  switch (m) {
#define X(num, name, string) case HTTP_##name: return name##_sym;
  HTTP_METHOD_MAP(X)
#undef X
  }
  return unknown_method_sym;
}

// helper class for the Parser
struct StringPtr {
  StringPtr() {
    on_heap_ = false;
    Reset();
  }

  ~StringPtr() {
    Reset();
  }

  // If str_ does not point to a heap string yet, this function makes it do
  // so. This is called at the end of each http_parser_execute() so as not
  // to leak references. See issue #2438 and test-http-parser-bad-ref.js.
  void Save() {
    if (!on_heap_ && size_ > 0) {
      char* s = new char[size_];
      memcpy(s, str_, size_);
      str_ = s;
      on_heap_ = true;
    }
  }

  void Reset() {
    if (on_heap_) {
      delete[] str_;
      on_heap_ = false;
    }

    str_ = NULL;
    size_ = 0;
  }

  void Update(const char* str, size_t size) {
    if (str_ == NULL)
      str_ = str;
    else if (on_heap_ || str_ + size_ != str) {
      // Non-consecutive input, make a copy on the heap.
      // TODO Use slab allocation, O(n) allocs is bad.
      char* s = new char[size_ + size];
      memcpy(s, str_, size_);
      memcpy(s + size_, str, size);

      if (on_heap_)
        delete[] str_;
      else
        on_heap_ = true;

      str_ = s;
    }
    size_ += size;
  }

  Local<String> ToString() const {
    if (str_)
      return String::New(str_, size_);
    else
      return String::Empty();
  }

  const char* str_;
  bool on_heap_;
  size_t size_;
};

class Parser : public ObjectWrap {
public:
  Parser(enum http_parser_type type) : ObjectWrap() {
    Init(type);
  }

  ~Parser() {
  }

  HTTP_CB(on_message_begin) {
    num_fields_ = num_values_ = 0;
    url_.Reset();
    return 0;
  }

  HTTP_DATA_CB(on_url) {
    url_.Update(at, length);
    return 0;
  }

  HTTP_DATA_CB(on_header_field) {
    if (num_fields_ == num_values_) {
      // start of new field name
      num_fields_++;
      if (num_fields_ == ARRAY_SIZE(fields_)) {
        // ran out of space - flush to javascript land
        Flush();
        num_fields_ = 1;
        num_values_ = 0;
      }
      fields_[num_fields_ - 1].Reset();
    }

    assert(num_fields_ < (int)ARRAY_SIZE(fields_));
    assert(num_fields_ == num_values_ + 1);

    fields_[num_fields_ - 1].Update(at, length);

    return 0;
  }

  HTTP_DATA_CB(on_header_value) {
    if (num_values_ != num_fields_) {
      // start of new header value
      num_values_++;
      values_[num_values_ - 1].Reset();
    }

    assert(num_values_ < (int)ARRAY_SIZE(values_));
    assert(num_values_ == num_fields_);

    values_[num_values_ - 1].Update(at, length);

    return 0;
  }

  HTTP_CB(on_headers_complete) {
    Local<Value> cb = handle_->Get(on_headers_complete_sym);

    if (!cb->IsFunction())
      return 0;

    Local<Object> message_info = Object::New();

    if (have_flushed_) {
      // Slow case, flush remaining headers.
      Flush();
    }
    else {
      // Fast case, pass headers and URL to JS land.
      message_info->Set(headers_sym, CreateHeaders());
      if (parser_.type == HTTP_REQUEST)
        message_info->Set(url_sym, url_.ToString());
    }
    num_fields_ = num_values_ = 0;

    // METHOD
    if (parser_.type == HTTP_REQUEST) {
      message_info->Set(method_sym, method_to_str(parser_.method));
    }

    // STATUS
    if (parser_.type == HTTP_RESPONSE) {
      message_info->Set(status_code_sym,
                        Integer::New(parser_.status_code));
    }

    // VERSION
    message_info->Set(version_major_sym,
                      Integer::New(parser_.http_major));
    message_info->Set(version_minor_sym,
                      Integer::New(parser_.http_minor));

    message_info->Set(should_keep_alive_sym,
                      http_should_keep_alive(&parser_) ? True()
                                                       : False());

    message_info->Set(upgrade_sym,
                      parser_.upgrade ? True()
                                      : False());

    Local<Value> argv[1] = { message_info };

    Local<Value> head_response =
        Local<Function>::Cast(cb)->Call(handle_, 1, argv);

    if (head_response.IsEmpty()) {
      got_exception_ = true;
      return -1;
    }

    return head_response->IsTrue() ? 1 : 0;
  }

  HTTP_DATA_CB(on_body) {
    HandleScope scope;

    Local<Value> cb = handle_->Get(on_body_sym);
    if (!cb->IsFunction())
      return 0;

    Local<Value> argv[3] = {
      *current_buffer,
      Integer::New(at - current_buffer_data),
      Integer::New(length)
    };

    Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 3, argv);

    if (r.IsEmpty()) {
      got_exception_ = true;
      return -1;
    }

    return 0;
  }

  HTTP_CB(on_message_complete) {
    HandleScope scope;

    if (num_fields_)
      Flush(); // Flush trailing HTTP headers.

    Local<Value> cb = handle_->Get(on_message_complete_sym);

    if (!cb->IsFunction())
      return 0;

    Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 0, NULL);

    if (r.IsEmpty()) {
      got_exception_ = true;
      return -1;
    }

    return 0;
  }

  static Handle<Value> New(const Arguments& args) {
    HandleScope scope;

    http_parser_type type =
        static_cast<http_parser_type>(args[0]->Int32Value());

    if (type != HTTP_REQUEST && type != HTTP_RESPONSE) {
      return ThrowException(Exception::Error(String::New(
          "Argument must be HTTPParser.REQUEST or HTTPParser.RESPONSE")));
    }

    Parser* parser = new Parser(type);
    parser->Wrap(args.This());

    return args.This();
  }

  void Save() {
    url_.Save();

    for (int i = 0; i < num_fields_; i++) {
      fields_[i].Save();
    }

    for (int i = 0; i < num_values_; i++) {
      values_[i].Save();
    }
  }

  // var bytesParsed = parser->execute(buffer, off, len);
  static Handle<Value> Execute(const Arguments& args) {
    HandleScope scope;

    Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());

    assert(!current_buffer);
    assert(!current_buffer_data);

    if (current_buffer) {
      return ThrowException(Exception::TypeError(
            String::New("Already parsing a buffer")));
    }

    Local<Value> buffer_v = args[0];

    if (!Buffer::HasInstance(buffer_v)) {
      return ThrowException(Exception::TypeError(
            String::New("Argument should be a buffer")));
    }

    Local<Object> buffer_obj = buffer_v->ToObject();
    char *buffer_data = Buffer::Data(buffer_obj);
    size_t buffer_len = Buffer::Length(buffer_obj);

    size_t off = args[1]->Int32Value();
    if (off >= buffer_len) {
      return ThrowException(Exception::Error(
            String::New("Offset is out of bounds")));
    }

    size_t len = args[2]->Int32Value();
    if (!Buffer::IsWithinBounds(off, len, buffer_len)) {
      return ThrowException(Exception::Error(
            String::New("off + len > buffer.length")));
    }

    // Assign 'buffer_' while we parse. The callbacks will access that varible.
    current_buffer = &buffer_v;
    current_buffer_data = buffer_data;
    current_buffer_len = buffer_len;
    parser->got_exception_ = false;

    size_t nparsed =
      http_parser_execute(&parser->parser_, &settings, buffer_data + off, len);

    parser->Save();

    // Unassign the 'buffer_' variable
    assert(current_buffer);
    current_buffer = NULL;
    current_buffer_data = NULL;

    // If there was an exception in one of the callbacks
    if (parser->got_exception_) return Local<Value>();

    Local<Integer> nparsed_obj = Integer::New(nparsed);
    // If there was a parse error in one of the callbacks
    // TODO What if there is an error on EOF?
    if (!parser->parser_.upgrade && nparsed != len) {
      enum http_errno err = HTTP_PARSER_ERRNO(&parser->parser_);

      Local<Value> e = Exception::Error(String::NewSymbol("Parse Error"));
      Local<Object> obj = e->ToObject();
      obj->Set(String::NewSymbol("bytesParsed"), nparsed_obj);
      obj->Set(String::NewSymbol("code"), String::New(http_errno_name(err)));
      return scope.Close(e);
    } else {
      return scope.Close(nparsed_obj);
    }
  }

  static Handle<Value> Finish(const Arguments& args) {
    HandleScope scope;

    Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());

    assert(!current_buffer);
    parser->got_exception_ = false;

    int rv = http_parser_execute(&(parser->parser_), &settings, NULL, 0);

    if (parser->got_exception_) return Local<Value>();

    if (rv != 0) {
      enum http_errno err = HTTP_PARSER_ERRNO(&parser->parser_);

      Local<Value> e = Exception::Error(String::NewSymbol("Parse Error"));
      Local<Object> obj = e->ToObject();
      obj->Set(String::NewSymbol("bytesParsed"), Integer::New(0));
      obj->Set(String::NewSymbol("code"), String::New(http_errno_name(err)));
      return scope.Close(e);
    }

    return Undefined();
  }

  static Handle<Value> Reinitialize(const Arguments& args) {
    HandleScope scope;

    http_parser_type type =
        static_cast<http_parser_type>(args[0]->Int32Value());

    if (type != HTTP_REQUEST && type != HTTP_RESPONSE) {
      return ThrowException(Exception::Error(String::New(
          "Argument must be HTTPParser.REQUEST or HTTPParser.RESPONSE")));
    }

    Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());
    parser->Init(type);

    return Undefined();
  }

  template <bool should_pause>
  static Handle<Value> Pause(const Arguments& args) {
    HandleScope scope;
    Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());
    http_parser_pause(&parser->parser_, should_pause);
    return Undefined();
  }

private:

  Local<Array> CreateHeaders() {
    // num_values_ is either -1 or the entry # of the last header
    // so num_values_ == 0 means there's a single header
    Local<Array> headers = Array::New(2 * num_values_);

    for (int i = 0; i < num_values_; ++i) {
      headers->Set(2 * i, fields_[i].ToString());
      headers->Set(2 * i + 1, values_[i].ToString());
    }

    return headers;
  }

  // spill headers and request path to JS land
  void Flush() {
    HandleScope scope;

    Local<Value> cb = handle_->Get(on_headers_sym);

    if (!cb->IsFunction())
      return;

    Local<Value> argv[2] = {
      CreateHeaders(),
      url_.ToString()
    };

    Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 2, argv);

    if (r.IsEmpty())
      got_exception_ = true;

    url_.Reset();
    have_flushed_ = true;
  }

  void Init(enum http_parser_type type) {
    http_parser_init(&parser_, type);
    url_.Reset();
    num_fields_ = 0;
    num_values_ = 0;
    have_flushed_ = false;
    got_exception_ = false;
  }

  http_parser parser_;
  StringPtr fields_[32];  // header fields
  StringPtr values_[32];  // header values
  StringPtr url_;
  int num_fields_;
  int num_values_;
  bool have_flushed_;
  bool got_exception_;
};

void InitHttpParser(Handle<Object> target) {
  HandleScope scope;

  Local<FunctionTemplate> t = FunctionTemplate::New(Parser::New);
  t->InstanceTemplate()->SetInternalFieldCount(1);
  t->SetClassName(String::NewSymbol("HTTPParser"));

  PropertyAttribute attrib = (PropertyAttribute) (ReadOnly | DontDelete);
  t->Set(String::NewSymbol("REQUEST"),
         Integer::New(HTTP_REQUEST),
         attrib);
  t->Set(String::NewSymbol("RESPONSE"),
         Integer::New(HTTP_RESPONSE),
         attrib);

  NODE_SET_PROTOTYPE_METHOD(t, "execute", Parser::Execute);
  NODE_SET_PROTOTYPE_METHOD(t, "finish", Parser::Finish);
  NODE_SET_PROTOTYPE_METHOD(t, "reinitialize", Parser::Reinitialize);
  NODE_SET_PROTOTYPE_METHOD(t, "pause", Parser::Pause<true>);
  NODE_SET_PROTOTYPE_METHOD(t, "resume", Parser::Pause<false>);

  target->Set(String::NewSymbol("HTTPParser"), t->GetFunction());

  on_headers_sym          = NODE_PSYMBOL("onHeaders");
  on_headers_complete_sym = NODE_PSYMBOL("onHeadersComplete");
  on_body_sym             = NODE_PSYMBOL("onBody");
  on_message_complete_sym = NODE_PSYMBOL("onMessageComplete");

#define X(num, name, string) name##_sym = NODE_PSYMBOL(#string);
  HTTP_METHOD_MAP(X)
#undef X
  unknown_method_sym = NODE_PSYMBOL("UNKNOWN_METHOD");

  method_sym = NODE_PSYMBOL("method");
  status_code_sym = NODE_PSYMBOL("statusCode");
  http_version_sym = NODE_PSYMBOL("httpVersion");
  version_major_sym = NODE_PSYMBOL("versionMajor");
  version_minor_sym = NODE_PSYMBOL("versionMinor");
  should_keep_alive_sym = NODE_PSYMBOL("shouldKeepAlive");
  upgrade_sym = NODE_PSYMBOL("upgrade");
  headers_sym = NODE_PSYMBOL("headers");
  url_sym = NODE_PSYMBOL("url");

  settings.on_message_begin    = Parser::on_message_begin;
  settings.on_url              = Parser::on_url;
  settings.on_header_field     = Parser::on_header_field;
  settings.on_header_value     = Parser::on_header_value;
  settings.on_headers_complete = Parser::on_headers_complete;
  settings.on_body             = Parser::on_body;
  settings.on_message_complete = Parser::on_message_complete;
}

}  // namespace node

NODE_MODULE(node_http_parser, node::InitHttpParser)


text:
int main() {
  // Check that a real malloc is used by allocating, freeing, then seeing that we did actually free by a new allocation going to the original place
  int N = 100;
  void *allocs[N];
  for (int i = 0; i < N; i++)
    allocs[i] = malloc((i+1)*1024);
  for (int i = 0; i < N; i++)
    free(allocs[i]);
  void *another = malloc(1024);
  assert(another == allocs[0]);
  printf("hello, world!\n");
  return 1;
}


text:
package com.panaceamobile.panacea.ui.controls;

import com.panaceamobile.panacea.sdk.PMUtils;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Color;

public class ReceivedMessageBubbleField extends MessageBubbleField {

	private static int screenDensity = PMUtils.SCREEN_DENSITY;
	private static final int leftOffset = screenDensity==PMUtils.SCREEN_DENSITY_HIGH?40:(screenDensity==PMUtils.SCREEN_DENSITY_MEDIUM?23:10);
	private static final int rightOffset = screenDensity==PMUtils.SCREEN_DENSITY_HIGH?33:(screenDensity==PMUtils.SCREEN_DENSITY_MEDIUM?23:10);
	private static final int topOffset = screenDensity==PMUtils.SCREEN_DENSITY_HIGH?25:(screenDensity==PMUtils.SCREEN_DENSITY_MEDIUM?17:8);
	private static final int bottomOffset = screenDensity==PMUtils.SCREEN_DENSITY_HIGH?25:(screenDensity==PMUtils.SCREEN_DENSITY_MEDIUM?17:8);

	public ReceivedMessageBubbleField(String message)
	{
		super(message,PMUtils.getBestBitmapResource("img/speechbubble_grey.png"),leftOffset,rightOffset,topOffset,bottomOffset,0);
		setTextColor(Color.BLUE);
	}

}


text:
<?php get_header(); ?>

								<?php
								//the_archive_title( '
', '
' );
								add_filter( 'get_the_archive_title', function ( $title ) {

	    							if( is_category() ) {
		        						$title = single_cat_title( '', false );
	    							}

									return $title;

								});
								printf(get_the_archive_title());
								?>

							<?php
								the_archive_description( '
', '
' );
								if (have_posts()) : while (have_posts()) : the_post();
							?>

							<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article">

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>

										<?php printf( __( 'Posted', 'auroratheme' ).' %1$s ',
                  							     /* the time the post was published */
                  							     '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>'
                    							); ?>
                    					 <?php edit_post_link("Edit"); ?>

									<?php the_post_thumbnail( 'aurora-thumb-300' ); ?>

									<?php the_excerpt(); ?>

							<?php endwhile; ?>

									<?php aurora_page_navi(); ?>

							<?php else : ?>

<?php _e( 'Oops, Post Not Found!', 'auroratheme' ); ?>

<?php _e( 'Uh Oh. Something is missing. Try double checking things.', 'auroratheme' ); ?>

<?php _e( 'This is the error message in the archive.php template.', 'auroratheme' ); ?>

							<?php endif; ?>

					<?php get_sidebar(); ?>

<?php get_footer(); ?>


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var home_cmp_1 = require('./home.cmp');
var home_routes_1 = require('./home.routes');
var HomeModule = (function () {
    function HomeModule() {
    }
    HomeModule = __decorate([
        core_1.NgModule({
            imports: [
                home_routes_1.ROUTING
            ],
            declarations: [
                home_cmp_1.HomeComponent
            ]
        }),
        __metadata('design:paramtypes', [])
    ], HomeModule);
    return HomeModule;
}());
exports.HomeModule = HomeModule;
//# sourceMappingURL=home.module.js.map


text:
<?php

namespace Thytanium\Chameleon\Customize;

use Thytanium\Chameleon\Row;

/**
 * Class CustomizeRow
 * @package Thytanium\Chameleon
 */
trait CustomizeRow
{
    /**
     * Change background
     * @param $color
     * @param Row $row
     */
    public static function background($color, Row $row)
    {
        $row->appendClass($color);
    }
}


text:
#region Apache License Version 2.0

#endregion Apache License Version 2.0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SF.Sys.Events
{
	public interface IEvent
	{
		long Id { get; }
		string Topic { get; }
	}
	public interface IEvent<TPayload> : IEvent
	{
		TPayload Payload { get; }
	}

	public class CommonEvent<TPayload> : IEvent<TPayload>
	{
		public long Id { get; set; }
		public string Topic { get; set; }
		public TPayload Payload { get; set; }
	}

	public interface IEventEmitter
	{
		long Id { get; }
		string Topic { get; }
		Task Cancel(Exception Exception);
		Task Commit();
	}
	public interface IEventEmitter<TPayload> : IEventEmitter {
		TPayload Payload { get; }
	}

	public interface IEventValidator<T>
	{
		Task<bool> Validate(T Event);
	}

	public interface IEventSubscriber<TPayload>
	{
		IDisposable Wait(
			Func<IEvent<TPayload>,Task> Callback,
			EventDeliveryPolicy Policy = EventDeliveryPolicy.NoGuarantee,
			string Topic = null,
			string SubscriberIdent = null
			);
	}
	public interface IEventObserver<TPayload>
	{
		Task<object> Prepare(IEvent<TPayload> Event);
		Task Commit(IEvent<TPayload> Event,object Context);
		Task Cancel(IEvent<TPayload> Event, object Context, Exception Exception);
	}

	public interface IEventSubscribeService
	{
		IDisposable Subscribe<TPayload>(
			string TopicFilter,
			string SubscriberIdent,
			EventDeliveryPolicy Policy,
			IEventObserver<TPayload> Observer
			);
	}

	public interface IEventEmitService
	{
		Task<IEventEmitter> Create<TPayload>(string Topic, TPayload Payload);
	}

}


text:
package org.apache.cordova.core;

public class FileExistsException extends Exception {

    public FileExistsException(String msg) {
        super(msg);
    }

}


text:
<?php

declare(strict_types=1);

namespace Trafficjam\RabbitMq;

class PublishMessage
{
    /**
     * @var string
     */
    private $message;

    /**
     * @var string
     */
    private $routingKey;

    /**
     * @var string
     */
    private $exchange;

    public function __construct(string $message, ?string $routingKey = null, ?string $exchange = null)
    {
        $this->message = $message;
        $this->routingKey = $routingKey;
        $this->exchange = $exchange;
    }

    public function getMessage(): string
    {
        return $this->message;
    }

    public function getRoutingKey(): ?string
    {
        return $this->routingKey;
    }

    public function getExchange(): ?string
    {
        return $this->exchange;
    }
}


text:
{- |
Module      :  Camfort.Specification.Units.Parser.Types
Description :  Defines the representation of unit specifications resulting from parsing.
Copyright   :  (c) 2017, Dominic Orchard, Andrew Rice, Mistral Contrastin, Matthew Danish
License     :  Apache-2.0

Maintainer  :  dom.orchard@gmail.com
Stability   :  experimental
-}

{-# LANGUAGE DeriveDataTypeable #-}

module Camfort.Specification.Units.Parser.Types
  ( UnitStatement(..)
  , UnitOfMeasure(..)
  , UnitPower(..)
  ) where

import Data.Data (Data)
import Data.List (intercalate)

data UnitStatement =
   UnitAssignment (Maybe [String]) UnitOfMeasure
 | UnitAlias String UnitOfMeasure
  deriving (Eq, Data)

instance Show UnitStatement where
  show (UnitAssignment (Just ss) uom)
    = "= unit (" ++ show uom ++ ") :: " ++ intercalate "," ss
  show (UnitAssignment Nothing uom)
    = "= unit (" ++ show uom ++ ")"
  show (UnitAlias s uom)
    = "= unit :: " ++ s ++ " = " ++ show uom

data UnitOfMeasure =
   Unitless
 | UnitBasic String
 | UnitProduct UnitOfMeasure UnitOfMeasure
 | UnitQuotient UnitOfMeasure UnitOfMeasure
 | UnitExponentiation UnitOfMeasure UnitPower
 | UnitRecord [(String, UnitOfMeasure)]
  deriving (Data, Eq)

instance Show UnitOfMeasure where
  show Unitless      = "1"
  show (UnitBasic s) = s
  show (UnitProduct uom1 uom2)
    = show uom1 ++ " " ++ show uom2
  show (UnitQuotient uom1 uom2)
    = show uom1 ++ " / " ++ show uom2
  show (UnitExponentiation uom expt)
    = show uom  ++ "** (" ++ show expt ++ ")"
  show (UnitRecord recs)
    = "record (" ++ intercalate ", "
      (map (\ (n, u) -> n ++ " :: " ++ show u) recs) ++ ")"

data UnitPower =
   UnitPowerInteger Integer
 | UnitPowerRational Integer Integer
 deriving (Data, Eq)

instance Show UnitPower where
  show (UnitPowerInteger i)      = show i
  show (UnitPowerRational i1 i2) = show i1 ++ "/" ++ show i2


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<root>

    <readcareplan>
        <parameter name="id"/>
              <![CDATA[
    SELECT A.id,
       A.status,
       A.periodstart,
       A.periodend,
       A.modified,
       A.patient,
       A.participantpractitioner,
       A.participantorganization
  FROM mis.v_clinical_careplan A
  where id=?
            ]]>
    </readcareplan>

    <readrange>
        <parameter name="id"/>
                      <![CDATA[
    SELECT   A.code, A.foodintake, A.bodysite,A.rangetype, A.low, A.high
    FROM mis.v_clinical_activity_response_glucose_range A,
         mis.v_clinical_activity_observation_response_glucose B
    where A.activityid=B.id
    and  B.careplan=?
    order by A.code,A.foodintake,A.bodysite
        ]]>
    </readrange>

    <createtype>
        <parameter type="string" name="id" />
        insert into mis.v_clinical_careplan_type(type,careplanid)
        values('КПГ',?)
    </createtype>

    <createcareplan>
        <parameter type="string" name="status"/>
        <parameter type="string" name="periodstart" />
        <parameter type="string" name="periodend"/>
        <parameter type="string" name="modified" />
        <parameter type="string" name="patient" />
        <parameter type="string" name="participantpractitioner" />
        <parameter type="string" name="participantorganization" />
        <parameter type="string" name="id" value="${PAGE.guid()}"/>
         <![CDATA[
             insert into mis.v_clinical_careplan (status,periodstart,periodend,modified,patient,participantpractitioner,participantorganization,id)
             values (${PAGE.strRepeat("?",",",8)}) returning  id
        ]]>
    </createcareplan>

    <updatecareplan>
        <parameter type="string" name="status"/>
        <parameter type="string" name="periodstart" />
        <parameter type="string" name="periodend" />
        <parameter type="string" name="modified" />
        <parameter type="string" name="patient" />
        <parameter type="string" name="participantpractitioner" />
        <parameter type="string" name="participantorganization" />
        <parameter type="string" name="id" />
         <![CDATA[
             update mis.v_clinical_careplan set
                status=?,
                periodstart=?,
                periodend=?,
                modified=?,
                patient=?,
                participantpractitioner=?,
                participantorganization=?
            where id=?
            returning  id
        ]]>
    </updatecareplan>

    <getactivity>
        <parameter type="string" name="id"/>
        <parameter type="string" name="rangetype" value="${(critical)?'2':'3'}"/>
        SELECT b.id
        FROM  mis.v_clinical_activity_observation_response_glucose B
        where B.careplan=?
        and b.rangetype=?
    </getactivity>

    <create_activity>
        <parameter type="string" name="careplan"/>
        <parameter type="string" name="rangetype" value="${(critical)?'2':'3'}"/>
        <parameter type="string" name="id" value="${PAGE.guid()}"/>

        insert into mis.v_clinical_activity_observation_response_glucose
        (status,prohibited,careplan,rangetype,id)
        values ('scheduled',false,?,?,?) returning  id
    </create_activity>

    <deleterange>
        <parameter type="string" name="id"/>
      delete FROM mis.v_clinical_activity_response_glucose_range A
      where A.activityid in (
        select b.id from mis.v_clinical_activity_observation_response_glucose b
        where b.careplan=?
      )
    </deleterange>

    <createrange>
        <parameter type="string" name="id" value="${PAGE.guid()}"/>
        <parameter type="string" name="activityid"/>
        <parameter type="string" name="rangetype" value="${(critical)?'2':'3'}"/>
        <parameter type="string" name="code"/>
        <parameter type="string" name="bodysite"/>
        <parameter type="string" name="foodintake"/>
        <parameter type="bigdecimal" name="low"/>
        <parameter type="bigdecimal" name="high"/>
        insert into mis.v_clinical_activity_response_glucose_range
        (id,activityid,rangetype,code,bodysite,foodintake,low,high)
        values (${PAGE.strRepeat("?",",",8)}) returning  id
    </createrange>

    <delete>
        <parameter name="id" />
           <![CDATA[
             delete from mis.v_clinical_careplan
             where id=?
           ]]>
    </delete>

    <search>
     <parameter name="patient" if="${PAGE.exist('patient')}"/>
     <parameter name="status" if="${PAGE.exist('status')}"/>
     <parameter name="date" if="${PAGE.exist('date')}"/>
     <parameter name="startperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}"/>
     <parameter name="endperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}"/>
     <parameter name="startperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}"/>
     <parameter name="endperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}"/>

     <define    type="string" name="wpatient" if="${PAGE.exist('patient')}">
            and A.patient =?
     </define>
     <define    type="string" name="wstatus" if="${PAGE.exist('status')}">
            and A.status =?
     </define>
     <define    type="string" name="wperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}">
            and mis.is_date_in_range(A.periodstart,?,?)
     </define>
     <define    type="string" name="wperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}">
            and mis.is_date_in_range(A.periodend,?,?)
     </define>

     <define    type="string" name="orderBy" if="${PAGE.exist('orderBy')}">
            order by ${orderBy}
     </define>
    SELECT A.id,
        A.status,
        A.periodstart,
        A.periodend,
        A.modified,
        A.patient,
        A.participantpractitioner,
        A.participantorganization
   FROM mis.v_clinical_careplan A
   where A.id in (
     SELECT
        B.careplanid
     FROM mis.v_clinical_careplan_type B
     where B.type='КПГ'
    )
    ${wpatient}
    ${wstatus}
    ${wperiodstart}
    ${wperiodend}
    ${orderBy}
   </search>
   <count>
     <parameter name="patient" if="${PAGE.exist('patient')}"/>
     <parameter name="status" if="${PAGE.exist('status')}"/>
     <parameter name="date" if="${PAGE.exist('date')}"/>
     <parameter name="startperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}"/>
     <parameter name="endperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}"/>
     <parameter name="startperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}"/>
     <parameter name="endperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}"/>

     <define    type="string" name="wpatient" if="${PAGE.exist('patient')}">
            and A.patient =?
     </define>
     <define    type="string" name="wstatus" if="${PAGE.exist('status')}">
            and A.status =?
     </define>
     <define    type="string" name="wperiodstart" if="${PAGE.exist('startperiodstart')||PAGE.exist('endperiodstart')}">
            and mis.is_date_in_range(A.periodstart,?,?)
     </define>
     <define    type="string" name="wperiodend" if="${PAGE.exist('startperiodend')||PAGE.exist('endperiodend')}">
            and mis.is_date_in_range(A.periodend,?,?)
     </define>
      SELECT
           count(*) as count
      FROM mis.v_clinical_careplan A
      where A.id in (
      SELECT
        B.careplanid
     FROM mis.v_clinical_careplan_type B
     where B.type='КПГ'
     )
     ${wpatient}
     ${wstatus}
     ${wperiodstart}
     ${wperiodend}
    </count>
    <completed>
         UPDATE  mis.clinical_careplan set
                  status='completed',
                  periodend=now(),
                  modified=now()
                where  id in(select careplanid from mis.clinical_careplan_type where type='КПГ');
    </completed>
</root>


text:
package build_queue

import (
	"fmt"
	"math"
	"regexp"
	"sort"
	"sync"
	"time"

	"github.com/skia-dev/glog"
	"go.skia.org/infra/go/buildbot"
	"go.skia.org/infra/go/gitinfo"
	"go.skia.org/infra/go/timer"
	"go.skia.org/infra/go/util"
)

const (
	// Default score threshold for scheduling builds. This is "essentially zero",
	// allowing for significant floating point error, which indicates that we will
	// backfill builds for all commits except for those at which we've already built.
	DEFAULT_SCORE_THRESHOLD = 0.0001

	// Don't bisect builds with greater than this many commits. This
	// prevents spending lots of time computing giant blamelists.
	NO_BISECT_COMMIT_LIMIT = 100

	// If this time period used, include commits from the beginning of time.
	PERIOD_FOREVER = 0
)

var (
	// "Constants".

	// ERR_EMPTY_QUEUE is returned by BuildQueue.Pop() when the queue for
	// that builder is empty.
	ERR_EMPTY_QUEUE = fmt.Errorf("Queue is empty.")
)

// BuildCandidate is a struct which describes a candidate for a build.
type BuildCandidate struct {
	Author  string
	Commit  string
	Builder string
	Score   float64
	Repo    string
}

// BuildCandidateSlice is an alias to help sort BuildCandidates.
type BuildCandidateSlice []*BuildCandidate

func (s BuildCandidateSlice) Len() int { return len(s) }
func (s BuildCandidateSlice) Less(i, j int) bool {
	if s[i].Score == s[j].Score {
		// Fall back to sorting by commit hash to keep the sort order
		// consistent for testing.
		return s[i].Commit < s[j].Commit
	}
	return s[i].Score < s[j].Score
}
func (s BuildCandidateSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

// BuildQueue is a struct which contains a priority queue for builders and
// commits.
type BuildQueue struct {
	botBlacklist   []*regexp.Regexp
	lock           sync.RWMutex
	period         time.Duration
	scoreThreshold float64
	queue          map[string][]*BuildCandidate
	repos          *gitinfo.RepoMap
	timeLambda     float64
}

// NewBuildQueue creates and returns a BuildQueue instance which considers
// commits in the specified time period.
//
// Build candidates with a score below the given scoreThreshold are not added
// to the queue. The score for a build candidate is defined as the value added
// by running that build, which is the difference between the total scores for
// all commits on a given builder before and after the build candidate would
// run. Scoring for an individual commit/builder pair is as follows:
//
// -1.0    if no build has ever included this commit on this builder.
// 1.0     if this builder has built AT this commit.
// 1.0 / N if a build on this builer has included this commit, where N is the
//         number of commits included in the build.
//
// The scoring works out such that build candidates which include commits which
// have never been included in a build have a value-add of >= 2, and other build
// candidates (eg. backfilling) have a value-add of < 2.
//
// Additionally, the scores include a time factor which serves to prioritize
// backfilling of more recent commits. The time factor is an exponential decay
// which is controlled by the timeDecay24Hr parameter. This parameter indicates
// what the time factor should be after 24 hours. For example, setting
// timeDecay24Hr equal to 0.5 causes the score for a build candidate with value
// 1.0 to be 0.5 if the commit is 24 hours old. At 48 hours with a value of 1.0
// the build candidate would receive a score of 0.25.
func NewBuildQueue(period time.Duration, repos *gitinfo.RepoMap, scoreThreshold, timeDecay24Hr float64, botBlacklist []*regexp.Regexp) (*BuildQueue, error) {
	if timeDecay24Hr <= 0.0 || timeDecay24Hr > 1.0 {
		return nil, fmt.Errorf("Time penalty must be 0 < p <= 1")
	}
	q := &BuildQueue{
		botBlacklist:   botBlacklist,
		lock:           sync.RWMutex{},
		period:         period,
		scoreThreshold: scoreThreshold,
		queue:          map[string][]*BuildCandidate{},
		repos:          repos,
		timeLambda:     lambda(timeDecay24Hr),
	}
	return q, nil
}

// lambda returns the lambda-value given a decay amount at 24 hours.
func lambda(decay float64) float64 {
	return (-math.Log(decay) / float64(24))
}

// timeFactor returns the time penalty factor, which is an exponential decay.
func timeFactor(now, t time.Time, lambda float64) float64 {
	hours := float64(now.Sub(t)) / float64(time.Hour)
	return math.Exp(-lambda * hours)
}

// scoreBuild returns the current score for the given commit/builder pair. The
// details on how scoring works are described in the doc for NewBuildQueue.
func scoreBuild(commit *gitinfo.LongCommit, build *buildbot.Build, now time.Time, timeLambda float64) float64 {
	s := -1.0
	if build != nil {
		if build.GotRevision == commit.Hash {
			s = 1.0
		} else if util.In(commit.Hash, build.Commits) {
			s = 1.0 / float64(len(build.Commits))
		}
	}
	return s * timeFactor(now, commit.Timestamp, timeLambda)
}

// Update retrieves the set of commits over a time period and the builds
// associated with those commits and builds a priority queue for commit/builder
// pairs.
func (q *BuildQueue) Update() error {
	return q.update(time.Now())
}

// update is the inner function which does all the work for Update. It accepts
// a time.Time so that time.Now() can be faked for testing.
func (q *BuildQueue) update(now time.Time) error {
	glog.Info("Updating build queue.")
	defer timer.New("BuildQueue.update()").Stop()
	queue := map[string][]*BuildCandidate{}
	errs := map[string]error{}
	mutex := sync.Mutex{}
	var wg sync.WaitGroup
	for _, repoUrl := range q.repos.Repos() {
		wg.Add(1)
		go func(repoUrl string) {
			defer wg.Done()
			candidates, err := q.updateRepo(repoUrl, now)
			mutex.Lock()
			defer mutex.Unlock()
			if err != nil {
				errs[repoUrl] = err
				return
			}
			for k, v := range candidates {
				queue[k] = v
			}
		}(repoUrl)
	}
	wg.Wait()
	if len(errs) > 0 {
		msg := "Failed to update repos:"
		for repoUrl, err := range errs {
			msg += fmt.Sprintf("\n%s: %v", repoUrl, err)
		}
		return fmt.Errorf(msg)
	}

	// Update the queues.
	q.lock.Lock()
	defer q.lock.Unlock()
	q.queue = queue

	return nil
}

// updateRepo syncs the given repo and returns a set of BuildCandidates for
// each builder which uses it.
func (q *BuildQueue) updateRepo(repoUrl string, now time.Time) (map[string][]*BuildCandidate, error) {
	defer timer.New("BuildQueue.updateRepo()").Stop()
	errMsg := "Failed to update the repo: %v"

	// Sync/update the code.
	repo, err := q.repos.Repo(repoUrl)
	if err != nil {
		return nil, fmt.Errorf(errMsg, err)
	}
	if err := repo.Update(true, true); err != nil {
		return nil, fmt.Errorf(errMsg, err)
	}

	// Get the details for all recent commits.
	from := now.Add(-q.period)
	if q.period == PERIOD_FOREVER {
		from = time.Unix(0, 0)
	}
	recentCommits := repo.From(from)

	// Pre-load commit details, from a larger window than we actually care about.
	fromPreload := now.Add(time.Duration(int64(-1.5 * float64(q.period))))
	if q.period == PERIOD_FOREVER {
		fromPreload = time.Unix(0, 0)
	}
	recentCommitsPreload := repo.From(fromPreload)
	for _, c := range recentCommitsPreload {
		if _, err := repo.Details(c); err != nil {
			return nil, fmt.Errorf(errMsg, err)
		}
	}

	// Get all builds associated with the recent commits.
	buildsByCommit, err := buildbot.GetBuildsForCommits(recentCommitsPreload, map[int]bool{})
	if err != nil {
		return nil, fmt.Errorf(errMsg, err)
	}

	// Create buildFinders for each builder.
	buildFinders := map[string]*buildFinder{}
	for _, buildsForCommit := range buildsByCommit {
		for _, build := range buildsForCommit {
			if util.AnyMatch(q.botBlacklist, build.Builder) {
				glog.Infof("Skipping blacklisted builder %s", build.Builder)
				continue
			}
			if _, ok := buildFinders[build.Builder]; !ok {
				bf, err := newBuildFinder(build.Builder, build.Master, build.Repository)
				if err != nil {
					return nil, fmt.Errorf(errMsg, err)
				}
				buildFinders[build.Builder] = bf
			}
			buildFinders[build.Builder].add(build)
		}
	}

	// Find candidates for each builder.
	candidates := map[string][]*BuildCandidate{}
	errs := map[string]error{}
	mutex := sync.Mutex{}
	var wg sync.WaitGroup
	for builder, finder := range buildFinders {
		wg.Add(1)
		go func(b string, bf *buildFinder) {
			defer wg.Done()
			c, err := q.getCandidatesForBuilder(bf, recentCommits, now)
			mutex.Lock()
			defer mutex.Unlock()
			if err != nil {
				errs[b] = err
				return
			}
			candidates[b] = c
		}(builder, finder)
	}
	wg.Wait()
	if len(errs) > 0 {
		msg := "Failed to update the repo:"
		for _, err := range errs {
			msg += fmt.Sprintf("\n%v", err)
		}
		return nil, fmt.Errorf(msg)
	}
	return candidates, nil
}

// getCandidatesForBuilder finds all BuildCandidates for the given builder, in order.
func (q *BuildQueue) getCandidatesForBuilder(bf *buildFinder, recentCommits []string, now time.Time) ([]*BuildCandidate, error) {
	defer timer.New(fmt.Sprintf("getCandidatesForBuilder(%s)", bf.Builder)).Stop()
	repo, err := q.repos.Repo(bf.Repo)
	if err != nil {
		return nil, err
	}
	candidates := []*BuildCandidate{}
	for {
		score, newBuild, stoleFrom, err := q.getBestCandidate(bf, recentCommits, now)
		if err != nil {
			return nil, fmt.Errorf("Failed to get build candidates for %s: %v", bf.Builder, err)
		}
		if score < q.scoreThreshold {
			break
		}
		d, err := repo.Details(newBuild.GotRevision)
		if err != nil {
			return nil, err
		}
		// "insert" the new build.
		bf.add(newBuild)
		if stoleFrom != nil {
			bf.add(stoleFrom)
		}
		candidates = append(candidates, &BuildCandidate{
			Author:  d.Author,
			Builder: newBuild.Builder,
			Commit:  newBuild.GotRevision,
			Score:   score,
			Repo:    bf.Repo,
		})
	}
	return candidates, nil
}

// getBestCandidate finds the best BuildCandidate for the given builder.
func (q *BuildQueue) getBestCandidate(bf *buildFinder, recentCommits []string, now time.Time) (float64, *buildbot.Build, *buildbot.Build, error) {
	errMsg := fmt.Sprintf("Failed to get best candidate for %s: %%v", bf.Builder)
	repo, err := q.repos.Repo(bf.Repo)
	if err != nil {
		return 0.0, nil, nil, fmt.Errorf(errMsg, err)
	}
	// Find the current scores for each commit.
	currentScores := map[string]float64{}
	for _, commit := range recentCommits {
		currentBuild, err := bf.getBuildForCommit(commit)
		if err != nil {
			return 0.0, nil, nil, fmt.Errorf(errMsg, err)
		}
		d, err := repo.Details(commit)
		if err != nil {
			return 0.0, nil, nil, err
		}
		currentScores[commit] = scoreBuild(d, currentBuild, now, q.timeLambda)
	}

	// For each commit/builder pair, determine the score increase obtained
	// by running a build at that commit.
	scoreIncrease := map[string]float64{}
	newBuildsByCommit := map[string]*buildbot.Build{}
	stoleFromByCommit := map[string]*buildbot.Build{}
	for _, commit := range recentCommits {
		// Shortcut: Don't bisect builds with a huge number
		// of commits.  This saves lots of time and only affects
		// the first successful build for a bot.
		b, err := bf.getBuildForCommit(commit)
		if err != nil {
			return 0.0, nil, nil, fmt.Errorf(errMsg, err)
		}
		if b != nil {
			if len(b.Commits) > NO_BISECT_COMMIT_LIMIT {
				glog.Warningf("Skipping %s on %s; previous build has too many commits (#%d)", commit[0:7], b.Builder, b.Number)
				scoreIncrease[commit] = 0.0
				continue
			}
		}

		newScores := map[string]float64{}
		// Pretend to create a new Build at the given commit.
		newBuild := buildbot.Build{
			Builder:     bf.Builder,
			Master:      bf.Master,
			Number:      bf.MaxBuildNum + 1,
			GotRevision: commit,
			Repository:  bf.Repo,
		}
		commits, stealFrom, stolen, err := buildbot.FindCommitsForBuild(bf, &newBuild, q.repos)
		if err != nil {
			return 0.0, nil, nil, fmt.Errorf(errMsg, err)
		}
		// Re-score all commits in the new build.
		newBuild.Commits = commits
		for _, c := range commits {
			d, err := repo.Details(c)
			if err != nil {
				return 0.0, nil, nil, fmt.Errorf(errMsg, err)
			}
			if _, ok := currentScores[c]; !ok {
				// If this build has commits which are outside of our window,
				// insert them into currentScores to account for them.
				b, err := bf.getBuildForCommit(c)
				if err != nil {
					return 0.0, nil, nil, fmt.Errorf(errMsg, err)
				}
				score := scoreBuild(d, b, now, q.timeLambda)
				currentScores[c] = score
			}
			newScores[c] = scoreBuild(d, &newBuild, now, q.timeLambda)
		}
		newBuildsByCommit[commit] = &newBuild
		// If the new build includes commits previously included in
		// another build, update scores for commits in the build we stole
		// them from.
		if stealFrom != -1 {
			stoleFromOrig, err := bf.getByNumber(stealFrom)
			if err != nil {
				return 0.0, nil, nil, fmt.Errorf(errMsg, err)
			}
			if stoleFromOrig == nil {
				// The build may not be cached. Fall back on getting it from the DB.
				stoleFromOrig, err = buildbot.GetBuildFromDB(bf.Builder, bf.Master, stealFrom)
				if err != nil {
					return 0.0, nil, nil, fmt.Errorf(errMsg, err)
				}
				bf.add(stoleFromOrig)
			}
			// "copy" the build so that we can assign new commits to it
			// without modifying the cached build.
			stoleFromBuild := *stoleFromOrig
			newCommits := []string{}
			for _, c := range stoleFromBuild.Commits {
				if !util.In(c, stolen) {
					newCommits = append(newCommits, c)
				}
			}
			stoleFromBuild.Commits = newCommits
			for _, c := range stoleFromBuild.Commits {
				d, err := repo.Details(c)
				if err != nil {
					return 0.0, nil, nil, err
				}
				newScores[c] = scoreBuild(d, &stoleFromBuild, now, q.timeLambda)
			}
			stoleFromByCommit[commit] = &stoleFromBuild
		}
		// Sum the old and new scores.
		oldScoresList := make([]float64, 0, len(newScores))
		newScoresList := make([]float64, 0, len(newScores))
		for c, score := range newScores {
			oldScoresList = append(oldScoresList, currentScores[c])
			newScoresList = append(newScoresList, score)
		}
		oldTotal := util.Float64StableSum(oldScoresList)
		newTotal := util.Float64StableSum(newScoresList)
		scoreIncrease[commit] = newTotal - oldTotal
	}

	// Arrange the score increases by builder.
	candidates := []*BuildCandidate{}
	for commit, increase := range scoreIncrease {
		candidates = append(candidates, &BuildCandidate{
			Commit: commit,
			Score:  increase,
		})
	}
	sort.Sort(BuildCandidateSlice(candidates))
	best := candidates[len(candidates)-1]

	return best.Score, newBuildsByCommit[best.Commit], stoleFromByCommit[best.Commit], nil
}

// Pop retrieves the highest-priority item in the given set of builders and
// removes it from the queue. Returns nil if there are no items in the queue.
func (q *BuildQueue) Pop(builders []string) (*BuildCandidate, error) {
	q.lock.Lock()
	defer q.lock.Unlock()
	var best *BuildCandidate
	for _, builder := range builders {
		s, ok := q.queue[builder]
		if !ok {
			// We don't yet know about this builder. In other words, it hasn't
			// built any commits. Therefore, the highest-priority commit to
			// build is tip-of-tree. Unfortunately, we don't know which repo
			// the bot uses, so we can only say "origin/master" and use the Skia
			// repo as a default.
			r, err := q.repos.Repo(q.repos.Repos()[0])
			if err != nil {
				return nil, err
			}
			h, err := r.FullHash("origin/master")
			if err != nil {
				return nil, err
			}
			details, err := r.Details(h)
			if err != nil {
				return nil, err
			}
			best = &BuildCandidate{
				Author:  details.Author,
				Builder: builder,
				Commit:  h,
				Repo:    q.repos.Repos()[0],
				Score:   math.MaxFloat64,
			}
			q.queue[builder] = []*BuildCandidate{best}
		} else {
			if len(s) > 0 {
				bc := s[0]
				if best == nil || bc.Score > best.Score {
					best = bc
				}
			}
		}
	}
	// Return the highest-priority commit for this builder.
	if best == nil {
		return nil, ERR_EMPTY_QUEUE
	}
	q.queue[best.Builder] = q.queue[best.Builder][1:len(q.queue[best.Builder])]
	return best, nil
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>R-Index</title>
<meta name="date" content="2015-02-23">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G L O P R S T V W Z

R

readByte() - Method in class cub3d.file.reader.BasicReader

readDouble() - Method in class cub3d.file.reader.BasicReader

Reader - Class in cub3d.file.reader

Reader(InputStream) - Constructor for class cub3d.file.reader.Reader

readFloat() - Method in class cub3d.file.reader.BasicReader

readInt() - Method in class cub3d.file.reader.BasicReader

readLine() - Method in class cub3d.file.reader.BasicReader

readLong() - Method in class cub3d.file.reader.BasicReader

readRawByte() - Method in class cub3d.file.reader.Reader

A B C D E F G L O P R S T V W Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
kitchensink-aerogear-js: Example AeroGear Application Using Multiple HTML5, Mobile & JAX-RS Technologies
=========================================================================================================
Author: Jay Balunas
Level: Beginner
Technologies: Aerogear, CDI, HTML5, REST
Origin: http://www.aerogear.org
Summary: Based on kitchensink, but uses HTML5, making it suitable for mobile and tablet computers
Target Product: WFK

What is it?
-----------

This is your project! It's a deployable Maven 3 project to help you
get your foot in the door developing HTML5 based desktop/mobile web applications with Java EE 6
on JBoss. This project is setup to allow you to create a basic Java EE 6 application
using HTML5, jQuery Mobile, JAX-RS, CDI 1.0, EJB 3.1, JPA 2.0 and Bean Validation 1.0. It includes
a persistence unit and some sample persistence and transaction code to help
you get your feet wet with database access in enterprise Java.

This application is built using a HTML5 + REST approach.  This uses a pure HTML
client that interacts with with the application server via restful end-points (JAX-RS).  This
application also uses some of the latest HTML5 features and advanced JAX-RS. And since testing
is just as important with client side as it is server side, this application uses QUnit to show
you how to unit test your JavaScript.

What is a modern web application without mobile web support? This application also integrates
jQuery mobile and basic client side device detection to give you both a desktop and mobile
version of the interface. Both support the same features, including form validation, member
registration, etc. However the mobile version adds in mobile layout, touch, and performance
improvements needed to get you started with mobile web development on JBoss.

System requirements
-------------------

All you need to build this project is Java 6.0 (Java SDK 1.6) or better, Maven
3.0 or better.

The application this project produces is designed to be run on JBoss AS 7 or JBoss Enterprise Application Platform 6.

An HTML5 compatible browser such as Chrome, Safari 5+, Firefox 5+, or IE 9+ are
required. and note that some behaviors will vary slightly (ex. validations) based on browser support,
especially IE 9.

Mobile web support is limited to Android and iOS devices.  It should run on HP,
and Black Berry devices as well.  Windows Phone, and others will be supported as
jQuery Mobile announces support.

With the prerequisites out of the way, you're ready to build and deploy.

Deploying the application
-------------------------

### Deploying locally

First you need to start the JBoss container. To do this, run

    $JBOSS_HOME/bin/standalone.sh

or if you are using windows

    $JBOSS_HOME/bin/standalone.bat

Note: Adding "-b 0.0.0.0" to the above commands will allow external clients (phones, tablets,
desktops, etc...) connect through your local network.

For example

    $JBOSS_HOME/bin/standalone.sh -b 0.0.0.0

To deploy the application, you first need to produce the archive to deploy using
the following Maven goal:

    mvn package

You can now deploy the artifact by executing the following command:

    mvn jboss-as:deploy

The client application will be running at the following URL [http://localhost:8080/\<artifactId>/]("http://localhost:8080/<artifactId>").

To undeploy run this command:

    mvn jboss-as:undeploy

You can also start the JBoss container and deploy the project using JBoss Tools. See the
Getting Started Developing Applications Guide
for more information.

### Deploying to OpenShift

You can also deploy the application directly to OpenShift, Red Hat's cloud based PaaS offering, follow the instructions [here](https://community.jboss.org/wiki/DeployingHTML5ApplicationsToOpenshift)

Minification
============================

By default, the project uses the [wro4j](http://code.google.com/p/wro4j/) plugin,
which provides the ability to concatenate, validate and minify JavaScript and CSS
files. These minified files, as well as their unmodified versions are deployed with
the project.

With just a few quick changes to the project, you can link to the minified versions
of your JavaScript and CSS files.

First, in the <project-root>/src/main/webapp/index.html file, search for
references to minification and comment or uncomment the appropriate lines.

Finally, wro4j runs in the compile phase so any standard build command like package,
install, etc. will trigger it. The plugin is in a profile with an id of "minify" so
you will want to specify that profile in your maven build.

NOTE: You must either specify the default profile for no tests or the arquillian test
profile to run tests when minifying to avoid test errors. For example:

    #No Tests
    mvn clean package jboss-as:deploy -Pminify,default

OR

    #With Tests
    mvn clean package jboss-as:deploy -Pminify,arq-jbossas-remote

Running the Arquillian tests
============================

By default, tests are configured to be skipped. The reason is that the sample
test is an Arquillian test, which requires the use of a container. You can
activate this test by selecting one of the container configuration provided
for JBoss.

To run the test in JBoss, first start the container instance. Then, run the
test goal with the following profile activated:

    mvn clean test -Parq-jbossas-remote

Running the QUnit tests
============================

QUnit is a JavaScript unit testing framework used and built by jQuery. This
application includes a set of QUnit tests in order to verify JavaScript that
is core to this HTML5 application. Executing QUnit test cases is quite easy. First,
make sure the server is running and the project has been deployed as some of the
tests will be testing the functionality of the services. Then, simply load the
following HTML in the browser you wish to test.

    <project-root>/src/test/qunit/index.html

For more information on QUnit tests see http://docs.jquery.com/QUnit

Importing the project into an IDE
=================================

If you created the project using the Maven archetype wizard in your IDE
(Eclipse, NetBeans or IntelliJ IDEA), then there is nothing to do. You should
already have an IDE project.

Detailed instructions for using Eclipse / JBoss Tools with are provided in the
Getting Started Developing Applications Guide.

If you created the project from the command line using archetype:generate, then
you need to import the project into your IDE. If you are using NetBeans 6.8 or
IntelliJ IDEA 9, then all you have to do is open the project as an existing
project. Both of these IDEs recognize Maven projects natively.

Downloading the sources and Javadocs
====================================

If you want to be able to debug into the source code or look at the Javadocs
of any library in the project, you can run either of the following two
commands to pull them into your local repository. The IDE should then detect
them.

    mvn dependency:sources
    mvn dependency:resolve -Dclassifier=javadoc

Development notes
=================

Copyright headers
-----------------

To update the copyright headers, just run `mvn license:format -Dyear=<current year>`