text:
package de.felixbruns.jotify.api.media;

import java.util.zip.Adler32;

import de.felixbruns.jotify.api.util.Hex;

/**
 * Subclass of {@link Adler32}, supplying methods to calculate
 * a checksum of different media objects.
 *
 * @author Felix Bruns <felixbruns@web.de>
 */
public class Checksum extends Adler32 {
	/**
	 * Update the checksum with a {@link Playlist}.
	 *
	 * @param playlist A {@link Playlist} object.
	 */
	public void update(Playlist playlist){
		this.update(Hex.toBytes(playlist.getId()));
		this.update((byte)0x02);
	}

	/**
	 * Update the checksum with a {@link Track}.
	 *
	 * @param track A {@link Track} object.
	 */
	public void update(Track track){
		this.update(Hex.toBytes(track.getId()));
		this.update((byte)0x01);
	}
}


text:
package services // import "google.golang.org/genproto/googleapis/ads/googleads/v0/services"

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import resources "google.golang.org/genproto/googleapis/ads/googleads/v0/resources"
import _ "google.golang.org/genproto/googleapis/api/annotations"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Request message for [CustomerClientLinkService.GetCustomerClientLink][google.ads.googleads.v0.services.CustomerClientLinkService.GetCustomerClientLink].
type GetCustomerClientLinkRequest struct {
	// The resource name of the customer client link to fetch.
	ResourceName         string   `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetCustomerClientLinkRequest) Reset()         { *m = GetCustomerClientLinkRequest{} }
func (m *GetCustomerClientLinkRequest) String() string { return proto.CompactTextString(m) }
func (*GetCustomerClientLinkRequest) ProtoMessage()    {}
func (*GetCustomerClientLinkRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_customer_client_link_service_9bdafa43d925b47f, []int{0}
}
func (m *GetCustomerClientLinkRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetCustomerClientLinkRequest.Unmarshal(m, b)
}
func (m *GetCustomerClientLinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetCustomerClientLinkRequest.Marshal(b, m, deterministic)
}
func (dst *GetCustomerClientLinkRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetCustomerClientLinkRequest.Merge(dst, src)
}
func (m *GetCustomerClientLinkRequest) XXX_Size() int {
	return xxx_messageInfo_GetCustomerClientLinkRequest.Size(m)
}
func (m *GetCustomerClientLinkRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetCustomerClientLinkRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetCustomerClientLinkRequest proto.InternalMessageInfo

func (m *GetCustomerClientLinkRequest) GetResourceName() string {
	if m != nil {
		return m.ResourceName
	}
	return ""
}

func init() {
	proto.RegisterType((*GetCustomerClientLinkRequest)(nil), "google.ads.googleads.v0.services.GetCustomerClientLinkRequest")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// CustomerClientLinkServiceClient is the client API for CustomerClientLinkService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type CustomerClientLinkServiceClient interface {
	// Returns the requested CustomerClientLink in full detail.
	GetCustomerClientLink(ctx context.Context, in *GetCustomerClientLinkRequest, opts ...grpc.CallOption) (*resources.CustomerClientLink, error)
}

type customerClientLinkServiceClient struct {
	cc *grpc.ClientConn
}

func NewCustomerClientLinkServiceClient(cc *grpc.ClientConn) CustomerClientLinkServiceClient {
	return &customerClientLinkServiceClient{cc}
}

func (c *customerClientLinkServiceClient) GetCustomerClientLink(ctx context.Context, in *GetCustomerClientLinkRequest, opts ...grpc.CallOption) (*resources.CustomerClientLink, error) {
	out := new(resources.CustomerClientLink)
	err := c.cc.Invoke(ctx, "/google.ads.googleads.v0.services.CustomerClientLinkService/GetCustomerClientLink", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CustomerClientLinkServiceServer is the server API for CustomerClientLinkService service.
type CustomerClientLinkServiceServer interface {
	// Returns the requested CustomerClientLink in full detail.
	GetCustomerClientLink(context.Context, *GetCustomerClientLinkRequest) (*resources.CustomerClientLink, error)
}

func RegisterCustomerClientLinkServiceServer(s *grpc.Server, srv CustomerClientLinkServiceServer) {
	s.RegisterService(&_CustomerClientLinkService_serviceDesc, srv)
}

func _CustomerClientLinkService_GetCustomerClientLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetCustomerClientLinkRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CustomerClientLinkServiceServer).GetCustomerClientLink(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/google.ads.googleads.v0.services.CustomerClientLinkService/GetCustomerClientLink",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CustomerClientLinkServiceServer).GetCustomerClientLink(ctx, req.(*GetCustomerClientLinkRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _CustomerClientLinkService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.ads.googleads.v0.services.CustomerClientLinkService",
	HandlerType: (*CustomerClientLinkServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCustomerClientLink",
			Handler:    _CustomerClientLinkService_GetCustomerClientLink_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/ads/googleads/v0/services/customer_client_link_service.proto",
}

func init() {
	proto.RegisterFile("google/ads/googleads/v0/services/customer_client_link_service.proto", fileDescriptor_customer_client_link_service_9bdafa43d925b47f)
}

var fileDescriptor_customer_client_link_service_9bdafa43d925b47f = []byte{
	// 349 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xbf, 0x4a, 0xc3, 0x40,
	0x18, 0x27, 0x15, 0x04, 0x83, 0x2e, 0x01, 0x41, 0x4b, 0x91, 0x52, 0x1d, 0xa4, 0xc3, 0x5d, 0x50,
	0x8a, 0x83, 0x56, 0x48, 0x33, 0xd4, 0x41, 0xa4, 0x54, 0xe8, 0x20, 0x81, 0x70, 0x26, 0x47, 0x38,
	0x9a, 0xdc, 0xd5, 0xfb, 0xae, 0x5d, 0xc4, 0xc5, 0x57, 0xf0, 0x0d, 0x1c, 0x7d, 0x14, 0xc1, 0xc9,
	0xdd, 0xc9, 0xcd, 0x97, 0x90, 0xe4, 0x72, 0x11, 0xa9, 0xb1, 0xdb, 0x8f, 0xdc, 0xf7, 0xfb, 0xf3,
	0xfd, 0xbe, 0xd8, 0x7e, 0x22, 0x44, 0x92, 0x52, 0x4c, 0x62, 0xc0, 0x1a, 0xe6, 0x68, 0xe1, 0x62,
	0xa0, 0x72, 0xc1, 0x22, 0x0a, 0x38, 0x9a, 0x83, 0x12, 0x19, 0x95, 0x61, 0x94, 0x32, 0xca, 0x55,
	0x98, 0x32, 0x3e, 0x0d, 0xcb, 0x57, 0x34, 0x93, 0x42, 0x09, 0xa7, 0xad, 0x99, 0x88, 0xc4, 0x80,
	0x2a, 0x11, 0xb4, 0x70, 0x91, 0x11, 0x69, 0x9e, 0xd5, 0xd9, 0x48, 0x0a, 0x62, 0x2e, 0xeb, 0x7c,
	0xb4, 0x7e, 0xb3, 0x65, 0xd8, 0x33, 0x86, 0x09, 0xe7, 0x42, 0x11, 0xc5, 0x04, 0x07, 0xfd, 0xda,
	0xf1, 0xed, 0xd6, 0x90, 0x2a, 0xbf, 0xa4, 0xfb, 0x05, 0xfb, 0x92, 0xf1, 0xe9, 0x98, 0xde, 0xcd,
	0x29, 0x28, 0x67, 0xdf, 0xde, 0x32, 0x2e, 0x21, 0x27, 0x19, 0xdd, 0xb1, 0xda, 0xd6, 0xe1, 0xc6,
	0x78, 0xd3, 0x7c, 0xbc, 0x22, 0x19, 0x3d, 0xfa, 0xb2, 0xec, 0xdd, 0x65, 0x89, 0x6b, 0x9d, 0xdf,
	0x79, 0xb3, 0xec, 0xed, 0x3f, 0x3d, 0x9c, 0x73, 0xb4, 0x6a, 0x77, 0xf4, 0x5f, 0xb8, 0x66, 0xaf,
	0x96, 0x5f, 0x35, 0x83, 0x96, 0xd9, 0x9d, 0xfe, 0xe3, 0xfb, 0xe7, 0x53, 0xe3, 0xc4, 0xe9, 0xe5,
	0x1d, 0xde, 0xff, 0x5a, 0xaf, 0x6f, 0x8a, 0x04, 0xdc, 0xad, 0x4a, 0xfd, 0xa1, 0x02, 0xee, 0x3e,
	0x0c, 0x3e, 0x2c, 0xfb, 0x20, 0x12, 0xd9, 0xca, 0xec, 0x83, 0xbd, 0xda, 0x4e, 0x46, 0x79, 0xf7,
	0x23, 0xeb, 0xe6, 0xa2, 0xd4, 0x48, 0x44, 0x4a, 0x78, 0x82, 0x84, 0x4c, 0x70, 0x42, 0x79, 0x71,
	0x19, 0x73, 0xe9, 0x19, 0x83, 0xfa, 0xff, 0xeb, 0xd4, 0x80, 0xe7, 0xc6, 0xda, 0xd0, 0xf3, 0x5e,
	0x1a, 0xed, 0xa1, 0x16, 0xf4, 0x62, 0x40, 0x1a, 0xe6, 0x68, 0xe2, 0xa2, 0xd2, 0x18, 0x5e, 0xcd,
	0x48, 0xe0, 0xc5, 0x10, 0x54, 0x23, 0xc1, 0xc4, 0x0d, 0xcc, 0xc8, 0xed, 0x7a, 0x11, 0xe0, 0xf8,
	0x3b, 0x00, 0x00, 0xff, 0xff, 0x53, 0x7b, 0xfc, 0x03, 0xdf, 0x02, 0x00, 0x00,
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/contentBackground"
    android:padding="@dimen/standard_margins"
    android:gravity="center"
    android:orientation="vertical">

    <TextView
        android:id="@+id/tvBrightness"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@android:color/white" />

    <SeekBar
        android:id="@+id/sbBrightness"
        style="@style/AppTheme.SeekBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/standard_margins" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/standard_margins"
        android:gravity="center"
        android:orientation="horizontal">

        <com.sandradita.lg.quick_settings.ui.views.AppButton
            android:id="@+id/appBtnBack"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:iconSrc="@drawable/ic_back"
            app:text="@string/property_title_back" />

        <com.sandradita.lg.quick_settings.ui.views.AppButton
            android:id="@+id/appBtnAutoBrightness"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:iconSrc="@drawable/ic_auto_brightness"
            app:text="@string/property_title_auto" />

    </LinearLayout>

</LinearLayout>


text:
package com.toastedbits.jacoco.test;

import static org.testng.Assert.*;

import java.sql.SQLException;

import org.testng.annotations.Test;

import com.toastedbits.jacoco.JaCoCoDemo;

public class DemoTest {
	@Test
	public void testGetConnection() throws SQLException {
		JaCoCoDemo jccd = new JaCoCoDemo();
		assertEquals(42, jccd.calculateAnswer("What is the answer to the ultimate question of life, the universe and everything?"));
	}
}


text:
package com.genesis.hamlet.ui.users;

import android.content.Context;

import com.genesis.hamlet.data.DataRepository;
import com.genesis.hamlet.data.DataSource;
import com.genesis.hamlet.data.models.user.User;
import com.genesis.hamlet.util.mvp.BasePresenter;
import com.genesis.hamlet.util.threading.MainUiThread;
import com.genesis.hamlet.util.threading.ThreadExecutor;

import java.util.List;

/**
 * The Presenter that fetches photo data by calling {@link DataRepository} at the request of
 * its View "{@link UsersContract.View}", and then delivers the data back to
 * its View.
 * The presenter also calls other relevant methods of its View such as for
 * showing/hiding progress bar and for showing Toast messages.
 * The Presenter subscribes to its View lifecycle by allowing
 * the View to call the Presenter's {@link #onViewActive(Object)} and {@link #onViewInactive()}
 * to reference/unreference its View. This allows its View to be GCed and prevents memory leaks.
 * The Presenter also checks if its View is active before calling any of its methods.
 */
public class UsersPresenter extends BasePresenter<UsersContract.View> implements
        UsersContract.Presenter {

    private DataRepository dataRepository;
    private ThreadExecutor threadExecutor;
    private MainUiThread mainUiThread;

    public UsersPresenter(UsersContract.View view, DataRepository dataRepository,
                          ThreadExecutor threadExecutor, MainUiThread mainUiThread) {
        this.view = view;
        this.dataRepository = dataRepository;
        this.threadExecutor = threadExecutor;
        this.mainUiThread = mainUiThread;
    }

    @Override
    public boolean isConnected() {
        return dataRepository.isConnected();
    }

    @Override
    public void connect(Context context) {
        if (dataRepository.isConnected())
            return;
        view.setProgressBar(true);

        dataRepository.connectRemote(context, new DataSource.OnUsersCallback() {
            @Override
            public void onSuccess(List<User> users) {
                if (view != null) {
                    view.setProgressBar(false);
                    if (users == null || users.size() == 0) {
                        return;
                    }
                    view.showUsers(users);
                    view.shouldShowPlaceholderText();
                }
            }

            @Override
            public void onFailure(Throwable throwable) {
                if (view != null) {
                    view.setProgressBar(false);
                    //// TODO: 10/14/17 set error message here
                    view.showToastMessage("Something went wrong");
                    view.shouldShowPlaceholderText();
                }
            }

            @Override
            public void onNetworkFailure() {
                if (view != null) {
                    view.setProgressBar(false);
                    //// TODO: 10/14/17 set the network error message here
                    view.showToastMessage("Something wrong with network");
                    view.shouldShowPlaceholderText();
                }
            }

            @Override
            public void onNewUserJoined(User user) {
                if (view != null) {
                    view.setProgressBar(false);
                    view.addUser(user);
                }
            }

            @Override
            public void onUserLeft(User user) {
                if (view != null) {
                    view.setProgressBar(false);
                    view.remove(user);
                }
            }

            @Override
            public void onUserUpdate(User user) {
                if (view != null) {
                    view.setProgressBar(false);
                    view.updateUser(user);
                }
            }
        }, 0);
    }

    @Override
    public void loadMoreUsers(Context context, int page) {
        if (dataRepository.isConnected()) {
            if (view != null)
                view.setProgressBar(false);
            return;
        }
        connect(context);
    }

    @Override
    public void interestsUpdated(Context context) {
        if (dataRepository.isConnected()) {
            if (view != null)
                view.setProgressBar(false);
            dataRepository.updateUserInterests();
            return;
        }
        connect(context);
    }
}


text:
module Petstore
  module Models
    #
    # The parameters to provide for the account.
    #
    class StorageAccountCreateParameters

      include MsRestAzure

      # @return [String] Resource location
      attr_accessor :location

      # @return [Hash{String => String}] Resource tags
      attr_accessor :tags

      # @return [StorageAccountPropertiesCreateParameters]
      attr_accessor :properties

      #
      # Validate the object. Throws ValidationError if validation fails.
      #
      def validate
        fail MsRest::ValidationError, 'property location is nil' if @location.nil?
        @tags.each{ |e| e.validate if e.respond_to?(:validate) } unless @tags.nil?
        @properties.validate unless @properties.nil?
      end

      #
      # Serializes given Model object into Ruby Hash.
      # @param object Model object to serialize.
      # @return [Hash] Serialized object in form of Ruby Hash.
      #
      def self.serialize_object(object)
        object.validate
        output_object = {}

        serialized_property = object.location
        output_object['location'] = serialized_property unless serialized_property.nil?

        serialized_property = object.tags
        output_object['tags'] = serialized_property unless serialized_property.nil?

        serialized_property = object.properties
        unless serialized_property.nil?
          serialized_property = StorageAccountPropertiesCreateParameters.serialize_object(serialized_property)
        end
        output_object['properties'] = serialized_property unless serialized_property.nil?

        output_object
      end

      #
      # Deserializes given Ruby Hash into Model object.
      # @param object [Hash] Ruby Hash object to deserialize.
      # @return [StorageAccountCreateParameters] Deserialized object.
      #
      def self.deserialize_object(object)
        return if object.nil?
        output_object = StorageAccountCreateParameters.new

        deserialized_property = object['location']
        output_object.location = deserialized_property

        deserialized_property = object['tags']
        output_object.tags = deserialized_property

        deserialized_property = object['properties']
        unless deserialized_property.nil?
          deserialized_property = StorageAccountPropertiesCreateParameters.deserialize_object(deserialized_property)
        end
        output_object.properties = deserialized_property

        output_object
      end
    end
  end
end


text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package org.apache.cassandra.thrift;
/*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 *
 */

import org.apache.commons.lang.builder.HashCodeBuilder;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CqlResult implements org.apache.thrift.TBase<CqlResult, CqlResult._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CqlResult");

  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("num", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)4);

  /**
   *
   * @see CqlResultType
   */
  public CqlResultType type;
  public List<CqlRow> rows;
  public int num;
  public CqlMetadata schema;

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     *
     * @see CqlResultType
     */
    TYPE((short)1, "type"),
    ROWS((short)2, "rows"),
    NUM((short)3, "num"),
    SCHEMA((short)4, "schema");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TYPE
          return TYPE;
        case 2: // ROWS
          return ROWS;
        case 3: // NUM
          return NUM;
        case 4: // SCHEMA
          return SCHEMA;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __NUM_ISSET_ID = 0;
  private BitSet __isset_bit_vector = new BitSet(1);

  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CqlResultType.class)));
    tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CqlRow.class))));
    tmpMap.put(_Fields.NUM, new org.apache.thrift.meta_data.FieldMetaData("num", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CqlMetadata.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CqlResult.class, metaDataMap);
  }

  public CqlResult() {
  }

  public CqlResult(
    CqlResultType type)
  {
    this();
    this.type = type;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public CqlResult(CqlResult other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetRows()) {
      List<CqlRow> __this__rows = new ArrayList<CqlRow>();
      for (CqlRow other_element : other.rows) {
        __this__rows.add(new CqlRow(other_element));
      }
      this.rows = __this__rows;
    }
    this.num = other.num;
    if (other.isSetSchema()) {
      this.schema = new CqlMetadata(other.schema);
    }
  }

  public CqlResult deepCopy() {
    return new CqlResult(this);
  }

  @Override
  public void clear() {
    this.type = null;
    this.rows = null;
    setNumIsSet(false);
    this.num = 0;
    this.schema = null;
  }

  /**
   *
   * @see CqlResultType
   */
  public CqlResultType getType() {
    return this.type;
  }

  /**
   *
   * @see CqlResultType
   */
  public CqlResult setType(CqlResultType type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

  /** Returns true if field type is set (has been assigned a value) and false otherwise */
  public boolean isSetType() {
    return this.type != null;
  }

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

  public int getRowsSize() {
    return (this.rows == null) ? 0 : this.rows.size();
  }

  public java.util.Iterator<CqlRow> getRowsIterator() {
    return (this.rows == null) ? null : this.rows.iterator();
  }

  public void addToRows(CqlRow elem) {
    if (this.rows == null) {
      this.rows = new ArrayList<CqlRow>();
    }
    this.rows.add(elem);
  }

  public List<CqlRow> getRows() {
    return this.rows;
  }

  public CqlResult setRows(List<CqlRow> rows) {
    this.rows = rows;
    return this;
  }

  public void unsetRows() {
    this.rows = null;
  }

  /** Returns true if field rows is set (has been assigned a value) and false otherwise */
  public boolean isSetRows() {
    return this.rows != null;
  }

  public void setRowsIsSet(boolean value) {
    if (!value) {
      this.rows = null;
    }
  }

  public int getNum() {
    return this.num;
  }

  public CqlResult setNum(int num) {
    this.num = num;
    setNumIsSet(true);
    return this;
  }

  public void unsetNum() {
    __isset_bit_vector.clear(__NUM_ISSET_ID);
  }

  /** Returns true if field num is set (has been assigned a value) and false otherwise */
  public boolean isSetNum() {
    return __isset_bit_vector.get(__NUM_ISSET_ID);
  }

  public void setNumIsSet(boolean value) {
    __isset_bit_vector.set(__NUM_ISSET_ID, value);
  }

  public CqlMetadata getSchema() {
    return this.schema;
  }

  public CqlResult setSchema(CqlMetadata schema) {
    this.schema = schema;
    return this;
  }

  public void unsetSchema() {
    this.schema = null;
  }

  /** Returns true if field schema is set (has been assigned a value) and false otherwise */
  public boolean isSetSchema() {
    return this.schema != null;
  }

  public void setSchemaIsSet(boolean value) {
    if (!value) {
      this.schema = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((CqlResultType)value);
      }
      break;

    case ROWS:
      if (value == null) {
        unsetRows();
      } else {
        setRows((List<CqlRow>)value);
      }
      break;

    case NUM:
      if (value == null) {
        unsetNum();
      } else {
        setNum((Integer)value);
      }
      break;

    case SCHEMA:
      if (value == null) {
        unsetSchema();
      } else {
        setSchema((CqlMetadata)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TYPE:
      return getType();

    case ROWS:
      return getRows();

    case NUM:
      return new Integer(getNum());

    case SCHEMA:
      return getSchema();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case TYPE:
      return isSetType();
    case ROWS:
      return isSetRows();
    case NUM:
      return isSetNum();
    case SCHEMA:
      return isSetSchema();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof CqlResult)
      return this.equals((CqlResult)that);
    return false;
  }

  public boolean equals(CqlResult that) {
    if (that == null)
      return false;

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_rows = true && this.isSetRows();
    boolean that_present_rows = true && that.isSetRows();
    if (this_present_rows || that_present_rows) {
      if (!(this_present_rows && that_present_rows))
        return false;
      if (!this.rows.equals(that.rows))
        return false;
    }

    boolean this_present_num = true && this.isSetNum();
    boolean that_present_num = true && that.isSetNum();
    if (this_present_num || that_present_num) {
      if (!(this_present_num && that_present_num))
        return false;
      if (this.num != that.num)
        return false;
    }

    boolean this_present_schema = true && this.isSetSchema();
    boolean that_present_schema = true && that.isSetSchema();
    if (this_present_schema || that_present_schema) {
      if (!(this_present_schema && that_present_schema))
        return false;
      if (!this.schema.equals(that.schema))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    boolean present_type = true && (isSetType());
    builder.append(present_type);
    if (present_type)
      builder.append(type.getValue());

    boolean present_rows = true && (isSetRows());
    builder.append(present_rows);
    if (present_rows)
      builder.append(rows);

    boolean present_num = true && (isSetNum());
    builder.append(present_num);
    if (present_num)
      builder.append(num);

    boolean present_schema = true && (isSetSchema());
    builder.append(present_schema);
    if (present_schema)
      builder.append(schema);

    return builder.toHashCode();
  }

  public int compareTo(CqlResult other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    CqlResult typedOther = (CqlResult)other;

    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRows()).compareTo(typedOther.isSetRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, typedOther.rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNum()).compareTo(typedOther.isSetNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num, typedOther.num);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSchema()).compareTo(typedOther.isSetSchema());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchema()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, typedOther.schema);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.type = CqlResultType.findByValue(iprot.readI32());
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // ROWS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list71 = iprot.readListBegin();
              this.rows = new ArrayList<CqlRow>(_list71.size);
              for (int _i72 = 0; _i72 < _list71.size; ++_i72)
              {
                CqlRow _elem73;
                _elem73 = new CqlRow();
                _elem73.read(iprot);
                this.rows.add(_elem73);
              }
              iprot.readListEnd();
            }
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // NUM
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.num = iprot.readI32();
            setNumIsSet(true);
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // SCHEMA
          if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
            this.schema = new CqlMetadata();
            this.schema.read(iprot);
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.type != null) {
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
      oprot.writeI32(this.type.getValue());
      oprot.writeFieldEnd();
    }
    if (this.rows != null) {
      if (isSetRows()) {
        oprot.writeFieldBegin(ROWS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.rows.size()));
          for (CqlRow _iter74 : this.rows)
          {
            _iter74.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
    }
    if (isSetNum()) {
      oprot.writeFieldBegin(NUM_FIELD_DESC);
      oprot.writeI32(this.num);
      oprot.writeFieldEnd();
    }
    if (this.schema != null) {
      if (isSetSchema()) {
        oprot.writeFieldBegin(SCHEMA_FIELD_DESC);
        this.schema.write(oprot);
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("CqlResult(");
    boolean first = true;

    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (isSetRows()) {
      if (!first) sb.append(", ");
      sb.append("rows:");
      if (this.rows == null) {
        sb.append("null");
      } else {
        sb.append(this.rows);
      }
      first = false;
    }
    if (isSetNum()) {
      if (!first) sb.append(", ");
      sb.append("num:");
      sb.append(this.num);
      first = false;
    }
    if (isSetSchema()) {
      if (!first) sb.append(", ");
      sb.append("schema:");
      if (this.schema == null) {
        sb.append("null");
      } else {
        sb.append(this.schema);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (type == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! Struct: " + toString());
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bit_vector = new BitSet(1);
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Creation Flows Project | Emily Mattison Design</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="manifest" href="site.webmanifest">
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.0/slick/slick.css"/>
  <link rel="stylesheet" href="css/style.css">

  <link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="192x192"  href="img/favicon/android-icon-192x192.png">
  <link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="img/favicon/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
  <link rel="manifest" href="img/favicon/manifest.json">
  <meta name="msapplication-TileColor" content="#ffffff">
  <meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png">
  <meta name="theme-color" content="#ffffff">

Work

About

Contact

      UserIQ

Recreating the process for creating in-app engagements

      Role
      UX Designer

      Background

The most popular feature with
the least popular workflow

As an early-stage startup that was still in the process of staking out its position within the product management and customer success space, my former company UserIQ initially focused on developing three widely different feature sets in an effort to satisfy the largest number of new and existing users. The most popular and reliable of these three feature sets were in-app engagements—pop-up announcements, guided tours, surveys, and info bars—that other SaaS companies could use within their products to present information to or gather feedback from their users.

An example of a UserIQ NPS Survey on a customer's site.

Despite its popularity, however, creating a "campaign" was an enormous headache for our customers partly because they were unable to style their campaigns while creating them. To make their campaigns appear the way they wanted them to, they first had to go to a separate part of the app and create a theme that included styles for all campaign types before they could go back and apply that theme to the campaign they were trying to create. To make matters worse, the convoluted arrangement of theme options within this separate Create Theme flow meant that users were having trouble fulfilling the basic tasks of creating a theme.

We are working on our Campaign Themes and having trouble editing the font [and] border color for buttons."

      —UserIQ customer in a Zendesk ticket to our CS team

It was obvious that both the Create Campaign and Create Theme flows needed attention and, because dealing with theme-related issues was consuming a significant amount of our customer success team's time, redesigning the Create Theme flow became one of my first assignments as a new UX hire at UserIQ.

      Process

Creating a more intuitive flow based on
patterns our customers were already
familiar with

Defining the Problem & Research

In order for me to better understand the problem, JD spent some time at the beginning of the project pointing out to me what he knew were the biggest issues within the Create Theme flow based on feedback he had received from the CS team. Two of the things that stood out were the scrolling tab bar at the top of the "Edit" panel that allowed the user to switch to the inputs and preview for a different campaign type as well as the placement of the custom CSS editor, which was currently hidden behind a misleading toggle below the save button.

Existing Create Theme Flow

After getting a better sense of what was needed from my discussions with JD, I began to look at other apps with flows that seemed similar to UserIQ's Create Theme flow and which our customers may have used before. MailChimp and Delighted provided good examples of how a few simple UI components, such as button groups, accordions, and a stepper, could be used to better organize this type of design wizard.

Screenshots of MailChimp's "Design Email" flow (left) and Delighted's "Customize Appearance" flow (right).

Sketches

Once I began sketching as many viable solutions to the problem that I could think of, I realized that the biggest challenge to redesigning the Create Theme flow was going to be figuring out the best way for users to switch to a variety of different views on the same screen. They needed to be able to:

Switch between the WYSIWYG inputs for different campaign types within the "Edit" panel

Switch between the WYSIWYG inputs and custom CSS editor that advanced users were using within the "Edit" panel

Switch between desktop and mobile previews within the "Preview" panel and, in some cases:

Switch between different campaign type previews within the "Preview" panel

One of the other challenges that I realized we needed to solve for was the random assortment of WYSIWYG inputs for each campaign type. The layout of inputs was disorganized with inputs for elements that would appear in the footer of the campaign being displayed above inputs for elements that would appear in the header. What's more, users had the ability to change the styles for elements that were in multiple campaign types only on certain campaign types. It was obvious that we needed to determine a universal set of available WYSIWYG inputs with consistent naming conventions for all campaign types, but also include WYSIWYG inputs for elements that were unique to particular campaign types.

The sketches that I initially put together reflected these two challenges and were inspired, in part, by MailChimp's and Delighted's creation flows.

A few of my early sketches for the new Create Theme flow.

Mockups, Prototypes, & User Testing

After thinking about the pros and cons for each of the sketches, I was able to narrow down the number of viable options to just two concepts, which I converted into mockups and later prototypes. The key difference between the two concepts was that one concept had an additional tab in the tab bar for "Theme CSS" that would allow the user to switch to viewing the custom CSS editor for all campaign types and the other had a button group within the "Edit" panel that would allow the user to switch between viewing the WYSIWYG inputs for that campaign type and the custom CSS editor, which still applied to all campaign types.

New Create Theme Flow—Tab Option

New Create Theme Flow—Toggle Option

Our uncertainty about users' mental models was the reason for the difference between these two concepts. JD and I had learned from the engineering team that any custom CSS that was added to the theme would apply to all campaign types within the theme rather than to specific campaign types, so we wondered whether it would make more sense to users if the custom CSS editor were in its own tab rather than in the "Edit" panel. We also wondered, however, if users would be more likely to miss the custom CSS editor if it were placed within the last tab on the tab bar.

From a few hallway tests that we conducted with our coworkers who weren't on the product team, it became clear that the custom CSS editor was harder to find when it was placed within the tab bar. It also became clear that users didn't care that much whether or not the custom CSS for different campaign types was linked, alleviating any concerns that we had about confusing mental models.

      Solution

Applying new patterns to improve overall
user experience

After making one final update to the mockups, we had landed on a solution that we felt confident in and that our engineering team was able to release following a three week sprint cycle.

The final mockups for the new Create Theme flow.

Within another few weeks, however, our Director of Software Engineering told our product team that the latest releases, including the Create Theme one, had improved the user experience in certain areas of our app so much that it would be worthwhile for us to spend a few days in a war room session determining how we could apply some of the new UX patterns to other parts of our app. After some discussion, JD and I suggested applying the two-panel concept and accordion pattern from the Create Theme flow to the Create Campaign flow, reducing some of the gaps within the overall process for creating a campaign.

The wireframes JD put together for the new Create Campaign flow.

Although there was room for future improvements, we had found a way to reduce the number of usability issues within the Create Theme and Create Campaign flows within a short period of time, as evidenced by a drop in the number of Zendesk tickets that our CS team received around creating themes and campaigns. We had also done it without disrupting either the back-end of our application or our users' workflows, making both redesigns a success for our company and our customers.

More Work

          UserIQ

Creation
Flows

          View Project

          UserIQ

Campaign Results

          View Project

          UserIQ

Tasks & Playbooks

          View Project

          Konquer Jiu Jitsu

E-Commerce Site

          View Project

          Ballad

Web & Mobile App

          View Project

          Oliver Pluff & Co.

E-Commerce App

          View Project

Get in touch

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      Fuck yeah, let's get in touch


text:
namespace dx.misv.donations.data
{
    public class Donater
    {
        public int Age { get; set; }
        public string Sex { get; set; }
        public int Income { get; set; }
        public string Zip { get; set; }
        public string Education { get; set; }
        public string MaritalStatus { get; set; }
        public string Children { get; set; }
        public int Interactions { get; set; }
        public int Amount { get; set; }
        public int WeekDay { get; set; }
        public int Month { get; set; }
        public int Hour { get; set; }
        public string Location { get; set; }
        public string Device { get; set; }
        public string Profile { get; set; }
    }
}


text:
#ifndef _MIRTKPROBABILISTICATLAS_H

#define _MIRTKPROBABILISTICATLAS_H

#include "mirtk/Object.h"

#include "mirtk/Image.h"

#include <vector>

/**

Atlas probability map class

 */
using namespace std;
namespace mirtk {

class ProbabilisticAtlas : public Object
{
	mirtkObjectMacro(ProbabilisticAtlas);

	// Vector of probability maps
	vector<RealImage> _images;

	// Vector of pointers to probability maps
	vector<RealPixel *> _pointers;

	///Number of voxels
	int _number_of_voxels;

	///Number of voxels
	int _number_of_tissues;

	/// Hard segmentation
	RealImage _segmentation;

public:

	/// Constructor
	ProbabilisticAtlas();

	/// swap images within atlas
	void SwapImages(int, int);

	/// Adds new image (channel)
	void AddImage(RealImage image);

	/// Moves pointers in all images to the first voxel
	void First();

	/// Moves pointers in all images to the next voxel
	void Next();

	///Returns intensity value at pointer
	RealPixel GetValue(unsigned int channel);

	///Returns intensity value at position
	RealPixel GetValue(int x, int y, int z, unsigned int tissue);

	///Sets intensity value at pointer
	void SetValue(unsigned int tissue, RealPixel value);

	///Sets intensity value at position
	void SetValue(int x, int y, int z, unsigned int tissue, RealPixel value);

	/// Returns number of voxels
	int GetNumberOfVoxels();

	/// Add probability maps
	void AddProbabilityMaps(int, RealImage **atlas);

	/// Computes probability map for the last tissue type
	void AddBackground();

	/// normalize atlas without adding background
	void NormalizeAtlas();

	/// normalize atlas while adding background
	void NormalizeAtlas(RealImage background);

	///Returns number of tissues
	int GetNumberOfTissues();

	/// Write
	void Write(int, const char *);

	/// Computes hard segmentation
	RealImage ComputeHardSegmentation();

	/// Extract a label from hard segmentation
	void ExtractLabel(int label, RealImage& image);

	/// Writes hard segmentation into a file
	void WriteHardSegmentation(const char *filename);

	RealImage GetImage(int);

};

inline void ProbabilisticAtlas::First()
{
	unsigned int i;
	for (i=0; i<_pointers.size(); i++) _pointers[i] = _images[i].GetPointerToVoxels();
}

inline void ProbabilisticAtlas::Next()
{
	unsigned int i;
	for (i=0; i<_pointers.size(); i++) _pointers[i]++;
}

inline RealPixel ProbabilisticAtlas::GetValue(unsigned int channel)
{
	if (channel < _images.size()) return *_pointers[channel];
	else {
		cerr << "Channel identificator " << channel <<" out of range." <<endl;
		exit(1);
	}
}

inline RealPixel ProbabilisticAtlas::GetValue(int x, int y, int z, unsigned int channel)
{
	if (channel < _images.size()) return _images[channel].Get(x,y,z);
	else {
		cerr << "Channel identificator " << channel <<" out of range." <<endl;
		exit(1);
	}
}

inline void ProbabilisticAtlas::SetValue(unsigned int channel, RealPixel value)
{
	if (channel < _images.size()) *_pointers[channel] = value;
	else {
		cerr << "Channel identificator " << channel << " out of range." <<endl;
		exit(1);
	}
}

inline void ProbabilisticAtlas::SetValue(int x, int y, int z, unsigned int channel, RealPixel value)
{
	if (channel < _images.size()) _images[channel].Put( x, y, z, value);
	else {
		cerr << "Channel identificator " << channel <<" out of range." <<endl;
		exit(1);
	}
}

inline int ProbabilisticAtlas::GetNumberOfVoxels()
{
	return _number_of_voxels;
}

inline int ProbabilisticAtlas::GetNumberOfTissues()
{
	return _number_of_tissues;
}

}

#endif


text:
set -e

INDEX_FILE=/usr/share/nginx/html/index.html

# TODO: this is empty but we'll be adding configuration values here

exec nginx -g 'daemon off;'


text:
package codeblockutil;

public class GlassExplorerEvent implements ExplorerEvent{
	public final static int SLIDING_CONTAINER_FINISHED_OPEN = 1;
	public final static int SLIDING_CONTAINER_FINISHED_CLOSED = 2;

	private int eventType;
	private GlassExplorer ge=null;

	public GlassExplorerEvent(GlassExplorer ge, int event){
		this.ge =ge;
		this.eventType = event;
	}

	public int getEventType(){
		return this.eventType;
	}

	public Explorer getSource(){
		return this.ge;
	}

}


text:
<?php

class Type_Void extends Type
{
    public function cast($value)
    {
    }
}


text:
'use strict';

// [START functions_pubsub_setup]
const PubSub = require('@google-cloud/pubsub');

// Instantiates a client
const pubsub = PubSub();
// [END functions_pubsub_setup]

const Buffer = require('safe-buffer').Buffer;

// [START functions_pubsub_publish]
/**
 * Publishes a message to a Cloud Pub/Sub Topic.
 *
 * @example
 * gcloud alpha functions call publish --data '{"topic":"[YOUR_TOPIC_NAME]","message":"Hello, world!"}'
 *
 *   - Replace `[YOUR_TOPIC_NAME]` with your Cloud Pub/Sub topic name.
 *
 * @param {object} req Cloud Function request context.
 * @param {object} req.body The request body.
 * @param {string} req.body.topic Topic name on which to publish.
 * @param {string} req.body.message Message to publish.
 * @param {object} res Cloud Function response context.
 */
exports.publish = (req, res) => {
  if (!req.body.topic) {
    res.status(500).send(new Error('Topic not provided. Make sure you have a "topic" property in your request'));
    return;
  } else if (!req.body.message) {
    res.status(500).send(new Error('Message not provided. Make sure you have a "message" property in your request'));
    return;
  }

  console.log(`Publishing message to topic ${req.body.topic}`);

  // References an existing topic
  const topic = pubsub.topic(req.body.topic);

  const message = {
    data: {
      message: req.body.message
    }
  };

  // Publishes a message
  return topic.publish(message)
    .then(() => res.status(200).send('Message published.'))
    .catch((err) => {
      console.error(err);
      res.status(500).send(err);
      return Promise.reject(err);
    });
};
// [END functions_pubsub_publish]

// [START functions_pubsub_subscribe]
/**
 * Triggered from a message on a Cloud Pub/Sub topic.
 *
 * @param {object} event The Cloud Functions event.
 * @param {object} event.data The Cloud Pub/Sub Message object.
 * @param {string} event.data.data The "data" property of the Cloud Pub/Sub Message.
 * @param {function} callback The callback function.
 */
exports.subscribe = (event, callback) => {
  const pubsubMessage = event.data;

  // We're just going to log the message to prove that it worked!
  console.log(Buffer.from(pubsubMessage.data, 'base64').toString());

  // Don't forget to call the callback!
  callback();
};
// [END functions_pubsub_subscribe]


text:
<法規>
<法規性質>法律</法規性質>
<英文法規名稱>Organization of the Centers for Disease Control, Ministry of Health and Welfare Act</英文法規名稱>
<中文法規名稱>衛生福利部疾病管制署組織法</中文法規名稱>
<法規網址>https://law.moj.gov.tw/Eng/LawClass/LawAll.aspx?pcode=L0000056</法規網址>
<最新英文異動日期>20130619</最新英文異動日期>
<廢止註記>
</廢止註記>
<附件 />
<沿革內容><![CDATA[1.Formulated and Promulgated in eight articles on June 19, 2013, under Hua-Tsung-I-Yi No. 10200113971.]]></沿革內容>
<前言><![CDATA[]]></前言>
<法規內容>
  <條文>
    <條號>Article 1</條號>
    <條文內容><![CDATA[For the purpose of implementing prevention and control of communicable diseases, the Ministry of Health and Welfare shall establish the Centers for Diseases Control (hereafter referred to as the CDC).]]></條文內容>
  </條文>
  <條文>
    <條號>Article 2</條號>
    <條文內容><![CDATA[The CDC shall implement the following matters:
1. Planning, execution of policies and formulating relevant regulations concerning the prevention and control of communicable diseases (hereafter referred to as disease control);
2. Prevention, control, investigation, research and laboratory testing of various communicable diseases (hereafter referred to as diseases);
3. Reporting and epidemic surveillance of diseases within the country and international collection and exchange of epidemic intelligence;
4. Preparedness and response to outbreaks of diseases and emergency management and handling;
5. Provision of disease control pharmaceuticals, government-funded vaccines, biologics, and immunization against notifiable diseases;
6. Quarantine inspection and sanitary management (hereafter referred to as quarantine) at international ports and health management of foreign laborers;
7. Formulation of laboratory testing methods and accreditation of laboratory testing and management of bio-safety;
8. Training of disease control and quarantine professionals;
9. International cooperation and exchange on matters concerning disease control and quarantine;
10. Other matters concerning disease control.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 3</條號>
    <條文內容><![CDATA[There shall be in the CDC one director-general at grade 13; two deputy directors-general at grade 12 each.
Two of the personnel mentioned in the preceding paragraph may be relevant medical personnel of grade 1 in accordance with the Medical Personnel Management Act.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 4</條號>
    <條文內容><![CDATA[There shall be in the CDC one chief-secretary at grade 11.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 5</條號>
    <條文內容><![CDATA[Researchers and associate researchers of the CDC may be appointed in accordance with the Act of Governing the Appointment of Educators; their retirement and pension shall be handled in accordance with relevant regulations of school teachers, and shall be reported to the Ministry of Health and Welfare for approval.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 6</條號>
    <條文內容><![CDATA[One of the division directors or deputy division directors, one of the center directors or deputy center directors, and one-fifth of the senior technical specialists, when necessary, may be appointed from relevant medical personnel of grade 1 in accordance with the Medical Personnel Management Act.
There may be medical personnel in the CDC. Their appointment shall follow the Medical Personnel Management Act.
The titles, ranks or classifications and their numbers shall be set forth separately in an organization chart.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 7</條號>
    <條文內容><![CDATA[Researchers employed in accordance with the regulations of Article 13 of the Organization Act of the former Centers for Disease Control of the Department of Health, the Executive Yuan, before the enactment of this Act shall be employed in accordance with the regulations of the original Organization Act.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 8</條號>
    <條文內容><![CDATA[The date of enforcement of this Act shall be determined by the Executive Yuan.]]></條文內容>
  </條文>
</法規內容>
</法規>


text:
describe RuboCop::Cop::Style::ParenthesesAroundCondition, :config do
  subject(:cop) { described_class.new(config) }
  let(:cop_config) { { 'AllowSafeAssignment' => true } }

  it 'registers an offense for parentheses around condition' do
    inspect_source(cop, <<-END.strip_indent)
      if (x > 10)
      elsif (x < 3)
      end
      unless (x > 10)
      end
      while (x > 10)
      end
      until (x > 10)
      end
      x += 1 if (x < 10)
      x += 1 unless (x < 10)
      x += 1 until (x < 10)
      x += 1 while (x < 10)
    END
    expect(cop.offenses.size).to eq(9)
    expect(cop.messages.first)
      .to eq("Don't use parentheses around the condition of an `if`.")
    expect(cop.messages.last)
      .to eq("Don't use parentheses around the condition of a `while`.")
  end

  it 'accepts parentheses if there is no space between the keyword and (.' do
    inspect_source(cop, <<-END.strip_indent)
      if(x > 5) then something end
      do_something until(x > 5)
    END
    expect(cop.offenses).to be_empty
  end

  it 'auto-corrects parentheses around condition' do
    corrected = autocorrect_source(cop, <<-END.strip_indent)
      if (x > 10)
      elsif (x < 3)
      end
      unless (x > 10)
      end
      while (x > 10)
      end
      until (x > 10)
      end
      x += 1 if (x < 10)
      x += 1 unless (x < 10)
      x += 1 while (x < 10)
      x += 1 until (x < 10)
    END
    expect(corrected).to eq <<-END.strip_indent
      if x > 10
      elsif x < 3
      end
      unless x > 10
      end
      while x > 10
      end
      until x > 10
      end
      x += 1 if x < 10
      x += 1 unless x < 10
      x += 1 while x < 10
      x += 1 until x < 10
    END
  end

  it 'accepts condition without parentheses' do
    inspect_source(cop, <<-END.strip_indent)
      if x > 10
      end
      unless x > 10
      end
      while x > 10
      end
      until x > 10
      end
      x += 1 if x < 10
      x += 1 unless x < 10
      x += 1 while x < 10
      x += 1 until x < 10
    END
    expect(cop.offenses).to be_empty
  end

  it 'accepts parentheses around condition in a ternary' do
    inspect_source(cop, '(a == 0) ? b : a')
    expect(cop.offenses).to be_empty
  end

  it 'is not confused by leading parentheses in subexpression' do
    inspect_source(cop, '(a > b) && other ? one : two')
    expect(cop.offenses).to be_empty
  end

  it 'is not confused by unbalanced parentheses' do
    inspect_source(cop, <<-END.strip_indent)
      if (a + b).c()
      end
    END
    expect(cop.offenses).to be_empty
  end

  %w[rescue if unless while until].each do |op|
    it "allows parens if the condition node is a modifier #{op} op" do
      inspect_source(cop, <<-END.strip_indent)
        if (something #{op} top)
        end
      END
      expect(cop.offenses).to be_empty
    end
  end

  it 'does not blow up when the condition is a ternary op' do
    inspect_source(cop, 'x if (a ? b : c)')
    expect(cop.offenses.size).to eq(1)
  end

  it 'does not blow up for empty if condition' do
    inspect_source(cop, <<-END.strip_indent)
      if ()
      end
    END
    expect(cop.offenses).to be_empty
  end

  it 'does not blow up for empty unless condition' do
    inspect_source(cop, <<-END.strip_indent)
      unless ()
      end
    END
    expect(cop.offenses).to be_empty
  end

  context 'safe assignment is allowed' do
    it 'accepts variable assignment in condition surrounded with parentheses' do
      inspect_source(cop, <<-END.strip_indent)
        if (test = 10)
        end
      END
      expect(cop.offenses).to be_empty
    end

    it 'accepts element assignment in condition surrounded with parentheses' do
      inspect_source(cop, <<-END.strip_indent)
        if (test[0] = 10)
        end
      END
      expect(cop.offenses).to be_empty
    end

    it 'accepts setter in condition surrounded with parentheses' do
      inspect_source(cop, <<-END.strip_indent)
        if (self.test = 10)
        end
      END
      expect(cop.offenses).to be_empty
    end
  end

  context 'safe assignment is not allowed' do
    let(:cop_config) { { 'AllowSafeAssignment' => false } }

    it 'does not accept variable assignment in condition surrounded with ' \
       'parentheses' do
      inspect_source(cop, <<-END.strip_indent)
        if (test = 10)
        end
      END
      expect(cop.offenses.size).to eq(1)
    end

    it 'does not accept element assignment in condition surrounded with ' \
       'parentheses' do
      inspect_source(cop, <<-END.strip_indent)
        if (test[0] = 10)
        end
      END
      expect(cop.offenses.size).to eq(1)
    end
  end
end


text:
```text
Announce blobs to the DHT

Usage:
    blob_announce [-a] [<blob_hash> | --blob_hash=<blob_hash>]
                  [<stream_hash> | --stream_hash=<stream_hash>]
                  [<sd_hash> | --sd_hash=<sd_hash>]

Options:
    -a                                          : announce all the blobs possessed by user
    <blob_hash>, --blob_hash=<blob_hash>        : announce a blob, specified by blob_hash
    <stream_hash>, --stream_hash=<stream_hash>  : announce all blobs associated with
                                                    stream_hash
    <sd_hash>, --sd_hash=<sd_hash>              : announce all blobs associated with
                                                    sd_hash and the sd_hash itself

Returns:
    (bool) true if successful
```

## blob_announce_all

```text
Announce all blobs to the DHT

Usage:
    blob_announce_all

Returns:
    (str) Success/fail message
```

## blob_delete

```text
Delete a blob

Usage:
    blob_delete (<blob_hash> | --blob_hash=<blob_hash)

Returns:
    (str) Success/fail message
```

## blob_get

```text
Download and return a blob

Usage:
    blob_get (<blob_hash> | --blob_hash=<blob_hash>) [--timeout=<timeout>]
             [--encoding=<encoding>] [--payment_rate_manager=<payment_rate_manager>]

Options:
--timeout=<timeout>                            : timeout in number of seconds
--encoding=<encoding>                          : by default no attempt at decoding is made,
                                                 can be set to one of the
                                                 following decoders:
                                                    'json'
--payment_rate_manager=<payment_rate_manager>  : if not given the default payment rate
                                                 manager will be used.
                                                 supported alternative rate managers:
                                                    'only-free'

Returns
    (str) Success/Fail message or (dict) decoded data
```

## blob_list

```text
Returns blob hashes. If not given filters, returns all blobs known by the blob manager

Usage:
    blob_list [-n] [-f] [<uri> | --uri=<uri>] [<stream_hash> | --stream_hash=<stream_hash>]
              [<sd_hash> | --sd_hash=<sd_hash>] [<page_size> | --page_size=<page_size>]
              [<page> | --page=<page>]

Options:
    -n                                          : only return needed blobs
    -f                                          : only return finished blobs
    <uri>, --uri=<uri>                          : filter blobs by stream in a uri
    <stream_hash>, --stream_hash=<stream_hash>  : filter blobs by stream hash
    <sd_hash>, --sd_hash=<sd_hash>              : filter blobs by sd hash
    <page_size>, --page_size=<page_size>        : results page size
    <page>, --page=<page>                       : page of results to return

Returns:
    (list) List of blob hashes
```

## blob_reflect_all

```text
Reflects all saved blobs

Usage:
    blob_reflect_all

Returns:
    (bool) true if successful
```

## block_show

```text
Get contents of a block

Usage:
    block_show (<blockhash> | --blockhash=<blockhash>) | (<height> | --height=<height>)

Options:
    <blockhash>, --blockhash=<blockhash>  : hash of the block to look up
    <height>, --height=<height>           : height of the block to look up

Returns:
    (dict) Requested block
```

## channel_list_mine

```text
Get my channels

Usage:
    channel_list_mine

Returns:
    (list) ClaimDict
```

## channel_new

```text
Generate a publisher key and create a new '@' prefixed certificate claim

Usage:
    channel_new (<channel_name> | --channel_name=<channel_name>)
                (<amount> | --amount=<amount>)

Returns:
    (dict) Dictionary containing result of the claim
    {
        'tx' : (str) hex encoded transaction
        'txid' : (str) txid of resulting claim
        'nout' : (int) nout of the resulting claim
        'fee' : (float) fee paid for the claim transaction
        'claim_id' : (str) claim ID of the resulting claim
    }
```

## claim_abandon

```text
Abandon a name and reclaim credits from the claim

Usage:
    claim_abandon [<claim_id> | --claim_id=<claim_id>]
                  [<txid> | --txid=<txid>] [<nout> | --nout=<nout>]

Return:
    (dict) Dictionary containing result of the claim
    {
        txid : (str) txid of resulting transaction
        fee : (float) fee paid for the transaction
    }
```

## claim_list

```text
List current claims and information about them for a given name

Usage:
    claim_list (<name> | --name=<name>)

Returns
    (dict) State of claims assigned for the name
    {
        'claims': (list) list of claims for the name
        [
            {
            'amount': (float) amount assigned to the claim
            'effective_amount': (float) total amount assigned to the claim,
                                including supports
            'claim_id': (str) claim ID of the claim
            'height': (int) height of block containing the claim
            'txid': (str) txid of the claim
            'nout': (int) nout of the claim
            'supports': (list) a list of supports attached to the claim
            'value': (str) the value of the claim
            },
        ]
        'supports_without_claims': (list) supports without any claims attached to them
        'last_takeover_height': (int) the height of last takeover for the name
    }
```

## claim_list_by_channel

```text
Get paginated claims in a channel specified by a channel uri

Usage:
    claim_list_by_channel (<uri> | --uri=<uri>) [<uris>...] [--page=<page>]
                           [--page_size=<page_size>]

Options:
    --page=<page>            : which page of results to return where page 1 is the first
                               page, defaults to no pages
    --page_size=<page_size>  : number of results in a page, default of 10

Returns:
    {
         resolved channel uri: {
            If there was an error:
            'error': (str) error message

            'claims_in_channel': the total number of results for the channel,

            If a page of results was requested:
            'returned_page': page number returned,
            'claims_in_channel': [
                {
                    'absolute_channel_position': (int) claim index number in sorted list of
                                                 claims which assert to be part of the
                                                 channel
                    'address': (str) claim address,
                    'amount': (float) claim amount,
                    'effective_amount': (float) claim amount including supports,
                    'claim_id': (str) claim id,
                    'claim_sequence': (int) claim sequence number,
                    'decoded_claim': (bool) whether or not the claim value was decoded,
                    'height': (int) claim height,
                    'depth': (int) claim depth,
                    'has_signature': (bool) included if decoded_claim
                    'name': (str) claim name,
                    'supports: (list) list of supports [{'txid': txid,
                                                         'nout': nout,
                                                         'amount': amount}],
                    'txid': (str) claim txid,
                    'nout': (str) claim nout,
                    'signature_is_valid': (bool), included if has_signature,
                    'value': ClaimDict if decoded, otherwise hex string
                }
            ],
        }
    }
