text:
package javax.servlet.http;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;

import jakarta.servlet.AsyncContext;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletInputStream;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpUpgradeHandler;
import jakarta.servlet.http.Part;

/**
 * A temporary class used until all dependencies provide releases based on jakarta.** APIs
 */
public interface HttpServletRequest extends jakarta.servlet.http.HttpServletRequest {

    class Impl implements HttpServletRequest {

        private final jakarta.servlet.http.HttpServletRequest delegate;

        public Impl(jakarta.servlet.http.HttpServletRequest delegate)
        {
            this.delegate = delegate;
        }

        @Override
        public jakarta.servlet.http.HttpServletRequest getDelegate() {
            return delegate;
        }
    }

    jakarta.servlet.http.HttpServletRequest getDelegate();

    @Override
    default String getAuthType() {
        return getDelegate().getAuthType();
    }

    @Override
    default Cookie[] getCookies() {
        return getDelegate().getCookies();
    }

    @Override
    default long getDateHeader(String name) {
        return getDelegate().getDateHeader(name);
    }

    @Override
    default String getHeader(String name) {
        return getDelegate().getHeader(name);
    }

    @Override
    default Enumeration<String> getHeaders(String name) {
        return getDelegate().getHeaders(name);
    }

    @Override
    default Enumeration<String> getHeaderNames() {
        return getDelegate().getHeaderNames();
    }

    @Override
    default int getIntHeader(String name) {
        return getDelegate().getIntHeader(name);
    }

    @Override
    default String getMethod() {
        return getDelegate().getMethod();
    }

    @Override
    default String getPathInfo() {
        return getDelegate().getPathInfo();
    }

    @Override
    default String getPathTranslated() {
        return getDelegate().getPathTranslated();
    }

    @Override
    default String getContextPath() {
        return getDelegate().getContextPath();
    }

    @Override
    default String getQueryString() {
        return getDelegate().getQueryString();
    }

    @Override
    default String getRemoteUser() {
        return getDelegate().getRemoteUser();
    }

    @Override
    default boolean isUserInRole(String role) {
        return getDelegate().isUserInRole(role);
    }

    @Override
    default Principal getUserPrincipal() {
        return getDelegate().getUserPrincipal();
    }

    @Override
    default String getRequestedSessionId() {
        return getDelegate().getRequestedSessionId();
    }

    @Override
    default String getRequestURI() {
        return getDelegate().getRequestURI();
    }

    @Override
    default StringBuffer getRequestURL() {
        return getDelegate().getRequestURL();
    }

    @Override
    default String getServletPath() {
        return getDelegate().getServletPath();
    }

    @Override
    default HttpSession getSession(boolean create) {
        return getDelegate().getSession(create);
    }

    @Override
    default HttpSession getSession() {
        return getDelegate().getSession();
    }

    @Override
    default String changeSessionId() {
        return getDelegate().changeSessionId();
    }

    @Override
    default boolean isRequestedSessionIdValid() {
        return getDelegate().isRequestedSessionIdValid();
    }

    @Override
    default boolean isRequestedSessionIdFromCookie() {
        return getDelegate().isRequestedSessionIdFromCookie();
    }

    @Override
    default boolean isRequestedSessionIdFromURL() {
        return getDelegate().isRequestedSessionIdFromURL();
    }

    @Override
    default boolean isRequestedSessionIdFromUrl() {
        return getDelegate().isRequestedSessionIdFromURL();
    }

    @Override
    default boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
        return getDelegate().authenticate(response);
    }

    @Override
    default void login(String username, String password) throws ServletException {
        getDelegate().login(username, password);
    }

    @Override
    default void logout() throws ServletException {
        getDelegate().logout();
    }

    @Override
    default Collection<Part> getParts() throws IOException, ServletException {
        return getDelegate().getParts();
    }

    @Override
    default Part getPart(String name) throws IOException, ServletException {
        return getDelegate().getPart(name);
    }

    @Override
    default <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException {
        return getDelegate().upgrade(handlerClass);
    }

    @Override
    default Object getAttribute(String name) {
        return getDelegate().getAttribute(name);
    }

    @Override
    default Enumeration<String> getAttributeNames() {
        return getDelegate().getAttributeNames();
    }

    @Override
    default String getCharacterEncoding() {
        return getDelegate().getCharacterEncoding();
    }

    @Override
    default void setCharacterEncoding(String env) throws UnsupportedEncodingException {
        getDelegate().setCharacterEncoding(env);
    }

    @Override
    default int getContentLength() {
        return getDelegate().getContentLength();
    }

    @Override
    default long getContentLengthLong() {
        return getDelegate().getContentLengthLong();
    }

    @Override
    default String getContentType() {
        return getDelegate().getContentType();
    }

    @Override
    default ServletInputStream getInputStream() throws IOException {
        return getDelegate().getInputStream();
    }

    @Override
    default String getParameter(String name) {
        return getDelegate().getParameter(name);
    }

    @Override
    default Enumeration<String> getParameterNames() {
        return getDelegate().getParameterNames();
    }

    @Override
    default String[] getParameterValues(String name) {
        return getDelegate().getParameterValues(name);
    }

    @Override
    default Map<String, String[]> getParameterMap() {
        return getDelegate().getParameterMap();
    }

    @Override
    default String getProtocol() {
        return getDelegate().getProtocol();
    }

    @Override
    default String getScheme() {
        return getDelegate().getScheme();
    }

    @Override
    default String getServerName() {
        return getDelegate().getScheme();
    }

    @Override
    default int getServerPort() {
        return getDelegate().getServerPort();
    }

    @Override
    default BufferedReader getReader() throws IOException {
        return getDelegate().getReader();
    }

    @Override
    default String getRemoteAddr() {
        return getDelegate().getRemoteAddr();
    }

    @Override
    default String getRemoteHost() {
        return getDelegate().getRemoteHost();
    }

    @Override
    default void setAttribute(String name, Object o) {
        getDelegate().setAttribute(name, o);
    }

    @Override
    default void removeAttribute(String name) {
        getDelegate().removeAttribute(name);
    }

    @Override
    default Locale getLocale() {
        return getDelegate().getLocale();
    }

    @Override
    default Enumeration<Locale> getLocales() {
        return getDelegate().getLocales();
    }

    @Override
    default boolean isSecure() {
        return getDelegate().isSecure();
    }

    @Override
    default RequestDispatcher getRequestDispatcher(String path) {
        return getDelegate().getRequestDispatcher(path);
    }

    @Override
    default String getRealPath(String path) {
        return getDelegate().getRealPath(path);
    }

    @Override
    default int getRemotePort() {
        return getDelegate().getRemotePort();
    }

    @Override
    default String getLocalName() {
        return getDelegate().getLocalName();
    }

    @Override
    default String getLocalAddr() {
        return getDelegate().getLocalAddr();
    }

    @Override
    default int getLocalPort() {
        return getDelegate().getLocalPort();
    }

    @Override
    default ServletContext getServletContext() {
        return getDelegate().getServletContext();
    }

    @Override
    default AsyncContext startAsync() throws IllegalStateException {
        return getDelegate().startAsync();
    }

    @Override
    default AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException {
        return getDelegate().startAsync(servletRequest, servletResponse);
    }

    @Override
    default boolean isAsyncStarted() {
        return getDelegate().isAsyncStarted();
    }

    @Override
    default boolean isAsyncSupported() {
        return getDelegate().isAsyncSupported();
    }

    @Override
    default AsyncContext getAsyncContext() {
        return getDelegate().getAsyncContext();
    }

    @Override
    default DispatcherType getDispatcherType() {
        return getDelegate().getDispatcherType();
    }
}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M5.625,10.167V9.812H14.396V10.167Z"/>
</vector>

redpajama_set_name: RedPajamaGithub


text:
package cluster

