text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="reminder_pref_entries">
        <item>Disabled</item>
        <item>Daily</item>
        <item>Weekly</item>
        <item>Monthly</item>
    </string-array>

    <string-array name="reminder_pref_values">
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
    </string-array>

    <string-array name="daily_tips_values">
        <item>Be sure the soil is well-fertilized and healthy before planting your plants.</item>
        <item>If planting seeds, be sure not to smother the seeds by covering them with too much soil.</item>
        <item>You can ensure young plants will grow by adding water-solubile fertilizers to your watering can  or hose sprayer.</item>
        <item>Be sure that your plants are not competing with weeds for sunlight or other resources.</item>
        <item>Some plants, like tomatoes, require stakes and support for their stems as they grow bigger.</item>
        <item>Make sure to move your plants to larger containers if they grow too big.</item>
        <item>Ensure your plant is receiving the adequate amount of light for its particular species.</item>
        <item>Plants tend to need less water during nonactive growing seasons like winter.</item>
        <item>Houseplants can be harmed by dry heater air in the winter. Be sure the air around your plants is humid enough so they can thrive.</item>
        <item>Don\'t fertilize a plant that is dry. Water it first, then fertilize a few days later.</item>
        <item>It is generally not recommended to re-pot your plants during the winter.</item>
        <item>If growing houseplants, make sure the temperature of your home is within the acceptable range for your plants.</item>
        <item>Alternating periods of drought and flood can really stress a plant\'s root system. Most plants like having their roots consistently moist, but not wet. Consult your plant\'s watering requirements.</item>
        <item>When a houseplant gets attacked by an insect pest, the problem can quickly spread to other plants. Preventing insects from entering your home is key to indoor insect control.</item>
        <item>It is also a good idea to wash the leaves of your plants several times a year. Dust and grime on houseplants doesn\'t just look bad; it is also bad for the health of the plant.</item>
        <item>Never use a feather duster to clean plants, because dusters can easily transfer tiny insects or eggs from one plant to another.</item>
        <item>Wash smooth-leaved houseplants with a moist, soft cloth and some insecticidal soap.</item>
        <item>All plants need food, water and sunlight to survive, but different plants require different amounts of each. Consult individual plant requirements to determine what works best for your plant.</item>
        <item>Good drainage is essential to healthy houseplants. Start with a good, organic potting soil (not regular soil) that has been mixed specifically for indoor gardening.</item>
        <item>A 2–3 inch (5–7.5cm) layer of good mulch will help plants retain moisture, regulate soil temperature, and keep down weed pressure.</item>
        <item>To remove the salt deposits that form on clay pots, combine equal parts white vinegar, rubbing alcohol and water in a spray bottle. Apply the mixture to the pot and scrub with a plastic brush. Let the pot dry before you plant anything in it.</item>
        <item>Little clay pots make great cloches for protecting young plants from sudden, overnight frosts and freezes.</item>
        <item>Got aphids? You can control them with a strong blast of water from the hose or with insecticidal soap.</item>
        <item>Use leftover tea and coffee grounds to acidify the soil of acid-loving plants such as azaleas, rhododendrons, camellias, gardenias and even blueberries.</item>
        <item>Use chamomile tea to control damping-off fungus, which often attacks young seedlings quite suddenly.</item>
        <item>Companion planting is an excellent way to improve your garden. Some plants replenish nutrients lost by another one, and some combinations effectively keep pests away.</item>
        <item>Compost needs time to integrate and stabilize in the soil. Apply two to three weeks prior to planting.</item>
        <item>Like vining vegetables, but don't have the room? Train your melons, squash, and cucumbers onto a vertical trellis or fence.</item>
        <item>Keep dirt off lettuce and cabbage leaves when growing by spreading a 1-2 inch layer of mulch (untreated by pesticides or fertilizers) around each plant.</item>
        <item>Insects can't stand plants such as garlic, onions, chives and chrysanthemums. Grow these plants around the garden to help repel insects.</item>
        <item>Healthy soil means healthy plants that are better able to resist pests and disease, reducing the need for harmful pesticides.</item>
    </string-array>

    <string-array name="user_stats_x_axis_labels">
        <item>Add</item>
        <item>Delete</item>
        <item>Water</item>
        <item>Measure</item>
        <item>Picture</item>
    </string-array>

    <string-array name="day_x_axis_labels">
        <item>Today</item>
        <item>Sun.</item>
        <item>Mon.</item>
        <item>Tue.</item>
        <item>Wed.</item>
        <item>Thu.</item>
        <item>Fri.</item>
        <item>Sat.</item>
    </string-array>

    <array name="user_stats_chart_colors">
        <item>@color/material_green_accent_200</item>
        <item>@color/material_red_accent_200</item>
        <item>@color/material_cyan_200</item>
        <item>@color/material_purple_200</item>
        <item>@color/material_orange_200</item>
    </array>
</resources>


text:
package com.foc.business.country.city;

import com.foc.desc.FocDesc;
import com.foc.gui.FListPanel;
import com.foc.gui.FPanel;
import com.foc.gui.table.FTableView;
import com.foc.list.FocList;

@SuppressWarnings("serial")
public class CityGuiBrowsePanel extends FListPanel{

