text:
"""Unit tests for reviewboard.accounts.models.Trophy."""

from django.contrib.auth.models import User
from django.test.client import RequestFactory

from reviewboard.accounts.models import Trophy
from reviewboard.accounts.trophies import TrophyType
from reviewboard.deprecation import RemovedInReviewBoard40Warning
from reviewboard.testing import TestCase

class TrophyTests(TestCase):
    """Unit tests for reviewboard.accounts.models.Trophy."""

    fixtures = ['test_users']

    def test_is_fish_trophy_awarded_for_new_review_request(self):
        """Testing if a fish trophy is awarded for a new review request"""
        user1 = User.objects.get(username='doc')
        category = 'fish'
        review_request = self.create_review_request(publish=True, id=3223,
                                                    submitter=user1)
        trophies = Trophy.objects.get_trophies(review_request)
        self.assertEqual(trophies[0].category, category)
        self.assertTrue(
            trophies[0].review_request.extra_data['calculated_trophies'])

    def test_is_fish_trophy_awarded_for_older_review_request(self):
        """Testing if a fish trophy is awarded for an older review request"""
        user1 = User.objects.get(username='doc')
        category = 'fish'
        review_request = self.create_review_request(publish=True, id=1001,
                                                    submitter=user1)
        del review_request.extra_data['calculated_trophies']
        trophies = Trophy.objects.get_trophies(review_request)
        self.assertEqual(trophies[0].category, category)
        self.assertTrue(
            trophies[0].review_request.extra_data['calculated_trophies'])

    def test_is_milestone_trophy_awarded_for_new_review_request(self):
        """Testing if a milestone trophy is awarded for a new review request
        """
        user1 = User.objects.get(username='doc')
        category = 'milestone'
        review_request = self.create_review_request(publish=True, id=1000,
                                                    submitter=user1)
        trophies = Trophy.objects.compute_trophies(review_request)
        self.assertEqual(trophies[0].category, category)
        self.assertTrue(
            trophies[0].review_request.extra_data['calculated_trophies'])

    def test_is_milestone_trophy_awarded_for_older_review_request(self):
        """Testing if a milestone trophy is awarded for an older review
        request
        """
        user1 = User.objects.get(username='doc')
        category = 'milestone'
        review_request = self.create_review_request(publish=True, id=10000,
                                                    submitter=user1)
        del review_request.extra_data['calculated_trophies']
        trophies = Trophy.objects.compute_trophies(review_request)
        self.assertEqual(trophies[0].category, category)
        self.assertTrue(
            trophies[0].review_request.extra_data['calculated_trophies'])

    def test_is_no_trophy_awarded(self):
        """Testing if no trophy is awarded"""
        user1 = User.objects.get(username='doc')
        review_request = self.create_review_request(publish=True, id=999,
                                                    submitter=user1)
        trophies = Trophy.objects.compute_trophies(review_request)
        self.assertFalse(trophies)

redpajama_set_name: RedPajamaGithub


text:
import axios from 'axios';
import { reducer as notifReducer, actions as notifActions, Notifs } from 're-notif';
const { notifSend } = notifActions;
import notification from './notification';

export const HACKATHON = 'HACKATHON';
export const UPDATE = 'UPDATE_HACKATHON';

// ------------------------------------
// Actions
// ------------------------------------
export function hackathon (value: Object): Action {
  return {
    type: HACKATHON,
    payload: value
  };
}

export function update (value: Object): Action {
  return {
    type: UPDATE,
    payload: value
  };
}

export const fetchFromServer = (id) => (dispatch) => {
  // TODO use config path instead
  axios.get('/api/hackathons/' + id)
    .then((res) => {
      dispatch(hackathon(res.data));
    });
};

export const reset = () => (dispatch) => {
  dispatch(hackathon({hackathon: {}}));
};

export const updateToSever = (id, req) => (dispatch) => {
  // TODO use config path instead
  if(id) {
    axios.put('/api/hackathons/' + id, req.hackathon)
      .then((res) => {
        dispatch(update(res.data));
        dispatch(notifSend(notification(res.data.title + ' is now updated', 'success')));
      });
  } else {
    axios.post('/api/hackathons/', req.hackathon)
      .then((res) => {
        dispatch(update(res.data));
        dispatch(notifSend(notification(res.data.title + ' is now created', 'success')));
      });
  }
};

export const actions = {
  fetchFromServer,
  updateToSever,
  reset
};

// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [HACKATHON]: (state: Object, action: {payload: Object}): Object => action.payload,
  [UPDATE]: (state: Object, action: {payload: Object}) : Object => action.payload
};

// ------------------------------------
// Reducer
// ------------------------------------
const initialState = new Object();
export default function hackathonReducer (state: Object = initialState, action: Action): Object {
  const handler = ACTION_HANDLERS[action.type];

  return handler ? handler(state, action) : state;
}


text:
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
using System.Xml.Linq;

namespace TheGameOfLife.Model
{
    public sealed class PhysicsContainer
    {
        #region Singleton

        private static readonly object PadLock = new object();
        private static PhysicsContainer _instance;

        public static PhysicsContainer Instance
        {
            get
            {
                lock (PadLock)
                {
                    if (_instance == null)
                    {
                        _instance = new PhysicsContainer();
                    }
                    return _instance;
                }
            }
        }

        #endregion

        private Dictionary<string, LifePhysics> _physicses = new Dictionary<string, LifePhysics>();
        private string _defaultPhysiscName = string.Empty;

        public PhysicsContainer()
        {
            ExtractPhysics();
        }

        #region Extraction

        private void ExtractPhysics()
        {
            var xmlDoc = GetXmlDocument();
            ExtractDefaultPhysicsName(xmlDoc);
            ExtractPhysicsFromXML(xmlDoc);
        }

        private XDocument GetXmlDocument()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var stream = assembly.GetManifestResourceStream("TheGameOfLife.Model.Physics.xml");
            var xDoc = XDocument.Load(stream);
            return xDoc;
        }

        private void ExtractDefaultPhysicsName(XDocument xmlDoc)
        {
            _defaultPhysiscName = xmlDoc.Descendants("DefaultPhysicName").Single().Value;
        }

        private void ExtractPhysicsFromXML(XDocument xmlDoc)
        {
            var fromXmlPhysics = xmlDoc.Descendants("Physic");

            foreach (var physics in fromXmlPhysics)
            {
                string name = physics.Attribute("Name").Value;
                string description = physics.Attribute("Description").Value;

                string ruleString = physics.Descendants("Rule").Single().Value;
                string[] rules = ruleString.Split('/');
                if (rules.Length != 2)
                    throw new XmlException(string.Format("Rule in {0} physic invalid.", name));
                List<int> aliveStaysAlive = ExtractDigitsFromString(rules[0]);
                List<int> deadBecomesAlive = ExtractDigitsFromString(rules[1]);

                var newPhysic = new LifePhysics(name, description, aliveStaysAlive, deadBecomesAlive);

                _physicses.Add(name, newPhysic);
            }
        }

        /// <summary>
        /// Extracts list of digits from string that describes physic's rule.
        /// E.g. if life rule is 23/345, then we invoke this method twice with "23" and "345" parameters.
        /// </summary>
        /// <param name="rule">Life rule, e.g. "3456". No special characters allowed.</param>
        /// <returns>List of digits extracted from provided string.</returns>
        private List<int> ExtractDigitsFromString(string rule)
        {
            return rule.Select(digit => digit - 48).ToList();
        }

        #endregion

        public LifePhysics GetPhysic()
        {
            return GetPhysic(string.Empty);
        }

        public LifePhysics GetPhysic(string name)
        {
            if (string.IsNullOrEmpty(name))
                name = _defaultPhysiscName;

            var physics = _physicses.Single(x => x.Key == name).Value;

            return physics;
        }
    }
}


text:
package keybase1

import (
	"github.com/keybase/go-framed-msgpack-rpc/rpc"
	context "golang.org/x/net/context"
)

type RegisterAddressRes struct {
	Type   string `codec:"type" json:"type"`
	Family string `codec:"family" json:"family"`
}

func (o RegisterAddressRes) DeepCopy() RegisterAddressRes {
	return RegisterAddressRes{
		Type:   o.Type,
		Family: o.Family,
	}
}

type RegisterAddressArg struct {
	SessionID    int         `codec:"sessionID" json:"sessionID"`
	Address      string      `codec:"address" json:"address"`
	Force        bool        `codec:"force" json:"force"`
	WantedFamily string      `codec:"wantedFamily" json:"wantedFamily"`
	SigVersion   *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"`
}

type CryptocurrencyInterface interface {
	RegisterAddress(context.Context, RegisterAddressArg) (RegisterAddressRes, error)
}