import (
	"context"
	"os"
	"testing"

	"github.com/coreos/pkg/capnslog"
	"github.com/pkg/errors"
	cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
	"github.com/rook/rook/pkg/client/clientset/versioned/scheme"
	"github.com/rook/rook/pkg/clusterd"
	"github.com/rook/rook/pkg/operator/k8sutil"
	exectest "github.com/rook/rook/pkg/util/exec/test"
	"github.com/stretchr/testify/assert"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

func getFakeClient(obj ...runtime.Object) client.Client {
	// Register operator types with the runtime scheme.
	scheme := scheme.Scheme
	scheme.AddKnownTypes(cephv1.SchemeGroupVersion, &cephv1.CephCluster{})
	client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(obj...).Build()
	return client
}

func fakeCluster(ns string) *cephv1.CephCluster {
	cephCluster := &cephv1.CephCluster{
		ObjectMeta: metav1.ObjectMeta{
			Name:      ns,
			Namespace: ns,
		},
		Status: cephv1.ClusterStatus{
			Phase: "",
		},
		Spec: cephv1.ClusterSpec{
			Storage: cephv1.StorageScopeSpec{},
		},
	}
	return cephCluster
}

func TestCheckStorageForNode(t *testing.T) {
	ns := "rook-ceph"
	cephCluster := fakeCluster(ns)

	assert.False(t, checkStorageForNode(cephCluster))

	cephCluster.Spec.Storage.UseAllNodes = true
	assert.True(t, checkStorageForNode(cephCluster))

	fakeNodes := []cephv1.Node{
		{
			Name: "nodeA",
		},
	}
	cephCluster.Spec.Storage.Nodes = fakeNodes
	assert.True(t, checkStorageForNode(cephCluster))

	fakeDeviceSets := []cephv1.StorageClassDeviceSet{
		{
			Name: "DeviceSet1",
		},
	}
	cephCluster.Spec.Storage.StorageClassDeviceSets = fakeDeviceSets
	assert.True(t, checkStorageForNode(cephCluster))
}

func TestOnK8sNode(t *testing.T) {
	ns := "rook-ceph"
	ctx := context.TODO()
	cephCluster := fakeCluster(ns)
	objects := []runtime.Object{
		cephCluster,
	}
	// Create a fake client to mock API calls.
	client := getFakeClient(objects...)

	executor := &exectest.MockExecutor{}
	executor.MockExecuteCommandWithOutput = func(command string, args ...string) (string, error) {
		return "", errors.New("failed to get osd list on host")
	}
	clientCluster := newClientCluster(client, ns, &clusterd.Context{
		Executor: executor,
	})

	node := &corev1.Node{
		Spec: corev1.NodeSpec{
			Unschedulable: false,
		},
		Status: corev1.NodeStatus{
			Conditions: []corev1.NodeCondition{
				{
					Status: corev1.ConditionStatus(corev1.ConditionTrue),
					Type:   corev1.NodeConditionType(corev1.NodeReady),
				},
			},
		},
		ObjectMeta: metav1.ObjectMeta{
			Name: "fakenode",
		},
	}

	// node will reconcile
	fakeNodes := []cephv1.Node{
		{
			Name: "nodeA",
		},
	}
	fakeDeviceSets := []cephv1.StorageClassDeviceSet{
		{
			Name: "DeviceSet1",
		},
	}
	cephCluster.Spec.Storage.Nodes = fakeNodes
	cephCluster.Spec.Storage.StorageClassDeviceSets = fakeDeviceSets
	cephCluster.Spec.Storage.UseAllNodes = true
	cephCluster.Status.Phase = k8sutil.ReadyStatus
	client = getFakeClient(objects...)
	clientCluster.client = client
	b := clientCluster.onK8sNode(ctx, node)
	assert.True(t, b)

	// node will not reconcile
	b = clientCluster.onK8sNode(ctx, node)
	assert.False(t, b)
}

func TestOnDeviceCMUpdate(t *testing.T) {
	// Set DEBUG logging
	capnslog.SetGlobalLogLevel(capnslog.DEBUG)
	os.Setenv("ROOK_LOG_LEVEL", "DEBUG")

	service := &corev1.Service{}
	ns := "rook-ceph"
	cephCluster := fakeCluster(ns)
	objects := []runtime.Object{
		cephCluster,
	}

	// Create a fake client to mock API calls.
	client := getFakeClient(objects...)
	clientCluster := newClientCluster(client, ns, &clusterd.Context{})

	// Dummy object
	b := clientCluster.onDeviceCMUpdate(service, service)
	assert.False(t, b)

	// No Data in the cm
	oldCM := &corev1.ConfigMap{}
	newCM := &corev1.ConfigMap{}
	b = clientCluster.onDeviceCMUpdate(oldCM, newCM)
	assert.False(t, b)

	devices := []byte(`
	[
		{
		  "name": "dm-0",
		  "parent": ".",
		  "hasChildren": false,
		  "devLinks": "/dev/disk/by-id/dm-name-ceph--bee31cdd--e899--4f9a--9e77--df71cfad66f9-osd--data--b5df7900--0cf0--4b1a--a337--7b57c9f0111b/dev/disk/by-id/dm-uuid-LVM-B10SBHeAy5yF6l2OM3p3EqTQbUAYc6JI63n8ZZPTmxRHXTJHmQ4YTAIBCJqY931Z",
		  "size": 31138512896,
		  "uuid": "aafee853-1b8d-4a15-83a9-17825728befc",
		  "serial": "",
		  "type": "lvm",
		  "rotational": true,
		  "readOnly": false,
		  "Partitions": [
			{
			  "Name": "ceph--bee31cdd--e899--4f9a--9e77--df71cfad66f9-osd--data--b5df7900--0cf0--4b1a--a337--7b57c9f0111b",
			  "Size": 0,
			  "Label": "",
			  "Filesystem": ""
			}
		  ],
		  "filesystem": "ceph_bluestore",
		  "vendor": "",
		  "model": "",
		  "wwn": "",
		  "wwnVendorExtension": "",
		  "empty": false,
		  "real-path": "/dev/mapper/ceph--bee31cdd--e899--4f9a--9e77--df71cfad66f9-osd--data--b5df7900--0cf0--4b1a--a337--7b57c9f0111b"
		}
	  ]`)

	oldData := make(map[string]string, 1)
	oldData["devices"] = "[{}]"
	oldCM.Data = oldData

	newData := make(map[string]string, 1)
	newData["devices"] = string(devices)
	newCM.Data = newData

	// now there is a diff but cluster is not ready
	b = clientCluster.onDeviceCMUpdate(oldCM, newCM)
	assert.False(t, b)

	// finally the cluster is ready and we can reconcile
	// Add ready status to the CephCluster
	cephCluster.Status.Phase = k8sutil.ReadyStatus
	client = getFakeClient(objects...)
	clientCluster.client = client
	b = clientCluster.onDeviceCMUpdate(oldCM, newCM)
	assert.True(t, b)
}


text:
<?php

namespace Brightmarch\Bundle\RestfulBundle\Exceptions;

class HttpNotAcceptableException extends HttpException
{

    public function __construct($message)
    {
        parent::__construct($message, 406);
    }

}


text:
class ACDBCORE2D_PORT AcDbAssocActionBody : public AcDbObject
{
public:
  ACRX_DECLARE_MEMBERS(AcDbAssocActionBody);
  explicit AcDbAssocActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
  virtual ~AcDbAssocActionBody();
    /// <summary>
    /// Returns AcDbObjectId of the parent AcDbAssocAction that owns this
    /// action body object.
    /// </summary>
    ///
  AcDbObjectId parentAction() const
  {
    return ownerId();
  }
    /// <summary>
    /// Returns AcDbObjectId of the parent AcDbAssocAction that owns the given
    /// action body object.
    /// </summary>
    ///
  static AcDbObjectId parentAction(const AcDbObjectId& actionBodyId);
    // The following non-virtual methods are just shortcuts that just forward
    // to the parent AcDbAssocAction class, to save some typing for the
    // implementers of the derived custom action body classes

    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcDbAssocStatus status() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus setStatus(AcDbAssocStatus newStatus, bool notifyOwningNetwork = true, bool setInOwnedActions = false) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcDbObjectId owningNetwork() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus getDependencies(bool readDependenciesWanted, bool writeDependenciesWanted, AcDbObjectIdArray& dependencyIds) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus addDependency(const AcDbObjectId& dependencyId, bool setThisActionAsOwningAction = true) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus addDependency(AcRxClass* pDependencyClass, AcRxClass* pDependencyBodyClass, bool isReadDep, bool isWriteDep, int order, AcDbObjectId& dependencyId) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus removeDependency(const AcDbObjectId& dependencyId, bool alsoEraseIt) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus removeAllDependencies(bool alsoEraseThem) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus evaluateDependencies() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  bool isActionEvaluationInProgress() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcDbAssocEvaluationCallback* currentEvaluationCallback() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus removeAllParams(bool alsoEraseThem) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  int paramCount() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  const AcDbObjectIdArray& ownedParams() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus addParam(const AcDbObjectId& paramId, int& paramIndex) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus addParam(const AcString& paramName, AcRxClass* pParamClass, AcDbObjectId& paramId, int& paramIndex) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus removeParam(const AcDbObjectId& paramId, bool alsoEraseIt) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  const AcDbObjectIdArray& paramsAtName(const AcString& paramName) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcDbObjectId paramAtName(const AcString& paramName, int index = 0) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcDbObjectId paramAtIndex(int paramIndex) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  void ownedValueParamNames(AcArray<AcString>& paramNames) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus getValueParamArray(const AcString& paramName, AcArray<AcDbEvalVariant>& values, AcArray<AcString>& expressions, AcArray<AcString>& evaluatorIds) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus getValueParam(const AcString& paramName, AcDbEvalVariant& value, AcString& expression, AcString& evaluatorId, int valueIndex = 0) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus setValueParamArray(const AcString& paramName, const AcArray<AcDbEvalVariant>& values, const AcArray<AcString>& expressions, const AcArray<AcString>& evaluatorIds, AcArray<AcString>& errorMessages, bool silentMode) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus setValueParam(const AcString& paramName, const AcDbEvalVariant& value, const AcString& expression, const AcString& evaluatorId, AcString& errorMessage, bool silentMode, int valueIndex = 0) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  AcValue::UnitType valueParamUnitType(const AcString& paramName) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus setValueParamUnitType(const AcString& paramName, AcValue::UnitType unitType) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus removeValueParam(const AcString& paramName) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus valueParamInputVariables(const AcString& paramName, AcDbObjectIdArray& variableIds) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus setValueParamControlledObjectDep(const AcString& paramName, const AcDbObjectId& controlledObjectDepId) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus updateValueParamControlledObject(const AcString& paramName) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus updateValueParamFromControlledObject(const AcString& paramName) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus updateAllObjectsControlledByValueParams() const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus transformAllConstantGeometryParams(const AcGeMatrix3d& transform) const;
    /// <summary>
    /// Just a shortcut, calls the method on the parent AcDbAssocAction that
    /// owns this action body object.
    /// </summary>
    ///
  Acad::ErrorStatus scaleAllDistanceValueParams(double scaleFactor) const;
    /// <summary>
    /// Utility function that returns true if the action owns any dependency whose
    /// status is kErasedAssocStatus or whose dependent-on object cannot be
    /// opened. AcDbAssocValueDependencies are ignored.
    /// </summary>
    ///
  bool hasAnyErasedOrBrokenDependencies() const;
    /// <summary> <para>
    /// Utility function that creates AcDbAssocAction and AcDbAssocActionBody
    /// of the required class, makes the action own the action body and posts
    /// both to the database of the given objectId.
    /// </para> <para>
    /// It uses the objectId to find the network to add the newly created action
    /// to. If the objectId is of an AcDbAssocNetwork, this network is used.
    /// If the objectId is of an AcDbBlockTableRecord or of an entity owned by
    /// a AcDbBlockTableRecord, adds the newly created action to the network of
    /// the AcDbBlockTableRecord.
    /// </para> </summary>
    ///
  static Acad::ErrorStatus createActionAndActionBodyAndPostToDatabase(AcRxClass* pActionBodyClass, const AcDbObjectId& objectId, AcDbObjectId& createdActionId, AcDbObjectId& createdActionBodyId);
    /// <summary>
    /// Utility static method that returns all action bodies of all actions that
    /// have the requested type of dependencies on the given object. Notice that
    /// There may be no more than a single action that has a write-only dependency
    /// on the object, that is why the pWriteOnlyActionBodyId is a pointer to a
    /// single AcDbObjectId, not to an AcDbObjectIdArray. If any of the pointers
    /// are NULL, the type of action bodies are not returned.
    /// </summary>
    ///
  static Acad::ErrorStatus getActionBodiesOnObject(const AcDbObject* pObject, bool ignoreInternalActions, bool ignoreSuppressedActions, AcDbObjectId* pWriteOnlyActionBodyId, AcDbObjectIdArray* pReadWriteActionBodyIds, AcDbObjectIdArray* pReadOnlyActionBodyIds = NULL);
    // Virtual methods that can be overridden by the derived classes

    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. This method has to be overridden and
    /// this is how the behavior of custom actions is implemented.
    /// </summary>
    ///
  virtual void evaluateOverride() = 0;
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus getDependenciesOverride(bool readDependenciesWanted, bool writeDependenciesWanted, AcDbObjectIdArray& dependencyIds) const
  {
    ADESK_UNREFED_PARAM(readDependenciesWanted);
    ADESK_UNREFED_PARAM(writeDependenciesWanted);
    ADESK_UNREFED_PARAM(dependencyIds);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus getDependentObjectsOverride(bool readDependenciesWanted, bool writeDependenciesWanted, AcDbObjectIdArray& objectIds) const
  {
    ADESK_UNREFED_PARAM(readDependenciesWanted);
    ADESK_UNREFED_PARAM(writeDependenciesWanted);
    ADESK_UNREFED_PARAM(objectIds);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus removeAllDependenciesOverride(bool alsoEraseThem)
  {
    ADESK_UNREFED_PARAM(alsoEraseThem);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus isOwnedDependencyOverride(const AcDbAssocDependency* pDependency, bool& isOwnedDependency) const
  {
    ADESK_UNREFED_PARAM(pDependency);
    ADESK_UNREFED_PARAM(isOwnedDependency);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus isExternalDependencyOverride(const AcDbAssocDependency* pDependency, bool& isExternalDependency) const
  {
    ADESK_UNREFED_PARAM(pDependency);
    ADESK_UNREFED_PARAM(isExternalDependency);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus hasDependencyCachedValueOverride(const AcDbAssocDependency* pDependency, bool& hasDepCachedValue) const
  {
    ADESK_UNREFED_PARAM(pDependency);
    ADESK_UNREFED_PARAM(hasDepCachedValue);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus isRelevantDependencyChangeOverride(const AcDbAssocDependency* pDependency, bool& isRelevantDepChange) const
  {
    ADESK_UNREFED_PARAM(pDependency);
    ADESK_UNREFED_PARAM(isRelevantDepChange);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus areDependenciesOnTheSameThingOverride(const AcDbAssocDependency* pDependency1, const AcDbAssocDependency* pDependency2, bool& areDependentOnSameThing) const
  {
    ADESK_UNREFED_PARAM(pDependency1);
    ADESK_UNREFED_PARAM(pDependency2);
    ADESK_UNREFED_PARAM(areDependentOnSameThing);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus areDependenciesEqualOverride(const AcDbAssocDependency* pDependency1, const AcDbAssocDependency* pDependency2, bool& areEqual) const
  {
    ADESK_UNREFED_PARAM(pDependency1);
    ADESK_UNREFED_PARAM(pDependency2);
    ADESK_UNREFED_PARAM(areEqual);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus evaluateDependencyOverride(AcDbAssocDependency* pDependency)
  {
    ADESK_UNREFED_PARAM(pDependency);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus dependentObjectClonedOverride(const AcDbAssocDependency* pDependency, const AcDbObject* pDbObj, const AcDbObject* pNewObj)
  {
    ADESK_UNREFED_PARAM(pDependency);
    ADESK_UNREFED_PARAM(pDbObj);
    ADESK_UNREFED_PARAM(pNewObj);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus addMoreObjectsToDeepCloneOverride(AcDbIdMapping&, AcDbObjectIdArray&) const
  {
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus postProcessAfterDeepCloneOverride(AcDbIdMapping&)
  {
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus postProcessAfterDeepCloneCancelOverride(AcDbIdMapping&)
  {
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus ownedDependencyStatusChangedOverride(AcDbAssocDependency* pOwnedDependency, AcDbAssocStatus previousStatus)
  {
    ADESK_UNREFED_PARAM(pOwnedDependency);
    ADESK_UNREFED_PARAM(previousStatus);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus isEqualToOverride(const AcDbAssocAction* pOtherAction, bool& isEqual) const
  {
    ADESK_UNREFED_PARAM(pOtherAction);
    ADESK_UNREFED_PARAM(isEqual);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus evaluationPriorityOverride(AcDbAssocEvaluationPriority& priority) const
  {
    ADESK_UNREFED_PARAM(priority);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus getDependentActionsToEvaluateOverride(AcDbActionsToEvaluateCallback* pActionsToEvaluateCallback) const
  {
    ADESK_UNREFED_PARAM(pActionsToEvaluateCallback);
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus transformActionByOverride(const AcGeMatrix3d&)
  {
    return Acad::eNotImplemented;
  }
    /// <summary>
    /// Called from the corresponding method of the parent AcDbAssocAction class
    /// that owns this action body object. It does not need to be overridden.
    /// </summary>
    ///
  virtual Acad::ErrorStatus dragStatusOverride(const AcDb::DragStat status)
  {
    ADESK_UNREFED_PARAM(status);
    return Acad::eNotImplemented;
  }
    /// <summary><para>
    /// This method may be overridden in derived action body clases.
    /// </para><para>
    /// The AcDbAssocAction::removeActionsControllingObject() method notifies all
    /// action bodies that have a write-dependency on the controlled object by
    /// calling this method. The individual action bodies then can do some work
    /// before they are detached from the controlled object, or can even not let
    /// themselves be detached.
    /// </para><para>
    /// It this method returns Acad::eOk, AcDbAssocAction::removeActionsControllingObject()
    /// will not detach the action from the controlled object, expecting the
    /// action body to do it by itself. If not overridden, this method returns
    /// Acad::eNotImplemented, indicating that AcDbAssocAction::removeActionsControllingObject()
    /// should detach the action from the controlled object.
    /// </para></summary>
    /// <param name="pControlledObject">
    /// An AcDbObject for which AcDbAssocAction::removeActionsControllingObject()
    /// is being called. This action body has a write-dependency on this object.
    /// </param>
    /// <returns> Acad::ErrorStatus. </returns>
    ///
  virtual Acad::ErrorStatus removeActionsControllingObjectOverride(AcDbObject* pControlledObject)
  {
    ADESK_UNREFED_PARAM(pControlledObject);
    return Acad::eNotImplemented;
  }
    /// <summary><para>
    /// Called from AcDbAssocManager::auditAssociativeData() after file open and possibly
    /// after some other scenarios when the associative data may need to be audited and fixed-up.
    /// At this time custom code may also initialize internal chaches that were not saved to dwg/dxf
    /// file, or do some other work.
    /// </para><para>
    /// The action body may request the parent action to be erased by setting kErasedAssocStatus
    /// to parentActionHandling output argument. Setting kChangedDirectlyAssocStatus to
    /// parentActionHandling will make the parent action evaluate after the audit of all
    /// actions has been completed.
    /// </para><para>
    /// An example of possible and inevitable inconsistencies is when the drawing was modified
    /// in an AutoCAD release that didn't have code for the action, the action body was a proxy
    /// and therefore didn't react to notifications and didn't evaluate.
    /// </para><para>
    /// Another example of possible and inevitable ininconsistencies are references to objects
    /// that are not in the database any more because their owning objects were erased, the
    /// drawing was then saved, and these objects with erased owners were not saved to
    /// database. No notifications happen about the erase of these objects because they were
    /// not actually erased, so the actions cannot know that these objects are not in the database
    /// any more and may still hold AcDbObjectIds of these "lazily-erased" objects.
    /// </para><para>
    /// Before auditAssociativeDataOverride() is called, the system performs overall
    /// checks and fixes for cases like a dependency depending on a non-existent object,
    /// checks proper links between network, action, action body, action parameters, and
    /// dependencies, etc., so that these general checks do not need to be performed by
    /// the custom code.
    /// </para></summary>
    ///
  virtual void auditAssociativeDataOverride(AcDbAssocStatus& parentActionHandling);
    /// <summary>
    /// General notification that the action body can receive. The information
    /// about the notification is passed in an AcDbAssocNotificationData object.
    /// </summary>
    /// <remarks> For internal use only. </remarks>
    /// <param name="pNotificationData">
    /// Pointer to an AcDbAssocNotificationData object. The action body should check
    /// the type of the AcDbAssocNotificationData object, cast it to that type,
    /// and obtain the notification information from it.
    /// </param>
    /// <returns> Acad::ErrorStatus. </returns>
    ///
  virtual Acad::ErrorStatus notificationOverride(class AcDbAssocNotificationData* pNotificationData);
    /// <summary>
    /// Using this method the action body reveals its AcDbStepIds and AcDbPersSubentIds
    /// to the AcDbAssocPersSubentManager.
    /// </summary>
    /// <remarks> For internal use only. </remarks>
    /// <param name="stepIds">       The array of returned AcDbPersStepIds.    </param>
    /// <param name="persSubentIds"> The array of returned  AcDbPersSubentIds. </param>
    ///
  virtual Acad::ErrorStatus collectPersSubentNamingDataOverride(AcDbPersStepIdArray& stepIds, AcDbPersSubentIdArray& persSubentIds) const;
    /// <summary>
    /// Using this method the action body asks the AcDbAssocPersSubentManager
    /// to remap its AcDbPersStepIds and PersSubentIds after the action body
    /// has been cloned.
    /// </summary>
    /// <remarks> For internal use only. </remarks>
    /// <param name="pCloner">
    /// AcDbAssocPersSubentManagerCloner that the action body uses to remap
    /// its AcDbPersStepIds and PersSubentIds.
    /// </param>
    //
  virtual Acad::ErrorStatus clonePersSubentNamingDataOverride(class AcDbAssocPersSubentManagerCloner* pCloner);
};
/// <summary>
/// Just to be able to specify output AcString parameters by default value.
/// </summary>
///
ACDBCORE2D_PORT AcString& dummyString();
#pragma  pack (pop)


text:
/**
 * DO NOT MODIFY THIS CODE
 *
 * Place all of your changes in PaymentDetails.java
 *
 * It has been machine generated from fixtures and your changes will be
 * lost if anything new needs to be added to the API.
 **/
// Last Generated: 2011-09-26T15:53:49-04:00
package com.haravan.api.resources;

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

/**
 * This code has been machine generated by processing the single entry
 * fixtures found from the Haravan API Documentation
 */

public class MGPaymentDetails extends HaravanResource {

	@JsonProperty("credit_card_company")
	public String getCreditCardCompany() {
		return (String)getAttribute("credit_card_company");
	}
	@JsonProperty("credit_card_company")
	public void setCreditCardCompany(String _credit_card_company) {
		setAttribute("credit_card_company", _credit_card_company);
	}

	@JsonProperty("credit_card_number")
	public String getCreditCardNumber() {
		return (String)getAttribute("credit_card_number");
	}
	@JsonProperty("credit_card_number")
	public void setCreditCardNumber(String _credit_card_number) {
		setAttribute("credit_card_number", _credit_card_number);
	}

}


text:
package cmd

import (
	"io/ioutil"
	"os"
	"path/filepath"

	"github.com/TheThingsNetwork/ttn/api"
	"github.com/TheThingsNetwork/ttn/api/discovery"
	"github.com/TheThingsNetwork/ttn/api/pool"
	"github.com/TheThingsNetwork/ttn/core/types"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	"golang.org/x/net/context" // See https://github.com/grpc/grpc-go/issues/711"
	"google.golang.org/grpc/metadata"
)

// brokerRegisterPrefixCmd represents the secure command
var brokerRegisterPrefixCmd = &cobra.Command{
	Use:   "register-prefix [prefix ...]",
	Short: "Register a prefix to this Broker",
	Long:  `ttn broker register prefix registers a prefix to this Broker`,
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			cmd.UsageFunc()(cmd)
			return
		}

		path := filepath.Clean(viper.GetString("key-dir") + "/ca.cert")
		cert, err := ioutil.ReadFile(path)
		if err == nil && !pool.RootCAs.AppendCertsFromPEM(cert) {
			ctx.Warnf("Could not add root certificates from %s", path)
		}

		conn, err := api.Dial(viper.GetString("discovery-address"))
		if err != nil {
			ctx.WithError(err).Fatal("Could not connect to Discovery server")
		}
		client := discovery.NewDiscoveryClient(conn)

		client.GetAll(context.Background(), &discovery.GetServiceRequest{})

		md := metadata.Pairs(
			"service-name", "broker",
			"id", viper.GetString("id"),
			"token", viper.GetString("auth-token"),
		)
		dscContext := metadata.NewOutgoingContext(context.Background(), md)

		success := true
		for _, prefixString := range args {
			ctx := ctx.WithField("Prefix", prefixString)
			prefix, err := types.ParseDevAddrPrefix(prefixString)
			if err != nil {
				ctx.WithError(err).Error("Could not register prefix")
				success = false
				continue
			}
			_, err = client.AddMetadata(dscContext, &discovery.MetadataRequest{
				ServiceName: "broker",
				Id:          viper.GetString("id"),
				Metadata: &discovery.Metadata{Metadata: &discovery.Metadata_DevAddrPrefix{
					DevAddrPrefix: prefix.Bytes(),
				}},
			})
			if err != nil {
				ctx.WithError(err).Error("Could not register prefix")
				success = false
				continue
			}
			ctx.Info("Registered prefix")
		}

		if !success {
			os.Exit(1)
		}
	},
}

func init() {
	brokerCmd.AddCommand(brokerRegisterPrefixCmd)
}


text:
var config = require('config');
var memcached = require('./index')(config.memcached);
var co = require('co');

co(function* () {
    var key = 'test';
    yield memcached.set(key, 7, 3600);
    var get  = yield memcached.get(key);
    console.log('get--->>>', get);

    var del  = yield memcached.delete(key);

    var get  = yield memcached.get(key);
    console.log('get--->>>', get);

})();


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "country".
 *
 * @property integer $id
 * @property string $country
 * @property integer $zone_id
 *
 * @property Address[] $addresses
 * @property ShippingZones $zone
 */
class Country extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'country';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['country'], 'required'],
            [['zone_id'], 'integer'],
            [['country'], 'string', 'max' => 45]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'country' => 'Country',
            'zone_id' => 'Zone ID',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAddresses()
    {
        return $this->hasMany(Address::className(), ['country_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getZone()
    {
        return $this->hasOne(ShippingZones::className(), ['id' => 'zone_id']);
    }

    /**
     * @inheritdoc
     * @return CountryQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new CountryQuery(get_called_class());
    }
}


text:
/*jslint nomen: true, unparam: true, regexp: true */
/*global $, window, document */

$(function () {
    'use strict'; //What is this?

    // Initialize the jQuery File Upload widget:
    $('#fileupload').fileupload({
        maxChunkSize : 1500000, // ~1.5 MB
        add: function (e, data) {
            var that = this;
            var uploadCheckAction = $('#fileupload').prop('action').replace('upload.action','partialUploadCheck.action');
            var params = {
                    chunkedFileName: data.files[0].name,
                    chunkedFileSize: data.files[0].size,
                    'project.id': $('#uploadProjectId').val()
            };
            $.getJSON(uploadCheckAction, params, function (file) {
                data.uploadedBytes = file && file.size;
                $.blueimpUI.fileupload.prototype
                    .options.add.call(that, e, data);
            });
        }
    });

    // Load existing files:
    $.getJSON($('#fileupload').prop('action'), function (files) {
        var fu = $('#fileupload').data('fileupload'), template;
        fu._adjustMaxNumberOfFiles(-files.length);
        template = fu._renderDownload(files)
            .appendTo($('#fileupload .files'));
        // Force reflow:
        fu._reflow = fu._transition && template.length &&
            template[0].offsetWidth;
        template.addClass('in');
    });

    // Enable iframe cross-domain access via redirect page:
    var redirectPage = window.location.href.replace(
        /\/[^\/]*$/,
        '/cors/result.html?%s'
    );
    $('#fileupload').bind('fileuploadsend', function (e, data) {
        if (data.dataType.substr(0, 6) === 'iframe') {
            var target = $('<a/>').prop('href', data.url)[0];
            if (window.location.host !== target.host) {
                data.formData.push({
                    name: 'redirect',
                    value: redirectPage
                });
            }
        }
    });

    $('#fileupload').bind('fileuploadstop', function (e, data) {
        onUploadDone();
    });

    // Open download dialogs via iframes,
    // to prevent aborting current uploads:
    $('#fileupload .files').delegate(
        'a:not([rel^=gallery])',
        'click',
        function (e) {
            e.preventDefault();
            $('<iframe style="display:none;"></iframe>')
                .prop('src', this.href)
                .appendTo(document.body);
        }
    );

});


text:
// CLASS HEADER
#include <dali/devel-api/adaptor-framework/image-loading.h>

// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/internal/imaging/common/file-download.h>
#include <dali/internal/imaging/common/image-loader.h>
#include <dali/internal/system/common/file-reader.h>
#include <dali/public-api/object/property-map.h>

namespace Dali
{
namespace
{
// limit maximum image down load size to 50 MB
const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024;

} // namespace

Devel::PixelBuffer LoadImageFromFile(const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
  Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);

  Internal::Platform::FileReader fileReader(url);
  FILE* const                    fp = fileReader.GetFile();
  if(fp != NULL)
  {
    Dali::Devel::PixelBuffer bitmap;
    bool                     success = TizenPlatform::ImageLoader::ConvertStreamToBitmap(resourceType, url, fp, bitmap);
    if(success && bitmap)
    {
      return bitmap;
    }
  }
  return Dali::Devel::PixelBuffer();
}

void LoadImagePlanesFromFile(const std::string& url, std::vector<Devel::PixelBuffer>& buffers, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
  Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);

  Internal::Platform::FileReader fileReader(url);
  FILE* const                    fp = fileReader.GetFile();
  if(fp != NULL)
  {
    TizenPlatform::ImageLoader::ConvertStreamToPlanes(resourceType, url, fp, buffers);
  }
}

Devel::PixelBuffer LoadImageFromBuffer(const Dali::Vector<uint8_t>& buffer, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
  if(buffer.Empty())
  {
    DALI_LOG_ERROR("buffer is empty!\n");
    return Dali::Devel::PixelBuffer();
  }
  Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);

  Internal::Platform::FileReader fileReader(buffer);
  FILE* const                    fp = fileReader.GetFile();
  if(fp != NULL)
  {
    Dali::Devel::PixelBuffer bitmap;
    // Make path as empty string. Path information just for file format hint.
    bool success = TizenPlatform::ImageLoader::ConvertStreamToBitmap(resourceType, std::string(""), fp, bitmap);
    if(success && bitmap)
    {
      return bitmap;
    }
  }
  return Dali::Devel::PixelBuffer();
}

ImageDimensions GetClosestImageSize(const std::string& filename,
                                    ImageDimensions    size,
                                    FittingMode::Type  fittingMode,
                                    SamplingMode::Type samplingMode,
                                    bool               orientationCorrection)
{
  ImageDimensions dimension = TizenPlatform::ImageLoader::GetClosestImageSize(filename, size, fittingMode, samplingMode, orientationCorrection);

  dimension.SetWidth(std::min(dimension.GetWidth(), static_cast<uint16_t>(GetMaxTextureSize())));
  dimension.SetHeight(std::min(dimension.GetHeight(), static_cast<uint16_t>(GetMaxTextureSize())));

  return dimension;
}

ImageDimensions GetOriginalImageSize(const std::string& filename, bool orientationCorrection)
{
  return TizenPlatform::ImageLoader::GetClosestImageSize(filename, ImageDimensions(0, 0), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, orientationCorrection);
}

Devel::PixelBuffer DownloadImageSynchronously(const std::string& url, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
{
  Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);

  bool                  succeeded;
  Dali::Vector<uint8_t> dataBuffer;
  size_t                dataSize;

  succeeded = TizenPlatform::Network::DownloadRemoteFileIntoMemory(url, dataBuffer, dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE);
  if(succeeded)
  {
    size_t blobSize = dataBuffer.Size();
    DALI_ASSERT_DEBUG(blobSize > 0U);

    if(blobSize > 0U)
    {
      // Open a file handle on the memory buffer:
      Dali::Internal::Platform::FileReader fileReader(dataBuffer, blobSize);
      FILE* const                          fp = fileReader.GetFile();
      if(NULL != fp)
      {
        Dali::Devel::PixelBuffer bitmap;
        bool                     result = TizenPlatform::ImageLoader::ConvertStreamToBitmap(
          resourceType,
          url,
          fp,
          bitmap);

        if(result && bitmap)
        {
          return bitmap;
        }
        else
        {
          DALI_LOG_WARNING("Unable to decode bitmap supplied as in-memory blob.\n");
        }
      }
    }
  }
  return Dali::Devel::PixelBuffer();
}

unsigned int GetMaxTextureSize()
{
  return TizenPlatform::ImageLoader::GetMaxTextureSize();
}

} // namespace Dali


text:
package org.springframework.cloud.zookeeper.config;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;

import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/**
 * @author Enrique Recarte Llorens
 * @author Olga Maciaszek-Sharma
 */
public class ZookeeperPropertySourceLocatorFailFastTests {

	@Before
	public void setUp() {
		// This system property makes Curator fail faster, otherwise it takes 15 seconds
		// to trigger a retry
		System.setProperty("curator-default-connection-timeout", "0");
	}

	@After
	public void tearDown() {
		System.clearProperty("curator-default-connection-timeout");
	}

	@Test
	public void testFailFastFalseLoadsTheApplicationContext() {
		assertThatCode(() -> {
			new SpringApplicationBuilder().sources(Config.class)
					.web(WebApplicationType.NONE)
					.run("--spring.application.name=testZookeeperPropertySourceLocatorFailFast",
							"--spring.config.use-legacy-processing=true",
							"--spring.cloud.zookeeper.config.connectString=localhost:2188",
							"--spring.cloud.zookeeper.baseSleepTimeMs=0",
							"--spring.cloud.zookeeper.maxRetries=0",
							"--spring.cloud.zookeeper.maxSleepMs=0",
							"--spring.cloud.zookeeper.blockUntilConnectedWait=0",
							"--spring.cloud.zookeeper.config.failFast=false");
		}).doesNotThrowAnyException();
	}

	@Test
	public void testFailFastTrueDoesNotLoadTheApplicationContext() {
		assertThatThrownBy(() -> {
			new SpringApplicationBuilder().sources(Config.class)
					.web(WebApplicationType.NONE)
					.run("--spring.application.name=testZookeeperPropertySourceLocatorFailFast",
							"--spring.config.use-legacy-processing=true",
							"--spring.cloud.zookeeper.config.connectString=localhost:2188",
							"--spring.cloud.zookeeper.baseSleepTimeMs=0",
							"--spring.cloud.zookeeper.maxRetries=0",
							"--spring.cloud.zookeeper.maxSleepMs=0",
							"--spring.cloud.zookeeper.blockUntilConnectedWait=0",
							"--spring.cloud.zookeeper.config.failFast=true");
		})
				.isNotNull();
	}

	@SpringBootConfiguration
	@EnableAutoConfiguration
	static class Config {

	}

}


text:
<?php

/**
 * Counterattack
 *
 * @phpstub
 *
 * @param array $open
 * @param array $high
 * @param array $low
 * @param array $close
 *
 * @return array Returns an array with calculated data or false on failure.
 */
function trader_cdlcounterattack($open, $high, $low, $close)
{
}


text:
using CefSharp;
using TweetDuck.Browser.Notification;
using TweetDuck.Controls;
using TweetLib.Browser.Contexts;
using IContextMenuHandler = TweetLib.Browser.Interfaces.IContextMenuHandler;

namespace TweetDuck.Browser.Base {
	sealed class ContextMenuNotification : ContextMenuBase {
		private readonly FormNotificationBase form;

		public ContextMenuNotification(FormNotificationBase form, IContextMenuHandler? handler) : base(handler) {
			this.form = form;
		}

		protected override Context CreateContext(IContextMenuParams parameters) {
			Context context = base.CreateContext(parameters);
			context.Notification = new TweetLib.Browser.Contexts.Notification(form.CurrentTweetUrl, form.CurrentQuoteUrl);
			return context;
		}

		public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) {
			base.OnBeforeContextMenu(browserControl, browser, frame, parameters, model);
			form.InvokeAsyncSafe(() => form.ContextMenuOpen = true);
		}

		public override void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame) {
			base.OnContextMenuDismissed(browserControl, browser, frame);
			form.InvokeAsyncSafe(() => form.ContextMenuOpen = false);
		}
	}
}


text:
using System;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;

namespace Avro
{
    /// <summary>
    /// Base class for all schema types
    /// </summary>
    public abstract class Schema
    {
        /// <summary>
        /// Enum for schema types
        /// </summary>
        public enum Type
        {
            /// <summary>
            /// No value.
            /// </summary>
            Null,

            /// <summary>
            /// A binary value.
            /// </summary>
            Boolean,

            /// <summary>
            /// A 32-bit signed integer.
            /// </summary>
            Int,

            /// <summary>
            /// A 64-bit signed integer.
            /// </summary>
            Long,

            /// <summary>
            /// A single precision (32-bit) IEEE 754 floating-point number.
            /// </summary>
            Float,

            /// <summary>
            /// A double precision (64-bit) IEEE 754 floating-point number.
            /// </summary>
            Double,

            /// <summary>
            /// A sequence of 8-bit unsigned bytes.
            /// </summary>
            Bytes,

            /// <summary>
            /// An unicode character sequence.
            /// </summary>
            String,

            /// <summary>
            /// A logical collection of fields.
            /// </summary>
            Record,

            /// <summary>
            /// An enumeration.
            /// </summary>
            Enumeration,

            /// <summary>
            /// An array of values.
            /// </summary>
            Array,

            /// <summary>
            /// A map of values with string keys.
            /// </summary>
            Map,

            /// <summary>
            /// A union.
            /// </summary>
            Union,

            /// <summary>
            /// A fixed-length byte string.
            /// </summary>
            Fixed,

            /// <summary>
            /// A protocol error.
            /// </summary>
            Error,

            /// <summary>
            /// A logical type.
            /// </summary>
            Logical
        }

        /// <summary>
        /// Schema type property
        /// </summary>
        public Type Tag { get; private set; }

        /// <summary>
        /// Additional JSON attributes apart from those defined in the AVRO spec
        /// </summary>
        internal PropertyMap Props { get; private set; }

        /// <summary>
        /// Constructor for schema class
        /// </summary>
        /// <param name="type"></param>
        /// <param name="props">dictionary that provides access to custom properties</param>
        protected Schema(Type type, PropertyMap props)
        {
            this.Tag = type;
            this.Props = props;
        }

        /// <summary>
        /// If this is a record, enum or fixed, returns its name, otherwise the name the primitive type.
        /// </summary>
        public abstract string Name { get; }

        /// <summary>
        /// The name of this schema. If this is a named schema such as an enum, it returns the fully qualified
        /// name for the schema. For other schemas, it returns the type of the schema.
        /// </summary>
        public virtual string Fullname
        {
            get { return Name; }
        }

        /// <summary>
        /// Static class to return new instance of schema object
        /// </summary>
        /// <param name="jtok">JSON object</param>
        /// <param name="names">list of named schemas already read</param>
        /// <param name="encspace">enclosing namespace of the schema</param>
        /// <returns>new Schema object</returns>
        internal static Schema ParseJson(JToken jtok, SchemaNames names, string encspace)
        {
            if (null == jtok) throw new ArgumentNullException("j", "j cannot be null.");

            if (jtok.Type == JTokenType.String) // primitive schema with no 'type' property or primitive or named type of a record field
            {
                string value = (string)jtok;

                PrimitiveSchema ps = PrimitiveSchema.NewInstance(value);
                if (null != ps) return ps;

                NamedSchema schema = null;
                if (names.TryGetValue(value, null, encspace, null, out schema)) return schema;

                throw new SchemaParseException($"Undefined name: {value} at '{jtok.Path}'");
            }

            if (jtok is JArray) // union schema with no 'type' property or union type for a record field
                return UnionSchema.NewInstance(jtok as JArray, null, names, encspace);

            if (jtok is JObject) // JSON object with open/close parenthesis, it must have a 'type' property
            {
                JObject jo = jtok as JObject;

                JToken jtype = jo["type"];
                if (null == jtype)
                    throw new SchemaParseException($"Property type is required at '{jtok.Path}'");

                var props = Schema.GetProperties(jtok);

                if (jtype.Type == JTokenType.String)
                {
                    string type = (string)jtype;

                    if (type.Equals("array", StringComparison.Ordinal))
                        return ArraySchema.NewInstance(jtok, props, names, encspace);
                    if (type.Equals("map", StringComparison.Ordinal))
                        return MapSchema.NewInstance(jtok, props, names, encspace);
                    if (null != jo["logicalType"]) // logical type based on a primitive
                        return LogicalSchema.NewInstance(jtok, props, names, encspace);

                    Schema schema = PrimitiveSchema.NewInstance((string)type, props);
                    if (null != schema)
                        return schema;

                    return NamedSchema.NewInstance(jo, props, names, encspace);
                }
                else if (jtype.Type == JTokenType.Array)
                    return UnionSchema.NewInstance(jtype as JArray, props, names, encspace);
                else if (jtype.Type == JTokenType.Object)
                {
                    if (null != jo["logicalType"]) // logical type based on a complex type
                    {
                        return LogicalSchema.NewInstance(jtok, props, names, encspace);
                    }

                    var schema = ParseJson(jtype, names, encspace); // primitive schemas are allowed to have additional metadata properties
                    if (schema is PrimitiveSchema)
                    {
                        return schema;
                    }
                }
            }
            throw new AvroTypeException($"Invalid JSON for schema: {jtok} at '{jtok.Path}'");
        }

        /// <summary>
        /// Parses a given JSON string to create a new schema object
        /// </summary>
        /// <param name="json">JSON string</param>
        /// <returns>new Schema object</returns>
        public static Schema Parse(string json)
        {
            if (string.IsNullOrEmpty(json)) throw new ArgumentNullException(nameof(json), "json cannot be null.");
            return Parse(json.Trim(), new SchemaNames(), null); // standalone schema, so no enclosing namespace
        }

        /// <summary>
        /// Parses a JSON string to create a new schema object
        /// </summary>
        /// <param name="json">JSON string</param>
        /// <param name="names">list of named schemas already read</param>
        /// <param name="encspace">enclosing namespace of the schema</param>
        /// <returns>new Schema object</returns>
        internal static Schema Parse(string json, SchemaNames names, string encspace)
        {
            Schema sc = PrimitiveSchema.NewInstance(json);
            if (null != sc) return sc;

            try
            {
                bool IsArray = json.StartsWith("[", StringComparison.Ordinal)
                    && json.EndsWith("]", StringComparison.Ordinal);
                JContainer j = IsArray ? (JContainer)JArray.Parse(json) : (JContainer)JObject.Parse(json);

                return ParseJson(j, names, encspace);
            }
            catch (Newtonsoft.Json.JsonSerializationException ex)
            {
                throw new SchemaParseException("Could not parse. " + ex.Message + Environment.NewLine + json);
            }
        }

        /// <summary>
        /// Static function to parse custom properties (not defined in the Avro spec) from the given JSON object
        /// </summary>
        /// <param name="jtok">JSON object to parse</param>
        /// <returns>Property map if custom properties were found, null if no custom properties found</returns>
        internal static PropertyMap GetProperties(JToken jtok)
        {
            var props = new PropertyMap();
            props.Parse(jtok);
            if (props.Count > 0)
                return props;
            else
                return null;
        }

        /// <summary>
        /// Returns the canonical JSON representation of this schema.
        /// </summary>
        /// <returns>The canonical JSON representation of this schema.</returns>
        public override string ToString()
        {
            using (System.IO.StringWriter sw = new System.IO.StringWriter())
            using (Newtonsoft.Json.JsonTextWriter writer = new Newtonsoft.Json.JsonTextWriter(sw))
            {
                WriteJson(writer, new SchemaNames(), null); // stand alone schema, so no enclosing name space

                return sw.ToString();
            }
        }

        /// <summary>
        /// Writes opening { and 'type' property
        /// </summary>
        /// <param name="writer">JSON writer</param>
        private void writeStartObject(JsonTextWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("type");
            writer.WriteValue(GetTypeString(this.Tag));
        }

        /// <summary>
        /// Returns symbol name for the given schema type
        /// </summary>
        /// <param name="type">schema type</param>
        /// <returns>symbol name</returns>
        public static string GetTypeString(Type type)
        {
            return type != Type.Enumeration ? type.ToString().ToLowerInvariant() : "enum";
        }

        /// <summary>
        /// Default implementation for writing schema properties in JSON format
        /// </summary>
        /// <param name="writer">JSON writer</param>
        /// <param name="names">list of named schemas already written</param>
        /// <param name="encspace">enclosing namespace of the schema</param>
        protected internal virtual void WriteJsonFields(JsonTextWriter writer, SchemaNames names, string encspace)
        {
        }

        /// <summary>
        /// Writes schema object in JSON format
        /// </summary>
        /// <param name="writer">JSON writer</param>
        /// <param name="names">list of named schemas already written</param>
        /// <param name="encspace">enclosing namespace of the schema</param>
        protected internal virtual void WriteJson(JsonTextWriter writer, SchemaNames names, string encspace)
        {
            writeStartObject(writer);
            WriteJsonFields(writer, names, encspace);
            if (null != this.Props) Props.WriteJson(writer);
            writer.WriteEndObject();
        }

        /// <summary>
        /// Returns the schema's custom property value given the property name
        /// </summary>
        /// <param name="key">custom property name</param>
        /// <returns>custom property value</returns>
        public string GetProperty(string key)
        {
            if (null == this.Props) return null;
            string v;
            return this.Props.TryGetValue(key, out v) ? v : null;
        }

        /// <summary>
        /// Hash code function
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return Tag.GetHashCode() + getHashCode(Props);
        }

        /// <summary>
        /// Returns true if and only if data written using writerSchema can be read using the current schema
        /// according to the Avro resolution rules.
        /// </summary>
        /// <param name="writerSchema">The writer's schema to match against.</param>
        /// <returns>True if and only if the current schema matches the writer's.</returns>
        public virtual bool CanRead(Schema writerSchema) { return Tag == writerSchema.Tag; }

        /// <summary>
        /// Compares two objects, null is equal to null
        /// </summary>
        /// <param name="o1">first object</param>
        /// <param name="o2">second object</param>
        /// <returns>true if two objects are equal, false otherwise</returns>
        protected static bool areEqual(object o1, object o2)
        {
            return o1 == null ? o2 == null : o1.Equals(o2);
        }

        /// <summary>
        /// Hash code helper function
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        protected static int getHashCode(object obj)
        {
            return obj == null ? 0 : obj.GetHashCode();
        }

        /// <summary>
        /// Parses the Schema.Type from a string.
        /// </summary>
        /// <param name="type">The type to convert.</param>
        /// <param name="removeQuotes">if set to <c>true</c> [remove quotes].</param>
        /// <returns>A Schema.Type unless it could not parse then null</returns>
        /// <remarks>
        /// usage ParseType("string") returns Schema.Type.String
        /// </remarks>
        public static Schema.Type? ParseType(string type, bool removeQuotes = false)
        {
            string newValue = removeQuotes ? RemoveQuotes(type) : type;

            switch (newValue)
            {
                case "null":
                    return Schema.Type.Null;

                case "boolean":
                    return Schema.Type.Boolean;

                case "int":
                    return Schema.Type.Int;

                case "long":
                    return Schema.Type.Long;

                case "float":
                    return Schema.Type.Float;

                case "double":
                    return Schema.Type.Double;

                case "bytes":
                    return Schema.Type.Bytes;

                case "string":
                    return Schema.Type.String;

                case "record":
                    return Schema.Type.Record;

                case "enumeration":
                    return Schema.Type.Enumeration;

                case "array":
                    return Schema.Type.Array;

                case "map":
                    return Schema.Type.Map;

                case "union":
                    return Schema.Type.Union;

                case "fixed":
                    return Schema.Type.Fixed;

                case "error":
                    return Schema.Type.Error;

                case "logical":
                    return Schema.Type.Logical;

                default:
                    return null;
            }
        }

        /// <summary>
        /// Removes the quotes from the first position and last position of the string.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>
        /// If string has a quote at the beginning and the end it removes them,
        /// otherwise it returns the original string
        /// </returns>
        private static string RemoveQuotes(string value)
        {
            if(value.StartsWith("\"") && value.EndsWith("\""))
            {
                return value.Substring(1, value.Length - 2);
            }

            return value;
        }
    }
}


text:
static NSString * const PDFDocumentCropViewControllerSegueExit = @"PDFDocumentCropViewControllerSegueExit";

@interface PDFDocumentCropViewController () <UIGestureRecognizerDelegate>
@property (nonatomic, strong) PDFPageCropViewController *pdfPageViewController;
@property (nonatomic, assign) BOOL fullScreen;
@property (nonatomic, strong) UIButton *modeButton;
@property (nonatomic, strong) IBOutlet PDFDocumentCropLayoutView *layoutView;
@end

@implementation PDFDocumentCropViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor grayColor];

    self.modeButton = ({
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.titleLabel.font = [UIFont systemFontOfSize:12];
        button.titleEdgeInsets = UIEdgeInsetsMake(2, 8, 0, 0);
        button.imageEdgeInsets = UIEdgeInsetsMake(2, 0, 0, 0);
        [button setTitleColor:self.navigationController.navigationBar.tintColor
                     forState:UIControlStateNormal];
        [button setTitleColor:[self.navigationController.navigationBar.tintColor colorWithAlphaComponent:0.4]
                     forState:UIControlStateHighlighted];
        button.titleLabel.numberOfLines = 2;
        [button addTarget:self
                   action:@selector(changeMode:)
         forControlEvents:UIControlEventTouchUpInside];
        button;
    });
    [self updateModeButton];

    PDFPage *page = [self.document pageAtIndex:self.document.currentPage];
    self.pdfPageViewController =
            [[PDFPageCropViewController alloc] initWithPage:page];
    self.pdfPageViewController.crop = self.crop;
    [self.layoutView addSubview:self.pdfPageViewController.view];
    self.pdfPageViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |
            UIViewAutoresizingFlexibleHeight;
    self.pdfPageViewController.view.frame = self.layoutView.bounds;

    UITapGestureRecognizer *tapRec =
            [[UITapGestureRecognizer alloc] initWithTarget:self
                                                    action:@selector(singleTapped:)];
    tapRec.delegate = self;
    [self.pdfPageViewController.view addGestureRecognizer:tapRec];
}

- (void)changeMode:(id)sender
{
    self.crop.mode += 1;
    if (self.crop.mode == 3) {
        self.crop.mode = 0;
    }
    [self updateModeButton];
}

- (void)updateModeButton
{
    NSString *imageName = nil;
    NSString *title = nil;

    if (self.crop.mode == PDFDocumentCropModeSame) {
        imageName = @"CropBoth";
        title = LocalizedString(@"crop.same-crops-odd-and-even");
    } else if (self.crop.mode == PDFDocumentCropModeDifferent) {
        if (self.isOddPage) {
            imageName = @"CropOdd";
        } else {
            imageName = @"CropEven";
        }
        title = LocalizedString(@"crop.different-crops-odd-and-even");
    } else {
        title = LocalizedString(@"crop.no-crops");
        imageName = @"CropNone";
    }
    [self.modeButton setImage:[[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]
                     forState:UIControlStateNormal];
    [self.modeButton setTitle:title forState:UIControlStateNormal];
    [self.modeButton sizeToFit];
    self.modeButton.frame = ({
        CGRect r = self.modeButton.frame;
        r.size.height = 44;
        r.size.width += 8.0;
        r;
    });

    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:self.modeButton];
    self.navigationItem.leftBarButtonItem = item;
}

#pragma mark -

- (void)singleTapped:(UITapGestureRecognizer *)recognizer
{
    [self toggleFullScreen];
}

#pragma mark -

- (BOOL)prefersStatusBarHidden
{
    return self.fullScreen;
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

#pragma mark -

- (void)toggleFullScreen
{
    self.fullScreen = !self.fullScreen;

    CGFloat alpha = self.fullScreen ? 0.0 : 1.0;
    CGRect barFrame = self.navigationController.navigationBar.frame;
    barFrame.origin.y = 20;
    self.navigationController.navigationBar.frame = barFrame;
    if (!self.fullScreen) {
        [self.navigationController setNavigationBarHidden:NO animated:NO];
        self.navigationController.navigationBar.alpha = 0.0;
    }

    [UIView animateWithDuration:0.125
                     animations:^{
        [self setNeedsStatusBarAppearanceUpdate];
        self.navigationController.navigationBar.alpha = alpha;
    } completion:^(BOOL finished) {
        [self.navigationController setNavigationBarHidden:self.fullScreen animated:NO];
    }];

    self.navigationController.navigationBar.frame = CGRectZero;
    self.navigationController.navigationBar.frame = barFrame;
}

#pragma mark -

- (BOOL)isOddPage
{
    return self.document.currentPage % 2 != 0;
}

#pragma mark -

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:PDFDocumentCropViewControllerSegueExit]) {
        if (self.crop.mode == PDFDocumentCropModeSame) {
            self.crop.oddCropRect = self.pdfPageViewController.cropRect;
            self.crop.evenCropRect = self.pdfPageViewController.cropRect;
        } else if (self.crop.mode == PDFDocumentCropModeDifferent) {
            if (self.isOddPage) {
                self.crop.oddCropRect = self.pdfPageViewController.cropRect;
            } else {
                self.crop.evenCropRect = self.pdfPageViewController.cropRect;
            }
        }
    }
}

@end

@implementation PDFDocumentCropLayoutView : UIView

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
    return YES;
}

@end


text:
=begin
#NSX-T Manager API

#VMware NSX-T Manager REST API

OpenAPI spec version: 2.3.0.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.3.1

=end

require 'date'

module NSXT

  class AdvertisementConfig
    # Link to this resource
    attr_accessor :_self

    # The server will populate this field when returing the resource. Ignored on PUT and POST.
    attr_accessor :_links

    # Schema for this resource
    attr_accessor :_schema

    # The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected.
    attr_accessor :_revision

    # Indicates system owned resource
    attr_accessor :_system_owned

    # Defaults to ID if not set
    attr_accessor :display_name

    # Description of this resource
    attr_accessor :description

    # Opaque identifiers meaningful to the API user
    attr_accessor :tags

    # ID of the user who created this resource
    attr_accessor :_create_user

    # Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed             to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed                 to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super                    user and can modify it, but only when providing                    the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this           entity.
    attr_accessor :_protection

    # Timestamp of resource creation
    attr_accessor :_create_time

    # Timestamp of last modification
    attr_accessor :_last_modified_time

    # ID of the user who last modified this resource
    attr_accessor :_last_modified_user

    # Unique identifier of this resource
    attr_accessor :id

    # The type of this resource.
    attr_accessor :resource_type

    # Flag to advertise all connected routes
    attr_accessor :advertise_nsx_connected_routes

    # Flag to advertise lb vip
    attr_accessor :advertise_lb_vip

    # Flag to advertise all static routes
    attr_accessor :advertise_static_routes

    # Logical router id
    attr_accessor :logical_router_id

    # Flag to advertise all routes of nat
    attr_accessor :advertise_nat_routes

    # Flag to enable this configuration
    attr_accessor :enabled

    # Flag to advertise all lb SNAT ips
    attr_accessor :advertise_lb_snat_ip

    # Attribute mapping from ruby-style variable name to JSON key.
    def self.attribute_map
      {
        :'_self' => :'_self',
        :'_links' => :'_links',
        :'_schema' => :'_schema',
        :'_revision' => :'_revision',
        :'_system_owned' => :'_system_owned',
        :'display_name' => :'display_name',
        :'description' => :'description',
        :'tags' => :'tags',
        :'_create_user' => :'_create_user',
        :'_protection' => :'_protection',
        :'_create_time' => :'_create_time',
        :'_last_modified_time' => :'_last_modified_time',
        :'_last_modified_user' => :'_last_modified_user',
        :'id' => :'id',
        :'resource_type' => :'resource_type',
        :'advertise_nsx_connected_routes' => :'advertise_nsx_connected_routes',
        :'advertise_lb_vip' => :'advertise_lb_vip',
        :'advertise_static_routes' => :'advertise_static_routes',
        :'logical_router_id' => :'logical_router_id',
        :'advertise_nat_routes' => :'advertise_nat_routes',
        :'enabled' => :'enabled',
        :'advertise_lb_snat_ip' => :'advertise_lb_snat_ip'
      }
    end

    # Attribute type mapping.
    def self.swagger_types
      {
        :'_self' => :'SelfResourceLink',
        :'_links' => :'Array<ResourceLink>',
        :'_schema' => :'String',
        :'_revision' => :'Integer',
        :'_system_owned' => :'BOOLEAN',
        :'display_name' => :'String',
        :'description' => :'String',
        :'tags' => :'Array<Tag>',
        :'_create_user' => :'String',
        :'_protection' => :'String',
        :'_create_time' => :'Integer',
        :'_last_modified_time' => :'Integer',
        :'_last_modified_user' => :'String',
        :'id' => :'String',
        :'resource_type' => :'String',
        :'advertise_nsx_connected_routes' => :'BOOLEAN',
        :'advertise_lb_vip' => :'BOOLEAN',
        :'advertise_static_routes' => :'BOOLEAN',
        :'logical_router_id' => :'String',
        :'advertise_nat_routes' => :'BOOLEAN',
        :'enabled' => :'BOOLEAN',
        :'advertise_lb_snat_ip' => :'BOOLEAN'
      }
    end

    # Initializes the object
    # @param [Hash] attributes Model attributes in the form of hash
    def initialize(attributes = {})
      return unless attributes.is_a?(Hash)

      # convert string to symbol for hash key
      attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

      if attributes.has_key?(:'_self')
        self._self = attributes[:'_self']
      end

      if attributes.has_key?(:'_links')
        if (value = attributes[:'_links']).is_a?(Array)
          self._links = value
        end
      end

      if attributes.has_key?(:'_schema')
        self._schema = attributes[:'_schema']
      end

      if attributes.has_key?(:'_revision')
        self._revision = attributes[:'_revision']
      end

      if attributes.has_key?(:'_system_owned')
        self._system_owned = attributes[:'_system_owned']
      end

      if attributes.has_key?(:'display_name')
        self.display_name = attributes[:'display_name']
      end

      if attributes.has_key?(:'description')
        self.description = attributes[:'description']
      end

      if attributes.has_key?(:'tags')
        if (value = attributes[:'tags']).is_a?(Array)
          self.tags = value
        end
      end

      if attributes.has_key?(:'_create_user')
        self._create_user = attributes[:'_create_user']
      end

      if attributes.has_key?(:'_protection')
        self._protection = attributes[:'_protection']
      end

      if attributes.has_key?(:'_create_time')
        self._create_time = attributes[:'_create_time']
      end

      if attributes.has_key?(:'_last_modified_time')
        self._last_modified_time = attributes[:'_last_modified_time']
      end

      if attributes.has_key?(:'_last_modified_user')
        self._last_modified_user = attributes[:'_last_modified_user']
      end

      if attributes.has_key?(:'id')
        self.id = attributes[:'id']
      end

      if attributes.has_key?(:'resource_type')
        self.resource_type = attributes[:'resource_type']
      end

      if attributes.has_key?(:'advertise_nsx_connected_routes')
        self.advertise_nsx_connected_routes = attributes[:'advertise_nsx_connected_routes']
      else
        self.advertise_nsx_connected_routes = false
      end

      if attributes.has_key?(:'advertise_lb_vip')
        self.advertise_lb_vip = attributes[:'advertise_lb_vip']
      else
        self.advertise_lb_vip = false
      end

      if attributes.has_key?(:'advertise_static_routes')
        self.advertise_static_routes = attributes[:'advertise_static_routes']
      else
        self.advertise_static_routes = false
      end

      if attributes.has_key?(:'logical_router_id')
        self.logical_router_id = attributes[:'logical_router_id']
      end

      if attributes.has_key?(:'advertise_nat_routes')
        self.advertise_nat_routes = attributes[:'advertise_nat_routes']
      else
        self.advertise_nat_routes = false
      end

      if attributes.has_key?(:'enabled')
        self.enabled = attributes[:'enabled']
      else
        self.enabled = false
      end

      if attributes.has_key?(:'advertise_lb_snat_ip')
        self.advertise_lb_snat_ip = attributes[:'advertise_lb_snat_ip']
      else
        self.advertise_lb_snat_ip = false
      end

    end

    # Show invalid properties with the reasons. Usually used together with valid?
    # @return Array for valid properties with the reasons
    def list_invalid_properties
      invalid_properties = Array.new
      if !@display_name.nil? && @display_name.to_s.length > 255
        invalid_properties.push("invalid value for 'display_name', the character length must be smaller than or equal to 255.")
      end

      if !@description.nil? && @description.to_s.length > 1024
        invalid_properties.push("invalid value for 'description', the character length must be smaller than or equal to 1024.")
      end

      return invalid_properties
    end

    # Check to see if the all the properties in the model are valid
    # @return true if the model is valid
    def valid?
      return false if !@display_name.nil? && @display_name.to_s.length > 255
      return false if !@description.nil? && @description.to_s.length > 1024
      return true
    end

    # Custom attribute writer method with validation
    # @param [Object] display_name Value to be assigned
    def display_name=(display_name)

      if !display_name.nil? && display_name.to_s.length > 255
        fail ArgumentError, "invalid value for 'display_name', the character length must be smaller than or equal to 255."
      end

      @display_name = display_name
    end

    # Custom attribute writer method with validation
    # @param [Object] description Value to be assigned
    def description=(description)

      if !description.nil? && description.to_s.length > 1024
        fail ArgumentError, "invalid value for 'description', the character length must be smaller than or equal to 1024."
      end

      @description = description
    end

    # Checks equality by comparing each attribute.
    # @param [Object] Object to be compared
    def ==(o)
      return true if self.equal?(o)
      self.class == o.class &&
          _self == o._self &&
          _links == o._links &&
          _schema == o._schema &&
          _revision == o._revision &&
          _system_owned == o._system_owned &&
          display_name == o.display_name &&
          description == o.description &&
          tags == o.tags &&
          _create_user == o._create_user &&
          _protection == o._protection &&
          _create_time == o._create_time &&
          _last_modified_time == o._last_modified_time &&
          _last_modified_user == o._last_modified_user &&
          id == o.id &&
          resource_type == o.resource_type &&
          advertise_nsx_connected_routes == o.advertise_nsx_connected_routes &&
          advertise_lb_vip == o.advertise_lb_vip &&
          advertise_static_routes == o.advertise_static_routes &&
          logical_router_id == o.logical_router_id &&
          advertise_nat_routes == o.advertise_nat_routes &&
          enabled == o.enabled &&
          advertise_lb_snat_ip == o.advertise_lb_snat_ip
    end

    # @see the `==` method
    # @param [Object] Object to be compared
    def eql?(o)
      self == o
    end

    # Calculates hash code according to all attributes.
    # @return [Fixnum] Hash code
    def hash
      [_self, _links, _schema, _revision, _system_owned, display_name, description, tags, _create_user, _protection, _create_time, _last_modified_time, _last_modified_user, id, resource_type, advertise_nsx_connected_routes, advertise_lb_vip, advertise_static_routes, logical_router_id, advertise_nat_routes, enabled, advertise_lb_snat_ip].hash
    end

    # Builds the object from hash
    # @param [Hash] attributes Model attributes in the form of hash
    # @return [Object] Returns the model itself
    def build_from_hash(attributes)
      return nil unless attributes.is_a?(Hash)
      self.class.swagger_types.each_pair do |key, type|
        if type =~ /\AArray<(.*)>/i
          # check to ensure the input is an array given that the the attribute
          # is documented as an array but the input is not
          if attributes[self.class.attribute_map[key]].is_a?(Array)
            self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
          end
        elsif !attributes[self.class.attribute_map[key]].nil?
          self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
        end # or else data not found in attributes(hash), not an issue as the data can be optional
      end

      self
    end

    # Deserializes the data based on type
    # @param string type Data type
    # @param string value Value to be deserialized
    # @return [Object] Deserialized data
    def _deserialize(type, value)
      case type.to_sym
      when :DateTime
        DateTime.parse(value)
      when :Date
        Date.parse(value)
      when :String
        value.to_s
      when :Integer
        value.to_i
      when :Float
        value.to_f
      when :BOOLEAN
        if value.to_s =~ /\A(true|t|yes|y|1)\z/i
          true
        else
          false
        end
      when :Object
        # generic object (usually a Hash), return directly
        value
      when /\AArray<(?<inner_type>.+)>\z/
        inner_type = Regexp.last_match[:inner_type]
        value.map { |v| _deserialize(inner_type, v) }
      when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
        k_type = Regexp.last_match[:k_type]
        v_type = Regexp.last_match[:v_type]
        {}.tap do |hash|
          value.each do |k, v|
            hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
          end
        end
      else # model
        temp_model = NSXT.const_get(type).new
        temp_model.build_from_hash(value)
      end
    end

    # Returns the string representation of the object
    # @return [String] String presentation of the object
    def to_s
      to_hash.to_s
    end

    # to_body is an alias to to_hash (backward compatibility)
    # @return [Hash] Returns the object in the form of hash
    def to_body
      to_hash
    end

    # Returns the object in the form of hash
    # @return [Hash] Returns the object in the form of hash
    def to_hash
      hash = {}
      self.class.attribute_map.each_pair do |attr, param|
        value = self.send(attr)
        next if value.nil?
        hash[param] = _to_hash(value)
      end
      hash
    end

    # Outputs non-array value in the form of hash
    # For object, use to_hash. Otherwise, just return the value
    # @param [Object] value Any valid value
    # @return [Hash] Returns the value in the form of hash
    def _to_hash(value)
      if value.is_a?(Array)
        value.compact.map{ |v| _to_hash(v) }
      elsif value.is_a?(Hash)
        {}.tap do |hash|
          value.each { |k, v| hash[k] = _to_hash(v) }
        end
      elsif value.respond_to? :to_hash
        value.to_hash
      else
        value
      end
    end

  end

end


text:
package org.apache.ibatis.session;

import java.sql.Connection;

/**
 * 事务隔离级别
 */
public enum TransactionIsolationLevel {
  /** 没有事物 */
  NONE(Connection.TRANSACTION_NONE),
  /** 读提交 不可重复读*/
  READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED),
  /** 读未提交  脏读 */
  READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED),
  /** 重复读,即再一个事务开始时,不允许update操作, 但允许insert操作  可能出现幻读*/
  REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),
  /** 串行化 */
  SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE);

  private final int level;

  private TransactionIsolationLevel(int level) {
    this.level = level;
  }

  public int getLevel() {
    return level;
  }
}


text:
function(git_remote_has_ref uri ref_name ref_type)
  git_remote_ref("${uri}" "${ref_name}" "${ref_type}")
  ans(res)
  if(res)
    return(true)
  else()
    return(false)
  endif()

endfunction()


text:
package uk.ac.hutton.ics.buntata.service;

import java.util.*;

import jhi.buntata.resource.*;
import retrofit2.*;
import retrofit2.http.*;

/**
 * @author Sebastian Raubach
 */

public interface DatasourceProvider
{
	@GET("datasource")
	Call<List<BuntataDatasource>> getAll();
}