```

## claim_list_mine

```text
List my name claims

Usage:
    claim_list_mine

Returns
    (list) List of name claims owned by user
    [
        {
            'address': (str) address that owns the claim
            'amount': (float) amount assigned to the claim
            'blocks_to_expiration': (int) number of blocks until it expires
            'category': (str) "claim", "update" , or "support"
            'claim_id': (str) claim ID of the claim
            'confirmations': (int) number of blocks of confirmations for the claim
            'expiration_height': (int) the block height which the claim will expire
            'expired': (bool) true if expired, false otherwise
            'height': (int) height of the block containing the claim
            'is_spent': (bool) true if claim is abandoned, false otherwise
            'name': (str) name of the claim
            'txid': (str) txid of the cliam
            'nout': (int) nout of the claim
            'value': (str) value of the claim
        },
   ]
```

## claim_new_support

```text
Support a name claim

Usage:
    claim_new_support (<name> | --name=<name>) (<claim_id> | --claim_id=<claim_id>)
                      (<amount> | --amount=<amount>)

Return:
    (dict) Dictionary containing result of the claim
    {
        txid : (str) txid of resulting support claim
        nout : (int) nout of the resulting support claim
        fee : (float) fee paid for the transaction
    }
```

## claim_send_to_address

```text
Send a name claim to an address

