text:
package org.eclipse.collections.impl.map.sorted.immutable;

import java.util.Iterator;
import java.util.Map;
import java.util.Optional;
import java.util.SortedMap;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.bag.ImmutableBag;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function0;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
import org.eclipse.collections.api.block.function.primitive.ByteFunction;
import org.eclipse.collections.api.block.function.primitive.CharFunction;
import org.eclipse.collections.api.block.function.primitive.DoubleFunction;
import org.eclipse.collections.api.block.function.primitive.FloatFunction;
import org.eclipse.collections.api.block.function.primitive.IntFunction;
import org.eclipse.collections.api.block.function.primitive.LongFunction;
import org.eclipse.collections.api.block.function.primitive.ShortFunction;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure;
import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.api.list.primitive.ImmutableBooleanList;
import org.eclipse.collections.api.list.primitive.ImmutableByteList;
import org.eclipse.collections.api.list.primitive.ImmutableCharList;
import org.eclipse.collections.api.list.primitive.ImmutableDoubleList;
import org.eclipse.collections.api.list.primitive.ImmutableFloatList;
import org.eclipse.collections.api.list.primitive.ImmutableIntList;
import org.eclipse.collections.api.list.primitive.ImmutableLongList;
import org.eclipse.collections.api.list.primitive.ImmutableShortList;
import org.eclipse.collections.api.map.ImmutableMap;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.primitive.ImmutableObjectDoubleMap;
import org.eclipse.collections.api.map.primitive.ImmutableObjectLongMap;
import org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap;
import org.eclipse.collections.api.map.primitive.MutableObjectLongMap;
import org.eclipse.collections.api.map.sorted.ImmutableSortedMap;
import org.eclipse.collections.api.map.sorted.MutableSortedMap;
import org.eclipse.collections.api.multimap.list.ImmutableListMultimap;
import org.eclipse.collections.api.multimap.sortedset.ImmutableSortedSetMultimap;
import org.eclipse.collections.api.ordered.OrderedIterable;
import org.eclipse.collections.api.partition.list.PartitionImmutableList;
import org.eclipse.collections.api.partition.list.PartitionMutableList;
import org.eclipse.collections.api.stack.MutableStack;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.impl.block.factory.Functions;
import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.block.factory.PrimitiveFunctions;
import org.eclipse.collections.impl.block.procedure.MutatingAggregationProcedure;
import org.eclipse.collections.impl.block.procedure.NonMutatingAggregationProcedure;
import org.eclipse.collections.impl.block.procedure.PartitionPredicate2Procedure;
import org.eclipse.collections.impl.block.procedure.PartitionProcedure;
import org.eclipse.collections.impl.block.procedure.SelectInstancesOfProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectBooleanProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectByteProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectCharProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectDoubleProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectFloatProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectIntProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectLongProcedure;
import org.eclipse.collections.impl.block.procedure.primitive.CollectShortProcedure;
import org.eclipse.collections.impl.factory.Bags;
import org.eclipse.collections.impl.factory.SortedMaps;
import org.eclipse.collections.impl.list.mutable.FastList;
import org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.CharArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.IntArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.LongArrayList;
import org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList;
import org.eclipse.collections.impl.map.AbstractMapIterable;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.eclipse.collections.impl.map.mutable.primitive.ObjectDoubleHashMap;
import org.eclipse.collections.impl.map.mutable.primitive.ObjectLongHashMap;
import org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap;
import org.eclipse.collections.impl.multimap.list.FastListMultimap;
import org.eclipse.collections.impl.partition.list.PartitionFastList;
import org.eclipse.collections.impl.utility.MapIterate;

