text:
;(function ( $, window, document, undefined ) {
	var _name = 'button'
	,	_defaults = {
			theme: 'default'
		,	beforeAction: $.noop()
		,	action: $.noop()
		,	clicked: $.noop()
		,	ifNotAction: $.noop()
		,	beforeUnset: $.noop()
		,	ifNotUnsetted: $.noop()
		,	ifUnsettedOrNot: $.noop()
		,	unsetted: $.noop()
	}

	Button = function( element_, options_ ) {
		this.element = element_;
		this.name = _name;
		this.state = 'unactive';
		this.options = $.extend( {}, this.options, _defaults, options_ );
		this._setOptions( this.options );

		if( typeof $.button === 'undefined' )
			$.button = [];
		if( this.element !== 'undefined' )
			$.button.push( this.element );

		this.init();
	}

	Button.prototype = new $.kit();
	Button.prototype.constructor = Button;

	Button.prototype.__setOption = function( key_, value_ ) {
		var me  = this
		,	$me = $(me.element);

		switch( key_ ) {
			case 'theme':
				$me.addClass( '-' + value_ + '-' );
			break;

			case 'enabled':
				value_ === true ? $me.removeClass( '-disabled-' ) : $me.addClass( '-disabled-' );
			break;
		}

		me.options[ key_ ] = value_;
	}

	Button.prototype.init = function() {
		var me  = this;

		$(me.element).on( 'click.' + me.name, function( event_ ) {
			me._toggle( me.element );
			event_.preventDefault();
		});
	}

	Button.prototype._toggle = function( btn_ ) {
		var me  = this
		,	$me = $(me.element);

		if( btn_ === me.element ) {
			if( me.state === 'unactive' )
				me.action()
			else
			if( me.state === 'active' )
				me.unset();
		}
	}

	Button.prototype.action = function() {
		var me  = this
		,	$me = $(me.element);

		if( me.options.enabled === true && me.state !== 'loading' ) {

			me.state = 'loading';

			if( me.options.beforeAction !== 'undefined' && (typeof me.options.beforeAction === 'object' || typeof me.options.beforeAction === 'function' )) {

				try {
					var deferred = me.options.beforeAction.call( $me );
					deferred
						.done(function(){
							me._action();
						})
						.fail(function(){
							me.state = 'unactive';
							$me.trigger('ifNotAction.' + me.name);
							$me.trigger('clicked.' + me.name);
						})
				} catch( e ) {
					me._action();
				}

			}
			else {
				me._action();
			}
		}
	}

	Button.prototype._action = function() {
		var me  = this;
		var $me = $(me.element);

		if( me.state === 'loading' ) {

			if( $me.data('radio') )
			{
				var _radio = $me.data('radio');
				$.each( me._getOtherInstanses( $.button ), function() {
					var _plugin = $.data( this, 'kit-' + me.name )
					,	_el = $( _plugin.element );

					if( _plugin.element !== me.element && _el.data('radio') && _el.data('radio') === _radio && _plugin.getState() === 'active' )
						_plugin.unset();
				});
			}

			me.state = 'active';
			$me.trigger('action.' + me.name);
		}

		$me.trigger('clicked.' + me.name);
	}

	Button.prototype.unset = function() {
		var me  = this;
		var $me = $(me.element);

		if( me.options.enabled === true && me.state !== 'unset' ) {

			if( me.options.beforeUnset != 'undefined' && (typeof me.options.beforeUnset === 'object' || typeof me.options.beforeUnset === 'function' ))
			{
				try {
					var deferred = me.options.beforeUnset.call( $me );
					deferred
						.done(function(){
							me._unset();
						})
						.fail(function(){
							$me.trigger('ifNotUnsetted.' + me.name);
							$me.trigger('ifUnsettedOrNot.' + me.name);
							me.state = 'active';
						})
				} catch( e ) {
					me._unset();
				}

			}
			else {
				me._unset();
			}
		}
	}

	Button.prototype._unset = function() {
		var me  = this;
		var $me = $(me.element);

		if( me.state === 'active' ) {
			me.state = 'unactive';
			$me.trigger('unsetted');
		}
		$me.trigger('ifUnsettedOrNot.' + me.name);
	}

	$.fn[_name] = function( options_ ) {
		return this.each(function() {
			if( ! $.data( this, 'kit-' + _name ) ) {
				$.data( this, 'kit-' + _name, new Button( this, options_ ) );
			}
			else {
				typeof options_ === 'object' ? $.data( this, 'kit-' + _name )._setOptions( options_ ) :
					typeof options_ === 'string' && options_.charAt(0) !== '_' ? $.data( this, 'kit-' + _name )[ options_ ] : $.error( 'What do you want to do?' );
			}
		});
	}

})( jQuery, window, document );


