text:
'use strict'

const fs = require('fs')
    , binPacker = require('../lib/index')
    , utils = require('../lib/util/utils')
    , prepareValues = require('../lib/util/prepare-values')

class AlgorithmType {
  static APPROX_PACKING = new AlgorithmType('APPROX_PACKING')
  static VARCAP_PACKING = new AlgorithmType('VARCAP_PACKING')
  static EXACT_PACKING = new AlgorithmType('EXACT_PACKING')
  static LOWER_BOUND = new AlgorithmType('LOWER_BOUND')

  constructor(name) {
    this.name = name
  }

  static isPacking(type) {
    return type === AlgorithmType.APPROX_PACKING ||
        type === AlgorithmType.VARCAP_PACKING ||
        type === AlgorithmType.EXACT_PACKING
  }
}

class Algorithm {
  /**
   * @param {string} name
   * @param {function} method
   * @param {AlgorithmType} type
   */
  constructor(name, method, type) {
    this.name = name
    this.method = method
    this.type = type
  }
}

class DataSpec {
  constructor(name, data, sizeOf, capacity, optimalSize) {
    this.name = name
    this.data = data
    this.sizeOf = sizeOf
    this.capacity = capacity
    this.optimalSize = optimalSize
    this.dataArray = prepareValues.toArray(this.data)
    this.dataLength = this.dataArray.length
    this.oversizedInData = anyTooBigInBin(this.dataArray, sizeOf, capacity)
  }
}

class PackedResult {
  /**
   * @param {Algorithm} algorithm
   * @param {DataSpec} dataSpec
   * @param {object} result  Altgorithm output.
   *    For fit algorithms: {bins: [], oversized: [],}
   *    For bound algorithms: {bound: <Number>, oversized: <Number>}
   */
  constructor(algorithm, dataSpec, result) {
    this.algorithm = algorithm
    this.dataSpec = dataSpec
    this.result = result
  }
}

const algorithms = [
        new Algorithm('nextFit', binPacker.nextFit, AlgorithmType.APPROX_PACKING),
        new Algorithm('firstFit', binPacker.firstFit, AlgorithmType.APPROX_PACKING),
        new Algorithm('firstFitDecreasing',
            binPacker.firstFitDecreasing, AlgorithmType.APPROX_PACKING),
        new Algorithm('bestFitDecreasing',
            binPacker.bestFitDecreasing, AlgorithmType.APPROX_PACKING),
        new Algorithm('nextFitVarCap', binPacker.nextFitVarCap, AlgorithmType.VARCAP_PACKING),
        new Algorithm('binCompletion', binPacker.binCompletion, AlgorithmType.EXACT_PACKING),
        new Algorithm('lowerBound1', binPacker.lowerBound1, AlgorithmType.LOWER_BOUND),
        new Algorithm('lowerBound2', binPacker.lowerBound2, AlgorithmType.LOWER_BOUND),
        ]
    , itemIsSize = item => item
    , dataPath = './spec/data/Falkenauer_ordered.json'
    , dataSpecs = toDataSpecs(dataFileToJson(dataPath), itemIsSize)
    , specsToRun = 80 // Number.MAX_SAFE_INTEGER

function toDataSpecs(json, sizeOf) {
  return Object.values(json).map(data =>
    new DataSpec(data.name, data.data, sizeOf, data.capacity, data.solution)
  )
}

function dataFileToJson(path) {
  return JSON.parse(fs.readFileSync(path))
}

/**
 * @param {DataSpec} dataSpec
 * @param {array<Algorithm>} algorithms
 * @returns {array<PackedResult>}
 */
function allResultsFor(dataSpec, algorithms) {
  const results = []
  for (const algorithm of algorithms) {
    if (AlgorithmType.EXACT_PACKING !== algorithm.type || isSafeToRunExactAlgo(dataSpec)) {
      results.push(new PackedResult(
          algorithm,
          dataSpec,
          algorithm.method(dataSpec.data.slice(), dataSpec.sizeOf, dataSpec.capacity)))
    }
  }
  return results
}

function isSafeToRunExactAlgo(dataSpec) {
  if (dataSpec.data.length > 120) {
    return false
  }
  if (dataSpec.name.startsWith('Falkenauer_t')) {
    return false
  }
  return true
}

/**
 * @param {array<PackedResult>} allResults
 * @param {string} algorithmName
 */
function findResultFor(allResults, algorithmName) {
  return allResults.find(results => results.algorithm.name === algorithmName)
}

function anyTooBig(bins, sizeOf, capacity) {
  for (const bin of bins) {
    if (anyTooBigInBin(bin, sizeOf, capacity)) {
      return true
    }
  }
  return false
}

function anyTooBigInBin(bin, sizeOf, capacity) {
  for (const item of bin) {
    if (sizeOf(item) > capacity) {
      return true
    }
  }
  return false
}

function anyEmpty(bins) {
  for (const bin of bins) {
    if (bin.length === 0) {
      return true
    }
  }
  return false
}

function numOversized(bin, sizeOf, capacity) {
  let count = 0
  for (const item of bin) {
    if (sizeOf(item) > capacity) {
      ++count
    }
  }
  return count
}

function getArrayKeyCount(bins) {
  return bins.reduce((acc, bin) => acc + bin.length, 0)
}

describe('bin-packer', function () {
  describe('algorithms', function () {
    describe('prepareValues', function () {
      function testPrepareValuesFor(algorithm) {
        const name = algorithm.name
        const method = algorithm.method
        it(`${name} should reject a non-positive capacity`, function () {
          expect(() => method([0, 1, 5], item => item, []))
              .toThrowError('Expected a number for capacity')
          expect(() => method([0, 1, 5], item => item, 0))
              .toThrowError('Capacity must be a positive number')
          expect(() => method([0, 1, 5], item => item, -3.2))
              .toThrowError('Capacity must be a positive number')
        })

        it(`${name} sizeOf must always return a number`, function () {
          expect(() => method([0, 1, 5], item => item.toString(), 10))
              .toThrowError('Expected a number for 0')
          expect(() => method([0, 1, {test: 100}, 5], item => item, 10))
              .toThrowError('Expected a number for 2')
        })
      }

      for (const algorithm of algorithms) {
        if (AlgorithmType.VARCAP_PACKING !== algorithm.type) {
          testPrepareValuesFor(algorithm)
        }
      }
    })

    describe('results check', function () {
      /**
       * @param {PackedResult} result
       */
      function resultChecks(results) {
        const algoName = results.algorithm.name
            , result = results.result
            , spec = results.dataSpec
            , dataName = spec.name

        it(`${algoName} should return as many keys as it was passed (${dataName})`, () => {
          expect(getArrayKeyCount(result.bins) + result.oversized.length).toEqual(spec.dataLength)
        })

        it(`${algoName} should have no empty bins (${dataName})`, function () {
          expect(anyEmpty(result.bins)).toBeFalsy()
        })

        it(`${algoName} should contain some oversized (${dataName})`, function () {
          if (spec.oversizedInData) {
            expect(result.oversized.length).toBeGreaterThan(0)
          } else {
            expect(result.oversized.length).toEqual(0)
          }
        })
      }

      function resultCapacityChecks(results) {
        const algoName = results.algorithm.name
            , result = results.result
            , spec = results.dataSpec
            , dataName = spec.name

        it(`${algoName} should not have any bins larger than capacity (${dataName})`, () => {
          expect(anyTooBig(
              result.bins,
              spec.sizeOf,
              spec.capacity)).toBeFalsy()
        })

        it(`${algoName} all oversized values should be > than capacity (${dataName})`, () => {
          expect(result.oversized)
              .toHaveSize(numOversized(result.oversized, spec.sizeOf, spec.capacity))
        })
      }

      /**
       * @param {array<PackedResult>} allResults
       */
      function relativeNumberOfBins(allResults) {
        const nextFit = findResultFor(allResults, 'nextFit').result
            , firstFit = findResultFor(allResults, 'firstFit').result
            , firstFitDecreasing = findResultFor(allResults, 'firstFitDecreasing').result
            , bestFitDecreasing = findResultFor(allResults, 'bestFitDecreasing').result
            , nextFitVarCap = findResultFor(allResults, 'nextFitVarCap').result
            , binCompletion = findResultFor(allResults, 'binCompletion')?.result
            , lowerBound1 = findResultFor(allResults, 'lowerBound1').result
            , lowerBound2 = findResultFor(allResults, 'lowerBound2').result
            , arbitrarySpec = allResults[0].dataSpec // All results have the same DataSpec
            , dataName = arbitrarySpec.name

        it(`nextFit >= firstFit (${dataName})`, function () {
          expect(nextFit.bins.length).toBeGreaterThanOrEqual(firstFit.bins.length)
        })

        it(`firstFit >= firstFitDecreasing (${dataName})`, function () {
          expect(firstFit.bins.length).toBeGreaterThanOrEqual(firstFitDecreasing.bins.length)
        })

        it(`firstFitDecreasing >= bestFitDecreasing (${dataName})`, function () {
          expect(firstFitDecreasing.bins.length)
              .toBeGreaterThanOrEqual(bestFitDecreasing.bins.length)
        })

        if (binCompletion) {
          it(`bestFitDecreasing >= binCompletion (${dataName})`, function () {
            expect(bestFitDecreasing.bins.length).toBeGreaterThanOrEqual(binCompletion.bins.length)
          })
        }

        it(`bestFitDecreasing >= optimal solution (${dataName})`, function () {
          expect(bestFitDecreasing.bins.length).toBeGreaterThanOrEqual(arbitrarySpec.optimalSize)
        })

        // Note: Exact algorithms are tested against the optimal solution in
        // exactAlgorithmShouldGetExactResult

        it(`firstFit length === nextFitVarCap length with constant capacity (${dataName})`, () => {
          expect(nextFit.bins.length).toEqual(nextFitVarCap.bins.length)
        })
        it(`firstFit bins identical to nextFitVarCap bins with constant capacity (${dataName})`,
            () => { expect(nextFit.bins).toEqual(nextFitVarCap.bins) }
        )

        it(`lowerBound1 <= lowerBound2 (${dataName})`, function () {
          expect(lowerBound1.bound).toBeLessThanOrEqual(lowerBound2.bound)
          expect(lowerBound1.oversized).toEqual(lowerBound2.oversized)
        })
      }

      function exactAlgorithmShouldGetExactResult(exactResult) {
        const algoName = exactResult.algorithm.name
            , dataName = exactResult.dataSpec.name
        it(`exact algorithm ${algoName} should get the optimal solution (${dataName})`, () => {
          expect(exactResult.result.bins).toHaveSize(exactResult.dataSpec.optimalSize)
        })
      }

      function lowerBoundLessOrEqualToFitResult(lowerBound, fitResult) {
        const bound = lowerBound.result
            , result = fitResult.result
            , dataName = fitResult.dataSpec.name
            , boundName = lowerBound.algorithm.name
            , fitName = fitResult.algorithm.name
        it(`lower bound ${boundName} should be <= fit result ${fitName} (${dataName})`, () => {
          expect(bound.bound).toBeLessThanOrEqual(result.bins.length)
          expect(bound.oversized).toEqual(result.oversized.length)
        })
      }

      function boundInvariants(lowerBound) {
        const bound = lowerBound.result.bound
            , dataName = lowerBound.dataSpec.name
            , boundName = lowerBound.algorithm.name
            , dataLength = lowerBound.dataSpec.dataLength
            , exactSize = lowerBound.dataSpec.optimalSize
        it(`bound ${boundName} > 0 (${dataName})`, function () {
          expect(bound).toBeGreaterThan(0)
        })

        it(`bound ${boundName} <= size of data (${dataName})`, function () {
          expect(bound).toBeLessThanOrEqual(dataLength)
        })

        it(`lower bound ${boundName} <= exact solution (${dataName})`, function () {
          expect(bound).toBeLessThanOrEqual(exactSize)
        })
      }

      let i = 0
      for (const spec of dataSpecs) {
        if (i < specsToRun) {
          ++i
          // allResults has type array<PackedResult>
          const allResults = allResultsFor(spec, algorithms)

          relativeNumberOfBins(allResults)

          for (const result of allResults) {
            if (AlgorithmType.isPacking(result.algorithm.type)) {

              resultChecks(result)
              if (AlgorithmType.VARCAP_PACKING !== result.algorithm.type) {
                resultCapacityChecks(result)
              }

              if (AlgorithmType.EXACT_PACKING === result.algorithm.type) {
                exactAlgorithmShouldGetExactResult(result)
              }
              // Check all lower bounds are less than this packing's size
              allResults
                  .filter(r => AlgorithmType.LOWER_BOUND === r.algorithm.type)
                  .forEach(lb => lowerBoundLessOrEqualToFitResult(lb, result))
            } else if (AlgorithmType.LOWER_BOUND === result.algorithm.type) {
              boundInvariants(result)
            }
          }
        }
      }
    })
  })

  describe('empty input', function () {
    function emptyInputToEmptyPacking(algorithm) {
      it(`should produce empty arrays (${algorithm.name})`, function () {
        // sizeOf and capacity are arbitrary
        const packing = algorithm.method([], itemIsSize, 100)
        expect(packing.bins).toHaveSize(0)
        expect(packing.oversized).toHaveSize(0)
      })
    }

    for (const algorithm of algorithms) {
      if (AlgorithmType.isPacking(algorithm.type)) {
        emptyInputToEmptyPacking(algorithm)
      }
    }
  })
})

