text:
#ifndef ABSTRACTFILTER_H
#define ABSTRACTFILTER_H
#include <QString>
#include <QPainter>
#include <QtPlugin>
#include "model/common/comsequence.h"

class SequenceManager;
class DrawEngine;
class YUV420RGBBuffer;
class FilterLoader;
class SelectionManager;

/*!
 * \brief The FilterContext class
 * Parameters which will be sent to the filter plgins in AbstractFilter Interface
 * Basically it is just pointers to the objects in model, indicating the state of the system.
 */
struct FilterContext
{
    SequenceManager* pcSequenceManager;     /// sequences
    DrawEngine* pcDrawEngine;               /// draw engine
    YUV420RGBBuffer* pcBuffer;              /// yuv and rgb buffer
    FilterLoader* pcFilterLoader;           /// filter loader (all filters are here)
    SelectionManager* pcSelectionManager;   /// selection helper function
};

/*!
 * \brief The AbstractFilter class
 * Interface of the filter plugins
 */
class AbstractFilter
{
public:
    AbstractFilter()
    {
        m_bEnable = false;
        m_strName = "UNKNOWN";
    }

    virtual ~AbstractFilter()
    {
    }

    /*!
     * \brief init is called as soon as loaded in
     * \param pcContext \see FilterContext
     * \return
     */
    virtual bool init     (FilterContext* pcContext)
    {
        return true;
    }

    /*!
     * \brief uninit is called before unload
     * \param pcContext \see FilterContext
     * \return
     */
    virtual bool uninit    (FilterContext* pcContext)
    {
        return true;
    }

    /*!
     * \brief config is called when user push the 'config' button in user interface (or 'config' command in command line)
     *        Generally, we suggest a GUI here for adjusting the parameters for filters.
     * \param pcContext \see FilterContext
     * \return
     */
    virtual bool config   (FilterContext* pcContext)
    {
        return true;
    }