text:
package com.fanyo.common;

/**
 * 名称:  Constants
 * 作者:   rain.wang
 * 日期:   2016/9/9
 * 简介:
 */
public class Constants {
    public static final String CONSUMER_KEY = "c25c6029176a4cd16678e17f3f739eb6";
    public static final String CONSUMER_SECRET = "883339528b0a9520e0688dade07ceeb7";
    public static final String REQ_TOKEN_URL = "http://fanfou.com/oauth/request_token";
    public static final String ACC_TOKEN_URL = "http://fanfou.com/oauth/access_token";
    public static final String AUTH_URL = "http://fanfou.com/oauth/authorize";
    public static final String AUTH_METHOD = "SHA-1";
    public static final String CHARSET = "UTF-8";
    public static final String HTTP_METHOD = "GET";
}

redpajama_set_name: RedPajamaGithub


text:
/* This file is auto generated.
 * DO NOT EDIT IT MANUALLY!
 */
package com.units.frequency;

import com.units.internal.Multipliers;

public class Kilohertz extends Frequency {

	public static final double _scale =
		Multipliers.kilo * Hertz._scale;

	public Kilohertz(double value) {
		super(value);
	}

	@Override
	public String pluralName() {
		return "kilohertz";
	}

	@Override
	public double scale() {
		return _scale;
	}

	public static Kilohertz zero() {
		return new Kilohertz(0);
	}

	public static Kilohertz one() {
		return new Kilohertz(1);
	}

	public Kilohertz plus(Kilohertz other) {
		return new Kilohertz(value() + other.value());
	}

	public Kilohertz minus(Kilohertz other) {
		return new Kilohertz(value() - other.value());
	}

	public Kilohertz opposite() {
		return new Kilohertz(-value());
	}

	public Kilohertz multiplyByScalar(double scalar) {
		return new Kilohertz(scalar * value());
	}

	public Kilohertz divideByScalar(double scalar) {
		return new Kilohertz(value() / scalar);
	}

	public double scalarRatio(Kilohertz other) {
		return value() / other.value();
	}

	public boolean equals(Kilohertz other) {
		if (other == null)
			return false;
		return almostEqualsValue(other.value());
	}

	public boolean lessThan(Kilohertz other) {
		return value() < other.value();
	}

	public boolean lessThanOrEquals(Kilohertz other) {
		return !other.lessThan(this);
	}

	public boolean greaterThan(Kilohertz other) {
		return other.lessThan(this);
	}

	public boolean greaterThanOrEquals(Kilohertz other) {
		return !lessThan(other);
	}
}


text:
package com.spotify.heroic.shell.task;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.spotify.heroic.QueryManager;
import com.spotify.heroic.QueryOptions;
import com.spotify.heroic.dagger.CoreComponent;
import com.spotify.heroic.metric.MetricCollection;
import com.spotify.heroic.metric.RequestError;
import com.spotify.heroic.metric.ShardedResultGroup;
import com.spotify.heroic.shell.AbstractShellTaskParams;
import com.spotify.heroic.shell.ShellIO;
import com.spotify.heroic.shell.ShellTask;
import com.spotify.heroic.shell.TaskName;
import com.spotify.heroic.shell.TaskParameters;
import com.spotify.heroic.shell.TaskUsage;
import dagger.Component;
import eu.toolchain.async.AsyncFuture;
import lombok.ToString;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;

import javax.inject.Inject;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@TaskUsage("Execute a query")
@TaskName("query")
public class Query implements ShellTask {
    private final QueryManager query;
    private final ObjectMapper mapper;

    @Inject
    public Query(QueryManager query, @Named("application/json") ObjectMapper mapper) {
        this.query = query;
        this.mapper = mapper;
    }

