text:
#ifndef _MItMeshFaceVertex
#define _MItMeshFaceVertex
//-
// ==========================================================================
// Copyright (C) 1995 - 2006 Autodesk, Inc., and/or its licensors.  All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its
// licensors,  which is protected by U.S. and Canadian federal copyright law
// and by international treaties.
//
// The Data may not be disclosed or distributed to third parties or be
// copied or duplicated, in whole or in part, without the prior written
// consent of Autodesk.
//
// The copyright notices in the Software and this entire statement,
// including the above license grant, this restriction and the following
// disclaimer, must be included in all copies of the Software, in whole
// or in part, and all derivative works of the Software, unless such copies
// or derivative works are solely in the form of machine-executable object
// code generated by a source language processor.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
// AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
// WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
// NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
// OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO
// EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST
// REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR
// CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS
// BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
// ==========================================================================
//+
//
// CLASS:    MItMeshFaceVertex
//
// ****************************************************************************

#if defined __cplusplus

// ****************************************************************************
// INCLUDED HEADER FILES

#include <maya/MFnDagNode.h>
#include <maya/MObject.h>
#include <maya/MVector.h>
#include <maya/MPoint.h>
#include <maya/MColor.h>
#include <maya/MFloatArray.h>
#include <maya/MFloatVectorArray.h>
#include <maya/MVectorArray.h>
#include <maya/MColorArray.h>
#include <maya/MString.h>

// ****************************************************************************
// DECLARATIONS

class MPointArray;
class MDoubleArray;
class MIntArray;
class MDGModifier;

// ****************************************************************************
// CLASS DECLARATION (MItMeshFaceVertex)

//! \ingroup OpenMaya
//! \brief Face vertex iterator.
/*!
	This class is the iterator for face vertices on polygonal surfaces.

	The iterator functions in two modes depending on whether a component
	is specified. When a component is not given or is NULL the iteration
	will be over all polygons for the surface.  When a component is given
	this iterator will iterate over the polygons specified in the component.
	When iterating over components a DAG path to the surface must also be
	supplied.
*/
class OPENMAYA_EXPORT MItMeshFaceVertex
{
public:
    MItMeshFaceVertex( const MObject & polyObject, MStatus * ReturnStatus = NULL );
    MItMeshFaceVertex( const MDagPath &polyObject,
					MObject & component = MObject::kNullObj,
					MStatus * ReturnStatus = NULL );
	virtual ~MItMeshFaceVertex();
    bool        isDone( MStatus * ReturnStatus = NULL );
    MStatus     next();
    MStatus     reset();
    MStatus     reset( const MObject & polyObject );
    MStatus     reset( const MDagPath &polyObject,
						MObject & component = MObject::kNullObj );
    int         vertId( MStatus * ReturnStatus = NULL ) const;
    int         faceId( MStatus * ReturnStatus = NULL ) const;
    int         faceVertId( MStatus * ReturnStatus = NULL ) const;
	// Obsolete
	MObject		faceVertex(MStatus * ReturnStatus = NULL) const;
	MObject		currentItem(MStatus * ReturnStatus = NULL) const;

    MPoint      position( MSpace::Space space = MSpace::kObject,
						  MStatus * ReturnStatus = NULL );

    // Get/Set methods for normals.
    MStatus     getNormal( MVector & normal,
						   MSpace::Space space = MSpace::kObject ) const;
    int         normalId( MStatus * ReturnStatus = NULL ) const;

    int         tangentId( MStatus * ReturnStatus = NULL ) const;

    MVector     getTangent( MSpace::Space space = MSpace::kObject,
						    const MString * uvSet = NULL,
						    MStatus * ReturnStatus = NULL) const;

    MVector     getBinormal( MSpace::Space space = MSpace::kObject,
						     const MString * uvSet = NULL,
						     MStatus * ReturnStatus = NULL) const;

	// UV methods. Mention sharing in docs when setUVs
	bool		hasUVs( MStatus * ReturnStatus = NULL ) const;
    bool        hasUVs( const MString & uvSet,
						MStatus * ReturnStatus = NULL ) const;
    MStatus     getUV( float2 & uvPoint, const MString * uvSet = NULL) const;
    MStatus     getUVIndex( int & index, const MString *uvSet = NULL );
    MStatus     getUVIndex( int & index, float & u, float & v,
							const MString *uvSet = NULL);

	// Color methods. Mention sharing in docs when setUVs
	bool		hasColor(MStatus * ReturnStatus = NULL ) const;
	MStatus		getColor(MColor &color, const MString *colorSetName = NULL);
	MStatus		getColorIndex( int & colorIndex, const MString *colorSetName = NULL );

    MStatus     updateSurface();
    MStatus     geomChanged();
	MStatus		setIndex(int faceId, int vertFaceId,
					     int &prevFaceId, int &prevVertId );

    static const char*  className();

protected:
    bool		getUVSetIndex( const MString * uvSetName,
							   int & uvSet) const;

	bool		updateColorSet(const MString *colorSetName, int& prevSetId);

	void		resetColorSetToPrevious(const MString *colorSetName, int prevSetId);

private:
    MPtrBase *      f_shape;
    void 	 *      f_path;
    void 	 *      f_geom;
	void	 *		f_ref;
	void	 *		f_trans;

	void	 *		fCompIter;		// face vertex component iterator
	void     *      fElements;		// pointer to the vertex face component list

};

#endif /* __cplusplus */
#endif /* _MItMeshFaceVertex */


text:
package org.b3log.latke.cache.redis;

import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Latkes;
import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.Protocol;

/**
 * Redis connection utilities.
 *
 * @author Liang Ding
 * @version 1.0.1.1, Sep 27, 2019
 * @since 2.3.13
 */
public final class Connections {

    /**
     * Logger.
     */
    private static final Logger LOGGER = Logger.getLogger(Connections.class);

    /**
     * Pool.
     */
    private static JedisPool pool;

    static {
        try {
            final JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();

            final Latkes.RuntimeCache runtimeCache = Latkes.getRuntimeCache();
            if (Latkes.RuntimeCache.REDIS == runtimeCache) {
                final int minConnCnt = Integer.valueOf(Latkes.getLocalProperty("redis.minConnCnt"));
                jedisPoolConfig.setMinIdle(minConnCnt);
                final int maxConnCnt = Integer.valueOf(Latkes.getLocalProperty("redis.maxConnCnt"));
                jedisPoolConfig.setMaxTotal(maxConnCnt);
                final String host = Latkes.getLocalProperty("redis.host");
                final int port = Integer.valueOf(Latkes.getLocalProperty("redis.port"));
                String password = Latkes.getLocalProperty("redis.password");
                if (StringUtils.isBlank(password)) {
                    password = null;
                }
                final long waitTime = Long.valueOf(Latkes.getLocalProperty("redis.waitTime"));
                jedisPoolConfig.setMaxWaitMillis(waitTime);

                pool = new JedisPool(jedisPoolConfig, host, port, Protocol.DEFAULT_TIMEOUT, password);
            }
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Initializes redis connection pool failed", e);
        }
    }

    /**
     * Gets a jedis.
     *
     * @return jedis
     */
    public static Jedis getJedis() {
        return pool.getResource();
    }

    /**
     * Shutdowns pool.
     */
    static void shutdown() {
        pool.close();
    }