    /*!
     * \brief drawFrame is called for every frame
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcSequence sequence which is selected as the currently displaying one
     * \param iPoc the POC of currently displaying frame (begin with 0)
     * \return true - success   false - fail
     */
    virtual bool drawFrame(FilterContext* pcContext, QPainter* pcPainter,
                           ComFrame *pcFrame, double dScale, QRect* pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief drawTile is called for every frame
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcSequence sequence which is selected as the currently displaying one
     * \param iPoc the POC of currently displaying frame (begin with 0)
     * \return true - success   false - fail
     */
    virtual bool drawTile(FilterContext *pcContext, QPainter *pcPainter, ComTile *pcTile, double dScale, QRect *pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief drawCTU is called for each CTU (Coding Tree Unit, i.e. LCU)
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcCU the CTU(i.e. LCU) to be draw
     * \param dScale the scale of current display
     * \param pcScaledArea the scaled size of current PU
     * \return
     */
    virtual bool drawCTU(FilterContext* pcContext, QPainter* pcPainter,
                         ComCU *pcCTU, double dScale, QRect* pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief drawCU is called for each leaf CU (each leaf node of the Coding Tree Unit )
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcCU the CU to be draw
     * \param dScale the scale of current display
     * \param pcScaledArea the scaled size of current PU
     * \return
     */
    virtual bool drawCU   (FilterContext* pcContext, QPainter* pcPainter,
                           ComCU *pcCU, double dScale,  QRect* pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief drawPU
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcPU the PU to be draw
     * \param dScale the scale of current display
     * \param pcScaledArea the scaled size of current PU
     * \return
     */
    virtual bool drawPU   (FilterContext* pcContext, QPainter* pcPainter,
                           ComPU *pcPU, double dScale,  QRect* pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief drawTU
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcTU the TU to be draw
     * \param dScale the scale of current display
     * \param pcScaledArea the scaled size of current PU
     * \return
     */
    virtual bool drawTU   (FilterContext* pcContext, QPainter* pcPainter,
                           ComTU *pcTU, double dScale,  QRect* pcScaledArea)
    {
        return true;
    }

    /*!
     * \brief mousePress when user press mouse button on the dispalyed frame
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param pcUnscaledPos position in the unscaled frame
     * \param pcScaledPos position in the scaled frame
     * \param dScale the scale of current display
     * \param eMouseBtn mouse button that is pressed
     * \return
     */
    virtual bool mousePress(FilterContext* pcContext, QPainter* pcPainter, ComFrame *pcFrame,
                            const QPointF* pcUnscaledPos, const QPointF* pcScaledPos,
                            double dScale, Qt::MouseButton eMouseBtn)
    {
        return true;
    }

    /*!
     * \brief keyPress when user press a key
     * \param pcContext \see FilterContext
     * \param pcPainter the QPainter of the QPixmap object which is being displayed on screen
     * \param iKeyPressed position in the unscaled frame
     * \return
     */
    virtual bool keyPress  (FilterContext* pcContext, QPainter* pcPainter, ComFrame *pcFrame,
                            int iKeyPressed)
    {
        return true;
    }

    /*! This is the filter name displayed in the user interface
     */
    ADD_CLASS_FIELD(QString, strName, getName, setName)

    /*! This is the switch for turn off or on this filter
     *  false - this filter will not be applied
     *  true  - this filter will be applied
     */
    ADD_CLASS_FIELD(bool, bEnable, getEnable, setEnable)

};

/// This is required by the Qt plugin system.
Q_DECLARE_INTERFACE(AbstractFilter, "cn.edu.sysu.gitl.gitlhevcanalyzer.AbstractFilter")
Q_DECLARE_METATYPE(AbstractFilter*)

#endif // ABSTRACTFILTER_H


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <typeAliases>
        <typeAlias alias="User" type="ledweb.model.User"/>
        <typeAlias alias="Teacher" type="ledweb.model.Teacher"/>
        <typeAlias alias="Student" type="ledweb.model.Student"/>
        <typeAlias alias="Product" type="ledweb.model.Product"/>
        <typeAlias alias="Category" type="ledweb.model.Category"/>
        <typeAlias alias="Spec" type="ledweb.model.Spec"/>
        <typeAlias alias="Type" type="ledweb.model.Type"/>
        <typeAlias alias="Order" type="ledweb.model.Order"/>
        <typeAlias alias="ProductSpec" type="ledweb.model.ProductSpec"/>
        <typeAlias alias="ProductType" type="ledweb.model.ProductType"/>
        <typeAlias alias="TypeGroup" type="ledweb.model.TypeGroup"/>
        <typeAlias alias="LEDbenefits" type="ledweb.model.LEDbenefits"/>
        <typeAlias alias="Glossary" type="ledweb.model.Glossary"/>
        <typeAlias alias="AboutUS" type="ledweb.model.AboutUs"/>
        <typeAlias alias="ContactUs" type="ledweb.model.ContactUs"/>
        <typeAlias alias="HomeImage" type="ledweb.model.HomeImage"/>
        <typeAlias alias="OrderType" type="ledweb.model.OrderType"/>
        <typeAlias alias="Trade" type="ledweb.model.Trade"/>
        <typeAlias alias="UserTrade" type="ledweb.model.UserTrade"/>

    </typeAliases>

    <environments default="development">
        <environment id="development">
        <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
            <property name="driver" value="com.mysql.jdbc.Driver"/>

             <!--<property name="url" value="jdbc:mysql://localhost:3306/mydb" />
            <property name="username" value="hive"/>
            <property name="password" value="123!@#QWEqwe"/>-->

           <property name="url" value="jdbc:mysql://192.168.103.18:3306/mydb" />
            <property name="username" value="hive"/>
            <property name="password" value="hive"/>

            </dataSource>
        </environment>
    </environments>

    <mappers>
        <mapper resource="ledweb/model/User.xml"/>
        <mapper resource="ledweb/model/Product.xml"/>
        <mapper resource="ledweb/model/Category.xml"/>
        <mapper resource="ledweb/model/Spec.xml"/>
        <mapper resource="ledweb/model/ProductSpec.xml"/>
        <mapper resource="ledweb/model/Type.xml"/>
        <mapper resource="ledweb/model/ProductType.xml"/>
        <mapper resource="ledweb/model/Order.xml"/>
        <mapper resource="ledweb/model/mapper/TeacherMapper.xml"/>
        <mapper resource="ledweb/model/TypeGroup.xml"/>
        <mapper resource="ledweb/model/LEDbenefits.xml"/>
        <mapper resource="ledweb/model/Glossary.xml"/>
        <mapper resource="ledweb/model/AboutUs.xml"/>
        <mapper resource="ledweb/model/ContactUs.xml"/>
        <mapper resource="ledweb/model/HomeImage.xml"/>
        <mapper resource="ledweb/model/OrderType.xml"/>
        <mapper resource="ledweb/model/Trade.xml"/>
        <mapper resource="ledweb/model/UserTrade.xml"/>
    </mappers>
</configuration>

redpajama_set_name: RedPajamaGithub


text:
package cloudstack

import (
	"encoding/json"
	"fmt"
	"net/url"
	"strconv"
	"strings"
)

type CreatePortableIpRangeParams struct {
	p map[string]interface{}
}

func (p *CreatePortableIpRangeParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["endip"]; found {
		u.Set("endip", v.(string))
	}
	if v, found := p.p["gateway"]; found {
		u.Set("gateway", v.(string))
	}
	if v, found := p.p["netmask"]; found {
		u.Set("netmask", v.(string))
	}
	if v, found := p.p["regionid"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("regionid", vv)
	}
	if v, found := p.p["startip"]; found {
		u.Set("startip", v.(string))
	}
	if v, found := p.p["vlan"]; found {
		u.Set("vlan", v.(string))
	}
	return u
}

func (p *CreatePortableIpRangeParams) SetEndip(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["endip"] = v
	return
}

func (p *CreatePortableIpRangeParams) SetGateway(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["gateway"] = v
	return
}

func (p *CreatePortableIpRangeParams) SetNetmask(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["netmask"] = v
	return
}

func (p *CreatePortableIpRangeParams) SetRegionid(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["regionid"] = v
	return
}

func (p *CreatePortableIpRangeParams) SetStartip(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["startip"] = v
	return
}

func (p *CreatePortableIpRangeParams) SetVlan(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["vlan"] = v
	return
}

// You should always use this function to get a new CreatePortableIpRangeParams instance,
// as then you are sure you have configured all required params
func (s *PortableIPService) NewCreatePortableIpRangeParams(endip string, gateway string, netmask string, regionid int, startip string) *CreatePortableIpRangeParams {
	p := &CreatePortableIpRangeParams{}
	p.p = make(map[string]interface{})
	p.p["endip"] = endip
	p.p["gateway"] = gateway
	p.p["netmask"] = netmask
	p.p["regionid"] = regionid
	p.p["startip"] = startip
	return p
}

// adds a range of portable public IP's to a region
func (s *PortableIPService) CreatePortableIpRange(p *CreatePortableIpRangeParams) (*CreatePortableIpRangeResponse, error) {
	resp, err := s.cs.newRequest("createPortableIpRange", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r CreatePortableIpRangeResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type CreatePortableIpRangeResponse struct {
	JobID             string `json:"jobid,omitempty"`
	Endip             string `json:"endip,omitempty"`
	Gateway           string `json:"gateway,omitempty"`
	Id                string `json:"id,omitempty"`
	Netmask           string `json:"netmask,omitempty"`
	Portableipaddress []struct {
		Accountid         string `json:"accountid,omitempty"`
		Allocated         string `json:"allocated,omitempty"`
		Domainid          string `json:"domainid,omitempty"`
		Ipaddress         string `json:"ipaddress,omitempty"`
		Networkid         string `json:"networkid,omitempty"`
		Physicalnetworkid string `json:"physicalnetworkid,omitempty"`
		Regionid          int    `json:"regionid,omitempty"`
		State             string `json:"state,omitempty"`
		Vpcid             string `json:"vpcid,omitempty"`
		Zoneid            string `json:"zoneid,omitempty"`
	} `json:"portableipaddress,omitempty"`
	Regionid int    `json:"regionid,omitempty"`
	Startip  string `json:"startip,omitempty"`
	Vlan     string `json:"vlan,omitempty"`
}

type DeletePortableIpRangeParams struct {
	p map[string]interface{}
}

func (p *DeletePortableIpRangeParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	return u
}

func (p *DeletePortableIpRangeParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

// You should always use this function to get a new DeletePortableIpRangeParams instance,
// as then you are sure you have configured all required params
func (s *PortableIPService) NewDeletePortableIpRangeParams(id string) *DeletePortableIpRangeParams {
	p := &DeletePortableIpRangeParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}

// deletes a range of portable public IP's associated with a region
func (s *PortableIPService) DeletePortableIpRange(p *DeletePortableIpRangeParams) (*DeletePortableIpRangeResponse, error) {
	resp, err := s.cs.newRequest("deletePortableIpRange", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeletePortableIpRangeResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type DeletePortableIpRangeResponse struct {
	JobID       string `json:"jobid,omitempty"`
	Displaytext string `json:"displaytext,omitempty"`
	Success     bool   `json:"success,omitempty"`
}

type ListPortableIpRangesParams struct {
	p map[string]interface{}
}

func (p *ListPortableIpRangesParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	if v, found := p.p["keyword"]; found {
		u.Set("keyword", v.(string))
	}
	if v, found := p.p["page"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("page", vv)
	}
	if v, found := p.p["pagesize"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("pagesize", vv)
	}
	if v, found := p.p["regionid"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("regionid", vv)
	}
	return u
}

func (p *ListPortableIpRangesParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

func (p *ListPortableIpRangesParams) SetKeyword(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["keyword"] = v
	return
}

func (p *ListPortableIpRangesParams) SetPage(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["page"] = v
	return
}

func (p *ListPortableIpRangesParams) SetPagesize(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["pagesize"] = v
	return
}

func (p *ListPortableIpRangesParams) SetRegionid(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["regionid"] = v
	return
}

// You should always use this function to get a new ListPortableIpRangesParams instance,
// as then you are sure you have configured all required params
func (s *PortableIPService) NewListPortableIpRangesParams() *ListPortableIpRangesParams {
	p := &ListPortableIpRangesParams{}
	p.p = make(map[string]interface{})
	return p
}

// This is a courtesy helper function, which in some cases may not work as expected!
func (s *PortableIPService) GetPortableIpRangeByID(id string, opts ...OptionFunc) (*PortableIpRange, int, error) {
	p := &ListPortableIpRangesParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range opts {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListPortableIpRanges(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.PortableIpRanges[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for PortableIpRange UUID: %s!", id)
}

// list portable IP ranges
func (s *PortableIPService) ListPortableIpRanges(p *ListPortableIpRangesParams) (*ListPortableIpRangesResponse, error) {
	resp, err := s.cs.newRequest("listPortableIpRanges", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListPortableIpRangesResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}
	return &r, nil
}

type ListPortableIpRangesResponse struct {
	Count            int                `json:"count"`
	PortableIpRanges []*PortableIpRange `json:"portableiprange"`
}

type PortableIpRange struct {
	Endip             string `json:"endip,omitempty"`
	Gateway           string `json:"gateway,omitempty"`
	Id                string `json:"id,omitempty"`
	Netmask           string `json:"netmask,omitempty"`
	Portableipaddress []struct {
		Accountid         string `json:"accountid,omitempty"`
		Allocated         string `json:"allocated,omitempty"`
		Domainid          string `json:"domainid,omitempty"`
		Ipaddress         string `json:"ipaddress,omitempty"`
		Networkid         string `json:"networkid,omitempty"`
		Physicalnetworkid string `json:"physicalnetworkid,omitempty"`
		Regionid          int    `json:"regionid,omitempty"`
		State             string `json:"state,omitempty"`
		Vpcid             string `json:"vpcid,omitempty"`
		Zoneid            string `json:"zoneid,omitempty"`
	} `json:"portableipaddress,omitempty"`
	Regionid int    `json:"regionid,omitempty"`
	Startip  string `json:"startip,omitempty"`
	Vlan     string `json:"vlan,omitempty"`
}


text:
package io.github.resilience4j.ratpack.circuitbreaker;

import com.google.inject.Inject;
import io.github.resilience4j.circuitbreaker.CircuitBreakerOpenException;
import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry;
import io.github.resilience4j.ratpack.recovery.RecoveryFunction;
import io.github.resilience4j.reactor.circuitbreaker.operator.CircuitBreakerOperator;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import ratpack.exec.Promise;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;

/**
 * A {@link MethodInterceptor} to handle all methods annotated with {@link CircuitBreaker}. It will
 * handle methods that return a Promise, Observable, Flowable, CompletionStage, or value. It will execute the circuit breaker and
 * the fallback found in the annotation.
 */
public class CircuitBreakerMethodInterceptor implements MethodInterceptor {

    @Inject(optional = true)
    private CircuitBreakerRegistry registry;

    @SuppressWarnings("unchecked")
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        CircuitBreaker annotation = invocation.getMethod().getAnnotation(CircuitBreaker.class);
        RecoveryFunction<?> recoveryFunction = annotation.recovery().newInstance();
        if (registry == null) {
            registry = CircuitBreakerRegistry.ofDefaults();
        }
        io.github.resilience4j.circuitbreaker.CircuitBreaker breaker = registry.circuitBreaker(annotation.name());
        if (breaker == null) {
            return invocation.proceed();
        }
        Class<?> returnType = invocation.getMethod().getReturnType();
        if (Promise.class.isAssignableFrom(returnType)) {
            Promise<?> result = (Promise<?>) proceed(invocation, breaker, recoveryFunction);
            if (result != null) {
                CircuitBreakerTransformer transformer = CircuitBreakerTransformer.of(breaker).recover(recoveryFunction);
                result = result.transform(transformer);
            }
            return result;
        } else if (Flux.class.isAssignableFrom(returnType)) {
            Flux<?> result = (Flux<?>) proceed(invocation, breaker, recoveryFunction);
            if (result != null) {
                CircuitBreakerOperator operator = CircuitBreakerOperator.of(breaker);
                result = recoveryFunction.onErrorResume(result.transform(operator));
            }
            return result;
        } else if (Mono.class.isAssignableFrom(returnType)) {
            Mono<?> result = (Mono<?>) proceed(invocation, breaker, recoveryFunction);
            if (result != null) {
                CircuitBreakerOperator operator = CircuitBreakerOperator.of(breaker);
                result = recoveryFunction.onErrorResume(result.transform(operator));
            }
            return result;
        } else if (CompletionStage.class.isAssignableFrom(returnType)) {
            final CompletableFuture promise = new CompletableFuture<>();
            if (breaker.isCallPermitted()) {
                CompletionStage<?> result = (CompletionStage<?>) proceed(invocation, breaker, recoveryFunction);
                if (result != null) {
                    long start = System.nanoTime();
                    result.whenComplete((v, t) -> {
                        long durationInNanos = System.nanoTime() - start;
                        if (t != null) {
                            breaker.onError(durationInNanos, t);
                            try {
                                promise.complete(recoveryFunction.apply((Throwable) t));
                            } catch (Exception e) {
                                promise.completeExceptionally(e);
                            }
                        } else {
                            breaker.onSuccess(durationInNanos);
                            promise.complete(v);
                        }
                    });
                }
            } else {
                Throwable t = new CircuitBreakerOpenException(String.format("CircuitBreaker '%s' is open", breaker.getName()));
                try {
                    promise.complete(recoveryFunction.apply((Throwable) t));
                } catch (Throwable t2) {
                    promise.completeExceptionally(t2);
                }
            }
            return promise;
        }
        return proceed(invocation, breaker, recoveryFunction);
    }

    private Object proceed(MethodInvocation invocation, io.github.resilience4j.circuitbreaker.CircuitBreaker breaker, RecoveryFunction<?> recoveryFunction) throws Throwable {
        Object result;
        long start = System.nanoTime();
        try {
            result = invocation.proceed();
        } catch (Exception e) {
            long durationInNanos = System.nanoTime() - start;
            breaker.onError(durationInNanos, e);
            return recoveryFunction.apply(e);
        }
        return result;
    }

}


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

describe('TODO', function() {
  it('does what its supposed to do', function() {
    assert(true, true, 'actual tests');
  });
});


text:
@REM /* --------------------- */
@REM Copyright Contributors to the Open Shading Language project.
@REM SPDX-License-Identifier: BSD-3-Clause
@REM /* --------------------- */

@REM Running OSLToy in debug mode

@echo off

call osl_env_vars_setup.bat

cls

set PATH=%PYTHON_LOCATION%;%PYTHON_LOCATION%/Scripts;%QT_LOCATION%/bin;%QT_LOCATION%/lib;%BASE_LOCATION%/osl_debug/bin;%BASE_LOCATION%/osl_debug/lib;%PATH%
set PYTHONPATH=%PYTHON_LOCATION%/Lib/site-packages;

osltoy


text:
<?php

// Manual usage:
// php update-packagist.org.php --project TYPO3CMS/Extensions/rss_display --branch master

// parse parameters into sth. easier to access, namely into $args
$args = array();
for ($i = 1; $i < $_SERVER['argc']; $i++) {
	if (substr($_SERVER['argv'][$i], 0, 2) == '--') {
		$optionName = substr($_SERVER['argv'][$i], 2);
		$args[$optionName] = $_SERVER['argv'][$i + 1];
		$i++;
	} else {
		echo "Ignored unexpected parameter #" . $i . ": " . $_SERVER['argv'][$i];
	}
}

// log input parameters
$parametersGiven = array();
foreach ($args as $key => $value) {
	$parametersGiven[] = $key . ":" . $value;
}
echo "Executing hook file " . __FILE__ . " (" . implode(", ", $parametersGiven) . ")";
unset($parametersGiven);

///////////// START REAL WORK ////////////////////

// Hook into Packagist
exec('GIT_DIR=/var/gerrit/review/git/' . $args['project'] . '.git/ git cat-file blob ' . $args['branch'] . ':composer.json', $composerJson, $result);
if ($result === 0 && !empty($composerJson)) {
	$composerJson = json_decode(implode('', $composerJson));
	if (is_object($composerJson) && !empty($composerJson->name)) {

		// We have a composer.json in our branch, check for packagist package to update
		$http = curl_init('https://packagist.org/packages/' . $composerJson->name);
		curl_setopt($http, CURLOPT_RETURNTRANSFER, TRUE);
		$result = curl_exec($http);
		$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE);
		curl_close($http);
		if ($http_status === 200) {

			// Package is found on packagist, request an update
			$url = sprintf('curl -X PUT -d username=%s -d apiToken=%s -d update=1 --silent https://packagist.org/packages/%s',
				'typo3', // Packagist username
				'<%= @token %>', // API Token
				$composerJson->name
			);

			exec($url, $result);

			$message = 'something unexpected went wrong';
			if (!empty($result)) {
				$message = implode("\n", $result);
			}
			echo chr(10);
			echo 'Update ' . $composerJson->name . ' on packagist.org returned: ' . $message;
			echo chr(10);

			# Fabien: I had trouble with this code and replaced by a plain curl command.
			#$put = curl_init('https://packagist.org/packages/' . $composerJson->name);
			#curl_setopt($put, CURLOPT_POSTFIELDS, array(
			#	'update_package' => 1,
			#	'username' => 'typo3',
			#	'apiToken' => '4k6vm79r45c0g4o848wk'
			#));
			#curl_setopt($put, CURLOPT_CUSTOMREQUEST, 'PUT');
			#curl_setopt($put, CURLOPT_RETURNTRANSFER, TRUE);
			#$result = curl_exec($put);
			#$put_status = curl_getinfo($put, CURLINFO_HTTP_CODE);
			#curl_close($put);
			#echo 'Update ' . $composerJson->name . ' on packagist.org returned status: ' . $put_status;
		}
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Tap Water in Ljubljana</title>
  <meta name="description" content="Tap water locations in Ljubljana">
  <meta name="author" content="Miha Rekar">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <link href="https://fonts.googleapis.com/css?family=Roboto&subset=latin,cyrillic-ext" rel="stylesheet">
  <link href="css/main.css" rel="stylesheet">


text:
#include "Base/BaseTypes.h"

#include <AssetCache/AssetCacheClient.h>

class CacheRequest;
class ClientApplication final
{
public:
    ClientApplication();
    ~ClientApplication();

    bool ParseCommandLine(const DAVA::Vector<DAVA::String>& cmdLine);

    DAVA::AssetCache::Error GetExitCode() const
    {
        return exitCode;
    };

    void Process();

private:
    void PrintUsage() const;

private:
    DAVA::AssetCache::Error exitCode = DAVA::AssetCache::Error::WRONG_COMMAND_LINE;

    DAVA::List<std::unique_ptr<CacheRequest>> requests;
    CacheRequest* activeRequest = nullptr;

    DAVA::AssetCacheClient cacheClient;
};

#endif //__CLIENT_APPLICATION_H__


text:
Membership

                    <?php echo $this->session->flashdata('alert_msg'); ?>

                <?php
                    $user_id = $this->session->userdata('user_id');
                    $current_date = date('Y-m-d H:i:s');
                    $membership = check_membership($user_id);
                    if($membership != FALSE){
                        if($membership->status == 'Authorised' && $membership->membership_expired > $current_date){
                ?>

Your Current Plan is
                                <?php if($membership->amount == "18.99"){ ?>
                                $18.99/Month - 1 Month Subscription
                                <?php }else if($membership->amount == "47.97"){ ?>
                                $15.99/Month - 3 Month Subscription
                                <?php }else if($membership->amount == "89.94"){ ?>
                                $14.99/Month - 6 Month Subscription
                                <?php }else if($membership->amount == "167.88"){ ?>
                                $13.99/Month - 12 Month Subscription
                                <?php } ?>

Purchased on <?php echo date('d, M Y',strtotime($membership->created_at)); ?>

Expired on <?php echo date('d, M Y',strtotime($membership->membership_expired)); ?>

Your Transaction Ref no : <?php echo $membership->trans_ref; ?>

                <?php
                        }else if($membership->status == 'Authorised' && $membership->membership_expired < $current_date){
                ?>
Your Plan is Expired select package to Renew

                        <?php
                            echo form_open('telr');
                        ?>

                                <input name="ivp_amount" value="18.99" type="radio" required id="problem1">
                                1 Month
 $18.99

                                <input name="ivp_amount" value="47.97" type="radio" required id="problem2">
                                3 Month
 $15.99

                                <input name="ivp_amount" value="89.94" type="radio" required id="problem3">
                                6 Month
 $14.99

                                <input name="ivp_amount" value="167.88" type="radio" required id="problem4">
                                12 Month
 $13.99

                            <input name="ivp_method" value="create" type="hidden">
                            <input name="ivp_store" value="18194" type="hidden">
                        <input name="ivp_authkey" value="qsSt^bfbXX@fk7p8" type="hidden">
                        <input name="ivp_currency" value="USD" type="hidden">
                            <input name="ivp_test" value="0" type="hidden">
                            <input name="ivp_desc" value="Membership Plan" type="hidden">
                            <input name="return_auth" value="<?php echo base_url('telr/success'); ?>" type="hidden">
                            <input name="return_decl" value="<?php echo base_url('telr/success'); ?>" type="hidden">
                            <input name="return_can" value="<?php echo base_url('telr/cancel'); ?>" type="hidden">

                            <input value="Renew Membership" name="submit" class="btn btn-primary waves-effect" type="submit">

                        </form>
                <?php
                        }
                    }else {
                ?>

                    <?php
                        echo form_open('telr');
                    ?>

                            <input name="ivp_amount" value="18.99" type="radio" required id="problem1">
                            1 Month
 $18.99

                            <input name="ivp_amount" value="47.97" type="radio" required id="problem2">
                            3 Month
 $15.99

                            <input name="ivp_amount" value="89.94" type="radio" required id="problem3">
                            6 Month
 $14.99

                            <input name="ivp_amount" value="167.88" type="radio" required id="problem4">
                            12 Month
 $13.99

                        <input name="ivp_method" value="sale" type="hidden">
                        <input name="ivp_store" value="18194" type="hidden">
                        <input name="ivp_authkey" value="qsSt^bfbXX@fk7p8" type="hidden">
                        <input name="ivp_currency" value="USD" type="hidden">
                        <input name="ivp_test" value="0" type="hidden">
                        <input name="ivp_desc" value="Membership Plan" type="hidden">
                        <input name="return_auth" value="<?php echo base_url('telr/success'); ?>" type="hidden">
                        <input name="return_decl" value="<?php echo base_url('telr/success'); ?>" type="hidden">
                        <input name="return_can" value="<?php echo base_url('telr/cancel'); ?>" type="hidden">

                        <input value="Purchase Membership" name="submit" class="btn btn-primary waves-effect" type="submit">

                    </form>

                <?php
                    }
                ?>


text:
var validate = require('./validation.js').validate
var evaluate = require('./evaluation.js').evaluate

exports.validate = validate;
exports.evaluate = evaluate;


text:
package org.wso2.carbon.esb.mediator.test.xquery;

import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;

import static org.testng.Assert.assertTrue;

public class XQueryIntegrationTestCase extends ESBIntegrationTest {
    @BeforeClass(alwaysRun = true)
    public void uploadSynapseConfig() throws Exception {
        super.init();
    }

    //use SimpleURLRegistry
    @Test(groups = {"wso2.esb"}, description = "Introduction to the XQuery mediator", enabled = false)
    public void testXQueryTransformation() throws AxisFault {
        OMElement response;

        response = axis2Client.sendCustomQuoteRequest(null,
                getProxyServiceURLHttp("xQueryMediatorIntegrationTestProxy"), "IBM");
        assertTrue(response.toString().contains("IBM"));

    }

    @AfterClass(alwaysRun = true)
    private void destroy() throws Exception {
        super.cleanup();
    }
}


text:
cask 'font-geostar-fill' do
  version :latest
  sha256 :no_check

  # github.com/google/fonts was verified as official when first introduced to the cask
  url 'https://github.com/google/fonts/raw/master/ofl/geostarfill/GeostarFill-Regular.ttf'
  name 'Geostar Fill'
  homepage 'http://www.google.com/fonts/specimen/Geostar+Fill'

  font 'GeostarFill-Regular.ttf'
end


text:
Partial Public Class ManipulateImage
    Inherits System.Web.UI.Page
#Else
    <ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never), ComponentModel.ToolboxItem(False)> _
    Partial Public Class ManipulateImage
        Inherits System.Web.UI.Page
#End If
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        End Sub

    End Class


text:
'use strict';

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Distributor = function Distributor() {
  _classCallCheck(this, Distributor);
};

var Packet = function Packet() {
  _classCallCheck(this, Packet);
};

var Mutator = function Mutator() {
  _classCallCheck(this, Mutator);
};

var Source = function Source() {
  _classCallCheck(this, Source);
};

var message = void 0;
var source = void 0;

// initialization
message = new Template('#message');

// generation
greeting = new Source({
  title: 'Untitled Document',
  from: 'Anonymous',
  content: 'Hello, world!'
});

// preperation
message.pipe(greeting);

// destination
message.pipe('#messages');

/* Optional // */

var helper = void 0;
var synchronization = void 0;

// mutation

// work with objects
function timestamp(input) {
  return { now: new Date() }; // output
}

// work with elements
function virus(input) {
  return Alchemist.synthesize(disease).infect(input);
}

helper = new Mutator(timestamp);
synchronization = new Mutator(virus);

// will be sorted automatically

message.pipe(helper);
message.pipe(synchronization);

greeting.update({ title: 'Greetings!' });


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/recentButton"
        android:layout_width="95dp"
        android:layout_height="95dp"
        android:background="@drawable/button_last_used_app" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:paddingTop="10dp" >

        <ImageView
            android:id="@android:id/background"
            android:layout_width="@dimen/app_icon_size"
            android:layout_height="@dimen/app_icon_size"
            android:clickable="false" />

        <TextView
            android:id="@android:id/text1"
            style="@style/IconText"
            android:layout_width="95dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:clickable="false"
            android:includeFontPadding="false"
            android:lines="2" />
    </LinearLayout>

</FrameLayout>


text:
SnsPhwatch
==========

Small php app to monitor Aws Sns topics


text:
<?php

/* ====================
 * [BEGIN_COT_EXT]
 * Code=paymasterbilling
 * Name=PayMaster
 * Category=Payments
 * Description=Система оплаты PayMaster
 * Version=1.0.0
 * Date=
 * Author=Yahor Nikitsionak
 * Notes=
 * Auth_guests=RW
 * Lock_guests=12345A
 * Auth_members=RW
 * Lock_members=12345A
 * Requires_modules=payments
 * [END_COT_EXT]
 *
 * [BEGIN_COT_EXT_CONFIG]
 * testmode=1:radio::1:Тестовый режим
 * merchant_id=2:string::
 * email=7:string::
 * [END_COT_EXT_CONFIG]
 */


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../../../../node_modules/semantic-ui-css/semantic.css"/>

  <sm-rating ng-model="rate" type="heart" size="large" max="max" readonly="isReadonly" on-hover="hoveringOver(value)" on-leave="overStar = null"></sm-rating>
  <div class="ui mini label" ng-class="{'yellow': percent<30, 'blue': percent>=30 && percent<70, 'green': percent>=70}" ng-show="overStar && !isReadonly">{{percent}}%

Rate: {{rate}} - Readonly is: {{isReadonly}} - Hovering over: {{overStar || "none"}}

Clear

Toggle Readonly


text:
CREATE TABLE [systemsStatus].[dbo].[ss_service_tags](
	[tag_service_id] [int] NOT NULL,
	[tag_value] [nvarchar](50) NOT NULL
)


text:
package com.azure.resourcemanager.kusto.implementation;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.kusto.fluent.models.ClusterInner;
import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner;
import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.kusto.models.AcceptedAudiences;
import com.azure.resourcemanager.kusto.models.AzureSku;
import com.azure.resourcemanager.kusto.models.Cluster;
import com.azure.resourcemanager.kusto.models.ClusterNetworkAccessFlag;
import com.azure.resourcemanager.kusto.models.ClusterUpdate;
import com.azure.resourcemanager.kusto.models.DiagnoseVirtualNetworkResult;
import com.azure.resourcemanager.kusto.models.EngineType;
import com.azure.resourcemanager.kusto.models.FollowerDatabaseDefinition;
import com.azure.resourcemanager.kusto.models.Identity;
import com.azure.resourcemanager.kusto.models.KeyVaultProperties;
import com.azure.resourcemanager.kusto.models.LanguageExtension;
import com.azure.resourcemanager.kusto.models.LanguageExtensionsList;
import com.azure.resourcemanager.kusto.models.OptimizedAutoscale;
import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection;
import com.azure.resourcemanager.kusto.models.ProvisioningState;
import com.azure.resourcemanager.kusto.models.PublicIpType;
import com.azure.resourcemanager.kusto.models.PublicNetworkAccess;
import com.azure.resourcemanager.kusto.models.State;
import com.azure.resourcemanager.kusto.models.TrustedExternalTenant;
import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update {
    private ClusterInner innerObject;

    private final com.azure.resourcemanager.kusto.KustoManager serviceManager;

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public String location() {
        return this.innerModel().location();
    }

    public Map<String, String> tags() {
        Map<String, String> inner = this.innerModel().tags();
        if (inner != null) {
            return Collections.unmodifiableMap(inner);
        } else {
            return Collections.emptyMap();
        }
    }

    public AzureSku sku() {
        return this.innerModel().sku();
    }

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

    public List<String> zones() {
        List<String> inner = this.innerModel().zones();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public Identity identity() {
        return this.innerModel().identity();
    }

    public String etag() {
        return this.innerModel().etag();
    }

    public State state() {
        return this.innerModel().state();
    }

    public ProvisioningState provisioningState() {
        return this.innerModel().provisioningState();
    }

    public String uri() {
        return this.innerModel().uri();
    }

    public String dataIngestionUri() {
        return this.innerModel().dataIngestionUri();
    }

    public String stateReason() {
        return this.innerModel().stateReason();
    }

    public List<TrustedExternalTenant> trustedExternalTenants() {
        List<TrustedExternalTenant> inner = this.innerModel().trustedExternalTenants();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public OptimizedAutoscale optimizedAutoscale() {
        return this.innerModel().optimizedAutoscale();
    }

    public Boolean enableDiskEncryption() {
        return this.innerModel().enableDiskEncryption();
    }

    public Boolean enableStreamingIngest() {
        return this.innerModel().enableStreamingIngest();
    }

    public VirtualNetworkConfiguration virtualNetworkConfiguration() {
        return this.innerModel().virtualNetworkConfiguration();
    }

    public KeyVaultProperties keyVaultProperties() {
        return this.innerModel().keyVaultProperties();
    }

    public Boolean enablePurge() {
        return this.innerModel().enablePurge();
    }

    public LanguageExtensionsList languageExtensions() {
        return this.innerModel().languageExtensions();
    }

    public Boolean enableDoubleEncryption() {
        return this.innerModel().enableDoubleEncryption();
    }

    public PublicNetworkAccess publicNetworkAccess() {
        return this.innerModel().publicNetworkAccess();
    }

    public List<String> allowedIpRangeList() {
        List<String> inner = this.innerModel().allowedIpRangeList();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public EngineType engineType() {
        return this.innerModel().engineType();
    }

    public List<AcceptedAudiences> acceptedAudiences() {
        List<AcceptedAudiences> inner = this.innerModel().acceptedAudiences();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public Boolean enableAutoStop() {
        return this.innerModel().enableAutoStop();
    }

    public ClusterNetworkAccessFlag restrictOutboundNetworkAccess() {
        return this.innerModel().restrictOutboundNetworkAccess();
    }

    public List<String> allowedFqdnList() {
        List<String> inner = this.innerModel().allowedFqdnList();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public PublicIpType publicIpType() {
        return this.innerModel().publicIpType();
    }

    public String virtualClusterGraduationProperties() {
        return this.innerModel().virtualClusterGraduationProperties();
    }

    public List<PrivateEndpointConnection> privateEndpointConnections() {
        List<PrivateEndpointConnectionInner> inner = this.innerModel().privateEndpointConnections();
        if (inner != null) {
            return Collections
                .unmodifiableList(
                    inner
                        .stream()
                        .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()))
                        .collect(Collectors.toList()));
        } else {
            return Collections.emptyList();
        }
    }

    public Region region() {
        return Region.fromName(this.regionName());
    }

    public String regionName() {
        return this.location();
    }

    public String resourceGroupName() {
        return resourceGroupName;
    }

    public ClusterInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.kusto.KustoManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String clusterName;

    private String createIfMatch;

    private String createIfNoneMatch;

    private String updateIfMatch;

    private ClusterUpdate updateParameters;

    public ClusterImpl withExistingResourceGroup(String resourceGroupName) {
        this.resourceGroupName = resourceGroupName;
        return this;
    }

    public Cluster create() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .createOrUpdate(
                    resourceGroupName, clusterName, this.innerModel(), createIfMatch, createIfNoneMatch, Context.NONE);
        return this;
    }

    public Cluster create(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .createOrUpdate(
                    resourceGroupName, clusterName, this.innerModel(), createIfMatch, createIfNoneMatch, context);
        return this;
    }

    ClusterImpl(String name, com.azure.resourcemanager.kusto.KustoManager serviceManager) {
        this.innerObject = new ClusterInner();
        this.serviceManager = serviceManager;
        this.clusterName = name;
        this.createIfMatch = null;
        this.createIfNoneMatch = null;
    }

    public ClusterImpl update() {
        this.updateIfMatch = null;
        this.updateParameters = new ClusterUpdate();
        return this;
    }

    public Cluster apply() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .update(resourceGroupName, clusterName, updateParameters, updateIfMatch, Context.NONE);
        return this;
    }

    public Cluster apply(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .update(resourceGroupName, clusterName, updateParameters, updateIfMatch, context);
        return this;
    }

    ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.kusto.KustoManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
        this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
        this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters");
    }

    public Cluster refresh() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE)
                .getValue();
        return this;
    }

    public Cluster refresh(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getClusters()
                .getByResourceGroupWithResponse(resourceGroupName, clusterName, context)
                .getValue();
        return this;
    }

    public void stop() {
        serviceManager.clusters().stop(resourceGroupName, clusterName);
    }

    public void stop(Context context) {
        serviceManager.clusters().stop(resourceGroupName, clusterName, context);
    }

    public void start() {
        serviceManager.clusters().start(resourceGroupName, clusterName);
    }

    public void start(Context context) {
        serviceManager.clusters().start(resourceGroupName, clusterName, context);
    }

    public PagedIterable<FollowerDatabaseDefinition> listFollowerDatabases() {
        return serviceManager.clusters().listFollowerDatabases(resourceGroupName, clusterName);
    }

    public PagedIterable<FollowerDatabaseDefinition> listFollowerDatabases(Context context) {
        return serviceManager.clusters().listFollowerDatabases(resourceGroupName, clusterName, context);
    }

    public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove) {
        serviceManager.clusters().detachFollowerDatabases(resourceGroupName, clusterName, followerDatabaseToRemove);
    }

    public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove, Context context) {
        serviceManager
            .clusters()
            .detachFollowerDatabases(resourceGroupName, clusterName, followerDatabaseToRemove, context);
    }

    public DiagnoseVirtualNetworkResult diagnoseVirtualNetwork() {
        return serviceManager.clusters().diagnoseVirtualNetwork(resourceGroupName, clusterName);
    }

    public DiagnoseVirtualNetworkResult diagnoseVirtualNetwork(Context context) {
        return serviceManager.clusters().diagnoseVirtualNetwork(resourceGroupName, clusterName, context);
    }

    public PagedIterable<LanguageExtension> listLanguageExtensions() {
        return serviceManager.clusters().listLanguageExtensions(resourceGroupName, clusterName);
    }

    public PagedIterable<LanguageExtension> listLanguageExtensions(Context context) {
        return serviceManager.clusters().listLanguageExtensions(resourceGroupName, clusterName, context);
    }

    public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd) {
        serviceManager.clusters().addLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToAdd);
    }

    public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd, Context context) {
        serviceManager
            .clusters()
            .addLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToAdd, context);
    }

    public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove) {
        serviceManager.clusters().removeLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToRemove);
    }

    public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove, Context context) {
        serviceManager
            .clusters()
            .removeLanguageExtensions(resourceGroupName, clusterName, languageExtensionsToRemove, context);
    }

    public ClusterImpl withRegion(Region location) {
        this.innerModel().withLocation(location.toString());
        return this;
    }

    public ClusterImpl withRegion(String location) {
        this.innerModel().withLocation(location);
        return this;
    }

    public ClusterImpl withSku(AzureSku sku) {
        if (isInCreateMode()) {
            this.innerModel().withSku(sku);
            return this;
        } else {
            this.updateParameters.withSku(sku);
            return this;
        }
    }

    public ClusterImpl withTags(Map<String, String> tags) {
        if (isInCreateMode()) {
            this.innerModel().withTags(tags);
            return this;
        } else {
            this.updateParameters.withTags(tags);
            return this;
        }
    }

    public ClusterImpl withZones(List<String> zones) {
        this.innerModel().withZones(zones);
        return this;
    }

    public ClusterImpl withIdentity(Identity identity) {
        if (isInCreateMode()) {
            this.innerModel().withIdentity(identity);
            return this;
        } else {
            this.updateParameters.withIdentity(identity);
            return this;
        }
    }

    public ClusterImpl withTrustedExternalTenants(List<TrustedExternalTenant> trustedExternalTenants) {
        if (isInCreateMode()) {
            this.innerModel().withTrustedExternalTenants(trustedExternalTenants);
            return this;
        } else {
            this.updateParameters.withTrustedExternalTenants(trustedExternalTenants);
            return this;
        }
    }

    public ClusterImpl withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) {
        if (isInCreateMode()) {
            this.innerModel().withOptimizedAutoscale(optimizedAutoscale);
            return this;
        } else {
            this.updateParameters.withOptimizedAutoscale(optimizedAutoscale);
            return this;
        }
    }

    public ClusterImpl withEnableDiskEncryption(Boolean enableDiskEncryption) {
        if (isInCreateMode()) {
            this.innerModel().withEnableDiskEncryption(enableDiskEncryption);
            return this;
        } else {
            this.updateParameters.withEnableDiskEncryption(enableDiskEncryption);
            return this;
        }
    }

    public ClusterImpl withEnableStreamingIngest(Boolean enableStreamingIngest) {
        if (isInCreateMode()) {
            this.innerModel().withEnableStreamingIngest(enableStreamingIngest);
            return this;
        } else {
            this.updateParameters.withEnableStreamingIngest(enableStreamingIngest);
            return this;
        }
    }

    public ClusterImpl withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) {
        if (isInCreateMode()) {
            this.innerModel().withVirtualNetworkConfiguration(virtualNetworkConfiguration);
            return this;
        } else {
            this.updateParameters.withVirtualNetworkConfiguration(virtualNetworkConfiguration);
            return this;
        }
    }