func CryptocurrencyProtocol(i CryptocurrencyInterface) rpc.Protocol {
	return rpc.Protocol{
		Name: "keybase.1.cryptocurrency",
		Methods: map[string]rpc.ServeHandlerDescription{
			"registerAddress": {
				MakeArg: func() interface{} {
					var ret [1]RegisterAddressArg
					return &ret
				},
				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
					typedArgs, ok := args.(*[1]RegisterAddressArg)
					if !ok {
						err = rpc.NewTypeError((*[1]RegisterAddressArg)(nil), args)
						return
					}
					ret, err = i.RegisterAddress(ctx, typedArgs[0])
					return
				},
			},
		},
	}
}

type CryptocurrencyClient struct {
	Cli rpc.GenericClient
}

func (c CryptocurrencyClient) RegisterAddress(ctx context.Context, __arg RegisterAddressArg) (res RegisterAddressRes, err error) {
	err = c.Cli.Call(ctx, "keybase.1.cryptocurrency.registerAddress", []interface{}{__arg}, &res)
	return
}


text:
"""Wrappers for protocol buffer enum types."""

class EncodingType(object):
    """
    Represents the text encoding that the caller uses to process the output.
    Providing an ``EncodingType`` is recommended because the API provides the
    beginning offsets for various outputs, such as tokens and mentions, and
    languages that natively use different text encodings may access offsets
    differently.

    Attributes:
      NONE (int): If ``EncodingType`` is not specified, encoding-dependent information (such as
        ``begin_offset``) will be set at ``-1``.
      UTF8 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based
        on the UTF-8 encoding of the input. C++ and Go are examples of languages
        that use this encoding natively.
      UTF16 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based
        on the UTF-16 encoding of the input. Java and Javascript are examples of
        languages that use this encoding natively.
      UTF32 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based
        on the UTF-32 encoding of the input. Python is an example of a language
        that uses this encoding natively.
    """
    NONE = 0
    UTF8 = 1
    UTF16 = 2
    UTF32 = 3

class Document(object):
    class Type(object):
        """
        The document types enum.

        Attributes:
          TYPE_UNSPECIFIED (int): The content type is not specified.
          PLAIN_TEXT (int): Plain text
          HTML (int): HTML
        """
        TYPE_UNSPECIFIED = 0
        PLAIN_TEXT = 1
        HTML = 2

class Entity(object):
    class Type(object):
        """
        The type of the entity.

        Attributes:
          UNKNOWN (int): Unknown
          PERSON (int): Person
          LOCATION (int): Location
          ORGANIZATION (int): Organization
          EVENT (int): Event
          WORK_OF_ART (int): Work of art
          CONSUMER_GOOD (int): Consumer goods
          OTHER (int): Other types
        """
        UNKNOWN = 0
        PERSON = 1
        LOCATION = 2
        ORGANIZATION = 3
        EVENT = 4
        WORK_OF_ART = 5
        CONSUMER_GOOD = 6
        OTHER = 7

class PartOfSpeech(object):
    class Tag(object):
        """
        The part of speech tags enum.

        Attributes:
          UNKNOWN (int): Unknown
          ADJ (int): Adjective
          ADP (int): Adposition (preposition and postposition)
          ADV (int): Adverb
          CONJ (int): Conjunction
          DET (int): Determiner
          NOUN (int): Noun (common and proper)
          NUM (int): Cardinal number
          PRON (int): Pronoun
          PRT (int): Particle or other function word
          PUNCT (int): Punctuation
          VERB (int): Verb (all tenses and modes)
          X (int): Other: foreign words, typos, abbreviations
          AFFIX (int): Affix
        """
        UNKNOWN = 0
        ADJ = 1
        ADP = 2
        ADV = 3
        CONJ = 4
        DET = 5
        NOUN = 6
        NUM = 7
        PRON = 8
        PRT = 9
        PUNCT = 10
        VERB = 11
        X = 12
        AFFIX = 13

class DependencyEdge(object):
    class Label(object):
        """
        The parse label enum for the token.

        Attributes:
          UNKNOWN (int): Unknown
          ABBREV (int): Abbreviation modifier
          ACOMP (int): Adjectival complement
          ADVCL (int): Adverbial clause modifier
          ADVMOD (int): Adverbial modifier
          AMOD (int): Adjectival modifier of an NP
          APPOS (int): Appositional modifier of an NP
          ATTR (int): Attribute dependent of a copular verb
          AUX (int): Auxiliary (non-main) verb
          AUXPASS (int): Passive auxiliary
          CC (int): Coordinating conjunction
          CCOMP (int): Clausal complement of a verb or adjective
          CONJ (int): Conjunct
          CSUBJ (int): Clausal subject
          CSUBJPASS (int): Clausal passive subject
          DEP (int): Dependency (unable to determine)
          DET (int): Determiner
          DISCOURSE (int): Discourse
          DOBJ (int): Direct object
          EXPL (int): Expletive
          GOESWITH (int): Goes with (part of a word in a text not well edited)
          IOBJ (int): Indirect object
          MARK (int): Marker (word introducing a subordinate clause)
          MWE (int): Multi-word expression
          MWV (int): Multi-word verbal expression
          NEG (int): Negation modifier
          NN (int): Noun compound modifier
          NPADVMOD (int): Noun phrase used as an adverbial modifier
          NSUBJ (int): Nominal subject
          NSUBJPASS (int): Passive nominal subject
          NUM (int): Numeric modifier of a noun
          NUMBER (int): Element of compound number
          P (int): Punctuation mark
          PARATAXIS (int): Parataxis relation
          PARTMOD (int): Participial modifier
          PCOMP (int): The complement of a preposition is a clause
          POBJ (int): Object of a preposition
          POSS (int): Possession modifier
          POSTNEG (int): Postverbal negative particle
          PRECOMP (int): Predicate complement
          PRECONJ (int): Preconjunt
          PREDET (int): Predeterminer
          PREF (int): Prefix
          PREP (int): Prepositional modifier
          PRONL (int): The relationship between a verb and verbal morpheme
          PRT (int): Particle
          PS (int): Associative or possessive marker
          QUANTMOD (int): Quantifier phrase modifier
          RCMOD (int): Relative clause modifier
          RCMODREL (int): Complementizer in relative clause
          RDROP (int): Ellipsis without a preceding predicate
          REF (int): Referent
          REMNANT (int): Remnant
          REPARANDUM (int): Reparandum
          ROOT (int): Root
          SNUM (int): Suffix specifying a unit of number
          SUFF (int): Suffix
          TMOD (int): Temporal modifier
          TOPIC (int): Topic marker
          VMOD (int): Clause headed by an infinite form of the verb that modifies a noun
          VOCATIVE (int): Vocative
          XCOMP (int): Open clausal complement
          SUFFIX (int): Name suffix
          TITLE (int): Name title
          ADVPHMOD (int): Adverbial phrase modifier
          AUXCAUS (int): Causative auxiliary
          AUXVV (int): Helper auxiliary
          DTMOD (int): Rentaishi (Prenominal modifier)
          FOREIGN (int): Foreign words
          KW (int): Keyword
          LIST (int): List for chains of comparable items
          NOMC (int): Nominalized clause
          NOMCSUBJ (int): Nominalized clausal subject
          NOMCSUBJPASS (int): Nominalized clausal passive
          NUMC (int): Compound of numeric modifier
          COP (int): Copula
          DISLOCATED (int): Dislocated relation (for fronted/topicalized elements)
        """
        UNKNOWN = 0
        ABBREV = 1
        ACOMP = 2
        ADVCL = 3
        ADVMOD = 4
        AMOD = 5
        APPOS = 6
        ATTR = 7
        AUX = 8
        AUXPASS = 9
        CC = 10
        CCOMP = 11
        CONJ = 12
        CSUBJ = 13
        CSUBJPASS = 14
        DEP = 15
        DET = 16
        DISCOURSE = 17
        DOBJ = 18
        EXPL = 19
        GOESWITH = 20
        IOBJ = 21
        MARK = 22
        MWE = 23
        MWV = 24
        NEG = 25
        NN = 26
        NPADVMOD = 27
        NSUBJ = 28
        NSUBJPASS = 29
        NUM = 30
        NUMBER = 31
        P = 32
        PARATAXIS = 33
        PARTMOD = 34
        PCOMP = 35
        POBJ = 36
        POSS = 37
        POSTNEG = 38
        PRECOMP = 39
        PRECONJ = 40
        PREDET = 41
        PREF = 42
        PREP = 43
        PRONL = 44
        PRT = 45
        PS = 46
        QUANTMOD = 47
        RCMOD = 48
        RCMODREL = 49
        RDROP = 50
        REF = 51
        REMNANT = 52
        REPARANDUM = 53
        ROOT = 54
        SNUM = 55
        SUFF = 56
        TMOD = 57
        TOPIC = 58
        VMOD = 59
        VOCATIVE = 60
        XCOMP = 61
        SUFFIX = 62
        TITLE = 63
        ADVPHMOD = 64
        AUXCAUS = 65
        AUXVV = 66
        DTMOD = 67
        FOREIGN = 68
        KW = 69
        LIST = 70
        NOMC = 71
        NOMCSUBJ = 72
        NOMCSUBJPASS = 73
        NUMC = 74
        COP = 75
        DISLOCATED = 76