    @Override
    public TaskParameters params() {
        return new Parameters();
    }

    @Override
    public AsyncFuture<Void> run(final ShellIO io, final TaskParameters base) throws Exception {
        final Parameters params = (Parameters) base;

        final String queryString = params.query.stream().collect(Collectors.joining(" "));

        final ObjectMapper indent = mapper.copy();
        indent.configure(SerializationFeature.INDENT_OUTPUT, true);

        final QueryOptions options = QueryOptions.builder().tracing(params.tracing).build();

        return query
            .useGroup(params.group)
            .query(query.newQueryFromString(queryString).options(Optional.of(options)).build())
            .directTransform(result -> {
                for (final RequestError e : result.getErrors()) {
                    io.out().println(String.format("ERR: %s", e.toString()));
                }

                for (final ShardedResultGroup resultGroup : result.getGroups()) {
                    final MetricCollection group = resultGroup.getGroup();

                    io
                        .out()
                        .println(String.format("%s: %s %s", group.getType(), resultGroup.getShard(),
                            indent.writeValueAsString(resultGroup.getSeries())));
                    io.out().println(indent.writeValueAsString(group.getData()));
                    io.out().flush();
                }

                io.out().println("TRACE:");
                result.getTrace().formatTrace(io.out());
                io.out().flush();

                return null;
            });
    }

    @ToString
    private static class Parameters extends AbstractShellTaskParams {
        @Option(name = "-g", aliases = {"--group"}, usage = "Backend group to use",
            metaVar = "<group>")
        private String group = null;

        @Argument(metaVar = "<query>")
        private List<String> query = new ArrayList<>();

        @Option(name = "--tracing", usage = "Enable extensive tracing")
        private boolean tracing = false;
    }

    public static Query setup(final CoreComponent core) {
        return DaggerQuery_C.builder().coreComponent(core).build().task();
    }

    @Component(dependencies = CoreComponent.class)
    static interface C {
        Query task();
    }
}


text:
using System;
using System.Linq;
using System.Threading.Tasks;

namespace Hokanson.JottoRepository
{
    using Exceptions;
    using Models;

    public class PlayerRepository : RepositoryBase<JottoPlayer>
    {
        static PlayerRepository()
        {
            string id = Guid.NewGuid().ToString();
            Objects[id] = new JottoPlayer
            {
                IsComputer = true,
                Id = id,
                Name = "Computer"
            };
        }

        public override Task<JottoPlayer> AddAsync(JottoPlayer player)
        {
            // alternate key
            if (Objects.Values.FirstOrDefault(p => string.Compare(p.Name, player.Name, StringComparison.OrdinalIgnoreCase) == 0) != null)
                throw new PkException("player with that name already exists");

            player.Id = Guid.NewGuid().ToString();
            player.IsComputer = false;

            Objects[player.Id] = player;

            return Task.FromResult(player);
        }
    }
}


text:
package io.netty.resolver.dns.macos;

import io.netty.resolver.dns.DnsServerAddressStream;
import io.netty.resolver.dns.DnsServerAddressStreamProvider;
import io.netty.resolver.dns.DnsServerAddressStreamProviders;
import io.netty.resolver.dns.DnsServerAddresses;
import io.netty.util.internal.ClassInitializerUtil;
import io.netty.util.internal.NativeLibraryLoader;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.netty.util.internal.ThrowableUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;

import java.net.InetSocketAddress;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;

/**
 * {@link DnsServerAddressStreamProvider} implementation which makes use of the same mechanism as
 * Apple's open source mDNSResponder to retrieve the
 * current nameserver configuration of the system.
 */
public final class MacOSDnsServerAddressStreamProvider implements DnsServerAddressStreamProvider {

    private static final Comparator<DnsResolver> RESOLVER_COMPARATOR =
            new Comparator<DnsResolver>() {
                @Override
                public int compare(DnsResolver r1, DnsResolver r2) {
                    // Note: order is descending (from higher to lower) so entries with lower search order override
                    // entries with higher search order.
                    return r1.searchOrder() < r2.searchOrder() ? 1 : r1.searchOrder() == r2.searchOrder() ? 0 : -1;
                }
            };

    private static final Throwable UNAVAILABILITY_CAUSE;