describe('utils', function () {
  describe('sortDescending', function () {
    function sortOrder(dataSpec) {
      it(`should not sort a smaller value before a larger value ${dataSpec.name}`, function () {
        const sorted = utils.sortDescending(dataSpec.data.slice(), dataSpec.sizeOf)
        expect(sorted).toHaveSize(dataSpec.data.length)
        for (let i = 0; i < sorted.length - 1; ++i) {
          if (dataSpec.sizeOf(sorted[i]) < dataSpec.sizeOf(sorted[i + 1])) {
            fail(`size ${dataSpec.sizeOf(sorted[i])} at index ${i} < ` +
                `${dataSpec.sizeOf(sorted[i + 1])} at index ${i + 1}`)
          }
        }
      })
    }
    dataSpecs.forEach(spec => sortOrder(spec))
  })

  describe('sortAscending', function () {
    function sortOrder(dataSpec) {
      it(`should not sort a larger value before a smaller value ${dataSpec.name}`, function () {
        const sorted = utils.sortAscending(dataSpec.data.slice(), dataSpec.sizeOf)
        expect(sorted).toHaveSize(dataSpec.data.length)
        for (let i = 0; i < sorted.length - 1; ++i) {
          if (dataSpec.sizeOf(sorted[i]) > dataSpec.sizeOf(sorted[i + 1])) {
            fail(`size ${dataSpec.sizeOf(sorted[i])} at index ${i} > ` +
                `${dataSpec.sizeOf(sorted[i + 1])} at index ${i + 1}`)
          }
        }
      })
    }
    dataSpecs.forEach(spec => sortOrder(spec))
  })
})

describe('prepareValues', function () {
  describe('adaptToNumberIterable', function () {
    it('should adapt number to iterable', function () {
      const constantSeed = 300.123
      const iterableCapacity = prepareValues.adaptToNumberIterable(constantSeed)
      expect(prepareValues.isIterable(iterableCapacity)).toBeTrue()
      let i = 0
      for (const value of iterableCapacity) {
        if (i >= 1_000) {
          break
        }
        expect(value).toEqual(constantSeed)
        ++i
      }
    })
    it('should return iterable unchanged', function () {
      const iterable = {
        [Symbol.iterator]: function () {
          let i = 0
          return {
            next: function () {
              return {
                value: Math.random(),
                done: i++ < 100
              }
            }
          }
        }
      }
      expect(prepareValues.adaptToNumberIterable(iterable)).toBe(iterable)
    })
    it('should adapt generator to iterable', function () {
      const genFunc = function* () { yield Math.random() }
      expect(prepareValues.isIterable(prepareValues.adaptToNumberIterable(genFunc))).toBeTrue()
    })
    it('should not accept just any old function', function () {
      expect(() => prepareValues.adaptToNumberIterable(function () { return 2 }))
          .toThrowError('Capacity must be one of: number, iterable, or generator')
    })
  })
})


text:
import deferCSS from './src/deferCSS';
import deferFonts from './src/deferFonts';
import deferNoScript from './src/deferNoScript';
import inlineSVG from './src/inlineSVG';
import lazyload from './src/lazyload';

const easyPerf = {
  deferCSS,
  deferFonts,
  deferNoScript,
  inlineSVG,
  lazyload,
};

window.easyPerf = easyPerf;

export default easyPerf;
export { deferCSS, deferFonts, deferNoScript, inlineSVG, lazyload };

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Opulence\Databases\ConnectionPools;

use Opulence\Databases\Adapters\Pdo\MySql\Driver as MySqlDriver;
use Opulence\Databases\Adapters\Pdo\PostgreSql\Driver as PostgreSqlDriver;
use Opulence\Databases\IConnection;
use Opulence\Databases\IDriver;
use Opulence\Databases\Server;
use RuntimeException;

/**
 * Defines a database connection pool
 * This can handle multiple server setups or simple single server setups
 */
abstract class ConnectionPool
{
    /** @var array Maps driver names to their fully-qualified class names */
    public static $drivers = [
        'pdo_mysql' => MySqlDriver::class,
        'pdo_pgsql' => PostgreSqlDriver::class,
    ];
    /** @var array The servers in this pool */
    protected $servers = [
        'master' => [
            'server' => null,
            'connection' => null,
        ],
        'custom' => []
    ];
    /** @var IDriver The driver to use for connections made by this pool */
    protected $driver = null;
    /** @var array The list of connection options */
    protected $connectionOptions = [];
    /** @var array The list of driver options */
    protected $driverOptions = [];
    /** @var IConnection|null The connection to use for read queries */
    protected $readConnection = null;
    /** @var IConnection|null The connection to use for write queries */
    protected $writeConnection = null;

    /**
     * @param IDriver $driver The driver to use
     * @param Server $master The master server
     * @param array $driverOptions The setting to use to setup a driver
     * @param array $connectionOptions The driver-specific connection settings
     */
    public function __construct(
        IDriver $driver,
        Server $master,
        array $driverOptions = [],
        array $connectionOptions = []
    ) {
        $this->driver = $driver;
        $this->setMaster($master);
        $this->driverOptions = $driverOptions;
        $this->connectionOptions = $connectionOptions;
    }

    /**
     * Gets the list of pre-defined driver names available in this class
     *
     * @return array The list of driver names
     */
    public static function getDriverNames() : array
    {
        return array_keys(self::$drivers);
    }

    /**
     * @return IDriver
     */
    public function getDriver() : IDriver
    {
        return $this->driver;
    }

    /**
     * @return Server|null
     */
    public function getMaster()
    {
        return $this->servers['master']['server'];
    }

    /**
     * Gets the connection used for read queries
     *
     * @param ?Server $preferredServer The preferred server to use
     * @return IConnection The connection to use for reads
     * @throws RuntimeException Thrown if the connection pool wasn't configured correctly
     */
    public function getReadConnection(Server $preferredServer = null) : IConnection
    {
        if ($preferredServer !== null) {
            $this->addServer('custom', $preferredServer);
            $this->setReadConnection($preferredServer);
        } elseif ($this->readConnection == null) {
            $this->setReadConnection();
        }

        return $this->readConnection;
    }

    /**
     * Gets the connection used for write queries
     *
     * @param ?Server $preferredServer The preferred server to use
     * @return IConnection The connection to use for writes
     * @throws RuntimeException Thrown if the connection pool wasn't configured correctly
     */
    public function getWriteConnection(Server $preferredServer = null) : IConnection
    {
        if ($preferredServer != null) {
            $this->addServer('custom', $preferredServer);
            $this->setWriteConnection($preferredServer);
        } elseif ($this->writeConnection == null) {
            $this->setWriteConnection();
        }

        return $this->writeConnection;
    }

    /**
     * @param Server $master
     */
    public function setMaster(Server $master)
    {
        $this->addServer('master', $master);
    }

    /**
     * Sets the connection to use for read queries
     *
     * @param ?Server $preferredServer The preferred server to connect to
     * @throws RuntimeException Thrown if the connection pool wasn't configured correctly
     */
    abstract protected function setReadConnection(Server $preferredServer = null);

    /**
     * Sets the connection to use for write queries
     *
     * @param ?Server $preferredServer The preferred server to connect to
     * @throws RuntimeException Thrown if the connection pool wasn't configured correctly
     */
    abstract protected function setWriteConnection(Server $preferredServer = null);