Usage:
    claim_send_to_address (<claim_id> | --claim_id=<claim_id>)
                          (<address> | --address=<address>)
                          [<amount> | --amount=<amount>]

Options:
    <amount>  : Amount of credits to claim name for, defaults to the current amount
                on the claim
```

## claim_show

```text
Resolve claim info from txid/nout or with claim ID

Usage:
    claim_show [<txid> | --txid=<txid>] [<nout> | --nout=<nout>]
               [<claim_id> | --claim_id=<claim_id>]

Options:
    <txid>, --txid=<txid>              : look for claim with this txid, nout must
                                            also be specified
    <nout>, --nout=<nout>              : look for claim with this nout, txid must
                                            also be specified
    <claim_id>, --claim_id=<claim_id>  : look for claim with this claim id

Returns:
    (dict) Dictionary containing claim info as below,

    {
        'txid': (str) txid of claim
        'nout': (int) nout of claim
        'amount': (float) amount of claim
        'value': (str) value of claim
        'height' : (int) height of claim takeover
        'claim_id': (str) claim ID of claim
        'supports': (list) list of supports associated with claim
    }

    if claim cannot be resolved, dictionary as below will be returned

    {
        'error': (str) reason for error
    }
```

## cli_test_command

```text
This command is only for testing the CLI argument parsing
Usage:
    cli_test_command [-a] [-b] (<pos_arg> | --pos_arg=<pos_arg>)
                     [<pos_args>...] [--pos_arg2=<pos_arg2>]
                     [--pos_arg3=<pos_arg3>]