    /**
     * Private constructor.
     */
    private Connections() {
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace platform
{
namespace deRCB128RFA1
{
    using avr_halib::logging::devices::Uart;

    typedef avr_halib::config::Frequency< F_CPU > CPUClock;
    typedef avr_halib::config::Frequency< 32768 > RTCClock;

    struct LoggingConfig : public Uart::DefaultConfig
    {
        typedef avr_halib::regmaps::local::Uart0 RegMap;
        static const Uart::BaudRateType baudRate = 57600;
    };

    typedef Uart::configure<LoggingConfig>::type LoggingDevice;

    struct MorpheusConfig : public avr_halib::power::Morpheus::DefaultConfig
    {
        typedef boost::mpl::list< LoggingDevice::SleepSync >::type SyncList;
    };

    typedef avr_halib::power::Morpheus::configure< MorpheusConfig >::type Morpheus;

    struct AsyncTimerBaseConfig
    {
        typedef avr_halib::regmaps::local::Timer2 RegMap;
        typedef RTCClock InputFrequency;
    };

    struct Timer0BaseConfig
    {
        typedef avr_halib::regmaps::local::Timer0 RegMap;
        typedef CPUClock InputFrequency;
    };

    struct Timer1BaseConfig
    {
        typedef avr_halib::regmaps::local::Timer1 RegMap;
        typedef CPUClock InputFrequency;
    };

    typedef AsyncTimerBaseConfig Timer2BaseConfig;

    struct Timer3BaseConfig
    {
        typedef avr_halib::regmaps::local::Timer3 RegMap;
        typedef CPUClock InputFrequency;
    };

    struct Timer4BaseConfig
    {
        typedef avr_halib::regmaps::local::Timer4 RegMap;
        typedef CPUClock InputFrequency;
    };

    struct Timer5BaseConfig
    {
        typedef avr_halib::regmaps::local::Timer5 RegMap;
        typedef CPUClock InputFrequency;
    };

    #include <deRCB128RFA1_portmap.h>
}
}


text:
include ../makeinclude

clean:
	$(RM) api/html/*
	$(RM) api/latex/*

realclean: clean

install:


text:
//////////////////////////////////////////////////////////////////////////////
//
//                    Copyright 2019, Cornutum Project
//                             www.cornutum.org
//
//////////////////////////////////////////////////////////////////////////////

package org.cornutum.tcases.openapi.resolver;

import org.cornutum.tcases.VarBindingBuilder;
import org.cornutum.tcases.openapi.resolver.NumberDomain.Range;
import static org.cornutum.hamcrest.Composites.*;
import static org.cornutum.hamcrest.ExpectedFailure.expectFailure;
import static org.cornutum.tcases.openapi.resolver.DataValue.Type;

import org.junit.Test;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

import java.util.stream.Stream;
import static java.util.stream.Collectors.toSet;

import java.util.Arrays;
import java.util.List;

/**
 * Runs tests for {@link LongDomain}.
 */
public class LongDomainTest extends ValueDomainTest
  {
  @Test
  public void whenEnum()
    {
    // Given...
    List<String> longs = Arrays.asList( "1", "2", "3", "5", "3", "2", "1");
    LongEnum domain = new LongEnum( longs);

    // Then...
    List<Long> values = valuesOf( domain, 1000);
    assertThat( "Enum values size", values.size(), is( 1000));
    assertThat( "Enum values content", values.stream().collect( toSet()), containsMembers( Arrays.asList( 1L, 2L, 3L, 5L)));
    assertThat( "Contains", domain.contains( 5L), is( true));
    assertThat( "Contains", domain.contains( 8L), is( false));
    }

  @Test
  public void whenInvalidEnum()
    {
    // Given...
    List<String> longs = Arrays.asList( "?");

    expectFailure( ValueDomainException.class)
      .when( () -> new LongEnum( longs));
    }

  @Test
  public void whenRangeTooBig()
    {
    // Given...
    LongDomain domain = new LongDomain();

    // Then...
    expectFailure( IllegalArgumentException.class)
      .when( () -> domain.setRange( -1L, Long.MAX_VALUE));
    }

  @Test
  public void whenNotMultipleOf()
    {
    // Given...
    LongDomain domain = new LongDomain();

    // When...
    domain.setRange( 7L, 10L);
    domain.setMultipleOf( "2");
    domain.setNotMultipleOfs( new String[]{ "5" });

    // Then...
    List<Long> values = valuesOf( domain, 10);
    assertThat( "Values size", values.size(), is( 1));
    assertThat( "Value", domain.select( getResolverContext()), matches( dataValueMatcher( 8L, Type.INTEGER, "int64")));

    // When...
    domain.setRange( 9L, 11L);

    // Then...
    values = valuesOf( domain, 10);
    assertThat( "Values size", values.size(), is( 0));
    expectFailure( IllegalStateException.class).when( () -> domain.select( getResolverContext()));

    // When...
    domain.setRange( -11L, 11L);

    // Then...
    verifyContainsValues( domain, 1000);
    assertThat( "Contains", domain.contains( 4L), is( true));
    assertThat( "Contains", domain.contains( 12L), is( false));
    assertThat( "Contains", domain.contains( -10L), is( false));
    }

  @Test
  public void whenConstant()
    {
    // Given...
    LongConstant domain = new LongConstant( -123456789L);

    // Then...
    List<Long> values = valuesOf( domain, 10);
    assertThat( "Constant values size", values.size(), is( 1));
    assertThat( "Constant value", domain.select( getResolverContext()), matches( dataValueMatcher( -123456789L, Type.INTEGER, "int64")));
    }

  @Test
  public void whenNotMultipleOfs()
    {
    // Given...
    LongDomain domain = new LongDomain();

    // When...
    domain.setRange( Range.of( VarBindingBuilder.with( "Long").value( "< -999999999").build()));
    domain.setNotMultipleOfs( Stream.of( 5L, 2L).collect( toSet()));

    // Then...
    verifyContainsValues( domain, 1000);
    assertThat( "Contains", domain.contains( -1000000007L), is( true));
    assertThat( "Contains", domain.contains( -999999999L), is( false));
    assertThat( "Contains", domain.contains( -1000000000L), is( false));
    }

  @Test
  public void whenMultipleOf()
    {
    // Given...
    LongDomain domain = new LongDomain();

    // When...
    domain.setRange( Range.of( VarBindingBuilder.with( "Long").value( "> 999999999").build()));
    domain.setMultipleOf( 1000L);

    // Then...
    verifyContainsValues( domain, 1000);
    assertThat( "Contains", domain.contains( 1000000000L), is( true));
    assertThat( "Contains", domain.contains( 1000000999L), is( false));
    assertThat( "Contains", domain.contains( 999999000L), is( false));
    }

  @Test
  public void whenExcluded()
    {
    // Given...
    LongDomain domain = new LongDomain();

    // When...
    domain.setRange(
      Range.of(
        VarBindingBuilder.with( "Long")
        .value( "Other")
        .has( "excluded", 2L, 3L, 5L, 8L, 13L, 21L).build()));

    // Then...
    verifyContainsValues( domain, 1000);
    assertThat( "Contains", domain.contains( -2345L), is( true));
    assertThat( "Contains", domain.contains( 21L), is( false));
    assertThat( "Contains", domain.contains( 4L), is( true));
    }
  }


text:
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

Newsletter

        <form>

            <input type="email" class="form-control" id="newsletterEmail" placeholder="input your email">

            <button class="btn btn-lg btn-primary pull-right" type="submit" id="submit-button">Sign Up!</button>

        </form>

Donate

If you like what we are doing and would like to support our cause, please donate.

      <button class="btn btn-lg btn-primary">Donate</button>

About

        The Mission

        The Team

        FAQ

        Press

        Developers

        Jobs

        Privacy Policy

        Terms of Use

        Contact

Follow

         Facebook

         Twitter

         Meetup

         LinkedIn

         SnapChat

         Instagram

Yakkee © 2017 by Yakkee, LLC. All Rights Reserved


text:
/*	$NetBSD: if_il.h,v 1.1 2001/05/06 15:30:47 ragge Exp $	*/
/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)if_il.h	7.3 (Berkeley) 6/28/90
 */

/*
 * Structure of an Ethernet header -- receive format
 */
struct	il_rheader {
	u_char	ilr_status;		/* Frame Status */
	u_char	ilr_fill1;
	u_short	ilr_length;		/* Frame Length */
	u_char	ilr_dhost[6];		/* Destination Host */
	u_char	ilr_shost[6];		/* Source Host */
	u_short	ilr_type;		/* Type of packet */
};

/*
 * Structure of statistics record
 */
struct	il_stats {
	u_short	ils_fill1;
	u_short	ils_length;		/* Length (should be 62) */
	u_char	ils_addr[6];		/* Ethernet Address */
	u_short	ils_frames;		/* Number of Frames Received */
	u_short	ils_rfifo;		/* Number of Frames in Receive FIFO */
	u_short	ils_xmit;		/* Number of Frames Transmitted */
	u_short	ils_xcollis;		/* Number of Excess Collisions */
	u_short	ils_frag;		/* Number of Fragments Received */
	u_short	ils_lost;		/* Number of Times Frames Lost */
	u_short	ils_multi;		/* Number of Multicasts Accepted */
	u_short	ils_rmulti;		/* Number of Multicasts Rejected */
	u_short	ils_crc;		/* Number of CRC Errors */
	u_short	ils_align;		/* Number of Alignment Errors */
	u_short	ils_collis;		/* Number of Collisions */
	u_short	ils_owcollis;		/* Number of Out-of-window Collisions */
	u_short	ils_fill2[8];
	char	ils_module[8];		/* Module ID */
	char	ils_firmware[8];	/* Firmware ID */
};

/*
 * Structure of Collision Delay Time Record
 */
struct	il_collis {
	u_short	ilc_fill1;
	u_short	ilc_length;		/* Length (should be 0-32) */
	u_short	ilc_delay[16];		/* Delay Times */
};


text:
/*
 * Dawn Engine
 * Written by David Avedissian (c) 2012-2019 (git@dga.dev)
 */
#pragma once

// Mark this header as a system header
#if defined(DW_GCC) || defined(DW_CLANG)
#pragma GCC system_header
#elif defined(DW_MSVC)
#pragma warning(push, 0)
#endif

#include <btBulletDynamicsCommon.h>

// Re-enable warnings
#if defined(DW_MSVC)
#pragma warning(pop)
#endif


text:
package com.navercorp.pinpoint.web.dao;

import java.util.List;

import com.navercorp.pinpoint.web.vo.User;

/**
 * @author minwoo.jung
 */
public interface UserDao {

    void dropAndCreateUserTable();

    void insertUser(User user);

    void insertUserList(List<User> users);

    void deleteUser(String userId);

    List<User> selectUser();

    List<User> selectUserByDepartment(String department);

    User selectUserByUserId(String userId);

    List<User> selectUserByUserName(String userName);

    List<User> searchUser(String condition);

    List<User> selectUserByUserGroupId(String userGroupId);

    void updateUser(User user);