    /**
     * Adds a server to our list of servers
     *
     * @param string $type The type of server we're trying to add, eg "master", "custom"
     * @param Server $server The server to add
     */
    protected function addServer(string $type, Server $server)
    {
        switch ($type) {
            case 'master':
                $this->servers['master'] = ['server' => $server, 'connection' => null];

                break;
            default:
                $serverHashId = spl_object_hash($server);

                if (!isset($this->servers[$type][$serverHashId])) {
                    $this->servers[$type][$serverHashId] = ['server' => $server, 'connection' => null];
                }

                break;
        }
    }

    /**
     * Creates a database connection
     *
     * @param Server $server The server to connect to
     * @return IConnection The database connection
     */
    protected function connectToServer(Server $server) : IConnection
    {
        return $this->driver->connect($server, $this->connectionOptions, $this->driverOptions);
    }

    /**
     * Gets a connection to the input server
     *
     * @param string $type The type of server we're trying to connect to, eg "master", "custom"
     * @param Server $server The server we want to connect to
     * @return IConnection The connection to the server
     * @throws RuntimeException Thrown if the connection pool wasn't configured correctly
     */
    protected function getConnection(string $type, Server $server) : IConnection
    {
        switch ($type) {
            case 'master':
                if ($this->servers['master']['server'] == null) {
                    throw new RuntimeException('No master specified');
                }

                if ($this->servers['master']['connection'] == null) {
                    $this->servers['master']['connection'] = $this->connectToServer($server);
                }

                return $this->servers['master']['connection'];
            default:
                $serverHashId = spl_object_hash($server);

                if (!isset($this->servers[$type][$serverHashId])
                    || empty($this->servers[$type][$serverHashId]['server'])
                ) {
                    throw new RuntimeException("Server of type '" . $type . "' not added to connection pool");
                }

                if (empty($this->servers[$type][$serverHashId]['connection'])) {
                    $this->servers[$type][$serverHashId]['connection'] = $this->connectToServer($server);
                }

                return $this->servers[$type][$serverHashId]['connection'];
        }
    }
}


text:
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#fragmentation">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">

Test passes if there is a filled green square and no red.


text:
"""Policy Engine For Glance"""

import copy

from oslo_config import cfg
from oslo_log import log as logging
from oslo_policy import policy

from clictest.common import exception
import clictest.domain.proxy
from clictest.i18n import _

LOG = logging.getLogger(__name__)
CONF = cfg.CONF

DEFAULT_RULES = policy.Rules.from_dict({
    'context_is_admin': 'role:admin',
    'default': '@',
    'manage_image_cache': 'role:admin',
})

class Enforcer(policy.Enforcer):
    """Responsible for loading and enforcing rules"""

    def __init__(self):
        if CONF.find_file(CONF.oslo_policy.policy_file):
            kwargs = dict(rules=None, use_conf=True)
        else:
            kwargs = dict(rules=DEFAULT_RULES, use_conf=False)
        super(Enforcer, self).__init__(CONF, overwrite=False, **kwargs)

    def add_rules(self, rules):
        """Add new rules to the Rules object"""
        self.set_rules(rules, overwrite=False, use_conf=self.use_conf)

    def enforce(self, context, action, target):
        """Verifies that the action is valid on the target in this context.

           :param context: Glance request context
           :param action: String representing the action to be checked
           :param target: Dictionary representing the object of the action.
           :raises: `glance.common.exception.Forbidden`
           :returns: A non-False value if access is allowed.
        """
        credentials = {
            'roles': context.roles,
            'user': context.user,
            'tenant': context.tenant,
        }
        return super(Enforcer, self).enforce(action, target, credentials,
                                             do_raise=True,
                                             exc=exception.Forbidden,
                                             action=action)

    def check(self, context, action, target):
        """Verifies that the action is valid on the target in this context.

           :param context: Glance request context
           :param action: String representing the action to be checked
           :param target: Dictionary representing the object of the action.
           :returns: A non-False value if access is allowed.
        """
        credentials = {
            'roles': context.roles,
            'user': context.user,
            'tenant': context.tenant,
        }
        return super(Enforcer, self).enforce(action, target, credentials)

    def check_is_admin(self, context):
        """Check if the given context is associated with an admin role,
           as defined via the 'context_is_admin' RBAC rule.

           :param context: Glance request context
           :returns: A non-False value if context role is admin.
        """
        return self.check(context, 'context_is_admin', context.to_dict())


text:
Reminders

Dr. Srinivas Murthy

Dr. Srinivas Murthy

                  Today at 12.15 pm

Last Appointments

Nothing to install. Just works out-of-box from all devices you
                    already use. Works from your laptop, desktop, iPad and Android devices.

 Find patient information before you begin consulting. Save prescriptions and patient history.

View details »

Make New Appointment

Call when you are free. At the appointment time, patient would be waiting but they
                    cannot make call to you. You will make call to them when you are ready. Of course,
                    please honor the appointment time as much as you can.

View details »

Find Doctors

Much better than Skype

See your patients from anywhere. Patients too would like to see doctors from anywhere.
                    Patients will not need somebody to accompany them

View details »


text:
{% extends "base.html" %}

{% block stylesheet %}
	<link rel="stylesheet" type="text/css" href="/static/stylesheets/portfolio.css">
{% endblock%}

{% block content %}

My Accomplishments

These are the noteworthy things I've worked on.

Apps

Bible iOS Developer

On more than 245 million devices around the world, people are reading, listening to, watching, and sharing the Bible using the #1 rated Bible App—completely free. Over 1,000 Bible versions, in hundreds of languages.

Mangrove Prayer Developer

The Mangrove Prayer App is designed to connect Christians individuals and Christian organizations together in prayer across a community, city, state, and nation.

Quakes - Earthquake Utility Developer & Designer

Quakes is an elegant earthquake utility. A simple easy to use interface will help you stay updated with the latest earthquake activity.

Doodler - Sticker Drawing Developer & Designer

Doodler is a simple way to bring your imaginations to life. Quickly sketch out ideas, or spend the time to carefully create a masterpiece. Your drawings can be shared and saved to show the world.

Whereabouts - Location Utility Developer & Designer

Whereabouts is an easy way to keep track of the places you visit. Whereabouts can utilize your phone's GPS to provide a information based upon your surroundings.

pong - Made for a Treehouse Contest Developer & Designer

Experience Pong at it's finest! Download this tribute to the old hit arcade game that revolutionized the gaming industry. Compete with the world over GameCenter for glory and fame!

Wiggly Piggly Developer & Designer

Ever heard of the saying "When pigs fly". Well now its up to you to see how far you can get. Avoid the massive slices of bacon by tapping your finger against your screen. Remember to have fun!

Writing

UIGestureRecognizer Tutorial: Getting Started Tutorial Update

In this tutorial, you'll learn how to configure UIGestureRecognizer objects and how to create custom recognizers in code.

HEIC Image Compression for iOS Tutorial Author

In this HEIC image compression tutorial, you'll learn how to transform images into HEIC and JPEG formats, comparing their efficiency for optimum performance.

iOS File Provider Extension Tutorial Tutorial Author

In this tutorial, you will learn about the File Provider framework and how to implement your own File Provider extension to expose your app's own content.

Game Center for iOS: Building a Turn-Based Game Tutorial Author

In this tutorial, you'll learn about authentication with Game Center and how its turn-based mechanics work. In the end, you'll have the foundations of how to integrate a multiplayer game with GameCenter.

Firebase Tutorial: Real-time Chat Tutorial Update

It seems like every major app out there has a chat feature. This tutorial shows you how to build a chat app with Firebase and MessageKit!

Basic iOS Security: Keychain and Hashing Tutorial Author

One of the most important aspects of software development also happens to be considered one of the most mysterious and scary (and is thus avoided like the plague): application security.

Auto Layout Tutorial in iOS 11: Getting Started Tutorial Update

Have you ever been frustrated trying to make your apps look good in both portrait and landscape orientation? Is making screen layouts that support both the iPhone and iPad driving you to the brink of madness?

GameplayKit Tutorial: Entity-Component System, Agents, Goals, and Behaviors Tutorial Update

In this GameplayKit tutorial, you will learn how to create flexible and scalable games by using the Entity-Component system with Agents, Goals and Behaviors.

GameplayKit Tutorial: Artificial Intelligence Tutorial Author

In this tutorial, you'll learn how to implement artificial intelligence (AI) in a SpriteKit game using GameplayKit and Swift.

How to Make a Game Like Can Knockdown Tutorial Author

Learn how to make a game like Can Knockdown using SceneKit and Swift.

How To Make a Game Like Space Invaders with Sprite Kit and Swift Tutorial Tutorial Update

Learn how to make a game like Space Invaders using Apple's built-in 2D game framework: Sprite Kit!

Talks

Techlahoma CocoaHeads OKC The Keys to iOS Security

In this talk I covered the foundations security on iOS. This included securely saving data to the Keychain, the best practices for hashing private information, and how to incorporate biometrics.

RWDevCon 2017 iMessage Apps

My first public talk that I gave at RWDevCon about iMessages apps. Read about my experience giving my first conference talk...

Open Source

VisualActivityViewController

The goal of this project is to show a small preview of what's being shared to other apps.

RAScrollablePickerView

Simple HSB color picker view in Swift.

{% endblock %}


text:
<?php

namespace EzMail\Exception;

interface ExceptionInterface
{
}


text:
package com.peacecraftec.bukkit.economy.command;

import com.peacecraftec.bukkit.economy.EconomyPermissions;
import com.peacecraftec.bukkit.economy.PeacecraftEconomy;
import com.peacecraftec.bukkit.economy.core.EconomyPlayer;
import com.peacecraftec.bukkit.economy.core.EconomyWorld;
import com.peacecraftec.module.cmd.Command;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import static com.peacecraftec.bukkit.internal.util.SenderUtil.getDisplayName;
import static com.peacecraftec.bukkit.internal.util.SenderUtil.matchPlayer;
import static com.peacecraftec.bukkit.internal.util.SenderUtil.sendMessage;
import static com.peacecraftec.bukkit.internal.util.SenderUtil.sendUsage;

public class EconomyCommands {

    private PeacecraftEconomy module;

    public EconomyCommands(PeacecraftEconomy module) {
        this.module = module;
    }