Options:
    -a, --a_arg                        : a arg
    -b, --b_arg                        : b arg
    <pos_arg2>, --pos_arg2=<pos_arg2>  : pos arg 2
    <pos_arg3>, --pos_arg3=<pos_arg3>  : pos arg 3
Returns:
    pos args
```

## commands

```text
Return a list of available commands

Usage:
    commands

Returns:
    (list) list of available commands
```

## daemon_stop

```text
Stop lbrynet-daemon

Usage:
    daemon_stop

Returns:
    (string) Shutdown message
```

## file_delete

```text
Delete a LBRY file

Usage:
    file_delete [-f] [--delete_all] [--sd_hash=<sd_hash>] [--file_name=<file_name>]
                [--stream_hash=<stream_hash>] [--claim_id=<claim_id>]
                [--outpoint=<outpoint>] [--rowid=<rowid>]
                [--name=<name>]

Options:
    -f, --delete_from_download_dir  : delete file from download directory,
                                        instead of just deleting blobs
    --delete_all                    : if there are multiple matching files,
                                        allow the deletion of multiple files.
                                        Otherwise do not delete anything.
    --sd_hash=<sd_hash>             : delete by file sd hash
    --file_name<file_name>          : delete by file name in downloads folder
    --stream_hash=<stream_hash>     : delete by file stream hash
    --claim_id=<claim_id>           : delete by file claim id
    --outpoint=<outpoint>           : delete by file claim outpoint
    --rowid=<rowid>                 : delete by file row id
    --name=<name>                   : delete by associated name claim of file