    private static final InternalLogger logger =
            InternalLoggerFactory.getInstance(MacOSDnsServerAddressStreamProvider.class);

    // Let's refresh every 10 seconds.
    private static final long REFRESH_INTERVAL = TimeUnit.SECONDS.toNanos(10);

    static {
        // Preload all classes that will be used in the OnLoad(...) function of JNI to eliminate the possiblity of a
        // class-loader deadlock. This is a workaround for https://github.com/netty/netty/issues/11209.

        // This needs to match all the classes that are loaded via NETTY_JNI_UTIL_LOAD_CLASS or looked up via
        // NETTY_JNI_UTIL_FIND_CLASS.
        ClassInitializerUtil.tryLoadClasses(MacOSDnsServerAddressStreamProvider.class,
                // netty_resolver_dns_macos
                byte[].class, String.class
        );

        Throwable cause = null;
        try {
            loadNativeLibrary();
        } catch (Throwable error) {
            cause = error;
        }
        UNAVAILABILITY_CAUSE = cause;
    }

    private static void loadNativeLibrary() {
        if (!PlatformDependent.isOsx()) {
            throw new IllegalStateException("Only supported on MacOS/OSX");
        }
        String staticLibName = "netty_resolver_dns_native_macos";
        String sharedLibName = staticLibName + '_' + PlatformDependent.normalizedArch();
        ClassLoader cl = PlatformDependent.getClassLoader(MacOSDnsServerAddressStreamProvider.class);
        try {
            NativeLibraryLoader.load(sharedLibName, cl);
        } catch (UnsatisfiedLinkError e1) {
            try {
                NativeLibraryLoader.load(staticLibName, cl);
                logger.debug("Failed to load {}", sharedLibName, e1);
            } catch (UnsatisfiedLinkError e2) {
                ThrowableUtil.addSuppressed(e1, e2);
                throw e1;
            }
        }
    }

    public static boolean isAvailable() {
        return UNAVAILABILITY_CAUSE == null;
    }

    public static void ensureAvailability() {
        if (UNAVAILABILITY_CAUSE != null) {
            throw (Error) new UnsatisfiedLinkError(
                    "failed to load the required native library").initCause(UNAVAILABILITY_CAUSE);
        }
    }

    public static Throwable unavailabilityCause() {
        return UNAVAILABILITY_CAUSE;
    }

    public MacOSDnsServerAddressStreamProvider() {
        ensureAvailability();
        currentMappings = retrieveCurrentMappings();
        lastRefresh = new AtomicLong(System.nanoTime());
    }

    private volatile Map<String, DnsServerAddresses> currentMappings;
    private final AtomicLong lastRefresh;

    private static Map<String, DnsServerAddresses> retrieveCurrentMappings() {
        DnsResolver[] resolvers = resolvers();

        if (resolvers == null || resolvers.length == 0) {
            return Collections.emptyMap();
        }
        Arrays.sort(resolvers, RESOLVER_COMPARATOR);
        Map<String, DnsServerAddresses> resolverMap = new HashMap<String, DnsServerAddresses>(resolvers.length);
        for (DnsResolver resolver: resolvers) {
            // Skip mdns
            if ("mdns".equalsIgnoreCase(resolver.options())) {
                continue;
            }
            InetSocketAddress[] nameservers = resolver.nameservers();
            if (nameservers == null || nameservers.length == 0) {
                continue;
            }
            String domain = resolver.domain();
            if (domain == null) {
                // Default mapping.
                domain = StringUtil.EMPTY_STRING;
            }
            InetSocketAddress[] servers = resolver.nameservers();
            for (int a = 0; a < servers.length; a++) {
                InetSocketAddress address = servers[a];
                // Check if the default port should be used
                if (address.getPort() == 0) {
                    int port = resolver.port();
                    if (port == 0) {
                        port = 53;
                    }
                    servers[a] = new InetSocketAddress(address.getAddress(), port);
                }
            }

            resolverMap.put(domain, DnsServerAddresses.sequential(servers));
        }
        return resolverMap;
    }