    @Command(aliases = {"economy", "eco"}, desc = "economy.command.economy", usage = "<give/take/set> <player> <amount>", min = 3, permission = EconomyPermissions.MANAGE)
    public void eco(CommandSender sender, String command, String[] args) {
        if(args[0].equalsIgnoreCase("give") || args[0].equalsIgnoreCase("take") || args[0].equalsIgnoreCase("set")) {
            String w = sender instanceof Player ? ((Player) sender).getWorld().getName() : this.module.getManager().getDefaultWorld();
            UUID uuid = Bukkit.getOfflinePlayer(args[1]).getUniqueId();

            EconomyWorld world = this.module.getEcoManager().getWorld(w);
            EconomyPlayer player = world.getPlayer(uuid);
            if(player == null) {
                sendMessage(sender, "economy.player-not-found");
                return;
            }

            double amount = 0;
            try {
                amount = Double.parseDouble(args[2]);
            } catch(NumberFormatException e) {
                sendMessage(sender, "economy.invalid-amount");
                return;
            }

            if(amount < 0) {
                sendMessage(sender, "economy.negative");
                return;
            }

            String formatted = this.module.getEcoManager().format(amount);
            String displayName = getDisplayName(uuid, w);
            if(args[0].equalsIgnoreCase("give")) {
                player.addBalance(amount);
                sendMessage(sender, "economy.add-to-account", formatted, displayName);
            } else if(args[0].equalsIgnoreCase("take")) {
                player.removeBalance(amount);
                sendMessage(sender, "economy.remove-from-account", formatted, displayName);
            } else if(args[0].equalsIgnoreCase("set")) {
                player.setBalance(amount);
                sendMessage(sender, "economy.set-balance", formatted, displayName);
            }
        } else {
            sendUsage(sender, command, "<give/take/set> <player> <amount>");
        }
    }

    @Command(aliases = {"balance", "bal", "money"}, desc = "economy.command.balance", usage = "[player]", permission = EconomyPermissions.BALANCE)
    public void balance(CommandSender sender, String command, String[] args) {
        Player player = null;
        if(args.length > 0) {
            if(!sender.hasPermission(EconomyPermissions.BALANCE_OTHERS)) {
                sendMessage(sender, "economy.noperm-other-balance");
                return;
            }

            List<Player> players = matchPlayer(args[0]);
            if(players.size() == 0) {
                sendMessage(sender, "internal.player-not-found");
                return;
            } else if(players.size() > 1) {
                sendMessage(sender, "internal.multiple-players");
                return;
            } else {
                player = players.get(0);
            }
        } else {
            if(!(sender instanceof Player)) {
                sendMessage(sender, "internal.cannot-use-command");
                return;
            }

            player = (Player) sender;
        }

        String w = sender instanceof Player ? ((Player) sender).getWorld().getName() : this.module.getManager().getDefaultWorld();
        EconomyWorld world = this.module.getEcoManager().getWorld(w);
        EconomyPlayer p = world.getPlayer(player.getUniqueId());
        if(p == null) {
            sendMessage(sender, "internal.player-not-found");
            return;
        }

        sendMessage(sender, "economy.balance", getDisplayName(player), this.module.getEcoManager().format(p.getBalance()));
    }

    @Command(aliases = {"pay"}, desc = "economy.command.pay", usage = "<player> <amount>", min = 2, permission = EconomyPermissions.PAY, console = false, commandblock = false)
    public void pay(CommandSender sender, String command, String[] args) {
        EconomyWorld world = this.module.getEcoManager().getWorld(((Player) sender).getWorld().getName());
        EconomyPlayer from = world.getPlayer(((Player) sender).getUniqueId());

        OfflinePlayer playerto = null;
        List<Player> players = matchPlayer(args[0]);
        if(players.size() == 0) {
            playerto = Bukkit.getOfflinePlayer(args[0]);
        } else if(players.size() > 1) {
            sendMessage(sender, "internal.multiple-players");
            return;
        } else {
            playerto = players.get(0);
        }

        double amount = 0;
        try {
            amount = Double.parseDouble(args[1]);
            if((double) Math.round(amount * 100) / 100 == 0) {
                sendMessage(sender, "economy.invalid-amount");
                return;
            }
        } catch(NumberFormatException e) {
            sendMessage(sender, "economy.invalid-amount");
            return;
        }

        if(amount < 0) {
            sendMessage(sender, "economy.negative");
            return;
        }

        if(from.getBalance() < amount) {
            sendMessage(sender, "economy.not-enough-money");
            return;
        }

        world.getPlayer(playerto.getUniqueId()).addBalance(amount);
        from.removeBalance(amount);
        sendMessage(sender, "economy.sent-money", this.module.getEcoManager().format(amount), getDisplayName(playerto.getUniqueId(), ((Player) sender).getWorld().getName()));
        if(playerto instanceof Player) {
            sendMessage((Player) playerto, "economy.received-money", this.module.getEcoManager().format(amount), ChatColor.RESET + getDisplayName(sender));
        }
    }

    @Command(aliases = {"sell"}, desc = "economy.command.sell", usage = "<item/mainhand/offhand> [quantity]", min = 1, permission = EconomyPermissions.SELL, console = false, commandblock = false)
    public void sell(CommandSender sender, String command, String[] args) {
        Player player = (Player) sender;
        EconomyPlayer eco = this.module.getEcoManager().getWorld(player.getWorld().getName()).getPlayer(player.getUniqueId());
        boolean mainhand = false;
        boolean offhand = false;
        Material mat;
        if(args[0].equalsIgnoreCase("mainhand")) {
            mainhand = true;
            mat = player.getInventory().getItemInMainHand().getType();
            if(mat == Material.AIR) {
                sendMessage(sender, "economy.cant-sell-air");
                return;
            }
        } else if(args[0].equalsIgnoreCase("offhand")) {
            offhand = true;
            mat = player.getInventory().getItemInOffHand().getType();
            if(mat == Material.AIR) {
                sendMessage(sender, "economy.cant-sell-air");
                return;
            }
        } else {
            mat = Material.matchMaterial(args[0]);
            if(mat == null) {
                sendMessage(sender, "economy.invalid-item");
                return;
            }

            if(!player.getInventory().contains(mat)) {
                sendMessage(sender, "economy.none-to-sell");
                return;
            }
        }

        if(!this.module.getEcoManager().hasWorth(mat.name().toLowerCase())) {
            sendMessage(sender, "economy.cannot-sell");
            return;
        }

        double cost = this.module.getEcoManager().getWorth(mat.name().toLowerCase());
        int amount = -1;
        if(args.length > 1) {
            try {
                amount = Integer.parseInt(args[1]);
            } catch(NumberFormatException e) {
                sendMessage(sender, "economy.invalid-amount");
                return;
            }

            if(amount < 0) {
                sendMessage(sender, "economy.invalid-amount");
                return;
            }
        }

        if(mainhand) {
            ItemStack item = player.getInventory().getItemInMainHand();
            if(amount == -1) {
                amount = item.getAmount();
            }

            if(item.getAmount() < amount) {
                sendMessage(sender, "economy.not-enough-item");
                return;
            }

            cost *= amount;
            if(item.getAmount() == amount) {
                player.getInventory().setItemInMainHand(null);
            } else {
                item.setAmount(item.getAmount() - amount);
                player.getInventory().setItemInMainHand(item);
            }
        } else if(offhand) {
            ItemStack item = player.getInventory().getItemInOffHand();
            if(amount == -1) {
                amount = item.getAmount();
            }

            if(item.getAmount() < amount) {
                sendMessage(sender, "economy.not-enough-item");
                return;
            }

            cost *= amount;
            if(item.getAmount() == amount) {
                player.getInventory().setItemInOffHand(null);
            } else {
                item.setAmount(item.getAmount() - amount);
                player.getInventory().setItemInOffHand(item);
            }
        } else {
            int total = 0;
            Map<Integer, ? extends ItemStack> items = player.getInventory().all(mat);
            for(ItemStack item : items.values()) {
                total += item.getAmount();
            }

            if(amount == -1) {
                amount = total;
            }

            if(amount > total) {
                sendMessage(sender, "economy.not-enough-item");
                return;
            }

            cost *= amount;
            int remaining = amount;
            for(int slot : items.keySet()) {
                ItemStack item = items.get(slot);
                if(remaining < item.getAmount()) {
                    item.setAmount(item.getAmount() - remaining);
                    remaining = 0;
                    break;
                } else if(remaining == item.getAmount()) {
                    player.getInventory().setItem(slot, null);
                    remaining = 0;
                    break;
                } else {
                    player.getInventory().setItem(slot, null);
                    remaining -= item.getAmount();
                }
            }
        }

        eco.addBalance(cost);
        sendMessage(sender, "economy.sold-item", amount, mat.name() + (amount > 1 ? "s" : ""), this.module.getEcoManager().format(cost));
    }

    @Command(aliases = {"iteminfo"}, desc = "economy.command.iteminfo", usage = "[name/mainhand/offhand]", permission = EconomyPermissions.ITEM_INFO)
    public void iteminfo(CommandSender sender, String command, String[] args) {
        Material mat;
        if(args.length == 0 || args[0].equalsIgnoreCase("mainhand")) {
            if(!(sender instanceof Player)) {
                sendMessage(sender, "internal.cannot-use-command");
                return;
            }

            mat = ((Player) sender).getInventory().getItemInMainHand().getType();
        } else if(args[0].equalsIgnoreCase("offhand")) {
            if(!(sender instanceof Player)) {
                sendMessage(sender, "internal.cannot-use-command");
                return;
            }

            mat = ((Player) sender).getInventory().getItemInOffHand().getType();
        } else {
            mat = Material.matchMaterial(args[0]);
        }

        if(mat == null) {
            sendMessage(sender, "economy.invalid-item");
            return;
        }

        sendMessage(sender, "economy.iteminfo-name", mat.name());
    }

    @Command(aliases = {"balancetop", "baltop", "moneytop"}, desc = "economy.command.balancetop", permission = EconomyPermissions.BALANCE)
    public void balancetop(CommandSender sender, String command, String[] args) {
        String w = sender instanceof Player ? ((Player) sender).getWorld().getName() : this.module.getManager().getDefaultWorld();
        EconomyWorld world = this.module.getEcoManager().getWorld(w);
        List<EconomyPlayer> players = world.getPlayers();
        players.sort((p1, p2) -> Double.compare(p2.getBalance(), p1.getBalance()));

        sendMessage(sender, "economy.top-ten-header");
        for(int count = 0; count < Math.min(10, players.size()); count++) {
            EconomyPlayer player = players.get(count);
            sendMessage(sender, getDisplayName(player.getUniqueId(), w) + ChatColor.GOLD + " - " + ChatColor.GRAY + this.module.getEcoManager().format(player.getBalance()));
        }
    }
}