public abstract class AbstractImmutableSortedMap<K, V>
        extends AbstractMapIterable<K, V>
        implements ImmutableSortedMap<K, V>, SortedMap<K, V>
{
    @Override
    public SortedMap<K, V> castToMap()
    {
        return this;
    }

    @Override
    public SortedMap<K, V> castToSortedMap()
    {
        return this;
    }

    @Override
    public MutableSortedMap<K, V> toSortedMap()
    {
        return TreeSortedMap.newMap(this);
    }

    @Override
    public ImmutableSortedMap<K, V> toImmutable()
    {
        return this;
    }

    @Override
    public Iterator<V> iterator()
    {
        return this.valuesView().iterator();
    }

    @Override
    public void putAll(Map<? extends K, ? extends V> map)
    {
        throw new UnsupportedOperationException("Cannot call putAll() on " + this.getClass().getSimpleName());
    }

    @Override
    public void clear()
    {
        throw new UnsupportedOperationException("Cannot call clear() on " + this.getClass().getSimpleName());
    }

    @Override
    public ImmutableSortedMap<K, V> newWithKeyValue(K key, V value)
    {
        TreeSortedMap<K, V> sortedMap = TreeSortedMap.newMap(this);
        sortedMap.put(key, value);
        return sortedMap.toImmutable();
    }

    @Override
    public ImmutableSortedMap<K, V> newWithAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues)
    {
        TreeSortedMap<K, V> sortedMap = TreeSortedMap.newMap(this);
        for (Pair<? extends K, ? extends V> keyValuePair : keyValues)
        {
            sortedMap.put(keyValuePair.getOne(), keyValuePair.getTwo());
        }
        return sortedMap.toImmutable();
    }

    @Override
    public ImmutableSortedMap<K, V> newWithAllKeyValueArguments(Pair<? extends K, ? extends V>... keyValuePairs)
    {
        TreeSortedMap<K, V> sortedMap = TreeSortedMap.newMap(this);
        for (Pair<? extends K, ? extends V> keyValuePair : keyValuePairs)
        {
            sortedMap.put(keyValuePair.getOne(), keyValuePair.getTwo());
        }
        return sortedMap.toImmutable();
    }

    @Override
    public ImmutableSortedMap<K, V> newWithoutKey(K key)
    {
        TreeSortedMap<K, V> sortedMap = TreeSortedMap.newMap(this);
        sortedMap.removeKey(key);
        return sortedMap.toImmutable();
    }

    @Override
    public ImmutableSortedMap<K, V> newWithoutAllKeys(Iterable<? extends K> keys)
    {
        TreeSortedMap<K, V> sortedMap = TreeSortedMap.newMap(this);
        for (K key : keys)
        {
            sortedMap.removeKey(key);
        }
        return sortedMap.toImmutable();
    }

    @Override
    public V put(K key, V value)
    {
        throw new UnsupportedOperationException("Cannot call put() on " + this.getClass().getSimpleName());
    }

    @Override
    public V remove(Object key)
    {
        throw new UnsupportedOperationException("Cannot call remove() on " + this.getClass().getSimpleName());
    }

    @Override
    public ImmutableSortedSetMultimap<V, K> flip()
    {
        return MapIterate.flip(this).toImmutable();
    }

    @Override
    public ImmutableSortedMap<K, V> tap(Procedure<? super V> procedure)
    {
        this.forEach(procedure);
        return this;
    }

    @Override
    public ImmutableList<V> select(Predicate<? super V> predicate)
    {
        return this.select(predicate, FastList.newList(this.size())).toImmutable();
    }

    @Override
    public <P> ImmutableList<V> selectWith(Predicate2<? super V, ? super P> predicate, P parameter)
    {
        return this.select(Predicates.bind(predicate, parameter));
    }

    @Override
    public ImmutableSortedMap<K, V> select(Predicate2<? super K, ? super V> predicate)
    {
        MutableSortedMap<K, V> selectedMap = SortedMaps.mutable.with(this.comparator());
        this.forEachKeyValue((key, value) ->
        {
            if (predicate.accept(key, value))
            {
                selectedMap.put(key, value);
            }
        });
        return selectedMap.toImmutable();
    }

    @Override
    public ImmutableList<V> reject(Predicate<? super V> predicate)
    {
        return this.reject(predicate, FastList.newList(this.size())).toImmutable();
    }

    @Override
    public <P> ImmutableList<V> rejectWith(Predicate2<? super V, ? super P> predicate, P parameter)
    {
        return this.reject(Predicates.bind(predicate, parameter));
    }

    @Override
    public ImmutableSortedMap<K, V> reject(Predicate2<? super K, ? super V> predicate)
    {
        MutableSortedMap<K, V> rejectedMap = SortedMaps.mutable.with(this.comparator());
        this.forEachKeyValue((key, value) ->
        {
            if (!predicate.accept(key, value))
            {
                rejectedMap.put(key, value);
            }
        });
        return rejectedMap.toImmutable();
    }

    @Override
    public PartitionImmutableList<V> partition(Predicate<? super V> predicate)
    {
        PartitionMutableList<V> partitionFastList = new PartitionFastList<>();
        this.forEach(new PartitionProcedure<>(predicate, partitionFastList));
        return partitionFastList.toImmutable();
    }

    @Override
    public <P> PartitionImmutableList<V> partitionWith(Predicate2<? super V, ? super P> predicate, P parameter)
    {
        PartitionMutableList<V> partitionFastList = new PartitionFastList<>();
        this.forEach(new PartitionPredicate2Procedure<>(predicate, parameter, partitionFastList));
        return partitionFastList.toImmutable();
    }

    @Override
    public <S> ImmutableList<S> selectInstancesOf(Class<S> clazz)
    {
        FastList<S> result = FastList.newList(this.size());
        this.forEach(new SelectInstancesOfProcedure<>(clazz, result));
        return result.toImmutable();
    }

    @Override
    public <R> ImmutableList<R> collect(Function<? super V, ? extends R> function)
    {
        return this.collect(function, FastList.<R>newList(this.size())).toImmutable();
    }

    @Override
    public ImmutableBooleanList collectBoolean(BooleanFunction<? super V> booleanFunction)
    {
        BooleanArrayList result = new BooleanArrayList(this.size());
        this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableByteList collectByte(ByteFunction<? super V> byteFunction)
    {
        ByteArrayList result = new ByteArrayList(this.size());
        this.forEach(new CollectByteProcedure<>(byteFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableCharList collectChar(CharFunction<? super V> charFunction)
    {
        CharArrayList result = new CharArrayList(this.size());
        this.forEach(new CollectCharProcedure<>(charFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableDoubleList collectDouble(DoubleFunction<? super V> doubleFunction)
    {
        DoubleArrayList result = new DoubleArrayList(this.size());
        this.forEach(new CollectDoubleProcedure<>(doubleFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableFloatList collectFloat(FloatFunction<? super V> floatFunction)
    {
        FloatArrayList result = new FloatArrayList(this.size());
        this.forEach(new CollectFloatProcedure<>(floatFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableIntList collectInt(IntFunction<? super V> intFunction)
    {
        IntArrayList result = new IntArrayList(this.size());
        this.forEach(new CollectIntProcedure<>(intFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableLongList collectLong(LongFunction<? super V> longFunction)
    {
        LongArrayList result = new LongArrayList(this.size());
        this.forEach(new CollectLongProcedure<>(longFunction, result));
        return result.toImmutable();
    }

    @Override
    public ImmutableShortList collectShort(ShortFunction<? super V> shortFunction)
    {
        ShortArrayList result = new ShortArrayList(this.size());
        this.forEach(new CollectShortProcedure<>(shortFunction, result));
        return result.toImmutable();
    }

    @Override
    public <K2, V2> ImmutableMap<K2, V2> collect(Function2<? super K, ? super V, Pair<K2, V2>> function)
    {
        MutableMap<K2, V2> collectedMap = UnifiedMap.newMap(this.size());
        this.forEachKeyValue((key, value) -> collectedMap.add(function.value(key, value)));
        return collectedMap.toImmutable();
    }

    @Override
    public <P, VV> ImmutableList<VV> collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter)
    {
        return this.collect(Functions.bind(function, parameter));
    }

    @Override
    public <R> ImmutableList<R> collectIf(Predicate<? super V> predicate, Function<? super V, ? extends R> function)
    {
        return this.collectIf(predicate, function, FastList.<R>newList(this.size())).toImmutable();
    }

    @Override
    public <R> ImmutableSortedMap<K, R> collectValues(Function2<? super K, ? super V, ? extends R> function)
    {
        MutableSortedMap<K, R> collectedMap = SortedMaps.mutable.with(this.comparator());
        this.forEachKeyValue((key, value) -> collectedMap.put(key, function.value(key, value)));
        return collectedMap.toImmutable();
    }

    @Override
    public Pair<K, V> detect(Predicate2<? super K, ? super V> predicate)
    {
        return this.keyValuesView().detect(each -> predicate.accept(each.getOne(), each.getTwo()));
    }

    @Override
    public Optional<Pair<K, V>> detectOptional(Predicate2<? super K, ? super V> predicate)
    {
        return this.keyValuesView().detectOptional(each -> predicate.accept(each.getOne(), each.getTwo()));
    }

    @Override
    public <R> ImmutableList<R> flatCollect(Function<? super V, ? extends Iterable<R>> function)
    {
        return this.flatCollect(function, FastList.newList(this.size())).toImmutable();
    }

    @Override
    public <S> ImmutableList<Pair<V, S>> zip(Iterable<S> that)
    {
        return this.zip(that, FastList.newList(this.size())).toImmutable();
    }

    @Override
    public ImmutableList<Pair<V, Integer>> zipWithIndex()
    {
        return this.zipWithIndex(FastList.newList(this.size())).toImmutable();
    }

    @Override
    public SortedMap<K, V> subMap(K fromKey, K toKey)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".subMap() not implemented yet");
    }

    @Override
    public SortedMap<K, V> headMap(K toKey)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".headMap() not implemented yet");
    }

    @Override
    public SortedMap<K, V> tailMap(K fromKey)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".tailMap() not implemented yet");
    }

    @Override
    public <R> ImmutableListMultimap<R, V> groupBy(Function<? super V, ? extends R> function)
    {
        return this.groupBy(function, FastListMultimap.<R, V>newMultimap()).toImmutable();
    }

    @Override
    public <R> ImmutableListMultimap<R, V> groupByEach(Function<? super V, ? extends Iterable<R>> function)
    {
        return this.groupByEach(function, FastListMultimap.newMultimap()).toImmutable();
    }

    @Override
    public <V1> ImmutableMap<V1, V> groupByUniqueKey(Function<? super V, ? extends V1> function)
    {
        return this.groupByUniqueKey(function, UnifiedMap.<V1, V>newMap()).toImmutable();
    }

    @Override
    public <K2, V2> ImmutableMap<K2, V2> aggregateInPlaceBy(
            Function<? super V, ? extends K2> groupBy,
            Function0<? extends V2> zeroValueFactory,
            Procedure2<? super V2, ? super V> mutatingAggregator)
    {
        MutableMap<K2, V2> map = UnifiedMap.newMap();
        this.forEach(new MutatingAggregationProcedure<>(map, groupBy, zeroValueFactory, mutatingAggregator));
        return map.toImmutable();
    }

    @Override
    public <K2, V2> ImmutableMap<K2, V2> aggregateBy(
            Function<? super V, ? extends K2> groupBy,
            Function0<? extends V2> zeroValueFactory,
            Function2<? super V2, ? super V, ? extends V2> nonMutatingAggregator)
    {
        MutableMap<K2, V2> map = UnifiedMap.newMap();
        this.forEach(new NonMutatingAggregationProcedure<>(map, groupBy, zeroValueFactory, nonMutatingAggregator));
        return map.toImmutable();
    }

    @Override
    public <V1> ImmutableObjectLongMap<V1> sumByInt(Function<? super V, ? extends V1> groupBy, IntFunction<? super V> function)
    {
        MutableObjectLongMap<V1> result = ObjectLongHashMap.newMap();
        return this.injectInto(result, PrimitiveFunctions.sumByIntFunction(groupBy, function)).toImmutable();
    }

    @Override
    public <V1> ImmutableObjectDoubleMap<V1> sumByFloat(Function<? super V, ? extends V1> groupBy, FloatFunction<? super V> function)
    {
        MutableObjectDoubleMap<V1> result = ObjectDoubleHashMap.newMap();
        return this.injectInto(result, PrimitiveFunctions.sumByFloatFunction(groupBy, function)).toImmutable();
    }

    @Override
    public <V1> ImmutableObjectLongMap<V1> sumByLong(Function<? super V, ? extends V1> groupBy, LongFunction<? super V> function)
    {
        MutableObjectLongMap<V1> result = ObjectLongHashMap.newMap();
        return this.injectInto(result, PrimitiveFunctions.sumByLongFunction(groupBy, function)).toImmutable();
    }

    @Override
    public <V1> ImmutableObjectDoubleMap<V1> sumByDouble(Function<? super V, ? extends V1> groupBy, DoubleFunction<? super V> function)
    {
        MutableObjectDoubleMap<V1> result = ObjectDoubleHashMap.newMap();
        return this.injectInto(result, PrimitiveFunctions.sumByDoubleFunction(groupBy, function)).toImmutable();
    }

    @Override
    public void reverseForEach(Procedure<? super V> procedure)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".reverseForEach() not implemented yet");
    }

    @Override
    public void reverseForEachWithIndex(ObjectIntProcedure<? super V> procedure)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".reverseForEachWithIndex() not implemented yet");
    }

    @Override
    public LazyIterable<V> asReversed()
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".asReversed() not implemented yet");
    }

    @Override
    public ImmutableSortedMap<K, V> toReversed()
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".toReversed() not implemented yet");
    }

    @Override
    public int detectLastIndex(Predicate<? super V> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".detectLastIndex() not implemented yet");
    }

    @Override
    public ImmutableSortedMap<K, V> takeWhile(Predicate<? super V> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".takeWhile() not implemented yet");
    }

    @Override
    public ImmutableSortedMap<K, V> dropWhile(Predicate<? super V> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".dropWhile() not implemented yet");
    }

    @Override
    public PartitionImmutableList<V> partitionWhile(Predicate<? super V> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".partitionWhile() not implemented yet");
    }

    @Override
    public ImmutableList<V> distinct()
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".distinct() not implemented yet");
    }

    @Override
    public int indexOf(Object object)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".indexOf() not implemented yet");
    }

    @Override
    public <S> boolean corresponds(OrderedIterable<S> other, Predicate2<? super V, ? super S> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".corresponds() not implemented yet");
    }

    @Override
    public void forEach(int startIndex, int endIndex, Procedure<? super V> procedure)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".forEach() not implemented yet");
    }

    @Override
    public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super V> objectIntProcedure)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".forEachWithIndex() not implemented yet");
    }

    @Override
    public MutableStack<V> toStack()
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".toStack() not implemented yet");
    }

    @Override
    public int detectIndex(Predicate<? super V> predicate)
    {
        throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".detectIndex() not implemented yet");
    }

    /**
     * @since 9.0
     */
    @Override
    public <V1> ImmutableBag<V1> countBy(Function<? super V, ? extends V1> function)
    {
        return this.collect(function, Bags.mutable.<V1>empty()).toImmutable();
    }

    /**
     * @since 9.0
     */
    @Override
    public <V1, P> ImmutableBag<V1> countByWith(Function2<? super V, ? super P, ? extends V1> function, P parameter)
    {
        return this.collectWith(function, parameter, Bags.mutable.<V1>empty()).toImmutable();
    }
}


text:
<resources>
    <string name="app_name">sample-custom-strategy</string>
    <string name="fragment_launch_text_beverage_section">Beverage section</string>
    <string name="fragment_launch_edit_text_sugar">Sugar count</string>
    <string name="fragment_launch_toggle_lemon">Toggle lemon</string>
    <string name="fragment_launch_sugar_apply">Apply</string>
    <string name="fragment_launch_beverage_clear">Clean beverage</string>

    <string name="fragment_launch_burger_section">Burger section</string>
    <string name="fragment_launch_toggle_bread_type">Toggle Bread Type</string>
    <string name="fragment_launch_toggle_cheese">Toggle Cheese</string>
    <string name="fragment_launch_burger_clear">Clear burger</string>

    <string name="fragment_launch_result_section">Result section</string>
    <string name="bread_regex" >Bread type: %1$s</string>
    <string name="cheese_regex" >Have cheese: %1$s</string>
    <string name="sugar_regex" >Sugar count: %1$d</string>
    <string name="lemon_regex" >Have lemon: %1$s</string>
    <string name="fragment_launch_make_order">Make order</string>
    <string name="order_made">Заказан отправлен в обработку</string>
</resources>

redpajama_set_name: RedPajamaGithub


text:
namespace Google.Cloud.VMMigration.V1.Snippets
{
    // [START vmmigration_v1_generated_VmMigration_AddGroupMigration_sync_flattened]
    using Google.Cloud.VMMigration.V1;
    using Google.LongRunning;