    boolean isExistUserId(String userId);
}


text:
|stub-icon| Browsing, opening, and saving files from |Office iOS|
=================================================================


text:
package cmd

import (
	"errors"
	"strings"

	"github.com/achilleasa/polaris/asset/scene/reader"
	"github.com/achilleasa/polaris/asset/scene/writer"
	"github.com/urfave/cli"
)

// Compile scene to binary format.
func CompileScene(ctx *cli.Context) error {
	setupLogging(ctx)

	for idx := 0; idx < ctx.NArg(); idx++ {
		sceneFile := ctx.Args().Get(idx)
		if !strings.HasSuffix(sceneFile, ".obj") {
			logger.Warning("skipping unsupported file %s", sceneFile)
			continue
		}

		logger.Noticef("parsing and compiling scene: %s", sceneFile)
		sc, err := reader.ReadScene(sceneFile)
		if err != nil {
			return err
		}

		// Display compiled scene info
		logger.Noticef("scene information:\n%s", sc.Stats())

		zipFile := strings.Replace(sceneFile, ".obj", ".zip", -1)
		err = writer.WriteScene(sc, zipFile)
		if err != nil {
			return err
		}
	}

	return nil
}

// Display compiled scene info.
func ShowSceneInfo(ctx *cli.Context) error {
	setupLogging(ctx)

	if ctx.NArg() != 1 {
		return errors.New("missing compiled scene zip file")
	}

	sceneFile := ctx.Args().First()
	if !strings.HasSuffix(sceneFile, ".zip") {
		return errors.New("only compiled scene files with a .zip extension are supported")
	}

	sc, err := reader.ReadScene(sceneFile)
	if err != nil {
		return err
	}

	// Display compiled scene info
	logger.Noticef("scene information:\n%s", sc.Stats())

	return nil
}


text:
'use strict';

/* Services */

var gamedbServices = angular.module('gamedbServices', ['ngResource']);

gamedbServices.factory('Game', ['$resource',
  function($resource){
    //return $resource('http://localhost:8080/gamedbapi/game/:gameId', {}, {
    var res= $resource('http://huangyaoshi.me:8080/gamedbapi/game/:gameId', {}, {
      // query: {method:'GET', params:{gameId:'games'}, isArray:true}
    });
    return res;
  }]);

gamedbServices.factory('GameSearch', ['$resource',
  function($resource){
    //return $resource('http://localhost:8080/gamedbapi/search?v=:keyword&p=:platform&g=:genre', {}, {
    var res = $resource('http://huangyaoshi.me:8080/gamedbapi/search?v=:keyword&p=:platform&g=:genre', {}, {});
    return res;
  }]);

gamedbServices.factory('Homepage', ['$resource',
  function($resource){
    //return $resource('http://localhost:8080/gamedbapi/search?v=:keyword&p=:platform&g=:genre', {}, {
    var res = $resource('http://huangyaoshi.me:8080/gamedbapi/search?v=:keyword&p=:platform&g=:genre', {}, {});
    return res;
  }]);


text:
var recordName = 'test';

import { DeepstreamClient } from '../src/deepstream-client'
const client = new DeepstreamClient('ws://localhost:6020')

client.login({}, function () {
    const currentUserRecord = client.record.getRecord(recordName)
    currentUserRecord.whenReady(function (record) {
        var updateRecord = function() {
            currentUserRecord.set({ data: Math.random() }, err => {
                if (err) {
                    console.log('Record set with error:', err)
                } else {
                    console.log('Record set without error')
                }
            });
        }
        setInterval(updateRecord, 20);
    });
});


text:
"use strict";
const path = require("path");
const whatwgURL = require("whatwg-url");
const querystring = require("querystring");
const domSymbolTree = require("./living/helpers/internal-constants").domSymbolTree;
const SYMBOL_TREE_POSITION = require("symbol-tree").TreePosition;
const parseURLToResultingURLRecord = require("./living/helpers/document-base-url").parseURLToResultingURLRecord;

exports.toFileUrl = function (fileName) {
  // Beyond just the `path.resolve`, this is mostly for the benefit of Windows,
  // where we need to convert "\" to "/" and add an extra "/" prefix before the
  // drive letter.
  let pathname = path.resolve(process.cwd(), fileName).replace(/\\/g, "/");
  if (pathname[0] !== "/") {
    pathname = "/" + pathname;
  }

  // path might contain spaces, so convert those to %20
  return "file://" + encodeURI(pathname);
};

/**
 * Define a getter on an object
 *
 * This method replaces any existing getter but leaves setters in place.
 *
 * - `object` {Object} the object to define the getter on
 * - `property` {String} the name of the getter
 * - `getterFn` {Function} the getter
 */
exports.defineGetter = function defineGetter(object, property, getterFn) {
  const descriptor = Object.getOwnPropertyDescriptor(object, property) || {
    configurable: true,
    enumerable: true
  };

  descriptor.get = getterFn;

  Object.defineProperty(object, property, descriptor);
};

/**
 * Define a set of properties on an object, by copying the property descriptors
 * from the original object.
 *
 * - `object` {Object} the target object
 * - `properties` {Object} the source from which to copy property descriptors
 */
exports.define = function define(object, properties) {
  for (const name of Object.getOwnPropertyNames(properties)) {
    const propDesc = Object.getOwnPropertyDescriptor(properties, name);
    Object.defineProperty(object, name, propDesc);
  }
};

/**
 * Define a list of constants on a constructor and its .prototype
 *
 * - `Constructor` {Function} the constructor to define the constants on
 * - `propertyMap` {Object}  key/value map of properties to define
 */
exports.addConstants = function addConstants(Constructor, propertyMap) {
  for (const property in propertyMap) {
    const value = propertyMap[property];
    addConstant(Constructor, property, value);
    addConstant(Constructor.prototype, property, value);
  }
};

function addConstant(object, property, value) {
  Object.defineProperty(object, property, {
    configurable: false,
    enumerable: true,
    writable: false,
    value
  });
}

let memoizeQueryTypeCounter = 0;

/**
 * Returns a version of a method that memoizes specific types of calls on the object
 *
 * - `fn` {Function} the method to be memozied
 */
exports.memoizeQuery = function memoizeQuery(fn) {
  // Only memoize query functions with arity <= 2
  if (fn.length > 2) {
    return fn;
  }

  const type = memoizeQueryTypeCounter++;

  return function () {
    if (!this._memoizedQueries) {
      return fn.apply(this, arguments);
    }

    if (!this._memoizedQueries[type]) {
      this._memoizedQueries[type] = Object.create(null);
    }

    let key;
    if (arguments.length === 1 && typeof arguments[0] === "string") {
      key = arguments[0];
    } else if (arguments.length === 2 && typeof arguments[0] === "string" && typeof arguments[1] === "string") {
      key = arguments[0] + "::" + arguments[1];
    } else {
      return fn.apply(this, arguments);
    }

    if (!(key in this._memoizedQueries[type])) {
      this._memoizedQueries[type][key] = fn.apply(this, arguments);
    }
    return this._memoizedQueries[type][key];
  };
};

exports.reflectURLAttribute = (elementImpl, contentAttributeName) => {
  const attributeValue = elementImpl.getAttribute(contentAttributeName);
  if (attributeValue === null || attributeValue === "") {
    return "";
  }

  const urlRecord = parseURLToResultingURLRecord(attributeValue, elementImpl._ownerDocument);
  if (urlRecord === null) {
    return attributeValue;
  }
  return whatwgURL.serializeURL(urlRecord);
};

function isValidAbsoluteURL(str) {
  return whatwgURL.parseURL(str) !== null;
}

exports.isValidTargetOrigin = function (str) {
  return str === "*" || str === "/" || isValidAbsoluteURL(str);
};

exports.simultaneousIterators = function* (first, second) {
  for (;;) {
    const firstResult = first.next();
    const secondResult = second.next();

    if (firstResult.done && secondResult.done) {
      return;
    }

    yield [
      firstResult.done ? null : firstResult.value,
      secondResult.done ? null : secondResult.value
    ];
  }
};

exports.treeOrderSorter = function (a, b) {
  const compare = domSymbolTree.compareTreePosition(a, b);

  if (compare & SYMBOL_TREE_POSITION.PRECEDING) { // b is preceding a
    return 1;
  }

  if (compare & SYMBOL_TREE_POSITION.FOLLOWING) {
    return -1;
  }

  // disconnected or equal:
  return 0;
};

const base64Regexp = /^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=|[A-Z0-9+/]{4})$/i;

exports.parseDataUrl = function parseDataUrl(url) {
  const urlParts = url.match(/^data:(.+?)(?:;(base64))?,(.*)$/);
  let buffer;
  if (urlParts[2] === "base64") {
    if (urlParts[3] && !base64Regexp.test(urlParts[3])) {
      throw new Error("Not a base64 string");
    }
    buffer = new Buffer(urlParts[3], "base64");
  } else {
    buffer = new Buffer(querystring.unescape(urlParts[3]));
  }
  return { buffer, type: urlParts[1] };
};

/* eslint-disable global-require */

exports.Canvas = null;
["canvas", "canvas-prebuilt"].some(moduleName => {
  try {
    exports.Canvas = require(moduleName);
    if (typeof exports.Canvas !== "function") {
      // In browserify, the require will succeed but return an empty object
      exports.Canvas = null;
    }
  } catch (e) {
    exports.Canvas = null;
  }
  return exports.Canvas !== null;
});


text:
class DraftSkillsController < ApplicationController
  before_filter :authenticate_for_skills!
  expose(:draft_skill) { fetch_draft_skill }
  expose(:grouped_draft_skills_by_status) { grouped_draft_skills_by_status }
  expose(:skill) { draft_skill.skill }
  expose(:skill_categories) { SkillCategory.all }

  def show; end

  def index; end

  def edit
    authorize draft_skill, :allowed_to_modify?
  end

  def update
    authorize draft_skill, :allowed_to_modify?
    respond_to do |format|
      if DraftSkills::Update.new(draft_skill, draft_skill_params).call
        format.html { redirect_to draft_skill, notice: I18n.t('drafts.message.update.success') }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: draft_skill.errors, status: :unprocessable_entity }
      end
    end
  end

  private

  def draft_skill_params
    @draft_skill_params ||= begin
      params.require(:draft_skill).permit(:reviewer_explanation, :draft_status).merge(
        'reviewer_id' => current_user.id
      )
    end
  end

  def fetch_draft_skill
    DraftSkillDecorator.new(DraftSkill.find(params[:id]))
  end

  def grouped_draft_skills_by_status
    DraftSkillDecorator.decorate_collection(
      DraftSkill.not_accepted_or_since_last_30_days.includes(
        :requester, :reviewer, :skill_category
      )
    ).group_by(&:draft_status)
  end
end


text:
#import <Foundation/Foundation.h>

@protocol BTAppSwitchHandler;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - BTAppSwitch

/**
 @class BTAppSwitch
 @brief Handles return URLs when returning from app switch and routes the return URL to the correct app switch handler class.
 @discussion `returnURLScheme` must contain your app's registered URL Type that starts with the app's bundle
 ID. When your app returns from app switch, the app delegate should call `handleOpenURL:sourceApplication:`
*/
@interface BTAppSwitch : NSObject

/**
 @brief The URL scheme to return to this app after switching to another app.

 @discussion This URL scheme must be registered as a URL Type in the app's info.plist, and it must start with the app's bundle ID.
*/
@property (nonatomic, copy) NSString *returnURLScheme;

/**
 @brief The singleton instance
*/
+ (instancetype)sharedInstance;

/**
 @brief Sets the return URL scheme for your app.

 @discussion This must be configured if your app integrates a payment option that may switch to either
 Mobile Safari or to another app to finish the payment authorization workflow.

 @param returnURLScheme The return URL scheme
*/
+ (void)setReturnURLScheme:(NSString *)returnURLScheme;

