text:
package com.danilov.AndroidLikeThreadModelLibrary;

public class Message {

    public Object object;
    public int what;
    public int arg1;
    public int arg2;

    static final int FLAG_IN_USE = 1 << 0;
    static final int FLAG_ASYNCHRONOUS  = 1 << 1;
    int flags;
    long when;
    Handler target;
    Runnable callback;
    Message next;

    private static final Object sPoolSync = new Object();
    private static Message sPool;
    private static int sPoolSize = 0;

    private static final int MAX_POOL_SIZE = 50;

    public static Message obtain() {
        synchronized (sPoolSync) {
            if (sPool != null) {
                Message m = sPool;
                sPool = m.next;
                m.next = null;
                sPoolSize--;
                return m;
            }
        }
        return new Message();
    }

    public static Message obtain(Message original) {
        Message m = obtain();
        m.what = original.what;
        m.arg1 = original.arg1;
        m.arg2 = original.arg2;
        m.object = original.object;
        m.target = original.target;
        m.callback = original.callback;

        return m;
    }

    public static Message obtain(Handler h) {
        Message m = obtain();
        m.target = h;

        return m;
    }

    public static Message obtain(Handler h, Runnable callback) {
        Message m = obtain();
        m.target = h;
        m.callback = callback;

        return m;
    }

    public static Message obtain(Handler h, int what) {
        Message m = obtain();
        m.target = h;
        m.what = what;

        return m;
    }

    public static Message obtain(Handler h, int what, Object object) {
        Message m = obtain();
        m.target = h;
        m.what = what;
        m.object = object;

        return m;
    }

    public static Message obtain(Handler h, int what, int arg1, int arg2) {
        Message m = obtain();
        m.target = h;
        m.what = what;
        m.arg1 = arg1;
        m.arg2 = arg2;

        return m;
    }

    public static Message obtain(Handler h, int what,
            int arg1, int arg2, Object object) {
        Message m = obtain();
        m.target = h;
        m.what = what;
        m.arg1 = arg1;
        m.arg2 = arg2;
        m.object = object;

        return m;
    }

    public long getWhen() {
        return when;
    }

    public void setTarget(Handler target) {
        this.target = target;
    }

    public Handler getTarget() {
        return target;
    }

    public Runnable getCallback() {
        return callback;
    }

    public void sendToTarget() {
        target.sendMessage(this);
    }

    public boolean isAsynchronous() {
        return (flags & FLAG_ASYNCHRONOUS) != 0;
    }

    public void setAsynchronous(boolean async) {
        if (async) {
            flags |= FLAG_ASYNCHRONOUS;
        } else {
            flags &= ~FLAG_ASYNCHRONOUS;
        }
    }

    boolean isInUse() {
        return ((flags & FLAG_IN_USE) == FLAG_IN_USE);
    }

    void markInUse() {
        flags |= FLAG_IN_USE;
    }

    public void recycle() {
        clearForRecycle();

        synchronized (sPoolSync) {
            if (sPoolSize < MAX_POOL_SIZE) {
                next = sPool;
                sPool = this;
                sPoolSize++;
            }
        }
    }

    void clearForRecycle() {
        flags = 0;
        what = 0;
        arg1 = 0;
        arg2 = 0;
        object = null;
        when = 0;
        target = null;
        callback = null;
    }

    public Message() {
    }

    public String toString() {
        return Long.toString(System.currentTimeMillis());
    }

    String toString(long now) {
        StringBuilder   b = new StringBuilder();

        b.append("{ what=");
        b.append(what);

        b.append(" when=");

        if (arg1 != 0) {
            b.append(" arg1=");
            b.append(arg1);
        }

        if (arg2 != 0) {
            b.append(" arg2=");
            b.append(arg2);
        }

        if (object != null) {
            b.append(" obj=");
            b.append(object);
        }

        b.append(" }");

        return b.toString();
    }

}


text:
package simulator;

import simulator.exceptions.SimObjectCollisionException;
import simulator.exceptions.SimObjectOutOfBoundsException;
import simulator.robot.Robot;

public class SimObject {

    private String ID;
    private int positionX, positionY, positionZ;
    private int previousPositionX, previousPositionY, previousPositionZ;
    private int startPositionX, startPositionY, startPositionZ;;

    public SimObject(String ID, int positionX, int positionY, int positionZ) {
        super();
        this.ID = ID;
        this.positionX = positionX;
        this.positionY = positionY;
        this.positionZ = positionZ;
        this.previousPositionX = positionX;
        this.previousPositionY = positionY;
        this.previousPositionZ = positionZ;
        this.startPositionX = positionX;
        this.startPositionY = positionY;
        this.startPositionZ = positionZ;
    }

    public String getID() {
        return ID;
    }

    public int getPositionX() {
        return positionX;
    }

    public int getPositionY() {
        return positionY;
    }

    public int getPositionZ() {
        return positionZ;
    }

    private void setPositionX(int positionX) {
        this.positionX = positionX;
    }

    private void setPositionY(int positionY) {
        this.positionY = positionY;
    }

    private void setPositionZ(int positionZ) {
        this.positionZ = positionZ;
    }

    public int getPreviousPositionX() {
        return previousPositionX;
    }

    public int getPreviousPositionY() {
        return previousPositionY;
    }

    public int getPreviousPositionZ() {
        return previousPositionZ;
    }

    private void setPreviousPositionX(int previousPositionX) {
        this.previousPositionX = previousPositionX;
    }

    private void setPreviousPositionY(int previousPositionY) {
        this.previousPositionY = previousPositionY;
    }

    private void setPreviousPositionZ(int previousPositionZ) {
        this.previousPositionZ = previousPositionZ;
    }

    public int getStartPositionX() {
        return startPositionX;
    }

    public int getStartPositionY() {
        return startPositionY;
    }

    public int getStartPositionZ() {
        return startPositionZ;
    }

    public void moveBy(int distanceX, int distanceY, int distanceZ)
        throws SimObjectOutOfBoundsException, SimObjectCollisionException {
        int newPositionX = getPositionX() + distanceX;
        int newPositionY = getPositionY() + distanceY;
        int newPositionZ = getPositionZ() + distanceZ;

        boolean inBoundsMove = SimCoordinator.getInstance().pathExists(
            newPositionX, newPositionY, newPositionZ);
        if (!inBoundsMove) {
            throw new SimObjectOutOfBoundsException(newPositionX, newPositionY,
                newPositionZ);
        }
        boolean destinationHasRobot = SimCoordinator.getInstance().getPath(
            newPositionX, newPositionY, newPositionZ).hasRobot();
        Robot robot = SimCoordinator.getInstance().getPath(newPositionX,
            newPositionY, newPositionZ).getRobot();
        if (destinationHasRobot) {
            throw new SimObjectCollisionException(robot, newPositionX,
                newPositionY, newPositionZ);
        }

        setPreviousPositionX(getPositionX());
        setPreviousPositionY(getPositionY());
        setPreviousPositionZ(getPositionZ());
        setPositionX(newPositionX);
        setPositionY(newPositionY);
        setPositionZ(newPositionZ);
    }

    public void moveTo(int newPositionX, int newPositionY, int newPositionZ)
        throws SimObjectOutOfBoundsException, SimObjectCollisionException {

        boolean inBoundsMove = SimCoordinator.getInstance().pathExists(
            newPositionX, newPositionY, newPositionZ);
        if (!inBoundsMove) {
            throw new SimObjectOutOfBoundsException(newPositionX, newPositionY,
                newPositionZ);
        }
        boolean destinationHasRobot = SimCoordinator.getInstance().getPath(
            newPositionX, newPositionY, newPositionZ).hasRobot();
        Robot robot = SimCoordinator.getInstance().getPath(newPositionX,
            newPositionY, newPositionZ).getRobot();
        if (destinationHasRobot) {
            throw new SimObjectCollisionException(robot, newPositionX,
                newPositionY, newPositionZ);
        }

        setPreviousPositionX(getPositionX());
        setPreviousPositionY(getPositionY());
        setPreviousPositionZ(getPositionZ());
        setPositionX(newPositionX);
        setPositionY(newPositionY);
        setPositionZ(newPositionZ);
    }