    public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) {
        if (isInCreateMode()) {
            this.innerModel().withKeyVaultProperties(keyVaultProperties);
            return this;
        } else {
            this.updateParameters.withKeyVaultProperties(keyVaultProperties);
            return this;
        }
    }

    public ClusterImpl withEnablePurge(Boolean enablePurge) {
        if (isInCreateMode()) {
            this.innerModel().withEnablePurge(enablePurge);
            return this;
        } else {
            this.updateParameters.withEnablePurge(enablePurge);
            return this;
        }
    }

    public ClusterImpl withEnableDoubleEncryption(Boolean enableDoubleEncryption) {
        if (isInCreateMode()) {
            this.innerModel().withEnableDoubleEncryption(enableDoubleEncryption);
            return this;
        } else {
            this.updateParameters.withEnableDoubleEncryption(enableDoubleEncryption);
            return this;
        }
    }

    public ClusterImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        if (isInCreateMode()) {
            this.innerModel().withPublicNetworkAccess(publicNetworkAccess);
            return this;
        } else {
            this.updateParameters.withPublicNetworkAccess(publicNetworkAccess);
            return this;
        }
    }

    public ClusterImpl withAllowedIpRangeList(List<String> allowedIpRangeList) {
        if (isInCreateMode()) {
            this.innerModel().withAllowedIpRangeList(allowedIpRangeList);
            return this;
        } else {
            this.updateParameters.withAllowedIpRangeList(allowedIpRangeList);
            return this;
        }
    }

    public ClusterImpl withEngineType(EngineType engineType) {
        if (isInCreateMode()) {
            this.innerModel().withEngineType(engineType);
            return this;
        } else {
            this.updateParameters.withEngineType(engineType);
            return this;
        }
    }

    public ClusterImpl withAcceptedAudiences(List<AcceptedAudiences> acceptedAudiences) {
        if (isInCreateMode()) {
            this.innerModel().withAcceptedAudiences(acceptedAudiences);
            return this;
        } else {
            this.updateParameters.withAcceptedAudiences(acceptedAudiences);
            return this;
        }
    }

    public ClusterImpl withEnableAutoStop(Boolean enableAutoStop) {
        if (isInCreateMode()) {
            this.innerModel().withEnableAutoStop(enableAutoStop);
            return this;
        } else {
            this.updateParameters.withEnableAutoStop(enableAutoStop);
            return this;
        }
    }

    public ClusterImpl withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess) {
        if (isInCreateMode()) {
            this.innerModel().withRestrictOutboundNetworkAccess(restrictOutboundNetworkAccess);
            return this;
        } else {
            this.updateParameters.withRestrictOutboundNetworkAccess(restrictOutboundNetworkAccess);
            return this;
        }
    }

    public ClusterImpl withAllowedFqdnList(List<String> allowedFqdnList) {
        if (isInCreateMode()) {
            this.innerModel().withAllowedFqdnList(allowedFqdnList);
            return this;
        } else {
            this.updateParameters.withAllowedFqdnList(allowedFqdnList);
            return this;
        }
    }

    public ClusterImpl withPublicIpType(PublicIpType publicIpType) {
        if (isInCreateMode()) {
            this.innerModel().withPublicIpType(publicIpType);
            return this;
        } else {
            this.updateParameters.withPublicIpType(publicIpType);
            return this;
        }
    }

    public ClusterImpl withVirtualClusterGraduationProperties(String virtualClusterGraduationProperties) {
        this.innerModel().withVirtualClusterGraduationProperties(virtualClusterGraduationProperties);
        return this;
    }

    public ClusterImpl withIfMatch(String ifMatch) {
        if (isInCreateMode()) {
            this.createIfMatch = ifMatch;
            return this;
        } else {
            this.updateIfMatch = ifMatch;
            return this;
        }
    }

    public ClusterImpl withIfNoneMatch(String ifNoneMatch) {
        this.createIfNoneMatch = ifNoneMatch;
        return this;
    }

    private boolean isInCreateMode() {
        return this.innerModel().id() == null;
    }
}