text:
package com.klisly.bookbox.subscriber;

import android.content.Context;

import com.google.gson.JsonParseException;
import com.klisly.bookbox.BookBoxApplication;
import com.klisly.bookbox.R;
import com.klisly.bookbox.utils.RxUtils;
import com.klisly.bookbox.widget.progress.ProgressCancelListener;
import com.klisly.bookbox.widget.progress.ProgressDialogHandler;

import org.json.JSONException;
import org.json.JSONObject;

import java.net.ConnectException;
import java.net.SocketTimeoutException;

import retrofit2.adapter.rxjava.HttpException;
import rx.Subscriber;
import timber.log.Timber;

public abstract class AbsSubscriber<T> extends Subscriber<T> implements ProgressCancelListener {

    //对应HTTP的状态码
    private static final int INVALIDPARAM = 400; // 参数异常
    private static final int UNAUTHORIZED = 401; // 未授权
    private static final int FORBIDDEN = 403; // 无权限
    private static final int NOT_FOUND = 404;
    private static final int REQUEST_TIMEOUT = 408;
    private static final int INTERNAL_SERVER_ERROR = 500;
    private static final int BAD_GATEWAY = 502;
    private static final int SERVICE_UNAVAILABLE = 503;
    private static final int GATEWAY_TIMEOUT = 504;

    private ProgressDialogHandler mProgressDialogHandler;

    private boolean showProgress = true;
    private boolean inMainThread = true;
    //出错提示
    // private final String networkMsg;
    // private final String parseMsg;
    private final String unknownMsg = BookBoxApplication.getInstance().getString(R.string.unknown_error);

    public AbsSubscriber(Context context) {
        mProgressDialogHandler = new ProgressDialogHandler(context, this, true);
    }

    public AbsSubscriber(Context context , boolean isShowProgress) {
        showProgress = isShowProgress;
        if(showProgress){
            mProgressDialogHandler = new ProgressDialogHandler(context, this, true);
        }
    }

    public AbsSubscriber(Context context , boolean isShowProgress, boolean inMainThread) {
        showProgress = isShowProgress;
        this.inMainThread = inMainThread;
        if(showProgress){
            mProgressDialogHandler = new ProgressDialogHandler(context, this, true);
        }
    }

    @Override
    public void onError(Throwable e) {
        e.printStackTrace();
        dismissProgressDialog();
        Throwable throwable = e;
        //获取最根源的异常
        while(throwable.getCause() != null){
            e = throwable;
            throwable = throwable.getCause();
        }
        ApiException ex;
        if (e instanceof HttpException){             //HTTP错误
            HttpException httpException = (HttpException) e;
            ex = new ApiException(e, httpException.code());
            try {
                String str = httpException.response().errorBody().string();
                JSONObject jsonObject = new JSONObject(str);
                int status = jsonObject.getInt("status");
                ex.setCode(status);
                if(jsonObject.has("msg")){
                    ex.setMessage(jsonObject.getString("msg"));
                }
            } catch (Exception e1) {
                ex.setCode(SERVICE_UNAVAILABLE);
            }
            switch(httpException.code()){
                case UNAUTHORIZED:
                    onPermissionError(ex);          //权限错误,需要实现
                    break;
                case FORBIDDEN:
                case INVALIDPARAM:
                case NOT_FOUND:
                case REQUEST_TIMEOUT:
                    onError(ex);
                    break;
                case GATEWAY_TIMEOUT:
                case INTERNAL_SERVER_ERROR:
                case BAD_GATEWAY:
                case SERVICE_UNAVAILABLE:
                default:
                    ex.setMessage(BookBoxApplication.getInstance().getString(R.string.net_error));  //均视为网络错误
                    onError(ex);
                    break;
            }
        } else if (e instanceof SocketTimeoutException
                || e instanceof ConnectException) {
            ex = new ApiException(e, ApiException.UNKNOWN);
            ex.setMessage(BookBoxApplication.getInstance().getString(R.string.net_disconnect));  //均视为网络错误
            onError(ex);
        }else if (e instanceof JsonParseException
                || e instanceof JSONException){
            ex = new ApiException(e, ApiException.PARSE_ERROR);
            ex.setMessage(BookBoxApplication.getInstance().getString(R.string.parse_error));            //均视为解析错误
            onError(ex);
        } else {
            ex = new ApiException(e, ApiException.UNKNOWN);
            ex.setMessage(unknownMsg);          //未知错误
            onError(ex);
        }
    }

    /**
     * 错误回调
     */
    protected abstract void onError(ApiException ex);

    /**
     * 权限错误,需要实现重新登录操作
     */
    protected abstract void onPermissionError(ApiException ex);

    @Override
    public void onStart() {
        super.onStart();
        showProgressDialog();
    }

    @Override
    public void onCompleted() {
        dismissProgressDialog();
    }

    private void showProgressDialog(){
        if (mProgressDialogHandler != null && showProgress) {
            mProgressDialogHandler.obtainMessage(ProgressDialogHandler.SHOW_PROGRESS_DIALOG).sendToTarget();
        }
    }

    private void dismissProgressDialog(){
        if (mProgressDialogHandler != null && showProgress) {
            mProgressDialogHandler.obtainMessage(ProgressDialogHandler.DISMISS_PROGRESS_DIALOG).sendToTarget();
        }
    }

    @Override
    public void onCancelProgress() {
        RxUtils.unsubscribe(this);
    }

}


text:
package org.apache.hadoop.raid;

import java.io.OutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;

import org.apache.hadoop.mapreduce.Mapper.Context;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.BlockMissingException;
import org.apache.hadoop.fs.ChecksumException;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.protocol.Block;
import org.apache.hadoop.raid.StripeStore.StripeInfo;
import org.apache.hadoop.util.Progressable;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadFactory;
import java.util.zip.CRC32;

public class ReedSolomonDecoder extends Decoder {
  public static final Log LOG = LogFactory.getLog(
                                  "org.apache.hadoop.raid.ReedSolomonDecoder");
  private ErasureCode[] reedSolomonCode;
  private long decodeTime;
  private long waitTime;
  ExecutorService parallelDecoder;
  Semaphore decodeOps;
  private int stripeSize;
  private int paritySize;

  public ReedSolomonDecoder(
    Configuration conf) {
    super(conf, Codec.getCodec("rs"));
    this.reedSolomonCode = new ReedSolomonCode[parallelism];
    stripeSize = this.codec.stripeLength;
    paritySize = this.codec.parityLength;
    for (int i = 0; i < parallelism; i++) {
      reedSolomonCode[i] = new ReedSolomonCode(stripeSize, paritySize);
    }
    decodeOps = new Semaphore(parallelism);
  }

  @Override
  protected long fixErasedBlockImpl(
      FileSystem fs, Path srcFile,
      FileSystem parityFs, Path parityFile, boolean fixSource,
       long blockSize, long errorOffset, long limit,  boolean
       partial, OutputStream out, Context context, CRC32 crc,
       StripeInfo si, boolean recoverFromStripeStore, Block lostBlock)
           throws IOException {

    Progressable reporter = context;
    if (reporter == null) {
      reporter = RaidUtils.NULL_PROGRESSABLE;
    }

    if (partial) {
      throw new IOException ("We don't support partial reconstruction");
    }

    long start = System.currentTimeMillis();
    FSDataInputStream[] inputs = new FSDataInputStream[stripeSize + paritySize];
    int[] erasedLocations = buildInputs(fs, srcFile, parityFs, parityFile,
                                        fixSource, errorOffset, inputs);
    int erasedLocationToFix;
    if (fixSource) {
      int blockIdxInStripe = ((int)(errorOffset/blockSize)) % stripeSize;
      erasedLocationToFix = paritySize + blockIdxInStripe;
    } else {
      // generate the idx for parity fixing.
      int blockIdxInStripe = ((int)(errorOffset/blockSize)) % paritySize;
      erasedLocationToFix = blockIdxInStripe;
    }

    // Allows network reads to go on while decode is going on.
    int boundedBufferCapacity = 2;
    ThreadFactory reedSolomonDecoderFactory = new ThreadFactoryBuilder()
      .setNameFormat("ReedSolomonDecoder-%d")
      .build();
    parallelDecoder = Executors.newFixedThreadPool(parallelism, reedSolomonDecoderFactory);
    ParallelStreamReader parallelReader = new ParallelStreamReader(
      reporter, inputs, bufSize, parallelism, boundedBufferCapacity, blockSize);
    parallelReader.start();
    decodeTime = 0;
    waitTime = 0;
    try {
      return writeFixedBlock(inputs, erasedLocations, erasedLocationToFix,
                      limit, out, reporter, parallelReader, crc);
    } finally {
      // Inputs will be closed by parallelReader.shutdown().
      parallelReader.shutdown();
      LOG.info("Time spent in read " + parallelReader.readTime +
        ", decode " + decodeTime + ", wait " + waitTime + ", delay " +
          (System.currentTimeMillis() - start));
      parallelDecoder.shutdownNow();
    }
  }