    public void reset() {
        setPositionX(getStartPositionX());
        setPositionY(getStartPositionY());
        setPositionZ(getStartPositionZ());
        setPreviousPositionX(getStartPositionX());
        setPreviousPositionY(getStartPositionY());
        setPreviousPositionZ(getStartPositionZ());
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:onClick="changeSize"
    tools:appearIn=".SizeChange">

    <android.support.v7.widget.CardView
        android:id="@+id/card"
        android:layout_width="180dp"
        android:layout_height="240dp"
        android:layout_gravity="center"
        app:cardCornerRadius="2dp"
        app:cardElevation="2dp" />

</FrameLayout>


text:
import numpy as np

from .utils import (sizeof_fmt, logger, get_config, warn, _explain_exception,
                    verbose, fill_doc)

_cuda_capable = False

def get_cuda_memory(kind='available'):
    """Get the amount of free memory for CUDA operations.

    Parameters
    ----------
    kind : str
        Can be "available" or "total".

    Returns
    -------
    memory : str
        The amount of available or total memory as a human-readable string.
    """
    if not _cuda_capable:
        warn('CUDA not enabled, returning zero for memory')
        mem = 0
    else:
        import cupy
        mem = cupy.cuda.runtime.memGetInfo()[dict(available=0, total=1)[kind]]
    return sizeof_fmt(mem)

@verbose
def init_cuda(ignore_config=False, verbose=None):
    """Initialize CUDA functionality.

    This function attempts to load the necessary interfaces
    (hardware connectivity) to run CUDA-based filtering. This
    function should only need to be run once per session.

    If the config var (set via mne.set_config or in ENV)
    MNE_USE_CUDA == 'true', this function will be executed when
    the first CUDA setup is performed. If this variable is not
    set, this function can be manually executed.

    Parameters
    ----------
    ignore_config : bool
        If True, ignore the config value MNE_USE_CUDA and force init.
    %(verbose)s
    """
    global _cuda_capable
    if _cuda_capable:
        return
    if not ignore_config and (get_config('MNE_USE_CUDA', 'false').lower() !=
                              'true'):
        logger.info('CUDA not enabled in config, skipping initialization')
        return
    # Triage possible errors for informative messaging
    _cuda_capable = False
    try:
        import cupy  # noqa
    except ImportError:
        warn('module cupy not found, CUDA not enabled')
        return
    device_id = int(get_config('MNE_CUDA_DEVICE', '0'))
    try:
        # Initialize CUDA
        _set_cuda_device(device_id, verbose)
    except Exception:
        warn('so CUDA device could be initialized, likely a hardware error, '
             'CUDA not enabled%s' % _explain_exception())
        return

    _cuda_capable = True
    # Figure out limit for CUDA FFT calculations
    logger.info('Enabling CUDA with %s available memory' % get_cuda_memory())

@verbose
def set_cuda_device(device_id, verbose=None):
    """Set the CUDA device temporarily for the current session.

    Parameters
    ----------
    device_id : int
        Numeric ID of the CUDA-capable device you want MNE-Python to use.
    %(verbose)s
    """
    if _cuda_capable:
        _set_cuda_device(device_id, verbose)
    elif get_config('MNE_USE_CUDA', 'false').lower() == 'true':
        init_cuda()
        _set_cuda_device(device_id, verbose)
    else:
        warn('Could not set CUDA device because CUDA is not enabled; either '
             'run mne.cuda.init_cuda() first, or set the MNE_USE_CUDA config '
             'variable to "true".')

@verbose
def _set_cuda_device(device_id, verbose=None):
    """Set the CUDA device."""
    import cupy
    cupy.cuda.Device(device_id).use()
    logger.info('Now using CUDA device {}'.format(device_id))

###############################################################################
# Repeated FFT multiplication

def _setup_cuda_fft_multiply_repeated(n_jobs, h, n_fft,
                                      kind='FFT FIR filtering'):
    """Set up repeated CUDA FFT multiplication with a given filter.

    Parameters
    ----------
    n_jobs : int | str
        If n_jobs == 'cuda', the function will attempt to set up for CUDA
        FFT multiplication.
    h : array
        The filtering function that will be used repeatedly.
    n_fft : int
        The number of points in the FFT.
    kind : str
        The kind to report to the user.

    Returns
    -------
    n_jobs : int
        Sets n_jobs = 1 if n_jobs == 'cuda' was passed in, otherwise
        original n_jobs is passed.
    cuda_dict : dict
        Dictionary with the following CUDA-related variables:
            use_cuda : bool
                Whether CUDA should be used.
            fft_plan : instance of FFTPlan
                FFT plan to use in calculating the FFT.
            ifft_plan : instance of FFTPlan
                FFT plan to use in calculating the IFFT.
            x_fft : instance of gpuarray
                Empty allocated GPU space for storing the result of the
                frequency-domain multiplication.
            x : instance of gpuarray
                Empty allocated GPU space for the data to filter.
    h_fft : array | instance of gpuarray
        This will either be a gpuarray (if CUDA enabled) or ndarray.

    Notes
    -----
    This function is designed to be used with fft_multiply_repeated().
    """
    from scipy.fft import rfft, irfft
    cuda_dict = dict(n_fft=n_fft, rfft=rfft, irfft=irfft,
                     h_fft=rfft(h, n=n_fft))
    if n_jobs == 'cuda':
        n_jobs = 1
        init_cuda()
        if _cuda_capable:
            import cupy
            try:
                # do the IFFT normalization now so we don't have to later
                h_fft = cupy.array(cuda_dict['h_fft'])
                logger.info('Using CUDA for %s' % kind)
            except Exception as exp:
                logger.info('CUDA not used, could not instantiate memory '
                            '(arrays may be too large: "%s"), falling back to '
                            'n_jobs=1' % str(exp))
            cuda_dict.update(h_fft=h_fft,
                             rfft=_cuda_upload_rfft,
                             irfft=_cuda_irfft_get)
        else:
            logger.info('CUDA not used, CUDA could not be initialized, '
                        'falling back to n_jobs=1')
    return n_jobs, cuda_dict

def _fft_multiply_repeated(x, cuda_dict):
    """Do FFT multiplication by a filter function (possibly using CUDA).

    Parameters
    ----------
    h_fft : 1-d array or gpuarray
        The filtering array to apply.
    x : 1-d array
        The array to filter.
    n_fft : int
        The number of points in the FFT.
    cuda_dict : dict
        Dictionary constructed using setup_cuda_multiply_repeated().

    Returns
    -------
    x : 1-d array
        Filtered version of x.
    """
    # do the fourier-domain operations
    x_fft = cuda_dict['rfft'](x, cuda_dict['n_fft'])
    x_fft *= cuda_dict['h_fft']
    x = cuda_dict['irfft'](x_fft, cuda_dict['n_fft'])
    return x

###############################################################################
# FFT Resampling

def _setup_cuda_fft_resample(n_jobs, W, new_len):
    """Set up CUDA FFT resampling.

    Parameters
    ----------
    n_jobs : int | str
        If n_jobs == 'cuda', the function will attempt to set up for CUDA
        FFT resampling.
    W : array
        The filtering function to be used during resampling.
        If n_jobs='cuda', this function will be shortened (since CUDA
        assumes FFTs of real signals are half the length of the signal)
        and turned into a gpuarray.
    new_len : int
        The size of the array following resampling.

    Returns
    -------
    n_jobs : int
        Sets n_jobs = 1 if n_jobs == 'cuda' was passed in, otherwise
        original n_jobs is passed.
    cuda_dict : dict
        Dictionary with the following CUDA-related variables:
            use_cuda : bool
                Whether CUDA should be used.
            fft_plan : instance of FFTPlan
                FFT plan to use in calculating the FFT.
            ifft_plan : instance of FFTPlan
                FFT plan to use in calculating the IFFT.
            x_fft : instance of gpuarray
                Empty allocated GPU space for storing the result of the
                frequency-domain multiplication.
            x : instance of gpuarray
                Empty allocated GPU space for the data to resample.

    Notes
    -----
    This function is designed to be used with fft_resample().
    """
    from scipy.fft import rfft, irfft
    cuda_dict = dict(use_cuda=False, rfft=rfft, irfft=irfft)
    rfft_len_x = len(W) // 2 + 1
    # fold the window onto inself (should be symmetric) and truncate
    W = W.copy()
    W[1:rfft_len_x] = (W[1:rfft_len_x] + W[::-1][:rfft_len_x - 1]) / 2.
    W = W[:rfft_len_x]
    if n_jobs == 'cuda':
        n_jobs = 1
        init_cuda()
        if _cuda_capable:
            try:
                import cupy
                # do the IFFT normalization now so we don't have to later
                W = cupy.array(W)
                logger.info('Using CUDA for FFT resampling')
            except Exception:
                logger.info('CUDA not used, could not instantiate memory '
                            '(arrays may be too large), falling back to '
                            'n_jobs=1')
            else:
                cuda_dict.update(use_cuda=True,
                                 rfft=_cuda_upload_rfft,
                                 irfft=_cuda_irfft_get)
        else:
            logger.info('CUDA not used, CUDA could not be initialized, '
                        'falling back to n_jobs=1')
    cuda_dict['W'] = W
    return n_jobs, cuda_dict

def _cuda_upload_rfft(x, n, axis=-1):
    """Upload and compute rfft."""
    import cupy
    return cupy.fft.rfft(cupy.array(x), n=n, axis=axis)

def _cuda_irfft_get(x, n, axis=-1):
    """Compute irfft and get."""
    import cupy
    return cupy.fft.irfft(x, n=n, axis=axis).get()

@fill_doc
def _fft_resample(x, new_len, npads, to_removes, cuda_dict=None,
                  pad='reflect_limited'):
    """Do FFT resampling with a filter function (possibly using CUDA).

    Parameters
    ----------
    x : 1-d array
        The array to resample. Will be converted to float64 if necessary.
    new_len : int
        The size of the output array (before removing padding).
    npads : tuple of int
        Amount of padding to apply to the start and end of the
        signal before resampling.
    to_removes : tuple of int
        Number of samples to remove after resampling.
    cuda_dict : dict
        Dictionary constructed using setup_cuda_multiply_repeated().
    %(pad)s
        The default is ``'reflect_limited'``.

        .. versionadded:: 0.15

    Returns
    -------
    x : 1-d array
        Filtered version of x.
    """
    cuda_dict = dict(use_cuda=False) if cuda_dict is None else cuda_dict
    # add some padding at beginning and end to make this work a little cleaner
    if x.dtype != np.float64:
        x = x.astype(np.float64)
    x = _smart_pad(x, npads, pad)
    old_len = len(x)
    shorter = new_len < old_len
    use_len = new_len if shorter else old_len
    x_fft = cuda_dict['rfft'](x, None)
    if use_len % 2 == 0:
        nyq = use_len // 2
        x_fft[nyq:nyq + 1] *= 2 if shorter else 0.5
    x_fft *= cuda_dict['W']
    y = cuda_dict['irfft'](x_fft, new_len)

    # now let's trim it back to the correct size (if there was padding)
    if (to_removes > 0).any():
        y = y[to_removes[0]:y.shape[0] - to_removes[1]]

    return y

###############################################################################
# Misc

# this has to go in mne.cuda instead of mne.filter to avoid import errors
def _smart_pad(x, n_pad, pad='reflect_limited'):
    """Pad vector x."""
    n_pad = np.asarray(n_pad)
    assert n_pad.shape == (2,)
    if (n_pad == 0).all():
        return x
    elif (n_pad < 0).any():
        raise RuntimeError('n_pad must be non-negative')
    if pad == 'reflect_limited':
        # need to pad with zeros if len(x) <= npad
        l_z_pad = np.zeros(max(n_pad[0] - len(x) + 1, 0), dtype=x.dtype)
        r_z_pad = np.zeros(max(n_pad[1] - len(x) + 1, 0), dtype=x.dtype)
        return np.concatenate([l_z_pad, 2 * x[0] - x[n_pad[0]:0:-1], x,
                               2 * x[-1] - x[-2:-n_pad[1] - 2:-1], r_z_pad])
    else:
        return np.pad(x, (tuple(n_pad),), pad)


text:
package tastytest

object TestSaferExceptions {

  def test = SaferExceptions.safeDiv(1, 0) // error

}


text:
package it.infn.ct.futuregateway.apiserver.inframanager;

/**
 * Exception for inconsistent or misconfigured tasks.
 *
 * @author Marco Fargetta <marco.fargetta@ct.infn.it>
 */
public class TaskException extends Exception {

    /**
     * Creates a new instance of TaskException without detail
     * message.
     */
    public TaskException() {
    }

    /**
     * Constructs an instance of TaskException with the specified
     * detail message.
     *
     * @param msg the detail message.
     */
    public TaskException(final String msg) {
        super(msg);
    }
}


text:
<?php

namespace Drupal\search_api\Plugin\search_api\datasource;

use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\Entity\ContentEntityType;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Derives a datasource plugin definition for every content entity type.
 *
 * @see \Drupal\search_api\Plugin\search_api\datasource\ContentEntityDatasource
 */
class ContentEntityDeriver extends DeriverBase implements ContainerDeriverInterface {

  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  protected $derivatives = NULL;

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    $deriver = new static();

    /** @var $entity_type_manager \Drupal\Core\Entity\EntityTypeManagerInterface */
    $entity_type_manager = $container->get('entity_type.manager');
    $deriver->setEntityTypeManager($entity_type_manager);

    /** @var \Drupal\Core\StringTranslation\TranslationInterface $translation */
    $translation = $container->get('string_translation');
    $deriver->setStringTranslation($translation);

    return $deriver;
  }

  /**
   * Retrieves the entity type manager.
   *
   * @return \Drupal\Core\Entity\EntityTypeManagerInterface
   *   The entity type manager.
   */
  public function getEntityTypeManager() {
    return $this->entityTypeManager ?: \Drupal::entityTypeManager();
  }

  /**
   * Sets the entity type manager.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   *
   * @return $this
   */
  public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    if (!isset($this->derivatives)) {
      $plugin_derivatives = [];
      foreach ($this->getEntityTypeManager()->getDefinitions() as $entity_type => $entity_type_definition) {
        // We only support content entity types at the moment, since config
        // entities don't implement \Drupal\Core\TypedData\ComplexDataInterface.
        if ($entity_type_definition instanceof ContentEntityType) {
          $plugin_derivatives[$entity_type] = [
            'entity_type' => $entity_type,
            'label' => $entity_type_definition->getLabel(),
            'description' => $this->t('Provides %entity_type entities for indexing and searching.', ['%entity_type' => $entity_type_definition->getLabel()]),
          ] + $base_plugin_definition;
        }
      }

      $this->derivatives = $plugin_derivatives;
    }

    return $this->derivatives;
  }

}