    @Override
    public DnsServerAddressStream nameServerAddressStream(String hostname) {
        long last = lastRefresh.get();
        Map<String, DnsServerAddresses> resolverMap = currentMappings;
        if (System.nanoTime() - last > REFRESH_INTERVAL) {
            // This is slightly racy which means it will be possible still use the old configuration for a small
            // amount of time, but that's ok.
            if (lastRefresh.compareAndSet(last, System.nanoTime())) {
                resolverMap = currentMappings = retrieveCurrentMappings();
            }
        }

        final String originalHostname = hostname;
        for (;;) {
            int i = hostname.indexOf('.', 1);
            if (i < 0 || i == hostname.length() - 1) {
                // Try access default mapping.
                DnsServerAddresses addresses = resolverMap.get(StringUtil.EMPTY_STRING);
                if (addresses != null) {
                    return addresses.stream();
                }
                return DnsServerAddressStreamProviders.unixDefault().nameServerAddressStream(originalHostname);
            }

            DnsServerAddresses addresses = resolverMap.get(hostname);
            if (addresses != null) {
                return addresses.stream();
            }

            hostname = hostname.substring(i + 1);
        }
    }

    private static native DnsResolver[] resolvers();
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__float_zero_62b.cpp
Label Definition File: CWE369_Divide_by_Zero__float.label.xml
Template File: sources-sinks-62b.tmpl.cpp
*/
/*
 * @description
 * CWE: 369 Divide by Zero
 * BadSource: zero Fixed value of zero
 * GoodSource: A hardcoded non-zero number (two)
 * Sinks:
 *    GoodSink: Check value of or near zero before dividing
 *    BadSink : Divide a constant by data
 * Flow Variant: 62 Data flow: data flows using a C++ reference from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#include <math.h>

namespace CWE369_Divide_by_Zero__float_zero_62
{

#ifndef OMITBAD

void badSource(float &data)
{
    /* POTENTIAL FLAW: Set data to zero */
    data = 0.0F;
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B() uses the GoodSource with the BadSink */
void goodG2BSource(float &data)
{
    /* FIX: Use a hardcoded number that won't a divide by zero */
    data = 2.0F;
}

/* goodB2G() uses the BadSource with the GoodSink */
void goodB2GSource(float &data)
{
    /* POTENTIAL FLAW: Set data to zero */
    data = 0.0F;
}

#endif /* OMITGOOD */

} /* close namespace */


text:
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';

export default Route.extend({
  session: service(),
  beforeModel(){
    const session = this.session;
    if(session.isAuthenticated){
      return session.invalidate();
    }
  }
});


text:
package de.kernwelt.gpxtcx;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.xml.bind.DatatypeConverter;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Tcx {

    private List<TrackPoint> trackPoints;
    private Date dateTime;
    private int lastPointIdx = 0;

    public Tcx() {
    }

    public void createTrackPoints(File input) throws IOException, ParserConfigurationException, org.xml.sax.SAXException, ParseException {

        Document document = Util.parse(input);

        trackPoints = new ArrayList<TrackPoint>();
        NodeList trackPointNodes = document.getElementsByTagName("Trackpoint");
        for (int i = 0; i < trackPointNodes.getLength(); i++) {
            Node trackPointNode = trackPointNodes.item(i);
            NodeList children = trackPointNode.getChildNodes();
            int heartRate = 0;
            long time = 0;
            for (int j = 0; j < children.getLength(); j++) {
                Node subTrackPt = children.item(j);
                if (subTrackPt.getNodeName().equals("HeartRateBpm")) {
                    Node child = Util.getChildByName(subTrackPt, "Value");
                    if (child != null) {
                        heartRate = Integer.valueOf(child.getFirstChild().getNodeValue());
                    }
                } else if (subTrackPt.getNodeName().equals("Time")) {
                    Node node = subTrackPt.getFirstChild();
                    time = Util.toTime(node.getNodeValue());
                }
            }

            if (heartRate > 0 && time > 0) {
                trackPoints.add(new TrackPoint(time, heartRate));
            }
        }

        // <Lap StartTime="2011-03-06T12:40:09Z">
        NodeList lap = document.getElementsByTagName("Lap");
        String startTime = lap.item(0).getAttributes().getNamedItem("StartTime").getNodeValue();
        dateTime = DatatypeConverter.parseDateTime(startTime).getTime();
        lastPointIdx = 0;
    }

    public Date getStartTime() {
        return dateTime;
    }

    public int getHeartRateForTime(long time) {
        for (int i = lastPointIdx; i < trackPoints.size(); i++) {
            TrackPoint tp = trackPoints.get(i);
            if (time >= tp.getTime() - 5000) {
                if (time < tp.getTime() + 5000) {
                    lastPointIdx = i;
                    return tp.getHeartRate();
                } else if ((tp.getTime() - time) > 10000) {
                    return 0;
                }
            }
        }
        return 0;
    }

    public static class TrackPoint {
        private long time;
        private int heartRate;

        public TrackPoint(long time, int heartRate) {
            this.time = time;
            this.heartRate = heartRate;
        }

        public long getTime() {
            return time;
        }

        public int getHeartRate() {
            return heartRate;
        }
    }
}