text:
require 'digest/sha1'
require 'active_model'
require 'rubylibcrack'
module LdapChangePassword
  class User

    include ActiveModel::Dirty
    include ActiveModel::AttributeMethods
    include ActiveModel::Validations
    include ActiveModel::Serialization
    include ActiveModel::MassAssignmentSecurity
    extend  ActiveModel::Translation

    class << self
      def find_by_login(login)
        @ldap_user = LdapChangePassword::LDAP::User.find_by_login(login)
        new(@ldap_user) unless @ldap_user.nil?
      end

      def authenticate?(login, password)
        @ldap_user = LdapChangePassword::LDAP::User.find_by_login(login)
        @ldap_user.authenticate?(password) unless @ldap_user.nil?
      end
    end

    attr_reader   :login, :fullname, :email, :group, :expiration_date
    attr_accessor :password, :current_password
    define_attribute_methods  [:password, :current_password]
    validates :password, :presence => true, :confirmation => true, :length => {:within => 6..40}
    validates_presence_of :current_password, :on => :update
    class_attribute :_attributes
    self._attributes = []

    def initialize(entry)
      @ldap_entry = entry
      set_attr_readers!
    end

    def attributes
      self._attributes.inject({}) do |hash, attr|
        hash[attr.to_s] = send(attr)
        hash
      end
    end

    def valid?
      super and current_password_valid? and new_password_strong?
    end

    def save
      valid? ? update : false
    end

    def update
      if valid?
        update_ldap_password!
        true
      else
        false
      end
    end

    def update_attributes(hash)
      sanitize_for_mass_assignment(hash).each do |attribute, value|
        instance_variable_set("@#{attribute}", value)
      end
      update
    end

    def fullname
      force_encoding @fullname
    end

    def serializable_hash
      super :only => :login
    end

    private
    def force_encoding(string)
      string.to_s.force_encoding('utf-8').to_s
    end

    def current_password_valid?
      unless @ldap_entry.authenticate?(current_password)
        errors.add :current_password, "doesn't match"
        false
      else
        true
      end
    end

    def update_ldap_password!
      if password_was != password
        @ldap_entry.update_password(password)
      end
    end

    def new_password_strong?
       pw = Cracklib::Password.new(password)
       if pw.strong?
          true
       else
          errors.add :password, pw.message
          false
       end
    end

    def set_attr_readers!
      [:login, :fullname, :email, :group, :expiration_date, :password].each do |attr_name|
        if @ldap_entry.respond_to? attr_name
          self.instance_variable_set("@#{attr_name}", @ldap_entry.send(attr_name))
          self._attributes << attr_name
        end
        self.password_will_change!
      end
    end
  end
end


text:
package com.bt.pi.app.instancemanager.handlers;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.bt.pi.app.common.entities.BlockDeviceMapping;
import com.bt.pi.app.common.entities.Instance;
import com.bt.pi.app.common.entities.InstanceState;
import com.bt.pi.app.common.entities.Volume;
import com.bt.pi.app.common.entities.VolumeState;
import com.bt.pi.app.common.resource.PiQueue;
import com.bt.pi.app.instancemanager.libvirt.LibvirtManagerException;
import com.bt.pi.core.application.ReceivedMessageContext;
import com.bt.pi.core.conf.Property;
import com.bt.pi.core.continuation.PiContinuation;
import com.bt.pi.core.continuation.UpdateResolvingPiContinuation;
import com.bt.pi.core.dht.DhtWriter;
import com.bt.pi.core.entity.EntityResponseCode;
import com.bt.pi.core.id.PId;
import com.bt.pi.core.util.SerialExecutorRunnable;

/*
 * handle the detaching of volumes
 */
@Component("InstanceManager.DetachVolumeHandler")
public class DetachVolumeHandler extends AbstractHandler {
    private static final String FORCE_DETACHING_VOLUME_S_FROM_S = "force detaching volume %s from %s";
    private static final String DEFAULT_DETACH_VOLUME_RETRIES = "5";
    private static final Log LOG = LogFactory.getLog(DetachVolumeHandler.class);
    private static final int ONE = 1;
    private static final int SECOND = 1000;
    private static final String DEFAULT_DETACH_VOLUME_XML = "<disk type='file'><driver name='tap' type='aio' cache='default' /><source file='%s'/><target dev='%s'/></disk>";
    private String detachVolumeXml = DEFAULT_DETACH_VOLUME_XML;
    private int detachVolumeRetries;
    private ConcurrentMap<String, Semaphore> detachVolumeMap;

    public DetachVolumeHandler() {
        super();
        this.detachVolumeRetries = Integer.parseInt(DEFAULT_DETACH_VOLUME_RETRIES);
        detachVolumeMap = new ConcurrentHashMap<String, Semaphore>();
    }

    @Property(key = "detach.volume.retries", defaultValue = DEFAULT_DETACH_VOLUME_RETRIES)
    public void setDetachVolumeRetries(int aDetachVolumeRetries) {
        this.detachVolumeRetries = aDetachVolumeRetries;
    }

    @Property(key = "detach.volume.libvirt.xml", defaultValue = DEFAULT_DETACH_VOLUME_XML)
    public void setDetachVolumeXml(String aDetachVolumeXml) {
        this.detachVolumeXml = aDetachVolumeXml;
    }

    public boolean acquireLock(String aVolumeId, long time, TimeUnit timeUnit) throws InterruptedException {
        Semaphore semaphore = new Semaphore(ONE);
        Semaphore lock = detachVolumeMap.putIfAbsent(aVolumeId, semaphore);
        if (lock == null)
            lock = semaphore;

        return lock.tryAcquire(time, timeUnit);
    }

    public void releaseLock(String aVolumeId) {
        Semaphore lock = detachVolumeMap.get(aVolumeId);
        if (lock == null)
            throw new IllegalArgumentException(String.format("Lock for %s does not exist", aVolumeId));

        lock.release();
    }

    public void detachVolume(final Volume volume, final ReceivedMessageContext receivedMessageContext) {
        LOG.debug(String.format("detachVolume(%s, %s)", volume, receivedMessageContext));
        detachVolumeInThread(volume, receivedMessageContext);
    }

    private void detachVolumeInThread(final Volume volume, final ReceivedMessageContext receivedMessageContext) {
        LOG.debug(String.format("detachVolumeInThread(%s, %s)", volume, receivedMessageContext));
        final AtomicBoolean volumeIsDetached = new AtomicBoolean(false);

        findInstanceForVolume(volume, new PiContinuation<Instance>() {
            @Override
            public void handleResult(Instance resultInstance) {
                if (InstanceState.TERMINATED.equals(resultInstance.getState())) {
                    volumeIsDetached.set(true);
                    cleanVolumeFromFileSystemAndReturnMessage(volume, receivedMessageContext, volumeIsDetached.get());
                } else {
                    getSerialExecutor().execute(new SerialExecutorRunnable(PiQueue.DETACH_VOLUME.getUrl(), volume.getUrl()) {
                        @Override
                        public void run() {
                            try {
                                boolean detached = detachVolumeViaLibvirt(volume);
                                LOG.debug("detached: " + detached);
                                if (VolumeState.FORCE_DETACHING.equals(volume.getStatus())) {
                                    LOG.info(String.format(FORCE_DETACHING_VOLUME_S_FROM_S, volume.getVolumeId(), volume.getInstanceId()));
                                    volumeIsDetached.set(true);
                                } else
                                    volumeIsDetached.set(detached);
                            } catch (LibvirtManagerException lve) {
                                if (VolumeState.FORCE_DETACHING.equals(volume.getStatus())) {
                                    LOG.info(String.format(FORCE_DETACHING_VOLUME_S_FROM_S, volume.getVolumeId(), volume.getInstanceId()));
                                    volumeIsDetached.set(true);
                                }
                            } catch (InterruptedException e) {
                                LOG.warn("Interrupted exception", e);
                                Thread.interrupted();
                            }
                            cleanVolumeFromFileSystemAndReturnMessage(volume, receivedMessageContext, volumeIsDetached.get());
                        }
                    });
                }
            }
        });
    }