text:
export const bindings = {
  progress: '<'
}

export const require = {
  $parent: '^notification',
  $app: '^^app'
}

export function controller($timeout) {
  this.$onInit = () => {
    const subscription = this.progress.subscribe({
      next: ({ completed, errors, total }) => {
        this.value = {
          success: 100 * completed / total,
          warning: 100 * errors / total
        }
        if (completed + errors === total) {
          this.finished = true
          $timeout(() => this.$parent.close(), 2000)
        }
        this.$app.$applyDebounced()
      },
      error: (error) => {
        subscription.unsubscribe()
        this.$parent.close()
        this.$app.$applyDebounced()
      },
      complete: () => {
        this.finished = true
        this.$app.$applyDebounced()
      }
    })
  }

  this.retry = () => {
    this.$app.geocode()
    this.$parent.close()
  }
}

controller.$inject = ['$timeout']

export const template = `
  <progress-bar ng-if="!$ctrl.error" style="width: 100%" value="$ctrl.value"></progress-bar>
  <progress-bar ng-if="$ctrl.error" style="width: 100%" value="{danger: 100}" message="{danger: $ctrl.error}"></progress-bar>
`


text:
#import "UIView+React.h"

#import <objc/runtime.h>

#import "RCTAssert.h"
#import "RCTLog.h"
#import "RCTWrapperViewController.h"

@implementation UIView (React)

- (NSNumber *)reactTag
{
  return objc_getAssociatedObject(self, _cmd);
}