  public CityGuiBrowsePanel(FocList list, int viewID){
    setFrameTitle("City / Village");
    setMainPanelSising(FPanel.MAIN_PANEL_FILL_VERTICAL);
    FocDesc desc = CityDesc.getInstance();
    if(desc != null){
      if(list == null){
        list = CityDesc.getList(FocList.FORCE_RELOAD);
      }
      if(list != null){
        setFocList(list);

        FTableView tableView = getTableView();
        tableView.addColumn(desc, CityDesc.FLD_CITY_NAME, true);
        //tableView.setDetailPanelViewID(viewID);

        construct();
        requestFocusOnCurrentItem();
        //FValidationPanel savePanel = showValidationPanel(true);
        //savePanel.addSubject(list);
        //setMainPanelSising(FPanel.MAIN_PANEL_FILL_VERTICAL);
        setFill(FPanel.FILL_VERTICAL);

        showEditButton(false);
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
// ==========================================================================
//                 SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2013, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
//       its contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: David Weese <david.weese@fu-berlin.de>
// ==========================================================================

#ifndef TESTS_INDEX_TEST_INDEX_HELPERS_H
#define TESTS_INDEX_TEST_INDEX_HELPERS_H

#include <seqan/random.h>

//////////////////////////////////////////////////////////////////////////////

namespace SEQAN_NAMESPACE_MAIN
{

// Return shared random number generator for this test's helpers.  Note that the helper cannot be called in parallel.
inline seqan::Rng<> & getRng()
{
    const int SEED = 0;
    static seqan::Rng<> result(SEED);
    return result;
}

template < typename TBuffer >
void permute(TBuffer &buf)
{
	typename Size<TBuffer>::Type i, j, s = length(buf);
	for(i = 0; i < s; i++)
		buf[i] = s-i-1;
	for(i = 0; i < s; i++) {
		if (i > 0) {
			j = i - (rand() % i) - 1;
			assert(0 <= j && j < s);
		} else
			j = 0;
		unsigned tmp = buf[i];
		buf[i] = buf[j];
		buf[j] = tmp;
	}
}

template < typename TBuffer >
void blank(TBuffer &buf) {
	typename Size<TBuffer>::Type i, s = length(buf);
	typename Value<TBuffer>::Type c = typename Value<TBuffer>::Type();
	for(i = 0; i < s; i++)
		buf[i] = c;
}

template < typename TBuffer >
void randomize(TBuffer &buf)
{
	typename Size<TBuffer>::Type i, s = length(buf);

    seqan::Pdf<seqan::Uniform<int> > pdf(0, s - 1);

	for(i = 0; i < s; i++)
		buf[i] = pickRandomNumber(getRng(), pdf);
}

template < typename TBuffer >
void textRandomize(TBuffer &buf) {
    seqan::Pdf<seqan::Uniform<int> > pdf(0, 1);

	typename Size<TBuffer>::Type i, s = length(buf);
	for(i = 0; i < s; i++)
		buf[i] = '@' + pickRandomNumber(getRng(), pdf);
}

template < typename TValue >
struct IdentityMap : public ::std::unary_function< TValue, TValue > {
	inline TValue operator() (TValue const i) { return i; }
};

template < typename TValue >
struct SimpleCompare : public ::std::binary_function< TValue const, TValue const, int > {
	inline int operator() (TValue const a, TValue const b) const {
		if (a < b) return -1;
		if (a > b) return 1;
		return 0;
	}
};

template <typename TSequence>
void printArray(TSequence const &SA) {
	typedef typename Iterator<TSequence const, Standard>::Type TIter;
	TIter it = begin(SA);
	TIter itEnd = end(SA);
	for(; it != itEnd; ++it)
		::std::cout << *it << "  ";
	::std::cout << ::std::endl;
}

template <typename TSequence>
bool isPermutation(TSequence const &SA) {
	typedef typename Value<TSequence>::Type		TSize;
	typedef typename MakeSigned_<TSize>::Type	TSigned;
	TSize n = length(SA);
	bool *seen = new bool[n];
	TSize i;
	for (i = 0;  i < n;  i++) seen[i] = 0;
	for (i = 0;  i < n;  i++)
		if ((TSigned)SA[i] >= 0 && SA[i] < n) {
			if (seen[SA[i]])
				printf("isPermutation: not unique %d->%d\n", (int)i, (int)SA[i]);
			seen[SA[i]] = true;
		} else
			printf("isPermutation: SA index out of range (n=%d) SA[%d]=%d\n", (int)n, (int)i, (int)SA[i]);

	for (i = 0;  i < n;  i++)
		if (!seen[i]) {
			printf("isPermutation: not surjective %d empty\n", (int)i);
			delete[] seen;
			return false;
		}
	delete[] seen;
	return true;
}

template <typename TInput, typename TSpec>
bool isPermutation(Pipe<TInput, TSpec> &SA) {
	typedef typename Value< Pipe<TInput, TSpec> >::Type TSize;
	TSize n = length(SA);
	bool *seen = new bool[n];
	TSize i;
	for (i = 0;  i < n;  i++) seen[i] = 0;
	beginRead(SA);
	for (i = 0;  i < n;  i++, ++SA)
		if ((TSize)*SA < n) {
			if (seen[*SA])
				printf("isPermutation: not unique %d->%d\n", (int)i, (int)*SA);
			seen[*SA] = true;
		} else
			printf("isPermutation: SA index out of range (n=%d) SA[%d]=%d\n", (int)n, (int)i, (int)*SA);
	endRead(SA);

	for (i = 0;  i < n;  i++)
		if (!seen[i]) {
			printf("isPermutation: not surjective %d empty\n", (int)i);
			delete[] seen;
			return false;
		}
	delete[] seen;
	return true;
}

template <typename TInput, typename TSpec>
bool isPermutation(Pipe<TInput, TSpec> const &SA) {
	return isPermutation(const_cast<Pipe<TInput, TSpec> &>(SA));
}

template <typename TIt, typename ST>
bool sleq__(TIt s1, TIt s2, ST n1, ST n2) {
	ST n = _min(n1, n2);
	for(ST i = 0; i < n; i++, ++s1, ++s2) {
		if (ordLess(*s1,*s2)) return 1;
		if (ordLess(*s2,*s1)) {
			::std::cerr<<(ordLess(*s2,*s1));
			::std::cerr<<*s1;
			::std::cerr<<*s2;
			::std::cerr << "after " << i << " compares not " << (unsigned)*s1 << " leq " << (unsigned)*s2 << ::std::endl;
			return 0;
		}
	}
	return (n1 < n2);
}

// is SA a sorted suffix array for s?
template <typename TSequence, typename TText>
bool isSorted(TSequence const &SA, TText const &s) {
	typedef typename Value<TSequence>::Type TSize;
	TSize n = length(s);
	for(TSize i = 1; i < n; ++i) {
		if (!sleq__(begin(s) + SA[i-1], begin(s) + SA[i], n-SA[i-1], n-SA[i])) {
			printf("isSorted: sort error s_%d(SA[%d]) >= s_%d(SA[%d])\n",(int)SA[i-1],(int)(i-1),(int)SA[i],(int)i);
/*
		String<unsigned, External<> > safile;
		if (!open(safile,"error.sa")) printf("could not open ERROR.SA\n");
		safile = SA;
*/			    return false;
		}
	}
	return true;
}

template <typename TInput, typename TSpec, typename TText>
bool isSorted(Pipe<TInput, TSpec> &SA, TText const &s) {
	typedef typename Value< Pipe<TInput, TSpec> >::Type TSize;
	TSize n = length(s);
	beginRead(SA);
	TSize prev = *SA; ++SA;
	for(TSize i = 1; !eof(SA); ++SA, ++i) {
		if (!sleq__(begin(s) + prev, begin(s) + *SA, n-prev, n-*SA)) {
			printf("isSorted: sort error s_%d(SA[%d]) >= s_%d(SA[%d])\n",(int)prev,(int)(i-1),(int)*SA,(int)i);
			endRead(SA);

/*			String<unsigned, External<> > safile;
		if (!open(safile,"error.sa")) printf("could not open ERROR.SA\n");
		safile << SA;
*/
			return false;
		}
		prev = *SA;
	}
	endRead(SA);
	return true;
}

template <typename TInput, typename TSpec, typename TText>
bool isSorted(Pipe<TInput, TSpec> const &SA, TText const &s) {
	return isSorted(const_cast<Pipe<TInput, TSpec> &>(SA), s);
}

template <typename TIt, typename ST>
bool sleqLcp__(TIt s1, TIt s2, ST n1, ST n2, ST lcp) {
	ST n = _min(n1, n2);
	for(ST i = 0; i < n; i++, ++s1, ++s2) {
		if (ordLess(*s1,*s2)) return (i == lcp);
		if (ordLess(*s2,*s1)) {
			::std::cerr << "after " << i << " compares not " << (unsigned)*s1 << " leq " << (unsigned)*s2 << ::std::endl;
			return false;
		}
	}
	return (n1 < n2) && (n == lcp);
}

// is SA a sorted suffix array and LCP the correct LCP-Table for s?
/*    template <
	typename TSize1, typename TSpec1,
	typename TSize2, typename TSpec2,
	typename TText >
bool isSortedLCP(String<TSize1, TSpec1> &LCP, String<TSize2, TSpec2> &SA, TText const &s) {
	TSize2 n = length(s);
	for(TSize2 i = 1; i < n; ++i) {
		if (!sleq__(begin(s) + SA[i-1], begin(s) + SA[i], n-SA[i-1], n-SA[i], LCP[i-1])) {
			printf("isSorted: sort error s_%d(%d) >= s_%d(%d)\n",i-1,SA[i-1],i,SA[i]);
			return false;
		}
	}
	return true;
}
*/
template < typename TLCP, typename TSA, typename TText >
bool isSortedLCP(TLCP &LCP, TSA &SA, TText const &s) {
	typedef typename Value<TSA>::Type TSize;
	typedef typename Iterator<TSA, Rooted>::Type ISA;
	typedef typename Iterator<TLCP, Standard>::Type ILCP;

	TSize n  = length(s);
	ISA  sa  = begin(SA);
	ILCP lcp = begin(LCP);

	TSize prev = *sa; ++sa;
	for(TSize i = 1; sa != end(SA); ++sa, ++lcp, ++i) {
		if (!sleqLcp__(begin(s) + prev, begin(s) + *sa, n-prev, n-*sa, *lcp)) {
			printf("isLCP: sort error s_%d(%d) >= s_%d(%d)\n",(int)(i-1),(int)prev,(int)i,(int)*sa);
			return false;
		}
		prev = *sa;
	}
	return true;
}

template <typename TSufArray, typename TText>
bool isSuffixArray(TSufArray &SA, TText const &s) {
	if (length(SA) != length(s)) {
		::std::cerr<<"isSuffixArray: length is bad: SA="<<length(SA)<<", s="<<length(s)<<::std::endl;
		return false;
	}

	if (!isPermutation(SA)) {
		::std::cerr<<"isSuffixArray: SA is not a permutation!"<<::std::endl;
		return false;
	}

	if (!isSorted(SA, s)) {
		::std::cerr<<"isSuffixArray: SA is not sorted!"<<::std::endl;
/*			String<unsigned char, External<> > textfile;
		if (!open(textfile,"error.txt")) printf("could not open ERROR.TXT\n");
		textfile=s;
*/			return false;
	}

//        ::std::cerr<<"SATest OK! n="<<length(s)<<std::endl;
	return true;
}

template <typename TLCP, typename TSufArray, typename TText>
bool isLCPTable(TLCP &LCP, TSufArray &SA, TText const &s) {
	if (length(SA) != length(s)) {
		printf("isLCPTable: length is bad: SA=%d, s=%d\n", (int)length(SA), (int)length(s));
		return false;
	}

	if (length(LCP) != length(s)) {
		printf("isLCPTable: length is bad: LCP=%d, s=%d\n", (int)length(LCP), (int)length(s));
		return false;
	}

	if (!isPermutation(SA)) {
		::std::cerr<<"isLCPTable: SA is not a permutation!\n";
		return false;
	}

	if (!isSortedLCP(LCP, SA, s)) {
		::std::cerr<<"isLCPTable: SA is not sorted!\n";
		return false;
	}

//        ::std::cerr<<"LCPTest OK! n="<<length(s)<<std::endl;
	return true;
}

template <typename TA, typename TB>
bool isEqual(TA &_a, TB &_b) {
	typedef typename Iterator<TA, Standard>::Type IA;
	typedef typename Iterator<TB, Standard>::Type IB;

	IA a = begin(_a), e = end(_a);
	IB b = begin(_b);
	while (a!=e) {
		if (!(*a == *b)) {
			::std::cerr << "isEqual: difference at " << (e-a) << " a=" << *a << "  b=" << *b << ::std::endl;
			return false;
		}
		++a;
		++b;
	}

//        ::std::cerr<<"EQUALTest OK! n="<<length(_a)<<std::endl;
	return true;
}

//////////////////////////////////////////////////////////////////////////////

} //namespace SEQAN_NAMESPACE_MAIN

#endif //#ifndef SEQAN_HEADER_...


text:
package org.apache.cassandra.cql3;

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

import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.ColumnDefinition;
import org.apache.cassandra.cql3.Term.Raw;
import org.apache.cassandra.cql3.restrictions.Restriction;
import org.apache.cassandra.cql3.restrictions.SingleColumnRestriction;
import org.apache.cassandra.cql3.statements.Bound;
import org.apache.cassandra.db.marshal.CollectionType;
import org.apache.cassandra.db.marshal.ListType;
import org.apache.cassandra.db.marshal.MapType;
import org.apache.cassandra.exceptions.InvalidRequestException;

import static org.apache.cassandra.cql3.statements.RequestValidations.checkFalse;
import static org.apache.cassandra.cql3.statements.RequestValidations.checkTrue;
import static org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest;

/**
 * Relations encapsulate the relationship between an entity of some kind, and
 * a value (term). For example, {@code <key> > "start" or "colname1" = "somevalue"}.
 *
 */
public class SingleColumnRelation extends Relation
{
    private final ColumnDefinition.Raw entity;
    private final Term.Raw mapKey;
    private final Term.Raw value;
    private final List<Term.Raw> inValues;

    private SingleColumnRelation(ColumnDefinition.Raw entity, Term.Raw mapKey, Operator type, Term.Raw value, List<Term.Raw> inValues)
    {
        this.entity = entity;
        this.mapKey = mapKey;
        this.relationType = type;
        this.value = value;
        this.inValues = inValues;

        if (type == Operator.IS_NOT)
            assert value == Constants.NULL_LITERAL;
    }

    /**
     * Creates a new relation.
     *
     * @param entity the kind of relation this is; what the term is being compared to.
     * @param mapKey the key into the entity identifying the value the term is being compared to.
     * @param type the type that describes how this entity relates to the value.
     * @param value the value being compared.
     */
    public SingleColumnRelation(ColumnDefinition.Raw entity, Term.Raw mapKey, Operator type, Term.Raw value)
    {
        this(entity, mapKey, type, value, null);
    }

    /**
     * Creates a new relation.
     *
     * @param entity the kind of relation this is; what the term is being compared to.
     * @param type the type that describes how this entity relates to the value.
     * @param value the value being compared.
     */
    public SingleColumnRelation(ColumnDefinition.Raw entity, Operator type, Term.Raw value)
    {
        this(entity, null, type, value);
    }

    public Term.Raw getValue()
    {
        return value;
    }

    public List<? extends Term.Raw> getInValues()
    {
        return inValues;
    }

    public static SingleColumnRelation createInRelation(ColumnDefinition.Raw entity, List<Term.Raw> inValues)
    {
        return new SingleColumnRelation(entity, null, Operator.IN, null, inValues);
    }

    public ColumnDefinition.Raw getEntity()
    {
        return entity;
    }

    public Term.Raw getMapKey()
    {
        return mapKey;
    }

    @Override
    protected Term toTerm(List<? extends ColumnSpecification> receivers,
                          Raw raw,
                          String keyspace,
                          VariableSpecifications boundNames)
                          throws InvalidRequestException
    {
        assert receivers.size() == 1;

        Term term = raw.prepare(keyspace, receivers.get(0));
        term.collectMarkerSpecification(boundNames);
        return term;
    }

    public SingleColumnRelation withNonStrictOperator()
    {
        switch (relationType)
        {
            case GT: return new SingleColumnRelation(entity, Operator.GTE, value);
            case LT: return new SingleColumnRelation(entity, Operator.LTE, value);
            default: return this;
        }
    }

    public Relation renameIdentifier(ColumnDefinition.Raw from, ColumnDefinition.Raw to)
    {
        return entity.equals(from)
               ? new SingleColumnRelation(to, mapKey, operator(), value, inValues)
               : this;
    }

    @Override
    public String toString()
    {
        String entityAsString = entity.toString();
        if (mapKey != null)
            entityAsString = String.format("%s[%s]", entityAsString, mapKey);

        if (isIN())
            return String.format("%s IN %s", entityAsString, inValues);

        return String.format("%s %s %s", entityAsString, relationType, value);
    }

    @Override
    protected Restriction newEQRestriction(CFMetaData cfm,
                                           VariableSpecifications boundNames) throws InvalidRequestException
    {
        ColumnDefinition columnDef = entity.prepare(cfm);
        if (mapKey == null)
        {
            Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
            return new SingleColumnRestriction.EQRestriction(columnDef, term);
        }
        List<? extends ColumnSpecification> receivers = toReceivers(columnDef);
        Term entryKey = toTerm(Collections.singletonList(receivers.get(0)), mapKey, cfm.ksName, boundNames);
        Term entryValue = toTerm(Collections.singletonList(receivers.get(1)), value, cfm.ksName, boundNames);
        return new SingleColumnRestriction.ContainsRestriction(columnDef, entryKey, entryValue);
    }

    @Override
    protected Restriction newINRestriction(CFMetaData cfm,
                                           VariableSpecifications boundNames) throws InvalidRequestException
    {
        ColumnDefinition columnDef = entity.prepare(cfm);
        List<? extends ColumnSpecification> receivers = toReceivers(columnDef);
        List<Term> terms = toTerms(receivers, inValues, cfm.ksName, boundNames);
        if (terms == null)
        {
            Term term = toTerm(receivers, value, cfm.ksName, boundNames);
            return new SingleColumnRestriction.InRestrictionWithMarker(columnDef, (Lists.Marker) term);
        }

        // An IN restrictions with only one element is the same than an EQ restriction
        if (terms.size() == 1)
            return new SingleColumnRestriction.EQRestriction(columnDef, terms.get(0));

        return new SingleColumnRestriction.InRestrictionWithValues(columnDef, terms);
    }

    @Override
    protected Restriction newSliceRestriction(CFMetaData cfm,
                                              VariableSpecifications boundNames,
                                              Bound bound,
                                              boolean inclusive) throws InvalidRequestException
    {
        ColumnDefinition columnDef = entity.prepare(cfm);

        if (columnDef.type.referencesDuration())
        {
            checkFalse(columnDef.type.isCollection(), "Slice restrictions are not supported on collections containing durations");
            checkFalse(columnDef.type.isTuple(), "Slice restrictions are not supported on tuples containing durations");
            checkFalse(columnDef.type.isUDT(), "Slice restrictions are not supported on UDTs containing durations");
            throw invalidRequest("Slice restrictions are not supported on duration columns");
        }

        Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
        return new SingleColumnRestriction.SliceRestriction(columnDef, bound, inclusive, term);
    }

    @Override
    protected Restriction newContainsRestriction(CFMetaData cfm,
                                                 VariableSpecifications boundNames,
                                                 boolean isKey) throws InvalidRequestException
    {
        ColumnDefinition columnDef = entity.prepare(cfm);
        Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
        return new SingleColumnRestriction.ContainsRestriction(columnDef, term, isKey);
    }

    @Override
    protected Restriction newIsNotRestriction(CFMetaData cfm,
                                              VariableSpecifications boundNames) throws InvalidRequestException
    {
        ColumnDefinition columnDef = entity.prepare(cfm);
        // currently enforced by the grammar
        assert value == Constants.NULL_LITERAL : "Expected null literal for IS NOT relation: " + this.toString();
        return new SingleColumnRestriction.IsNotNullRestriction(columnDef);
    }

    @Override
    protected Restriction newLikeRestriction(CFMetaData cfm, VariableSpecifications boundNames, Operator operator) throws InvalidRequestException
    {
        if (mapKey != null)
            throw invalidRequest("%s can't be used with collections.", operator());

        ColumnDefinition columnDef = entity.prepare(cfm);
        Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);

        return new SingleColumnRestriction.LikeRestriction(columnDef, operator, term);
    }

    /**
     * Returns the receivers for this relation.
     * @param columnDef the column definition
     * @return the receivers for the specified relation.
     * @throws InvalidRequestException if the relation is invalid
     */
    private List<? extends ColumnSpecification> toReceivers(ColumnDefinition columnDef) throws InvalidRequestException
    {
        ColumnSpecification receiver = columnDef;

        if (isIN())
        {
            // We only allow IN on the row key and the clustering key so far, never on non-PK columns, and this even if
            // there's an index
            // Note: for backward compatibility reason, we conside a IN of 1 value the same as a EQ, so we let that
            // slide.
            checkFalse(!columnDef.isPrimaryKeyColumn() && !canHaveOnlyOneValue(),
                       "IN predicates on non-primary-key columns (%s) is not yet supported", columnDef.name);
        }

        checkFalse(isContainsKey() && !(receiver.type instanceof MapType), "Cannot use CONTAINS KEY on non-map column %s", receiver.name);
        checkFalse(isContains() && !(receiver.type.isCollection()), "Cannot use CONTAINS on non-collection column %s", receiver.name);

        if (mapKey != null)
        {
            checkFalse(receiver.type instanceof ListType, "Indexes on list entries (%s[index] = value) are not currently supported.", receiver.name);
            checkTrue(receiver.type instanceof MapType, "Column %s cannot be used as a map", receiver.name);
            checkTrue(receiver.type.isMultiCell(), "Map-entry equality predicates on frozen map column %s are not supported", receiver.name);
            checkTrue(isEQ(), "Only EQ relations are supported on map entries");
        }

        // Non-frozen UDTs don't support any operator
        checkFalse(receiver.type.isUDT() && receiver.type.isMultiCell(),
                   "Non-frozen UDT column '%s' (%s) cannot be restricted by any relation",
                   receiver.name,
                   receiver.type.asCQL3Type());

        if (receiver.type.isCollection())
        {
            // We don't support relations against entire collections (unless they're frozen), like "numbers = {1, 2, 3}"
            checkFalse(receiver.type.isMultiCell() && !isLegalRelationForNonFrozenCollection(),
                       "Collection column '%s' (%s) cannot be restricted by a '%s' relation",
                       receiver.name,
                       receiver.type.asCQL3Type(),
                       operator());

            if (isContainsKey() || isContains())
            {
                receiver = makeCollectionReceiver(receiver, isContainsKey());
            }
            else if (receiver.type.isMultiCell() && mapKey != null && isEQ())
            {
                List<ColumnSpecification> receivers = new ArrayList<>(2);
                receivers.add(makeCollectionReceiver(receiver, true));
                receivers.add(makeCollectionReceiver(receiver, false));
                return receivers;
            }
        }

        return Collections.singletonList(receiver);
    }

    private static ColumnSpecification makeCollectionReceiver(ColumnSpecification receiver, boolean forKey)
    {
        return ((CollectionType<?>) receiver.type).makeCollectionReceiver(receiver, forKey);
    }

    private boolean isLegalRelationForNonFrozenCollection()
    {
        return isContainsKey() || isContains() || isMapEntryEquality();
    }

    private boolean isMapEntryEquality()
    {
        return mapKey != null && isEQ();
    }

    private boolean canHaveOnlyOneValue()
    {
        return isEQ() || isLIKE() || (isIN() && inValues != null && inValues.size() == 1);
    }

    @Override
    public Relation toSuperColumnAdapter()
    {
        return new SuperColumnSingleColumnRelation(entity, mapKey, relationType, value);
    }

    /**
     * Required for SuperColumn compatibility, in order to map the SuperColumn key restrictions from the regular
     * column to the collection key one.
     */
    private class SuperColumnSingleColumnRelation extends SingleColumnRelation
    {
        SuperColumnSingleColumnRelation(ColumnDefinition.Raw entity, Raw mapKey, Operator type, Raw value)
        {
            super(entity, mapKey, type, value, inValues);
        }

        @Override
        public Restriction newSliceRestriction(CFMetaData cfm,
                                               VariableSpecifications boundNames,
                                               Bound bound,
                                               boolean inclusive) throws InvalidRequestException
        {
            ColumnDefinition columnDef = entity.prepare(cfm);
            if (cfm.isSuperColumnKeyColumn(columnDef))
            {
                Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
                return new SingleColumnRestriction.SuperColumnKeySliceRestriction(cfm.superColumnKeyColumn(), bound, inclusive, term);
            }
            else
            {
                return super.newSliceRestriction(cfm, boundNames, bound, inclusive);
            }
        }

        @Override
        protected Restriction newEQRestriction(CFMetaData cfm,
                                               VariableSpecifications boundNames) throws InvalidRequestException
        {
            ColumnDefinition columnDef = entity.prepare(cfm);
            if (cfm.isSuperColumnKeyColumn(columnDef))
            {
                Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
                return new SingleColumnRestriction.SuperColumnKeyEQRestriction(cfm.superColumnKeyColumn(), term);
            }
            else
            {
                return super.newEQRestriction(cfm, boundNames);
            }
        }

        @Override
        protected Restriction newINRestriction(CFMetaData cfm,
                                               VariableSpecifications boundNames) throws InvalidRequestException
        {
            ColumnDefinition columnDef = entity.prepare(cfm);
            if (cfm.isSuperColumnKeyColumn(columnDef))
            {
                List<? extends ColumnSpecification> receivers = Collections.singletonList(cfm.superColumnKeyColumn());
                List<Term> terms = toTerms(receivers, inValues, cfm.ksName, boundNames);
                if (terms == null)
                {
                    Term term = toTerm(receivers, value, cfm.ksName, boundNames);
                    return new SingleColumnRestriction.SuperColumnKeyINRestrictionWithMarkers(cfm.superColumnKeyColumn(), (Lists.Marker) term);
                }
                return new SingleColumnRestriction.SuperColumnKeyINRestrictionWithValues(cfm.superColumnKeyColumn(), terms);
            }
            else
            {
                return super.newINRestriction(cfm, boundNames);
            }
        }
    }
}


text:
layout: post
title: Building a Basic Database From .csv Files Using SQLite3
modified:
categories:
excerpt:
tags: []
image:
  feature:
date: 2015-10-02T13:40:55-07:00
---

### Motivation

We finally finished collecting data from our high-dimensional behavioural analysis of
40 *C. elegans* wild-isolates from across the globe and this week I was ready to dig into
the data - I am super excited to observe the diversity of behavioural profiles of 40
genetically distinct strains for whom we have whole genome sequences!

This is a much bigger dataset than I usually work with, and for this analysis I am not
only interested in one particular behavioural aspect, I want to look at **everything**.
Thus I found my usual strategy of importing all of my data directly into R did not work
with this 20 GB dataset...

Do you need all your data in R at once? In my case, the answer is no, but I do want it all
connected together somewhere so I can grab various pieces of for each part of my analysis.
Thus I was motivated to create a database that I can query from R.

### Software and installation

I decided to use SQLite from the command line because it is simple to install and use and
I had been exposed to it previously at a [Software Carpentry](http://software-carpentry.org/)
workshop. Here are the installation instructions for SQLite for each operating system,
courtesy of Software Carpentry:

SQLite

Windows

        The Software Carpentry Windows Installer
        installs SQLite for Windows.
        If you used the installer to configure nano, you don't need to run it again.

Mac OS X

        SQLite comes pre-installed on Mac OS X.

Linux

        SQLite comes pre-installed on Linux.

### Creating a database in SQLite

To create a database in SQLite using the command line, open a Bash instance and navigate
to the directory where you would like to have your database, then type:

~~~
sqlite3 mydatabase
~~~

You should then see the command line change to the following:

~~~
SQLite version 3.8.5 2014-05-29 12:36:14
Enter ".help" for usage hints.
sqlite>
~~~

This indicates that Sqlite is now running and you have created an empty database named
mydatabase (hopefully you name yours something more useful than this example).

### Putting a `.csv` file in your SQLite database

To add your `.csv` file as a table in the database you just created, your `.csv` must meet
the requirement of being a tabular flat file. There are likely ways to input `.csv` files
that don't meet this requirement, but that is beyond the scope of this simple example.

You also need to know what delimiter is used in your `.csv` file. SQLite assumes it is a
comma (`,`) but this is not always the case, and thus you can change that if necessary.

Before you add your `.csv` file to the database, it is best to create an empty table for
your `.csv` file to go into. This is done using the CREATE TABLE function as demonstrated
below:

~~~
sqlite> CREATE TABLE behaviour(
   ...> strain CHAR(8) NOT NULL,
   ...> plate CHAR(15) NOT NULL,
   ...> speed REAL
   ...> );
~~~

Using CREATE TABLE you should specify the name of each column in your `.csv` file, as well
as the type expected and whether or not NULL values are allowed for that column. The code
above creates an empty table called behaviour, with columns strain, plate and speed. To
see the tables that exist in the database we created, we can type:

~~~
sqlite> .table
behaviour
~~~

To enter our data from our `.csv` file into this empty table, we first must change the
mode to csv:

~~~
sqlite> .mode csv
~~~

And then specify the delimiter (my file had `\t` spacing instead of `,`'s):

~~~
sqlite> .separator '\t'
~~~

*Finally* we can add our data to the database using the import command and passing it the
name of the file to import and the name of the table.

~~~
sqlite> .import behaviourdata.csv behaviour
~~~

And now the data is in a queryable SQL database. My next post will be how to access slices
of such a database from R.


text:
package com.redhat.ceylon.tools.copy;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import com.redhat.ceylon.cmr.api.ArtifactContext;
import com.redhat.ceylon.cmr.api.ModuleQuery;
import com.redhat.ceylon.cmr.ceylon.CeylonUtils.CeylonRepoManagerBuilder;
import com.redhat.ceylon.cmr.ceylon.ModuleCopycat;
import com.redhat.ceylon.common.BooleanUtil;
import com.redhat.ceylon.common.Messages;
import com.redhat.ceylon.common.ModuleSpec;
import com.redhat.ceylon.common.ModuleUtil;
import com.redhat.ceylon.common.OSUtil;
import com.redhat.ceylon.common.tool.Argument;
import com.redhat.ceylon.common.tool.Description;
import com.redhat.ceylon.common.tool.Option;
import com.redhat.ceylon.common.tool.OptionArgument;
import com.redhat.ceylon.common.tool.RemainingSections;
import com.redhat.ceylon.common.tool.Summary;
import com.redhat.ceylon.common.tools.CeylonTool;
import com.redhat.ceylon.common.tools.OutputRepoUsingTool;
import com.redhat.ceylon.model.cmr.ArtifactResult;

@Summary("Copies modules from one module repository to another")
@Description("Copies a module or a set of modules from one repository " +
		"to another. If set for recursive copying it will also copy " +
		"all the module's dependencies and their dependencies until the " +
		"entire module tree has been copied.")
@RemainingSections(OutputRepoUsingTool.DOCSECTION_REPOSITORIES)
public class CeylonCopyTool extends OutputRepoUsingTool {

    private List<ModuleSpec> modules;
    private boolean withDependencies;

    private Boolean jvm;
    private Boolean js;
    private Boolean docs;
    private Boolean src;
    private Boolean scripts;
    private Boolean all;

    public CeylonCopyTool() {
        super(CeylonCopyMessages.RESOURCE_BUNDLE);
    }

    @Argument(argumentName="module", multiplicity="+")
    public void setModules(List<String> modules) {
        setModuleSpecs(ModuleSpec.parseEachList(modules));
    }

    public void setModuleSpecs(List<ModuleSpec> modules) {
        this.modules = modules;
    }

    @Option(longName="with-dependencies", shortName='r')
    @Description("Recursively copy all dependencies")
    public void setWithDependencies(boolean withDependencies) {
        this.withDependencies = withDependencies;
    }

    @Option
    @Description("Include artifacts compiled for the JVM (`.car` and `.jar`) (default: `true`)")
    public void setJvm(boolean jvm) {
        this.jvm = jvm;
    }

    @Option
    @Description("Include artifacts compiled for JavaScript (`.js` and `-model.js`) (default: `true`)")
    public void setJs(boolean js) {
        this.js = js;
    }

    @Option
    @Description("Include documentation (default: `false`)")
    public void setDocs(boolean docs) {
        this.docs = docs;
    }

    @Option
    @Description("Include sources (default: `false`)")
    public void setSrc(boolean src) {
        this.src = src;
    }

    @Option
    @Description("Include scripts (default: `false`)")
    public void setScripts(boolean scripts) {
        this.scripts = scripts;
    }

    @Option
    @Description("Include everything (equivalent to `--jvm`, `--js`, `--docs`, `--src`, `--scripts`) (default: `false`)")
    public void setAll(boolean all) {
        this.all = all;
    }

    @Option(shortName='d')
    @OptionArgument(argumentName = "flags")
    @Description("Produce verbose output. " +
            "If no `flags` are given then be verbose about everything, " +
            "otherwise just be verbose about the flags which are present. " +
            "Allowed flags include: `all`, `loader`, `files`.")
    public void setVerbose(String verbose) {
        this.verbose = verbose;
    }

    @Override
    protected boolean needsSystemRepo() {
        return false;
    }

    @Override
    protected boolean doNotReadFromOutputRepo(){
        return true;
    }

    @Override
    public void initialize(CeylonTool mainTool) {
    }

    @Override
    public void run() throws Exception {
        Set<String> artifacts = new LinkedHashSet<String>();
        boolean defaults = js == null
                && jvm == null
                && src == null
                && scripts == null
                && docs == null
                && all == null;
        if (BooleanUtil.isTrue(all)) {
            artifacts.addAll(Arrays.asList(ArtifactContext.allSuffixes()));
        }
        if (BooleanUtil.isTrue(js) || defaults) {
            artifacts.add(ArtifactContext.JS);
            artifacts.add(ArtifactContext.JS_MODEL);
            artifacts.add(ArtifactContext.RESOURCES);
        } else if (BooleanUtil.isFalse(js)) {
            artifacts.remove(ArtifactContext.JS);
            artifacts.remove(ArtifactContext.JS_MODEL);
            artifacts.remove(ArtifactContext.RESOURCES);
        }
        if (BooleanUtil.isTrue(jvm) || defaults) {
            // put the CAR first since its presence will shortcut the other three
            artifacts.add(ArtifactContext.CAR);
            artifacts.add(ArtifactContext.JAR);
            artifacts.add(ArtifactContext.MODULE_PROPERTIES);
            artifacts.add(ArtifactContext.MODULE_XML);
        } else if (BooleanUtil.isFalse(jvm)) {
            artifacts.remove(ArtifactContext.CAR);
            artifacts.remove(ArtifactContext.JAR);
            artifacts.remove(ArtifactContext.MODULE_PROPERTIES);
            artifacts.remove(ArtifactContext.MODULE_XML);
        }
        if (BooleanUtil.isTrue(src)) {
            artifacts.add(ArtifactContext.SRC);
        } else if (BooleanUtil.isFalse(src)) {
            artifacts.remove(ArtifactContext.SRC);
        }
        if (BooleanUtil.isTrue(scripts)) {
            artifacts.add(ArtifactContext.SCRIPTS_ZIPPED);
        } else if (BooleanUtil.isFalse(scripts)) {
            artifacts.remove(ArtifactContext.SCRIPTS_ZIPPED);
        }
        if (BooleanUtil.isTrue(docs)) {
            artifacts.add(ArtifactContext.DOCS);
        } else if (BooleanUtil.isFalse(docs)) {
            artifacts.remove(ArtifactContext.DOCS);
        }

        // Create the list of ArtifactContexts to copy
        List<ArtifactContext> acs = new ArrayList<ArtifactContext>();
        String[] artifactsArray = new String[artifacts.size()];
        artifacts.toArray(artifactsArray);
        for (ModuleSpec module : modules) {
            if (module != ModuleSpec.DEFAULT_MODULE && !module.isVersioned()) {
                String version = checkModuleVersionsOrShowSuggestions(getRepositoryManager(), module.getName(), null,
                		ModuleQuery.Type.ALL, null, null, null, null);
                module = new ModuleSpec(module.getName(), version);
            }
            ArtifactContext ac = new ArtifactContext(null, module.getName(), module.getVersion(), artifactsArray);
            ac.setIgnoreDependencies(!withDependencies);
            ac.setForceOperation(true);
            acs.add(ac);
        }

        // Now do the actual copying
        final boolean logArtifacts = verbose != null && (verbose.contains("all") || verbose.contains("files"));
        ModuleCopycat copier = new ModuleCopycat(getRepositoryManager(), getOutputRepositoryManager(), log, new ModuleCopycat.CopycatFeedback() {
            @Override
            public boolean beforeCopyModule(ArtifactContext ac, int count, int max) throws IOException {
                String module = ModuleUtil.makeModuleName(ac.getName(), ac.getVersion());
                msg("copying.module", module, count+1, max).flush();
                return true;
            }
            @Override
            public void afterCopyModule(ArtifactContext ac, int count, int max, boolean copied) throws IOException {
                if (!logArtifacts) {
                    String msg;
                    if (copied) {
                        msg = OSUtil.color(Messages.msg(bundle, "copying.ok"), OSUtil.Color.green);
                    } else {
                        msg = OSUtil.color(Messages.msg(bundle, "copying.skipped"), OSUtil.Color.yellow);
                    }
                    append(") ").append(msg).newline().flush();
                }
            }
            @Override
            public boolean beforeCopyArtifact(ArtifactContext ac, ArtifactResult ar, int count, int max) throws IOException {
                if (logArtifacts) {
                    if (count == 0) {
                        append(" -- ");
                        append(ar.repositoryDisplayString());
                        newline().flush();
                    }
                    append("    ").msg("copying.artifact", ar.artifact().getName(), count+1, max).flush();
                } else {
                    if (count > 0) {
                        append(", ");
                    } else {
                        append(" (");
                    }
                    String name = ArtifactContext.getSuffixFromFilename(ar.artifact().getName());
                    if (name.startsWith(".") || name.startsWith("-")) {
                        name = name.substring(1);
                    } else if ("module-doc".equals(name)) {
                        name = "doc";
                    }
                    append(name);
                }
                return true;
            }
            @Override
            public void afterCopyArtifact(ArtifactContext ac, ArtifactResult ar, int count, int max, boolean copied) throws IOException {
                if (logArtifacts) {
                    append(" ").msg((copied) ? "copying.ok" : "copying.skipped").newline().flush();
                }
            }
            @Override
            public void notFound(ArtifactContext ac) throws IOException {
                String err = getModuleNotFoundErrorMessage(getRepositoryManager(), ac.getName(), ac.getVersion());
                errorAppend(err);
                errorNewline();
            }
        });
        copier.copyModules(acs);
    }

    @Override
    protected CeylonRepoManagerBuilder createRepositoryManagerBuilder(boolean forInput) {
        return createRepositoryManagerBuilderNoOut(forInput);
    }

}


text:
int if_up(char *name);
int if_down(char *name);
int if_mtu(char *name, int mtu);
int if_promisc(char *name);
int if_enable_ibss(char *name);
int if_join_ibss(char *name, char *essid, int frequency);


text:
.. EN-Revision: none
.. _introduction.overview:

*******************
Descripción general
*******************

Zend Framework es un framework de código abierto para desarrollar aplicaciones web y servicios web con PHP5. Zend
Framework es una implementación que usa código 100% orientado a objetos. La estructura de los componentes de Zend
Framework es algo único; cada componente está construido con una baja dependencia de otros componentes. Esta
arquitectura débilmente acoplada permite a los desarrolladores utilizar los componentes por separado. A menudo se
refiere a este tipo de diseño como "use-at-will" (uso a voluntad).

Aunque se pueden utilizar de forma individual, los componentes de la biblioteca estándar de Zend Framework
conforman un potente y extensible framework de aplicaciones web al combinarse. Zend Framework ofrece un gran
rendimiento y una robusta implementación *MVC*, una abstración de base de datos fácil de usar, y un componente
de formularios que implementa la prestación de formularios *HTML*, validación y filtrado para que los
desarrolladores puedan consolidar todas las operaciones usando de una manera sencilla la interfaz orientada a
objetos. Otros componentes, como ``Zend_Auth`` y ``Zend\Permissions\Acl``, proveen autenticación de usuarios y autorización
diferentes a las tiendas de certificados comunes. También existen componentes que implementan bibliotecas de
cliente para acceder de forma sencilla a los web services más populares. Cualesquiera que sean las necesidades de
su solicitud, usted tiene todas las posibilidades de encontrar un componente de Zend Framework que se pueda
utilizar para reducir drásticamente el tiempo de desarrollo, con una base completamente sólida.

El principal patrocinador del proyecto Zend Framework es `Zend Technologies`_, pero muchas empresas han contribuido
con componentes o características importantes para el marco. Empresas como Google, Microsoft y StrikeIron se han
asociado con Zend para proporcionar interfaces de servicios web y otras tecnologías que desean poner a
disposición de los desarrolladores de Zend Framework.

Zend Framework no podría haber proporcionado y apoyado todas estas características sin la ayuda de la vibrante
comunidad de Zend Framework. Los miembros de la comunidad, incluidos los contribuyentes, están disponibles en las
, `listas de correo`_, `canales de IRC`_, y en otros foros. Cualquier duda que tenga acerca de Zend Framework, la
comunidad está siempre disponible para responder.

.. _`Zend Technologies`: http://www.zend.com
.. _`listas de correo`: http://framework.zend.com/archives
.. _`canales de IRC`: http://www.zftalk.com


text:
class CreateSamplesProtocols < ActiveRecord::Migration
  def self.up
    create_table :sample_protocols do |t|
      t.integer :sample_id
      t.integer :protocol_id
      t.integer :protocol_version
    end
  end

  def self.down
    drop_table :sample_protocols
  end
end


text:
@interface DrawViewModel : NSObject

+ (id)viewModelWithColor:(UIColor *)color Path:(UIBezierPath *)path Width:(CGFloat)width;

@property (strong, nonatomic) UIColor *color;

@property (strong, nonatomic) UIBezierPath *path;

@property (assign, nonatomic) CGFloat width;

@end


text:
var javascriptPE;
(function (javascriptPE) {
    (function (implementation) {

        var problem0002 = (function() {

            function problem0002(listHelperLibrary) {
                this.listHelpers = listHelperLibrary;
            }

            problem0002.prototype.isEven = function(number) {
                return number % 2 === 0;
            };

            problem0002.prototype.generateFibonnaciSequenceLessThan = function(maximumExclusive) {
                var lastNumber = 1;
                var currentNumber = 1;
                var arrayToReturn = [];

                while (currentNumber < maximumExclusive) {
                    arrayToReturn.push(currentNumber);

                    var nextNumber = currentNumber + lastNumber;
                    lastNumber = currentNumber;
                    currentNumber = nextNumber;
                };

                return arrayToReturn;
            };

            problem0002.prototype.sumOfEvenFibonaccisLessThan = function(maximumExclusive) {
                var fibSequence = this.generateFibonnaciSequenceLessThan(maximumExclusive);
                var filteredSeqence = fibSequence.filter(this.isEven);
                return this.listHelpers.sum(filteredSeqence);
            };

            return problem0002;
        })();
        implementation.problem0002 = problem0002;

    })(javascriptPE.implementation || (javascriptPE.implementation = {}));
})(javascriptPE || (javascriptPE = {}));


text:
layout: doc
title: Field Papers
permalink: /it/mobile-mapping/field-papers/
lang: it
category: mobile-mapping
---

Usare i Field Papers
=============================

> Revisionato l'08/02/2016

In questo capitolo vedremo come registrare le coordinate dei luoghi senza usare un GPS. Useremo uno strumento chiamato [Field Papers](http://fieldpapers.org/), che ti permette di stampare la mappa di un'area, disegnarci sopra e aggiungere note, e ricaricare la mappa cartacea annotata su JOSM, dove potrai aggiungere i luoghi annotati su OpenStreetMap. Puoi guardare  [questa guida](http://www.youtube.com/watch?v=A_HGkBXZ69g&feature=youtu.be) della durata di 8 minuti su come creare un atlante e caricare una schermata.

Descrizione dei Field Papers
--------------------------

Prima di entrare nei dettagli del funzionamento dei Field Papers diamo un'occhiata a come funziona l'intero processo:

1. Cerca l'area che vuoi mappare sul sito Fields Papers. Stampa una mappa dell'area. Puoi scegliere di stampare la mappa dell'area con lo sfondo di OpenStreetMap, puoi anche scegliere di stampare una foto aerea, se disponibile nella tua zona.
![FieldPapers homepage][]

2. Usa la stampa della mappa durante il rilevamento dell'area. Aggiungi luoghi e caratteristiche disegnandoli direttamente sulla mappa. Traccia linee per le strade, poligoni per gli edifici e così via. Scrivi note su ciascun luogo o scrivi numeri sulla mappa scrivendo poi i relativi dettagli su un block notes a parte, dove puoi scrivere informazioni più dettagliate su ciascun oggetto.
![Example fieldpaper print][]

3. Scansisci il foglio con i rilevamenti sul tuo computer. Se non hai uno scanner puoi scattare una foto al foglio, se la tua fotocamera riesce a scattare foto ad alta risoluzione. Carica poi l'immagine sul sito Field Papers.
Field Papers.

4. In JOSM carica il Field Paper. Usa gli oggetti che hai disegnato come riferimento per aggiungerli digitalmente in OpenStreetMap.
![Fieldpaper scan as a JOSM background][]

Come funziona Field Papers?
-----------------------------

Se segui il processo descritto sopra, potrai rilevare le coordinate geografiche di luoghi col solo tramite di carta e penna. Ma com'è possibile?
![QR code][]

Quando stampi un Field Paper, il foglio riporta un codice a barre (QRcode) quadrato nel fondo della pagina. Questo codice a barre permette a Field Papers di determinare l'esatta posizione della mappa che userai per i rilevamenti. Successivamente, quando carichi il foglio su JOSM, tutti gli oggetti che avrai disegnato saranno visualizzati nella loro reale posizione. E' come usare un GPS rilevando coordinate precise, tranne per il fatto che usi solo un foglio di carta.

Adesso impariamo come creare e usare i Field Papers.

Creare e stampare
----------------

Apri il tuo browser web. Nella barra dell'indirizzo nella parte superiore della finestra, inserisci il seguente testo e pigia Enter (o Invio): [fieldpapers.org](http://fieldpapers.org)
Il sito web dovrebbe assomigliare a questo:

![FieldPapers homepage][]

Fai click su **Crea un atlante** per selezionare un'area da stampare.

![Create a new atlas][]

Verrai indirizzato a questa pagina:

![Atlas location][]

Esegui uno zoom dell'area che vuoi stampare su carta. Puoi muovere la mappa nello stesso modo in cui muovi la mappa sul sito di OpenStreetMap, usando il bottone sinistro del mouse per trascinare la mappa e puoi ruotare la rotellina del mouse per zoomare ad una maggiore o minore scala. In alternativa, per lo zoom puoi cliccare col tasto sinistro del mouse sui bottoni (+) e (-) posti nell'angolo superiore sinistro.

![Zoom in and out][]

Indica un nome per intitolare il foglio. Puoi anche inserire del testo che apparirà su ciascuna pagina stampata.

![Provide a name][]

La prossima opzione ti permette di scegliere il formato della stampa. Se tu spunti (selezioni) la casella accanto la scritta "Print Notes", la tua mappa sarà stampata sulla metà superiore del foglio con le note disposte nella metà inferiore. Altrimenti la mappa sarà stampata a pagina piena.

![Layout][]

La casella sottostante ti permette di mantenere il tuo atlante privato. Se si sceglie di mantenere un atlante privato, questo sarà accessibile solo se si ci sarà loggati, o tramite il link diretto che ti verrà mostrato al termine del processo di generazione dell'atlante.

![Private][]

Accanto alla mappa ci sono altre opzioni addizionali. Le prime due ti permettono di scegliere il formato della carta e l'orientamento del foglio che desideri usare per stampare il Field Paper: puoi scegliere tra ritratto (verticale) o paesaggio (orizzontale).

![Choose map orientation][]

L'opzione successiva ti permette di selezionare il tipo di dati che vuoi usare per il tuo Field Paper. Qui puoi scegliere tra diverse opzioni, che modificheranno lo stile con cui la mappa verrà stampata. Per ora selezioniamo **Black & White**.

![Choose map tile - black & white][]

L'utlima opzione ti permette eventualmente di sovrapporre una griglia con le coordinate in sistema UTM (in Italia ci sono i fusi UTM32, 33 e 34)..

![UTM][]

Verifica che la finestra del browser mostri l'area che vuoi mappare. Puoi usare i controlli nella finestra della mappa per ridimensionare le pagine del tuo Field Paper e aggiungere o diminuire pagine. Accertati che le pagine coprano un'area relativamente piccola, altrimenti risultano poco utili per la mappatura dei dettagli. Se commetti errori non ti preoccupare, puoi creare tanti Field Papers quanti ne hai di bisogno.
Ora creiamo la stampa! Se hai inquadrato l'area di tuo interesse e hai selezionate le opzioni che rendono l'atlante comprensibile, sei pronto. Clicca sul bottone etichettato "Make Atlas".

![makeatlas][]

Vedrai che il tuo atlante sarà in fase di preparazione. Quando sarà finito lo vedrai su questa pagina. Normalmente ci impiega alcuni minuti per essere pronto per la stampa, dipende da quante pagine hai chiesto di creare.

![Preparing your atlas][]

Quando la tua stampa è pronta, clicca su "Scarica il PDF". Il Field Paper dovrebbe essere così scaricato.

![Download the pdf][]

Quando il download è terminato, apri il file PDF. Connetti il tuo computer a una stampante e stampa la pagina (o le pagine). Se tutto va bene dovresti avere ora la tua mappa stampata su carta.

Mappare con i Field Papers
-----------------------

- Porta il tuo Field Paper fuori con te, e usalo come guida per camminare e identificare nuovi luoghi e oggetti che non sono ancora sulla mappa.
- Traccia linee per le strade, poligoni per edifici, e così via. Scrivi note su ciascun oggetto direttamente sulla mappa, o scrivi dei numeri sulla mappa che fanno riferimento a note che prenderai a parte su un block notes, dove puoi scrivere informazioni più dettagliate su ogni oggetto.
- Quando hai fatto abbastanza aggiunte su carta e ti ritieni soddisfatto, puoi inserirle digitalmente su OpenStreetMap.

Fare una scansione e caricarla
---------------

I Field Papers sono molto utili per mappare con niente di più che carta e penna, ma non sono magici al 100%. Dobbiamo sempre aggiungere i nostri fogli in JOSM, aggiungere digitalmente le informazioni e salvare le modifiche in OpenStreetMap. Il primo passo è scansire il Field Paper nel tuo computer. Puoi fare questo collegando uno scanner al tuo computer, scansire il foglio (o i fogli), e salvarlo/i come immagine/i. Se non hai uno scanner, puoi scattare una foto al foglio cercando di ottenere un'immagine di buona qualità. Assicurati che il foglio sia piatto e che la fotocamera sia perpendicolare al foglio. Accertati di includere nell'immagine il codice a barre (QRcode), perchè Field Papers non funziona se non riesce a leggerlo. Ecco un esempio di immagine scansita/fotografata.

![FP screenshot][]

Ora che hai scansito e salvato sul computer il tuo Field Paper, apri il browser web e torna alla pagina fieldpapers.org, come avevi già fatto in precedenza.
- Fai click sul tab "Carica".

![Upload][]

Clicca su "Sfoglia" e naviga nei file sino a trovare la tua scansione/fotografia del tuo Field Paper.

![uploadfp][]

Il file potrebbe impiegare qualche minuto per caricarsi, a seconda della velocità della tua connessione internet. Quando il caricamento (upload) è terminato, vedrai qualcosa simile a questo:

![Upload 2][]

Se non lavorerai subito con JOSM è una buona idea salvare nei preferiti l'indirizzo di quella pagina web.

Aggiungere il plugin Field Papers
---------------------------

Per poter aprire il Field Paper in JOSM, dobbiamo aver installato l'estensione (il plugin) di Josm chiamato "Field Papers".

> Le estensioni ( i Plugins) aggiungono ulteriori funzioni a JOSM. Il plugin Field Papers ti permette di caricare il foglio digitalizzato visualizzandolo come sfondo, nello stesso modo in cui vediamo le immagini aeree o satellitari. Sul [sito di JOSM](https://josm.openstreetmap.de/wiki/It%3APlugins) sono disponibili ulteriori informazioni sui plugin.

<!-- link to josm plugins section here -->

- Apri JOSM e vai su Modifica -> Preferenze.
Clicca sulla scheda (tab) Estensioni (Plugins).
- Cerca l'estensione (plugin) Field Papers e seleziona la casellina al suo fianco. Clicca OK.

![FieldPapers JOSM plugin][]

- Riavvia JOSM.

Aprirlo in JOSM
------------

Ora puoi caricare il tuo foglio Field Paper in JOSM e usarlo per aggiungere informazioni che hai rilevato in OpenstreetMap. A meno che tu non abbia la pagina web aperta sulla tua mappa o se non hai salvato nei preferiti l'indirizzo web dell'immagine caricata, ritorna sul sito Field Papers digitando [fieldpapers.org](http://fieldpapers.org/) nel tuo browser web, come hai già fatto in precedenza.
- Clicca su "Guarda" e poi su "Snapshots".
- Trova il tuo file tra quelli della lista e cliccaci sopra. Dovresti vedere qualcosa di simile a questo:

![Scanned paper][]

Per caricare l'immagine in JOSM dobbiamo copiare l'ID del Field Papers che hai scansito. nella barra degli URL, in alto nella finestra del tuo browser internet, seleziona il testo e premi CTRL+C sulla tua tastiera per copiarlo. Il testo dovrebbe essere simile a questo:

[http://fieldpapers.org/snapshot.php?id=zqw8m33x#16/14.6582/121.1098](http://fieldpapers.org/snapshot.php?id=zqw8m33x#16/14.6582/121.1098)

![Fieldpaper ID][]

Sul menù superiore di JOSM, clicca "Field Papers". Poi clicca "Mappa Scannerizzata..."

![Scanned map][]

Sulla tua tastiera premi CTRL+V per incollare il testo che hai copiato dal sito Field Papers.

![Snapshot][]

Clicca ok. Se tutto è andato bene, dovresti vedere il tuo Field Paper caricato in JOSM. Nel prossimo capitolo vedremo come aggiungere in OpenStreetMap i luoghi e gli oggetti che hai rilevato.

![Fieldpaper scan as a JOSM background][]

Puoi anche usare le tue scansioni Field Papers in altri editor OSM online, come iD o Potlatch2 cliccando sui link  "Edit in iD" o "Edit in Potlatch" nella pagina delle scansioni Field Papers.

![Edit in iD or P2][]

![Snapshot layer in iD][]

Ripetere!
-------

Dopo che hai apportato le modifiche a OSM, esse saranno salvate sulla mappa. Quando la prossima volta vorrai migliorare la mappa, potrai stampare un nuovo Field Papers il quale includerà le tue modifiche. Ripetendo il processo la mappa diventerà sempre più dettagliata.

Conclusioni
-------

Congratulazioni! In questo capitolo hai imparato il processo dei Field Papers e sai come utilizzarli. Hai imparato a stamparli, inserigli i tuoi rilevamenti, scansire un Field Paper, e sai come utilizzarli per migliorare OpenStreetMap.

[FieldPapers homepage]: /images/mobile-mapping/field-papers_homepage.png
[Example fieldpaper print]: /images/mobile-mapping/field-papers_fieldp.png
[Fieldpaper scan as a JOSM background]: /images/mobile-mapping/fieldpaperjosm.png
[QR code]: /images/mobile-mapping/field-papers_paper_qrc.png
[Create a new atlas]: /images/mobile-mapping/field-papers_makeatlas.png
[Atlas location]: /images/mobile-mapping/field-papers_makeyourselfanatlas.png
[Zoom in and out]: /images/mobile-mapping/field-papers_zoominout.png
[Choose map orientation]: /images/mobile-mapping/field-papers_choosetile.png
[Choose map tile - black & white]: /images/mobile-mapping/field-papers_blackandwhite.png
[UTM]: /images/mobile-mapping/field-papers_UTM.png
[zoom]: /images/mobile-mapping/field-papers_zoom.png
[makeatlas]: /images/mobile-mapping/field-papers_labelnext.png
[Provide a name]: /images/mobile-mapping/field-papers_name.png
[Layout]: /images/mobile-mapping/field-papers_layout.png
[Private]: /images/mobile-mapping/field-papers_private.png
[Preparing your atlas]: /images/mobile-mapping/field-papers_preparingyouratlas.png
[Download the pdf]: /images/mobile-mapping/field-papers_downloadpdf.png
[FP screenshot]: /images/mobile-mapping/field-papers_scrnsht.png
[Upload]: /images/mobile-mapping/field-papers_upload.png
[uploadfp]: /images/mobile-mapping/field-papers_uploadfp.png
[Upload 2]: /images/mobile-mapping/field-papers_asd.png
[FieldPapers JOSM plugin]: /images/mobile-mapping/field-papers_plugin.png
[Scanned paper]: /images/mobile-mapping/field-papers_watchsnapshot.png
[Fieldpaper ID]: /images/mobile-mapping/field-papers_fieldpaperid.png
[Scanned map]: /images/mobile-mapping/field-papers_scannedmap.png
[Snapshot]: /images/mobile-mapping/field-papers_fsnapshot.png
[Edit in iD or P2]: /images/mobile-mapping/field-papers_editinidorpot.png
[Snapshot layer in iD]: /images/mobile-mapping/field-papers_id.png


text:
package org.monospark.spongematchers.util;

public final class GenericsHelper {

    private GenericsHelper() {}

    @SuppressWarnings("unchecked")
    public static <T, U> T genericWrapper(U object) {
        return (T) object;
    }
}


text:
package com.github.dozermapper.core.vo.metadata;

public class ClassB {

    private String autoField;
    private String customFieldB;
    private ClassD classD;

    /**
     * stringField1 getter
     *
     * @return the stringField1
     */
    public String getAutoField() {
        return autoField;
    }

    /**
     * stringField1 setter
     *
     * @param stringField1 the stringField1 to set
     */
    public void setAutoField(String stringField1) {
        this.autoField = stringField1;
    }

    /**
     * stringFieldB getter
     *
     * @return the stringFieldB
     */
    public String getCustomFieldB() {
        return customFieldB;
    }

    /**
     * stringFieldB setter
     *
     * @param stringFieldB the stringFieldB to set
     */
    public void setCustomFieldB(String stringFieldB) {
        this.customFieldB = stringFieldB;
    }

    /**
     * classD setter
     *
     * @param classD the classD to set
     */
    public void setClassD(ClassD classD) {
        this.classD = classD;
    }

    /**
     * classD getter
     *
     * @return the classD
     */
    public ClassD getClassD() {
        return classD;
    }

}


text:
8th May 2021 | All nominations to race secretary and in by Monday prior to race meeting

      {% include navbar.html %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  ~ComponentBase
  Steinberg::Vst::ComponentBase

  ~ConstStringTable
  Steinberg::ConstStringTable

  ~CPluginFactory
  Steinberg::CPluginFactory

  ~CPluginView
  Steinberg::CPluginView

  ~EditControllerEx1
  Steinberg::Vst::EditControllerEx1

  ~EditorView
  Steinberg::Vst::EditorView

  ~FileStream
  Steinberg::Vst::FileStream

  ~FReleaser
  Steinberg::FReleaser

  ~FUID
  Steinberg::FUID

  ~FVariant
  Steinberg::FVariant

  ~IPtr
  Steinberg::IPtr

  ~Parameter
  Steinberg::Vst::Parameter

  ~ParameterContainer
  Steinberg::Vst::ParameterContainer

  ~PresetFile
  Steinberg::Vst::PresetFile

  ~ReadOnlyBStream
  Steinberg::Vst::ReadOnlyBStream

  ~SingleComponentEffect
  Steinberg::Vst::SingleComponentEffect

  ~StringListParameter
  Steinberg::Vst::StringListParameter

  ~VstAutomationTest
  Steinberg::Vst::VstAutomationTest

  ~VSTGUIEditor
  Steinberg::Vst::VSTGUIEditor

  ~VstProcessTailTest
  Steinberg::Vst::VstProcessTailTest

  ~VstTestBase
  Steinberg::Vst::VstTestBase

  ~VstTestEnh
  Steinberg::Vst::VstTestEnh

  ~XmlRepresentationHelper
  Steinberg::Vst::XmlRepresentationHelper

Searching...

No Matches


text:
/* Author: Ioan Sucan */

#ifndef MOVEIT_VISUALIZATION_SCENE_DISPLAY_RVIZ_PLUGIN_PLANNING_SCENE_RENDER_
#define MOVEIT_VISUALIZATION_SCENE_DISPLAY_RVIZ_PLUGIN_PLANNING_SCENE_RENDER_

#include <moveit/macros/class_forward.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/rviz_plugin_render_tools/render_shapes.h>
#include <rviz/helpers/color.h>
#include <OgreMaterial.h>

namespace Ogre
{
class SceneNode;
}

namespace rviz
{
class DisplayContext;
}

namespace moveit_rviz_plugin
{
MOVEIT_CLASS_FORWARD(RobotStateVisualization);
MOVEIT_CLASS_FORWARD(RenderShapes);
MOVEIT_CLASS_FORWARD(PlanningSceneRender);

class PlanningSceneRender
{
public:
  PlanningSceneRender(Ogre::SceneNode* root_node, rviz::DisplayContext* context,
                      const RobotStateVisualizationPtr& robot);
  ~PlanningSceneRender();

  Ogre::SceneNode* getGeometryNode()
  {
    return planning_scene_geometry_node_;
  }

  const RobotStateVisualizationPtr& getRobotVisualization()
  {
    return scene_robot_;
  }

  void renderPlanningScene(const planning_scene::PlanningSceneConstPtr& scene, const rviz::Color& default_scene_color,
                           const rviz::Color& default_attached_color, OctreeVoxelRenderMode voxel_render_mode,
                           OctreeVoxelColorMode voxel_color_mode, float default_scene_alpha);
  void clear();

private:
  Ogre::SceneNode* planning_scene_geometry_node_;
  rviz::DisplayContext* context_;
  RenderShapesPtr render_shapes_;
  RobotStateVisualizationPtr scene_robot_;
};
}

#endif


text:
'use strict';

var exec = require('child_process').exec;

var $$users = {};
var standups;

module.exports = function reboot(controller, db) {

//   standups = db.collection('standups');

//   controller.hears(['standup'], ['direct_message','mention','direct_mention', 'message_received'], function(bot, message) {
//     bot.api.users.info({user: message.user}, function (err, user) {
//       $$users[message.user] = user.user;
//       // console.log(user);
//       // convo.$user = user;
//       bot.reply(message, 'Hello ' + user.user.real_name + '!');
//       bot.startPrivateConversation(message, step1);
//     });
//   });
};

function step1(response, convo) {
  convo.ask('What did you do yesterday?', function(response, convo) {
    step2(response, convo);
    convo.next();
  });
}

function step2(response, convo) {
  convo.ask('What will you do today?', function(response, convo) {
    step3(response, convo);
    convo.next();
  });
}

function step3(response, convo) {
  convo.ask('Do you have any pain points / road blocks?', function(response, convo) {
    step4(response, convo);
    convo.next();
  });
}

function step4(response, convo) {
  convo.ask('What is 1 win that you have experienced in the last 24 hours?', function(response, convo) {
    step5(response, convo);
    convo.next();
  });
}

function step5(response, convo) {

  var obj = {};
  obj.userID = convo.responses['What did you do yesterday?'].user;
  obj.userName = $$users[obj.userID].real_name;
  obj.timestamp = Date.now();
  obj.responses = convo.responses;
  console.log(obj);

  standups.insertMany([obj], function(err, result) {
    if(err) {
      convo.say('Whoops. Something happened and your standup was unable to be saved to the database. Please try again. If the error persists please contact hrr.communication@hackreactor.com')
    } else {
      convo.say('Thank you!');
    }
    convo.next();
  });
}


text:
class Tfive < ActiveRecord::Base
  acts_as_interface

  #Attributes:
  #:one, :two, :three, :account_id, :status

  def self.default(type = 'new')
    hash = {}
    case type
    when 'new'
      new(hash)
    when 'create'
      create(hash)
    end
  end

  def self.released
    #All of the posts on the site that are being shown.
    where(:status => 3)
  end

  def self.in_queue
    #All of the posts that are just waiting to be released.
    where(:status => 2)
  end

  def self.waiting_approval
    #All of the posts that are submitted and waiting to be judged.
    where(:status => 1)
  end

  def self.approved_by_user(user_id)
    #All of the posts that a user has had approved,
    where(:status => 3, :user_from => user_id)
  end

  def self.queued_by_user(user_id)
    #All of the posts in the queue that a user put there.
    queue.where(:user_from => user_id)
  end

  def self.waiting_by_user(user_id)
    #All of the posts that a user has submited that have been denied.
    waiting_approval.where(:user_from => user_id)
  end

  def self.post_next
    self.in_queue.first.post_to_site
  end

  def self.last_post
    if last = in_queue.last
      last.expected_time
    else
      Time.now
    end
  end

  def approve(user)
    self.expected_time = self.class.last_post + 4.hours
    self.added_time = Time.now
    self.queue!
    self.user_confirm = user.id
  end

  def deny(reason)
    self.reasons = reasons.to_s + ' --- ' + reason
    self.draft!
  end

  def resubmit
    self.waiting_confirm!
  end

  def post_to_site
    self.public_view!
  end

end


text:
@interface HCIsNot ()
@property (nonatomic, readonly) id <HCMatcher> matcher;
@end

@implementation HCIsNot

+ (instancetype)isNot:(id <HCMatcher>)matcher
{
    return [[self alloc] initNot:matcher];
}

- (instancetype)initNot:(id <HCMatcher>)matcher
{
    self = [super init];
    if (self)
        _matcher = matcher;
    return self;
}

- (BOOL)matches:(id)item
{
    return ![self.matcher matches:item];
}

- (void)describeTo:(id<HCDescription>)description
{
    [[description appendText:@"not "] appendDescriptionOf:self.matcher];
}

- (void)describeMismatchOf:(id)item to:(id<HCDescription>)mismatchDescription
{
    [self.matcher describeMismatchOf:item to:mismatchDescription];
}
@end

id HC_isNot(id aMatcher)
{
    return [HCIsNot isNot:HCWrapInMatcher(aMatcher)];
}


text:
Provides user interface animations to Xojo projects.

## Building Documentation

Documentation is powered by [MkDocs](http://www.mkdocs.org/). Simply `cd` into the Documentation directory and `mkdocs build` after installing MkDocs. Release builds will contain compiled documentation as well as hosted documentation.


text:
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Shadowsocks.Util.Sockets;

namespace Shadowsocks.ForwardProxy
{
    public class DirectConnect : IForwardProxy
    {
        private class FakeAsyncResult : IAsyncResult
        {
            public FakeAsyncResult(object state)
            {
                AsyncState = state;
            }

            public bool IsCompleted { get; } = true;
            public WaitHandle AsyncWaitHandle { get; } = null;
            public object AsyncState { get; }
            public bool CompletedSynchronously { get; } = true;
        }

        private class FakeEndPoint : EndPoint
        {
            public override AddressFamily AddressFamily { get; } = AddressFamily.Unspecified;

            public override string ToString()
            {
                return "null proxy";
            }
        }

        private WrappedSocket _remote = new WrappedSocket();

        public EndPoint LocalEndPoint => _remote.LocalEndPoint;

        public EndPoint ProxyEndPoint { get; } = new FakeEndPoint();
        public EndPoint DestEndPoint { get; private set; }

        public void BeginConnectProxy(EndPoint remoteEP, AsyncCallback callback, object state)
        {
            // do nothing

            var r = new FakeAsyncResult(state);
            callback?.Invoke(r);
        }

        public void EndConnectProxy(IAsyncResult asyncResult)
        {
            // do nothing
        }

        public void BeginConnectDest(EndPoint destEndPoint, AsyncCallback callback, object state)
        {
            DestEndPoint = destEndPoint;

            _remote.BeginConnect(destEndPoint, callback, state);
        }

        public void EndConnectDest(IAsyncResult asyncResult)
        {
            _remote.EndConnect(asyncResult);
            _remote.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true);
        }

        public void BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, AsyncCallback callback,
            object state)
        {
            _remote.BeginSend(buffer, offset, size, socketFlags, callback, state);
        }

        public int EndSend(IAsyncResult asyncResult)
        {
            return _remote.EndSend(asyncResult);
        }

        public void BeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, AsyncCallback callback,
            object state)
        {
            _remote.BeginReceive(buffer, offset, size, socketFlags, callback, state);
        }

        public int EndReceive(IAsyncResult asyncResult)
        {
            return _remote.EndReceive(asyncResult);
        }

        public void Shutdown(SocketShutdown how)
        {
            _remote.Shutdown(how);
        }

        public void Close()
        {
            _remote.Dispose();
        }
    }
}


text:
/* @flow */
import Box from '../../common/DemoBox';
import DemoLayout from '../../common/DemoLayout';

export default {
  id: 'spacing',
  title: 'Spacing',
  description: `Values for margin & padding
can be a [spacing theme variable](/theming#common-scenarios-theme-structure)
or a custom string or number.

In _order of precedence_, Box accepts the following spacing props:

1. \`margin[Bottom|Left|Right|Top]\`
1. \`marginStart\` (left, for left-to-right languages; right, for RTL languages)
1. \`marginEnd\` (right, for left-to-right languages; left, for RTL languages)
1. \`marginHorizontal\` (left & right)
1. \`marginVertical\` (top & bottom)
1. \`margin\` (all sides)

_Numbers < 1, e.g. \`1/2\`, will be converted to a percentage. Numbers ≥ 1 will
be appended with \`px\`. String values, e.g. \`"4em"\` or \`"20%"\`, will be
passed directly._

The same applies for \`padding\`.`,
  scope: { DemoLayout, Box },
  source: `
    /*
     * Spacing theme variables:
     * 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'
     */
    <DemoLayout>
      <Box>none</Box>
      <Box marginRight="xl">xl</Box>
      <Box marginRight="6em">6em</Box>
      <Box marginRight={120}>120</Box>
      <Box marginRight={1/3}>1/3</Box>
    </DemoLayout>`
};


text:
package com.secucard.connect.product.smart;

import com.secucard.connect.client.Callback;
import com.secucard.connect.client.ProductService;
import com.secucard.connect.event.AbstractEventListener;
import com.secucard.connect.event.DelegatingEventHandlerCallback;
import com.secucard.connect.event.Events;
import com.secucard.connect.net.Options;
import com.secucard.connect.product.common.model.MediaResource;
import com.secucard.connect.product.common.model.ObjectList;
import com.secucard.connect.product.general.model.Event;
import com.secucard.connect.product.smart.model.Checkin;
import com.secucard.connect.product.smart.model.ComponentInstruction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;

/**
 * Implements the smart/checkins operations.
 */
public class CheckinService extends ProductService<Checkin> {

  public static final ServiceMetaData<Checkin> META_DATA = new ServiceMetaData<>("smart", "checkins", Checkin.class);

  @Override
  public ServiceMetaData<Checkin> getMetaData() {
    return META_DATA;
  }

  @Override
  public Options getDefaultOptions() {
    return new Options(Options.CHANNEL_STOMP);
  }

  /**
   * Set a callback to get notified when a check in happened.
   *
   * @deprecated Use onChanged instead
   */
  public void onCheckinsChanged(final Callback<List<Checkin>> callback) {
    AbstractEventListener listener = null;

    if (callback != null) {
      listener = new DelegatingEventHandlerCallback<Event, List<Checkin>>(callback) {
        @Override
        public boolean accept(Event event) {
          return Events.TYPE_CHANGED.equals(event.getType()) && getMetaData().getObject().equals(event.getTarget());
        }

        @Override
        protected List<Checkin> process(Event event) {
          return getAll(null);
        }
      };
    }

    context.eventDispatcher.registerListener(getMetaData().getObject() + Events.TYPE_CHANGED, listener);
  }

  /**
   * Returning check in data.
 Data may contain a downloadable image. When the method returns either by callback or directly it is guarantied that
   * all images are completely downloaded to an local cache. To get the image content simply call {@link MediaResource#getInputStream()}  or {@link
   * MediaResource#getContents()}. The streaming approach should be favored, since the other obviously loads the content completely in memory before
   * returning, which may not be optimal in any case.
 Note: Depending on the network it may of course take a while to download all, so without
   * using an callback the method may block until ready. Id that's not acceptable use the callback.
   *
   * @param callback Callback for async result processing.
   * @return If no callback is provided a list of check in data objects or null if no data could be found. Returns always null if a callback was
   * provided, the callbacks methods return the result analogous.
   */
  public List<Checkin> getAll(Callback<List<Checkin>> callback) {
    Options options = getDefaultOptions();
    options.resultProcessing = new Callback.Notify<ObjectList<Checkin>>() {
      @Override
      public void notify(ObjectList<Checkin> result) {
        processCheckins(result);
      }
    };
    return super.getSimpleList(null, options, callback);
  }

  /**
   * Downloading check in pictures sequentially and return just when done. todo: consider doing it in parallel to speed up, but not sure if rest
   * channel can handle this properly
   */
  private void processCheckins(ObjectList<Checkin> checkins) {
    if (checkins != null && checkins.getList() != null) {
      for (Checkin checkin : checkins.getList()) {
        try {
          downloadMedia(checkin.getPictureObject());
        } catch (Exception e) {
          // download went wrong, so skip picture and continue
          checkin.setPicture(null);
          checkin.setError(e);
        }
      }
    }
  }

  /**
   * Set a callback to get notified when a component gets changed
   */
  public void onChanged(final Callback<List<ComponentInstruction>> callback) {
    AbstractEventListener listener = null;

    if (callback != null) {
      listener = new DelegatingEventHandlerCallback<Event, List<ComponentInstruction>>(callback) {
        @Override
        public boolean accept(Event event) {
          return Events.TYPE_CHANGED.equals(event.getType()) && getMetaData().getObject().equals(event.getTarget());
        }

        @Override
        protected List<ComponentInstruction> process(Event event) {
          return processAllEvents(event);
        }
      };
    }

    context.eventDispatcher.registerListener(getMetaData().getObject() + Events.TYPE_CHANGED, listener);
  }

  private List<ComponentInstruction> processAllEvents(Event event) {
    List<ComponentInstruction> resultList = new ArrayList<>();
    try {
      JSONArray array = new JSONArray(event.getDataRaw());

      for (int i = 0; i < array.length(); i++) {
        resultList.add(event.getJsonMapper().map(array.get(i).toString(), ComponentInstruction.class));
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    return resultList;
  }

  public void initiateComponentCheckinButton() {
    initiateComponent(ComponentInstruction.COMPONENT_TARGET_CHECKIN_BUTTON, ComponentInstruction.COMPONENT_ACTION_OPEN, null);
  }

  private void initiateComponent(String target, String action, String id) {

    Map<String, String> optionsArray = new HashMap<>();
    optionsArray.put("target", target);
    optionsArray.put("action", action);
    optionsArray.put("data", id);

    execute("me", "TriggerPushEvent", null, optionsArray, Checkin.class, new Options(Options.CHANNEL_REST), null);
  }
}


text:
package xyz.abhid.newsletterh.provider;

import android.net.Uri;
import android.provider.BaseColumns;

import xyz.abhid.newsletterh.NewsletterApplication;

@SuppressWarnings("unused")
public class NewsletterContract {

    public static final String PATH_ARTICLES = "articles";
    public static final String PATH_ISSUES = "issues";
    public static final String PATH_RENEW_FTS_TABLE = "renewFTSTable";
    private static final Uri BASE_CONTENT_URI = Uri.parse("content://"
            + NewsletterApplication.CONTENT_AUTHORITY);

    public interface ArticlesColumns {

        String REF_ARTICLE_ID = "articleId";

        String ISSUE = "issue";
        String ISSUE_DATE = "issueDate";
        String TITLE = "title";
        String BODY = "body";
        String POSTER = "poster";
        String AUTHOR = "author";
        String AUTHOR_YEAR = "authorYear";
        String IS_FAVORITE = "isFavorite";
        String IS_READ = "isRead";

        String[] PROJECTION = new String[]{BaseColumns._ID, ISSUE, ISSUE_DATE, TITLE, BODY, POSTER,
                AUTHOR, AUTHOR_YEAR, IS_FAVORITE, IS_READ};
    }

    public interface IssuesColumns {

        String REF_ISSUE_ID = "issueId";

        String ISSUE_DATE = "issueDate";

        String[] PROJECTION = new String[]{BaseColumns._ID, ISSUE_DATE};
    }

    public static class Articles implements ArticlesColumns, BaseColumns {

        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
                .appendPath(PATH_ARTICLES)
                .build();

        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.newsletterh.article";

        public static final String CONTENT_ITEM_TYPE
                = "vnd.android.cursor.item/vnd.newsletterh.article";

        public static Uri buildArticleUri(String articleId) {
            return CONTENT_URI.buildUpon().appendPath(articleId).build();
        }

        public static Uri buildArticleUri(int articleId) {
            return buildArticleUri(String.valueOf(articleId));
        }

        public static String getArticleId(Uri uri) {
            return uri.getLastPathSegment();
        }
    }

    public static class Issues implements IssuesColumns, BaseColumns {

        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
                .appendPath(PATH_ISSUES)
                .build();

        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.newsletterh.issues";

        public static final String CONTENT_ITEM_TYPE
                = "vnd.android.cursor.item/vnd.newsletterh.issues";

        public static Uri buildIssueUri(String issueId) {
            return CONTENT_URI.buildUpon().appendPath(issueId).build();
        }

        public static Uri buildIssueUri(int issueId) {
            return buildIssueUri(String.valueOf(issueId));
        }

        public static String getIssueId(Uri uri) {
            return uri.getLastPathSegment();
        }
    }
}


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

#include "../QBtServiceDiscoverer.h"
#include <QBtAuxFunctions.h>

#if defined(Q_OS_SYMBIAN)
#include "../QBtServiceDiscoverer_symbian.h"
#elif defined(Q_OS_WIN32)
#include "../QBtServiceDiscoverer_win32.h"
#elif !defined(Q_OS_WIN32) && !defined(Q_OS_SYMBIAN)
#include "../QBtServiceDiscoverer_stub.h"
#endif

QBT_NAMESPACE_BEGIN

//____________________________________________________________________________

QBtServiceDiscoverer::QBtServiceDiscoverer(QObject *parent) :
    QObject(parent)
{
#ifdef Q_OS_SYMBIAN
    QT_TRAP_THROWING(_implPtr = QBtServiceDiscovererPrivate::NewL(this));
#else
    _implPtr = new QBtServiceDiscovererPrivate(this);
#endif
}

//____________________________________________________________________________

QBtServiceDiscoverer::~QBtServiceDiscoverer()
{
    SafeDelete(_implPtr);
}

//____________________________________________________________________________

void QBtServiceDiscoverer::startDiscovery (const QBtDevice& targetDevice)
{
    _remoteDevice = targetDevice;
    _implPtr->DiscoverServices (& _remoteDevice);
}

//____________________________________________________________________________

void QBtServiceDiscoverer::startObexDiscovery (const QBtDevice& targetDevice)
{
    _remoteDevice = targetDevice;
    _implPtr->DiscoverObexServices (& _remoteDevice);
}

//____________________________________________________________________________

void QBtServiceDiscoverer::startRfcommDiscovery (const QBtDevice& targetDevice)
{
    _remoteDevice = targetDevice;
    _implPtr->DiscoverRfcommServices (& _remoteDevice);
}

//____________________________________________________________________________

void QBtServiceDiscoverer::startDiscovery (const QBtDevice& targetDevice, const QBtUuid & uuid)
{
    _remoteDevice = targetDevice;
    _implPtr->DiscoverSpecificClass (& _remoteDevice, uuid);//(QBtConstants::ServiceClass)uuid.get());
}

//____________________________________________________________________________

void QBtServiceDiscoverer::startDiscovery (const QBtDevice& targetDevice, const QList<QBtUuid> & uuids)
{
    _remoteDevice = targetDevice;
    _implPtr->DiscoverSpecificClasses (& _remoteDevice, uuids);
}

//____________________________________________________________________________

void QBtServiceDiscoverer::stopDiscovery()
{
    _implPtr->StopDiscovery();
}

//____________________________________________________________________________

const QBtDevice & QBtServiceDiscoverer::getTargetDevice() const
{
    return _remoteDevice;
}

//____________________________________________________________________________

QBtService::List QBtServiceDiscoverer::getInquiredServices()
{
    return _remoteDevice.getSupportedServices();
}

//____________________________________________________________________________

bool QBtServiceDiscoverer::isBusy () const
{
	return _implPtr->IsBusy();
}

QBT_NAMESPACE_END


text:
package org.appfuse.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.lang.StringUtils;

/**
 * This class is converts a java.util.Date to a String
 * and a String to a java.util.Date. It is used by
 * BeanUtils when copying properties.  Registered
 * for use in BaseAction.
 *
 *

 * View Source
 *

 *
 * @author Matt Raible
 */
public class DateConverter implements Converter {
    private static DateFormat df =
        new SimpleDateFormat(DateUtil.getDatePattern());

    public Object convert(Class type, Object value) {
        if (value == null) {
            return null;
        } else if (type == Date.class) {
            return convertToDate(type, value);
        } else if (type == String.class) {
            return convertToString(type, value);
        }

        throw new ConversionException("Could not convert " +
                                      value.getClass().getName() + " to " +
                                      type.getName());
    }

    protected Object convertToDate(Class type, Object value) {
        if (value instanceof String) {
            try {
                if (StringUtils.isEmpty(value.toString())) {
                    return null;
                }

                return df.parse((String) value);
            } catch (Exception pe) {
                throw new ConversionException("Error converting String to Date");
            }
        }

        throw new ConversionException("Could not convert " +
                                      value.getClass().getName() + " to " +
                                      type.getName());
    }

    protected Object convertToString(Class type, Object value) {
        if (value instanceof Date) {
            try {
                return df.format(value);
            } catch (Exception e) {
                throw new ConversionException("Error converting Date to String");
            }
        }

        return value.toString();
    }
}


text:
package org.apache.yoko.orb.OCI;

//
// IDL:orb.yoko.apache.org/OCI/TaggedComponentSeq:1.0
//
final public class TaggedComponentSeqHelper
{
    public static void
    insert(org.omg.CORBA.Any any, org.omg.IOP.TaggedComponent[] val)
    {
        org.omg.CORBA.portable.OutputStream out = any.create_output_stream();
        write(out, val);
        any.read_value(out.create_input_stream(), type());
    }

    public static org.omg.IOP.TaggedComponent[]
    extract(org.omg.CORBA.Any any)
    {
        if(any.type().equivalent(type()))
            return read(any.create_input_stream());
        else

            throw new org.omg.CORBA.BAD_OPERATION(
                org.apache.yoko.orb.OB.MinorCodes
                        .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch),
                org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO);
    }

    private static org.omg.CORBA.TypeCode typeCode_;

    public static org.omg.CORBA.TypeCode
    type()
    {
        if(typeCode_ == null)
        {
            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
            typeCode_ = orb.create_alias_tc(id(), "TaggedComponentSeq", org.omg.IOP.TaggedComponentSeqHelper.type());
        }

        return typeCode_;
    }

    public static String
    id()
    {
        return "IDL:orb.yoko.apache.org/OCI/TaggedComponentSeq:1.0";
    }

    public static org.omg.IOP.TaggedComponent[]
    read(org.omg.CORBA.portable.InputStream in)
    {
        org.omg.IOP.TaggedComponent[] _ob_v;
        _ob_v = org.omg.IOP.TaggedComponentSeqHelper.read(in);
        return _ob_v;
    }

    public static void
    write(org.omg.CORBA.portable.OutputStream out, org.omg.IOP.TaggedComponent[] val)
    {
        org.omg.IOP.TaggedComponentSeqHelper.write(out, val);
    }
}


text:
/**
 * Developed by :
 * ROUTE-TO-PA Project - grant No 645860. - www.routetopa.eu
 *
 */
var WorkcycleBehavior = {
    /**
     * A reference to Polymer object
     *
     */
    _component: null,

    /**
     * Request data from source(e.g. CKAN by api) using some kind of technology(e.g. Ajax)
     *
     * @method requestData
     */
    requestData: function(){
    },

    /**
     * Select the fields from data(typically json) previously retrieved by ajax request. The selection could be done by jsonPath but
     * it depends on the representation data format(CKAN apies return a json representation of the dataset).
     *
     * @method selectData
     */
    selectData: function(){
    },

    /**
     * Filter data previously selected. An example of filterting could be an expression such "fields > 30" or "fields = 'AAA'"
     * If you are using jsonPath to select the datas you can apply an expression directly in the jsonPath query string.
     *
     * @method filterData
     */
    filterData: function(){
    },

    /**
     * Transform the selected data in order to build the structure that the presentation phase needs.
     *
     * @method transformData
     */
    transformData: function(){
    },

    /**
     * Build the object/s for presentation layer.
     *
     * @method presentData
     */
    presentData: function(){

    },

    /**
     * Build the object/s for presentation layer.
     *
     * @method presentData
     */
    redraw: function(){

    },

    /**
     * This method represents the entire datalet workcycle.
     *
     * @method runWorkcycle
     */
    runWorkcycle: function() {
        // try catch in requestData selectData filterData transformData presentData redraw
        try {
            this.selectData();
            this.filterData();
            this.transformData();

            var that = this;
            this._component.async(function () {
                that.presentData();
                $(that._component).find("base-datalet")[0].removeLoader();
                that.redraw();
            }, 600);
        }
        catch (ex){
            $(this._component).find("base-datalet")[0].removeLoader();
            $($(this._component).find("#ajax_error")[0]).append(' error: runWorkcycle ');
            console.log(ex);
        }
    },

    /**
     * This method save the reference to the polymer object related to the datalet.
     *
     * @method init
     */
    init: function(component){
        this._component = component;

        if (this._component.data == undefined) {
            $(this._component).find("base-datalet")[0].removeRefresh();
            this.requestData();
        } else {
            try {
                this.data = this._component.data;
                this.transformData();

                var that = this;
                $($(this._component).find("#refresh")).click(function () {
                    that._component.data = undefined;
                    that.init(component);
                });
                this._component.async(function () {
                    that.presentData();
                    $(that._component).find("base-datalet")[0].removeLoader();
                    that.redraw();
                }, 600);
            }
            catch (ex){
                $(this._component).find("base-datalet")[0].removeLoader();
                $($(this._component).find("#ajax_error")[0]).append(' error: init ');
                console.log(ex);
            }
        }
    }

};