Returns:
    (bool) true if deletion was successful
```

## file_list

```text
List files limited by optional filters

Usage:
    file_list [--sd_hash=<sd_hash>] [--file_name=<file_name>] [--stream_hash=<stream_hash>]
              [--claim_id=<claim_id>] [--outpoint=<outpoint>] [--rowid=<rowid>]
              [--name=<name>]
              [-f]

Options:
    --sd_hash=<sd_hash>          : get file with matching sd hash
    --file_name=<file_name>      : get file with matching file name in the
                                   downloads folder
    --stream_hash=<stream_hash>  : get file with matching stream hash
    --claim_id=<claim_id>        : get file with matching claim id
    --outpoint=<outpoint>        : get file with matching claim outpoint
    --rowid=<rowid>              : get file with matching row id
    --name=<name>                : get file with matching associated name claim
    -f                           : full status, populate the 'message' and 'size' fields

Returns:
    (list) List of files

    [
        {
            'completed': (bool) true if download is completed,
            'file_name': (str) name of file,
            'download_directory': (str) download directory,
            'points_paid': (float) credit paid to download file,
            'stopped': (bool) true if download is stopped,
            'stream_hash': (str) stream hash of file,
            'stream_name': (str) stream name ,
            'suggested_file_name': (str) suggested file name,
            'sd_hash': (str) sd hash of file,
            'name': (str) name claim attached to file
            'outpoint': (str) claim outpoint attached to file
            'claim_id': (str) claim ID attached to file,
            'download_path': (str) download path of file,
            'mime_type': (str) mime type of file,
            'key': (str) key attached to file,
            'total_bytes': (int) file size in bytes, None if full_status is false
            'written_bytes': (int) written size in bytes
            'message': (str), None if full_status is false
            'metadata': (dict) Metadata dictionary
        },
    ]