- (void)setReactTag:(NSNumber *)reactTag
{
  objc_setAssociatedObject(self, @selector(reactTag), reactTag, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (BOOL)isReactRootView
{
  return RCTIsReactRootView(self.reactTag);
}

- (NSNumber *)reactTagAtPoint:(CGPoint)point
{
  UIView *view = [self hitTest:point withEvent:nil];
  while (view && !view.reactTag) {
    view = view.superview;
  }
  return view.reactTag;
}

- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
{
  [self insertSubview:subview atIndex:atIndex];
}

- (void)removeReactSubview:(UIView *)subview
{
  RCTAssert(subview.superview == self, @"%@ is a not a subview of %@", subview, self);
  [subview removeFromSuperview];
}

- (NSArray *)reactSubviews
{
  return self.subviews;
}

- (UIView *)reactSuperview
{
  return self.superview;
}

- (void)reactSetFrame:(CGRect)frame
{
  // These frames are in terms of anchorPoint = topLeft, but internally the
  // views are anchorPoint = center for easier scale and rotation animations.
  // Convert the frame so it works with anchorPoint = center.
  CGPoint position = {CGRectGetMidX(frame), CGRectGetMidY(frame)};
  CGRect bounds = {CGPointZero, frame.size};

  // Avoid crashes due to nan coords
  if (isnan(position.x) || isnan(position.y) ||
      isnan(bounds.origin.x) || isnan(bounds.origin.y) ||
      isnan(bounds.size.width) || isnan(bounds.size.height)) {
    RCTLogError(@"Invalid layout for (%@)%@. position: %@. bounds: %@",
                self.reactTag, self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds));
    return;
  }

  self.layer.position = position;
  self.layer.bounds = bounds;
}

- (void)reactSetInheritedBackgroundColor:(UIColor *)inheritedBackgroundColor
{
  self.backgroundColor = inheritedBackgroundColor;
}

- (UIViewController *)backingViewController
{
  id responder = [self nextResponder];
  if ([responder isKindOfClass:[RCTWrapperViewController class]]) {
    return responder;
  }
  return nil;
}

- (void)addControllerToClosestParent:(UIViewController *)controller
{
  if (!controller.parentViewController) {
    UIView *parentView = (UIView *)self.reactSuperview;
    while (parentView) {
      if (parentView.backingViewController) {
        [parentView.backingViewController addChildViewController:controller];
        [controller didMoveToParentViewController:parentView.backingViewController];
        break;
      }
      parentView = (UIView *)parentView.reactSuperview;
    }
    return;
  }
}

/**
 * Responder overrides - to be deprecated.
 */
- (void)reactWillMakeFirstResponder {};
- (void)reactDidMakeFirstResponder {};
- (BOOL)reactRespondsToTouch:(UITouch *)touch
{
  return YES;
}

@end


text:
<?php

namespace Sylius\Component\Core\OrderProcessing;

use Sylius\Component\Core\Model\AdjustmentInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Payment\Calculator\DelegatingFeeCalculatorInterface;
use Sylius\Component\Payment\Model\PaymentSubjectInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;

/**
 * @author Mateusz Zalewski <mateusz.p.zalewski@gmail.com>
 */
class PaymentChargesProcessor implements PaymentChargesProcessorInterface
{
    /**
     * @var RepositoryInterface
     */
    protected $adjustmentRepository;

    /**
     * @var DelegatingFeeCalculatorInterface
     */
    protected $feeCalculator;

    /**
     * Constructor.
     *
     * @param RepositoryInterface $adjustmentRepository
     * @param DelegatingFeeCalculatorInterface $feeCalculator
     */
    public function __construct(RepositoryInterface $adjustmentRepository, DelegatingFeeCalculatorInterface $feeCalculator)
    {
        $this->adjustmentRepository = $adjustmentRepository;
        $this->feeCalculator = $feeCalculator;
    }

    /**
     * @param OrderInterface $order
     */
    public function applyPaymentCharges(OrderInterface $order)
    {
        $order->removeAdjustments(AdjustmentInterface::PAYMENT_ADJUSTMENT);
        $order->calculateTotal();

        foreach ($order->getPayments() as $payment) {
            $this->addAdjustmentIfForNotCancelled($order, $payment);
        }
    }

    /**
     * @param OrderInterface   $order
     * @param PaymentSubjectInterface $payment
     */
    private function addAdjustmentIfForNotCancelled(OrderInterface $order, PaymentSubjectInterface $payment)
    {
        if (PaymentInterface::STATE_CANCELLED !== $payment->getState())
        {
            $order->addAdjustment($this->prepareAdjustmentForOrder($payment));
        }
    }

    /**
     * @param PaymentSubjectInterface $payment
     *
     * @return AdjustmentInterface
     */
    private function prepareAdjustmentForOrder(PaymentSubjectInterface $payment)
    {
        $adjustment = $this->adjustmentRepository->createNew();
        $adjustment->setType(AdjustmentInterface::PAYMENT_ADJUSTMENT);
        $adjustment->setAmount($this->feeCalculator->calculate($payment));
        $adjustment->setDescription($payment->getMethod()->getName());

        return $adjustment;
    }
}


text:
set -e

# Check java
if type -p java>/dev/null; then
    _java=java
else
    echo "Java is not installed"
    exit 1
fi

# We deploy artifacts build from jdk 1.7
JDK_VERSION=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$JDK_VERSION" > "1.8" ]]; then
    echo Require a jdk 1.7 version
    exit 1
fi
if [[ "$JDK_VERSION" < "1.7" ]]; then
    echo Require a jdk 1.7 version
    exit 1
fi
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -XX:MaxPermSize=1G"

# Check if mvn installed
MVN_INSTALL=$(which mvn 2>/dev/null | grep mvn | wc -l)
if [ $MVN_INSTALL -eq 0 ]; then
  echo "MVN is not installed. Exit"
  exit 1
fi

# Remove dist module
mv spark/pom.xml spark/pom.xml.origin
cat spark/pom.xml.origin | sed 's/<module>dist<\/module>//' > spark/pom.xml

# Backup the origin bigdl pom.xml
mv spark/dl/pom.xml spark/dl/pom.xml.origin

# Deploy common modules and bigdl-1.5
cat spark/dl/pom.xml.origin | sed 's/<artifactId>bigdl<\/artifactId>/<artifactId>bigdl-SPARK_1.5<\/artifactId>/' > spark/dl/pom.xml
mvn clean deploy -DskipTests -P sign -Dspark.version=1.5.2
# Upload package to download for bigdl-1.5
cd spark/dist/
mvn clean deploy -DskipTests -P sign -Dspark.version=1.5.2
cd ../../
# Upload package to download for bigdl-1.5 on mac
mvn clean package -DskipTests -P mac -Dspark.version=1.5.2
cd spark/dist/
mvn clean deploy -DskipTests -P sign -P mac -Dspark.version=1.5.2
cd ../../

# Deploy bigdl-1.6
cat spark/dl/pom.xml.origin | sed 's/<artifactId>bigdl<\/artifactId>/<artifactId>bigdl-SPARK_1.6<\/artifactId>/' > spark/dl/pom.xml
mvn clean package -DskipTests -P spark_1.6 -Dspark.version=1.6.3
cd spark/dl/
mvn clean deploy -DskipTests -P sign -P spark_1.6 -Dspark.version=1.6.3
# Upload package to download for bigdl-1.6
cd ../dist/
mvn clean deploy -DskipTests -P sign -P spark_1.6 -Dspark.version=1.6.3
cd ../../
# Upload package to download for bigdl-1.6 on mac
mvn clean package -DskipTests -P mac -P spark_1.6 -Dspark.version=1.6.3
cd spark/dist/
mvn clean deploy -DskipTests -P sign -P mac -P spark_1.6 -Dspark.version=1.6.3
cd ../../

# Deploy spark-2.0 project
cd spark/spark-version/2.0/
mvn clean deploy -DskipTests -P sign -P spark_2.x
cd ../../../

# Deploy bigdl-2.0
cat spark/dl/pom.xml.origin | sed 's/<artifactId>bigdl<\/artifactId>/<artifactId>bigdl-SPARK_2.0<\/artifactId>/' > spark/dl/pom.xml
mvn clean package -DskipTests -P spark_2.x -Dspark.version=2.0.2
cd spark/dl/
mvn clean deploy -DskipTests -P sign -P spark_2.x -Dspark.version=2.0.2
# Upload package to download for bigdl-2.0
cd ../dist/
mvn clean deploy -DskipTests -P sign -P spark_2.x -Dspark.version=2.0.2
cd ../../
# Upload package to download for bigdl-2.0 on mac
mvn clean package -DskipTests -P mac -P spark_2.x -Dspark.version=2.0.2
cd spark/dist/
mvn clean deploy -DskipTests -P sign -P mac -P spark_2.x -Dspark.version=2.0.2
cd ../../

# Deploy bigdl-2.1
cat spark/dl/pom.xml.origin | sed 's/<artifactId>bigdl<\/artifactId>/<artifactId>bigdl-SPARK_2.1<\/artifactId>/' > spark/dl/pom.xml
mvn clean package -DskipTests -P spark_2.x -Dspark.version=2.1.1
cd spark/dl/
mvn clean deploy -DskipTests -P sign -P spark_2.x -Dspark.version=2.1.1
# Upload package to download for bigdl-2.1
cd ../dist/
mvn clean deploy -DskipTests -P sign -P spark_2.x -Dspark.version=2.1.1
cd ../../
# Upload package to download for bigdl-2.1 on mac
mvn clean package -DskipTests -P mac -P spark_2.x -Dspark.version=2.1.1
cd spark/dist/
mvn clean deploy -DskipTests -P sign -P mac -P spark_2.x -Dspark.version=2.1.1
cd ../../

mv spark/pom.xml.origin spark/pom.xml
mv spark/dl/pom.xml.origin spark/dl/pom.xml


text:
layout: post
title: "16/05/2015 - A blog is born..."
published: false
---

Next you can update your site name, avatar and other options using the _config.yml file in the root of your repository (shown below).

![_config.yml]({{ site.baseurl }}/images/config.png)

The easiest way to make your first post is to edit this one. Go into /_posts/ and update the Hello World markdown file. For more instructions head over to the [Jekyll Now repository](https://github.com/barryclark/jekyll-now) on GitHub.

> CATS are cool, therefore I am as cool as a cat :)


text:
.class final Lcom/android/server/wifi/WifiTrafficPoller;
.super Ljava/lang/Object;
.source "WifiTrafficPoller.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;
    }