    public sealed partial class GeneratedVmMigrationClientSnippets
    {
        /// <summary>Snippet for AddGroupMigration</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void AddGroupMigration()
        {
            // Create client
            VmMigrationClient vmMigrationClient = VmMigrationClient.Create();
            // Initialize request argument(s)
            string group = "projects/[PROJECT]/locations/[LOCATION]/groups/[GROUP]";
            // Make the request
            Operation<AddGroupMigrationResponse, OperationMetadata> response = vmMigrationClient.AddGroupMigration(group);

            // Poll until the returned long-running operation is complete
            Operation<AddGroupMigrationResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            AddGroupMigrationResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<AddGroupMigrationResponse, OperationMetadata> retrievedResponse = vmMigrationClient.PollOnceAddGroupMigration(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AddGroupMigrationResponse retrievedResult = retrievedResponse.Result;
            }
        }
    }
    // [END vmmigration_v1_generated_VmMigration_AddGroupMigration_sync_flattened]
}


text:
/**
 * PCEP controller driver API.
 */
package org.onosproject.pcep.controller.driver;


text:
#ifndef TOC_H
#define TOC_H

#include "abstractinfodock.h"

class QTreeWidget;

class TocDock : public AbstractInfoDock
{
    Q_OBJECT

public:
    TocDock(QWidget *parent = 0);
    ~TocDock();

    /*virtual*/ void documentClosed();

protected:
    /*virtual*/ void fillInfo();

private:
    QTreeWidget *m_tree;
};

#endif


text:
/*
 *  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.
 */
using System;
using java = biz.ritter.javapi;

namespace biz.ritter.javapi.awt.image
{

    public sealed class ImageObserverConstants
    {

        public const int WIDTH = 1;

        public const int HEIGHT = 2;

        public const int PROPERTIES = 4;

        public const int SOMEBITS = 8;

        public const int FRAMEBITS = 16;

        public const int ALLBITS = 32;

        public const int ERROR = 64;

        public const int ABORT = 128;
    }

    public interface ImageObserver
    {
        bool imageUpdate(Image img, int infoflags, int x, int y,
                int width, int height);

    }

}


text:
#include "NfcUtil.h"

void NfcUtil::ConvertNdefPduToNdefMessage(NdefMessagePdu& aNdefPdu,
                                          NdefMessage* aNdefMessage) {
  for (uint32_t i = 0; i < aNdefPdu.numRecords; i++) {
    NdefRecordPdu& record = aNdefPdu.records[i];
    aNdefMessage->mRecords.push_back(NdefRecord(
      record.tnf,
      record.typeLength, record.type,
      record.idLength, record.id,
      record.payloadLength, record.payload));
  }
}

NfcEvtTransactionOrigin NfcUtil::ConvertOriginType(TransactionEvent::OriginType aType)
{
  switch (aType) {
    case TransactionEvent::SIM:    return NFC_EVT_TRANSACTION_SIM;
    case TransactionEvent::ESE:    return NFC_EVT_TRANSACTION_ESE;
    case TransactionEvent::ASSD:   return NFC_EVT_TRANSACTION_ASSD;
    default:                       return NFC_EVT_TRANSACTION_SIM;
  }
}

NfcNdefType NfcUtil::ConvertNdefType(NdefType aType)
{
  switch (aType) {
    case NDEF_TYPE1_TAG:           return NFC_NDEF_TYPE_1_TAG;
    case NDEF_TYPE2_TAG:           return NFC_NDEF_TYPE_2_TAG;
    case NDEF_TYPE3_TAG:           return NFC_NDEF_TYPE_3_TAG;
    case NDEF_TYPE4_TAG:           return NFC_NDEF_TYPE_4_TAG;
    case NDEF_MIFARE_CLASSIC_TAG:  return NFC_NDEF_MIFARE_CLASSIC_TAG;
    default:                       return NFC_NDEF_UNKNOWN_TAG;
  }
}


text:
class MyFancyClass
{
public:
    int randomNumber();
};

#endif


text:
// Copyright (c) 2006-2008 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s)     : Michael Hemmer   <hemmer@mpi-inf.mpg.de>

#ifndef CGAL_SQRT_EXTENSION_FRACTION_TRAITS_H
#define CGAL_SQRT_EXTENSION_FRACTION_TRAITS_H

#include <CGAL/basic.h>

namespace CGAL {

//################################# CGAL::Fraction_traits ##################
// Select the right alternative as Fraction_traits
// The actual Type traits is Intern::Sqrt_ext_Ftr_base_2
// The selction is done in two steps:
// 1. Inter::Sqrt_ext_Ftr_base_1 selects by the BOOL_TAG whether the COEFF type
//    Is_fraction
// 2. Intern::Sqrt_ext_Ftr_base_2 checks whether the internal type of the ROOT
//    is still implicite convertible to the new COEFF type.
//    since the ROOT type it self can not be converted.
namespace Intern{
    template <class EXT, bool> class Sqrt_ext_Ftr_base_2;
    template <class EXT, class BOOL_TAG> class Sqrt_ext_Ftr_base_1;
}

/*! \ingroup CGAL_Sqrt_extension
    \ingroup CGAL_Fraction_traits_spec
    \brief Specialisation of CGAL::Fraction_traits for CGAL::Sqrt_extension.
 *
 *  Extensions provide suitable specializations of \c CGAL::Fraction_traits.
 *  They are decomposable iff their coefficient type is.
 *  The denominator \e d of a Extension \e ext is a low common multiple
 *  (see \c CGAL::Fraction_traits::Common_factor for details) of the
 *  denominators of its coefficients.  The numerator is the Extenion
 *  \e d*ext with a fraction-free coefficient type.
 *
 *  This works for nested Sqrt_extensions, too.
 */

template <class COEFF, class ROOT, class ACDE_TAG, class FP_TAG >
class Fraction_traits< Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG > >
    : public Intern::Sqrt_ext_Ftr_base_1<
    Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG >,
    typename CGAL::Fraction_traits<COEFF>::Is_fraction >
{
    // nothing new
};

namespace Intern {

// Use this if the coefficients cannot be decomposed
// into numerator and denominator
template <class NT_ >
class Sqrt_ext_Ftr_base_2< NT_, false > {
public:
    typedef NT_ NT;
    typedef ::CGAL::Tag_false Is_fraction;
    typedef ::CGAL::Null_tag Numerator_type;
    typedef ::CGAL::Null_tag Denominator_type;
    typedef ::CGAL::Null_tag Common_factor;
    typedef ::CGAL::Null_tag Decompose;
    typedef ::CGAL::Null_tag Compose;
};

template <class COEFF, class ROOT, class ACDE_TAG,class FP_TAG>
class Sqrt_ext_Ftr_base_2< Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG>, true > {
private:
    typedef Fraction_traits<COEFF> CFT;
public:
  typedef Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG> NT;
    typedef CGAL::Tag_true Is_fraction;
  typedef Sqrt_extension<typename CFT::Numerator_type,ROOT,ACDE_TAG,FP_TAG> Numerator_type;
    typedef typename CFT::Denominator_type Denominator_type;
    typedef typename Algebraic_structure_traits<Denominator_type>::Gcd Common_factor;

    class Decompose {
    public:
        typedef NT first_argument_type;
        typedef Numerator_type second_argument_type;
        typedef Denominator_type& third_argument_type;
        void operator () (const NT& ext,
                          Numerator_type&   num,
                          Denominator_type& den){
            typename CFT::Decompose decompose;
            typename CFT::Common_factor common_factor;
            typedef typename CFT::Numerator_type NUM;
            typedef typename CFT::Denominator_type DEN;

            if(ext.is_extended()){
                NUM a0_num, a1_num;
                DEN a0_den, a1_den;
                DEN common_den;
                decompose(ext.a0(),a0_num,a0_den);
                decompose(ext.a1(),a1_num,a1_den);
                common_den=common_factor(a0_den,a1_den);
                typename CGAL::Coercion_traits<NUM,DEN>::Cast cast;
                a0_num = cast(a0_num) *
                         cast(CGAL::integral_division(a1_den,common_den));
                a1_num = cast(a1_num) *
                         cast(CGAL::integral_division(a0_den,common_den));
                den = CGAL::integral_division(a0_den,common_den)*a1_den;
                num = Numerator_type(a0_num,a1_num,ext.root());
            }else{
                NUM a0_num;
                decompose(ext.a0(),a0_num,den);
                num = Numerator_type(a0_num);
            }
        }
    };
    class Compose {
    public:
        typedef Numerator_type first_argument_type;
        typedef Denominator_type second_argument_type;
        typedef NT result_type;
        NT operator () (const Numerator_type&   num,
                        const Denominator_type& den){
            if(num.is_extended()){
                typename CFT::Compose compose;
                COEFF a0=compose(num.a0(),den);
                COEFF a1=compose(num.a1(),den);
                return NT(a0,a1,num.root());
            }else{
                typename CFT::Compose compose;
                COEFF a0=compose(num.a0(),den);
                return NT(a0);
            }
        }
    };
};

template <class EXT, class BOOL_TAG>
class Sqrt_ext_Ftr_base_1;

template <class COEFF, class ROOT, class ACDE_TAG, class FP_TAG>
class Sqrt_ext_Ftr_base_1< Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG>, CGAL::Tag_true >
    : public Sqrt_ext_Ftr_base_2<
    Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG>,
    ::boost::is_same< typename CGAL::Coercion_traits<ROOT,typename CGAL::Fraction_traits<COEFF>::Numerator_type>::Type,
                        typename CGAL::Fraction_traits<COEFF>::Numerator_type>::value >
{
    //nothing new
};

    template <class COEFF, class ROOT, class ACDE_TAG, class FP_TAG>
    class Sqrt_ext_Ftr_base_1< Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG>, CGAL::Tag_false >
      : public Sqrt_ext_Ftr_base_2< Sqrt_extension<COEFF,ROOT,ACDE_TAG,FP_TAG>, false>
    {
        //nothing new
    };
} // namespace Intern

/*
namespace Intern{
    template <class SqrtExt,class BoolTag> class Sqrt_ext_Coftr_base_1;
    template <class SqrtExt>
    class Sqrt_ext_Coftr_base_1< SqrtExt, CGAL::Tag_false >{
    public:
        typedef SqrtExt          Numerator_type;
        typedef ::CGAL::Tag_false Is_composable;
        typedef ::CGAL::Null_tag Denominator_type;
        typedef ::CGAL::Null_tag Type;
        typedef ::CGAL::Null_tag Compose;
    };
    template <class SqrtExt>
    class Sqrt_ext_Coftr_base_1< SqrtExt, CGAL::Tag_true >{
        typedef typename SqrtExt::NT Coeff;
        typedef typename SqrtExt::ROOT Root;
        typedef typename CGAL::Cofraction_traits<Coeff> CFT;
        typedef typename CFT::Type Type_coeff;

    public:
        typedef SqrtExt                                       Numerator_type;
        typedef ::CGAL::Tag_true                               Is_composable;
        typedef typename CFT::Denominator_type                Denominator;
        typedef CGAL::Sqrt_extension<Type_coeff,Root,ACDE_TAG,FP_TAG> Type;

        class Compose {
    public:
            //! first argument type
            typedef Numerator_type   first_argument_type;
            //! second argument type
            typedef Denominator_type second_argument_type;
            //! result type
            typedef Type    result_type;
            //! Compose fraction
            Type operator() (Numerator_type   num,
                                      Denominator_type den){
                if(num.is_extended()){
                    typename CFT::Compose compose_coeff;
                    Type_coeff a0_new(compose_coeff(num.a0(),den));
                    Type_coeff a1_new(compose_coeff(num.a1(),den));
                    return result_type(a0_new, a1_new, num.root());
                }else{
                    typename CFT::Compose compose_coeff;
                    return result_type(compose_coeff(num.a0(),den));
                }
            };
        };
    };
}

template <class Coeff, class Root,class ACDE_TAG, class FP_TAG>
class Cofraction_traits<Sqrt_extension<Coeff,Root,ACDE_TAG,FP_TAG> >
    :public Intern::Sqrt_ext_Coftr_base_1<
    Sqrt_extension<Coeff,Root,ACDE_TAG,FP_TAG>,
    typename CGAL::Cofraction_traits<Coeff>::Is_composable>{
    //nothing new;
};
*/

} //namespace CGAL