```

## file_reflect

```text
Reflect all the blobs in a file matching the filter criteria

Usage:
    file_reflect [--sd_hash=<sd_hash>] [--file_name=<file_name>]
                 [--stream_hash=<stream_hash>] [--claim_id=<claim_id>]
                 [--outpoint=<outpoint>] [--rowid=<rowid>] [--name=<name>]
                 [--reflector=<reflector>]

Options:
    --sd_hash=<sd_hash>          : get file with matching sd hash
    --file_name=<file_name>      : get file with matching file name in the
                                   downloads folder
    --stream_hash=<stream_hash>  : get file with matching stream hash
    --claim_id=<claim_id>        : get file with matching claim id
    --outpoint=<outpoint>        : get file with matching claim outpoint
    --rowid=<rowid>              : get file with matching row id
    --name=<name>                : get file with matching associated name claim
    --reflector=<reflector>      : reflector server, ip address or url
                                   by default choose a server from the config

Returns:
    (list) list of blobs reflected
```

## file_set_status

```text
Start or stop downloading a file

Usage:
    file_set_status <status> [--sd_hash=<sd_hash>] [--file_name=<file_name>]
              [--stream_hash=<stream_hash>] [--claim_id=<claim_id>]
              [--outpoint=<outpoint>] [--rowid=<rowid>]
              [--name=<name>]