.end annotation

# static fields
.field private static final ADD_CLIENT:I = 0x3

.field private static final ENABLE_TRAFFIC_STATS_POLL:I = 0x1

.field private static final POLL_TRAFFIC_STATS_INTERVAL_MSECS:I = 0x3e8

.field private static final REMOVE_CLIENT:I = 0x4

.field private static final TRAFFIC_STATS_POLL:I = 0x2

# instance fields
.field private DBG:Z

.field private final TAG:Ljava/lang/String;

.field private VDBG:Z

.field private final mClients:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/os/Messenger;",
            ">;"
        }
    .end annotation
.end field

.field private mDataActivity:I

.field private mEnableTrafficStatsPoll:Z

.field private final mInterface:Ljava/lang/String;

.field private mNetworkInfo:Landroid/net/NetworkInfo;

.field private mRxPkts:J

.field private mScreenOn:Ljava/util/concurrent/atomic/AtomicBoolean;

.field private final mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

.field private mTrafficStatsPollToken:I

.field private mTxPkts:J

# direct methods
.method constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "iface"    # Ljava/lang/String;

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

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

    .line 47
    iput-boolean v2, p0, Lcom/android/server/wifi/WifiTrafficPoller;->DBG:Z

    .line 48
    iput-boolean v2, p0, Lcom/android/server/wifi/WifiTrafficPoller;->VDBG:Z

    .line 50
    const-string v1, "WifiTrafficPoller"

    iput-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->TAG:Ljava/lang/String;

    .line 62
    iput-boolean v3, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mEnableTrafficStatsPoll:Z

    .line 63
    iput v3, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficStatsPollToken:I

    .line 69
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iput-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mClients:Ljava/util/List;

    .line 72
    new-instance v1, Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-direct {v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V

    iput-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mScreenOn:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 78
    iput-object p2, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mInterface:Ljava/lang/String;

    .line 79
    new-instance v1, Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    const/4 v2, 0x0

    invoke-direct {v1, p0, v2}, Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;-><init>(Lcom/android/server/wifi/WifiTrafficPoller;Lcom/android/server/wifi/WifiTrafficPoller$1;)V

    iput-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    .line 81
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    .line 82
    .local v0, "filter":Landroid/content/IntentFilter;
    const-string v1, "android.net.wifi.STATE_CHANGE"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 83
    const-string v1, "android.intent.action.SCREEN_OFF"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 84
    const-string v1, "android.intent.action.SCREEN_ON"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 86
    new-instance v1, Lcom/android/server/wifi/WifiTrafficPoller$1;

    invoke-direct {v1, p0}, Lcom/android/server/wifi/WifiTrafficPoller$1;-><init>(Lcom/android/server/wifi/WifiTrafficPoller;)V

    invoke-virtual {p1, v1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 102
    return-void
.end method

.method static synthetic access$102(Lcom/android/server/wifi/WifiTrafficPoller;Landroid/net/NetworkInfo;)Landroid/net/NetworkInfo;
    .locals 0
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;
    .param p1, "x1"    # Landroid/net/NetworkInfo;

    .prologue
    .line 45
    iput-object p1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mNetworkInfo:Landroid/net/NetworkInfo;

    return-object p1
.end method

.method static synthetic access$200(Lcom/android/server/wifi/WifiTrafficPoller;)Ljava/util/concurrent/atomic/AtomicBoolean;
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget-object v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mScreenOn:Ljava/util/concurrent/atomic/AtomicBoolean;

    return-object v0
.end method

.method static synthetic access$300(Lcom/android/server/wifi/WifiTrafficPoller;)V
    .locals 0
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    invoke-direct {p0}, Lcom/android/server/wifi/WifiTrafficPoller;->evaluateTrafficStatsPolling()V

    return-void
.end method

.method static synthetic access$400(Lcom/android/server/wifi/WifiTrafficPoller;)Z
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget-boolean v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mEnableTrafficStatsPoll:Z

    return v0
.end method

.method static synthetic access$402(Lcom/android/server/wifi/WifiTrafficPoller;Z)Z
    .locals 0
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;
    .param p1, "x1"    # Z

    .prologue
    .line 45
    iput-boolean p1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mEnableTrafficStatsPoll:Z

    return p1
.end method

.method static synthetic access$500(Lcom/android/server/wifi/WifiTrafficPoller;)Z
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget-boolean v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->DBG:Z

    return v0
.end method

.method static synthetic access$600(Lcom/android/server/wifi/WifiTrafficPoller;)I
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficStatsPollToken:I

    return v0
.end method

.method static synthetic access$608(Lcom/android/server/wifi/WifiTrafficPoller;)I
    .locals 2
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficStatsPollToken:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficStatsPollToken:I

    return v0
.end method

.method static synthetic access$700(Lcom/android/server/wifi/WifiTrafficPoller;)V
    .locals 0
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    invoke-direct {p0}, Lcom/android/server/wifi/WifiTrafficPoller;->notifyOnDataActivity()V

    return-void
.end method

.method static synthetic access$800(Lcom/android/server/wifi/WifiTrafficPoller;)Z
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget-boolean v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->VDBG:Z

    return v0
.end method

.method static synthetic access$900(Lcom/android/server/wifi/WifiTrafficPoller;)Ljava/util/List;
    .locals 1
    .param p0, "x0"    # Lcom/android/server/wifi/WifiTrafficPoller;

    .prologue
    .line 45
    iget-object v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mClients:Ljava/util/List;

    return-object v0
.end method

.method private evaluateTrafficStatsPolling()V
    .locals 5

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 176
    iget-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mNetworkInfo:Landroid/net/NetworkInfo;

    if-nez v1, :cond_0

    .line 185
    :goto_0
    return-void

    .line 177
    :cond_0
    iget-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v1}, Landroid/net/NetworkInfo;->getDetailedState()Landroid/net/NetworkInfo$DetailedState;

    move-result-object v1

    sget-object v2, Landroid/net/NetworkInfo$DetailedState;->CONNECTED:Landroid/net/NetworkInfo$DetailedState;

    if-ne v1, v2, :cond_1

    iget-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mScreenOn:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 178
    iget-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    invoke-static {v1, v4, v4, v3}, Landroid/os/Message;->obtain(Landroid/os/Handler;III)Landroid/os/Message;

    move-result-object v0

    .line 184
    .local v0, "msg":Landroid/os/Message;
    :goto_1
    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    goto :goto_0

    .line 181
    .end local v0    # "msg":Landroid/os/Message;
    :cond_1
    iget-object v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    invoke-static {v1, v4, v3, v3}, Landroid/os/Message;->obtain(Landroid/os/Handler;III)Landroid/os/Message;

    move-result-object v0

    .restart local v0    # "msg":Landroid/os/Message;
    goto :goto_1
.end method

.method private notifyOnDataActivity()V
    .locals 18

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

    iget-wide v8, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mTxPkts:J

    .local v8, "preTxPkts":J
    move-object/from16 v0, p0

    iget-wide v6, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mRxPkts:J

    .line 190
    .local v6, "preRxPkts":J
    const/4 v3, 0x0

    .line 192
    .local v3, "dataActivity":I
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mInterface:Ljava/lang/String;

    invoke-static {v14}, Landroid/net/TrafficStats;->getTxPackets(Ljava/lang/String;)J

    move-result-wide v14

    move-object/from16 v0, p0

    iput-wide v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mTxPkts:J

    .line 193
    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mInterface:Ljava/lang/String;

    invoke-static {v14}, Landroid/net/TrafficStats;->getRxPackets(Ljava/lang/String;)J

    move-result-wide v14

    move-object/from16 v0, p0

    iput-wide v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mRxPkts:J

    .line 195
    move-object/from16 v0, p0

    iget-boolean v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->VDBG:Z

    if-eqz v14, :cond_0

    .line 196
    const-string v14, "WifiTrafficPoller"

    new-instance v15, Ljava/lang/StringBuilder;

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

    const-string v16, " packet count Tx="

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mTxPkts:J

    move-wide/from16 v16, v0

    invoke-static/range {v16 .. v17}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, " Rx="

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mRxPkts:J

    move-wide/from16 v16, v0

    invoke-static/range {v16 .. v17}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v14, v15}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 202
    :cond_0
    const-wide/16 v14, 0x0

    cmp-long v14, v8, v14

    if-gtz v14, :cond_1

    const-wide/16 v14, 0x0

    cmp-long v14, v6, v14

    if-lez v14, :cond_5

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

    iget-wide v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mTxPkts:J

    sub-long v12, v14, v8

    .line 204
    .local v12, "sent":J
    move-object/from16 v0, p0

    iget-wide v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mRxPkts:J

    sub-long v10, v14, v6

    .line 205
    .local v10, "received":J
    const-wide/16 v14, 0x0

    cmp-long v14, v12, v14

    if-lez v14, :cond_2

    .line 206
    or-int/lit8 v3, v3, 0x2

    .line 208
    :cond_2
    const-wide/16 v14, 0x0

    cmp-long v14, v10, v14

    if-lez v14, :cond_3

    .line 209
    or-int/lit8 v3, v3, 0x1

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

    iget v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mDataActivity:I

    if-eq v3, v14, :cond_5

    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mScreenOn:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v14}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result v14

    if-eqz v14, :cond_5

    .line 213
    move-object/from16 v0, p0

    iput v3, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mDataActivity:I

    .line 214
    move-object/from16 v0, p0

    iget-boolean v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->DBG:Z

    if-eqz v14, :cond_4

    .line 215
    const-string v14, "WifiTrafficPoller"

    new-instance v15, Ljava/lang/StringBuilder;

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

    const-string v16, "notifying of data activity "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    move-object/from16 v0, p0

    iget v0, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mDataActivity:I

    move/from16 v16, v0

    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v14, v15}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

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

    iget-object v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mClients:Ljava/util/List;

    invoke-interface {v14}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .local v4, "i$":Ljava/util/Iterator;
    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v14

    if-eqz v14, :cond_5

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/os/Messenger;

    .line 219
    .local v2, "client":Landroid/os/Messenger;
    invoke-static {}, Landroid/os/Message;->obtain()Landroid/os/Message;

    move-result-object v5

    .line 220
    .local v5, "msg":Landroid/os/Message;
    const/4 v14, 0x1

    iput v14, v5, Landroid/os/Message;->what:I

    .line 221
    move-object/from16 v0, p0

    iget v14, v0, Lcom/android/server/wifi/WifiTrafficPoller;->mDataActivity:I

    iput v14, v5, Landroid/os/Message;->arg1:I

    .line 223
    :try_start_0
    invoke-virtual {v2, v5}, Landroid/os/Messenger;->send(Landroid/os/Message;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 224
    :catch_0
    move-exception v14

    goto :goto_0

    .line 231
    .end local v2    # "client":Landroid/os/Messenger;
    .end local v4    # "i$":Ljava/util/Iterator;
    .end local v5    # "msg":Landroid/os/Message;
    .end local v10    # "received":J
    .end local v12    # "sent":J
    :cond_5
    return-void
.end method

# virtual methods
.method addClient(Landroid/os/Messenger;)V
    .locals 2
    .param p1, "client"    # Landroid/os/Messenger;

    .prologue
    .line 105
    iget-object v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    const/4 v1, 0x3

    invoke-static {v0, v1, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    .line 106
    return-void
.end method

.method dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
    .locals 4
    .param p1, "fd"    # Ljava/io/FileDescriptor;
    .param p2, "pw"    # Ljava/io/PrintWriter;
    .param p3, "args"    # [Ljava/lang/String;

    .prologue
    .line 234
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "mEnableTrafficStatsPoll "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mEnableTrafficStatsPoll:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 235
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "mTrafficStatsPollToken "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficStatsPollToken:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 236
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "mTxPkts "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v2, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTxPkts:J

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 237
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "mRxPkts "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v2, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mRxPkts:J

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 238
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "mDataActivity "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mDataActivity:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 239
    return-void
.end method

.method enableVerboseLogging(I)V
    .locals 1
    .param p1, "verbose"    # I

    .prologue
    .line 113
    if-lez p1, :cond_0

    .line 114
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->DBG:Z

    .line 118
    :goto_0
    return-void

    .line 116
    :cond_0
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->DBG:Z

    goto :goto_0
.end method

.method removeClient(Landroid/os/Messenger;)V
    .locals 2
    .param p1, "client"    # Landroid/os/Messenger;

    .prologue
    .line 109
    iget-object v0, p0, Lcom/android/server/wifi/WifiTrafficPoller;->mTrafficHandler:Lcom/android/server/wifi/WifiTrafficPoller$TrafficHandler;

    const/4 v1, 0x4

    invoke-static {v0, v1, p1}, Landroid/os/Message;->obtain(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    .line 110
    return-void
.end method


text:
using Xunit;

namespace Grains.Tests.Hosted.Cluster
{
    [CollectionDefinition(nameof(ClusterCollection))]
    public class ClusterCollection : ICollectionFixture<ClusterFixture>
    {
    }
}


text:
<?php

/**
 * This class defines the structure of the 'sf_guard_user_profile' table.
 *
 *
 * This class was autogenerated by Propel 1.4.1 on:
 *
 * Fri Apr 29 23:44:18 2011
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    lib.model.map
 */
class SfGuardUserProfileTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'lib.model.map.SfGuardUserProfileTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('sf_guard_user_profile');
		$this->setPhpName('SfGuardUserProfile');
		$this->setClassname('SfGuardUserProfile');
		$this->setPackage('lib.model');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11, null);
		$this->addForeignKey('USER_ID', 'UserId', 'INTEGER', 'sf_guard_user', 'ID', true, 11, null);
		$this->addColumn('NOMBRE', 'Nombre', 'VARCHAR', true, 45, null);
		$this->addColumn('APELLIDOS', 'Apellidos', 'VARCHAR', false, 150, null);
		$this->addColumn('FECHA_NACIMIENTO', 'FechaNacimiento', 'DATE', false, null, null);
		$this->addColumn('PAIS', 'Pais', 'VARCHAR', false, 45, null);
		$this->addColumn('FORMACION', 'Formacion', 'VARCHAR', false, 255, null);
		$this->addColumn('RESIDENCIA', 'Residencia', 'VARCHAR', false, 45, null);
		$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
		$this->addColumn('VANITY', 'Vanity', 'VARCHAR', false, 45, null);
		$this->addColumn('IMAGEN', 'Imagen', 'VARCHAR', false, 50, null);
		$this->addColumn('CODIGO', 'Codigo', 'VARCHAR', false, 45, null);
		$this->addColumn('PAPEL_VOOTA', 'PapelVoota', 'VARCHAR', false, 280, null);
		$this->addColumn('MAILS_COMENTARIOS', 'MailsComentarios', 'INTEGER', true, 11, 1);
		$this->addColumn('MAILS_NOTICIAS', 'MailsNoticias', 'INTEGER', true, 11, 1);
		$this->addColumn('MAILS_CONTACTO', 'MailsContacto', 'INTEGER', true, 11, 1);
		$this->addColumn('MAILS_SEGUIDOR', 'MailsSeguidor', 'INTEGER', true, 11, 1);
		$this->addColumn('NUMERO_SOCIO', 'NumeroSocio', 'VARCHAR', false, 45, null);
		$this->addColumn('FACEBOOK_UID', 'FacebookUid', 'VARCHAR', false, 128, '1');
		$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 255, null);
		$this->addColumn('EMAIL_HASH', 'EmailHash', 'VARCHAR', false, 255, null);
		$this->addColumn('FB_PUBLISH_VOTOS', 'FbPublishVotos', 'BOOLEAN', true, null, true);
		$this->addColumn('FB_PUBLISH_VOTOS_OTROS', 'FbPublishVotosOtros', 'BOOLEAN', true, null, true);
		$this->addColumn('FB_PUBLISH_CAMBIOS_PERFIL', 'FbPublishCambiosPerfil', 'BOOLEAN', true, null, true);
		$this->addColumn('FB_TIP', 'FbTip', 'BOOLEAN', true, null, true);
		$this->addColumn('TW_PUBLISH_VOTOS', 'TwPublishVotos', 'BOOLEAN', true, null, true);
		$this->addColumn('TW_PUBLISH_VOTOS_OTROS', 'TwPublishVotosOtros', 'BOOLEAN', true, null, true);
		$this->addColumn('TW_PUBLISH_CAMBIOS_PERFIL', 'TwPublishCambiosPerfil', 'BOOLEAN', true, null, true);
		$this->addColumn('TW_OAUTH_TOKEN', 'TwOauthToken', 'VARCHAR', false, 45, null);
		$this->addColumn('TW_OAUTH_TOKEN_SECRET', 'TwOauthTokenSecret', 'VARCHAR', false, 45, null);
		$this->addColumn('ANONYMOUS', 'Anonymous', 'BOOLEAN', true, null, false);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('sfGuardUser', 'sfGuardUser', RelationMap::MANY_TO_ONE, array('user_id' => 'id', ), 'RESTRICT', 'RESTRICT');
    $this->addRelation('SfGuardUserProfileI18n', 'SfGuardUserProfileI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'RESTRICT', 'RESTRICT');
	} // buildRelations()

	/**
	 *
	 * Gets the list of behaviors registered for this table
	 *
	 * @return array Associative array (name => parameters) of behaviors
	 */
	public function getBehaviors()
	{
		return array(
			'symfony' => array('form' => 'true', 'filter' => 'true', ),
			'symfony_behaviors' => array(),
			'symfony_timestampable' => array('create_column' => 'created_at', ),
			'symfony_i18n' => array('i18n_table' => 'sf_guard_user_profile_i18n', ),
		);
	} // getBehaviors()

} // SfGuardUserProfileTableMap