/**
 @brief Handles a return from app switch

 @param url The URL that was opened to return to your app
 @param sourceApplication The source app that requested the launch of your app
 @return `YES` if the app switch successfully handled the URL, or `NO` if the attempt to handle the URL failed.
*/
+ (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication;

/**
 @brief Handles a return from app switch

 @param url The URL that was opened to return to your app
 @param options The options dictionary provided by `application:openURL:options:`
 @return `YES` if the app switch successfully handled the URL, or `NO` if the attempt to handle the URL failed.
*/
+ (BOOL)handleOpenURL:(NSURL *)url options:(NSDictionary *)options;

/**
 @brief Registers a class that knows how to handle a return from app switch
*/
- (void)registerAppSwitchHandler:(Class<BTAppSwitchHandler>)handler;

/**
 @brief Unregisters a class that knows how to handle a return from app switch
*/
- (void)unregisterAppSwitchHandler:(Class<BTAppSwitchHandler>)handler;

- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication;

@end

#pragma mark - BTAppSwitchDelegate

extern NSString * const BTAppSwitchWillSwitchNotification;
extern NSString * const BTAppSwitchDidSwitchNotification;
extern NSString * const BTAppSwitchWillProcessPaymentInfoNotification;
extern NSString * const BTAppSwitchNotificationTargetKey;

/**
 @brief Specifies the destination of an app switch
*/
typedef NS_ENUM(NSInteger, BTAppSwitchTarget) {
    BTAppSwitchTargetUnknown = 0,
    /// Native app
    BTAppSwitchTargetNativeApp,
    /// Browser (i.e. Mobile Safari)
    BTAppSwitchTargetWebBrowser,
};

/**
 @brief Protocol for receiving payment lifecycle messages from a payment option that may initiate an app or browser switch event to authorize payments.
*/
@protocol BTAppSwitchDelegate <NSObject>

/**
 @brief The app switcher will perform an app switch in order to obtain user payment authorization.

 @discussion Your implementation of this method may set your app to the state
 it should be in if the user manually app-switches back to your app.
 For example, re-enable any controls that are disabled.

 @param appSwitcher The app switcher
*/
- (void)appSwitcherWillPerformAppSwitch:(id)appSwitcher;

/**
 @brief Delegates receive this message when the app switcher has successfully performed an app switch.

 @discussion You may use this hook to prepare your UI for app switch return. Keep in mind that
 users may manually switch back to your app via the iOS task manager.

 @note You may also hook into the app switch lifecycle via UIApplicationWillResignActiveNotification.

 @param appSwitcher The app switcher instance performing user authentication
 @param target The destination that was actually used for this app switch
*/
- (void)appSwitcher:(id)appSwitcher didPerformSwitchToTarget:(BTAppSwitchTarget)target;

/**
 @brief The app switcher has obtained user payment details and/or user authorization and will process the results.

 @discussion This typically indicates asynchronous network activity.
 When you receive this message, your UI should indicate activity.

 In the case of an app switch, this message indicates that the user has returned to this app;
 this is usually after handleAppSwitchReturnURL: is called in your UIApplicationDelegate.

 @note You may also hook into the app switch lifecycle via UIApplicationWillResignActiveNotification.

 @param appSwitcher The app switcher
*/
- (void)appSwitcherWillProcessPaymentInfo:(id)appSwitcher;

@end

#pragma mark - BTAppSwitchHandler protocol

/**
 @protocol BTAppSwitchHandler
 @brief A protocol for handling the return from switching out of an app to gather payment information.
 @note The app may switch out to Mobile Safari or to a native app.
*/
@protocol BTAppSwitchHandler

@required

/**
 @brief Determine whether the app switch return URL can be handled.

 @param url the URL you receive in `application:openURL:sourceApplication:annotation` when returning to your app
 @param sourceApplication The source application you receive in `application:openURL:sourceApplication:annotation`
 @return `YES` when the object can handle returning from the application with a URL
*/
+ (BOOL)canHandleAppSwitchReturnURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication;

/**
 @brief Pass control back to `BTPayPalDriver` after returning from app or browser switch.

 @param url The URL you receive in `application:openURL:sourceApplication:annotation`
*/
+ (void)handleAppSwitchReturnURL:(NSURL *)url;

@optional

/**
 @brief Indicates whether an iOS app is installed and available for app switch.
*/
- (BOOL)isiOSAppAvailableForAppSwitch;

@end

NS_ASSUME_NONNULL_END


text:
package io.proleap.cobol.asg.metamodel.data.communication.impl;

import io.proleap.cobol.CobolParser.SymbolicSubQueueClauseContext;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.call.Call;
import io.proleap.cobol.asg.metamodel.data.communication.SymbolicSubQueueClause;
import io.proleap.cobol.asg.metamodel.impl.CobolDivisionElementImpl;

public class SymbolicSubQueueClauseImpl extends CobolDivisionElementImpl implements SymbolicSubQueueClause {

	protected SymbolicSubQueueClauseContext ctx;

	protected Call dataDescCall;

	protected SymbolicSubQueueClauseType symbolicSubQueueClauseType;

	public SymbolicSubQueueClauseImpl(final ProgramUnit programUnit, final SymbolicSubQueueClauseContext ctx) {
		super(programUnit, ctx);

		this.ctx = ctx;
	}

	@Override
	public Call getDataDescCall() {
		return dataDescCall;
	}

	@Override
	public SymbolicSubQueueClauseType getSymbolicSubQueueClauseType() {
		return symbolicSubQueueClauseType;
	}

	@Override
	public void setDataDescCall(final Call dataDescCall) {
		this.dataDescCall = dataDescCall;
	}

	@Override
	public void setSymbolicSubQueueClauseType(final SymbolicSubQueueClauseType symbolicSubQueueClauseType) {
		this.symbolicSubQueueClauseType = symbolicSubQueueClauseType;
	}

}


text:
package uk.joshiejack.settlements.entity.ai.action.tasks;

import uk.joshiejack.settlements.AdventureDataLoader;
import uk.joshiejack.settlements.building.Building;
import uk.joshiejack.settlements.entity.EntityNPC;
import uk.joshiejack.settlements.entity.ai.action.ActionPhysical;
import uk.joshiejack.settlements.network.town.land.PacketRemoveBuilding;
import uk.joshiejack.settlements.world.town.Town;
import uk.joshiejack.settlements.world.town.land.TownBuilding;
import uk.joshiejack.penguinlib.network.PenguinNetwork;
import uk.joshiejack.penguinlib.template.Placeable;
import uk.joshiejack.penguinlib.template.blocks.PlaceableBlock;
import uk.joshiejack.penguinlib.template.entities.PlaceableEntity;
import uk.joshiejack.penguinlib.util.PenguinLoader;
import uk.joshiejack.penguinlib.util.helpers.minecraft.BlockPosHelper;
import uk.joshiejack.penguinlib.util.helpers.minecraft.EntityHelper;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;

import java.util.List;

@PenguinLoader("destroy")
public class ActionDestroy extends ActionPhysical {
    private TownBuilding location;
    private Placeable.ConstructionStage stage;
    private int index;
    private int timeout;
    private boolean setAnimation;
    private boolean ySet;
    private int y;

    public ActionDestroy() { this.setMemorable(); }
    public ActionDestroy(TownBuilding location) {
        this.location = location;
        this.stage = Placeable.ConstructionStage.FINISHED;
        this.index = location.getBuilding().getTemplate().getComponents().length - 1;
        this.setMemorable();
    }

    private int getYTarget(EntityNPC npc) {
        if (!ySet) {
            y = npc.getEntityWorld().getTopSolidOrLiquidBlock(location.getPosition()).getY();
            ySet = true;
        } else if (timeout == 2500) ySet = false;

        return y;
    }

    @Override
    public EnumActionResult execute(EntityNPC npc) {
        if (location == null) return EnumActionResult.FAIL;
        //Set the animation for the builder
        if (!setAnimation) {
            setAnimation = true;
            npc.setAnimation("build");
        }

            if (npc.getHeldItemMainhand().getItem() != Item.getItemFromBlock(Blocks.TNT)) {
                npc.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(Blocks.TNT));
            }

            //Swing the hammer and look at the building
            npc.swingArm(EnumHand.MAIN_HAND);
            int explosions = 0;
            while (true) {
                Placeable current = location.getBuilding().getTemplate().getComponents()[index];
                timeout++; //Timeout limit
                int yTarget = getYTarget(npc);
                //if (timeout >= 5000) {
                    npc.setPositionAndUpdate(location.getPosition().getX() + 0.5, yTarget, location.getPosition().getZ() + 0.5);
                    timeout = 0;
               // }

                if (npc.getDistance(location.getPosition().getX() + 0.5, yTarget, location.getPosition().getZ() + 0.5) < 1 || timeout >= 10000) {
                   // boolean placed = current.place(npc.world, location.getPosition(), location.getRotation(), stage, true);
                    BlockPos lookTarget = BlockPosHelper.getTransformedPosition(current.getOffsetPos(), location.getPosition(), location.getRotation());
                    IBlockState lookState = npc.world.getBlockState(lookTarget);
                    if (current instanceof PlaceableBlock) {
                        npc.world.setBlockToAir(lookTarget); //DESTROYYYYYYYYYYYYYYYYYYY
                    } else if (current instanceof PlaceableEntity) {
                        List<Entity> entity = EntityHelper.getEntities(((PlaceableEntity)current).getEntityClass(), npc.world, lookTarget, 1F, 1F);
                        entity.forEach(Entity::setDead); //Kill all them bitches if they are in place

                    }

                    if (explosions < 24 && npc.world.rand.nextInt(16) == 0) {
                        npc.world.createExplosion(null, lookTarget.getX(), lookTarget.getY(), lookTarget.getZ(), 0F, false);
                        explosions++;
                    }

                    npc.getLookHelper().setLookPosition(lookTarget.getX(), lookTarget.getY(), lookTarget.getZ(), (float)npc.getHorizontalFaceSpeed(), (float)npc.getVerticalFaceSpeed());
                    index--;
                    timeout = 0;

                    if (index == -1) {
                        index = location.getBuilding().getTemplate().getComponents().length - 1; //Reset this
                        stage = stage.previous();
                        if (stage == Placeable.ConstructionStage.FINISHED) {
                            Town<?> town = AdventureDataLoader.get(npc.world).getTownByID(npc.world.provider.getDimension(), npc.getTown());
                            town.getLandRegistry().removeBuilding(npc.world, location);
                            PenguinNetwork.sendToEveryone(new PacketRemoveBuilding(npc.world.provider.getDimension(), town.getID(), location));
                            return EnumActionResult.SUCCESS;
                        }
                    }
                }
            }
        //}

        //return EnumActionResult.PASS;
    }

    @Override
    public NBTTagCompound serializeNBT() {
        NBTTagCompound tag = new NBTTagCompound();
        if (location != null) {
            tag.setString("Building", location.getBuilding().getRegistryName().toString());
            tag.setLong("Pos", location.getPosition().toLong());
            tag.setByte("Rotation", (byte) location.getRotation().ordinal());
            tag.setBoolean("Built", location.isBuilt());
            tag.setByte("Stage", (byte) stage.ordinal());
            tag.setInteger("Index", index);
        }

        return tag;
    }

    @Override
    public void deserializeNBT(NBTTagCompound nbt) {
        Building building = Building.REGISTRY.get(new ResourceLocation(nbt.getString("Building")));
        BlockPos pos = BlockPos.fromLong(nbt.getLong("Pos"));
        Rotation rotation = Rotation.values()[nbt.getByte("Rotation")];
        TownBuilding townBuilding = new TownBuilding(building, pos, rotation);
        if (nbt.getBoolean("Built")) townBuilding.setBuilt();
        stage = Placeable.ConstructionStage.values()[nbt.getByte("Stage")];
        index = nbt.getInteger("Index");
    }
}