Options:
    --sd_hash=<sd_hash>          : set status of file with matching sd hash
    --file_name=<file_name>      : set status of file with matching file name in the
                                   downloads folder
    --stream_hash=<stream_hash>  : set status of file with matching stream hash
    --claim_id=<claim_id>        : set status of file with matching claim id
    --outpoint=<outpoint>        : set status of file with matching claim outpoint
    --rowid=<rowid>              : set status of file with matching row id
    --name=<name>                : set status of file with matching associated name claim

Returns:
    (str) Confirmation message
```

## get

```text
Download stream from a LBRY name.

Usage:
    get <uri> [<file_name> | --file_name=<file_name>] [<timeout> | --timeout=<timeout>]

Options:
    <file_name>           : specified name for the downloaded file
    <timeout>             : download timeout in number of seconds
    <download_directory>  : path to directory where file will be saved

Returns:
    (dict) Dictionary contaning information about the stream
    {
        'completed': (bool) true if download is completed,
        'file_name': (str) name of file,
        'download_directory': (str) download directory,
        'points_paid': (float) credit paid to download file,
        'stopped': (bool) true if download is stopped,
        'stream_hash': (str) stream hash of file,
        'stream_name': (str) stream name,
        'suggested_file_name': (str) suggested file name,
        'sd_hash': (str) sd hash of file,
        'name': (str) name claim attached to file
        'outpoint': (str) claim outpoint attached to file
        'claim_id': (str) claim ID attached to file,
        'download_path': (str) download path of file,
        'mime_type': (str) mime type of file,
        'key': (str) key attached to file,
        'total_bytes': (int) file size in bytes, None if full_status is false
        'written_bytes': (int) written size in bytes
        'message': (str), None if full_status is false
        'metadata': (dict) Metadata dictionary
    }
```

## get_availability

```text
Get stream availability for lbry uri

Usage:
    get_availability (<uri> | --uri=<uri>) [<sd_timeout> | --sd_timeout=<sd_timeout>]
                     [<peer_timeout> | --peer_timeout=<peer_timeout>]

Options:
    <sd_timeout>, --sd_timeout=<sd_timeout>        : sd blob download timeout
    <peer_timeout>, --peer_timeout=<peer_timeout>  : how long to look for peers

Returns:
    (float) Peers per blob / total blobs
```

## help

```text
Return a useful message for an API command

Usage:
    help [<command> | --command=<command>]

Options:
    <command>, --command=<command>  : command to retrieve documentation for
```

## peer_list

```text
Get peers for blob hash

Usage:
    peer_list (<blob_hash> | --blob_hash=<blob_hash>) [<timeout> | --timeout=<timeout>]

Options:
    <timeout>, --timeout=<timeout>  : peer search timeout in seconds

Returns:
    (list) List of contacts
```

## publish

```text
Make a new name claim and publish associated data to lbrynet,
update over existing claim if user already has a claim for name.

Fields required in the final Metadata are:
    'title'
    'description'
    'author'
    'language'
    'license'
    'nsfw'

Metadata can be set by either using the metadata argument or by setting individual arguments
fee, title, description, author, language, license, license_url, thumbnail, preview, nsfw,
or sources. Individual arguments will overwrite the fields specified in metadata argument.

Usage:
    publish (<name> | --name=<name>) (<bid> | --bid=<bid>) [--metadata=<metadata>]
            [--file_path=<file_path>] [--fee=<fee>] [--title=<title>]
            [--description=<description>] [--author=<author>] [--language=<language>]
            [--license=<license>] [--license_url=<license_url>] [--thumbnail=<thumbnail>]
            [--preview=<preview>] [--nsfw=<nsfw>] [--sources=<sources>]
            [--channel_name=<channel_name>] [--channel_id=<channel_id>]
            [--claim_address=<claim_address>] [--change_address=<change_address>]

Options:
    --metadata=<metadata>          : ClaimDict to associate with the claim.
    --file_path=<file_path>        : path to file to be associated with name. If provided,
                                     a lbry stream of this file will be used in 'sources'.
                                     If no path is given but a metadata dict is provided,
                                     the source from the given metadata will be used.
    --fee=<fee>                    : Dictionary representing key fee to download content:
                                      {
                                        'currency': currency_symbol,
                                        'amount': float,
                                        'address': str, optional
                                      }
                                      supported currencies: LBC, USD, BTC
                                      If an address is not provided a new one will be
                                      automatically generated. Default fee is zero.
    --title=<title>                : title of the publication
    --description=<description>    : description of the publication
    --author=<author>              : author of the publication
    --language=<language>          : language of the publication
    --license=<license>            : publication license
    --license_url=<license_url>    : publication license url
    --thumbnail=<thumbnail>        : thumbnail url
    --preview=<preview>            : preview url
    --nsfw=<nsfw>                  : title of the publication
    --sources=<sources>            : {'lbry_sd_hash':sd_hash} specifies sd hash of file
    --channel_name=<channel_name>  : name of the publisher channel name in the wallet
    --channel_id=<channel_id>      : claim id of the publisher channel, does not check
                                     for channel claim being in the wallet. This allows
                                     publishing to a channel where only the certificate
                                     private key is in the wallet.
   --claim_address=<claim_address> : address where the claim is sent to, if not specified
                                     new address wil automatically be created

Returns:
    (dict) Dictionary containing result of the claim
    {
        'tx' : (str) hex encoded transaction
        'txid' : (str) txid of resulting claim
        'nout' : (int) nout of the resulting claim
        'fee' : (float) fee paid for the claim transaction
        'claim_id' : (str) claim ID of the resulting claim
    }
```

## report_bug

```text
Report a bug to slack

Usage:
    report_bug (<message> | --message=<message>)

Returns:
    (bool) true if successful