#endif


text:
package de.espend.idea.php.drupal.utils;

import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.openapi.project.Project;
import de.espend.idea.php.drupal.DrupalIcons;
import de.espend.idea.php.drupal.index.GetTextFileIndex;
import fr.adrienbrault.idea.symfony2plugin.stubs.SymfonyProcessors;
import org.jetbrains.annotations.NotNull;

public class TranslationUtil {
    public static void attachGetTextLookupKeys(@NotNull CompletionResultSet completionResultSet, @NotNull Project project) {
        for(String phpClassName: SymfonyProcessors.createResult(project, GetTextFileIndex.KEY)) {
            completionResultSet.addElement(LookupElementBuilder.create(phpClassName).withIcon(DrupalIcons.DRUPAL));
        }
    }
}


text:
[lists](lists.pv)

[dictionaries](dictionaries.pv)

####Individual Exercises
***The Array***

[Courses](courses.pv)

***The Dictionary***

[1. Room Database](my_room.py)

[2. Print Room](print_room.py)

***Data Structure***

[iTunes](iTunes.py)

####Group Exercise
with Marianne, Lola and Leonie

[Font Database | Helvetica](font_database.py)

####Exercises with the Shell
[Overview in Mou](exercises_with_the_shell.md)

## Concept

Een programma dat met behulp van grep zinnen met specifieke woorden uit de teksten van Edgar Allen Poe haalt en ze samenstelt tot nieuwe gedichten.

## Prototype: working demo

Ik kon met geen mogelijkheid bij mijn bestanden om uberhaupt wat uit te voeren, waarom begrijp ik niet.

[No such file or directory](prototype_fail.md)

Maar ik vond wel een interessant artikel over de mogelijkheden van grep. <http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/>

grep -o "first_word.*last_word" file_name zou bij mijn concept bijvoorbeeld heel handig zijn.

## Design the flow of the program

## How to use the script

## PDF format


text:
title: Test JOSSO in minutes
section: Getting Started
---

## Introduction

JOSSO is an open source Identity and Access Management (IAM) platform for rapid and standards-based
Cloud-scale Single Sign-On, web services security, strong authentication and provisioning.

## Agile IAM

Identity and Access Management is widely considered to be a highly technical domain, with an implementation that's out
of reach for most people. The process of setting up a system for identity and access management has a well-earned
reputation for technical difficulty, inconvenience, and errors; all in pursuit of an end product that most users dislike
and avoid.

Commercial identity and access management packages offer web-based facilities to set up their products; but without an
intimate knowledge of the product's inner structure, the overall set up and roll-out experience is tedious and
error-prone.

JOSSO incorporates a visual modeling user experience to enable ease of use, which translates to productivity.
You can get on board with implementing identity-centric use-cases, significantly accelerating time-to-value for
streamlining IAM rollouts.

## Quick JOSSO Playground overview

Identity and access management systems like JOSSO have many moving pieces. The product alone will not
 prove to be very useful while it's not integrated with the underlying IT ecosystem: target systems,
 directories and other infrastructure pieces.

In order to make sure that you can try JOSSO yourself, without having to perform manual and error-prone
tasks, we've made available a fully working virtual machine. This will also keep the host environment safe from any
changes that might be required at the infrastructure level (such as setting up DNS servers).

Within the Vagrant virtual machine, we're using Docker containers to host the components of the sandbox deployment.
This closely simulates an IT ecosystem, yet avoids the overhead involved in using multiple virtual machines in order
to deliver additional isolation. For instance, the JOSSO server, the domain name server, and the two tomcat web
containers all live in separate containers. This also provides the flexibility of rolling out additional infrastructure
components such as a directory server or an application server, by just pulling and running the corresponding
docker container.

Finally, Docker Compose is used for orchestrating containers, namely how containers are launched and their
configuration.

### Foreword about Vagrant and Docker

Vagrant is a multi-platform command line tool for creating lightweight, reproducible and portable virtual environments.
Vagrant acts as a glue layer between different virtualization solutions (software, hardware PaaS and IaaS) and
different configuration management utilities (Puppet, Chef, etc.).

Docker is an open source framework for developing, distributing and deploying so-called "Containers", middle ground
between virtual machines and process.

It allows processes to be running on the same kernel as system processes, yet it uses separate runtime
(include basic things like libc). It basically allows you to run centos on ubuntu or (via Virtual Box) on your
Mac and Windows installation.

These pages show how to take advantage of both Vagrant and Docker sandboxing capabilities to do a number of
JOSSO related tasks, including installation and testing basic features.

These instructions are not meant to be a full-blown guide to Vagrant or Docker. For that, we recommend looking at the
official documentation on the corresponding websites.

### Install Vagrant

Vagrant [installation packages](http://www.vagrantup.com/downloads.html) are available for OS X, Windows and Linux (deb
and rpm format). Installation is a simple "Next, Next, Next, Done" process and doesn't require any special user
interaction.

Since Vagrant is not a virtualization software by itself, it relies on 3rd party providers to accomplish virtualization.
For this tutorial I'll assume you have installed Oracle's VirtualBox. VirtualBox is a free multi-platform
virtualization software which is supported by Vagrant out of the box.

Before running the Vagrant box with the JOSSO Playground make sure to install the docker compose provisioner :

    vagrant plugin install vagrant-docker-compose

## Roll out the reference IAM ecosystem

### Launch playground

Let us now set up a JOSSO-based IAM development environment in Vagrant with the following steps:

Create a directory where we will be creating the instance:

    mkdir -p ~/Vagrant/josso-playground

    cd  ~/Vagrant/josso-playground

Now we are required to initialize the Vagrant box where the JOSSO playground lives.

    vagrant init atricore/josso-playground

This will create a VagrantFile which you may want to edit in case you wish to configure specific virtual machine
parameters (e.g. networking).

Finally, launch the vagrant box by issuing the following command:

    vagrant up --provider virtualbox

This may take several minutes depending on your bandwidth and the processing power of your workstation.

Once it's completed, connect to the vagrant box:

    vagrant ssh

and start the desktop environment:

    sudo startxfce4 &

This is required in order to launch a web browser for using the Atricore Console and example web application.

### Set up the JOSSO server

The example identity appliance encompasses three main entities, namely an Identity Provider (IdP) and two Service Providers (SP).
The identity provider is responsible for determining the identity of users, typically through some form of
authentication, and establishing a session for them. Conversely, the two service providers will trust authentication
assertions made by the identity provider. Once authenticated, users will be able to navigate seamlessly from one
service provider to the other without having to authenticate a second time.

The identity provider is using an internal repository - more specifically an identity vault - for storing user details.
You're free to use different repository flavors such as directories and external databases. The identity provider is also
using simple username and password authentication. Alternative mechanisms, potentially stronger, may be used instead.
The identity provider is also exposing its services using SAML, therefore an external SAML service provider may be
on-boarded.

Service providers are realized as JavaEE web applications hosted on Apache Tomcat. Both are exposed as SAML service
providers, and therefore may be linked to any SAML-compliant identity provider.

#### Launch the Atricore Console

Although the JOSSO server is running, its not configured yet. The playground box is bundled with an example
configuration - known as an identity appliance - for testing web single sign-on with JavaEE applications.

In order to access the Atricore Console, open a web browser from the desktop environment of the box
and hit the following url : http://demo_josso_1.josso.dev.docker:8081/atricore-console:

![Web Browser Launch](assets/images/web-browser-launch.png)

Access using 'admin' as the username and 'atricore' as the password.

![Sign-in to the Atricore Console](assets/images/atricore-console-1.png)

#### Import and launch the demo identity appliance

Click on the 'Import' button and select the *josso-quick-start-appliance.zip* file located in the
/home/vagrant/atricore-josso-playground/demo-josso-ce-2.4.3-javaee-tomcat folder.

![Import Identity Appliance](assets/images/atricore-console-2.png)

Click on the 'Identity and Lifecycle Management' tab. Drag the imported identity appliance entry to the 'Staged' section.
Then drag it to the 'Deployed' section and start it.

![Deploy and Start the Identity Appliance](assets/images/atricore-console-4.png)

The Identity Appliance should be up and running now, and ready to serve requests.

#### Provision test user and group

Both JavaEE web applications are configured to let in only users that are part of the 'role1' group.

Therefore, in order to manage users and their entitlements, switch to the 'Account and Entitlement Management' panel.
Click on the 'Create Group' button and enter 'role1' as the group name.

![Create role1 group](assets/images/atricore-console-9.png)

Create an example user identified as 'jdoe'. Enter the user details.

![Create jdoe user](assets/images/atricore-console-5.png)

Press on the 'Groups' tab and drag the 'role1' entry to the 'Member Of' column.

![Create role1 group](assets/images/atricore-console-6.png)

Press on the 'Password' tab and fill in the password field. Make sure to remember it as you'll need it to access the
configured applications.

![Set password](assets/images/atricore-console-7.png)

## Test it

The first usage scenario we're going to test is successfully accessing a protected resource on the first JavaEE application by
authenticating with the identity provider using a unique identifier.
The second use-case encompasses accessing a protected resource within the second JavaEE application without having to
re-authenticate. This is typically known as single sign-on (SSO).

Make sure to use the Firefox browser from within the virtual machine hosting the JOSSO playground.

### Protected resource access using unique user identifier