text:
<html>
	<head>
		<title>{{ descriptor.service_name }}</title>
		{% include 'sharrock/style.html' %}
	</head>
	<body>
	{% include 'sharrock/descriptor_body.html' %}
	</body>
</html>


text:
function redirectIfNotLoggedIn () {
  var self = this
  if(!Meteor.userId()) {
    Session.set('sendMeBackTo', self.url)
    self.redirect('login')
  } else {
    self.next()
  }
}

Router.route('/', {
  name: 'map'
, waitOn: function () {
    return Meteor.subscribe('placesList')
  }
, action: function () {
    var self = this
    self.render('pageMap')
  }
})

Router.route('/login', {
  name: 'login'
, action: function () {
    var self = this
    self.render('pageLogin')
  }
})

Router.route('/users', {
  name: 'users'
, onBeforeAction: redirectIfNotLoggedIn
, action: function () {
    var self = this
    self.render('pageUsers')
  }
})

Router.route('/places', {
  name: 'places'
, waitOn: function () {
    return Meteor.subscribe('placesList')
  }
, action: function () {
    var self = this
    self.render('pagePlaces')
  }
})

Router.route('/places/new', {
  name: 'places.new'
, onBeforeAction: redirectIfNotLoggedIn
, waitOn: function () {
    return Meteor.subscribe('placesList')
  }
, action: function () {
    var self = this
    self.render('pagePlacesNew')
  }
})