    private void cleanVolumeFromFileSystemAndReturnMessage(final Volume volume, final ReceivedMessageContext receivedMessageContext, final boolean volumeIsDetached) {
        LOG.debug(String.format("cleanVolumeFromFileSystemAndReturnMessage(%s, %s, %s)", volume, receivedMessageContext, volumeIsDetached));
        getSerialExecutor().execute(new SerialExecutorRunnable(PiQueue.DETACH_VOLUME.getUrl(), volume.getUrl()) {
            @Override
            public void run() {
                if (volumeIsDetached) {
                    boolean lockAcquired = false;
                    try {
                        lockAcquired = acquireLock(volume.getVolumeId(), ONE, TimeUnit.MILLISECONDS);
                        if (lockAcquired) {
                            copyVolumeFileFromLocalToRemote(volume);
                            deleteVolumeFileFromLocal(volume);
                        } else {
                            LOG.debug(String.format("Not detaching volume %s currently since a backup is in progress", volume.getVolumeId()));
                            return;
                        }
                    } catch (InterruptedException e) {
                        LOG.error(e.getMessage(), e);
                        Thread.interrupted();
                    } finally {
                        if (lockAcquired)
                            releaseLock(volume.getVolumeId());
                    }
                }

                PId id = getPiIdBuilder().getPIdForEc2AvailabilityZone(volume);
                getDhtClientFactory().createReader().getAsync(id, new PiContinuation<Volume>() {
                    @Override
                    public void handleResult(final Volume result) {
                        if (volumeIsDetached) {
                            result.setStatus(VolumeState.AVAILABLE);
                            removeBlockDeviceMappingsFromInstance(result, receivedMessageContext);
                        } else {
                            if (null != receivedMessageContext) {
                                result.setStatus(VolumeState.IN_USE);
                                receivedMessageContext.sendResponse(EntityResponseCode.OK, result);
                            }
                        }
                    }
                });
            }
        });
    }

    private void removeBlockDeviceMappingsFromInstance(final Volume volume, final ReceivedMessageContext receivedMessageContext) {
        LOG.debug(String.format("removeBlockDeviceMappingsFromInstance(%s, %s)", volume, receivedMessageContext));
        String instanceId = volume.getInstanceId();
        PId id = getPiIdBuilder().getPIdForEc2AvailabilityZone(Instance.getUrl(instanceId));
        DhtWriter dhtWriter = getDhtClientFactory().createWriter();
        dhtWriter.update(id, new UpdateResolvingPiContinuation<Instance>() {
            @Override
            public Instance update(Instance existingEntity, Instance requestedEntity) {
                List<BlockDeviceMapping> toBeRemoved = new ArrayList<BlockDeviceMapping>();
                for (BlockDeviceMapping blockDeviceMapping : existingEntity.getBlockDeviceMappings()) {
                    if (volume.getVolumeId().equals(blockDeviceMapping.getVolumeId())) {
                        toBeRemoved.add(blockDeviceMapping);
                    }
                }
                existingEntity.getBlockDeviceMappings().removeAll(toBeRemoved);
                return existingEntity;
            }

            @Override
            public void handleResult(Instance result) {
                if (null != receivedMessageContext) {
                    receivedMessageContext.sendResponse(EntityResponseCode.OK, volume);
                }
            }
        });
    }

    private boolean detachVolumeViaLibvirt(Volume volume) throws InterruptedException {
        LOG.debug(String.format("detachVolumeViaLibvirt(%s)", volume));
        String absoluteLocalVolumeFilename = getAbsoluteLocalVolumeFilename(volume.getVolumeId());
        String libvirtXml = String.format(this.detachVolumeXml, absoluteLocalVolumeFilename, cleanDevice(volume.getDevice()));

        int retryCount = 0;

        LOG.debug(String.format("Trying to detach volume: %s from Instance: %s on path: %s", volume.getVolumeId(), volume.getInstanceId(), absoluteLocalVolumeFilename));

        while (this.getLibvirtManager().volumeExists(volume.getInstanceId(), absoluteLocalVolumeFilename) && retryCount < this.detachVolumeRetries) {
            try {
                this.getLibvirtManager().detachVolume(volume.getInstanceId(), libvirtXml);
            } catch (LibvirtManagerException e) {
                LOG.warn(String.format("Error detaching volume %s from instance %s", volume.getVolumeId(), volume.getInstanceId()), e);
            }
            Thread.sleep(SECOND);
            retryCount++;
        }

        return !this.getLibvirtManager().volumeExists(volume.getInstanceId(), absoluteLocalVolumeFilename);
    }

    // we try to be idempotent here in case the file is missing
    private void copyVolumeFileFromLocalToRemote(Volume volume) {
        LOG.debug(String.format("copyVolumeFileFromLocalToRemote(%s)", volume));
        String localFilename = getRelativeLocalVolumeFilename(volume);
        if (fileExists(localFilename))
            getCommandRunner().run(String.format("%s %s %s", getCopyCommand(), localFilename, getRelativeNfsVolumeFilename(volume)));
    }

    // we try to be idempotent here in case the file is missing
    private void deleteVolumeFileFromLocal(Volume volume) {
        LOG.debug(String.format("deleteVolumeFileFromLocal(%s)", volume));
        String localFilename = getRelativeLocalVolumeFilename(volume);
        if (fileExists(localFilename))
            getCommandRunner().run(String.format("%s %s", getDeleteCommand(), localFilename));
    }

    // protected for testing override
    protected boolean fileExists(String path) {
        return new File(path).exists();
    }

    private void findInstanceForVolume(final Volume sparseVolume, PiContinuation<Instance> continuation) {
        LOG.debug(String.format("findInstanceForVolume(%s, %s)", sparseVolume, continuation));
        PId instancePId = getPiIdBuilder().getPIdForEc2AvailabilityZone(Instance.getUrl(sparseVolume.getInstanceId()));
        getDhtClientFactory().createReader().getAsync(instancePId, continuation);
    }
}


text:
package sith

import (
	"encoding/json"
	"net/http"
	"strconv"
	"time"

	"github.com/antage/eventsource"
	"github.com/op/go-libspotify/spotify"
)

const (
	esIdleTimeout = 30 * time.Minute
	esTimeout     = 5 * time.Second
)

type EventsWriter struct {
	es eventsource.EventSource

	// TODO base on timestamp?
	sequenceId int
}

// TODO this should not be kept here?

func NewEventsWriter() EventsWriter {
	esSettings := eventsource.Settings{
		CloseOnTimeout: false,
		IdleTimeout:    esIdleTimeout,
		Timeout:        esTimeout,
	}
	es := eventsource.New(&esSettings, nil)
	return EventsWriter{es, 0}
}

func (ew *EventsWriter) Close() error {
	ew.es.Close()
	return nil
}

func (ew *EventsWriter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	ew.es.ServeHTTP(w, r)
}

func (ew *EventsWriter) SendEvent(event string, data interface{}) error {
	ew.sequenceId++
	bytes, err := json.Marshal(data)
	if err != nil {
		return err
	}
	ew.es.SendEventMessage(string(bytes), event, strconv.Itoa(ew.sequenceId))
	return nil
}