text:
package netforward

import (
	"io"
	"log"
	"net"
)

func Forward(remote Dialer, local net.Listener) error {
	for {
		conn, err := local.Accept()
		if err != nil {
			return err
		}
		go forward(remote, conn)
	}
}

func forward(remote Dialer, conn io.ReadWriteCloser) {
	defer conn.Close()

	remoteConn, err := remote.Dial()
	if err != nil {
		log.Printf("dial failed: %v", err)
		return
	}
	defer remoteConn.Close()

	// remote -> local
	go func() {
		buf := getBuffer()
		defer releaseBuffer(buf)
		_, err := io.CopyBuffer(remoteConn, conn, buf)
		if err != nil {
			log.Printf("forward failed: %v", err)
		}
	}()

	// local -> remote
	buf := getBuffer()
	defer releaseBuffer(buf)
	_, err = io.CopyBuffer(conn, remoteConn, buf)
	if err != nil {
		log.Printf("forward failed: %v", err)
	}
}


text:
<?php
/*
Template Name: Sidebar Left
Template Post Type: post, page
*/
get_header();

$layout_class = ( function_exists( 'shapely_get_layout_class' ) ) ? shapely_get_layout_class() : ''; ?>

		<?php get_sidebar(); ?>
		<div id="primary" class="col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>">
			<?php
			while ( have_posts() ) : the_post();

				get_template_part( 'template-parts/content' );

				// If comments are open or we have at least one comment, load up the comment template.
				if ( comments_open() || get_comments_number() ) :
					comments_template();
				endif;

			endwhile; // End of the loop.
			?>

<?php
get_footer();


text:
@interface MMAFAppDotNetAPIClient : MMAFHTTPClient

+ (MMAFAppDotNetAPIClient *)sharedClient;

@end


text:
<!doctype html>
<html lang="en">
<head>
  <base href="/">

  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

  <title>UWI CloudCast Literacy Tutor</title>

  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
  <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
  <link rel="manifest" href="/manifest.json">
  <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#222222">
  <meta name="msapplication-TileColor" content="#222222">
  <meta name="msapplication-TileImage" content="/mstile-144x144.png">
  <meta name="theme-color" content="#222222">

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Francois+One" />

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.bundle.min.js"></script>

    <script type="text/javascript" src="shared/cloudcast.js"></script>
    <script type="text/javascript" src="shared/recorder.js"></script>

    <script src="https://use.typekit.net/kmv5qdr.js"></script>
    <script>try{Typekit.load({ async: true });}catch(e){}</script>

   <script src="https://code.responsivevoice.org/responsivevoice.js"></script>

</head>

<body>
  <app></app>
</body>
</html>


text:
Cakephp-Beauty-Paginator
========================

Cakephp pagination helper to remove action name from url and make them seo friendly

Description:
http://hashmode.com/remove-action-name-from-url-cakephp-pagination/34

Online Demo:
http://cakepagination.hashmode.com/posts

Currently does not support sorting.

## License

Released under the MIT license


text:
//
//  BaseReformer.m
//  SheJiQuan
//
//  Created by yshbyy on 15/11/13.
//  Copyright © 2015年 haiyabtx. All rights reserved.
//

#import "APIBaseReformer.h"

@interface APIBaseReformer ()

@end

@implementation APIBaseReformer

- (id)apiManagerReformResponseData:(id)responseData {
//    if ([responseData objectForKey:@"data"] == nil)
//    {
//        return responseData;
//    }
    id resulteData = [self handledResponseObject:responseData];
    return resulteData;
}