Router.route('/places/:_id/edit', {
  name: 'places.edit'
, onBeforeAction: redirectIfNotLoggedIn
, waitOn: function () {
    return Meteor.subscribe('placesList')
  }
, action: function () {
    var self = this
    self.render('pagePlacesEdit', {data: Places.findOne({_id: self.params._id})})
  }
})


text:
layout: page
title: Franklin Enterprises Show
date: 2016-05-24
author: Gary Mcmillan
tags: weekly links, java
status: published
summary: Proin vitae sodales lectus. Donec iaculis.
banner: images/banner/leisure-03.jpg
booking:
  startDate: 10/06/2016
  endDate: 10/09/2016
  ctyhocn: MSYMTHX
  groupCode: FES
published: true
---
Fusce vehicula nisi ac malesuada tempor. Donec auctor nec turpis nec auctor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin euismod, urna ut tincidunt condimentum, orci mauris eleifend dui, sed rutrum ligula tortor nec nulla. Mauris leo magna, congue eget sapien eget, fringilla iaculis enim. Aenean eu quam et odio laoreet eleifend. Nullam consectetur neque sit amet tristique aliquet. Nulla et urna vel lorem scelerisque tempus. Aenean eu egestas sem. Aenean ac neque iaculis, facilisis dolor ac, blandit sem. Donec laoreet lacinia ligula in ultrices. Nam porttitor tortor turpis, vel pretium mauris ullamcorper vitae.