  protected int[] buildInputs(FileSystem fs, Path srcFile,
                              FileSystem parityFs, Path parityFile,
                              boolean fixSource,
                              long errorOffset, FSDataInputStream[] inputs)
      throws IOException {
    LOG.info("Building inputs to recover block starting at " + errorOffset);
    try {
      FileStatus srcStat = fs.getFileStatus(srcFile);
      FileStatus parityStat = parityFs.getFileStatus(parityFile);
      long blockSize = srcStat.getBlockSize();
      long blockIdx = (int)(errorOffset / blockSize);
      long stripeIdx;
      if (fixSource) {
        stripeIdx = blockIdx / stripeSize;
      } else {
        stripeIdx = blockIdx / paritySize;
      }

      LOG.info("FileSize = " + srcStat.getLen() + ", blockSize = " + blockSize +
               ", blockIdx = " + blockIdx + ", stripeIdx = " + stripeIdx);
      ArrayList<Integer> erasedLocations = new ArrayList<Integer>();
      // First open streams to the parity blocks.
      for (int i = 0; i < paritySize; i++) {
        long offset = blockSize * (stripeIdx * paritySize + i);
        if ((!fixSource) && offset == errorOffset) {
          LOG.info(parityFile + ":" + offset +
              " is known to have error, adding zeros as input " + i);
          inputs[i] = new FSDataInputStream(new RaidUtils.ZeroInputStream(
                offset + blockSize));
          erasedLocations.add(i);
        } else if (offset > parityStat.getLen()) {
          LOG.info(parityFile + ":" + offset +
                   " is past file size, adding zeros as input " + i);
          inputs[i] = new FSDataInputStream(new RaidUtils.ZeroInputStream(
              offset + blockSize));
        } else {
          FSDataInputStream in = parityFs.open(
              parityFile, conf.getInt("io.file.buffer.size", 64 * 1024));
          in.seek(offset);
          LOG.info("Adding " + parityFile + ":" + offset + " as input " + i);
          inputs[i] = in;
        }
      }
      // Now open streams to the data blocks.
      for (int i = paritySize; i < paritySize + stripeSize; i++) {
        long offset = blockSize * (stripeIdx * stripeSize + i - paritySize);
        if (fixSource && offset == errorOffset) {
          LOG.info(srcFile + ":" + offset +
              " is known to have error, adding zeros as input " + i);
          inputs[i] = new FSDataInputStream(new RaidUtils.ZeroInputStream(
              offset + blockSize));
          erasedLocations.add(i);
        } else if (offset > srcStat.getLen()) {
          LOG.info(srcFile + ":" + offset +
                   " is past file size, adding zeros as input " + i);
          inputs[i] = new FSDataInputStream(new RaidUtils.ZeroInputStream(
              offset + blockSize));
        } else {
          FSDataInputStream in = fs.open(
            srcFile, conf.getInt("io.file.buffer.size", 64 * 1024));
          in.seek(offset);
          LOG.info("Adding " + srcFile + ":" + offset + " as input " + i);
          inputs[i] = in;
        }
      }
      if (erasedLocations.size() > paritySize) {
        String msg = "Too many erased locations: " + erasedLocations.size();
        LOG.error(msg);
        throw new IOException(msg);
      }
      int[] locs = new int[erasedLocations.size()];
      for (int i = 0; i < locs.length; i++) {
        locs[i] = erasedLocations.get(i);
      }
      return locs;
    } catch (IOException e) {
      RaidUtils.closeStreams(inputs);
      throw e;
    }

  }

  /**
   * Decode the inputs provided and write to the output.
   * @param inputs array of inputs.
   * @param erasedLocations indexes in the inputs which are known to be erased.
   * @param erasedLocationToFix index in the inputs which needs to be fixed.
   * @param limit maximum number of bytes to be written.
   * @param out the output.
   * @return size of recovered bytes
   * @throws IOException
   */
  long writeFixedBlock(
          FSDataInputStream[] inputs,
          int[] erasedLocations,
          int erasedLocationToFix,
          long limit,
          OutputStream out,
          Progressable reporter,
          ParallelStreamReader parallelReader, CRC32 crc) throws IOException {

    LOG.info("Need to write " + limit +
             " bytes for erased location index " + erasedLocationToFix);
    if (crc != null) {
      crc.reset();
    }
    int[] tmp = new int[inputs.length];
    int[] decoded = new int[erasedLocations.length];
    // Loop while the number of written bytes is less than the max.
    long written;
    for (written = 0; written < limit; ) {
      erasedLocations = readFromInputs(
        inputs, erasedLocations, limit, reporter, parallelReader);
      if (decoded.length != erasedLocations.length) {
        decoded = new int[erasedLocations.length];
      }

      int toWrite = (int)Math.min((long)bufSize, limit - written);
      int partSize = (int) Math.ceil(bufSize * 1.0 / parallelism);

      try {
        long startTime = System.currentTimeMillis();
        for (int i = 0; i < parallelism; i++) {
          decodeOps.acquire(1);
          int start = i * partSize;
          int count = Math.min(bufSize - start, partSize);
          parallelDecoder.execute(new DecodeOp(
            readBufs, writeBufs, start, count,
            erasedLocations, reedSolomonCode[i]));
        }
        decodeOps.acquire(parallelism);
        decodeOps.release(parallelism);
        decodeTime += (System.currentTimeMillis() - startTime);
      } catch (InterruptedException e) {
        throw new IOException("Interrupted while waiting for read result");
      }

      for (int i = 0; i < erasedLocations.length; i++) {
        if (erasedLocations[i] == erasedLocationToFix) {
          out.write(writeBufs[i], 0, toWrite);
          if (crc != null) {
            crc.update(writeBufs[i], 0, toWrite);
          }
          written += toWrite;
          break;
        }
      }
    }
    return written;
  }

  int[] readFromInputs(
          FSDataInputStream[] inputs,
          int[] erasedLocations,
          long limit,
          Progressable reporter,
          ParallelStreamReader parallelReader) throws IOException {
    ParallelStreamReader.ReadResult readResult;
    try {
      long start = System.currentTimeMillis();
      readResult = parallelReader.getReadResult();
      waitTime += (System.currentTimeMillis() - start);
    } catch (InterruptedException e) {
      throw new IOException("Interrupted while waiting for read result");
    }

    // Process io errors, we can tolerate upto paritySize errors.
    for (int i = 0; i < readResult.ioExceptions.length; i++) {
      IOException e = readResult.ioExceptions[i];
      if (e == null) {
        continue;
      }
      if (e instanceof BlockMissingException) {
        LOG.warn("Encountered BlockMissingException in stream " + i);
      } else if (e instanceof ChecksumException) {
        LOG.warn("Encountered ChecksumException in stream " + i);
      } else {
        throw e;
      }

      // Found a new erased location.
      if (erasedLocations.length == paritySize) {
        String msg = "Too many read errors";
        LOG.error(msg);
        throw new IOException(msg);
      }

      // Add this stream to the set of erased locations.
      int[] newErasedLocations = new int[erasedLocations.length + 1];
      for (int j = 0; j < erasedLocations.length; j++) {
        newErasedLocations[j] = erasedLocations[j];
      }
      newErasedLocations[newErasedLocations.length - 1] = i;
      erasedLocations = newErasedLocations;
    }
    readBufs = readResult.readBufs;
    return erasedLocations;
  }

  class DecodeOp implements Runnable {
    byte[][] readBufs;
    byte[][] writeBufs;
    int startIdx;
    int count;
    int[] erasedLocations;
    int[] tmpInput;
    int[] tmpOutput;
    ErasureCode rs;
    DecodeOp(byte[][] readBufs, byte[][] writeBufs,
             int startIdx, int count, int[] erasedLocations,
             ErasureCode rs) {
      this.readBufs = readBufs;
      this.writeBufs = writeBufs;
      this.startIdx = startIdx;
      this.count = count;
      this.erasedLocations = erasedLocations;
      this.tmpInput = new int[readBufs.length];
      this.tmpOutput = new int[erasedLocations.length];
      this.rs = rs;
    }

    public void run() {
      try {
        performDecode();
      } finally {
        decodeOps.release();
      }
    }

    private void performDecode() {
      for (int idx = startIdx; idx < startIdx + count; idx++) {
        for (int i = 0; i < tmpOutput.length; i++) {
          tmpOutput[i] = 0;
        }
        for (int i = 0; i < tmpInput.length; i++) {
          tmpInput[i] = readBufs[i][idx] & 0x000000FF;
        }
        rs.decode(tmpInput, erasedLocations, tmpOutput);
        for (int i = 0; i < tmpOutput.length; i++) {
          writeBufs[i][idx] = (byte)tmpOutput[i];
        }
      }
    }
  }

}


text:
package com.dumptruckman.minecraft.actionmenu2.api.event;

import com.dumptruckman.minecraft.actionmenu2.api.MenuModel;

public class MenuEvent {

    public final static int CONTENTS_CHANGED = 0;
    public final static int CONTENTS_ADDED = 1;
    public final static int CONTENTS_REMOVED = 2;
    public final static int SELECTION_CHANGED = 3;

    private MenuModel model;
    private int type;
    private int index0;
    private int index1;

    public MenuEvent(MenuModel model, int type, int index0, int index1) {
        this.model = model;
        this.type = type;
        this.index0 = index0;
        this.index1 = index1;
    }

    public MenuModel getModel() {
        return this.model;
    }

    public int getType() {
        return this.type;
    }

    public int getIndex0() {
        return this.index0;
    }

    public int getIndex1() {
        return this.index1;
    }
}


text:
$def with (strings, current_image, next_image, prev_image)

$var title:photos

Photoalbum

$strings["previous photo"]

            $if current_image is not None:

            $if current_image is None:

$strings["noimage"]

$strings["next photo"]


text:
.class Landroid/widget/AbsListView$FlingRunnable;
.super Ljava/lang/Object;
.source "AbsListView.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/widget/AbsListView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "FlingRunnable"
.end annotation

# static fields
.field private static final FLYWHEEL_TIMEOUT:I = 0x28

# instance fields
.field private final mCheckFlywheel:Ljava/lang/Runnable;

.field private mLastFlingY:I

.field private final mScroller:Landroid/widget/OverScroller;

.field final synthetic this$0:Landroid/widget/AbsListView;

# direct methods
.method constructor <init>(Landroid/widget/AbsListView;)V
    .locals 2
    .parameter

    .prologue
    .line 3961
    iput-object p1, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 3935
    new-instance v0, Landroid/widget/AbsListView$FlingRunnable$1;

    invoke-direct {v0, p0}, Landroid/widget/AbsListView$FlingRunnable$1;-><init>(Landroid/widget/AbsListView$FlingRunnable;)V

    iput-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mCheckFlywheel:Ljava/lang/Runnable;

    .line 3962
    new-instance v0, Landroid/widget/OverScroller;

    invoke-virtual {p1}, Landroid/widget/AbsListView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/OverScroller;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    .line 3963
    return-void
.end method

.method static synthetic access$1000(Landroid/widget/AbsListView$FlingRunnable;)Landroid/widget/OverScroller;
    .locals 1
    .parameter "x0"

    .prologue
    .line 3924
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    return-object v0
.end method