```

## resolve

```text
Resolve given LBRY URIs

Usage:
    resolve [-f] (<uri> | --uri=<uri>) [<uris>...]

Options:
    -f  : force refresh and ignore cache

Returns:
    Dictionary of results, keyed by uri
    '<uri>': {
            If a resolution error occurs:
            'error': Error message

            If the uri resolves to a channel or a claim in a channel:
            'certificate': {
                'address': (str) claim address,
                'amount': (float) claim amount,
                'effective_amount': (float) claim amount including supports,
                'claim_id': (str) claim id,
                'claim_sequence': (int) claim sequence number,
                'decoded_claim': (bool) whether or not the claim value was decoded,
                'height': (int) claim height,
                'depth': (int) claim depth,
                'has_signature': (bool) included if decoded_claim
                'name': (str) claim name,
                'supports: (list) list of supports [{'txid': txid,
                                                     'nout': nout,
                                                     'amount': amount}],
                'txid': (str) claim txid,
                'nout': (str) claim nout,
                'signature_is_valid': (bool), included if has_signature,
                'value': ClaimDict if decoded, otherwise hex string
            }

            If the uri resolves to a claim:
            'claim': {
                'address': (str) claim address,
                'amount': (float) claim amount,
                'effective_amount': (float) claim amount including supports,
                'claim_id': (str) claim id,
                'claim_sequence': (int) claim sequence number,
                'decoded_claim': (bool) whether or not the claim value was decoded,
                'height': (int) claim height,
                'depth': (int) claim depth,
                'has_signature': (bool) included if decoded_claim
                'name': (str) claim name,
                'channel_name': (str) channel name if claim is in a channel
                'supports: (list) list of supports [{'txid': txid,
                                                     'nout': nout,
                                                     'amount': amount}]
                'txid': (str) claim txid,
                'nout': (str) claim nout,
                'signature_is_valid': (bool), included if has_signature,
                'value': ClaimDict if decoded, otherwise hex string
            }
    }
```

## resolve_name

```text
Resolve stream info from a LBRY name

Usage:
    resolve_name <name> [-f]

Options:
    -f  : force refresh and do not check cache

Returns:
    (dict) Metadata dictionary from name claim, None if the name is not
            resolvable
```

## settings_get

```text
Get daemon settings

Usage:
    settings_get

Returns:
    (dict) Dictionary of daemon settings
    See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings
```

## settings_set

```text
Set daemon settings

Usage:
    settings_set [<download_directory> | --download_directory=<download_directory>]
                 [<data_rate> | --data_rate=<data_rate>]
                 [<download_timeout> | --download_timeout=<download_timeout>]
                 [<peer_port> | --peer_port=<peer_port>]
                 [<max_key_fee> | --max_key_fee=<max_key_fee>]
                 [<disable_max_key_fee> | --disable_max_key_fee=<disable_max_key_fee>]
                 [<use_upnp> | --use_upnp=<use_upnp>]
                 [<run_reflector_server> | --run_reflector_server=<run_reflector_server>]
                 [<cache_time> | --cache_time=<cache_time>]
                 [<reflect_uploads> | --reflect_uploads=<reflect_uploads>]
                 [<share_usage_data> | --share_usage_data=<share_usage_data>]
                 [<peer_search_timeout> | --peer_search_timeout=<peer_search_timeout>]
                 [<sd_download_timeout> | --sd_download_timeout=<sd_download_timeout>]

Options:
    <download_directory>, --download_directory=<download_directory>  : (str)
    <data_rate>, --data_rate=<data_rate>                             : (float), 0.0001
    <download_timeout>, --download_timeout=<download_timeout>        : (int), 180
    <peer_port>, --peer_port=<peer_port>                             : (int), 3333
    <max_key_fee>, --max_key_fee=<max_key_fee>   : (dict) maximum key fee for downloads,
                                                    in the format: {
                                                        "currency": <currency_symbol>,
                                                        "amount": <amount>
                                                    }. In the CLI, it must be an escaped
                                                    JSON string
                                                    Supported currency symbols:
                                                        LBC
                                                        BTC
                                                        USD
    <disable_max_key_fee>, --disable_max_key_fee=<disable_max_key_fee> : (bool), False
    <use_upnp>, --use_upnp=<use_upnp>            : (bool), True
    <run_reflector_server>, --run_reflector_server=<run_reflector_server>  : (bool), False
    <cache_time>, --cache_time=<cache_time>  : (int), 150
    <reflect_uploads>, --reflect_uploads=<reflect_uploads>  : (bool), True
    <share_usage_data>, --share_usage_data=<share_usage_data>  : (bool), True
    <peer_search_timeout>, --peer_search_timeout=<peer_search_timeout>  : (int), 3
    <sd_download_timeout>, --sd_download_timeout=<sd_download_timeout>  : (int), 3

Returns:
    (dict) Updated dictionary of daemon settings
```

## status

```text
Get daemon status

Usage:
    status [-s] [-d]

Options:
    -s  : include session status in results
    -d  : include dht network and peer status

Returns:
    (dict) lbrynet-daemon status
    {
        'lbry_id': lbry peer id, base58
        'installation_id': installation id, base58
        'is_running': bool
        'is_first_run': bool
        'startup_status': {
            'code': status code
            'message': status message
        },
        'connection_status': {
            'code': connection status code
            'message': connection status message
        },
        'blockchain_status': {
            'blocks': local blockchain height,
            'blocks_behind': remote_height - local_height,
            'best_blockhash': block hash of most recent block,
        },

        If given the session status option:
            'session_status': {
                'managed_blobs': count of blobs in the blob manager,
                'managed_streams': count of streams in the file manager
            }

        If given the dht status option:
            'dht_status': {
                'kbps_received': current kbps receiving,
                'kbps_sent': current kdps being sent,
                'total_bytes_sent': total bytes sent
                'total_bytes_received': total bytes received
                'queries_received': number of queries received per second
                'queries_sent': number of queries sent per second
                'recent_contacts': count of recently contacted peers
                'unique_contacts': count of unique peers
            }
    }
```

## stream_cost_estimate

```text
Get estimated cost for a lbry stream

Usage:
    stream_cost_estimate <uri> [<size> | --size=<size>]

Options:
    <size>, --size=<size>  : stream size in bytes. if provided an sd blob won't be
                             downloaded.

Returns:
    (float) Estimated cost in lbry credits, returns None if uri is not
        resolveable
```

## transaction_list

```text
List transactions belonging to wallet

Usage:
    transaction_list

Returns:
    (list) List of transactions
```

## transaction_show

```text
Get a decoded transaction from a txid

Usage:
    transaction_show (<txid> | --txid=<txid>)

Returns:
    (dict) JSON formatted transaction
```

## version

```text
Get lbry version information

Usage:
    version

Returns:
    (dict) Dictionary of lbry version information
    {
        'build': (str) build type (e.g. "dev", "rc", "release"),
        'ip': (str) remote ip, if available,
        'lbrynet_version': (str) lbrynet_version,
        'lbryum_version': (str) lbryum_version,
        'lbryschema_version': (str) lbryschema_version,
        'os_release': (str) os release string
        'os_system': (str) os name
        'platform': (str) platform string
        'processor': (str) processor type,
        'python_version': (str) python version,
    }
```

## wallet_balance

```text
Return the balance of the wallet

Usage:
    wallet_balance [<address> | --address=<address>] [-u]

Options:
    <address>  :  If provided only the balance for this address will be given
    -u         :  Include unconfirmed

Returns:
    (float) amount of lbry credits in wallet
```

## wallet_is_address_mine

```text
Checks if an address is associated with the current wallet.

Usage:
    wallet_is_address_mine (<address> | --address=<address>)

Returns:
    (bool) true, if address is associated with current wallet
```

## wallet_list

```text
List wallet addresses

Usage:
    wallet_list

Returns:
    List of wallet addresses
```

## wallet_new_address

```text
Generate a new wallet address

Usage:
    wallet_new_address

Returns:
    (str) New wallet address in base58
```

## wallet_public_key

```text
Get public key from wallet address

Usage:
    wallet_public_key (<address> | --address=<address>)

Returns:
    (list) list of public keys associated with address.
        Could contain more than one public key if multisig.
```

## wallet_send

```text
Send credits. If given an address, send credits to it. If given a claim id, send a tip
to the owner of a claim specified by uri. A tip is a claim support where the recipient
of the support is the claim address for the claim being supported.

Usage:
    wallet_send (<amount> | --amount=<amount>)
                ((<address> | --address=<address>) | (<claim_id> | --claim_id=<claim_id>))

Return:
    If sending to an address:
    (bool) true if payment successfully scheduled

    If sending a claim tip:
    (dict) Dictionary containing the result of the support
    {
        txid : (str) txid of resulting support claim
        nout : (int) nout of the resulting support claim
        fee : (float) fee paid for the transaction
    }
```

## wallet_unused_address

```text
Return an address containing no balance, will create
a new address if there is none.

Usage:
    wallet_unused_address

Returns:
    (str) Unused wallet address in base58
```


text:
layout: post
title:  Perl 6 changes - 2013W06
---
This time without any gimmicks (like five word sentences). This will be
simple description of changes I do regularly.

### New features (this time without building stuff part)
#### Rakudo Perl
* Constant folded `^..^` (infix) and `^` (prefix) operators.

#### Niecza Perl
* Added (borrowed from Rakudo Perl) the `Match.gist` method.
* Replaced "Unhandle conext character" error with "Unhandle con**t**ext
  character" error.
* Added Cool.set method. It can be used to convert argument to set.
* Added Cool.bag. Just like method above, it can be used to convert
  argument to bag.