text:
import $ from '../../utils/dom';
import Utils from '../../utils/utils';
import Device from '../../utils/device';
import Support from '../../utils/support';

const Zoom = {
  // Calc Scale From Multi-touches
  getDistanceBetweenTouches(e) {
    if (e.targetTouches.length < 2) return 1;
    const x1 = e.targetTouches[0].pageX;
    const y1 = e.targetTouches[0].pageY;
    const x2 = e.targetTouches[1].pageX;
    const y2 = e.targetTouches[1].pageY;
    const distance = Math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2));
    return distance;
  },
  // Events
  onGestureStart(e) {
    const swiper = this;
    const params = swiper.params.zoom;
    const zoom = swiper.zoom;
    const { gesture } = zoom;
    zoom.fakeGestureTouched = false;
    zoom.fakeGestureMoved = false;
    if (!Support.gestures) {
      if (e.type !== 'touchstart' || (e.type === 'touchstart' && e.targetTouches.length < 2)) {
        return;
      }
      zoom.fakeGestureTouched = true;
      gesture.scaleStart = Zoom.getDistanceBetweenTouches(e);
    }
    if (!gesture.$slideEl || !gesture.$slideEl.length) {
      gesture.$slideEl = $(e.target).closest('.swiper-slide');
      if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
      gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
      gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
      gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
      if (gesture.$imageWrapEl.length === 0) {
        gesture.$imageEl = undefined;
        return;
      }
    }
    gesture.$imageEl.transition(0);
    swiper.zoom.isScaling = true;
  },
  onGestureChange(e) {
    const swiper = this;
    const params = swiper.params.zoom;
    const zoom = swiper.zoom;
    const { gesture } = zoom;
    if (!Support.gestures) {
      if (e.type !== 'touchmove' || (e.type === 'touchmove' && e.targetTouches.length < 2)) {
        return;
      }
      zoom.fakeGestureMoved = true;
      gesture.scaleMove = Zoom.getDistanceBetweenTouches(e);
    }
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
    if (Support.gestures) {
      zoom.scale = e.scale * zoom.currentScale;
    } else {
      zoom.scale = (gesture.scaleMove / gesture.scaleStart) * zoom.currentScale;
    }
    if (zoom.scale > gesture.maxRatio) {
      zoom.scale = (gesture.maxRatio - 1) + (((zoom.scale - gesture.maxRatio) + 1) ** 0.5);
    }
    if (zoom.scale < params.minRatio) {
      zoom.scale = (params.minRatio + 1) - (((params.minRatio - zoom.scale) + 1) ** 0.5);
    }
    gesture.$imageEl.transform(`translate3d(0,0,0) scale(${zoom.scale})`);
  },
  onGestureEnd(e) {
    const swiper = this;
    const params = swiper.params.zoom;
    const zoom = swiper.zoom;
    const { gesture } = zoom;
    if (!Support.gestures) {
      if (!zoom.fakeGestureTouched || !zoom.fakeGestureMoved) {
        return;
      }
      if (e.type !== 'touchend' || (e.type === 'touchend' && e.changedTouches.length < 2 && !Device.android)) {
        return;
      }
      zoom.fakeGestureTouched = false;
      zoom.fakeGestureMoved = false;
    }
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
    zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
    gesture.$imageEl.transition(swiper.params.speed).transform(`translate3d(0,0,0) scale(${zoom.scale})`);
    zoom.currentScale = zoom.scale;
    zoom.isScaling = false;
    if (zoom.scale === 1) gesture.$slideEl = undefined;
  },
  onTouchStart(e) {
    const swiper = this;
    const zoom = swiper.zoom;
    const { gesture, image } = zoom;
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
    if (image.isTouched) return;
    if (Device.android) e.preventDefault();
    image.isTouched = true;
    image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
    image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
  },
  onTouchMove(e) {
    const swiper = this;
    const zoom = swiper.zoom;
    const { gesture, image, velocity } = zoom;
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
    swiper.allowClick = false;
    if (!image.isTouched || !gesture.$slideEl) return;

    if (!image.isMoved) {
      image.width = gesture.$imageEl[0].offsetWidth;
      image.height = gesture.$imageEl[0].offsetHeight;
      image.startX = Utils.getTranslate(gesture.$imageWrapEl[0], 'x') || 0;
      image.startY = Utils.getTranslate(gesture.$imageWrapEl[0], 'y') || 0;
      gesture.slideWidth = gesture.$slideEl[0].offsetWidth;
      gesture.slideHeight = gesture.$slideEl[0].offsetHeight;
      gesture.$imageWrapEl.transition(0);
      if (swiper.rtl) {
        image.startX = -image.startX;
        image.startY = -image.startY;
      }
    }
    // Define if we need image drag
    const scaledWidth = image.width * zoom.scale;
    const scaledHeight = image.height * zoom.scale;

    if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return;

    image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
    image.maxX = -image.minX;
    image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
    image.maxY = -image.minY;

    image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
    image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;

    if (!image.isMoved && !zoom.isScaling) {
      if (
        swiper.isHorizontal()
        && (
          (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x)
          || (Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)
        )
      ) {
        image.isTouched = false;
        return;
      } if (
        !swiper.isHorizontal()
        && (
          (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y)
          || (Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)
        )
      ) {
        image.isTouched = false;
        return;
      }
    }
    e.preventDefault();
    e.stopPropagation();

    image.isMoved = true;
    image.currentX = (image.touchesCurrent.x - image.touchesStart.x) + image.startX;
    image.currentY = (image.touchesCurrent.y - image.touchesStart.y) + image.startY;

    if (image.currentX < image.minX) {
      image.currentX = (image.minX + 1) - (((image.minX - image.currentX) + 1) ** 0.8);
    }
    if (image.currentX > image.maxX) {
      image.currentX = (image.maxX - 1) + (((image.currentX - image.maxX) + 1) ** 0.8);
    }

    if (image.currentY < image.minY) {
      image.currentY = (image.minY + 1) - (((image.minY - image.currentY) + 1) ** 0.8);
    }
    if (image.currentY > image.maxY) {
      image.currentY = (image.maxY - 1) + (((image.currentY - image.maxY) + 1) ** 0.8);
    }

    // Velocity
    if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x;
    if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y;
    if (!velocity.prevTime) velocity.prevTime = Date.now();
    velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
    velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
    if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0;
    if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0;
    velocity.prevPositionX = image.touchesCurrent.x;
    velocity.prevPositionY = image.touchesCurrent.y;
    velocity.prevTime = Date.now();

    gesture.$imageWrapEl.transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`);
  },
  onTouchEnd() {
    const swiper = this;
    const zoom = swiper.zoom;
    const { gesture, image, velocity } = zoom;
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
    if (!image.isTouched || !image.isMoved) {
      image.isTouched = false;
      image.isMoved = false;
      return;
    }
    image.isTouched = false;
    image.isMoved = false;
    let momentumDurationX = 300;
    let momentumDurationY = 300;
    const momentumDistanceX = velocity.x * momentumDurationX;
    const newPositionX = image.currentX + momentumDistanceX;
    const momentumDistanceY = velocity.y * momentumDurationY;
    const newPositionY = image.currentY + momentumDistanceY;

    // Fix duration
    if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);
    if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);
    const momentumDuration = Math.max(momentumDurationX, momentumDurationY);

    image.currentX = newPositionX;
    image.currentY = newPositionY;

    // Define if we need image drag
    const scaledWidth = image.width * zoom.scale;
    const scaledHeight = image.height * zoom.scale;
    image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
    image.maxX = -image.minX;
    image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
    image.maxY = -image.minY;
    image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
    image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);

    gesture.$imageWrapEl.transition(momentumDuration).transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`);
  },
  onTransitionEnd() {
    const swiper = this;
    const zoom = swiper.zoom;
    const { gesture } = zoom;
    if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) {
      gesture.$imageEl.transform('translate3d(0,0,0) scale(1)');
      gesture.$imageWrapEl.transform('translate3d(0,0,0)');

      zoom.scale = 1;
      zoom.currentScale = 1;

      gesture.$slideEl = undefined;
      gesture.$imageEl = undefined;
      gesture.$imageWrapEl = undefined;
    }
  },
  // Toggle Zoom
  toggle(e) {
    const swiper = this;
    const zoom = swiper.zoom;

    if (zoom.scale && zoom.scale !== 1) {
      // Zoom Out
      zoom.out();
    } else {
      // Zoom In
      zoom.in(e);
    }
  },
  in(e) {
    const swiper = this;

    const zoom = swiper.zoom;
    const params = swiper.params.zoom;
    const { gesture, image } = zoom;

    if (!gesture.$slideEl) {
      gesture.$slideEl = swiper.clickedSlide ? $(swiper.clickedSlide) : swiper.slides.eq(swiper.activeIndex);
      gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
      gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
    }
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;

    gesture.$slideEl.addClass(`${params.zoomedSlideClass}`);

    let touchX;
    let touchY;
    let offsetX;
    let offsetY;
    let diffX;
    let diffY;
    let translateX;
    let translateY;
    let imageWidth;
    let imageHeight;
    let scaledWidth;
    let scaledHeight;
    let translateMinX;
    let translateMinY;
    let translateMaxX;
    let translateMaxY;
    let slideWidth;
    let slideHeight;

    if (typeof image.touchesStart.x === 'undefined' && e) {
      touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
      touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
    } else {
      touchX = image.touchesStart.x;
      touchY = image.touchesStart.y;
    }

    zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
    zoom.currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
    if (e) {
      slideWidth = gesture.$slideEl[0].offsetWidth;
      slideHeight = gesture.$slideEl[0].offsetHeight;
      offsetX = gesture.$slideEl.offset().left;
      offsetY = gesture.$slideEl.offset().top;
      diffX = (offsetX + (slideWidth / 2)) - touchX;
      diffY = (offsetY + (slideHeight / 2)) - touchY;

      imageWidth = gesture.$imageEl[0].offsetWidth;
      imageHeight = gesture.$imageEl[0].offsetHeight;
      scaledWidth = imageWidth * zoom.scale;
      scaledHeight = imageHeight * zoom.scale;

      translateMinX = Math.min(((slideWidth / 2) - (scaledWidth / 2)), 0);
      translateMinY = Math.min(((slideHeight / 2) - (scaledHeight / 2)), 0);
      translateMaxX = -translateMinX;
      translateMaxY = -translateMinY;

      translateX = diffX * zoom.scale;
      translateY = diffY * zoom.scale;

      if (translateX < translateMinX) {
        translateX = translateMinX;
      }
      if (translateX > translateMaxX) {
        translateX = translateMaxX;
      }

      if (translateY < translateMinY) {
        translateY = translateMinY;
      }
      if (translateY > translateMaxY) {
        translateY = translateMaxY;
      }
    } else {
      translateX = 0;
      translateY = 0;
    }
    gesture.$imageWrapEl.transition(300).transform(`translate3d(${translateX}px, ${translateY}px,0)`);
    gesture.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${zoom.scale})`);
  },
  out() {
    const swiper = this;

    const zoom = swiper.zoom;
    const params = swiper.params.zoom;
    const { gesture } = zoom;

    if (!gesture.$slideEl) {
      gesture.$slideEl = swiper.clickedSlide ? $(swiper.clickedSlide) : swiper.slides.eq(swiper.activeIndex);
      gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
      gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
    }
    if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;

    zoom.scale = 1;
    zoom.currentScale = 1;
    gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)');
    gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)');
    gesture.$slideEl.removeClass(`${params.zoomedSlideClass}`);
    gesture.$slideEl = undefined;
  },
  // Attach/Detach Events
  enable() {
    const swiper = this;
    const zoom = swiper.zoom;
    if (zoom.enabled) return;
    zoom.enabled = true;

    const passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;

    // Scale image
    if (Support.gestures) {
      swiper.$wrapperEl.on('gesturestart', '.swiper-slide', zoom.onGestureStart, passiveListener);
      swiper.$wrapperEl.on('gesturechange', '.swiper-slide', zoom.onGestureChange, passiveListener);
      swiper.$wrapperEl.on('gestureend', '.swiper-slide', zoom.onGestureEnd, passiveListener);
    } else if (swiper.touchEvents.start === 'touchstart') {
      swiper.$wrapperEl.on(swiper.touchEvents.start, '.swiper-slide', zoom.onGestureStart, passiveListener);
      swiper.$wrapperEl.on(swiper.touchEvents.move, '.swiper-slide', zoom.onGestureChange, passiveListener);
      swiper.$wrapperEl.on(swiper.touchEvents.end, '.swiper-slide', zoom.onGestureEnd, passiveListener);
    }

    // Move image
    swiper.$wrapperEl.on(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, zoom.onTouchMove);
  },
  disable() {
    const swiper = this;
    const zoom = swiper.zoom;
    if (!zoom.enabled) return;

    swiper.zoom.enabled = false;

    const passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;

    // Scale image
    if (Support.gestures) {
      swiper.$wrapperEl.off('gesturestart', '.swiper-slide', zoom.onGestureStart, passiveListener);
      swiper.$wrapperEl.off('gesturechange', '.swiper-slide', zoom.onGestureChange, passiveListener);
      swiper.$wrapperEl.off('gestureend', '.swiper-slide', zoom.onGestureEnd, passiveListener);
    } else if (swiper.touchEvents.start === 'touchstart') {
      swiper.$wrapperEl.off(swiper.touchEvents.start, '.swiper-slide', zoom.onGestureStart, passiveListener);
      swiper.$wrapperEl.off(swiper.touchEvents.move, '.swiper-slide', zoom.onGestureChange, passiveListener);
      swiper.$wrapperEl.off(swiper.touchEvents.end, '.swiper-slide', zoom.onGestureEnd, passiveListener);
    }

    // Move image
    swiper.$wrapperEl.off(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, zoom.onTouchMove);
  },
};

export default {
  name: 'zoom',
  params: {
    zoom: {
      enabled: false,
      maxRatio: 3,
      minRatio: 1,
      toggle: true,
      containerClass: 'swiper-zoom-container',
      zoomedSlideClass: 'swiper-slide-zoomed',
    },
  },
  create() {
    const swiper = this;
    const zoom = {
      enabled: false,
      scale: 1,
      currentScale: 1,
      isScaling: false,
      gesture: {
        $slideEl: undefined,
        slideWidth: undefined,
        slideHeight: undefined,
        $imageEl: undefined,
        $imageWrapEl: undefined,
        maxRatio: 3,
      },
      image: {
        isTouched: undefined,
        isMoved: undefined,
        currentX: undefined,
        currentY: undefined,
        minX: undefined,
        minY: undefined,
        maxX: undefined,
        maxY: undefined,
        width: undefined,
        height: undefined,
        startX: undefined,
        startY: undefined,
        touchesStart: {},
        touchesCurrent: {},
      },
      velocity: {
        x: undefined,
        y: undefined,
        prevPositionX: undefined,
        prevPositionY: undefined,
        prevTime: undefined,
      },
    };

    ('onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out').split(' ').forEach((methodName) => {
      zoom[methodName] = Zoom[methodName].bind(swiper);
    });
    Utils.extend(swiper, {
      zoom,
    });

    let scale = 1;
    Object.defineProperty(swiper.zoom, 'scale', {
      get() {
        return scale;
      },
      set(value) {
        if (scale !== value) {
          const imageEl = swiper.zoom.gesture.$imageEl ? swiper.zoom.gesture.$imageEl[0] : undefined;
          const slideEl = swiper.zoom.gesture.$slideEl ? swiper.zoom.gesture.$slideEl[0] : undefined;
          swiper.emit('zoomChange', value, imageEl, slideEl);
        }
        scale = value;
      },
    });
  },
  on: {
    init() {
      const swiper = this;
      if (swiper.params.zoom.enabled) {
        swiper.zoom.enable();
      }
    },
    destroy() {
      const swiper = this;
      swiper.zoom.disable();
    },
    touchStart(e) {
      const swiper = this;
      if (!swiper.zoom.enabled) return;
      swiper.zoom.onTouchStart(e);
    },
    touchEnd(e) {
      const swiper = this;
      if (!swiper.zoom.enabled) return;
      swiper.zoom.onTouchEnd(e);
    },
    doubleTap(e) {
      const swiper = this;
      if (swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
        swiper.zoom.toggle(e);
      }
    },
    transitionEnd() {
      const swiper = this;
      if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
        swiper.zoom.onTransitionEnd();
      }
    },
  },
};


text:
package com.example.asus.paishow.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;

import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.example.asus.paishow.R;

import com.example.asus.paishow.SearchActivity;
import com.example.asus.paishow.listview.FoldingCellListAdapter;
import com.example.asus.paishow.listview.UserInfoBean;

import com.example.asus.paishow.ramotion.foldingcell.FoldingCell;
import com.google.gson.Gson;

import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.util.ArrayList;

/**
 * Created by asus on 2016/10/9.
 */
public class SearchFragment extends BaseFragment {

    private int imageIds[];
    private ArrayList<ImageView> images;
    private ArrayList<View> dots;
    private ViewPager mViewPager;
    private ViewPagerAdapter adapter;
    private int oldPosition =0;//记录上一次点的位置
   private boolean flag=false;
    Button btn_daren ;
    Button btn_renqi ;
    Button btn_shenglv ;

//    final  ArrayList<ListDaRenBean.DaRenPaiHang> daRenList=new ArrayList<ListDaRenBean.DaRenPaiHang>();
//    final  ArrayList<ListRenQiBean.RenQiPaiHang> renQiList=new ArrayList<ListRenQiBean.RenQiPaiHang>();
//    final ArrayList<ListShengLvBean.ShengLvPaiHang> shengLvList=new ArrayList<ListShengLvBean.ShengLvPaiHang>();
    final  ArrayList<UserInfoBean.UserInfo> userInfoList=new ArrayList<UserInfoBean.UserInfo>();

    ViewHolder viewHolder = new ViewHolder();
    private FoldingCellListAdapter darenAdpter;
//    private FoldingCellListAdapter renqiAdpter;
//    private FoldingCellListAdapter shenglvAdpter;
    private Button btn_tosearch;

    int msgWhat=0;
    private ListView theListView;
    private LinearLayout linear_btn;
    private RelativeLayout rl_line3;

    @Nullable
    @Override
    public View onCreateView(final LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
       final View view= inflater.inflate(R.layout.search_fragment,null);

        /**
         * 广告部分
         */

        //获取图片
        imageIds = new int[]{
                R.drawable.a,
                R.drawable.b,
                R.drawable.c,
                R.drawable.d,
                R.drawable.e
        };

        //显示图片
        images = new ArrayList<ImageView>();
        for (int i = 0; i < imageIds.length; i++) {
            ImageView imageView = new ImageView(getActivity());
            imageView.setBackgroundResource(imageIds[i]);

            images.add(imageView);
        }

        //显示点
        dots = new ArrayList<View>();
        dots.add(view.findViewById(R.id.dot_0));
        dots.add(view.findViewById(R.id.dot_1));
        dots.add(view.findViewById(R.id.dot_2));
        dots.add(view.findViewById(R.id.dot_3));
        dots.add(view.findViewById(R.id.dot_4));

        mViewPager = (ViewPager)view.findViewById(R.id.viewpager);

        adapter = new ViewPagerAdapter();
        mViewPager.setAdapter(adapter);
        mViewPager.setCurrentItem(1000);  //当前页是第1000页

        mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                dots.get(oldPosition).setBackgroundResource(R.drawable.dot_normal);
                dots.get(position%5).setBackgroundResource(R.drawable.dot_focused);
                oldPosition = position%5;

            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });

        /**
         * 排行部分
         */

        theListView = ((ListView) view.findViewById(R.id.mainListView));
        linear_btn = ((LinearLayout) view.findViewById(R.id.linear_btn));
        rl_line3 = ((RelativeLayout) view.findViewById(R.id.rl_line3));
//        View header1=rl_line3;
//        View header1=mViewPager;
//
//        theListView.addHeaderView(header1);
//        theListView.addHeaderView(linear_btn);
//        theListView.addHeaderView(LayoutInflater.from(getActivity()).inflate( R.id.linear_btn, null));

//       theListView.addHeaderView(rl_line3);

        theListView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                return flag;
            }
        });

        darenAdpter=new FoldingCellListAdapter(getActivity(), userInfoList);
//        renqiAdpter=new FoldingCellListAdapter(getActivity(), userInfoList);
//        shenglvAdpter=new FoldingCellListAdapter(getActivity(), userInfoList);

        darenAdpter.setDefaultRequestBtnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getActivity(), "DEFAULT HANDLER FOR ALL BUTTONS", Toast.LENGTH_SHORT).show();
            }
        });
        theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                flag=true;

                Handler x = new Handler();
                x.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        flag=false;
                    }
                }, 1500);
                ((FoldingCell) view).toggle(false);

                darenAdpter.registerToggle(position);
//                renqiAdpter.registerToggle(position);
//                shenglvAdpter.registerToggle(position);
            }
        });

        //拿到button
        btn_daren = (Button) view.findViewById(R.id.btn_daren);//达人排行的button
        btn_renqi = (Button) view.findViewById(R.id.btn_renqi);//人气排行的button
        btn_shenglv = (Button) view.findViewById(R.id.btn_shenglv);//胜率的button

//
        //达人排行
        btn_daren.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                theListView.setAdapter(darenAdpter);
                btn_daren.setSelected(true);
                btn_renqi.setSelected(false);
                btn_shenglv.setSelected(false);
                getDarenList();

            }
        });
//
//
//
//
//
//        //人气排行
         btn_renqi.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {

                 theListView.setAdapter(darenAdpter);
                 btn_daren.setSelected(false);
                 btn_renqi.setSelected(true);
                 btn_shenglv.setSelected(false);
                 getRenqiList();
             }
         });

//        //胜率排行
        btn_shenglv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                theListView.setAdapter(darenAdpter);

                btn_daren.setSelected(false);
                btn_renqi.setSelected(false);
                btn_shenglv.setSelected(true);
               getShenglvList();
            }
        });

        //通过搜索按钮跳转到搜索界面
        btn_tosearch = ((Button) view.findViewById(R.id.btn_tosearch));
        btn_tosearch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent();
                intent.setClass(getActivity(), SearchActivity.class);
                getActivity().startActivity(intent);
            }
        });

//
        theListView.setAdapter(darenAdpter);

        getDarenList();
//
        btn_daren.setSelected(true);
        return view;
    }

    //拿数据胜率
    private void getShenglvList() {

        RequestParams params=new RequestParams("http://10.40.5.48:8080/paishow/toandroiduserinfo");

        params.addParameter("orderflag",2+"");

        x.http().get(params, new Callback.CommonCallback<String>() {

            @Override
            public void onSuccess(String result) {
                Gson gson=new Gson();

               // ListShengLvBean shenglvBean=gson.fromJson(result, ListShengLvBean.class);
                UserInfoBean  userInfoBean=gson.fromJson(result,UserInfoBean.class);
                userInfoList.clear();
                userInfoList.addAll(userInfoBean.userinfoList);
                //通知listview跟新界面

                darenAdpter.notifyDataSetChanged();

            }

            @Override
            public void onError(Throwable ex, boolean isOnCallback) {

            }

            @Override
            public void onCancelled(CancelledException cex) {

            }

            @Override
            public void onFinished() {

            }
        });
    }

    //拿数据人气
    private void getRenqiList() {
        RequestParams params=new RequestParams("http://10.40.5.48:8080/paishow/toandroiduserinfo");
        params.addParameter("orderflag",1+"");
        x.http().get(params, new Callback.CommonCallback<String>() {

            @Override
            public void onSuccess(String result) {
                Gson gson=new Gson();
               // ListRenQiBean renqiBean=gson.fromJson(result, ListRenQiBean.class);
                UserInfoBean  userInfoBean=gson.fromJson(result,UserInfoBean.class);
                userInfoList.clear();
                userInfoList.addAll(userInfoBean.userinfoList);
                //通知listview跟新界面

                darenAdpter.notifyDataSetChanged();
            }

            @Override
            public void onError(Throwable ex, boolean isOnCallback) {

            }

            @Override
            public void onCancelled(CancelledException cex) {

            }

            @Override
            public void onFinished() {

            }
        });
    }

    //拿数据达人
    private void getDarenList() {
        RequestParams params=new RequestParams("http://10.40.5.48:8080/paishow/toandroiduserinfo");
        params.addParameter("orderflag",0+"");
        x.http().get(params, new Callback.CommonCallback<String>() {
            @Override
            public void onSuccess(String result) {

                Gson gson=new Gson();
              //  ListDaRenBean darenBean=gson.fromJson(result, ListDaRenBean.class);

                UserInfoBean  userInfoBean=gson.fromJson(result,UserInfoBean.class);
                userInfoList.clear();
                userInfoList.addAll(userInfoBean.userinfoList);
                //通知listview跟新界面
                System.out.println("==================111-========="+userInfoList.size());
                darenAdpter.notifyDataSetChanged();
            }

            @Override
            public void onError(Throwable ex, boolean isOnCallback) {

            }

            @Override
            public void onCancelled(CancelledException cex) {

            }

            @Override
            public void onFinished() {

            }
        });

    }

    /**
     * 对应广告切换
     */
    private class ViewPagerAdapter extends PagerAdapter {

        @Override
        public int getCount() {
           return Integer.MAX_VALUE;
        }

        @Override
        public boolean isViewFromObject(View view, Object object) {
            return view == object;
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView((View)object);
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            /**
             * position % imageList.size() 而不是position,是为了防止角标越界异常
             * 因为我们设置了viewpager子页面的数量有Integer.MAX_VALUE,而imageList的数量只是5。
             */

            container.addView(images.get(position % images.size()));
            return images.get(position % images.size());
        }
    }

//    @Override
//    public void onStart() {
//        super.onStart();
//
//
//
//        scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
//        //每隔2秒钟切换一张图片
//        scheduledExecutorService.scheduleWithFixedDelay(new ViewPagerTask(), 2, 2, TimeUnit.SECONDS);
//
//
//    }
//
//    private class ViewPagerTask implements Runnable {
//
//        @Override
//        public void run() {
//            currentItem = (currentItem + 1) % imageIds.length;
//            //更新界面
//            handler.obtainMessage().sendToTarget();
//
//        }
//    }
//

    private Handler handler = new Handler() {

        @Override
        public void handleMessage(Message msg) {
            //设置当前页面
            mViewPager.setCurrentItem(mViewPager.getCurrentItem()+1);
            handler.sendEmptyMessageDelayed(msgWhat,5000);
        }

    };

    @Override
    public void onResume() {
        super.onResume();
        handler.sendEmptyMessageDelayed(msgWhat, 2000);
    }

    @Override
    public void onStop() {
        super.onStop();
        handler.removeMessages(msgWhat);
    }

    //排行部分

    @Override
    public void initView() {

    }

    @Override
    public void initEvent() {

    }

    @Override
    public void initData() {

    }

////达人adpter
//    public  class  daRenAdapter extends  BaseAdapter{
//
//    @Override
//        public int getCount() {
//            return daRenList.size();
//        }
//
//        @Override
//        public Object getItem(int position) {
//            return null;
//        }
//
//        @Override
//        public long getItemId(int position) {
//            return 0;
//        }
//
//
//        @Override
//        public View getView(int position, View convertView, ViewGroup parent) {
//            View view= View.inflate(getActivity(),R.layout.search_daren_listview,null);
//
//
//
//            viewHolder.tv_userName = ((TextView) view.findViewById(R.id.tv_userName));
//            viewHolder.tv_dengjiNum=((TextView) view.findViewById(R.id.tv_dengjiNum));
//            viewHolder.iv_userImage = ((ImageView) view.findViewById(R.id.iv_userImage));
//            ListDaRenBean.DaRenPaiHang paiHang=daRenList.get(position);
//            try {
//                viewHolder.tv_userName.setText(URLDecoder.decode(paiHang.userName,"utf-8"));
//               // tv_dengjiNum.setText(paiHang.dengJiNum);
//                viewHolder.tv_dengjiNum.setText(URLDecoder.decode(paiHang.dengJiNum+"","utf-8"));
//                x.image().bind(viewHolder.iv_userImage, URLDecoder.decode(paiHang.userImg+"","utf-8"));
//            } catch (UnsupportedEncodingException e) {
//                e.printStackTrace();
//            }
//
//            return view;
//        }
//    }
//
//    //人气adpter
//        private class renQiAdapter extends BaseAdapter{
//
//
//
//        @Override
//        public int getCount() {
//            return renQiList.size();
//        }
//
//        @Override
//        public Object getItem(int position) {
//            return null;
//        }
//
//        @Override
//        public long getItemId(int position) {
//            return 0;
//        }
//
//        @Override
//        public View getView(int position, View convertView, ViewGroup parent) {
//            View view=View.inflate(getActivity(),R.layout.search_renqi_listview,null);
//            viewHolder.tv_userName1 = ((TextView) view.findViewById(R.id.tv_userName1));
//            viewHolder.tv_renqiNum = ((TextView) view.findViewById(R.id.tv_renqiNum));
//            viewHolder.iv_userImage1 = ((ImageView) view.findViewById(R.id.iv_userImage1));
//            ListRenQiBean.RenQiPaiHang paiHang=renQiList.get(position);
//            try {
//                viewHolder.tv_userName1.setText(URLDecoder.decode(paiHang.userName,"utf-8"));
//                // tv_dengjiNum.setText(paiHang.dengJiNum);
//                viewHolder.tv_renqiNum.setText(URLDecoder.decode(paiHang.renQiNum+"","utf-8"));
//                x.image().bind(viewHolder.iv_userImage1, URLDecoder.decode(paiHang.userImg,"utf-8"));
//            } catch (UnsupportedEncodingException e) {
//                e.printStackTrace();
//            }
//            return view;
//        }
//    }
//
//
//    //胜率adpter
//    private class shengLvAdpter extends BaseAdapter{
//
//
//
//        @Override
//        public int getCount() {
//            return shengLvList.size();
//        }
//
//        @Override
//        public Object getItem(int position) {
//            return null;
//        }
//
//        @Override
//        public long getItemId(int position) {
//            return 0;
//        }
//
//        @Override
//        public View getView(int position, View convertView, ViewGroup parent) {
//            View view=View.inflate(getActivity(),R.layout.search_shenglv_listview,null);
//            viewHolder.tv_userName2 = ((TextView) view.findViewById(R.id.tv_userName2));
//            viewHolder.tv_shengLvNum = ((TextView) view.findViewById(R.id.tv_shengLvNum));
//            viewHolder.iv_userImage2 = ((ImageView) view.findViewById(R.id.iv_userImage2));
//            ListShengLvBean.ShengLvPaiHang paiHang= shengLvList.get(position);
//
//            try {
//                viewHolder.tv_userName2.setText(URLDecoder.decode(paiHang.userName,"utf-8"));
//
//                viewHolder.tv_shengLvNum.setText(URLDecoder.decode(paiHang.shengLvNum+"","utf-8"));
//
//                x.image().bind(viewHolder.iv_userImage2, URLDecoder.decode(paiHang.userImg+"","utf-8"));
//            } catch (UnsupportedEncodingException e) {
//                e.printStackTrace();
//            }
//            return view;
//        }
//     }

      public class ViewHolder{
          TextView tv_userName;
          TextView tv_dengjiNum;
          TextView tv_userName1;
           TextView tv_renqiNum;
          TextView tv_userName2;
           TextView tv_shengLvNum;
          ImageView iv_userImage;
          ImageView iv_userImage1;
          ImageView iv_userImage2;
      }

    }


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.fasterxml.jackson.annotation.JsonFormat.Value (Jackson-annotations 2.12.0 API)</title>
<meta name="date" content="2020-11-28">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.fasterxml.jackson.annotation.JsonFormat.Value

Uses of JsonFormat.Value in com.fasterxml.jackson.annotation

Methods in com.fasterxml.jackson.annotation that return JsonFormat.Value

Modifier and Type
Method and Description

static JsonFormat.Value
JsonFormat.Value.empty()

static JsonFormat.Value
JsonFormat.Value.forLeniency(boolean lenient)

static JsonFormat.Value
JsonFormat.Value.forPattern(String p)

static JsonFormat.Value
JsonFormat.Value.forShape(JsonFormat.Shape sh)

static JsonFormat.Value
JsonFormat.Value.from(JsonFormat ann)

static JsonFormat.Value
JsonFormat.Value.merge(JsonFormat.Value base,
     JsonFormat.Value overrides)

Helper method that will try to combine values from two JsonFormat.Value
 instances, using one as base settings, and the other as overrides
 to use instead of base values when defined; base values are only
 use if override does not specify a value (matching value is null
 or logically missing).

static JsonFormat.Value
JsonFormat.Value.mergeAll(JsonFormat.Value... values)

JsonFormat.Value
JsonFormat.Value.withFeature(JsonFormat.Feature f)

JsonFormat.Value
JsonFormat.Value.withLenient(Boolean lenient)

JsonFormat.Value
JsonFormat.Value.withLocale(Locale l)

JsonFormat.Value
JsonFormat.Value.withoutFeature(JsonFormat.Feature f)

JsonFormat.Value
JsonFormat.Value.withOverrides(JsonFormat.Value overrides)

JsonFormat.Value
JsonFormat.Value.withPattern(String p)

JsonFormat.Value
JsonFormat.Value.withShape(JsonFormat.Shape s)

JsonFormat.Value
JsonFormat.Value.withTimeZone(TimeZone tz)

Methods in com.fasterxml.jackson.annotation with parameters of type JsonFormat.Value

Modifier and Type
Method and Description

static JsonFormat.Value
JsonFormat.Value.merge(JsonFormat.Value base,
     JsonFormat.Value overrides)

Helper method that will try to combine values from two JsonFormat.Value
 instances, using one as base settings, and the other as overrides
 to use instead of base values when defined; base values are only
 use if override does not specify a value (matching value is null
 or logically missing).

static JsonFormat.Value
JsonFormat.Value.mergeAll(JsonFormat.Value... values)

JsonFormat.Value
JsonFormat.Value.withOverrides(JsonFormat.Value overrides)

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2008–2020 FasterXML. All rights reserved.


text:
var oxo = {
    rand: function () {
        return "?r=" + Math.random();
    },

    model: {
        currentGame: "",
        gameList: [],
        name: "New User"
    },

    ajax: {
        createGame: function (cb) {
            $.post("/Game/CreateGame", cb);
        },

        placeMove: function (coords, cb) {
            $.post("/Game/", function (data) {
                if (cb) {
                    cb(data);
                }
            });
        },
        getGames: function (cb) {
            $.get("/Game/Index/" + oxo.rand(), function (data) {
                if (data) {
                    // games playing
                    data[0].forEach(function (x) {
                        x.Waiting = x.State == 0;
                    });
                }
                cb({ currentGames: data[0], availableGames: data[1] });
            });
        },
        getMoves: function (cb) {
            $.get("/Game/GetMoves/" + oxo.model.currentGame + oxo.rand(), cb);
        },
        makeMove: function (x, y, cb) {
            $.post("/Game/MakeMove/" + oxo.model.currentGame + "/?x=" + x + "&y=" + y, cb);
        },
        joinGame: function (gameId, cb) {
            $.post("/Game/Join/" + gameId, function (data) {
                // check we have joined
                oxo.model.currentGame = gameId;
                cb(data);
            });
        },
        setName: function (name, cb) {
            $.post("/Game/SetUser/" + name, function (data) {
                if (cb) {
                    cb(data);
                }
            });
        }
    },

    controllers: {
        refreshGamesList: function () {
            oxo.ajax.getGames(oxo.ui.renderGameList);
        },
        refreshBoard: function () {
            if (oxo.model.currentGame) {
                oxo.ajax.getMoves(function (data) {
                    oxo.ui.renderBoard(data);
                });
            }
        },
        play: function (gameId) {
            oxo.model.currentGame = gameId;
            oxo.controllers.refreshBoard();
            $("#board-placeholder").show("fast");
            $("#games-placeholder").hide("fast");
        },
        move: function (x, y) {
            oxo.ajax.makeMove(x, y, function () {
                oxo.controllers.refreshBoard();
                oxo.controllers.refreshGamesList();
            });
        },
        createGame: function () {
            oxo.ajax.createGame(oxo.controllers.refreshGamesList);
        },
        showJoinDialog: function () {
            $("#join-game-modal").modal();
        },
        joinGame: function () {
            var gameId = $("#join-game-input").val().trim();
            if (!gameId) return;
            $("#join-game-modal").modal('hide');
            oxo.ajax.joinGame(gameId, function (data) {
                $("#join-game-input").val("");
                oxo.controllers.refreshGamesList();
            });
        },
        joinThisGame: function (gameId) {
            if (!gameId) return;
            oxo.ajax.joinGame(gameId, function (data) {
                oxo.controllers.refreshGamesList();
            });
        },
        enterName: function () {
            var name = $("#enter-name-input").val().trim();
            if (!name) return;
            oxo.model.name = name;
            $("#enter-name-modal").modal('hide');
            oxo.ajax.setName(name, function () {
                $("#enter-name-input").val("")
                oxo.controllers.refreshGamesList();
            });
        },
        showInvite: function (gameId) {
            $("#invite-game-id").val(gameId);
            $("#invite-game-link").val(window.location.origin + "/Home/Join/" + gameId);
            $("#invite-game-modal").modal();
        },
        showGames: function () {
            $("#board-placeholder").hide("fast");
            $("#games-placeholder").show("fast");
        }

    },

    ui: {

        renderGameList: function (data) {
            var template = Handlebars.compile($("#games-template").html());
            $("#games-placeholder").html(template(data));
        },
        renderBoard: function (data) {
            var template = Handlebars.compile($("#board-template").html());
            var board = {};
            if (data.summary.YourMove) {
                for (var x = 0; x < 3; x++)
                    for (var y = 0; y < 3; y++)
                        board["x" + x + "y" + y] = 'MOVE'
            }
            var useO = true;
            data.moves.forEach(function (move) {
                board["x" + move.X + "y" + move.Y] = useO ? "O" : "X";
                useO = !useO;
            });
            data.board = board;
            $("#board-placeholder").html(template(data));
        }
    }
}

$(document).ready(function () {
    $("#joinConfirmButton").bind('click', oxo.controllers.joinGame);
    $("#enterNameOk").bind('click', oxo.controllers.enterName);
    $("enter-name-input").keyup(function (event) {
        if (event.keyCode == 13) {
            $("#enterNameOk").click();
        }
    });

    $("#enter-name-modal").modal({
        backdrop: 'static',
        keyboard: false
    });

    setInterval(oxo.controllers.refreshGamesList, 5 * 1000);
    setInterval(oxo.controllers.refreshBoard, 5 * 1000);
});