func (ew *EventsWriter) SendLink(event string, link *spotify.Link) error {
	return ew.SendEvent(event, struct {
		URI string `json:"uri"`
	}{link.String()})
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hyalopsora waterlotii Pat.

### Remarks
null


text:
package testdata

func Foo6(i int, b bool) (string, error) { return "", nil }


text:
var gulp = require('gulp');

gulp.task('public', function() {
  return gulp.src('./public/**/*')
    .pipe(gulp.dest('./dist'));
});


text:
Mavericks has a debug mode that enables some validation checks. These checks will safeguard against a number of common mistakes or other issues that could cause rare and hard to debug issues for real world users.

The checks include:

* Running all state reducers twice and ensuring that the resulting state is the same. This ensures that reducers are pure.
* All state properties are immutable vals not vars.
* State types are not one of: ArrayList, SparseArray, LongSparseArray, SparseArrayCompat, ArrayMap, and HashMap.
* State class visibility is public so it can be created and restored
* Each instance of your State is not mutated once it is set on the ViewModel

### Enabling debug mode

When you [integrate Mavericks into your app](/setup), there are overloads to pass in `Context` or to explicitly set `debugMode`. If you initialize Mavericks with `Context` (recommended) then debug mode will automatically be enabled if your application is debuggable (`context.applicationInfo.flags` contains `ApplicationInfo.FLAG_DEBUGGABLE`).

### Avoid slow operations in `withState`/`setState`
As all `withState`/`setState` blocks are processed sequentially, it's highly recommended to avoid slow calls inside these blocks (blocking IO/cpu consuming calls). You can use Android [StrictMode](https://developer.android.com/reference/android/os/StrictMode) to detect such calls. StrictMode.ThreadPolicy can be injected into `MavericksViewModelConfigFactory.storeContextOverride`:
```
val threadPolicy = StrictMode.ThreadPolicy.Builder()
    .detectNetwork()
    .penaltyDialog()
    .build()

Mavericks.viewModelConfigFactory = MavericksViewModelConfigFactory(
    this,
    storeContextOverride = if (isDebuggable()) threadPolicy.asContextElement() else EmptyCoroutineContext
)
```


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines contain the default error messages used by
    | the validator class. Some of these rules have multiple versions such
    | as the size rules. Feel free to tweak each of these messages here.
    |
    */

    'accepted'             => 'El campo :attribute debe ser aceptado.',
    'active_url'           => 'El campo :attribute no es una URL válida.',
    'after'                => 'El campo :attribute debe ser una fecha posterior a :date.',
    'alpha'                => 'El campo :attribute sólo debe contener letras.',
    'alpha_dash'           => 'El campo :attribute sólo debe contener letras, números y barras.',
    'alpha_num'            => 'El campo :attribute sólo debe contener letras y números.',
    'array'                => 'El campo :attribute debe ser una lista.',
    'before'               => 'El campo :attribute  debe ser una fecha anterior a :date.',
    'between'              => [
        'numeric' => 'El campo :attribute debe ser un número entre :min y :max.',
        'file'    => 'El campo :attribute debe ser entre :min y :max kilobytes.',
        'string'  => 'El campo :attribute debe ser entre :min y :max caracteres.',
        'array'   => 'El campo :attribute debe contener entre :min y :max elementos.',
    ],
    'boolean'              => 'El campo :attribute debe ser booleano.',
    'confirmed'            => 'El campo :attribute de confirmación no coincide.',
    'date'                 => 'El campo :attribute no es una fecha válida.',
    'date_format'          => 'La fecha :attribute debe coincidir con el formato :format.',
    'different'            => 'El campo :attribute y :other deben ser diferentes.',
    'digits'               => 'El número :attribute debe tener :digits dígitos.',
    'digits_between'       => 'El número :attribute debe tener entre :min y :max dígitos.',
    'dimensions'           => 'El :attribute contiene dimensiones de imagen invalidas.',
    'distinct'             => 'El campo :attribute contiene un valor duplicado.',
    'email'                => 'El campo :attribute debe contener un e-mail válido.',
    'exists'               => 'El campo :attribute seleccionado es inválido.',
    'file'                 => 'El :attribute debe ser un archivo.',
    'filled'               => 'El campo :attribute es obligatorio.',
    'image'                => 'El campo :attribute debe contener una imagen.',
    'in'                   => 'El :attribute seleccionado no es válido.',
    'in_array'             => 'El campo :attribute no existen en :other.',
    'integer'              => 'El campo :attribute debe ser un número entero.',
    'ip'                   => 'El campo :attribute debe contener una dirección IP válida.',
    'json'                 => 'El campo :attribute debe contener un JSON válido.',
    'max'                  => [
        'numeric' => 'El número :attribute no debe ser mayor que :max.',
        'file'    => 'El fichero :attribute no debe ser mayor que :max kilobytes.',
        'string'  => 'El texto :attribute debe tener menos de :max caracteres.',
        'array'   => 'La lista :attribute debe contener menos de :max elemnetos.',
    ],
    'mimes'                => 'El fichero :attribute debe tener el formato/s :values.',
    'min'                  => [
        'numeric' => 'El número :attribute debe ser mayor o igual a :min.',
        'file'    => 'El fichero :attribute debe ser mayor o igual a :min kilobytes.',
        'string'  => 'El texto :attribute debe tener, al menos, :min caracteres.',
        'array'   => 'La lista :attribute debe contener, al menos :min elemnetos.',
    ],
    'not_in'               => 'El :attribute seleccionado no es válido.',
    'numeric'              => 'El campo :attribute debe ser un número.',
    'present'              => 'El campo :attribute debe estar presente.',
    'regex'                => 'El formato de :attribute no es válido.',
    'required'             => 'El campo :attribute es obligatorio.',
    'required_if'          => 'El campo :attribute es obligatorio cuando :other tiene valor :value.',
    'required_unless'      => 'El campo :attribute es obligatorio, excepto cuando :other esta en :values.',
    'required_with'        => 'El campo :attribute es obligatorio cuando :values están presentes.',
    'required_with_all'    => 'El campo :attribute es obligatorio cuando :values están presentes.',
    'required_without'     => 'El campo :attribute es obligatorio cuando :values no están presentes.',
    'required_without_all' => 'El campo :attribute es obligatorio cuando ninguno de :values están presentes.',
    'same'                 => 'El campo :attribute y :other deben coincidir.',
    'size'                 => [
        'numeric' => 'El número :attribute debe tener :size caracteres.',
        'file'    => 'El fichero :attribute debe tener :size kilobytes.',
        'string'  => 'El texto :attribute debe tener :size caracteres.',
        'array'   => 'La lista :attribute debe contener :size elemnetos.',
    ],
    'string'               => 'El campo :attribute debe contener texto.',
    'timezone'             => 'El campo :attribute debe contener una zona horaria válida.',
    'unique'               => 'El campo :attribute ya está en uso.',
    'url'                  => 'El enlace :attribute debe tener un formato válido.',

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | Here you may specify custom validation messages for attributes using the
    | convention "attribute.rule" to name the lines. This makes it quick to
    | specify a specific custom language line for a given attribute rule.
    |
    */

    'custom' => [
        'attribute-name' => [
            'rule-name' => 'mensaje-personalizado',
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Attributes
    |--------------------------------------------------------------------------
    |
    | The following language lines are used to swap attribute place-holders
    | with something more reader friendly such as E-Mail Address instead
    | of "email". This simply helps us make messages a little cleaner.
    |
    */

    'attributes' => [

        'backend' => [
            'access' => [
                'permissions' => [
                    'associated_roles' => 'Roles asociados',
                    'dependencies' => 'Dependencias',
                    'display_name' => 'Nombre a mostrar',
                    'group' => 'Grupo',
                    'group_sort' => 'Orden del Grupo',

                    'groups' => [
                        'name' => 'Nombre del Grupo',
                    ],

                    'name' => 'Nombre',
                    'system' => 'Sistema?',
                ],

                'roles' => [
                    'associated_permissions' => 'Permisos asociados',
                    'name' => 'Nombre',
                    'sort' => 'Orden',
                ],

                'users' => [
                    'active' => 'Activo',
                    'associated_roles' => 'Roles asociados',
                    'confirmed' => 'Confirmado',
                    'email' => 'Dirección de Correo',
                    'name' => 'Nombre',
                    'other_permissions' => 'Otros Permisos',
                    'password' => 'Contraseña',
                    'password_confirmation' => 'Confirmación de la Contraseña',
                    'send_confirmation_email' => 'Enviar Correo de confirmación',
                ],
            ],
        ],

        'frontend' => [
            'email' => 'Dirección de Correo',
            'name' => 'Nombre',
            'password' => 'Contraseña',
            'password_confirmation' => 'Confirmación de la Contraseña',
            'old_password' => 'Antigua Contraseña',
            'new_password' => 'Nueva Contraseña',
            'new_password_confirmation' => 'Confirmación de la Nueva Contraseña',
        ],
    ],

];


text:
package test;

import static org.junit.Assert.*;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import com.github.kmkt.util.DefaultOptional;
import com.github.kmkt.util.DefaultOptionalBoolean;
import com.github.kmkt.util.DefaultOptionalDouble;
import com.github.kmkt.util.DefaultOptionalInt;
import com.github.kmkt.util.PrefixedProperties;

import org.junit.Test;

public class PrefixedPropertiesTest {

    @Test
    public void testPrefixedAccess() {
        Properties def = new Properties();
        def.put("a.b.c", "a.b.c");
        def.put("a.c.x", "a.x.x");
        def.put("b.a.c", "b.a.c");
        def.put("b.c.x", "b.x.x");
        PrefixedProperties p = new PrefixedProperties(def);
        System.out.println(p.getKeys("a"));
        System.out.println(p.getNextRankKeys("b"));
    }

    @Test
    public void testGetProperty(){
        PrefixedProperties pp = new PrefixedProperties();
        String testproperty =
                  "a= -121\n"
                + "b=1.2\n"
                + "c=true \n"
                + "d=1, 2, 3, 4\n";

        try (Reader sr = new StringReader(testproperty)) {
            pp.load(sr);

            DefaultOptionalInt a = pp.getPropertyAsInt("x");
            assertFalse(a.isPresent());

            a = pp.getPropertyAsInt("x", 1);
            assertTrue(a.isPresent());
            assertTrue(a.isDefault());
            assertEquals(1, a.getAsInt());

            a = pp.getPropertyAsInt("a", 1);
            assertTrue(a.isPresent());
            assertFalse(a.isDefault());
            assertEquals(-121, a.getAsInt());

            DefaultOptionalDouble b = pp.getPropertyAsDouble("x");
            assertFalse(b.isPresent());

            b = pp.getPropertyAsDouble("x", 2.2);
            assertTrue(b.isPresent());
            assertTrue(b.isDefault());
            assertEquals(2.2, b.getAsDouble(), 0.1);

            b = pp.getPropertyAsDouble("b", 2.2);
            assertTrue(b.isPresent());
            assertFalse(b.isDefault());
            assertEquals(1.2, b.getAsDouble(), 0.0001);

            DefaultOptionalBoolean c = pp.getPropertyAsBoolean("x");
            assertFalse(c.isPresent());

            c = pp.getPropertyAsBoolean("x", false);
            assertTrue(c.isPresent());
            assertTrue(c.isDefault());
            assertEquals(false, c.getAsBoolean());

            c = pp.getPropertyAsBoolean("c", false);
            assertTrue(c.isPresent());
            assertFalse(c.isDefault());
            assertEquals(true, c.getAsBoolean());

            DefaultOptional<List<Integer>> d = pp.getPropertyAsIntList("x", ",", true);
            assertFalse(d.isPresent());

            d = pp.getPropertyAsIntList("d", ",", true);
            assertTrue(d.isPresent());
            assertFalse(d.isDefault());
            List<Integer> except = new ArrayList<Integer>() {{ add(1); add (2); add(3); add(4); }};
            List<Integer> actual = d.get();
            assertEquals(except.size(), actual.size());
            for (int i = 0 ; i < except.size(); i++) {
                assertEquals(except.get(i), actual.get(i));
            }

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


text:
<?xml version="1.0" encoding="utf-8"?>
<reflection>
  <assemblies>
    <assembly name="mscorlib">
      <assemblydata version="4.0.0.0" culture="" key="00000000000000000400000000000000" hash="SHA1" />
      <attributes>
        <attribute>
          <type api="T:System.Runtime.CompilerServices.ExtensionAttribute" ref="true" />
        </attribute>
        <attribute>
          <type api="T:System.Runtime.InteropServices.GuidAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>BED7F4EA-1A96-11d2-8F08-00A0C9A6186D</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Runtime.InteropServices.ComVisibleAttribute" ref="true" />
          <argument>
            <type api="T:System.Boolean" ref="false" />
            <value>False</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.CLSCompliantAttribute" ref="true" />
          <argument>
            <type api="T:System.Boolean" ref="false" />
            <value>True</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Security.AllowPartiallyTrustedCallersAttribute" ref="true" />
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyTitleAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>mscorlib.dll</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyDescriptionAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>mscorlib.dll</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyDefaultAliasAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>mscorlib.dll</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyCompanyAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>Microsoft Corporation</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyProductAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>Microsoft® .NET Framework</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyCopyrightAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>© Microsoft Corporation.  All rights reserved.</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyFileVersionAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>4.6.1590.0</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyInformationalVersionAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>4.6.1590.0</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Resources.SatelliteContractVersionAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>4.0.0.0</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Resources.NeutralResourcesLanguageAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>en-US</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyDelaySignAttribute" ref="true" />
          <argument>
            <type api="T:System.Boolean" ref="false" />
            <value>True</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblyKeyFileAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>f:\dd\tools\devdiv\EcmaPublicKey.snk</value>
          </argument>
        </attribute>
        <attribute>
          <type api="T:System.Reflection.AssemblySignatureKeyAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>002400000c800000140100000602000000240000525341310008000001000100613399aff18ef1a2c2514a273a42d9042b72321f1757102df9ebada69923e2738406c21e5b801552ab8d200a65a235e001ac9adc25f2d811eb09496a4c6a59d4619589c69f5baf0c4179a47311d92555cd006acc8b5959f2bd6e10e360c34537a1d266da8085856583c85d81da7f3ec01ed9564c58d93d713cd0172c8e23a10f0239b80c96b07736f5d8b022542a4e74251a5f432824318b3539a5a087f8e53d2f135f9ca47f3bb2e10aff0af0849504fb7cea3ff192dc8de0edad64c68efde34c56d302ad55fd6e80f302d5efcdeae953658d3452561b5f36c542efdbdd9f888538d374cef106acf7d93a4445c3c73cd911f0571aaf3d54da12b11ddec375b3</value>
          </argument>
          <argument>
            <type api="T:System.String" ref="true" />
            <value>a5a866e1ee186f807668209f3b11236ace5e21f117803a3143abb126dd035d7d2f876b6938aaf2ee3414d5420d753621400db44a49c486ce134300a2106adb6bdb433590fef8ad5c43cba82290dc49530effd86523d9483c00f458af46890036b0e2c61d077d7fbac467a506eba29e467a87198b053c749aa2a4d2840c784e6d</value>
          </argument>
        </attribute>
      </attributes>
    </assembly>
  </assemblies>
  <apis>
    <api id="N:System.Diagnostics.Contracts.Internal">
      <topicdata group="api" />
      <apidata name="System.Diagnostics.Contracts.Internal" group="namespace" />
      <elements>
        <element api="T:System.Diagnostics.Contracts.Internal.ContractHelper" />
      </elements>
      <file name="3aee4117-fcf6-28d7-b538-cd3714c44beb" />
    </api>
    <api id="T:System.Diagnostics.Contracts.Internal.ContractHelper">
      <topicdata group="api" />
      <apidata name="ContractHelper" group="type" subgroup="class" />
      <typedata visibility="public" abstract="true" sealed="true" serializable="false" />
      <family>
        <ancestors>
          <type api="T:System.Object" ref="true" />
        </ancestors>
      </family>
      <elements>
        <element api="M:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.Exception)" />
        <element api="M:System.Diagnostics.Contracts.Internal.ContractHelper.TriggerFailure(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.String,System.Exception)" />
      </elements>
      <containers>
        <library assembly="mscorlib" module="mscorlib" kind="DynamicallyLinkedLibrary">
          <assemblydata version="4.6.1590.0" />
        </library>
        <namespace api="N:System.Diagnostics.Contracts.Internal" />
      </containers>
      <attributes>
        <attribute>
          <type api="T:System.ObsoleteAttribute" ref="true" />
          <argument>
            <type api="T:System.String" ref="true" />
            <value>Use the ContractHelper class in the System.Runtime.CompilerServices namespace instead.</value>
          </argument>
        </attribute>
      </attributes>
      <file name="137a74e3-9293-0c01-2394-b966f22f8fe5" />
    </api>
    <api id="Methods.T:System.Diagnostics.Contracts.Internal.ContractHelper">
      <topicdata name="ContractHelper" group="list" subgroup="Methods" typeTopicId="T:System.Diagnostics.Contracts.Internal.ContractHelper" />
      <apidata name="ContractHelper" group="type" subgroup="class" />
      <typedata visibility="public" abstract="true" sealed="true" serializable="false" />
      <elements>
        <element api="M:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.Exception)" />
        <element api="M:System.Diagnostics.Contracts.Internal.ContractHelper.TriggerFailure(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.String,System.Exception)" />
      </elements>
      <containers>
        <library assembly="mscorlib" module="mscorlib" kind="DynamicallyLinkedLibrary">
          <assemblydata version="4.6.1590.0" />
        </library>
        <namespace api="N:System.Diagnostics.Contracts.Internal" />
        <type api="T:System.Diagnostics.Contracts.Internal.ContractHelper" />
      </containers>
      <file name="3409fe82-91db-0fe4-b30e-b4aaafc1688c" />
    </api>
    <api id="M:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.Exception)">
      <topicdata group="api" />
      <apidata name="RaiseContractFailedEvent" group="member" subgroup="method" />
      <memberdata visibility="public" static="true" />
      <proceduredata virtual="false" />
      <parameters>
        <parameter name="failureKind">
          <type api="T:System.Diagnostics.Contracts.ContractFailureKind" ref="false" />
        </parameter>
        <parameter name="userMessage">
          <type api="T:System.String" ref="true" />
        </parameter>
        <parameter name="conditionText">
          <type api="T:System.String" ref="true" />
        </parameter>
        <parameter name="innerException">
          <type api="T:System.Exception" ref="true" />
        </parameter>
      </parameters>
      <returns>
        <type api="T:System.String" ref="true" />
      </returns>
      <containers>
        <library assembly="mscorlib" module="mscorlib" kind="DynamicallyLinkedLibrary">
          <assemblydata version="4.6.1590.0" />
        </library>
        <namespace api="N:System.Diagnostics.Contracts.Internal" />
        <type api="T:System.Diagnostics.Contracts.Internal.ContractHelper" ref="true" />
      </containers>
      <file name="743ed29a-1125-165d-b61e-a7e96e925859" />
    </api>
    <api id="M:System.Diagnostics.Contracts.Internal.ContractHelper.TriggerFailure(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.String,System.Exception)">
      <topicdata group="api" />
      <apidata name="TriggerFailure" group="member" subgroup="method" />
      <memberdata visibility="public" static="true" />
      <proceduredata virtual="false" />
      <parameters>
        <parameter name="kind">
          <type api="T:System.Diagnostics.Contracts.ContractFailureKind" ref="false" />
        </parameter>
        <parameter name="displayMessage">
          <type api="T:System.String" ref="true" />
        </parameter>
        <parameter name="userMessage">
          <type api="T:System.String" ref="true" />
        </parameter>
        <parameter name="conditionText">
          <type api="T:System.String" ref="true" />
        </parameter>
        <parameter name="innerException">
          <type api="T:System.Exception" ref="true" />
        </parameter>
      </parameters>
      <containers>
        <library assembly="mscorlib" module="mscorlib" kind="DynamicallyLinkedLibrary">
          <assemblydata version="4.6.1590.0" />
        </library>
        <namespace api="N:System.Diagnostics.Contracts.Internal" />
        <type api="T:System.Diagnostics.Contracts.Internal.ContractHelper" ref="true" />
      </containers>
      <file name="c7ffdeac-7ede-b8e1-d4c9-63adc152175b" />
    </api>
  </apis>
</reflection>


text:
namespace gloperate_text
{

class OPENLL_API GlyphSequenceConfig
{
public:
	explicit GlyphSequenceConfig(gloperate_text::FontFace * font);
	~GlyphSequenceConfig();

	bool wordWrap() const;
	void setWordWrap(bool enable);

	float lineWidth() const;
	void setLineWidth(float lineWidth);

	gloperate_text::Alignment alignment() const;
	void setAlignment(gloperate_text::Alignment alignment);

	gloperate_text::LineAnchor anchor() const;
	void setAnchor(const gloperate_text::LineAnchor anchor);

	float fontSize() const;
	void setFontSize(float fontSize);

	gloperate_text::FontFace * fontFace() const;
	void setFontFace(gloperate_text::FontFace * fontFace);

	const glm::vec4 & fontColor() const;
	void setFontColor(glm::vec4 fontColor);

	glm::vec4 margins() const;
	void setMargins(glm::vec4 margins);

	float ppiScale() const;
	void setPpiScale(float ppiScale);

protected:

	bool m_wordWrap;
	float m_lineWidth;

	gloperate_text::Alignment m_alignment;
	gloperate_text::LineAnchor m_anchor;

	glm::vec4 m_fontColor;
	gloperate_text::FontFace * m_fontFace;
	float m_fontSize;

	glm::vec4 m_margins;
	float m_ppiScale;
};

}// namespace gloperate_text


text:
<?xml version="1.0"?>
<openerp>
    <data noupdate="1">

        <record id="base.partner_demo" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_1" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_2" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_3" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_4" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_3" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_1" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_4" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_12" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_12" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_10" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_3" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_12" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_2" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_4" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_3" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_1" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_12" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_18" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_2" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_4" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_1" model="res.partner">
            <field name="notify_email">none</field>
        </record>
        <record id="base.res_partner_12" model="res.partner">
            <field name="notify_email">none</field>
        </record>

        <record id="msg_discus5" model="mail.message">
            <field name="subject">Plan to install backup servers</field>
            <field name="body"><![CDATA[
Hello,

We need to deploy new backup servers, with the following requirements:

daily incremental backups, with an history of 15 days,

45 servers should be backuped between 1am and 3am when our offices are closed,

two redundant servers,

total capacity of 200Gb.

                Do you have a simple solution with servers running on Redhat Linux?

Best regards,

            ]]></field>
            <field name="message_type">email</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="email_from">virginie@agrolait.fr</field>
            <field name="author_id" eval="False"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo'), ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(days=2)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus1" model="mail.message">
            <field name="subject">Feedback about our On Site Assistance</field>
            <field name="body"><![CDATA[
Hi Virginie,

I wrote to you about our On Site Assistance Service that we delivered to Agrolait last week. Do you have any feedback or remark about our service? I noticed you requested new IP phones. Will it be used for new employees, or did you have any issue with the ones we provided?
Best regards,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_root"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.res_partner_2')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(days=2)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus4_attach1" model="ir.attachment">
            <field name="datas">bWlncmF0aW9uIHRlc3Q=</field>
            <field name="datas_fname">catalog.doc</field>
            <field name="name">catalog.doc</field>
        </record>
        <record id="msg_discus4_attach2" model="ir.attachment">
            <field name="datas_fname">activity_graph_2012.jpg</field>
            <field name="name">activity_graph_2012</field>
            <field name="datas" type="base64" file="mail/static/img/msg_discus4_attach2-datas.jpg"/>
        </record>
        <record id="msg_discus4" model="mail.message">
            <field name="body"><![CDATA[
Hi Demo,

The next version of our products catalog is scheduled for next month. Our product team send me their updated document holding the prices and costs, and I updated our catalog.

You will find it in attachment, as well as a comparative benchmark of the different solutions currently existing on the market.
Have a nice reading!

            Sincerely,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_root"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo')])]"/>
            <field name="attachment_ids" eval="[(6, 0, [ref('msg_discus4_attach1'), ref('msg_discus4_attach2')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(days=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus2" model="mail.message">
            <field name="subject">Information meeting</field>
            <field name="body"><![CDATA[
Hello,

Epic Technologies is a small company specialized in software managing huge volume of data. Having an efficient and reliable backup system is very important for us, and critical for our customers. I eared you have some interesting solutions to manage our backups. Could we meet each other as soon as possible to discuss our need? Here is a first list of requirements:

about 25 backup servers, running on Redhat Linux

minimum 200Gb of storage per server

setup a VPN between all our servers in New York and Chicago

Thanks,

            ]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.res_partner_3"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(days=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus6_attach1" model="ir.attachment">
            <field name="datas">bWlncmF0aW9uIHRlc3Q=</field>
            <field name="datas_fname">RedHat_spec.doc</field>
            <field name="name">RedHat_spec.doc</field>
        </record>
        <record id="msg_discus6_attach2" model="ir.attachment">
            <field name="datas">bWlncmF0aW9uIHRlc3Q=</field>
            <field name="datas_fname">RedHat_spec_draft_v3.doc</field>
            <field name="name">RedHat_spec_draft_v3.doc</field>
        </record>
        <record id="msg_discus6" model="mail.message">
            <field name="subject">RedHat server updated spec</field>
            <field name="body"><![CDATA[
Hello Demo,

We have a lot of inquiries about our now solution based on RedHat servers. However I do not have the updated specification ready at hand.

Could you please send me the last version of the file asap?

Thanks,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_root"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(days=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>
        <record id="msg_discus6_1" model="mail.message">
            <field name="body"><![CDATA[
Sure, here it is. Have a nice day!
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="parent_id" ref="msg_discus6"/>
            <field name="author_id" ref="base.partner_demo"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="attachment_ids" eval="[(6, 0, [ref('msg_discus6_attach1')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=3)).strftime('%Y-%m-%d %H:%M')"/>
        </record>
        <record id="msg_discus6_2" model="mail.message">
            <field name="body"><![CDATA[
I just found a more recent draft of the spec. Jon did some cleaning in the specifications. Could you merge the two documents to have an updated one?

When it's done, put it on the internal document management system.

Thanks,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="parent_id" ref="msg_discus6"/>
            <field name="author_id" ref="base.partner_demo"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="attachment_ids" eval="[(6, 0, [ref('msg_discus6_attach2')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=3)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus3" model="mail.message">
            <field name="body"><![CDATA[
Hello,

I have a friend working at Epic Technologies. He told me they plan to upgrade their backup servers within the next 3 months.

I think that someone should contact them and check if there is an opportunity.
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_demo"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=3)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discuss4_1" model="mail.message">
            <field name="body"><![CDATA[
Thank you!
Could you send me the updated pricelists as negotiated at the beginning of this year?

Sincerely,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="parent_id" ref="msg_discus4"/>
            <field name="author_id" ref="base.partner_demo"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root'), ref('base.partner_demo')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=1, minutes=30)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus3_1" model="mail.message">
            <field name="body"><![CDATA[Contact Chris: +1 (650) 307-6736.]]></field>
            <field name="parent_id" ref="msg_discus3"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_demo"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus2_1" model="mail.message">
            <field name="subject">RE: Information meeting</field>
            <field name="body"><![CDATA[
Hello Epic!

I am glad you are interested in our products. Indeed, we are have several backup solutions that should meet your requirements. In order to prepare a detailed offer, we will have to discuss several technical points about your needs and the context of your data management.

I propose to have a meeting tomorrow at 2 PM. Does it seem suitable for you ?
Best regards,
]]></field>
            <field name="parent_id" ref="msg_discus2"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_root"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.res_partner_3')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>
        <record id="msg_discus2_2" model="mail.message">
            <field name="subject">RE: Information meeting</field>
            <field name="body"><![CDATA[
It is not possible for me to come tomorrow at 2 PM. Maybe at 4 PM?
]]></field>
            <field name="parent_id" ref="msg_discus2"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.res_partner_3"/>
            <field name="date" eval="(DateTime.today() - timedelta(minutes=35)).strftime('%Y-%m-%d %H:%M')"/>
        </record>
        <record id="msg_discus2_3" model="mail.message">
            <field name="subject">RE: Information meeting</field>
            <field name="body"><![CDATA[
4 PM is fine! See you tomorrow!
Best regards,
]]></field>
            <field name="parent_id" ref="msg_discus2"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.partner_root"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.res_partner_3')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(minutes=30)).strftime('%Y-%m-%d %H:%M')"/>
        </record>
        <record id="msg_discus2_4" model="mail.message">
            <field name="subject">RE: Information meeting</field>
            <field name="body"><![CDATA[
Ok! See you tomorrow.
]]></field>
            <field name="parent_id" ref="msg_discus2"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.res_partner_3"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(minutes=10)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus1_1" model="mail.message">
            <field name="subject">RE: Feedback about our On Site Assistance</field>
            <field name="body"><![CDATA[
Hello Administrator,

Glad to hear from you! Everything is perfect, thanks for asking. Concerning the order of 2 IP phones, I ordered them for new employees. We are satisfied with the products of YourCompany, and we plan to fit out each new employee with one of your phone this year.
Regards,
]]></field>
            <field name="parent_id" ref="msg_discus1"/>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.res_partner_2"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(minutes=5)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

        <record id="msg_discus0" model="mail.message">
            <field name="subject">FWD: Meeting with Demo </field>
            <field name="body"><![CDATA[
Hello Administrator,

A small email to inform you that we will have a meeting with Mr Demo next Tuesday. Everything is under control!
Regards,
]]></field>
            <field name="message_type">comment</field>
            <field name="subtype_id" ref="mt_comment"/>
            <field name="author_id" ref="base.res_partner_1"/>
            <field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
            <field name="date" eval="(DateTime.today() - timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M')"/>
        </record>

    </data>
</openerp>


text:
#ifndef PCL_KEYPOINT_IMPL_H_
#define PCL_KEYPOINT_IMPL_H_

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointInT, typename PointOutT> bool
pcl::Keypoint<PointInT, PointOutT>::initCompute ()
{
  if (!PCLBase<PointInT>::initCompute ())
    return (false);

  // Initialize the spatial locator
  if (!tree_)
  {
    if (input_->isOrganized ())
      tree_.reset (new pcl::search::OrganizedNeighbor<PointInT> ());
    else
      tree_.reset (new pcl::search::KdTree<PointInT> (false));
  }

  // If no search surface has been defined, use the input dataset as the search surface itself
  if (!surface_)
    surface_ = input_;

  // Send the surface dataset to the spatial locator
  tree_->setInputCloud (surface_);

  // Do a fast check to see if the search parameters are well defined
  if (search_radius_ != 0.0)
  {
    if (k_ != 0)
    {
      PCL_ERROR ("[pcl::%s::initCompute] Both radius (%f) and K (%d) defined! Set one of them to zero first and then re-run compute ().\n", getClassName ().c_str (), search_radius_, k_);
      return (false);
    }
    else                  // Use the radiusSearch () function
    {
      search_parameter_ = search_radius_;
      if (surface_ == input_)       // if the two surfaces are the same
      {
        // Declare the search locator definition
        int (KdTree::*radiusSearch)(int index, double radius, std::vector<int> &k_indices,
                                     std::vector<float> &k_distances, unsigned int max_nn) const = &KdTree::radiusSearch;
        search_method_ = boost::bind (radiusSearch, boost::ref (tree_), _1, _2, _3, _4, 0);
      }
      else
      {
        // Declare the search locator definition
        int (KdTree::*radiusSearchSurface)(const PointCloudIn &cloud, int index, double radius, std::vector<int> &k_indices,
                                            std::vector<float> &k_distances, unsigned int max_nn) const = &KdTree::radiusSearch;
        search_method_surface_ = boost::bind (radiusSearchSurface, boost::ref (tree_), _1, _2, _3, _4, _5, 0);
      }
    }
  }
  else
  {
    if (k_ != 0)         // Use the nearestKSearch () function
    {
      search_parameter_ = k_;
      if (surface_ == input_)       // if the two surfaces are the same
      {
        // Declare the search locator definition
        int (KdTree::*nearestKSearch)(int index, int k, std::vector<int> &k_indices, std::vector<float> &k_distances) const = &KdTree::nearestKSearch;
        search_method_ = boost::bind (nearestKSearch, boost::ref (tree_), _1, _2, _3, _4);
      }
      else
      {
        // Declare the search locator definition
        int (KdTree::*nearestKSearchSurface)(const PointCloudIn &cloud, int index, int k, std::vector<int> &k_indices, std::vector<float> &k_distances) const = &KdTree::nearestKSearch;
        search_method_surface_ = boost::bind (nearestKSearchSurface, boost::ref (tree_), _1, _2, _3, _4, _5);
      }
    }
    else
    {
      PCL_ERROR ("[pcl::%s::initCompute] Neither radius nor K defined! Set one of them to a positive number first and then re-run compute ().\n", getClassName ().c_str ());
      return (false);
    }
  }

  return (true);
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointInT, typename PointOutT> inline void
pcl::Keypoint<PointInT, PointOutT>::compute (PointCloudOut &output)
{
  if (!initCompute ())
  {
    PCL_ERROR ("[pcl::%s::compute] initCompute failed!\n", getClassName ().c_str ());
    return;
  }

  // Perform the actual computation
  detectKeypoints (output);

  deinitCompute ();

  // Reset the surface
  if (input_ == surface_)
    surface_.reset ();
}

#endif  //#ifndef PCL_KEYPOINT_IMPL_H_


text:
/*
 * Filter that only returns xforms.  Used by the change listener.
 */
function(doc, req)
{
	if (doc['xmlns'] == "http://code.javarosa.org/devicereport") {
		return false;
	}
    var doc_type = doc["doc_type"];

    switch (doc_type) {
        case "XFormInstance":
        case "XFormArchived":
        case "XFormDeprecated":
        case "XFormDuplicate":
        case "XFormInstance-Deleted":
        case "HQSubmission":
            return true;
        default:
            return false;
    }
}


text:
class StudentsController < ApplicationController
  before_action :set_student, only: [:show, :edit, :update, :destroy]

  respond_to :html

  def index
    @students = Student.all
    respond_with(@students)
  end

  # def show
  #   respond_with(@student)
  # end

  def new
    @student = Student.new
    respond_with(@student)
  end

  def edit
  end

  def create
    @student = Student.new(student_params)
    @student.save
    respond_with(@student, location: students_path)
  end

  def update
    @student.update(student_params)
    respond_with(@student, location: students_path)
  end

  def destroy
    @student.destroy
    respond_with(@student)
  end

  private
    def set_student
      @student = Student.find(params[:id])
    end

    def student_params
      params.require(:student).permit(:name, :register_number, :status)
    end
end


text:
GO
ALTER PROCEDURE [dbo].[SPUsersGet]
	@UserId int=11
AS
SELECT
	U.UserId
	,U.UserName
	,U.UserProfile
	,U.UserSignature
	,U.UserGroupId
	,U.UserBirthDate
	,U.UserWebsite
	,U.UserTimezone
	,U.UserPhoto
	,U.UserRegistrationDate
	,U.UserExternalProfileUrl
	,U.UserEmail
	,U.UserEmailPolicy
	,UG.UserGroupId
	,UG.UserGroupName
	,U.WarningStart
	,U.WarningRead
	,U.SuspendedStart
	,U.SuspendedEnd
	,U.BannedStart
	,U.ModeratorReasonFull
	,U.ModeratorReason
	,U.ModeratorUserId
FROM
	Users U
	INNER JOIN UsersGroups UG ON UG.UserGroupId = U.UserGroupId
WHERE
	U.UserId = @UserId;
GO