text:
import client from './apollo'
import gql from 'graphql-tag'
import chalk from 'chalk'
import present from 'present'
import moment from 'moment'

const { info, log, error } = console
const duration = ms => moment.utc(ms).format(`HH:mm:ss.SSS`)

const updateLanguageCode = input => client
  .mutate({
    mutation: gql`mutation updateLanguageCode($input: LanguageCodeInput) {
      updateLanguageCode(input: $input) {
        id
      }
    }`,
    variables: { input }
  })
  .then(res => res.data.updateLanguageCode)
  .catch(err => log(`Failed to update Language Code.`, input,  err))

const getLanguageCode = async input => await client
  .query({
    query: gql`query getLanguageCode($input: [String]) {
      language(filter: { name: $input }) {
        id
        code {
          id
          code
        }
      }
    }`,
    variables: { input },
    fetchPolicy: `cache-first`
  })
  .then(res => res.data.language[0].code)
  .catch(err => log(`Failed to get Language Code.`, input,  err))

const updateLanguage = input => client
  .mutate({
    mutation: gql`mutation updateLangauge($input: LanguageInput) {
      updateLanguage(input: $input) {
        id
      }
    }`,
    variables: { input }
  })
  .then(res => res.data.updateLanguage)
  .catch(err => log(`Failed to update Language.`, input,  err))