Open the following URL in the browser: (http://demo_tomcat1_1.josso.dev.docker:8080/partnerapp/protected) .

You should be redirected to the identity provider for authenticating. Enter the username and password for the user
you've provisioned earlier identified as 'jdoe'.

You should be able to access the protected resource and view the details of the user.

![Partner application one access](assets/images/atricore-console-11.png)

### Single sign-on

Open the following URL in the browser : (http://demo_tomcat2_1.josso.dev.docker:8080/partnerapp/protected) .

You should be redirected to the identity provider and then be able to access the protected resource without
authenticating a second time.

![Partner application two access](assets/images/atricore-console-10.png)


text:
title: Unleashing the Wisdom Wall
author: Adam
layout: post
date:   2015-06-19 13:25:25
permalink: /2015/06/unleashing-the-wisdom-wall/
image: /uploads/2015/06/walladvice.jpg
tags:
categories: PR Pubs
---
I've spent the last couple of days gearing up for the first ever summer version of the [PR Pubs][9] which is slated to start on June 29th. At [et4online][2] this year I attended a session titled [How and Why to Humanize Your Online Class][3] that was lead by [Michelle Pacansky-Brock][4], [Jill Leafstedt][5], and [Kristi O'Niel][6]. I arrived at the conference the day of and thus I wasn't able to get the full "Humanize" experience, but I did get to see a portion that was led by Kristi, who also happens to be a fellow Pepperdine Wave (Go Waves! :ocean:), where she walked us through an idea that she and her team has implemented for a chemistry course at CSU Channel Islands. It's what Michelle [has dubbed][10] a "Wisdom Wall" and is a strategy to have students share what they wish they would have known at the beginning of the course with the next set of students.

Here's an example titled "Words of Wisdom From Survivors of Chem 121":

Michelle has also written about [VoiceThread][8] as a potential asynchronous tool that can be used for online courses.

Given that I was a little under the gun and the semester was winding down, I decided that I would throw up a simple Google Form for students to fill out the second to last week of class with little advice tidbits for future Pubsters.

And to be totally honest, I sort of forgot that I had even done this until after the course had already ended. But its a fascinating perspective to get on your course. The students' advice ranges from very practical strategies to long, quasi-personal letters about what the PR Pubs experience can become if you are willing to do a some self-examination, give up a little bit of your ego, and come along in the journey.

It also helped me fully realize the emotional investment that goes into a course focused around the creative process. It requires students to acknowledge this place inside of them that they might have been ignoring for sometime. A colleague, [John Stewart][7], and me were recently discussing the euphoric feeling you get when you've been tinkering with code for a few hours and you finally discover that single line that makes it function. Or when you can step back from a piece of art and say "It is finished." Or when you can take what you did and yell at the closest person "Come here!" to show them that piece of furniture that you built, and then you gently nudge them into the recently stained seat so they can be a benefactor of the work that was inherently designed to be shared.

I think the wisdom wall helps students articulate what this little mini life experience we dub a course,whether it reached them personally or not, was like for them, and it gives them an audience that is willing to listen. Below I've embedded a few of my favorites but the students will have access to [all of them][12] on the [PR Pubs wiki][11]. Some student quotes:

###On getting started

>Start. Just start somewhere. There is a creative element involved in so much of the course, that it is easy to feel stumped before you even begin. Oftentimes I would focus on what my final layout would look like without enjoying the process-- I can't tell you how harmful this was to my design. Through the process, you WILL ultimately shift the screenshot in your head so I recommend you hold a loose visual of what you're expecting it to look like; this way, you can reenergize yourself and your vision as you go step by step. Your finalized project will be better than expected.

###On tinkering

>Dear Future PR Pubs Experimenters,
>
When I came into this class, I didn't know what to expect. The only photoshop experience I had was one time I put D. Bo's head on a Batman body. I couldn't even figure how to create an InDesign document.
>
But that all changed.
>
I'm here to tell you that your greatest asset in this class is the time you spend inside the programs. It's amazing how much you can learn by trial and error with design projects. Trust me, there's a whole lot of trial and a whole lot of error.
>
It's gets better.
>
I am asking you to tinker, to fiddle, to experiment, to delete and start over. Because, and thank goodness, when you finally get it right, you know it. You know that your design will achieve its objectives. And that feeling is amazing. To know that you have created something out of nothing and that it is good - that is when all of your time invested becomes worth it.
>
So all in all, put in the time, reap the rewards.
>
Happy experimenting!

###On trying and failing

>Try and fail, try and fail, improvise, and try again. As much as you may think you can't master a project or a program, a little hard work will definitely help you succeed. Good luck, and video tutorials are your friend!

###Acknowledging when to cut loose an idea

>If an idea isn't working, it's okay to abandon that idea and start fresh with something new! Just play around until you find something you like. Designing is a process, you never know where it can take you. So just let ideas flow!

###On overcoming yourself

>You're going to be pissed, but let yourself be pissed and cry and stay up all night trying to learn these programs in the beginning. Trust me, coming from someone who can't even figure out how to do fancy things in a Word document, I learned so incredibly much and have survived the class. Not to mention I'm now comfortable doing work in in-Design. Let yourself get pissed, and struggle. But don't stop striving to be better and let your creative juices flow. You'll be proud in the end. Enjoy!

Cover photo is a [flickr photo][1] by Diorama Sky  shared under a Creative Commons (BY-NC-ND) license

[1]: http://flickr.com/photos/diorama_sky/4604014351
[2]: http://olc.onlinelearningconsortium.org/conference/2015/et4online/welcome
[3]: http://olc.onlinelearningconsortium.org/conference/2015/et4online/how-and-why-humanize-your-online-class
[4]: https://twitter.com/brocansky
[5]: https://twitter.com/JLeafstedt
[6]: https://twitter.com/Kristi_ONeil
[7]: https://twitter.com/jstew511
[8]: https://voicethread.com
[9]: http://prpubs.us
[10]: http://www.teachingwithoutwalls.com/2013/10/believing-in-students-what-technology.html
[11]: http://prpubs.us/wiki/Main_Page
[12]: http://prpubs.us/wiki/Wisdom_from_Former_PR_Pubs_Students


text:
import petl as etl
from datetime import datetime
print("PULSE DATA")
pulse_tab = (
    etl
    .fromcsv('measurements.csv')
    .convert('value', float)
    .convert('value', int)
    .convert('timestamp', int)
    .convert('timestamp', lambda t: datetime.fromtimestamp(int(t/1000.0)))
)
print(pulse_tab.lookall())

print("PANAMA DATA")
src_tab = (
    etl
    .fromjson('monitor.json', header=['timestamp', 'metric', 'source', 'measure'])
    .convert('timestamp', lambda t: datetime.fromtimestamp(int(t/1000.0)))
    .select('source', lambda v: v == 'panama-scheduler')
    .rename('measure', 'value')
)
print(src_tab.lookall())


text:
.yui3-treeview {
    list-style:none;
    zoom: 1;
}
.yui3-treeview-content {
    padding: 2px 5px;
}
.yui3-treeview:focus {
    outline:none;
}
.yui3-treenode-content{
    margin-left: 20px;
    font-style: italic;
}

.yui3-treenode-content-toggle {
    /* color: #d4d4d4; */
    font-size: 14px;
    padding-right: 6px;
    cursor:pointer;
    display: inline-block;
    width: 14px;
}

.yui3-treenode-content-toggle:before {
    content: "▼";
    color: #ccc;
}

.yui3-treenode-collapsed .yui3-treenode-content-toggle:before {
    content: "►";
    color: #ccc;
}

.yui3-treenode-content-toggle:hover:before,
.yui3-treenode-collapsed .yui3-treenode-content-toggle:hover:before {
    color: #4E525E;
}

.yui3-treenode-content-icon,
.yui3-treeleaf-content-icon {
    display:inline-block;
    /* width:21px; */
    height: 18px;
    min-width: 16px;
    margin-top: -5px;
    margin-right: 8px;
    /* padding-right: 8px; */
}
.yui3-treeleaf-content-icon {
    /* margin: -4px 0 -6px; */
}

.yui3-treeleaf-default-icon,
.yui3-treenode-default-icon{
    margin: -6px 8px -8px 0px;
    height: 24px;
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.yui3-treeleaf-default-icon:before{
    content: "\f016";
}

.yui3-treenode-default-icon:before{
    content: "\f07c";
    /*content: "\f115";*/
}

.yui3-treenode-collapsed .yui3-treenode-default-icon:before {
    /*content: "\f114";*/
    content: "\f07b";
}

.yui3-treenode-loading > div > .yui3-treenode-content-icon,
.yui3-treenode-loading > div > .yui3-treeleaf-content-icon{
    background-image: url(../../wegas-app/images/loading-small.gif) !important;
    background-repeat: no-repeat !important;
    background-position: bottom left !important;
}
/*.yui3-treeleaf-default-icon {
    background-image: url(../../wegas-app/images/wegas-app-sprite.png);
    background-position: 0px -1290px;
    text-decoration: none;
}*/
.yui3-treenode-collapsed ul > li > .content-header,
.yui3-treenode-collapsed ul > li > div > .content-header{
    max-height: 0px !important;
    padding-top: 0px!important;
    padding-bottom: 0px !important;
    overflow: hidden;
    *display:none;
}
.yui3-treenode-content-rightwidget,
.yui3-treeleaf-content-rightwidget{
    position: absolute;
    right:5px;
    top: 0;
}
.yui3-treenode-content-header,
.yui3-treeleaf-content-header {
    position: relative;
    padding: 5px 27px 6px 2px;
    white-space: nowrap;
    font-style: normal;
    max-height: 50px;
    overflow: hidden;
}
.yui3-treenode-content-header:not(.no-transition),
.yui3-treeleaf-content-header:not(.no-transition) {
    transition: max-height 0.15s, padding 0.15s;
    -o-transition: max-height 0.15s, padding 0.15s;
    -moz-transition: max-height 0.15s, padding 0.15s;
    -ms-transition: max-height 0.15s, padding 0.15s;
    -webkit-transition: max-height 0.15s, padding 0.15s;
}
.yui3-treenode-content-header .yui3-treenode-content-header,
.yui3-treeleaf-content-header .yui3-treeleaf-content-header {
    padding: 3px 27px 3px 2px;
}
.yui3-treenode-content-header > .yui3-treenode-content-rightwidget,
.yui3-treeleaf-content-header > .yui3-treeleaf-content-rightwidget{
    opacity:0;
    /*    transition: opacity 0.1s linear 0.1s;
        -o-transition: opacity 0.1s linear 0.1s;
        -moz-transition: opacity 0.1s linear 0.1s;
        -ms-transition: opacity 0.1s linear 0.1s;
        -webkit-transition: opacity 0.1s linear 0.1s;*/
}
.yui3-treenode-content-header:hover > .yui3-treenode-content-rightwidget,
.yui3-treeleaf-content-header:hover > .yui3-treeleaf-content-rightwidget
/*.selected > .yui3-treenode-content-header > .yui3-treenode-content-rightwidget,
.selected > div > .yui3-treeleaf-content-header > .yui3-treeleaf-content-rightwidget */
{
    opacity:1;
    /*    transition: opacity 0.1s linear 0.05s;
        -o-transition: opacity 0.1s linear 0.05s;
        -moz-transition: opacity 0.1s linear 0.05s;
        -ms-transition: opacity 0.1s linear 0.05s;
        -webkit-transition: opacity 0.1s linear 0.05s;*/
}
.yui3-treenode-content-label,
.yui3-treeleaf-content-label{
    display:inline-block;
    vertical-align: text-top;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
    color: black;
}
.yui3-treeview [contenteditable="true"]{
    display: inline-block;
    min-width: 40px;
    cursor: text !important;
}
.yui3-treeview [contenteditable="true"]:focus{
}

/* EFFECT */
.yui3-treenode-content-header:hover,
.yui3-treeleaf-content-header:hover{
    background-color:#F9F9F9;
    box-shadow: 0px 0px 1px #6D6D6D;
}
.yui3-treeview-visible-right .yui3-treenode-content-rightwidget,
.yui3-treeview-visible-right .yui3-treeleaf-content-rightwidget{
    opacity: 1;
}
.selected > div > .yui3-treeleaf-content-header,
.selected > .yui3-treenode-content-header,
.yui3-treeview-multiselect .sub-fully-selected > .yui3-treenode-content-header {
    background-color: #A7CEF6;
}

.wegas-editor-variabletreeview .selected .yui3-treenode-content-icon,
.wegas-editor-variabletreeview .selected .yui3-treeleaf-content-icon {
    color: #4E525E;
}

/* Sub-items of selected items: */
.wegas-editor-variabletreeview .selected .yui3-treenode .yui3-treenode-content-icon,
.wegas-editor-variabletreeview .selected .yui3-treeleaf .yui3-treeleaf-content-icon {
    color: #4E525E;
}

.yui3-treeview-multiselect .sub-partially-selected > .yui3-treenode-content-header{
    background-color: transparent;
    box-shadow: 0px 0px 1px #6D6D6D;
    font-weight: bolder;
}
.yui3-treeview-empty-msg{
    width: 100%;
    text-align: center;
    font-style: italic;
    color: #a0a0a0;
    padding-top: 2em;
}
.yui3-treenode>ul:empty::before{
    content: "empty";
    font-style: italic;
    color: #a0a0a0;
}
.yui3-treeview>ul:empty::before{
    display: block;
    text-align: center;
}
.yui3-treenode-collapsed ul:empty::before,
.yui3-treeview-content .filter-no-match ul:empty::before {
    content: "";
}
/** FILTER **/
.yui3-treeview-content .filter-sub-match > .content-header,
.yui3-treeview-content .filter-match .filter-no-match > .content-header,
.yui3-treeview-content .filter-match .filter-no-match > div > .content-header{
    max-height: 50px;
    padding: 5px 27px 6px 2px;
    /* opacity: .6; */
}
.yui3-treeview-content .filter-match > .content-header,
.yui3-treeview-content .filter-match > div > .content-header{
    opacity: 1;
    /*background: rgba(0, 70, 139, 0.06);*/
}
.yui3-treeview-content .filter-no-match > .content-header,
.yui3-treeview-content .filter-no-match > div > .content-header{
    padding-top:0;
    padding-bottom: 0;
    max-height: 0;
}
.yui3-treeview-content .yui3-sortable-widget {
    opacity: 0.5;
    border: dashed 1px grey;
    position: relative;
}
/* Layer to prevent element click.
mousedown / mouseup on different targets */
.yui3-treeview-content .yui3-sortable-widget:before{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://www.92php.net" versionCode="0.6">
	<application setting="false">
		<name><![CDATA[知乎答题王创业融资小程序]]></name>
		<identifie><![CDATA[hc_answer]]></identifie>
		<version><![CDATA[2.1.6]]></version>
		<type><![CDATA[services]]></type>
		<ability><![CDATA[答题风暴]]></ability>
		<description><![CDATA[答题风暴]]></description>
		<author><![CDATA[微小白17817812]]></author>
		<url><![CDATA[]]></url>
	</application>
	<platform>
		<subscribes>
		</subscribes>
		<handles>
		</handles>
		<rule embed="false" />
		<card embed="false" />
		<supports>
			<item type="wxapp" />
		</supports>
	</platform>
	<bindings>
		<menu>
			<entry title="管理后台" do="home" state="" direct="false" />
		</menu>
	</bindings>
	<install><![CDATA[CREATE TABLE IF NOT EXISTS `ims_hc_ad` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `appid` varchar(50) NOT NULL,
  `path` varchar(200) NOT NULL,
  `desc` varchar(200) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_bonus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `sid` int(11) NOT NULL,
  `money` decimal(10,2) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `addtime` char(10) NOT NULL,
  `dealtime` char(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `openid` varchar(50) NOT NULL,
  `realname` varchar(20) NOT NULL,
  `mobile` varchar(11) NOT NULL,
  `province` varchar(30) NOT NULL,
  `city` varchar(30) NOT NULL,
  `area` varchar(30) NOT NULL,
  `address` varchar(300) NOT NULL,
  `isdefault` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `deleted` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_adv` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `advname` varchar(50) DEFAULT '',
  `link` varchar(255) DEFAULT '',
  `thumb` varchar(255) DEFAULT '',
  `displayorder` int(11) DEFAULT '0',
  `enabled` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `indx_weid` (`weid`),
  KEY `indx_enabled` (`enabled`),
  KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_bi` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `mid` int(10) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT NULL,
  `headimg` varchar(255) DEFAULT NULL,
  `bi` decimal(10,2) DEFAULT NULL,
  `createtime` varchar(255) DEFAULT NULL,
  `updatetime` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_bi_log` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `bid` int(10) DEFAULT NULL,
  `mid` int(10) DEFAULT NULL,
  `bi` int(10) DEFAULT NULL,
  `type` tinyint(1) DEFAULT NULL COMMENT '2表示人民币购买,3表示积分兑换',
  `createtime` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_cart` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `goodsid` int(11) NOT NULL,
  `goodstype` tinyint(1) NOT NULL DEFAULT '1',
  `from_user` varchar(50) NOT NULL,
  `total` int(10) unsigned NOT NULL,
  `optionid` int(10) DEFAULT '0',
  `marketprice` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `idx_openid` (`from_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `name` varchar(50) NOT NULL COMMENT '分类名称',
  `thumb` varchar(255) NOT NULL COMMENT '分类图片',
  `parentid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID,0为第一级',
  `isrecommand` int(10) DEFAULT '0',
  `description` varchar(500) NOT NULL COMMENT '分类介绍',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否开启',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_dispatch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `dispatchname` varchar(50) DEFAULT '',
  `dispatchtype` int(11) DEFAULT '0',
  `displayorder` int(11) DEFAULT '0',
  `firstprice` decimal(10,2) DEFAULT '0.00',
  `secondprice` decimal(10,2) DEFAULT '0.00',
  `firstweight` int(11) DEFAULT '0',
  `secondweight` int(11) DEFAULT '0',
  `express` int(11) DEFAULT '0',
  `description` text,
  PRIMARY KEY (`id`),
  KEY `indx_weid` (`weid`),
  KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_feedback` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `openid` varchar(50) NOT NULL,
  `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1为维权,2为告擎',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态0未解决,1用户同意,2用户拒绝',
  `feedbackid` varchar(30) NOT NULL COMMENT '投诉单号',
  `transid` varchar(30) NOT NULL COMMENT '订单号',
  `reason` varchar(1000) NOT NULL COMMENT '理由',
  `solution` varchar(1000) NOT NULL COMMENT '期待解决方案',
  `remark` varchar(1000) NOT NULL COMMENT '备注',
  `createtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_weid` (`weid`),
  KEY `idx_feedbackid` (`feedbackid`),
  KEY `idx_createtime` (`createtime`),
  KEY `idx_transid` (`transid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `pcate` int(10) unsigned NOT NULL DEFAULT '0',
  `ccate` int(10) unsigned NOT NULL DEFAULT '0',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1为实体,2为虚拟',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `displayorder` int(10) unsigned NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL DEFAULT '',
  `thumb` varchar(255) DEFAULT '',
  `unit` varchar(5) NOT NULL DEFAULT '',
  `description` varchar(1000) NOT NULL DEFAULT '',
  `content` text NOT NULL,
  `goodssn` varchar(50) NOT NULL DEFAULT '',
  `productsn` varchar(50) NOT NULL DEFAULT '',
  `marketprice` decimal(10,2) NOT NULL DEFAULT '0.00',
  `productprice` decimal(10,2) NOT NULL DEFAULT '0.00',
  `costprice` decimal(10,2) NOT NULL DEFAULT '0.00',
  `originalprice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
  `total` int(10) NOT NULL DEFAULT '0',
  `totalcnf` int(11) DEFAULT '0' COMMENT '0 拍下减库存 1 付款减库存 2 永久不减',
  `sales` int(10) unsigned NOT NULL DEFAULT '0',
  `spec` varchar(5000) NOT NULL,
  `createtime` int(10) unsigned NOT NULL,
  `weight` decimal(10,2) NOT NULL DEFAULT '0.00',
  `credit` int(11) DEFAULT '0',
  `maxbuy` int(11) DEFAULT '0',
  `hasoption` int(11) DEFAULT '0',
  `dispatch` int(11) DEFAULT '0',
  `thumb_url` text,
  `isnew` int(11) DEFAULT '0',
  `ishot` int(11) DEFAULT '0',
  `isdiscount` int(11) DEFAULT '0',
  `isrecommand` int(11) DEFAULT '0',
  `istime` int(11) DEFAULT '0',
  `timestart` int(11) DEFAULT '0',
  `timeend` int(11) DEFAULT '0',
  `viewcount` int(11) DEFAULT '0',
  `deleted` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `stock_total` int(10) DEFAULT NULL COMMENT '库存总量',
  `ticket_total` int(10) DEFAULT '0' COMMENT '已购买的商品数量',
  `goods_status` tinyint(1) DEFAULT '0' COMMENT '当已购买商品数量等于库存数量时为1,否则为0',
  `ticket` varchar(255) DEFAULT NULL,
  `ticket_time` varchar(20) DEFAULT NULL,
  `ticket_nickname` varchar(255) DEFAULT NULL,
  `usermaxbuy` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_goods_option` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `goodsid` int(10) DEFAULT '0',
  `title` varchar(50) DEFAULT '',
  `thumb` varchar(60) DEFAULT '',
  `productprice` decimal(10,2) DEFAULT '0.00',
  `marketprice` decimal(10,2) DEFAULT '0.00',
  `costprice` decimal(10,2) DEFAULT '0.00',
  `stock` int(11) DEFAULT '0',
  `weight` decimal(10,2) DEFAULT '0.00',
  `displayorder` int(11) DEFAULT '0',
  `specs` text,
  PRIMARY KEY (`id`),
  KEY `indx_goodsid` (`goodsid`),
  KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_goods_param` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `goodsid` int(10) DEFAULT '0',
  `title` varchar(50) DEFAULT '',
  `value` text,
  `displayorder` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `indx_goodsid` (`goodsid`),
  KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_member` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT NULL,
  `headimg` varchar(255) DEFAULT NULL,
  `createtime` varchar(255) DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `ordersn` varchar(20) NOT NULL,
  `price` varchar(10) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '-1取消状态,0普通状态,1为已付款,2为已发货,3为成功',
  `sendtype` tinyint(1) unsigned NOT NULL COMMENT '1为快递,2为自提',
  `paytype` tinyint(1) unsigned NOT NULL COMMENT '1为余额,2为在线,3为到付',
  `transid` varchar(30) NOT NULL DEFAULT '0' COMMENT '微信支付单号',
  `goodstype` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `remark` varchar(1000) NOT NULL DEFAULT '',
  `addressid` int(10) unsigned NOT NULL,
  `expresscom` varchar(30) NOT NULL DEFAULT '',
  `expresssn` varchar(50) NOT NULL DEFAULT '',
  `express` varchar(200) NOT NULL DEFAULT '',
  `goodsprice` decimal(10,2) DEFAULT '0.00',
  `dispatchprice` decimal(10,2) DEFAULT '0.00',
  `dispatch` int(10) DEFAULT '0',
  `createtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_order_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `orderid` int(10) unsigned NOT NULL,
  `goodsid` int(10) unsigned NOT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `total` int(10) unsigned NOT NULL DEFAULT '1',
  `optionid` int(10) DEFAULT '0',
  `createtime` int(10) unsigned NOT NULL,
  `optionname` text,
  `from_user` varchar(255) DEFAULT NULL,
  `goods_name` varchar(255) DEFAULT NULL,
  `goods_img` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_product` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `goodsid` int(11) NOT NULL,
  `productsn` varchar(50) NOT NULL,
  `title` varchar(1000) NOT NULL,
  `marketprice` decimal(10,0) unsigned NOT NULL,
  `productprice` decimal(10,0) unsigned NOT NULL,
  `total` int(11) NOT NULL,
  `status` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `spec` varchar(5000) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_goodsid` (`goodsid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_shai` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) DEFAULT NULL,
  `goodsid` int(10) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `content` text,
  `img` varchar(255) DEFAULT NULL,
  `createtime` varchar(20) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `img1` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_spec` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `title` varchar(50) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `displaytype` tinyint(3) unsigned NOT NULL,
  `content` text NOT NULL,
  `goodsid` int(11) DEFAULT '0',
  `displayorder` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_spec_item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `specid` int(11) DEFAULT '0',
  `title` varchar(255) DEFAULT '',
  `thumb` varchar(255) DEFAULT '',
  `show` int(11) DEFAULT '0',
  `displayorder` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `indx_weid` (`weid`),
  KEY `indx_specid` (`specid`),
  KEY `indx_show` (`show`),
  KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_credit_shopping_ticket` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `memberid` int(10) DEFAULT NULL,
  `createtime` varchar(255) DEFAULT NULL,
  `orderid` int(10) DEFAULT NULL,
  `goodsid` varchar(255) DEFAULT NULL,
  `ticket` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_dan` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `dan_id` int(11) NOT NULL,
  `season` tinyint(3) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `thumb` varchar(100) DEFAULT NULL,
  `win_star` tinyint(3) DEFAULT '0',
  `use_gold` int(11) DEFAULT '0',
  `win_gold` int(11) DEFAULT '0',
  `quesids` text NOT NULL,
  `reward` int(11) NOT NULL DEFAULT '0',
  `winexp` int(11) NOT NULL,
  `failexp` int(11) NOT NULL,
  `rewardnum` tinyint(3) NOT NULL DEFAULT '0',
  `border` varchar(200) NOT NULL,
  `createtime` char(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_formid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `formid` varchar(50) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_grade` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `levelno` int(11) NOT NULL,
  `levelname` varchar(20) NOT NULL,
  `levelexp` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_highguess_images` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `wid` int(10) unsigned NOT NULL COMMENT '词条ID',
  `rid` int(10) unsigned NOT NULL,
  `mid` int(10) unsigned NOT NULL COMMENT '会员ID',
  `image` varchar(255) DEFAULT NULL,
  `createtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_highguess_member` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `rid` int(10) unsigned NOT NULL,
  `from_user` varchar(50) DEFAULT NULL,
  `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `avatar` varchar(255) DEFAULT NULL,
  `realname` varchar(50) NOT NULL DEFAULT '',
  `createtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_highguess_reply` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `cover` varchar(255) DEFAULT NULL,
  `description` text,
  `sharetitle` varchar(255) DEFAULT NULL,
  `sharecover` varchar(255) DEFAULT NULL,
  `sharedescription` text,
  `gzurl` varchar(255) DEFAULT NULL,
  `level` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_highguess_selectlog` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `wid` int(10) unsigned NOT NULL,
  `imgid` int(10) unsigned NOT NULL,
  `from_user` varchar(50) DEFAULT NULL,
  `realname` varchar(50) NOT NULL DEFAULT '',
  `image` varchar(255) DEFAULT NULL,
  `word` varchar(20) DEFAULT NULL,
  `createtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_highguess_words` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `word` varchar(20) DEFAULT NULL,
  `words` varchar(100) DEFAULT NULL,
  `createtime` int(10) unsigned NOT NULL,
  `isopen` tinyint(1) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `uid` int(11) DEFAULT '0',
  `pid` int(11) DEFAULT '0',
  `ordersn` varchar(30) DEFAULT '',
  `formId` varchar(50) DEFAULT '',
  `fee` decimal(11,2) NOT NULL,
  `status` tinyint(1) DEFAULT '0',
  `paystatus` tinyint(1) NOT NULL DEFAULT '0',
  `paytime` char(10) NOT NULL,
  `transid` varchar(50) DEFAULT '',
  `createtime` int(10) DEFAULT '0',
  `package` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_pk_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `rid` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `usegold` int(11) NOT NULL,
  `score` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `expe` int(11) NOT NULL,
  `scoreplus` int(11) NOT NULL,
  `goldplus` int(11) NOT NULL,
  `expeplus` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_pk_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `rid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `qid` int(11) NOT NULL,
  `answer` char(1) NOT NULL,
  `plus` int(5) DEFAULT '0',
  `score` int(5) DEFAULT '0',
  `min` int(11) NOT NULL,
  `right` tinyint(1) NOT NULL DEFAULT '0',
  `addtime` char(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_pk_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `dan` int(11) NOT NULL,
  `userid_one` int(11) DEFAULT NULL,
  `userid_two` int(11) DEFAULT NULL,
  `userone_score` int(11) DEFAULT '0',
  `usertwo_score` int(11) DEFAULT '0',
  `questions` text NOT NULL,
  `status1` tinyint(1) NOT NULL DEFAULT '0',
  `status2` tinyint(1) NOT NULL DEFAULT '0',
  `createtime` char(10) DEFAULT NULL,
  `type` tinyint(1) DEFAULT '0' COMMENT '1好友对战',
  `leave` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1加入2开始3离开',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_prop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `name` varchar(20) DEFAULT NULL,
  `thumb` varchar(200) DEFAULT NULL,
  `usethumb` varchar(200) NOT NULL,
  `newthumb` varchar(200) NOT NULL,
  `cc` int(4) NOT NULL DEFAULT '0',
  `sj` int(4) NOT NULL DEFAULT '0',
  `jb` int(4) NOT NULL DEFAULT '0',
  `jy` int(4) NOT NULL DEFAULT '0',
  `jf` int(11) NOT NULL,
  `give` tinyint(1) NOT NULL DEFAULT '0',
  `remark` varchar(50) NOT NULL,
  `price` decimal(11,2) DEFAULT '0.00',
  `type` tinyint(1) DEFAULT '0' COMMENT '默认普通物品',
  `shop` tinyint(1) NOT NULL DEFAULT '0',
  `dan` tinyint(1) NOT NULL,
  `randnum` tinyint(4) NOT NULL,
  `desc` varchar(200) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '50',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `type_id` int(11) DEFAULT NULL,
  `question` varchar(100) DEFAULT NULL,
  `answer_a` varchar(100) DEFAULT NULL,
  `answer_b` varchar(100) DEFAULT NULL,
  `answer_c` varchar(100) NOT NULL,
  `answer_d` varchar(100) DEFAULT NULL,
  `easy` char(1) DEFAULT NULL,
  `answer` char(1) DEFAULT NULL,
  `createtime` char(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_question_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `thumbs` varchar(100) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `pid` int(11) DEFAULT '0',
  `upgrade` text NOT NULL,
  `desc1` varchar(200) NOT NULL,
  `desc2` varchar(200) NOT NULL,
  `createtime` char(10) DEFAULT NULL,
  `sort` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_season` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `no` int(11) NOT NULL DEFAULT '1',
  `name` varchar(20) NOT NULL,
  `starttime` char(10) NOT NULL,
  `endtime` char(10) NOT NULL,
  `createtime` char(10) NOT NULL,
  `status` char(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_setting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `index` text NOT NULL,
  `basic` text NOT NULL,
  `ques` text NOT NULL,
  `follow` text NOT NULL,
  `forward` text NOT NULL,
  `notice` text NOT NULL,
  `sign` text NOT NULL,
  `tpl` text NOT NULL,
  `active` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_shenhe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `stact` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `sort` int(11) DEFAULT NULL,
  `img` varchar(255) DEFAULT NULL,
  `content` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT NULL,
  `avatar` varchar(200) DEFAULT NULL,
  `nickname` varchar(50) DEFAULT NULL,
  `openid` varchar(50) DEFAULT NULL,
  `sessionkey` varchar(50) NOT NULL,
  `gender` tinyint(1) NOT NULL,
  `province` varchar(50) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `country` varchar(50) DEFAULT NULL,
  `createtime` char(10) DEFAULT NULL,
  `status` char(1) DEFAULT '1',
  `robot` char(1) NOT NULL DEFAULT '0',
  `inans` char(1) NOT NULL DEFAULT '0',
  `border` varchar(100) NOT NULL,
  `moneycode` varchar(200) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_cate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL DEFAULT '0',
  `uid` int(11) NOT NULL DEFAULT '0',
  `tid` int(11) NOT NULL DEFAULT '0',
  `level` int(11) NOT NULL DEFAULT '0',
  `plus` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_catelog` (
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `tid` int(11) NOT NULL,
  `before` int(11) NOT NULL,
  `now` int(11) NOT NULL,
  `book` int(11) NOT NULL,
  `num` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `createtime` char(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_forward` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `openGId` varchar(30) NOT NULL,
  `createtime` char(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_friends` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `fid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_gold` (
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '0加1减',
  `source` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0答题1分享',
  `addtime` char(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_history` (
  `uid` int(11) DEFAULT '0',
  `weid` int(11) DEFAULT '0',
  `sid` int(11) NOT NULL DEFAULT '0',
  `level` tinyint(3) DEFAULT '1',
  `expe` int(11) DEFAULT '0',
  `dan` int(11) DEFAULT '1',
  `star` int(11) DEFAULT '0',
  `winrate` varchar(10) DEFAULT '0',
  `totalnum` int(11) DEFAULT '0',
  `winnum` int(11) DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) DEFAULT '0',
  `weid` int(11) DEFAULT '0',
  `sid` int(11) NOT NULL DEFAULT '0',
  `level` tinyint(3) DEFAULT '1',
  `expe` int(11) DEFAULT '0',
  `maxexpe` int(11) DEFAULT '0',
  `dan` int(11) DEFAULT '1',
  `star` int(11) DEFAULT '0',
  `gold` int(11) DEFAULT '0',
  `winrate` varchar(10) DEFAULT '0',
  `totalnum` int(11) DEFAULT '0',
  `winnum` int(11) DEFAULT '0',
  `jbtime` char(10) NOT NULL,
  `jbnum` int(11) NOT NULL,
  `jytime` char(10) NOT NULL,
  `jynum` int(11) NOT NULL,
  `jfnum` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_prop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `uid` int(11) NOT NULL,
  `pid` int(11) DEFAULT '0',
  `num` int(11) DEFAULT '0',
  `usenum` tinyint(4) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_proplog` (
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `pid` int(11) NOT NULL,
  `type` char(1) DEFAULT NULL COMMENT '1签到2充值3系统赠送4使用5开宝箱',
  `top` int(11) NOT NULL,
  `num` int(11) DEFAULT NULL,
  `createtime` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_hc_user_sign` (
  `weid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `sid` int(11) NOT NULL,
  `date` char(10) NOT NULL,
  `signtime` char(10) NOT NULL,
  `pid` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
]]></install>
	<uninstall><![CDATA[DROP TABLE IF EXISTS `ims_hc_ad`;
DROP TABLE IF EXISTS `ims_hc_bonus`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_address`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_adv`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_bi`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_bi_log`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_cart`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_category`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_dispatch`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_feedback`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_goods`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_goods_option`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_goods_param`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_member`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_order`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_order_goods`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_product`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_shai`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_spec`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_spec_item`;
DROP TABLE IF EXISTS `ims_hc_credit_shopping_ticket`;
DROP TABLE IF EXISTS `ims_hc_dan`;
DROP TABLE IF EXISTS `ims_hc_formid`;
DROP TABLE IF EXISTS `ims_hc_grade`;
DROP TABLE IF EXISTS `ims_hc_highguess_images`;
DROP TABLE IF EXISTS `ims_hc_highguess_member`;
DROP TABLE IF EXISTS `ims_hc_highguess_reply`;
DROP TABLE IF EXISTS `ims_hc_highguess_selectlog`;
DROP TABLE IF EXISTS `ims_hc_highguess_words`;
DROP TABLE IF EXISTS `ims_hc_order`;
DROP TABLE IF EXISTS `ims_hc_pk_log`;
DROP TABLE IF EXISTS `ims_hc_pk_question`;
DROP TABLE IF EXISTS `ims_hc_pk_record`;
DROP TABLE IF EXISTS `ims_hc_prop`;
DROP TABLE IF EXISTS `ims_hc_question`;
DROP TABLE IF EXISTS `ims_hc_question_type`;
DROP TABLE IF EXISTS `ims_hc_season`;
DROP TABLE IF EXISTS `ims_hc_setting`;
DROP TABLE IF EXISTS `ims_hc_shenhe`;
DROP TABLE IF EXISTS `ims_hc_user`;
DROP TABLE IF EXISTS `ims_hc_user_cate`;
DROP TABLE IF EXISTS `ims_hc_user_catelog`;
DROP TABLE IF EXISTS `ims_hc_user_forward`;
DROP TABLE IF EXISTS `ims_hc_user_friends`;
DROP TABLE IF EXISTS `ims_hc_user_gold`;
DROP TABLE IF EXISTS `ims_hc_user_history`;
DROP TABLE IF EXISTS `ims_hc_user_info`;
DROP TABLE IF EXISTS `ims_hc_user_prop`;
DROP TABLE IF EXISTS `ims_hc_user_proplog`;
DROP TABLE IF EXISTS `ims_hc_user_sign`;
]]></uninstall>
	<upgrade><![CDATA[upgrade.php]]></upgrade>
</manifest>


text:
import Collection from '../src/scripts/models/collection.js';

describe('collection', function () {

  function DummyItem(args) {
    this.foo = args.foo;
  }
  DummyItem.prototype.serialize = function () {
    return { foo: this.foo };
  };

  it('should initialize with list of items', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }]
    });
    expect(collection).toHaveProperty('items');
    expect(collection.items).toHaveLength(2);
    collection.items.forEach(function (item) {
      expect(item).toBeInstanceOf(DummyItem);
    });
  });

  it('should serialize to a JSON object', function () {
    let serializedCollection = { items: [{ foo: 'abc' }, { foo: 'xyz' }] };
    let collection = new Collection({
        SubCollectionItem: DummyItem,
        items: serializedCollection.items
    });
    expect(collection.serialize()).toEqual(serializedCollection);
  });

  it('should get item by its index', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }]
    });
    expect(collection.get(0)).toHaveProperty('foo', 'abc');
    expect(collection.get(1)).toHaveProperty('foo', 'xyz');
  });

  it('should insert new item', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }]
    });
    collection.insert(1, { foo: 'def' });
    expect(collection.items).toHaveLength(3);
    expect(collection.items[1]).toHaveProperty('foo', 'def');
    expect(collection.items[1]).toBeInstanceOf(DummyItem);
  });

  it('should remove existing item', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'def' }]
    });
    collection.remove(1);
    expect(collection).toHaveLength(2);
    expect(collection.items[0]).toHaveProperty('foo', 'abc');
    expect(collection.items[1]).toHaveProperty('foo', 'def');
  });

  it('should iterate over items', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'def' }]
    });
    let iteratedItems = [];
    collection.forEach(function (item) {
      iteratedItems.push(item);
    });
    expect(iteratedItems).toEqual(collection.items);
  });

  it('should filter items', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'bef' }, { foo: 'ghi' }]
    });
    let itemsWithoutB = collection.filter(function (item) {
      return item.foo.indexOf('b') === -1;
    });
    expect(itemsWithoutB).toHaveLength(2);
    expect(itemsWithoutB[0]).toHaveProperty('foo', 'xyz');
    expect(itemsWithoutB[1]).toHaveProperty('foo', 'ghi');
  });

  it('should map items', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'def' }]
    });
    let iteratedItems = collection.map(function (item) {
      return item;
    });
    expect(iteratedItems).toEqual(collection.items);
  });

  it('should get collection length', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'def' }]
    });
    expect(collection.length).toEqual(3);
  });

  it('should set collection length', function () {
    let collection = new Collection({
      SubCollectionItem: DummyItem,
      items: [{ foo: 'abc' }, { foo: 'xyz' }, { foo: 'def' }]
    });
    collection.length = 0;
    expect(collection.length).toEqual(0);
    expect(collection.items.length).toEqual(0);
  });

});