* Morbi efficitur arcu ut mattis scelerisque
* Sed in est gravida, scelerisque nisi vel, tempor sapien
* Cras vitae turpis non mi gravida aliquam nec ut magna
* Nunc feugiat tortor quis fringilla egestas.

Proin auctor bibendum ex, nec fermentum risus scelerisque sodales. Mauris ut mollis ipsum, sed venenatis nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec pharetra eros augue, id lacinia ante fermentum at. Praesent interdum varius posuere. Vivamus sit amet lacinia felis. Nunc nec ultrices lacus.


text:
#ifndef AUDIO_CHANNEL_SEND_FRAME_TRANSFORMER_DELEGATE_H_
#define AUDIO_CHANNEL_SEND_FRAME_TRANSFORMER_DELEGATE_H_

#include <memory>

#include "api/frame_transformer_interface.h"
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
#include "rtc_base/buffer.h"
#include "rtc_base/critical_section.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "rtc_base/task_queue.h"

namespace webrtc {

// Delegates calls to FrameTransformerInterface to transform frames, and to
// ChannelSend to send the transformed frames using |send_frame_callback_| on
// the |encoder_queue_|.
// OnTransformedFrame() can be called from any thread, the delegate ensures
// thread-safe access to the ChannelSend callback.
class ChannelSendFrameTransformerDelegate : public TransformedFrameCallback {
 public:
  using SendFrameCallback =
      std::function<int32_t(AudioFrameType frameType,
                            uint8_t payloadType,
                            uint32_t rtp_timestamp,
                            rtc::ArrayView<const uint8_t> payload,
                            int64_t absolute_capture_timestamp_ms)>;
  ChannelSendFrameTransformerDelegate(
      SendFrameCallback send_frame_callback,
      rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
      rtc::TaskQueue* encoder_queue);

  // Registers |this| as callback for |frame_transformer_|, to get the
  // transformed frames.
  void Init();

  // Unregisters and releases the |frame_transformer_| reference, and resets
  // |send_frame_callback_| under lock. Called from ChannelSend destructor to
  // prevent running the callback on a dangling channel.
  void Reset();

  // Delegates the call to FrameTransformerInterface::TransformFrame, to
  // transform the frame asynchronously.
  void Transform(AudioFrameType frame_type,
                 uint8_t payload_type,
                 uint32_t rtp_timestamp,
                 uint32_t rtp_start_timestamp,
                 const uint8_t* payload_data,
                 size_t payload_size,
                 int64_t absolute_capture_timestamp_ms,
                 uint32_t ssrc);

  // Implements TransformedFrameCallback. Can be called on any thread.
  void OnTransformedFrame(
      std::unique_ptr<TransformableFrameInterface> frame) override;

  // Delegates the call to ChannelSend::SendRtpAudio on the |encoder_queue_|,
  // by calling |send_audio_callback_|.
  void SendFrame(std::unique_ptr<TransformableFrameInterface> frame) const;

 protected:
  ~ChannelSendFrameTransformerDelegate() override = default;

 private:
  rtc::CriticalSection send_lock_;
  SendFrameCallback send_frame_callback_ RTC_GUARDED_BY(send_lock_);
  rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_;
  rtc::TaskQueue* encoder_queue_ RTC_GUARDED_BY(send_lock_);
};
}  // namespace webrtc
#endif  // AUDIO_CHANNEL_SEND_FRAME_TRANSFORMER_DELEGATE_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/pedro/Documents/proyectos/gig-native-web/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-w600dp/values-w600dp.xml -->
    <eat-comment/>
    <dimen name="abc_search_view_text_min_width">192dip</dimen>
    <integer name="abc_max_action_buttons">5</integer>
</resources>


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

'use strict';
/* global process */

var url = require('url');
var http = require('http');
var lbPool = require('lb_pool');
var os = require('os');
var utils = require('./utils');
/* eslint-disable no-unused-vars */
/* jshint -W098 */
var pkginfo = require('pkginfo')(module);
/* jshint +W089 */
/* eslint-enable no-unused-vars */

var supportContentType = {
    'binary': 'application/vnd.kafka.binary.v1',
    'json': 'application/vnd.kafka.json.v1+json',
    'batch': 'application/vnd.kafka.binary.batch.v1'
};

var emptyFunction = function EmptyFunction() {
};

var defaultAppNameEnvVar = 'UDEPLOY_SERVICE_NAME';
var defaultServiceNameHeader = 'kafka-rest-client-service-name';
var defaultVersionHeader = 'kafka-rest-client-version';
var defaultInstanceNameHeader = 'kafka-rest-client-instance-name';
var defaultInstanceNameEnvVar = 'UDEPLOY_DEPLOYMENT_NAME';

var defaultLocalAgentHost = 'localhost';
var defaultLocalAgentPort = 5390;
var defaultClusterUrl = 'LOGGING TOPICS';
var defaultDataClusterUrl = 'DATA TOPICS';
var hpTopicFormat = ['hp-', 'hp_', 'hp.'];
var totalWaitingTimeMs = 0;
// try connectWaitTimeMs.length times to connect to rest proxy
var connectWaitTimeMs = [0, 100, 3000, 10000, 30000, 60000, 300000, 600000];
var defaultReconnectRetryMs = 100;

String.isNullOrEmpty = function checkNullOrEmpty(value) {
    // based on https://codereview.stackexchange.com/questions/5572/string-isnullorempty-in-javascript
    return !value;
};
// Kafka 8 Rest Proxy Client.
// Initialization: takes host and port and send a GET call to get all the
// <topic, host:port> mapping.
// Produce: for sending request, forkafka client will send a POST call
function KafkaRestClient(options, callback) {
    var self = this;
    callback = callback || emptyFunction;
    self.clientType = options.clientType;
    self.enable = false;
    self.connecting = false;
    self.proxyHost = options.proxyHost;
    self.localAgentMode = options.localAgentMode;
    self.timeout = options.timeout || 1000;
    self.maxPending = options.maxPending || 500;
    self.urlToHttpClientMapping = {};
    self.cachedTopicToUrlMapping = {};
    self.proxyPort = options.proxyPort;
    self.initLineageOption(options);
    self.requestUrl = self.proxyHost + ':' + self.proxyPort;
    self.metadataWhitelist = null;
    if ('metadataWhitelist' in options) {
        self.metadataWhitelist = options.metadataWhitelist;
    }

    self.initHttpClient(options);
    self.topicDiscoveryTimes = 0;
    self.maxRetries = options.maxRetries || 3;

    self.discoverTopics(function discoverTopicsCallback(err, isDone) {
        if (err || !isDone) {
            self.enable = false;
            totalWaitingTimeMs = 0;
            self.scheduleConnect(1);
            // Will not return an error since there are retries to rest proxy
            return callback();
        }
        self.enable = true;
        return callback();
    });
    self.scheduleTopicMapRefresh();
    self.statsd = (options.statsd && typeof options.statsd.increment === 'function') ? options.statsd : null;
    self.metricsPrefix = 'kafka_rest_proxy.rest-client.' + os.hostname() + '.';
    self.localAgentHost = options.localAgentHost || defaultLocalAgentHost;
    self.localAgentPort = options.localAgentPort || defaultLocalAgentPort;
    self.produceInterval = options.produceInterval || -1;
}

KafkaRestClient.prototype.initHttpClient = function initHttpClient(options) {
    var self = this;
    if (self.clientType === 'AtLeastOnce') {
        self.mainHttpClient = new lbPool.Pool(http, [self.requestUrl], {
            /* eslint-disable camelcase */
            /* jshint camelcase: false */
            keep_alive: true,
            timeout: self.timeout,
            max_pending: self.maxPending
            /* jshint camelcase: true */
            /* eslint-enable camelcase */
        });
    } else {
        self.mainHttpClient = new lbPool.Pool(http, [self.requestUrl], {
            /* eslint-disable camelcase */
            /* jshint camelcase: false */
            keep_alive: true
            /* jshint camelcase: true */
            /* eslint-enable camelcase */
        });
    }
    self.proxyRefreshTime = options.refreshTime;

    if ('blacklistMigratorHttpClient' in options) {
        self.blacklistMigratorHttpClient = options.blacklistMigratorHttpClient;
    } else {
        self.blacklistMigratorHttpClient = null;
    }
};