export { updateLanguageCode, getLanguageCode, updateLanguage }

export async function insertLanguages() {
  const start = present()
  const prefix = `${chalk.green(`[insertLanguages]: `)}`
  try {
    log(`${prefix}Begin adding languages to database...`)
    const languages = [
      { code: `en-US`, language: `English`},
      { code: `zh-Hans`, language: `Chinese Simplified`},
      { code: `zh-Hant`, language: `Chinese Traditional`},
      { code: `fr`, language: `French`},
      { code: `de`, language: `German`},
      { code: `it`, language: `Italian`},
      { code: `ja`, language: `Japanese`},
      { code: `ko`, language: `Korean`},
      { code: `pt`, language: `Portuguese`},
      { code: `ru`, language: `Russian`},
      { code: `es`, language: `Spanish`},
      { code: `pt-br`, language: `Portuguese (Brazil)`}
    ]
    await Promise.all(languages.map(({code, language}, index) => {
      info(`${prefix}Adding language ${chalk.green(language)}`)
      updateLanguageCode({ code, language: index })
      updateLanguage({ name: language, code: index })
    }))
    .then(info(`${prefix}Finished adding Languages.`))
    .catch(err => error(`${prefix}Failed to add Languages.`, { err }))
    const end = present()
    log(`${prefix}Finished inserting languages! (${duration(end - start)})`)
  } catch (err) {
    const end = present()
    error(`${prefix}Failed to add languages to the database. (${duration(end - start)})`, err)
  }
}


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

<TITLE>
Uses of Package com.sun.squawk.platform.posix.natives (2013 FRC Java API)
</TITLE>

<META NAME="date" CONTENT="2014-01-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
com.sun.squawk.platform.posix.natives

Packages that use com.sun.squawk.platform.posix.natives

com.sun.squawk.platform.posix
Classes that define and provide POSIX-specific implementations of various features of the JVM.

com.sun.squawk.platform.posix.linux.natives

com.sun.squawk.platform.posix.natives

Classes in com.sun.squawk.platform.posix.natives used by com.sun.squawk.platform.posix

Select

          java wrapper around #include <sys/select.h>

Classes in com.sun.squawk.platform.posix.natives used by com.sun.squawk.platform.posix.linux.natives

IoctlImpl

LibC.stat

          C struct stat
 //    struct stat {
 //        dev_t                st_dev;         /* [XSI] ID of device containing file             4 0
 //        ino_t                st_ino;         /* [XSI] File serial number                       4 4
 //        mode_t               st_mode;        /* [XSI] Mode of file (see below)             2 8
 //        nlink_t              st_nlink;       /* [XSI] Number of hard links                 2 10
 //        uid_t                st_uid;         /* [XSI] User ID of the file                      4 12
 //        gid_t                st_gid;         /* [XSI] Group ID of the file                     4 16
 //        dev_t                st_rdev;        /* [XSI] Device ID                                4 20
 //        time_t               st_atime;       /* [XSI] Time of last access                  4 24
 //        long         st_atimensec;   /* nsec of last access                        4 28
 //        time_t               st_mtime;       /* [XSI] Last data modification time          4 32
 //        long         st_mtimensec;   /* last data modification nsec                4 36
 //        time_t               st_ctime;       /* [XSI] Time of last status change           4 40
 //        long         st_ctimensec;   /* nsec of last status change                 4 44
 //        off_t                st_size;        /* [XSI] file size, in bytes                      8 48
 //        blkcnt_t     st_blocks;      /* [XSI] blocks allocated for file                8
 //        blksize_t    st_blksize;     /* [XSI] optimal blocksize for I/O                4
 //        __uint32_t   st_flags;       /* user defined flags for file                4
 //        __uint32_t   st_gen;         /* file generation number                     4
 //        __int32_t    st_lspare;      /* RESERVED: DO NOT USE!                          4
 //        __int64_t    st_qspare[2];   /* RESERVED: DO NOT USE!                      16
 //     };