text:
import Koa from 'koa';
import { kebabCase } from 'lodash';

/**
 * Sets the Koa Context's response to a JSON-API compliant error
 * ```
 * {
 *   status: statusCode,
 *   body: {
 *     errors: [
 *       { status: statusCode, title, detail }
 *     ]
 *   },
 *   type: 'application/vnd.api+json'
 * }
 * ```
 */
export function handleError(ctx: Koa.Context, statusCode: number, title: string, detail?: string) {
  let error: { status: string; title: string; detail?: string } = {
    status: `${statusCode}`,
    title,
  };
  if (detail) {
    error.detail = detail;
  }

  ctx.status = statusCode;
  ctx.body = {
    errors: [error],
  };
  ctx.type = 'application/vnd.api+json';
}

export interface NestedAttributeError {
  index: number;
  attribute: string;
  detail: string;
  status?: number;
}

export interface RelationshipError {
  relationship: string;
  status?: number;
  detail: string;
}

export function serializeErrors(errors: any) {
  return Object.keys(errors).flatMap((attribute) => {
    let errorsForAttribute = errors[attribute];
    return errorsForAttribute.map((error: string | NestedAttributeError | RelationshipError) => {
      if (typeof error === 'string') {
        return {
          status: '422',
          title: 'Invalid attribute',
          source: { pointer: `/data/attributes/${kebabCase(attribute)}` },
          detail: error,
        };
      } else if (errorIsNestedAttributeError(error)) {
        return {
          status: `${error.status || '422'}`,
          title: 'Invalid attribute',
          source: {
            pointer: `/data/attributes/${kebabCase(attribute)}/${error.index}/${kebabCase(error.attribute)}`,
          },
          detail: error.detail,
        };
      } else {
        return {
          status: `${error.status || '422'}`,
          title: 'Invalid relationship',
          source: {
            pointer: `/data/relationships/${kebabCase(attribute)}`,
          },
          detail: error.detail,
        };
      }
    });
  });
}

function errorIsNestedAttributeError(error: any): error is NestedAttributeError {
  if ((error as NestedAttributeError).attribute) {
    return true;
  }

  return false;
}


text:
using System;

namespace Microsoft.DirectX.Direct3D
{
	public enum CallbackSearchFlags
	{
		BehindInitialPosition = 2,
		ExcludingInitialPosition = 1
	}
}