# virtual methods
.method edgeReached(I)V
    .locals 6
    .parameter "delta"

    .prologue
    .line 4007
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    iget-object v3, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mScrollY:I
    invoke-static {v3}, Landroid/widget/AbsListView;->access$1600(Landroid/widget/AbsListView;)I

    move-result v3

    const/4 v4, 0x0

    iget-object v5, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v5, v5, Landroid/widget/AbsListView;->mOverflingDistance:I

    invoke-virtual {v2, v3, v4, v5}, Landroid/widget/OverScroller;->notifyVerticalEdgeReached(III)V

    .line 4008
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->getOverScrollMode()I

    move-result v0

    .line 4009
    .local v0, overscrollMode:I
    if-eqz v0, :cond_0

    const/4 v2, 0x1

    if-ne v0, v2, :cond_3

    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #calls: Landroid/widget/AbsListView;->contentFits()Z
    invoke-static {v2}, Landroid/widget/AbsListView;->access$1700(Landroid/widget/AbsListView;)Z

    move-result v2

    if-nez v2, :cond_3

    .line 4011
    :cond_0
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v3, 0x6

    iput v3, v2, Landroid/widget/AbsListView;->mTouchMode:I

    .line 4012
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    invoke-virtual {v2}, Landroid/widget/OverScroller;->getCurrVelocity()F

    move-result v2

    float-to-int v1, v2

    .line 4013
    .local v1, vel:I
    if-lez p1, :cond_2

    .line 4014
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mEdgeGlowTop:Landroid/widget/EdgeEffect;
    invoke-static {v2}, Landroid/widget/AbsListView;->access$1800(Landroid/widget/AbsListView;)Landroid/widget/EdgeEffect;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/widget/EdgeEffect;->onAbsorb(I)V

    .line 4024
    .end local v1           #vel:I
    :cond_1
    :goto_0
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->invalidate()V

    .line 4025
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2, p0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    .line 4026
    return-void

    .line 4016
    .restart local v1       #vel:I
    :cond_2
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mEdgeGlowBottom:Landroid/widget/EdgeEffect;
    invoke-static {v2}, Landroid/widget/AbsListView;->access$1900(Landroid/widget/AbsListView;)Landroid/widget/EdgeEffect;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/widget/EdgeEffect;->onAbsorb(I)V

    goto :goto_0

    .line 4019
    .end local v1           #vel:I
    :cond_3
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v3, -0x1

    iput v3, v2, Landroid/widget/AbsListView;->mTouchMode:I

    .line 4020
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget-object v2, v2, Landroid/widget/AbsListView;->mPositionScroller:Landroid/widget/AbsListView$PositionScroller;

    if-eqz v2, :cond_1

    .line 4021
    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget-object v2, v2, Landroid/widget/AbsListView;->mPositionScroller:Landroid/widget/AbsListView$PositionScroller;

    invoke-virtual {v2}, Landroid/widget/AbsListView$PositionScroller;->stop()V

    goto :goto_0
.end method

.method endFling()V
    .locals 2

    .prologue
    .line 4038
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, -0x1

    iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 4040
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z

    .line 4041
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget-object v1, p0, Landroid/widget/AbsListView$FlingRunnable;->mCheckFlywheel:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z

    .line 4043
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V

    .line 4044
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #calls: Landroid/widget/AbsListView;->clearScrollingCache()V
    invoke-static {v0}, Landroid/widget/AbsListView;->access$2000(Landroid/widget/AbsListView;)V

    .line 4045
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    invoke-virtual {v0}, Landroid/widget/OverScroller;->abortAnimation()V

    .line 4047
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
    invoke-static {v0}, Landroid/widget/AbsListView;->access$1300(Landroid/widget/AbsListView;)Landroid/os/StrictMode$Span;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 4048
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
    invoke-static {v0}, Landroid/widget/AbsListView;->access$1300(Landroid/widget/AbsListView;)Landroid/os/StrictMode$Span;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/StrictMode$Span;->finish()V

    .line 4049
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x0

    #setter for: Landroid/widget/AbsListView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
    invoke-static {v0, v1}, Landroid/widget/AbsListView;->access$1302(Landroid/widget/AbsListView;Landroid/os/StrictMode$Span;)Landroid/os/StrictMode$Span;

    .line 4051
    :cond_0
    return-void
.end method

.method flywheelTouch()V
    .locals 4

    .prologue
    .line 4054
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget-object v1, p0, Landroid/widget/AbsListView$FlingRunnable;->mCheckFlywheel:Ljava/lang/Runnable;

    const-wide/16 v2, 0x28

    invoke-virtual {v0, v1, v2, v3}, Landroid/widget/AbsListView;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 4055
    return-void
.end method