LibCImpl

NetDB.hostent

          C STRUCTURE HostEnt
            struct  hostent {
                     char    *h_name;         official name of host
                     char    **h_aliases;     alias list
                     int     h_addrtype;      host address type
                     int     h_length;        length of address
                     char    **h_addr_list;   list of addresses from name server
             };
             #define h_addr  h_addr_list[0]  address, for backward compatibility

NetDBImpl

SelectImpl

SocketImpl

TimeImpl

Classes in com.sun.squawk.platform.posix.natives used by com.sun.squawk.platform.posix.natives

Ioctl

          java wrapper around #include <sys/ioctl.h>

LibC

          Import common functions variables and constants from libc.

LibC.stat

          C struct stat
 //    struct stat {
 //        dev_t                st_dev;         /* [XSI] ID of device containing file             4 0
 //        ino_t                st_ino;         /* [XSI] File serial number                       4 4
 //        mode_t               st_mode;        /* [XSI] Mode of file (see below)             2 8
 //        nlink_t              st_nlink;       /* [XSI] Number of hard links                 2 10
 //        uid_t                st_uid;         /* [XSI] User ID of the file                      4 12
 //        gid_t                st_gid;         /* [XSI] Group ID of the file                     4 16
 //        dev_t                st_rdev;        /* [XSI] Device ID                                4 20
 //        time_t               st_atime;       /* [XSI] Time of last access                  4 24
 //        long         st_atimensec;   /* nsec of last access                        4 28
 //        time_t               st_mtime;       /* [XSI] Last data modification time          4 32
 //        long         st_mtimensec;   /* last data modification nsec                4 36
 //        time_t               st_ctime;       /* [XSI] Time of last status change           4 40
 //        long         st_ctimensec;   /* nsec of last status change                 4 44
 //        off_t                st_size;        /* [XSI] file size, in bytes                      8 48
 //        blkcnt_t     st_blocks;      /* [XSI] blocks allocated for file                8
 //        blksize_t    st_blksize;     /* [XSI] optimal blocksize for I/O                4
 //        __uint32_t   st_flags;       /* user defined flags for file                4
 //        __uint32_t   st_gen;         /* file generation number                     4
 //        __int32_t    st_lspare;      /* RESERVED: DO NOT USE!                          4
 //        __int64_t    st_qspare[2];   /* RESERVED: DO NOT USE!                      16
 //     };

LibCImpl.statImpl

NetDB

          java wrapper around #include <netdb.h>

NetDB.hostent

          C STRUCTURE HostEnt
            struct  hostent {
                     char    *h_name;         official name of host
                     char    **h_aliases;     alias list
                     int     h_addrtype;      host address type
                     int     h_length;        length of address
                     char    **h_addr_list;   list of addresses from name server
             };
             #define h_addr  h_addr_list[0]  address, for backward compatibility

NetDBImpl.hostentImpl

Select

          java wrapper around #include <sys/select.h>

Socket

          java wrapper around BSD sockets

Socket.sockaddr_in

          C STRUCTURE sockaddr_in  /
     struct sockaddr_in {
        u_char  sin_len;     1
        u_char  sin_family;  1
        u_short sin_port;    2
        struct  in_addr sin_addr; 4
        char    sin_zero[8];     8
     };

     struct sockaddr {
        __uint8_t       sa_len;         /* total length
        sa_family_t     sa_family;      /* [XSI] address family
        char            sa_data[14];    /* [XSI] addr value (actually larger)
};

SocketImpl.sockaddr_inImpl

Time

          java wrapper around #include <sys/time.h>

TimeImpl.timevalImpl

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

"For updated information see the Java FRC site"


text:
Creates routes for your app based on your `content` directory.
[Learn how content routes work](./content-routes.md)

```javascript
// ./app.js
const app = require('expressful')();
app.serveContent(); // <----
app.start();
```


text:
namespace TelegramClient.Core.Network.RecieveHandlers
{
    using System;
    using System.Text.RegularExpressions;

    using log4net;

    using OpenTl.Schema;

    using TelegramClient.Core.Exceptions;
    using TelegramClient.Core.IoC;
    using TelegramClient.Core.Network.Exceptions;
    using TelegramClient.Core.Network.Recieve.Interfaces;
    using TelegramClient.Core.Network.RecieveHandlers.Interfaces;

    [SingleInstance(typeof(IRecieveHandler))]
    internal class RpcResultRecieveHandler : IRecieveHandler
    {
        private static readonly ILog Log = LogManager.GetLogger(typeof(RpcResultRecieveHandler));

        public Type[] HandleCodes { get; } = { typeof(TRpcResult) };

        public IResponseResultSetter ResponseResultSetter { get; set; }

        public IGZipPackedHandler ZipPackedHandler { get; set; }

        public void HandleResponce(IObject obj)
        {
            Log.Debug("Handle RpcResult");

            var message = obj.Cast<TRpcResult>();

            Log.Debug($"Process RpcResult  with request id = '{message.ReqMsgId}'");

            switch (message.Result)
            {
                case TRpcError error:
                    HandleRpcError(message.ReqMsgId, error);
                    break;

                case TgZipPacked zipPacked:
                    var result = ZipPackedHandler.HandleGZipPacked(zipPacked);
                    ResponseResultSetter.ReturnResult(message.ReqMsgId, result);
                    break;

                default:
                    ResponseResultSetter.ReturnResult(message.ReqMsgId, message.Result);
                    break;
            }
        }

        private void HandleRpcError(long messageReqMsgId, TRpcError error)
        {
            // rpc_error

            Log.Warn($"Recieve error from server: {error.ErrorMessage}");

            Exception exception;
            switch (error.ErrorMessage)
            {
                case var floodMessage when floodMessage.StartsWith("FLOOD_WAIT_"):
                    var floodMessageTime = Regex.Match(floodMessage, @"\d+").Value;
                    var seconds = int.Parse(floodMessageTime);
                    exception = new FloodException(TimeSpan.FromSeconds(seconds));
                    break;

                case var phoneMigrate when phoneMigrate.StartsWith("PHONE_MIGRATE_"):
                    var phoneMigrateDcNumber = Regex.Match(phoneMigrate, @"\d+").Value;
                    var phoneMigrateDcIdx = int.Parse(phoneMigrateDcNumber);
                    exception = new PhoneMigrationException(phoneMigrateDcIdx);
                    break;

                case var fileMigrate when fileMigrate.StartsWith("FILE_MIGRATE_"):
                    var fileMigrateDcNumber = Regex.Match(fileMigrate, @"\d+").Value;
                    var fileMigrateDcIdx = int.Parse(fileMigrateDcNumber);
                    exception = new FileMigrationException(fileMigrateDcIdx);
                    break;

                case var userMigrate when userMigrate.StartsWith("USER_MIGRATE_"):
                    var userMigrateDcNumber = Regex.Match(userMigrate, @"\d+").Value;
                    var userMigrateDcIdx = int.Parse(userMigrateDcNumber);
                    exception = new UserMigrationException(userMigrateDcIdx);
                    break;

                case "PHONE_CODE_INVALID":
                    exception = new InvalidPhoneCodeException("The numeric code used to authenticate does not match the numeric code sent by SMS/Telegram");
                    break;

                case "SESSION_PASSWORD_NEEDED":
                    exception = new CloudPasswordNeededException("This Account has Cloud Password !");
                    break;

                case "AUTH_RESTART":
                    ResponseResultSetter.ReturnException(new AuthRestartException());
                    return;

                default:
                    exception = new InvalidOperationException(error.ErrorMessage);
                    break;
            }

            ResponseResultSetter.ReturnException(messageReqMsgId, exception);
        }
    }
}