KafkaRestClient.prototype.initLineageOption = function initLineageOption(options) {
    var self = this;
    if (options.serviceName) {
        // the application name for data lineage
        self.serviceName = options.serviceName;
    } else {
        if ('serviceNameEnv' in options) {
            self.serviceNameEnv = options.serviceNameEnv;
        } else {
            self.serviceNameEnv = defaultAppNameEnvVar;
        }
        /* eslint-disable no-process-env */
        self.serviceName = process.env[self.serviceNameEnv];
        /* eslint-enable no-process-env */

        if (String.isNullOrEmpty(self.serviceName)) {
            self.serviceName = utils.getServiceName();
        }
    }

    if ('serviceNameHeader' in options) {
        self.serviceNameHeader = options.serviceNameHeader;
    } else {
        self.serviceNameHeader = defaultServiceNameHeader;
    }

    if ('clientVersionHeader' in options) {
        self.clientVersionHeader = options.clientVersionHeader;
    } else {
        self.clientVersionHeader = defaultVersionHeader;
    }

    if ('instanceNameHeader' in options) {
        self.instanceNameHeader = options.instanceNameHeader;
    } else {
        self.instanceNameHeader = defaultInstanceNameHeader;
    }

    if ('instanceName' in options) {
        self.instanceName = options.instanceName;
    } else {
        if ('instanceNameEnv' in options) {
            self.instanceNameEnv = options.instanceNameEnv;
        } else {
            self.instanceNameEnv = defaultInstanceNameEnvVar;
        }
        /* eslint-disable no-process-env */
        self.instanceName = process.env[this.instanceNameEnv];
        if (String.isNullOrEmpty(self.instanceName)) {
            self.instanceName = utils.getLimitedLength(os.hostname());
        }
        /* eslint-enable no-process-env */
    }
    self.clientVersion = '[node,' + module.version + ']';

};
// produceInterval is for test purpose
// In production env, the interval is exponential back-off as 600 * Math.pow(5, retry + 1)
KafkaRestClient.prototype.getProduceInterval = function getProduceInterval(retry) {
    var self = this;
    if (self.produceInterval === -1) {
        if (self.clientType === 'AtLeastOnce') {
            return 1000;
        }
        return 600 * Math.pow(5, retry + 1);
    }
    return self.produceInterval;
};

KafkaRestClient.prototype.scheduleTopicMapRefresh = function scheduleTopicMapRefresh() {
    var self = this;
    if (self.proxyRefreshTime > 0) {
        /* eslint-disable no-undef,block-scoped-var */
        self.refreshIntervalId = setInterval(function refreshTopics() {
            totalWaitingTimeMs = 0;
            self.scheduleConnect(0);
        }, self.proxyRefreshTime);
        /* eslint-enable no-undef,block-scoped-var */
    }
};

// Reconnect to rest proxy if scheduleTopicMapRefresh fails
KafkaRestClient.prototype.scheduleConnect = function scheduleConnect(retry) {
    var self = this;
    if (retry < connectWaitTimeMs.length) {
        if (self.proxyRefreshTime > 0 && totalWaitingTimeMs + connectWaitTimeMs[retry] >= self.proxyRefreshTime) {
            return;
        }

        /* eslint-disable no-undef,block-scoped-var */
        self.reconnectId = setTimeout(function reconnect() {
            totalWaitingTimeMs += connectWaitTimeMs[retry];
            self.discoverTopics(function refreshTopicsCallback(err, isDone) {
                if (err === null && isDone) {
                    self.enable = true;
                } else if (retry < connectWaitTimeMs.length - 1) {
                    self.enable = false;
                    self.scheduleConnect(retry + 1);
                }
            });
        }, connectWaitTimeMs[retry]);
        /* eslint-enable no-undef,block-scoped-var */
    }
};

KafkaRestClient.prototype.discoverTopics = function discoverTopics(callback) {
    var self = this;
    self.connecting = true;
    this.getTopicRequestBody(self.proxyHost, self.proxyPort, function updateTopicToUrlMapping(err, res) {
        if (err) {
            self.connecting = false;
            return callback(err, false);
        }
        self.connecting = false;
        self.enable = true;
        self.cachedTopicToUrlMapping = self.getTopicToUrlMapping(res);
        self.topicDiscoveryTimes++;
        return callback(null, true);
    });
};

KafkaRestClient.prototype.getTopicRequestBody = function getTopicRequestBody(proxyHost, proxyPort, callback) {
    var self = this;
    var endpoint = '/topics';
    if (self.metadataWhitelist !== null) {
        endpoint += '?topics=' + self.metadataWhitelist.join();
    }
    self.mainHttpClient.get(endpoint, function handleGetCall(err, res, body) {
        if (err) {
            return callback(err, null);
        }
        callback(null, body);
    });
};

KafkaRestClient.prototype.getTopicToUrlMapping = function getTopicToUrlMapping(body) {
    var self = this;
    /* eslint-disable no-try-catch */
    try {
        var urlToTopicsJson = JSON.parse(body);
        var topicToUrlMapping = {};
        var urlArray = Object.keys(urlToTopicsJson);
        for (var i = 0; i < urlArray.length; i++) {
            var reqUrl = urlArray[i];
            var topicsArray = urlToTopicsJson[reqUrl];
            for (var j = 0; j < topicsArray.length; j++) {
                topicToUrlMapping[topicsArray[j]] = reqUrl;
            }
        }
        return topicToUrlMapping;
    } catch (e) {
        return self.cachedTopicToUrlMapping;
    }
    /* eslint-enable no-try-catch */
};

KafkaRestClient.prototype.isHeatPipeTopic = function isHeatPipeTopic(topic) {
    return hpTopicFormat.indexOf(topic.substring(0, 3)) > -1;
};

KafkaRestClient.prototype.goToLocalAgent = function goToLocalAgent(topic) {
    var self = this;
    return (self.clientType !== 'AtLeastOnce' && self.isHeatPipeTopic(topic)) ||
        (self.clientType === 'AtLeastOnce' && self.localAgentMode.toUpperCase() === 'ALWAYS');
};

// ProduceMessage {
// string topic,
// binary message,
// string type,
// long timeStamp
// }
KafkaRestClient.prototype.produce = function produce(produceMessage, callback) {
    var self = this;
    self.produceWithRetry(produceMessage, 0, callback);
    if (self.statsd) {
        self.statsd.increment(self.metricsPrefix + produceMessage.topic + '.produced');
    }
};

KafkaRestClient.prototype.produceWithRetry = function produceWithRetry(produceMessage, retry, callback) {
    var self = this;

    if (self.enable) {
        // push topic to whitelist if needed
        if (self.metadataWhitelist !== null && self.metadataWhitelist.indexOf(produceMessage.topic) < 0) {
            self.metadataWhitelist.push(produceMessage.topic);
        }
        if (produceMessage.topic in self.cachedTopicToUrlMapping) {
            self.tryMakeRequest(produceMessage, retry, callback);
        } else if (defaultDataClusterUrl in self.cachedTopicToUrlMapping && self.clientType !== 'AtLeastOnce') {
            self.cachedTopicToUrlMapping[produceMessage.topic] = self.cachedTopicToUrlMapping[defaultDataClusterUrl];
            self.produceWithRetry(produceMessage, 0, callback);
        } else if (self.goToLocalAgent(produceMessage.topic)) {
            self.tryMakeRequest(produceMessage, self.maxRetries - 1, callback);
        } else if (defaultClusterUrl in self.cachedTopicToUrlMapping && self.clientType !== 'AtLeastOnce') {
            self.cachedTopicToUrlMapping[produceMessage.topic] = self.cachedTopicToUrlMapping[defaultClusterUrl];
            self.produceWithRetry(produceMessage, 0, callback);
        } else if (self.clientType !== 'AtLeastOnce') {
            return callback(new Error('No default url for logging topics - ' + produceMessage.topic));
        } else {
            return callback(new Error('No url for topics - ' + produceMessage.topic));
        }
    } else if (self.connecting) {
        /* eslint-disable no-undef,block-scoped-var */
        setTimeout(function waitForInitDone() {
            self.produceWithRetry(produceMessage, retry, callback);
        }, defaultReconnectRetryMs);
        /* eslint-enable no-undef,block-scoped-var */
    } else if (self.goToLocalAgent(produceMessage.topic)) {
        self.tryMakeRequest(produceMessage, self.maxRetries - 1, callback);
    } else {
        return callback(new Error('Kafka Rest Client is not enabled yet.'));
    }
};

KafkaRestClient.prototype.tryMakeRequest = function tryMakeRequest(produceMessage, retry, callback) {
    var self = this;

    var pathUrl = self.cachedTopicToUrlMapping[produceMessage.topic];
    if (retry >= self.maxRetries - 1 && self.maxRetries > 1 && self.goToLocalAgent(produceMessage.topic)) {
        pathUrl = self.localAgentHost + ':' + self.localAgentPort;
    }
    if (pathUrl === undefined) {
        pathUrl = self.localAgentHost + ':' + self.localAgentPort;
    }

    var httpClient;
    if (self.urlToHttpClientMapping[pathUrl] === undefined) {
        if (self.clientType === 'AtLeastOnce') {
            self.urlToHttpClientMapping[pathUrl] = new lbPool.Pool(http, [pathUrl], {
                /* eslint-disable camelcase */
                /* jshint camelcase: false */
                keep_alive: true,
                timeout: self.timeout,
                max_pending: self.maxPending
                /* jshint camelcase: true */
                /* eslint-enable camelcase */
            });
        } else {
            self.urlToHttpClientMapping[pathUrl] = new lbPool.Pool(http, [pathUrl], {
                /* eslint-disable camelcase */
                /* jshint camelcase: false */
                keep_alive: true
                /* jshint camelcase: true */
                /* eslint-enable camelcase */
            });
        }
    }
    httpClient = self.urlToHttpClientMapping[pathUrl];

    var reqOpts = url.parse('http://' + pathUrl);
    reqOpts.method = 'POST';
    reqOpts.path = '/topics/' + produceMessage.topic;
    reqOpts.headers = {
        'Content-Type': supportContentType[produceMessage.type],
        'TimeStamp': produceMessage.timeStamp.toString()
    };
    if (produceMessage.key !== undefined && produceMessage.key !== '') {
        reqOpts.headers['Record-Key'] = produceMessage.key;
    }
    if (self.clientType === 'AtLeastOnce') {
        reqOpts.headers['Request-Type'] = 'sync';
    }
    reqOpts.headers[self.serviceNameHeader] = self.serviceName;
    reqOpts.headers[self.clientVersionHeader] = self.clientVersion;
    reqOpts.headers[self.instanceNameHeader] = self.instanceName;

    var time = new Date();
    httpClient.post(reqOpts, produceMessage.message, function handlePostCall(err, res, body) {
        var metricPrefix = self.metricsPrefix + produceMessage.topic;
        if (self.statsd && typeof self.statsd.timing === 'function') {
            self.statsd.timing(metricPrefix + '.latency', time);
        }

        if (err || (res && res.statusCode >= 500 && res.statusCode < 600)) {
            return self.handleError5xx(produceMessage, retry, metricPrefix, err, callback);
        }
        if (res.statusCode >= 400 && res.statusCode < 500) {
            return self.handleError4xx(produceMessage, res, callback);
        }
        if (self.clientType !== 'AtLeastOnce' ||
            (self.clientType === 'AtLeastOnce' && pathUrl !== self.localAgentHost + ':' + self.localAgentPort)) {
            return callback(null, body);
        }
        callback(new Error('Send to local agent for topic - ' + produceMessage.topic));
    });
};