- (NSDictionary *)handleDictionary:(NSDictionary *)dict
{
    NSMutableDictionary *mutableDict = [NSMutableDictionary dictionaryWithDictionary:dict];

    NSMutableArray *keyToDeleteArray = [NSMutableArray array];
    NSMutableArray *subDictKeyArray = [NSMutableArray array];
    NSMutableArray *subArrayArray = [NSMutableArray array];
    [mutableDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {

        if (!*stop)
        {
            if ([obj isEqual:[NSNull null]])
            {
                [keyToDeleteArray addObject:key];
            }
            else if ([obj isKindOfClass:[NSDictionary class]])
            {
                [subDictKeyArray addObject:key];
            }
            else if ([obj isKindOfClass:[NSArray class]])
            {
                [subArrayArray addObject:key];
            }
        }
    }];
    if (keyToDeleteArray.count > 0)
    {
        for (id key in keyToDeleteArray)
        {
            [mutableDict removeObjectForKey:key];
        }
    }
    if (subDictKeyArray.count > 0)
    {
        for (id key in subDictKeyArray)
        {
            mutableDict[key] = [self handleDictionary:mutableDict[key]];
        }
    }
    if (subArrayArray.count > 0)
    {
        for (id key in subArrayArray)
        {
            mutableDict[key] = [self handleArray:mutableDict[key]];
        }
    }

    return [mutableDict copy];
}

/**
 *
 *  处理数组里的字典元素, 去掉所有字典里 key = <null> 的键值对
 *
 *  @param array 数组
 *
 *  @return 处理后的字典
 */
- (NSArray *)handleArray:(NSArray *)array
{
    NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:array];

    NSMutableArray *subDictKeyArray = [NSMutableArray array];
    NSMutableArray *subArrayArray = [NSMutableArray array];
    [mutableArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        if ([obj isKindOfClass:[NSDictionary class]])
        {
            [subDictKeyArray addObject:@(idx)];
        }
        else if ([obj isKindOfClass:[NSArray class]])
        {
            [subArrayArray addObject:@(idx)];
        }
    }];
    if (subDictKeyArray.count > 0)
    {
        for (NSNumber *idxNumber in subDictKeyArray)
        {
            NSUInteger index = [idxNumber unsignedIntegerValue];
            NSDictionary *dict = mutableArray[index];
            mutableArray[index] = [self handleDictionary:dict];
        }
    }
    if (subArrayArray.count > 0)
    {
        for (NSNumber *idxNumber in subArrayArray)
        {
            NSUInteger index = [idxNumber unsignedIntegerValue];
            NSArray *subArr = mutableArray[index];
            mutableArray[index] = [self handleArray:subArr];
        }
    }
    return [mutableArray copy];
}

/**
 *
 *  处理网络返回值, 去掉所有字典里 key = <null> 的键值对
 *
 *  @param responseObject 网络返回
 *
 *  @return 处理后的返回
 */
- (id)handledResponseObject:(id)responseObject
{
    if ([responseObject isKindOfClass:[NSDictionary class]])
    {
        return [self handleDictionary:(NSDictionary *)responseObject];
    }
    else if ([responseObject isKindOfClass:[NSArray class]])
    {
        return [self handleArray:(NSArray *)responseObject];
    }
    return responseObject;
}

@end


text:
var CordovaHostedApp;
(function (CordovaHostedApp) {
    "use strict";
    var Application;
    (function (Application) {

        function initialize() {
            document.addEventListener('deviceready', onDeviceReady, false);
        }

        Application.initialize = initialize;

        function onDeviceReady() {
            // Handle the Cordova pause and resume events
            document.addEventListener('pause', onPause, false);
            document.addEventListener('resume', onResume, false);
            document.getElementsByClassName('btn-lg')[0].addEventListener('click', takePicture);
        }

        function onPause() {
        }

        function onResume() {
        }

    })(Application = CordovaHostedApp.Application || (CordovaHostedApp.Application = {}));
    window.onload = function () {
        Application.initialize();
    };
})(CordovaHostedApp || (CordovaHostedApp = {}));
//# sourceMappingURL=app.js.map