.method public run()V
    .locals 30

    .prologue
    .line 4058
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v2, v2, Landroid/widget/AbsListView;->mTouchMode:I

    packed-switch v2, :pswitch_data_0

    .line 4060
    :pswitch_0
    invoke-virtual/range {p0 .. p0}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V

    .line 4182
    :cond_0
    :goto_0
    return-void

    .line 4064
    :pswitch_1
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    invoke-virtual {v2}, Landroid/widget/OverScroller;->isFinished()Z

    move-result v2

    if-nez v2, :cond_0

    .line 4069
    :pswitch_2
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget-boolean v2, v2, Landroid/widget/AbsListView;->mDataChanged:Z

    if-eqz v2, :cond_1

    .line 4070
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->layoutChildren()V

    .line 4073
    :cond_1
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v2, v2, Landroid/widget/AbsListView;->mItemCount:I

    if-eqz v2, :cond_2

    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->getChildCount()I

    move-result v2

    if-nez v2, :cond_3

    .line 4074
    :cond_2
    invoke-virtual/range {p0 .. p0}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V

    goto :goto_0

    .line 4078
    :cond_3
    move-object/from16 v0, p0

    iget-object v0, v0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    move-object/from16 v27, v0

    .line 4079
    .local v27, scroller:Landroid/widget/OverScroller;
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->computeScrollOffset()Z

    move-result v23

    .line 4080
    .local v23, more:Z
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->getCurrY()I

    move-result v29

    .line 4084
    .local v29, y:I
    move-object/from16 v0, p0

    iget v2, v0, Landroid/widget/AbsListView$FlingRunnable;->mLastFlingY:I

    sub-int v20, v2, v29

    .line 4087
    .local v20, delta:I
    if-lez v20, :cond_6

    .line 4089
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v3, v3, Landroid/widget/AbsListView;->mFirstPosition:I

    iput v3, v2, Landroid/widget/AbsListView;->mMotionPosition:I

    .line 4090
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object v21

    .line 4091
    .local v21, firstView:Landroid/view/View;
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual/range {v21 .. v21}, Landroid/view/View;->getTop()I

    move-result v3

    iput v3, v2, Landroid/widget/AbsListView;->mMotionViewOriginalTop:I

    .line 4094
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->getHeight()I

    move-result v2

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mPaddingBottom:I
    invoke-static {v3}, Landroid/widget/AbsListView;->access$2100(Landroid/widget/AbsListView;)I

    move-result v3

    sub-int/2addr v2, v3

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mPaddingTop:I
    invoke-static {v3}, Landroid/widget/AbsListView;->access$2200(Landroid/widget/AbsListView;)I

    move-result v3

    sub-int/2addr v2, v3

    add-int/lit8 v2, v2, -0x1

    move/from16 v0, v20

    invoke-static {v2, v0}, Ljava/lang/Math;->min(II)I

    move-result v20

    .line 4108
    .end local v21           #firstView:Landroid/view/View;
    :goto_1
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v3, v3, Landroid/widget/AbsListView;->mMotionPosition:I

    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v5, v5, Landroid/widget/AbsListView;->mFirstPosition:I

    sub-int/2addr v3, v5

    invoke-virtual {v2, v3}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object v24

    .line 4109
    .local v24, motionView:Landroid/view/View;
    const/16 v26, 0x0

    .line 4110
    .local v26, oldTop:I
    if-eqz v24, :cond_4

    .line 4111
    invoke-virtual/range {v24 .. v24}, Landroid/view/View;->getTop()I

    move-result v26

    .line 4115
    :cond_4
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move/from16 v0, v20

    move/from16 v1, v20

    invoke-virtual {v2, v0, v1}, Landroid/widget/AbsListView;->trackMotionScroll(II)Z

    move-result v15

    .line 4116
    .local v15, atEdge:Z
    if-eqz v15, :cond_7

    if-eqz v20, :cond_7

    const/16 v16, 0x1

    .line 4117
    .local v16, atEnd:Z
    :goto_2
    if-eqz v16, :cond_8

    .line 4118
    if-eqz v24, :cond_5

    .line 4120
    invoke-virtual/range {v24 .. v24}, Landroid/view/View;->getTop()I

    move-result v2

    sub-int v2, v2, v26

    sub-int v2, v20, v2

    neg-int v4, v2

    .line 4121
    .local v4, overshoot:I
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v3, 0x0

    const/4 v5, 0x0

    move-object/from16 v0, p0

    iget-object v6, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mScrollY:I
    invoke-static {v6}, Landroid/widget/AbsListView;->access$2500(Landroid/widget/AbsListView;)I

    move-result v6

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object/from16 v0, p0

    iget-object v10, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v10, v10, Landroid/widget/AbsListView;->mOverflingDistance:I

    const/4 v11, 0x0

    #calls: Landroid/widget/AbsListView;->overScrollBy(IIIIIIIIZ)Z
    invoke-static/range {v2 .. v11}, Landroid/widget/AbsListView;->access$2600(Landroid/widget/AbsListView;IIIIIIIIZ)Z

    .line 4124
    .end local v4           #overshoot:I
    :cond_5
    if-eqz v23, :cond_0

    .line 4125
    move-object/from16 v0, p0

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView$FlingRunnable;->edgeReached(I)V

    goto/16 :goto_0

    .line 4097
    .end local v15           #atEdge:Z
    .end local v16           #atEnd:Z
    .end local v24           #motionView:Landroid/view/View;
    .end local v26           #oldTop:I
    :cond_6
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->getChildCount()I

    move-result v2

    add-int/lit8 v25, v2, -0x1

    .line 4098
    .local v25, offsetToLast:I
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v3, v3, Landroid/widget/AbsListView;->mFirstPosition:I

    add-int v3, v3, v25

    iput v3, v2, Landroid/widget/AbsListView;->mMotionPosition:I

    .line 4100
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move/from16 v0, v25

    invoke-virtual {v2, v0}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object v22

    .line 4101
    .local v22, lastView:Landroid/view/View;
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual/range {v22 .. v22}, Landroid/view/View;->getTop()I

    move-result v3

    iput v3, v2, Landroid/widget/AbsListView;->mMotionViewOriginalTop:I

    .line 4104
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->getHeight()I

    move-result v2

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mPaddingBottom:I
    invoke-static {v3}, Landroid/widget/AbsListView;->access$2300(Landroid/widget/AbsListView;)I

    move-result v3

    sub-int/2addr v2, v3

    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mPaddingTop:I
    invoke-static {v3}, Landroid/widget/AbsListView;->access$2400(Landroid/widget/AbsListView;)I

    move-result v3

    sub-int/2addr v2, v3

    add-int/lit8 v2, v2, -0x1

    neg-int v2, v2

    move/from16 v0, v20

    invoke-static {v2, v0}, Ljava/lang/Math;->max(II)I

    move-result v20

    goto/16 :goto_1

    .line 4116
    .end local v22           #lastView:Landroid/view/View;
    .end local v25           #offsetToLast:I
    .restart local v15       #atEdge:Z
    .restart local v24       #motionView:Landroid/view/View;
    .restart local v26       #oldTop:I
    :cond_7
    const/16 v16, 0x0

    goto/16 :goto_2

    .line 4130
    .restart local v16       #atEnd:Z
    :cond_8
    if-eqz v23, :cond_a

    if-nez v16, :cond_a

    .line 4131
    if-eqz v15, :cond_9

    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->invalidate()V

    .line 4132
    :cond_9
    move/from16 v0, v29

    move-object/from16 v1, p0

    iput v0, v1, Landroid/widget/AbsListView$FlingRunnable;->mLastFlingY:I

    .line 4133
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move-object/from16 v0, p0

    invoke-virtual {v2, v0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    goto/16 :goto_0

    .line 4135
    :cond_a
    invoke-virtual/range {p0 .. p0}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V

    goto/16 :goto_0

    .line 4153
    .end local v15           #atEdge:Z
    .end local v16           #atEnd:Z
    .end local v20           #delta:I
    .end local v23           #more:Z
    .end local v24           #motionView:Landroid/view/View;
    .end local v26           #oldTop:I
    .end local v27           #scroller:Landroid/widget/OverScroller;
    .end local v29           #y:I
    :pswitch_3
    move-object/from16 v0, p0

    iget-object v0, v0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    move-object/from16 v27, v0

    .line 4154
    .restart local v27       #scroller:Landroid/widget/OverScroller;
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->computeScrollOffset()Z

    move-result v2

    if-eqz v2, :cond_11

    .line 4155
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mScrollY:I
    invoke-static {v2}, Landroid/widget/AbsListView;->access$2700(Landroid/widget/AbsListView;)I

    move-result v9

    .line 4156
    .local v9, scrollY:I
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->getCurrY()I

    move-result v19

    .line 4157
    .local v19, currY:I
    sub-int v7, v19, v9

    .line 4158
    .local v7, deltaY:I
    move-object/from16 v0, p0

    iget-object v5, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v6, 0x0

    const/4 v8, 0x0

    const/4 v10, 0x0

    const/4 v11, 0x0

    const/4 v12, 0x0

    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    iget v13, v2, Landroid/widget/AbsListView;->mOverflingDistance:I

    const/4 v14, 0x0

    #calls: Landroid/widget/AbsListView;->overScrollBy(IIIIIIIIZ)Z
    invoke-static/range {v5 .. v14}, Landroid/widget/AbsListView;->access$2800(Landroid/widget/AbsListView;IIIIIIIIZ)Z

    move-result v2

    if-eqz v2, :cond_10

    .line 4160
    if-gtz v9, :cond_d

    if-lez v19, :cond_d

    const/16 v17, 0x1

    .line 4161
    .local v17, crossDown:Z
    :goto_3
    if-ltz v9, :cond_e

    if-gez v19, :cond_e

    const/16 v18, 0x1

    .line 4162
    .local v18, crossUp:Z
    :goto_4
    if-nez v17, :cond_b

    if-eqz v18, :cond_f

    .line 4163
    :cond_b
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->getCurrVelocity()F

    move-result v2

    float-to-int v0, v2

    move/from16 v28, v0

    .line 4164
    .local v28, velocity:I
    if-eqz v18, :cond_c

    move/from16 v0, v28

    neg-int v0, v0

    move/from16 v28, v0

    .line 4167
    :cond_c
    invoke-virtual/range {v27 .. v27}, Landroid/widget/OverScroller;->abortAnimation()V

    .line 4168
    move-object/from16 v0, p0

    move/from16 v1, v28

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView$FlingRunnable;->start(I)V

    goto/16 :goto_0

    .line 4160
    .end local v17           #crossDown:Z
    .end local v18           #crossUp:Z
    .end local v28           #velocity:I
    :cond_d
    const/16 v17, 0x0

    goto :goto_3

    .line 4161
    .restart local v17       #crossDown:Z
    :cond_e
    const/16 v18, 0x0

    goto :goto_4

    .line 4170
    .restart local v18       #crossUp:Z
    :cond_f
    invoke-virtual/range {p0 .. p0}, Landroid/widget/AbsListView$FlingRunnable;->startSpringback()V

    goto/16 :goto_0

    .line 4173
    .end local v17           #crossDown:Z
    .end local v18           #crossUp:Z
    :cond_10
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v2}, Landroid/widget/AbsListView;->invalidate()V

    .line 4174
    move-object/from16 v0, p0

    iget-object v2, v0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    move-object/from16 v0, p0

    invoke-virtual {v2, v0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    goto/16 :goto_0

    .line 4177
    .end local v7           #deltaY:I
    .end local v9           #scrollY:I
    .end local v19           #currY:I
    :cond_11
    invoke-virtual/range {p0 .. p0}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V

    goto/16 :goto_0

    .line 4058
    nop

    :pswitch_data_0
    .packed-switch 0x3
        :pswitch_1
        :pswitch_2
        :pswitch_0
        :pswitch_3
    .end packed-switch
.end method

.method start(I)V
    .locals 9
    .parameter "initialVelocity"

    .prologue
    const v6, 0x7fffffff

    const/4 v1, 0x0

    .line 3966
    if-gez p1, :cond_1

    move v2, v6

    .line 3967
    .local v2, initialY:I
    :goto_0
    iput v2, p0, Landroid/widget/AbsListView$FlingRunnable;->mLastFlingY:I

    .line 3968
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    const/4 v3, 0x0

    invoke-virtual {v0, v3}, Landroid/widget/OverScroller;->setInterpolator(Landroid/view/animation/Interpolator;)V

    .line 3969
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    move v3, v1

    move v4, p1

    move v5, v1

    move v7, v1

    move v8, v6

    invoke-virtual/range {v0 .. v8}, Landroid/widget/OverScroller;->fling(IIIIIIII)V

    .line 3971
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x4

    iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 3972
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    .line 3981
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
    invoke-static {v0}, Landroid/widget/AbsListView;->access$1300(Landroid/widget/AbsListView;)Landroid/os/StrictMode$Span;

    move-result-object v0

    if-nez v0, :cond_0

    .line 3982
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const-string v1, "AbsListView-fling"

    invoke-static {v1}, Landroid/os/StrictMode;->enterCriticalSpan(Ljava/lang/String;)Landroid/os/StrictMode$Span;

    move-result-object v1

    #setter for: Landroid/widget/AbsListView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
    invoke-static {v0, v1}, Landroid/widget/AbsListView;->access$1302(Landroid/widget/AbsListView;Landroid/os/StrictMode$Span;)Landroid/os/StrictMode$Span;

    .line 3984
    :cond_0
    return-void

    .end local v2           #initialY:I
    :cond_1
    move v2, v1

    .line 3966
    goto :goto_0
.end method

.method startOverfling(I)V
    .locals 11
    .parameter "initialVelocity"

    .prologue
    const/4 v1, 0x0

    .line 3998
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Landroid/widget/OverScroller;->setInterpolator(Landroid/view/animation/Interpolator;)V

    .line 3999
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mScrollY:I
    invoke-static {v2}, Landroid/widget/AbsListView;->access$1500(Landroid/widget/AbsListView;)I

    move-result v2

    const/high16 v7, -0x8000

    const v8, 0x7fffffff

    iget-object v3, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v3}, Landroid/widget/AbsListView;->getHeight()I

    move-result v10

    move v3, v1

    move v4, p1

    move v5, v1

    move v6, v1

    move v9, v1

    invoke-virtual/range {v0 .. v10}, Landroid/widget/OverScroller;->fling(IIIIIIIIII)V

    .line 4001
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x6

    iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 4002
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0}, Landroid/widget/AbsListView;->invalidate()V

    .line 4003
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    .line 4004
    return-void
.end method

.method startScroll(IIZ)V
    .locals 6
    .parameter "distance"
    .parameter "duration"
    .parameter "linear"

    .prologue
    const/4 v1, 0x0

    .line 4029
    if-gez p1, :cond_0

    const v2, 0x7fffffff

    .line 4030
    .local v2, initialY:I
    :goto_0
    iput v2, p0, Landroid/widget/AbsListView$FlingRunnable;->mLastFlingY:I

    .line 4031
    iget-object v3, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    if-eqz p3, :cond_1

    sget-object v0, Landroid/widget/AbsListView;->sLinearInterpolator:Landroid/view/animation/Interpolator;

    :goto_1
    invoke-virtual {v3, v0}, Landroid/widget/OverScroller;->setInterpolator(Landroid/view/animation/Interpolator;)V

    .line 4032
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    move v3, v1

    move v4, p1

    move v5, p2

    invoke-virtual/range {v0 .. v5}, Landroid/widget/OverScroller;->startScroll(IIIII)V

    .line 4033
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x4

    iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 4034
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    .line 4035
    return-void

    .end local v2           #initialY:I
    :cond_0
    move v2, v1

    .line 4029
    goto :goto_0

    .line 4031
    .restart local v2       #initialY:I
    :cond_1
    const/4 v0, 0x0

    goto :goto_1
.end method

.method startSpringback()V
    .locals 7

    .prologue
    const/4 v1, 0x0

    .line 3987
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;

    iget-object v2, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    #getter for: Landroid/widget/AbsListView;->mScrollY:I
    invoke-static {v2}, Landroid/widget/AbsListView;->access$1400(Landroid/widget/AbsListView;)I

    move-result v2

    move v3, v1

    move v4, v1

    move v5, v1

    move v6, v1

    invoke-virtual/range {v0 .. v6}, Landroid/widget/OverScroller;->springBack(IIIIII)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 3988
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v1, 0x6

    iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 3989
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0}, Landroid/widget/AbsListView;->invalidate()V

    .line 3990
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->postOnAnimation(Ljava/lang/Runnable;)V

    .line 3995
    :goto_0
    return-void

    .line 3992
    :cond_0
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    const/4 v2, -0x1

    iput v2, v0, Landroid/widget/AbsListView;->mTouchMode:I

    .line 3993
    iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V

    goto :goto_0
.end method


text:
package com.ocdsoft.bacta.swg.server.object.tangible.installation.harvester;

public class HopperEntry {

}