/* jshint maxparams: 5 */
KafkaRestClient.prototype.handleError5xx = function handleError1(produceMessage, retry, metricPrefix, err, callback) {
    var self = this;

    if (retry < self.maxRetries - 1) {
        /* eslint-disable no-undef,block-scoped-var */
        setTimeout(function delayedProduce() {
            self.produceWithRetry(produceMessage, retry + 1, callback);
        }, self.getProduceInterval(retry));
        /* eslint-enable no-undef,block-scoped-var */

        if (self.statsd) {
            self.statsd.increment(metricPrefix + '.retry');
        }
    } else if (self.goToLocalAgent(produceMessage.topic) &&
        retry === self.maxRetries - 1 && self.maxRetries > 1) {
        /* eslint-disable no-undef,block-scoped-var */
        setTimeout(function delayedProduce() {
            self.tryMakeRequest(produceMessage, self.maxRetries, callback);
        }, 100);
        /* eslint-enable no-undef,block-scoped-var */
    } else {
        if (err !== null && typeof err === 'object') {
            // attempt field in err return by lb_pool lib has circular structure
            // will cause problem when we try to JSON.stringify it
            err.attempt = null;
        }
        if (self.statsd) {
            self.statsd.increment(metricPrefix + '.error');
        }
        return void callback(err);
    }
};

KafkaRestClient.prototype.handleError4xx = function handleError2(produceMessage, res, callback) {
    var self = this;

    if (self.goToLocalAgent(produceMessage.topic) && self.maxRetries > 1) {
        self.tryMakeRequest(produceMessage, self.maxRetries - 1, callback);
    } else {
        return void callback(new Error('Got statusCode ' + res.statusCode));
    }
};

KafkaRestClient.prototype.close = function close() {
    // Trying to close kafka rest client, need to cancel timer scheduler.
    var self = this;
    self.enable = false;
    self.connecting = false;
    if (self.proxyRefreshTime > 0) {
        // Trying to cancel TimeInterval
        /* eslint-disable no-undef,block-scoped-var */
        clearInterval(self.refreshIntervalId);
        /* eslint-enable no-undef,block-scoped-var */
        self.proxyRefreshTime = 0;
    }
    if (self.reconnectId) {
        /* eslint-disable no-undef,block-scoped-var */
        clearTimeout(self.reconnectId);
        /* eslint-enable no-undef,block-scoped-var */
    }
    self.mainHttpClient.close();
    if (self.blacklistMigratorHttpClient) {
        self.blacklistMigratorHttpClient.close();
    }
    Object.keys(self.urlToHttpClientMapping).forEach(function closeHttpClient(reqUrl) {
        self.urlToHttpClientMapping[reqUrl].close();
    });
};

module.exports = KafkaRestClient;


text:
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <TextView
        android:id="@+id/circlebinder_checklist_item_circle_label"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="@dimen/circlebinder_material_list_key_line_container_padding_horizontal"
        android:paddingRight="@dimen/circlebinder_material_list_key_line_container_padding_horizontal"
        android:textSize="@dimen/circlebinder_material_font_body"
        android:ellipsize="end"
        android:maxLines="1"
        android:alpha="0.5"
        tools:text="あ-01a"
        />

</FrameLayout>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using TravelAgent.IDAL;
using TravelAgent.Tool;

namespace TravelAgent.DALSQL
{
    public class AdminRole:IAdminRole
    {
        /// <summary>
        /// 取得最新插入的ID
        /// </summary>
        public int GetMaxID(string FieldName)
        {
            return DbHelperSQL.GetMaxID(FieldName, "AdminRole");
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(TravelAgent.Model.AdminRole model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into AdminRole(");
            strSql.Append("roleName,roleAuth,roleInfo)");
            strSql.Append(" values (");
            strSql.Append("@roleName,@roleAuth,@roleInfo)");
            SqlParameter[] parameters = {
					new SqlParameter("@roleName", SqlDbType.VarChar),
                    new SqlParameter("@roleAuth", SqlDbType.VarChar),
                    new SqlParameter("@roleInfo", SqlDbType.VarChar)};
            parameters[0].Value = model.roleName;
            parameters[1].Value = model.roleAuth;
            parameters[2].Value = model.roleInfo;
            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(TravelAgent.Model.AdminRole model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update AdminRole set ");
            strSql.Append("roleName=@roleName,");
            strSql.Append("roleAuth=@roleAuth,");
            strSql.Append("roleInfo=@roleInfo");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters = {
				new SqlParameter("@roleName", SqlDbType.VarChar),
                    new SqlParameter("@roleAuth", SqlDbType.VarChar),
                    new SqlParameter("@roleInfo", SqlDbType.VarChar),
                    new SqlParameter("@Id", SqlDbType.Int,4)};
            parameters[0].Value = model.roleName;
            parameters[1].Value = model.roleAuth;
            parameters[2].Value = model.roleInfo;
            parameters[3].Value = model.Id;

            return DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
        /// <summary>
        /// 删除数据
        /// </summary>
        public int Delete(int Id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from AdminRole ");
            strSql.Append(" where Id=" + Id);

            return DbHelperSQL.ExecuteSql(strSql.ToString());
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public TravelAgent.Model.AdminRole GetModel(int Id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 * from AdminRole ");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters = {
					new SqlParameter("@Id", SqlDbType.Int,4)};
            parameters[0].Value = Id;

            TravelAgent.Model.AdminRole model = new TravelAgent.Model.AdminRole();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
                {
                    model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
                }
                model.roleName = ds.Tables[0].Rows[0]["roleName"].ToString();
                model.roleAuth = ds.Tables[0].Rows[0]["roleAuth"].ToString();
                model.roleInfo = ds.Tables[0].Rows[0]["roleInfo"].ToString();
                return model;
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM AdminRole ");
            return DbHelperSQL.Query(strSql.ToString());
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM AdminRole ");
            if (strWhere != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }
    }
}


text:
package org.jeasy.random.beans;

import lombok.Data;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NavigableMap;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;

@SuppressWarnings("rawtypes")
@Data
public class MapBean {

    /*
     * Interfaces
     */

    private Map map;
    private Map<Integer, Person> typedMap;

    private SortedMap sortedMap;
    private SortedMap<Integer, Person> typedSortedMap;

    private NavigableMap navigableMap;
    private NavigableMap<Integer, Person> typedNavigableMap;

    private ConcurrentMap concurrentMap;
    private ConcurrentMap<Integer, Person> typedConcurrentMap;

    private ConcurrentNavigableMap concurrentNavigableMap;
    private ConcurrentNavigableMap<Integer, Person> typedConcurrentNavigableMap;

    /*
     * Classes
     */

    private HashMap hashMap;
    private HashMap<Integer, Person> typedHashMap;

    private Hashtable hashtable;
    private Hashtable<Integer, Person> typedHashtable;

    private LinkedHashMap linkedHashMap;
    private LinkedHashMap<Integer, Person> typedLinkedHashMap;

    private WeakHashMap weakHashMap;
    private WeakHashMap<Integer, Person> typedWeakHashMap;

    private IdentityHashMap identityHashMap;
    private IdentityHashMap<Integer, Person> typedIdentityHashMap;

    private TreeMap treeMap;
    private TreeMap<Integer, Person> typedTreeMap;

    private ConcurrentSkipListMap concurrentSkipListMap;
    private ConcurrentSkipListMap<Integer, Person> typedConcurrentSkipListMap;

}


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

package org.browsermob.core.har;

import java.util.List;
import org.codehaus.jackson.annotate.JsonWriteNullProperties;

@JsonWriteNullProperties(value = false)
public class HarPostData {

  private String mimeType;
  private List<HarPostDataParam> params;
  private String text;

  public String getMimeType() {
    return mimeType;
  }

  public void setMimeType(String mimeType) {
    this.mimeType = mimeType;
  }

  public List<HarPostDataParam> getParams() {
    return params;
  }

  public void setParams(List<HarPostDataParam> params) {
    this.params = params;
  }

  public String getText() {
    return text;
  }

  public void setText(String text) {
    this.text = text;
  }
}


text:
package org.airavata.appcatalog.cpi;

import java.util.List;

public interface WorkflowCatalog {

    public List<String> getAllWorkflows() throws AppCatalogException;

    public org.apache.airavata.model.Workflow getWorkflow(String workflowTemplateId) throws AppCatalogException;

    public void deleteWorkflow(String workflowTemplateId) throws AppCatalogException;

    public String registerWorkflow(org.apache.airavata.model.Workflow workflow) throws AppCatalogException;

    public void updateWorkflow(String workflowTemplateId, org.apache.airavata.model.Workflow workflow) throws AppCatalogException;

    public String getWorkflowTemplateId(String workflowName) throws AppCatalogException;

    public boolean isWorkflowExistWithName(String workflowName) throws AppCatalogException;
}


text:
using System.Drawing;
using System.Drawing.Imaging;
using Xunit;

namespace WmcSoft.Drawing
{
    public class ImageExtensionsTests
    {
        [Fact]
        public void AssertBitmapDefaults() {
            using (var b = new Bitmap(100, 100)) {
                Assert.Equal(96F, b.HorizontalResolution);
                Assert.Equal(96F, b.VerticalResolution);
                Assert.Equal(PixelFormat.Format32bppArgb, b.PixelFormat);
            }
        }
    }
}