text:
package de.onyxbits.weave.swing;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractAction;
import javax.swing.Action;

/**
 * An {@link Action} that that calls through to other {@link ActionListener}S.
 *
 * @author patrick
 *
 */
public class ForwardingAction extends AbstractAction {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private ActionListener receivers[];

	/**
	 * Register receivers
	 *
	 * @param receivers
	 *          the receivers to call through to. If null, the action disables
	 *          itself.
	 * @return this reference.
	 */
	public ForwardingAction forwardTo(ActionListener... receivers) {
		this.receivers = receivers;
		if (receivers == null) {
			setEnabled(false);
		}
		return this;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (receivers != null) {
			for (ActionListener receiver : receivers) {
				receiver.actionPerformed(e);
			}
		}
	}

}


text:
<?php echo theme_partial('header'); ?>

    <?php echo  $content; ?>

<?php echo theme_partial('footer'); ?>

redpajama_set_name: RedPajamaGithub


text:
<h1> Centreon Widget - Engine Status </h1>

<h2> Description </h2>

This widget displays operational metrics of a monitoring engine (latency and execution time of the checks) as well as the number of hosts and services per status.

<h2> Contributing </h2>

Please read [CONTRIBUTING.md](https://github.com/centreon/centreon/blob/master/CONTRIBUTING.md) of the main repository of Centreon project for details on our code of conduct, bug report, feature request and the process for submitting pull requests that can be applied to this repository.

<h2> License </h2>

This project is licensed under the GPL-2.0 License - see the [LICENSE.md](LICENSE.md) file for details


text:
module Tetra
  # encapsulates tar
  class Tar
    include ProcessRunner

    # decompresses a file in a target directory
    def decompress(tarfile, directory)
      result = run("tar xvf #{tarfile} --directory #{directory}")
      result.strip if result != ""
    end
  end
end


text:
var forms = require('forms')
  , fields = forms.fields
  , widgets = forms.widgets
  , validators = forms.validators
  , _ = require('underscore');

_fields = {
  'String': 'string',
  'Password': 'password',
  'Email': 'email',
  'Date': 'string',
  'Boolean': 'boolean'
}

function convert_mongoose_field(mongoose_field) {
  return fields[_fields[mongoose_field] || fields.string];
}

function get_field(path, form_name) {
  var _field = null;
  if (!(path.options && path.options.forms))
    return null;
  var forms = path.options.forms;
  if (! (
    forms[form_name] || forms['all'] || (form_name === '*' && forms._all)
  ))
    return null;

  var _options = _.extend({}, forms._all, forms.all, forms[form_name]);

  if (_options.type)
    _field = (typeof _options.type === 'string') ? fields[_options.type] : _options.type
  if (!_field)
    _field = convert_mongoose_field( path.options.type ? path.options.type.name : path.instance );
  if (!_field)
    throw new Error('Model does not have forms.type, probably on a virtual', path);
  var _fields = {}
  _options = _.defaults(_options, {
    required: ( (typeof _options.required === 'undefined') ? (path.options.required || path.options.unique) : _options.required),
    validators: []
  });
  if (path.validators)
    for (var i = path.options.required ? 1 : 0; i < path.validators.length; i ++)
      (function (validator) {
        _options.validators.push(function (form, field, callback) {
          callback(validator[0](field.value) ? undefined : validator[1]);
        });
      })(path.validators[i]);
  _fields[path.path] = null;
  if (_options.confirm) {
    var _options_confirm = _.clone(_options);
    _options_confirm.validators = _options.validators.slice(0)
    _options_confirm.validators.unshift(validators.matchField(path.path));
    _fields[path.path + '.confirm'] = _field(_options_confirm);
  }
  if(_options.existing) {
    var _options_existing = _.clone(_options);
    _options_existing.validators = [function (form, field, callback) {
      if (!form.existing)
        return callback('Server error');
      var existing = form.existing[path.path];
      if (typeof existing === 'function') {
        existing(field.data, function (err, result) {
          if (err) return callback('Server error: ' + err);
          if (!result) return callback('Does not match existing value!!!');
          callback();
        });
      } else if (form.existing[field.name] != field.data) {
          return callback('Does not match existing value!');
      } else {
        callback();
      }
    }];
    _fields[path.path + '.existing'] = _field(_options_existing);
  }
  _options.validators.unshift(function (form, field, callback) {
    if (field.data && _options.confirm)
      form.fields[path.path + '.confirm'].required = true;
    if (field.data && _options.existing)
      form.fields[path.path + '.existing'].required = true;
    callback();
  });
  _fields[path.path] = _field(_options);
  return _fields;
}

module.exports.create = function (model, extra_params, form_name) {
  var schema = model.schema
    , paths = schema.paths
    , virtuals = schema.virtuals
    , params = {};
  for (var pathName in paths) {
    var path = paths[pathName];
    var field = get_field(path, form_name);
    if (field)
      params = _.extend(params, field);
  }
  for (var virtName in virtuals) {
    var virt = virtuals[virtName];
    virt.path = virtName;
    var field = get_field(virt, form_name);
    if (field)
      params = _.extend(params, field);
  }
  params = _.extend({}, params, extra_params);
  var form = forms.create(params);
  return forms.create(params);
}

module.exports.fields = fields;
module.exports.widgets = widgets;
module.exports.validators = validators;
module.exports.createForm = function (params, extra_params) {
  params = _.extend({}, params, extra_params);
  var form = forms.create(params)
  return form;
}


text:
package com.transakk.mobile.home;

import java.util.ArrayList;
import java.util.List;

import com.transakk.mobile.R;

import android.os.Bundle;

import android.support.design.widget.TabLayout;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;

import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

public class HomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(final Bundle savedInstanceState) {

        setTheme(R.style.AppThemeBlue);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home_activity_layout);

        initToolbar();
        initViewPagerAndTabs();
    }

    private void initToolbar() {
        Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(mToolbar);
        setTitle(getString(R.string.app_transakk));
        mToolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
    }

    private void initViewPagerAndTabs() {
        ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
        PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager());
        pagerAdapter.addFragment(HomeFragment.createInstance(20), getString(R.string.tab_transaction));
        pagerAdapter.addFragment(HomeFragment.createInstance(4), getString(R.string.tab_settlement));
        pagerAdapter.addFragment(LoginFragment.createInstance(), getString(R.string.tab_mine));
        viewPager.setAdapter(pagerAdapter);

        TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
        tabLayout.setupWithViewPager(viewPager);
    }

    static class PagerAdapter extends FragmentPagerAdapter {

        private final List<Fragment> fragmentList = new ArrayList<>();
        private final List<String> fragmentTitleList = new ArrayList<>();

        public PagerAdapter(final FragmentManager fragmentManager) {
            super(fragmentManager);
        }

        public void addFragment(final Fragment fragment, final String title) {
            fragmentList.add(fragment);
            fragmentTitleList.add(title);
        }

        @Override
        public Fragment getItem(final int position) {
            return fragmentList.get(position);
        }

        @Override
        public int getCount() {
            return fragmentList.size();
        }

        @Override
        public CharSequence getPageTitle(final int position) {
            return fragmentTitleList.get(position);
        }
    }
}


text:
package org.apache.hive.service.cli.session;

import org.apache.hadoop.hive.ql.hooks.Hook;
import org.apache.hive.service.cli.HiveSQLException;

/**
 * HiveSessionHook.
 * HiveServer2 session level Hook interface. The run method is executed
 *  when session manager starts a new session
 *
 */
public interface HiveSessionHook extends Hook {

  /**
   * @param sessionHookContext context
   * @throws HiveSQLException
   */
  public void run(HiveSessionHookContext sessionHookContext) throws HiveSQLException;
}


text:
Frameworks
----------

 * `Boost <https://github.com/ruslo/hunter/wiki/pkg.boost>`_ - peer-reviewed portable C++ source libraries.
 * `Boost.process <https://github.com/ruslo/hunter/wiki/pkg.boost.process>`_
 * `Qt <https://github.com/ruslo/hunter/wiki/pkg.qt>`_
 * `QtQmlManager <https://github.com/ruslo/hunter/wiki/pkg.qt.qml.manager>`_
 * `wxWidgets <https://github.com/ruslo/hunter/wiki/pkg.wxwidgets>`_ - Cross-Platform GUI Library


text:
fw_depends ffead-cpp-nginx-mongo

#export FFEAD_CPP_PATH=$IROOT/ffead-cpp-2.0
export LD_LIBRARY_PATH=$IROOT:$FFEAD_CPP_PATH/lib:$LD_LIBRARY_PATH
export ODBCINI=${IROOT}/odbc.ini
export ODBCSYSINI=${IROOT}
echo $FFEAD_CPP_PATH
echo $LD_LIBRARY_PATH
rm -f $FFEAD_CPP_PATH/*.cntrl
rm -f $FFEAD_CPP_PATH/tmp/*.sess
nginx > ffead.log 2>&1


text:
.class public Landroid/graphics/drawable/ScaleDrawable;
.super Landroid/graphics/drawable/Drawable;
.source "ScaleDrawable.java"

# interfaces
.implements Landroid/graphics/drawable/Drawable$Callback;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/graphics/drawable/ScaleDrawable$1;,
        Landroid/graphics/drawable/ScaleDrawable$ScaleState;
    }
.end annotation

# instance fields
.field private mMutated:Z

.field private mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

.field private final mTmpRect:Landroid/graphics/Rect;

# direct methods
.method constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 53
    invoke-direct {p0, v0, v0}, Landroid/graphics/drawable/ScaleDrawable;-><init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/content/res/Resources;)V

    .line 54
    return-void
.end method

.method public constructor <init>(Landroid/graphics/drawable/Drawable;IFF)V
    .locals 1
    .parameter "drawable"
    .parameter "gravity"
    .parameter "scaleWidth"
    .parameter "scaleHeight"

    .prologue
    const/4 v0, 0x0

    .line 57
    invoke-direct {p0, v0, v0}, Landroid/graphics/drawable/ScaleDrawable;-><init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/content/res/Resources;)V

    .line 59
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput-object p1, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    .line 60
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput p2, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mGravity:I

    .line 61
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput p3, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleWidth:F

    .line 62
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput p4, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleHeight:F

    .line 64
    if-eqz p1, :cond_0

    .line 65
    invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 67
    :cond_0
    return-void
.end method

.method private constructor <init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/content/res/Resources;)V
    .locals 1
    .parameter "state"
    .parameter "res"

    .prologue
    .line 313
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable;-><init>()V

    .line 50
    new-instance v0, Landroid/graphics/Rect;

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

    iput-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mTmpRect:Landroid/graphics/Rect;

    .line 314
    new-instance v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    invoke-direct {v0, p1, p0, p2}, Landroid/graphics/drawable/ScaleDrawable$ScaleState;-><init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/graphics/drawable/ScaleDrawable;Landroid/content/res/Resources;)V

    iput-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    .line 315
    return-void
.end method

.method synthetic constructor <init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/content/res/Resources;Landroid/graphics/drawable/ScaleDrawable$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"

    .prologue
    .line 47
    invoke-direct {p0, p1, p2}, Landroid/graphics/drawable/ScaleDrawable;-><init>(Landroid/graphics/drawable/ScaleDrawable$ScaleState;Landroid/content/res/Resources;)V

    return-void
.end method

.method private static getPercent(Landroid/content/res/TypedArray;I)F
    .locals 4
    .parameter "a"
    .parameter "name"

    .prologue
    .line 77
    invoke-virtual {p0, p1}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;

    move-result-object v1

    .line 78
    .local v1, s:Ljava/lang/String;
    if-eqz v1, :cond_0

    .line 79
    const-string v2, "%"

    invoke-virtual {v1, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 80
    const/4 v2, 0x0

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v3

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

    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 81
    .local v0, f:Ljava/lang/String;
    invoke-static {v0}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v2

    const/high16 v3, 0x42c8

    div-float/2addr v2, v3

    .line 84
    .end local v0           #f:Ljava/lang/String;
    :goto_0
    return v2

    :cond_0
    const/high16 v2, -0x4080

    goto :goto_0
.end method

# virtual methods
.method public draw(Landroid/graphics/Canvas;)V
    .locals 1
    .parameter "canvas"

    .prologue
    .line 152
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getLevel()I

    move-result v0

    if-eqz v0, :cond_0

    .line 153
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 154
    :cond_0
    return-void
.end method

.method public getChangingConfigurations()I
    .locals 2

    .prologue
    .line 158
    invoke-super {p0}, Landroid/graphics/drawable/Drawable;->getChangingConfigurations()I

    move-result v0

    iget-object v1, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v1, v1, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mChangingConfigurations:I

    or-int/2addr v0, v1

    iget-object v1, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v1, v1, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getChangingConfigurations()I

    move-result v1

    or-int/2addr v0, v1

    return v0
.end method

.method public getConstantState()Landroid/graphics/drawable/Drawable$ConstantState;
    .locals 2

    .prologue
    .line 245
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    invoke-virtual {v0}, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->canConstantState()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 246
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getChangingConfigurations()I

    move-result v1

    iput v1, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mChangingConfigurations:I

    .line 247
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    .line 249
    :goto_0
    return-object v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getDrawable()Landroid/graphics/drawable/Drawable;
    .locals 1

    .prologue
    .line 73
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    return-object v0
.end method

.method public getIntrinsicHeight()I
    .locals 1

    .prologue
    .line 240
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v0

    return v0
.end method

.method public getIntrinsicWidth()I
    .locals 1

    .prologue
    .line 235
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v0

    return v0
.end method

.method public getOpacity()I
    .locals 1

    .prologue
    .line 187
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getOpacity()I

    move-result v0

    return v0
.end method

.method public getPadding(Landroid/graphics/Rect;)Z
    .locals 1
    .parameter "padding"

    .prologue
    .line 166
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z

    move-result v0

    return v0
.end method

.method public inflate(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)V
    .locals 10
    .parameter "r"
    .parameter "parser"
    .parameter "attrs"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/xmlpull/v1/XmlPullParserException;,
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 90
    invoke-super {p0, p1, p2, p3}, Landroid/graphics/drawable/Drawable;->inflate(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)V

    .line 94
    sget-object v8, Lcom/android/internal/R$styleable;->ScaleDrawable:[I

    invoke-virtual {p1, p3, v8}, Landroid/content/res/Resources;->obtainAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 96
    .local v0, a:Landroid/content/res/TypedArray;
    const/4 v8, 0x1

    invoke-static {v0, v8}, Landroid/graphics/drawable/ScaleDrawable;->getPercent(Landroid/content/res/TypedArray;I)F

    move-result v6

    .line 97
    .local v6, sw:F
    const/4 v8, 0x2

    invoke-static {v0, v8}, Landroid/graphics/drawable/ScaleDrawable;->getPercent(Landroid/content/res/TypedArray;I)F

    move-result v5

    .line 98
    .local v5, sh:F
    const/4 v8, 0x3

    const/4 v9, 0x3

    invoke-virtual {v0, v8, v9}, Landroid/content/res/TypedArray;->getInt(II)I

    move-result v2

    .line 99
    .local v2, g:I
    const/4 v8, 0x4

    const/4 v9, 0x0

    invoke-virtual {v0, v8, v9}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v3

    .line 101
    .local v3, min:Z
    const/4 v8, 0x0

    invoke-virtual {v0, v8}, Landroid/content/res/TypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    .line 103
    .local v1, dr:Landroid/graphics/drawable/Drawable;
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 105
    invoke-interface {p2}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I

    move-result v4

    .line 107
    .local v4, outerDepth:I
    :cond_0
    :goto_0
    invoke-interface {p2}, Lorg/xmlpull/v1/XmlPullParser;->next()I

    move-result v7

    .local v7, type:I
    const/4 v8, 0x1

    if-eq v7, v8, :cond_2

    const/4 v8, 0x3

    if-ne v7, v8, :cond_1

    invoke-interface {p2}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I

    move-result v8

    if-le v8, v4, :cond_2

    .line 108
    :cond_1
    const/4 v8, 0x2

    if-ne v7, v8, :cond_0

    .line 111
    invoke-static {p1, p2, p3}, Landroid/graphics/drawable/Drawable;->createFromXmlInner(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    goto :goto_0

    .line 114
    :cond_2
    if-nez v1, :cond_3

    .line 115
    new-instance v8, Ljava/lang/IllegalArgumentException;

    const-string v9, "No drawable specified for <scale>"

    invoke-direct {v8, v9}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v8

    .line 118
    :cond_3
    iget-object v8, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput-object v1, v8, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    .line 119
    iget-object v8, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput v6, v8, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleWidth:F

    .line 120
    iget-object v8, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput v5, v8, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleHeight:F

    .line 121
    iget-object v8, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput v2, v8, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mGravity:I

    .line 122
    iget-object v8, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iput-boolean v3, v8, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mUseIntrinsicSizeAsMin:Z

    .line 123
    if-eqz v1, :cond_4

    .line 124
    invoke-virtual {v1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 126
    :cond_4
    return-void
.end method

.method public invalidateDrawable(Landroid/graphics/drawable/Drawable;)V
    .locals 1
    .parameter "who"

    .prologue
    .line 131
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 132
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    invoke-interface {v0, p0}, Landroid/graphics/drawable/Drawable$Callback;->invalidateDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 134
    :cond_0
    return-void
.end method

.method public isStateful()Z
    .locals 1

    .prologue
    .line 192
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isStateful()Z

    move-result v0

    return v0
.end method

.method public mutate()Landroid/graphics/drawable/Drawable;
    .locals 1

    .prologue
    .line 254
    iget-boolean v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mMutated:Z

    if-nez v0, :cond_0

    invoke-super {p0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    if-ne v0, p0, :cond_0

    .line 255
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;

    .line 256
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mMutated:Z

    .line 258
    :cond_0
    return-object p0
.end method

.method protected onBoundsChange(Landroid/graphics/Rect;)V
    .locals 13
    .parameter "bounds"

    .prologue
    const/4 v0, 0x0

    const v12, 0x461c4000

    const/4 v11, 0x0

    .line 212
    iget-object v4, p0, Landroid/graphics/drawable/ScaleDrawable;->mTmpRect:Landroid/graphics/Rect;

    .line 213
    .local v4, r:Landroid/graphics/Rect;
    iget-object v3, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-boolean v9, v3, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mUseIntrinsicSizeAsMin:Z

    .line 214
    .local v9, min:Z
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getLevel()I

    move-result v8

    .line 215
    .local v8, level:I
    invoke-virtual {p1}, Landroid/graphics/Rect;->width()I

    move-result v1

    .line 216
    .local v1, w:I
    iget-object v3, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v3, v3, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleWidth:F

    cmpl-float v3, v3, v11

    if-lez v3, :cond_0

    .line 217
    if-eqz v9, :cond_3

    iget-object v3, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v3, v3, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v7

    .line 218
    .local v7, iw:I
    :goto_0
    sub-int v3, v1, v7

    rsub-int v10, v8, 0x2710

    mul-int/2addr v3, v10

    int-to-float v3, v3

    iget-object v10, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v10, v10, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleWidth:F

    mul-float/2addr v3, v10

    div-float/2addr v3, v12

    float-to-int v3, v3

    sub-int/2addr v1, v3

    .line 220
    .end local v7           #iw:I
    :cond_0
    invoke-virtual {p1}, Landroid/graphics/Rect;->height()I

    move-result v2

    .line 221
    .local v2, h:I
    iget-object v3, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v3, v3, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleHeight:F

    cmpl-float v3, v3, v11

    if-lez v3, :cond_1

    .line 222
    if-eqz v9, :cond_4

    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v6

    .line 223
    .local v6, ih:I
    :goto_1
    sub-int v0, v2, v6

    rsub-int v3, v8, 0x2710

    mul-int/2addr v0, v3

    int-to-float v0, v0

    iget-object v3, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v3, v3, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mScaleHeight:F

    mul-float/2addr v0, v3

    div-float/2addr v0, v12

    float-to-int v0, v0

    sub-int/2addr v2, v0

    .line 225
    .end local v6           #ih:I
    :cond_1
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getResolvedLayoutDirectionSelf()I

    move-result v5

    .line 226
    .local v5, layoutDirection:I
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mGravity:I

    move-object v3, p1

    invoke-static/range {v0 .. v5}, Landroid/view/Gravity;->apply(IIILandroid/graphics/Rect;Landroid/graphics/Rect;I)V

    .line 228
    if-lez v1, :cond_2

    if-lez v2, :cond_2

    .line 229
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    iget v3, v4, Landroid/graphics/Rect;->left:I

    iget v10, v4, Landroid/graphics/Rect;->top:I

    iget v11, v4, Landroid/graphics/Rect;->right:I

    iget v12, v4, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {v0, v3, v10, v11, v12}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 231
    :cond_2
    return-void

    .end local v2           #h:I
    .end local v5           #layoutDirection:I
    :cond_3
    move v7, v0

    .line 217
    goto :goto_0

    .restart local v2       #h:I
    :cond_4
    move v6, v0

    .line 222
    goto :goto_1
.end method

.method protected onLevelChange(I)Z
    .locals 1
    .parameter "level"

    .prologue
    .line 204
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setLevel(I)Z

    .line 205
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v0

    invoke-virtual {p0, v0}, Landroid/graphics/drawable/ScaleDrawable;->onBoundsChange(Landroid/graphics/Rect;)V

    .line 206
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->invalidateSelf()V

    .line 207
    const/4 v0, 0x1

    return v0
.end method

.method protected onStateChange([I)Z
    .locals 2
    .parameter "state"

    .prologue
    .line 197
    iget-object v1, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v1, v1, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    move-result v0

    .line 198
    .local v0, changed:Z
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v1

    invoke-virtual {p0, v1}, Landroid/graphics/drawable/ScaleDrawable;->onBoundsChange(Landroid/graphics/Rect;)V

    .line 199
    return v0
.end method

.method public scheduleDrawable(Landroid/graphics/drawable/Drawable;Ljava/lang/Runnable;J)V
    .locals 1
    .parameter "who"
    .parameter "what"
    .parameter "when"

    .prologue
    .line 137
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 138
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    invoke-interface {v0, p0, p2, p3, p4}, Landroid/graphics/drawable/Drawable$Callback;->scheduleDrawable(Landroid/graphics/drawable/Drawable;Ljava/lang/Runnable;J)V

    .line 140
    :cond_0
    return-void
.end method

.method public setAlpha(I)V
    .locals 1
    .parameter "alpha"

    .prologue
    .line 177
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 178
    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .locals 1
    .parameter "cf"

    .prologue
    .line 182
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    .line 183
    return-void
.end method

.method public setVisible(ZZ)Z
    .locals 1
    .parameter "visible"
    .parameter "restart"

    .prologue
    .line 171
    iget-object v0, p0, Landroid/graphics/drawable/ScaleDrawable;->mScaleState:Landroid/graphics/drawable/ScaleDrawable$ScaleState;

    iget-object v0, v0, Landroid/graphics/drawable/ScaleDrawable$ScaleState;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1, p2}, Landroid/graphics/drawable/Drawable;->setVisible(ZZ)Z

    .line 172
    invoke-super {p0, p1, p2}, Landroid/graphics/drawable/Drawable;->setVisible(ZZ)Z

    move-result v0

    return v0
.end method

.method public unscheduleDrawable(Landroid/graphics/drawable/Drawable;Ljava/lang/Runnable;)V
    .locals 1
    .parameter "who"
    .parameter "what"

    .prologue
    .line 143
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 144
    invoke-virtual {p0}, Landroid/graphics/drawable/ScaleDrawable;->getCallback()Landroid/graphics/drawable/Drawable$Callback;

    move-result-object v0

    invoke-interface {v0, p0, p2}, Landroid/graphics/drawable/Drawable$Callback;->unscheduleDrawable(Landroid/graphics/drawable/Drawable;Ljava/lang/Runnable;)V

    .line 146
    :cond_0
    return-void
.end method


text:
<?php
	class MarkdownifyComponent extends Object {

		/**
		 * Define the Markdownify varaible.
		 */
		public $markdownify;

		/**
		 * Import the Markdownify vendor files and instantiate the object.
		 */
		public function __construct() {

			/**
			 * Import the Markdownify vendor files.
			 */
			App::import('Vendor', 'markdownify/markdownify');

			/**
			 * instantiate the Mardownify object.
			 */
			$this->markdownify = new Markdownify;
		}

	  /**
	   * parse a HTML string
	   *
	   * @param string $html
	   * @return string markdown formatted
	   */
		public function parseString($htmlInput) {
			return $this->markdownify->parseString($htmlInput);
		}
	}
?>


text:
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus

#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
typedef void (GLE_FUNCPTR * PFNGLVERTEXATTRIBDIVISORPROC)(GLuint , GLuint );

extern PFNGLVERTEXATTRIBDIVISORPROC __gleVertexAttribDivisor;
#define glVertexAttribDivisor __gleVertexAttribDivisor

#ifdef __cplusplus
}
#endif //__cplusplus

#endif //_INT_GL_3_3_H


text:
namespace CAPNet
{
    /// <summary>
    ///
    /// </summary>
    public class MessageTypeRejectionError : Error
    {
    }
}


text:
#import "TiBase.h"

#ifdef USE_TI_UIIPADSPLITWINDOW
#ifndef USE_TI_UIIPADSPLITWINDOWBUTTON
#define USE_TI_UIIPADSPLITWINDOWBUTTON
#endif

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2

#import "TiUIiPadSplitWindow.h"
#import "TiUtils.h"
#import "TiViewController.h"
#import "TiApp.h"
#import "TiUIiPadPopoverProxy.h"

#ifdef USE_TI_UIIPADSPLITWINDOWBUTTON
#import "TiUIiPadSplitWindowButtonProxy.h"
#endif

UIViewController * ControllerForProxy(TiViewProxy * proxy);

UIViewController * ControllerForProxy(TiViewProxy * proxy)
{
	if([proxy respondsToSelector:@selector(controller)])
	{
	//	return [(TiWindowProxy *)proxy controller];
	}

	[[proxy view] setAutoresizingMask:UIViewAutoresizingNone];

	return [[[TiViewController alloc] initWithViewProxy:proxy] autorelease];
}

@implementation TiUIiPadSplitWindow

-(void)dealloc
{
	RELEASE_TO_NIL(controller);
	[super dealloc];
}

-(UIViewController*)controller
{
	if (controller==nil)
	{
		TiViewProxy* masterProxy = [self.proxy valueForUndefinedKey:@"masterView"];
		TiViewProxy* detailProxy = [self.proxy valueForUndefinedKey:@"detailView"];

		controller = [[MGSplitViewController alloc] init];
		[controller setViewControllers:[NSArray arrayWithObjects:
				ControllerForProxy(masterProxy),ControllerForProxy(detailProxy),nil]];

		controller.delegate = self;

		UIView * controllerView = [controller view];

		[controllerView setFrame:[self bounds]];
		[self addSubview:controllerView];

		[controller viewWillAppear:NO];

		[controller willAnimateRotationToInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation] duration:0.0];

		[masterProxy windowWillOpen];
		[masterProxy windowDidOpen];

		[detailProxy windowWillOpen];
		[detailProxy windowDidOpen];

		[controller viewDidAppear:NO];
	}
	return controller;
}

-(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds
{
	[[[self controller] view] setFrame:bounds];
}

//FIXME - probably should remove this ... not sure...

-(void)setToolbar:(id)items withObject:(id)properties
{
	BOOL animated = [TiUtils boolValue:@"animated" properties:properties def:YES];
	UINavigationController*c = [[controller viewControllers] objectAtIndex:1];
	UIViewController *vc = [[c viewControllers] objectAtIndex:0];

	if (items!=nil)
	{
		NSMutableArray *array = [NSMutableArray array];
		for (TiViewProxy *proxy in items)
		{
			if ([proxy supportsNavBarPositioning])
			{
				// detach existing one
				UIBarButtonItem *item = [proxy barButtonItem];
				[array addObject:item];
			}
			else
			{
				NSString *msg = [NSString stringWithFormat:@"%@ doesn't support positioning on the nav bar",proxy];
				THROW_INVALID_ARG(msg);
			}
		}
		[vc setToolbarItems:array animated:animated];
		[c setToolbarHidden:NO animated:animated];
	}
	else
	{
		[vc setToolbarItems:nil animated:animated];
		[c setToolbarHidden:YES animated:animated];
	}
}

#pragma mark Split Window properties

-(void)setMasterPopupVisible_:(id)value
{
	BOOL showPopover = [TiUtils boolValue:value def:NO];
	MGSplitViewController * splitController = (MGSplitViewController *)[self controller];
	BOOL masterInSplit = [splitController isShowingMaster];

	if (masterInSplit)
	{
		[[self proxy] replaceValue:NUMBOOL(NO) forKey:@"masterPopupVisibile" notification:NO];
		return;
	}

	if (showPopover)
	{
		[splitController showMasterPopover:self];
	}
	else
	{
		[splitController hideMasterPopover:self];
	}
}

-(void)setShowMasterInPortrait_:(id)value
{
    BOOL showMaster = [TiUtils boolValue:value def:NO];
    MGSplitViewController* splitController = (MGSplitViewController*)[self controller];
    [splitController setShowsMasterInPortrait:showMaster];

    [[self proxy] replaceValue:value forKey:@"showMasterInPortrait" notification:NO];
}

#pragma mark Delegate

- (void)splitViewController:(UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)pc
{
	[[self proxy] replaceValue:NUMBOOL(NO) forKey:@"masterPopupVisibile" notification:NO];
	if ([self.proxy _hasListeners:@"visible"])
	{
		NSMutableDictionary *event = [NSMutableDictionary dictionaryWithObject:@"detail" forKey:@"view"];
#ifdef USE_TI_UIIPADSPLITWINDOWBUTTON
		TiUIiPadSplitWindowButtonProxy *button = [[TiUIiPadSplitWindowButtonProxy alloc] initWithButton:barButtonItem pageContext:[self.proxy pageContext]];
		[event setObject:button forKey:@"button"];
		[button release];
#endif
		[self.proxy fireEvent:@"visible" withObject:event];
	}
}

- (void)splitViewController:(UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)button
{
	[[self proxy] replaceValue:NUMBOOL(NO) forKey:@"masterPopupVisibile" notification:NO];
	if ([self.proxy _hasListeners:@"visible"])
	{
		NSDictionary *event = [NSDictionary dictionaryWithObject:@"master" forKey:@"view"];
		[self.proxy fireEvent:@"visible" withObject:event];
	}
}

- (void)splitViewController:(UISplitViewController*)svc popoverController:(UIPopoverController*)pc willPresentViewController:(UIViewController *)aViewController
{
	[[self proxy] replaceValue:NUMBOOL(YES) forKey:@"masterPopupVisibile" notification:NO];
	if ([self.proxy _hasListeners:@"visible"])
	{
		NSMutableDictionary *event = [NSMutableDictionary dictionaryWithObject:@"popover" forKey:@"view"];
		[self.proxy fireEvent:@"visible" withObject:event];
	}
}

@end

#endif

#endif


text:
@import Foundation;

@interface CFooInfo: NSObject
+ (nonnull NSString*)name;
@end


text:
<?php

namespace DvsaMotTestTest\Mapper;

use Dvsa\Mot\ApiClient\Resource\Item\DvsaVehicle;
use Dvsa\Mot\ApiClient\Resource\Item\MotTest;
use Dvsa\Mot\ApiClient\Resource\Item\WeightSource;
use DvsaCommon\Dto\BrakeTest\BrakeTestConfigurationClass3AndAboveDto;
use DvsaCommon\Enum\BrakeTestTypeCode;
use DvsaCommon\Enum\VehicleClassCode;
use DvsaCommon\Enum\WeightSourceCode;
use DvsaCommonTest\TestUtils\XMock;
use DvsaMotTest\Mapper\BrakeTestConfigurationClass3AndAboveMapper;
use DvsaMotTest\Specification\OfficialWeightSourceForVehicle;
use DvsaMotTestTest\TestHelper\Fixture;
use Dvsa\Mot\Frontend\Test\TestCase;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Matcher\InvokedRecorder;

/**
 * Tests for BrakeTestConfigurationClass3AndAboveMapper.
 */
class BrakeTestConfigurationClass3AndAboveMapperTest extends TestCase
{
    const DEFAULT_VEHICLE_WEIGHT = '1111';
    const DEFAULT_VEHICLE_WEIGHT_SOURCE = WeightSourceCode::VSI;

    /** @var BrakeTestConfigurationClass3AndAboveMapper */
    private $mapper;
    /** @var OfficialWeightSourceForVehicle|MockObject */
    private $officialWeightSourceForVehicle;
    /** @var DvsaVehicle|MockObject*/
    private $dvsaVehicle;

    public function setup()
    {
        $this->officialWeightSourceForVehicle = XMock::of(OfficialWeightSourceForVehicle::class);
        $this->mapper = new BrakeTestConfigurationClass3AndAboveMapper(
            $this->officialWeightSourceForVehicle
        );
        $this->dvsaVehicle = XMock::of(DvsaVehicle::class);
    }

    public function testMapToDto()
    {
        $testData = $this->getStandardMapInputData();
        $expected = $this->getStandardMapOutputDto();

        $actual = $this->mapper->mapToDto($testData);

        $this->assertEquals($expected, $actual);
    }

    public function testMapToDtoWith2ServiceBrakeControls()
    {
        $testData = $this->getStandardMapInputData();
        $testData['serviceBrakeControlsCount'] = '2';

        $expected = $this->getStandardMapOutputDto()
            ->setServiceBrake2TestType(BrakeTestTypeCode::ROLLER)
            ->setServiceBrakeControlsCount(2);

        $actual = $this->mapper->mapToDto($testData);

        $this->assertEquals($expected, $actual);
    }

    public function testMapToDtoWithInvalidInput()
    {
        $this->expectException(\InvalidArgumentException::class);

        $this->mapper->mapToDto(null);
    }

    /**
     * @param $specValue
     * @param $specInvocations
     * @param $expectedVehicleWeight
     *
     * @dataProvider mapToDefaultDto_withMotTestWithoutBrakeTestResultDP
     */
    public function testMapToDefaultDto_withMotTestWithoutBrakeTestResult(
        $specValue,
        $specInvocations,
        $expectedVehicleWeight
    )
    {
        $motTestData = Fixture::getMotTestDataVehicleClass4(true);
        $this->withOfficialWeightSourceSpec($specValue, $specInvocations);
        $this->withDvsaVehicle($expectedVehicleWeight);
        /*
         * this is the case when a new MOT Test does not have brake test submitted
         * vehicle weight should be empty in the dto because there is no source of brake tests
         * to populate the field in DTO
         *
         * @see BrakeTestConfigurationClass3AndAboveMapper @ mapToDefaultDto()
         */
        $motTestData->brakeTestResult = null;

        $motTest = new MotTest($motTestData);
        $expected = $this->getDefaultDto()
            ->setVehicleWeight($expectedVehicleWeight); // vehicle weight from previous mot test (see fixture file)

        //with new Brake Test Weight logic we don't populate default value (VSI for class 3,4) when Vehicle has no weight
        $expected->setWeightType(null);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);

        $this->assertEquals($expected, $actual);
    }

    public function mapToDefaultDto_withMotTestWithoutBrakeTestResultDP()
    {
        return [
            // specValue, specIC, expectedWeight
            [true, 1, self::DEFAULT_VEHICLE_WEIGHT],
            [false, 1, null],
        ];
    }

    public function testMapToDefaultDto_withMotTestContainingDefaultBreakTestValues()
    {
        $vehicleWeight = '3000';
        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::VSI);

        $motTestData = Fixture::getMotTestDataVehicleClass4(true);

        $motTest = new MotTest($motTestData);
        $expected = $this->getDefaultDto()
            ->setVehicleWeight($vehicleWeight);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);

        $this->assertEquals($expected, $actual);
    }

    public function testMapToDefaultDtoWithVehicleWeightDefault()
    {
        $vehicleWeight = '1800';
        $motTestData = Fixture::getMotTestDataVehicleClass4(true);
        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::VSI);

        $motTest = new MotTest($motTestData);
        $expected = $this->getDefaultDto()->setVehicleWeight($vehicleWeight);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);

        $this->assertEquals($expected, $actual);
    }

    public function testShouldReturnWeightTypeDGWForVehicleClass7AndWeightGreaterThan0()
    {
        $vehicleWeight = '3000';

        $expected = $this->getDefaultDto()->setVehicleWeight($vehicleWeight)->setWeightType(WeightSourceCode::DGW);

        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::DGW);
        $motTestData = Fixture::getMotTestDataVehicleClass4(true);

        $motTest = new MotTest($motTestData);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);
        $this->assertEquals($expected, $actual);
    }

    public function testShouldReturnWeightTypeVSIForVehicleClass7AndWeightEqual0()
    {
        $vehicleWeight = 0;

        $expected = $this->getDefaultDto()
            ->setVehicleWeight($vehicleWeight)
            ->setWeightType(WeightSourceCode::VSI);

        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::VSI);

        $motTestData = Fixture::getMotTestDataVehicleClass4(true);

        $motTest = new MotTest($motTestData);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);
        $this->assertEquals($expected, $actual);
    }

    public function testShouldReturnWeightTypeVSIForVehicleClass7AndWeightEqualNull()
    {
        $vehicleWeight = null;

        $motTestData = Fixture::getMotTestDataVehicleClass4(true);

        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::VSI);

        $motTest = new MotTest($motTestData);

        $expected = $this->getDefaultDto()
            ->setVehicleWeight(null)
            ->setWeightType(WeightSourceCode::VSI);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);
        $this->assertEquals($expected, $actual);
    }

    public function testShouldReturnDefaultVSIWeightTypeFoClass4Vehicles()
    {
        $vehicleWeight = null;

        $motTestData = Fixture::getMotTestDataVehicleClass4(true);

        $this->withOfficialWeightSourceSpec(true);
        $this->withDvsaVehicle($vehicleWeight, WeightSourceCode::VSI);

        $motTest = new MotTest($motTestData);

        $expected = $this->getDefaultDto()->setWeightType(WeightSourceCode::VSI);

        $actual = $this->mapper->mapToDefaultDto($motTest, $this->dvsaVehicle);
        $this->assertEquals($expected, $actual);
    }

    /**
     * @return array
     */
    private function getStandardMapInputData()
    {
        return [
            'serviceBrake1TestType' => BrakeTestTypeCode::ROLLER,
            'positionOfSingleWheel' => BrakeTestConfigurationClass3AndAboveMapper::LOCATION_FRONT,
            'parkingBrakeTestType' => BrakeTestTypeCode::ROLLER,
            'weightType' => WeightSourceCode::VSI,
            'vehicleWeight' => '1400',
            'weightIsUnladen' => '1',
            'brakeLineType' => BrakeTestConfigurationClass3AndAboveMapper::BRAKE_LINE_TYPE_SINGLE,
            'vehiclePurposeType' => BrakeTestConfigurationClass3AndAboveMapper::VEHICLE_PURPOSE_TYPE_COMMERCIAL,
            'parkingBrakeWheelsCount' => '1',
            'serviceBrakeControlsCount' => '1',
            'numberOfAxles' => '2',
            'parkingBrakeNumberOfAxles' => '1',
            'vehicleClass' => VehicleClassCode::CLASS_4,
        ];
    }

    /**
     * @return BrakeTestConfigurationClass3AndAboveDto
     */
    private function getStandardMapOutputDto()
    {
        return (new BrakeTestConfigurationClass3AndAboveDto())
            ->setServiceBrake1TestType(BrakeTestTypeCode::ROLLER)
            ->setServiceBrake2TestType(null)
            ->setParkingBrakeTestType(BrakeTestTypeCode::ROLLER)
            ->setWeightType(WeightSourceCode::VSI)
            ->setVehicleWeight('1400')
            ->setWeightIsUnladen(true)
            ->setServiceBrakeIsSingleLine(true)
            ->setIsCommercialVehicle(true)
            ->setIsSingleInFront(true)
            ->setIsParkingBrakeOnTwoWheels(false)
            ->setServiceBrakeControlsCount(1)
            ->setNumberOfAxles(2)
            ->setParkingBrakeNumberOfAxles(1)
            ->setVehicleClass(VehicleClassCode::CLASS_4);
    }

    /**
     * This returns the default DTO generated by
     * BrakeTestConfigurationClass3AndAboveMapper @ mapToDefaultDto().
     *
     * @return BrakeTestConfigurationClass3AndAboveDto
     */
    private function getDefaultDto()
    {
        return (new BrakeTestConfigurationClass3AndAboveDto())
            ->setServiceBrake1TestType(BrakeTestTypeCode::ROLLER)
            ->setServiceBrake2TestType(null)
            ->setParkingBrakeTestType(BrakeTestTypeCode::ROLLER)
            ->setWeightType(WeightSourceCode::VSI)
            ->setWeightIsUnladen(false)
            ->setServiceBrakeIsSingleLine(false)
            ->setIsCommercialVehicle(false)
            ->setIsSingleInFront(true)
            ->setIsParkingBrakeOnTwoWheels(false)
            ->setServiceBrakeControlsCount(1)
            ->setNumberOfAxles(2)
            ->setParkingBrakeNumberOfAxles(1)
            ->setVehicleWeight('');
    }

    /**
     * @param $returnValue
     * @param int $invocationCount
     */
    private function withOfficialWeightSourceSpec($returnValue, $invocationCount = 1)
    {
        $this->officialWeightSourceForVehicle
            ->expects($this->convertInvocationCount($invocationCount))
            ->method('isSatisfiedBy')
            ->willReturn($returnValue);
    }

    /**
     * @param $count
     * @return InvokedRecorder
     */
    private function convertInvocationCount($count)
    {
        switch((int)$count){
            case 0:
                return $this->never();
            case 1:
                return $this->once();
            case 2:
                return $this->exactly(2);
            default:
                return $this->any();
        }
    }

    private function withDvsaVehicle($vehicleWeight = null, $weightSourceCode = null)
    {
        $this->dvsaVehicle
            ->expects($this->any())
            ->method('getWeight')
            ->willReturn($vehicleWeight);

        $weightSource = XMock::of(WeightSource::class);
        $weightSource
            ->expects($this->any())
            ->method('getCode')
            ->willReturn($weightSourceCode);

        $this->dvsaVehicle
            ->expects($this->any())
            ->method('getWeightSource')
            ->willReturn($weightSource);

    }
}


text:
#ifndef INTERFACE_H
#define INTERFACE_H

// C/C++ Standard Library
#include <map>
#include <string>

// libpit
#include "libpit.h"

// Heimdall
#include "Heimdall.h"

namespace Heimdall
{
	namespace Interface
	{
		typedef int (*ActionExecuteFunction)(int, char **);

		typedef struct ActionInfo
		{
			ActionExecuteFunction executeFunction;
			const char *usage;

			ActionInfo()
			{
				executeFunction = nullptr;
				usage = nullptr;
			}

			ActionInfo(ActionExecuteFunction executeFunction, const char *usage)
			{
				this->executeFunction = executeFunction;
				this->usage = usage;
			}

		} ActionInfo;

		const std::map<std::string, ActionInfo>& GetActionMap(void);

		void Print(const char *format, ...);
		void PrintWarning(const char *format, ...);
		void PrintWarningSameLine(const char *format, ...);
		void PrintError(const char *format, ...);
		void PrintErrorSameLine(const char *format, ...);

		void PrintVersion(void);
		void PrintUsage(void);
		void PrintReleaseInfo(void);
		void PrintFullInfo(void);

		void PrintDeviceDetectionFailed(void);

		void PrintPit(const libpit::PitData *pitData);

		void SetStdoutErrors(bool enabled);
	};
}

#endif


text:
```
$ sudo update-rc.d script_name defaults 99
```

## Remove Links
```
$ sudo update-rc.d -f script_name remove
```


text:
using System;
using Xwt.Drawing;
using System.Collections.Generic;

namespace Xwt.Backends
{
	public abstract class ContextBackendHandler: DrawingPathBackendHandler
	{
		public abstract void Save (object backend);

		public abstract void Restore (object backend);

		public abstract void Clip (object backend);

		public abstract void ClipPreserve(object backend);

		public abstract void Fill (object backend);

		public abstract void FillPreserve (object backend);

		public abstract void NewPath (object backend);

		public abstract void Stroke (object backend);

		public abstract void StrokePreserve (object backend);

		public abstract void SetColor (object backend, Xwt.Drawing.Color color);

		public abstract void SetLineWidth (object backend, double width);

		public abstract void SetLineDash (object backend, double offset, params double[] pattern);

		public abstract void SetPattern (object backend, object p);

		public abstract void DrawTextLayout (object backend, TextLayout layout, double x, double y);

		public abstract void DrawImage (object backend, ImageDescription img, double x, double y);

		public abstract void DrawImage (object backend, ImageDescription img, Rectangle srcRect, Rectangle destRect);

		public abstract void Rotate (object backend, double angle);

		public abstract void Scale (object backend, double scaleX, double scaleY);

		public abstract void Translate (object backend, double tx, double ty);

		public abstract void ModifyCTM (object backend, Matrix transform);

		public abstract Matrix GetCTM (object backend);

		public abstract bool IsPointInStroke (object backend, double x, double y);

		/// <summary>
		/// Sets a global alpha to be applied to all drawing operations.
		/// It doesn't affect colors that have already been set.
		/// </summary>
		public abstract void SetGlobalAlpha (object backend, double globalAlpha);

		public abstract double GetScaleFactor (object backend);

		public abstract void SetStyles (object backend, StyleSet styles);
	}
}


text:
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using InvokeIR.Win32;

namespace InvokeIR.PowerForensics.Ntfs
{
    #region UsnJrnlClass

    public class UsnJrnl
    {
        #region Enums

        [FlagsAttribute]
        public enum USN_REASON : uint
        {
            DATA_OVERWRITE = 0x00000001,
            DATA_EXTEND = 0x00000002,
            DATA_TRUNCATION = 0x00000004,
            NAMED_DATA_OVERWRITE = 0x00000010,
            NAMED_DATA_EXTEND = 0x00000020,
            NAMED_DATA_TRUNCATION = 0x00000040,
            FILE_CREATE = 0x00000100,
            FILE_DELETE = 0x00000200,
            EA_CHANGE = 0x00000400,
            SECURITY_CHANGE = 0x00000800,
            RENAME_OLD_NAME = 0x00001000,
            RENAME_NEW_NAME = 0x00002000,
            INDEXABLE_CHANGE = 0x00004000,
            BASIC_INFO_CHANGE = 0x00008000,
            HARD_LINK_CHANGE = 0x00010000,
            COMPRESSION_CHANGE = 0x00020000,
            ENCRYPTION_CHANGE = 0x00040000,
            OBJECT_ID_CHANGE = 0x00080000,
            REPARSE_POINT_CHANGE = 0x00100000,
            STREAM_CHANGE = 0x00200000,
            CLOSE = 0x80000000
        }

        [FlagsAttribute]
        public enum USN_SOURCE : uint
        {
            DATA_MANAGEMENT = 0x00000001,
            AUXILIARY_DATA = 0x00000002,
            REPLICATION_MANAGEMENT = 0x00000004
        }

        #endregion Enums

        #region Properties

        private readonly static Version USN40Version = new Version(4, 0);

        public readonly string VolumePath;
        public readonly Version Version;
        public readonly ulong RecordNumber;
        public readonly ushort FileSequenceNumber;
        public readonly ulong ParentFileRecordNumber;
        public readonly ushort ParentFileSequenceNumber;
        public readonly ulong Usn;
        public readonly DateTime TimeStamp;
        public readonly USN_REASON Reason;
        public readonly USN_SOURCE SourceInfo;
        public readonly uint SecurityId;
        public readonly StandardInformation.ATTR_STDINFO_PERMISSION FileAttributes;
        public readonly string FileName;

        #endregion Properties

        #region Constructors

        internal UsnJrnl(byte[] bytes, string volume, ref int offset)
        {
            uint RecordLength = RecordLength = BitConverter.ToUInt32(bytes, (0x00 + offset));
            VolumePath = volume;
            Version = new System.Version(BitConverter.ToUInt16(bytes, (0x04 + offset)), BitConverter.ToUInt16(bytes, (0x06 + offset)));
            RecordNumber = (BitConverter.ToUInt64(bytes, (0x08 + offset)) & 0x0000FFFFFFFFFFFF);
            FileSequenceNumber = ParentFileSequenceNumber = BitConverter.ToUInt16(bytes, (0x0E + offset));
            ParentFileRecordNumber = (BitConverter.ToUInt64(bytes, (0x10 + offset)) & 0x0000FFFFFFFFFFFF);
            ParentFileSequenceNumber = BitConverter.ToUInt16(bytes, (0x16 + offset));
            Usn = BitConverter.ToUInt64(bytes, (0x18 + offset));
            TimeStamp = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, (0x20 + offset)));
            Reason = ((USN_REASON)BitConverter.ToUInt32(bytes, (0x28 + offset)));
            SourceInfo = ((USN_SOURCE)BitConverter.ToUInt32(bytes, (0x2C + offset)));
            SecurityId = BitConverter.ToUInt32(bytes, (0x30 + offset));
            FileAttributes = ((StandardInformation.ATTR_STDINFO_PERMISSION)BitConverter.ToUInt32(bytes, (0x34 + offset)));
            ushort fileNameLength = BitConverter.ToUInt16(bytes, (0x38 + offset));
            ushort fileNameOffset = BitConverter.ToUInt16(bytes, (0x3A + offset));
            FileName = Encoding.Unicode.GetString(bytes, 0x3C + offset, fileNameLength);
            offset += (int)RecordLength;
        }

        #endregion Constructors

        #region StaticMethods

        public static UsnJrnl Get(string volume, ulong usn)
        {
            // Check for valid Volume name
            NativeMethods.getVolumeName(ref volume);

            // Set up FileStream to read volume
            IntPtr hVolume = NativeMethods.getHandle(volume);
            FileStream streamToRead = NativeMethods.getFileStream(hVolume);

            // Get VolumeBootRecord object for logical addressing
            VolumeBootRecord VBR = VolumeBootRecord.Get(streamToRead);

            // Get the $J Data attribute (contains UsnJrnl details
            NonResident J = UsnJrnl.GetJStream(UsnJrnl.GetFileRecord(volume));

            // Determine the length of the initial sparse pages
            ulong SparseLength = (ulong)J.DataRun[0].ClusterLength * VBR.BytesPerCluster;
            // Subtract length of sparse data from desired usn offset
            ulong usnOffset = usn - SparseLength;

            // Iterate through each data run
            for (int i = 1; i < J.DataRun.Length; i++)
            {
                // Determine length of current DataRun
                ulong dataRunLength = (ulong)J.DataRun[i].ClusterLength * VBR.BytesPerCluster;

                // Check if usnOffset resides in current DataRun
                if (dataRunLength <= usnOffset)
                {
                    // If not, subtract length of DataRun from usnOffset
                    usnOffset -= dataRunLength;
                }

                // If usnOffset resides within DataRun, parse associated UsnJrnl Entry
                else
                {
                    // Read DataRun from disk
                    byte[] fragmentBytes = NativeMethods.readDrive(streamToRead, ((ulong)J.DataRun[i].StartCluster * VBR.BytesPerCluster), ((ulong)J.DataRun[i].ClusterLength * VBR.BytesPerCluster));

                    // Instatiate a byte array that is the size of a single cluster
                    byte[] clusterBytes = new byte[VBR.BytesPerCluster];

                    // Iterate through the clusters in the DataRun
                    for (long j = 0; j < J.DataRun[i].ClusterLength; j++)
                    {
                        // If usnOffset is not in current cluster, then subtract cluster size from offset and iterate
                        if (VBR.BytesPerCluster <= usnOffset)
                        {
                            usnOffset -= VBR.BytesPerCluster;
                        }
                        // Else if usnOffset is in current cluster
                        else
                        {
                            // Copy current cluster bytes to clusterBytes variable
                            Array.Copy(fragmentBytes, ((long)j * VBR.BytesPerCluster), clusterBytes, 0, clusterBytes.Length);

                            // Parse desired UsnJrnl entry from cluster
                            int offset = (int)usnOffset;
                            return new UsnJrnl(clusterBytes, volume, ref offset);
                        }
                    }
                }
            }
            return null;
        }

        public static UsnJrnl[] GetInstances(string volume)
        {
            // Check for valid Volume name
            NativeMethods.getVolumeName(ref volume);

            // Set up FileStream to read volume
            IntPtr hVolume = NativeMethods.getHandle(volume);
            FileStream streamToRead = NativeMethods.getFileStream(hVolume);

            // Get VolumeBootRecord object for logical addressing
            VolumeBootRecord VBR = VolumeBootRecord.Get(streamToRead);

            // Get the $J Data attribute (contains UsnJrnl details
            NonResident J = UsnJrnl.GetJStream(UsnJrnl.GetFileRecord(volume));

            List<UsnJrnl> usnList = new List<UsnJrnl>();

            for (int i = 0; i < J.DataRun.Length; i++)
            {
                if (!(J.DataRun[i].Sparse))
                {
                    long clusterCount = J.DataRun[i].ClusterLength;

                    byte[] fragmentBytes = NativeMethods.readDrive(streamToRead, ((ulong)J.DataRun[i].StartCluster * VBR.BytesPerCluster), ((ulong)clusterCount * VBR.BytesPerCluster));

                    byte[] clusterBytes = new byte[VBR.BytesPerCluster];

                    for (long j = 0; j < clusterCount; j++)
                    {
                        Array.Copy(fragmentBytes, ((long)j * VBR.BytesPerCluster), clusterBytes, 0, clusterBytes.Length);

                        int offset = 0;

                        do
                        {
                            if (clusterBytes[offset] == 0)
                            {
                                break;
                            }

                            try
                            {
                                UsnJrnl usn = new UsnJrnl(clusterBytes, volume, ref offset);
                                if (usn.Version > USN40Version)
                                {
                                    break;
                                }
                                usnList.Add(usn);
                            }
                            catch
                            {
                                break;
                            }

                        } while (offset >= 0 && offset < clusterBytes.Length);
                    }
                }
            }
            return usnList.ToArray();
        }

        internal static FileRecord GetFileRecord(string volume)
        {
            string volLetter = volume.Split('\\')[3];
            ulong index = IndexEntry.Get(volLetter + "\\$Extend\\$UsnJrnl").RecordNumber;
            return new FileRecord(FileRecord.GetRecordBytes(volume, (int)index), volume, true);
        }

        internal static NonResident GetJStream(FileRecord fileRecord)
        {
            foreach (Attr attr in fileRecord.Attribute)
            {
                if (attr.NameString == "$J")
                {
                    return attr as NonResident;
                }
            }
            throw new Exception("No $J attribute found.");
        }

        internal static Data GetMaxStream(FileRecord fileRecord)
        {
            foreach (Attr attr in fileRecord.Attribute)
            {
                if (attr.NameString == "$Max")
                {
                    return attr as Data;
                }
            }
            throw new Exception("No $MAX attribute found.");
        }

        #endregion StaticMethods

        #region InstanceMethods

        public FileRecord GetFileRecord()
        {
            FileRecord record = new FileRecord(FileRecord.GetRecordBytes(this.VolumePath, (int)this.RecordNumber), this.VolumePath);

            if (record.SequenceNumber == this.FileSequenceNumber)
            {
                return record;
            }
            else
            {
                throw new Exception("Desired FileRecord has been overwritten");
            }
        }

        public FileRecord GetParentFileRecord()
        {
            FileRecord record = new FileRecord(FileRecord.GetRecordBytes(this.VolumePath, (int)this.ParentFileRecordNumber), this.VolumePath);

            if (record.SequenceNumber == this.ParentFileSequenceNumber)
            {
                return record;
            }
            else
            {
                throw new Exception("Desired FileRecord has been overwritten");
            }
        }

        #endregion InstanceMethods
    }

    #endregion USNJrnlClass

    #region UsnJrnlDetailClass

    public class UsnJrnlDetail
    {
        #region Properties

        public ulong MaxSize;
        public ulong AllocationDelta;
        public ulong UsnId;
        public ulong LowestUsn;

        #endregion Properties

        #region Constructors

        internal UsnJrnlDetail(byte[] maxBytes)
        {
            MaxSize = BitConverter.ToUInt64(maxBytes, 0x00);
            AllocationDelta = BitConverter.ToUInt64(maxBytes, 0x08);
            UsnId = BitConverter.ToUInt64(maxBytes, 0x10);
            LowestUsn = BitConverter.ToUInt64(maxBytes, 0x18);
        }

        #endregion Constructors
    }

    #endregion UsnJrnlDetailClass
}


text:
package com.vivifram.second.hitalk.base;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.vivifram.second.hitalk.HiTalkApplication;
import com.vivifram.second.hitalk.broadcast.ConnectivityNotifier;
import com.vivifram.second.hitalk.ui.page.layout.BaseFragmentLayout;
import com.zuowei.utils.bridge.EaterManager;
import com.zuowei.utils.bridge.IEater;
import com.zuowei.utils.bridge.constant.EaterAction;
import com.zuowei.utils.bridge.params.ParamWrap;
import com.zuowei.utils.bridge.params.chat.ClientOpenParam;
import com.zuowei.utils.common.NLog;
import com.zuowei.utils.common.TagUtil;
import com.zuowei.utils.handlers.ClientOpenHandler;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zuowei on 16-7-25.
 */
public abstract class BaseFragment<T extends BaseFragmentLayout> extends Fragment {
    private static final String TAG = TagUtil.makeTag(BaseFragment.class);
    private static final String PREFIX = "com.vivifram.second.hitalk.ui.page.layout.";
    protected WorkHandler workHandler;
    protected Context mAppCtx;
    protected T mLayout;
    protected boolean isInternetConnected;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        mAppCtx = HiTalkApplication.mAppContext;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EaterManager.getInstance().registerEater(EaterAction.ACTION_DO_CHECK_CLIENT, clientOpenHandler);
        ConnectivityNotifier.getNotifier(mAppCtx).addAndRequestOneShot(mAppCtx, this::onInternetConnected);
        workHandler = new WorkHandler();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(getContentLayout(), container, false);
        mLayout = generateLayout(view);
        if (mLayout != null) {
            mLayout.setActivity(getActivity());
            mLayout.onActivitySet();
            bindAllInterfaces();
            LayoutIdBinder.FLAYOUT.bindViewToFLayout(mLayout);
            mLayout.onViewCreate(view);
        }

        checkAndInstallEatMark();
        onViewCreated();
        return view;
    }

    private List<IEater> eater = new ArrayList<>();
    private void checkAndInstallEatMark() {
        Class<?>[] declaredClasses = getClass().getDeclaredClasses();
        if (declaredClasses != null) {
            for (Class<?> declaredClass : declaredClasses) {
                EatMark eatMark = declaredClass.getAnnotation(EatMark.class);
                if (eatMark != null) {
                    IEater iEater = null;
                    try {
                        Constructor<?> constructor = declaredClass.getDeclaredConstructor(this.getClass());
                        constructor.setAccessible(true);
                        iEater = (IEater) constructor.newInstance(this);
                    } catch (java.lang.InstantiationException e) {
                        NLog.e(TAG, "checkAndInstallEatMark failed :",e);
                    } catch (IllegalAccessException e) {
                        NLog.e(TAG, "checkAndInstallEatMark failed :",e);
                    } catch (NoSuchMethodException e) {
                        NLog.e(TAG, "checkAndInstallEatMark failed :",e);
                    } catch (InvocationTargetException e) {
                        NLog.e(TAG, "checkAndInstallEatMark failed :",e);
                    }
                    if (iEater != null) {
                        eater.add(iEater);
                        EaterManager.getInstance().registerEater(eatMark.action(),iEater);
                    }
                }
            }
        }
    }

    private void bindAllInterfaces() {
        Field[] declaredFields = getClass().getDeclaredFields();
        if (declaredFields != null) {
            for (Field injectField : declaredFields) {
                InterfaceInject annotation = injectField.getAnnotation(InterfaceInject.class);
                if (annotation == null) {
                    continue;
                }
                String name = annotation.bindName();
                try {
                    Field field = mLayout.getClass().getDeclaredField(name);
                    field.setAccessible(true);
                    injectField.setAccessible(true);
                    field.set(mLayout,injectField.get(this));
                } catch (NoSuchFieldException e) {
                    NLog.e(TAG,"bindAllInterfaces failed : ",e);
                } catch (IllegalAccessException e) {
                    NLog.e(TAG,"bindAllInterfaces failed : ",e);
                }
            }
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        if (mLayout != null) {
            mLayout.onStart();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if (mLayout != null) {
            mLayout.onResume();
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        if (mLayout != null) {
            mLayout.onPause();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        if (mLayout != null){
            mLayout.onStop();
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (mLayout != null) {
            mLayout.onViewDestroy();
        }
        onViewDestroyed();
        unInstallEatMark();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mLayout != null) {
            mLayout.onDestroy();
        }
        if (workHandler != null) {
            workHandler.removeCallbacksAndMessages(null);
            workHandler = null;
        }

        EaterManager.getInstance().unRegisterEater(clientOpenHandler);
    }

    public void onClientOpen() {

    }

    public void onInternetConnected(boolean connected){
        isInternetConnected = connected;
    }

    private void unInstallEatMark() {
        for (IEater iEater : eater) {
            EaterManager.getInstance().unRegisterEater(iEater);
        }
    }

    protected void onViewCreated(){}

    protected void onViewDestroyed(){}

    protected abstract int getContentLayout();

    public T getLayout() {
        return mLayout;
    }

    private T generateLayout(View root) {
        LayoutInject layoutInject = getClass().getAnnotation(LayoutInject.class);
        if (layoutInject != null){
            String layoutName = layoutInject.name();
            try {
                Class layoutC = Class.forName(PREFIX + layoutName);
                Constructor constructor = layoutC.getConstructor(View.class);
                constructor.setAccessible(true);
                return (T) constructor.newInstance(root);
            }catch (InvocationTargetException ex){
                NLog.e(TAG,"generateLayout failed : ",ex.getTargetException());
            } catch (Exception e) {
                NLog.e(TAG,"generateLayout failed : ",e);
            }
        }
        return null;
    }

    protected class WorkHandler extends Handler{
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if (isAdded()){
                safeHandler(msg);
            }
        }

        public void safeHandler(Message msg){

        }
    }

    private ClientOpenHandler clientOpenHandler = new ClientOpenHandler() {
        @Override
        public void doJobWithParam(ParamWrap<ClientOpenParam> paramWrap) {
            if (paramWrap.getParam().mOpened){
                onClientOpen();
            }
        }
    };
}


text:
package org.runetranscriber.core;

import java.util.ArrayList;
import java.util.List;

/**
 * Provides utility methods to convert between a String and a List.
 */
final class ListUtilities
{
    /**
     * @param list List.
     *
     * @return a String version of the contents of the list.
     */
    public static final String convert(final List<String> list)
    {
        final StringBuilder answer = new StringBuilder();

        if (list != null)
        {
            for (final String letter : list)
            {
                answer.append(letter);
            }
        }

        return answer.toString();
    }

    /**
     * @param string String.
     *
     * @return a list of the contents of the string.
     */
    public static final List<String> convert(final String string)
    {
        final List<String> answer = new ArrayList<String>();

        if (string != null)
        {
            for (int i = 0; i < string.length(); i++)
            {
                answer.add(String.valueOf(string.charAt(i)));
            }
        }

        return answer;
    }

    /**
     * @param fromList From list.
     * @param key Key.
     * @param start Start index.
     *
     * @return true if the key appears in fromList at the given start index.
     */
    public static final <T> boolean equals(final List<T> fromList, final List<T> key, final int start)
    {
        boolean answer = false;

        if ((fromList != null) && (key != null))
        {
            final int size = fromList.size();
            final int end = start + key.size();

            if ((0 <= start) && (end <= size))
            {
                answer = key.equals(fromList.subList(start, end));
            }
        }

        return answer;
    }
}


text:
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using System.Globalization;
using System.Linq;
using Windows.ApplicationModel;
using Windows.Security.ExchangeActiveSyncProvisioning;
using Windows.System;
using Windows.System.Profile;
using Windows.System.UserProfile;

namespace Microsoft.Toolkit.Uwp.Helpers
{
    /// <summary>
    /// Defines class providing information of OS and application
    /// </summary>
    public static class SystemInformation
    {
        /// <summary>
        /// Gets Application's name
        /// </summary>
        public static string ApplicationName { get; }

        /// <summary>
        /// Gets Application's version
        /// </summary>
        public static PackageVersion ApplicationVersion { get; }

        /// <summary>
        /// Gets the most preferred culture by the user
        /// </summary>
        public static CultureInfo Culture { get; }

        /// <summary>
        /// Gets device's family
        /// </summary>
        public static string DeviceFamily { get; }

        /// <summary>
        /// Gets operating system
        /// </summary>
        public static string OperatingSystem { get; }

        /// <summary>
        /// Gets operating system version
        /// </summary>
        public static OSVersion OperatingSystemVersion { get; }

        /// <summary>
        /// Gets used processor architecture
        /// </summary>
        public static ProcessorArchitecture OperatingSystemArchitecture { get; }

        /// <summary>
        /// Gets available memory
        /// </summary>
        public static float AvailableMemory => (float)MemoryManager.AppMemoryUsageLimit / 1024 / 1024;

        /// <summary>
        /// Gets device model
        /// </summary>
        public static string DeviceModel { get; }

        /// <summary>
        /// Gets device's manufacturer
        /// </summary>
        public static string DeviceManufacturer { get; }

        /// <summary>
        /// Initializes static members of the <see cref="SystemInformation"/> class.
        /// </summary>
        static SystemInformation()
        {
            ApplicationName = Package.Current.DisplayName;
            ApplicationVersion = Package.Current.Id.Version;
            try
            {
                Culture = GlobalizationPreferences.Languages.Count > 0 ? new CultureInfo(GlobalizationPreferences.Languages.First()) : null;
            }
            catch
            {
                Culture = null;
            }

            DeviceFamily = AnalyticsInfo.VersionInfo.DeviceFamily;
            ulong version = ulong.Parse(AnalyticsInfo.VersionInfo.DeviceFamilyVersion);
            OperatingSystemVersion = new OSVersion
            {
                Major = (ushort)((version & 0xFFFF000000000000L) >> 48),
                Minor = (ushort)((version & 0x0000FFFF00000000L) >> 32),
                Build = (ushort)((version & 0x00000000FFFF0000L) >> 16),
                Revision = (ushort)(version & 0x000000000000FFFFL)
            };
            OperatingSystemArchitecture = Package.Current.Id.Architecture;
            EasClientDeviceInformation deviceInfo = new EasClientDeviceInformation();
            OperatingSystem = deviceInfo.OperatingSystem;
            DeviceManufacturer = deviceInfo.SystemManufacturer;
            DeviceModel = deviceInfo.SystemProductName;
        }
    }
}


text:
title: Bar Graph Project
localeTitle: Proyecto de gráfico de barras
---
## Nuestro objetivo es aprender los fundamentos de los datos.

Visualización utilizando D3 a través de este proyecto.

![captura de pantalla 2016-05-17 a las 5 02 41 pm](//discourse-user-assets.s3.amazonaws.com/original/2X/2/2d46c5c1c76bd03b9e85d450da02695d3f07c75c.png)

## ¿Qué es D3.js?

Para aquellos que no están familiarizados con D3, D3.js es una biblioteca de JavaScript para manipular documentos basados en datos. D3 le ayuda a dar vida a los datos utilizando HTML, SVG y CSS.

D3.js lo ayuda a adjuntar sus datos a elementos DOM (Modelo de Objeto de Documento). Luego puedes usar CSS3, HTML y / o SVG para mostrar estos datos. Finalmente, puede hacer que los datos sean interactivos mediante el uso de transformaciones y transiciones basadas en datos de D3.js.

## Explicación del proyecto:

### Guión:

Hay una clase de estudiantes en línea que interactúan con diferentes temas de la materia y dan una prueba sobre esos temas.

Hay 15 temas y en cada tema, tenemos un número de estudiantes que han realizado el cuestionario y han obtenido puntajes en tres categorías: Bajo, Medio y Alto

### Por ejemplo (Datos dados):

Tema: "1", bajo: 4, medio: 13, alto: 18

Tema: "2", bajo: 11, medio: 12, alto: 6

Tema: "3", bajo: 12, medio: 24, alto: 6 y así sucesivamente.

Tenga en cuenta que el Tema 1 tiene `4 + 13 + 8 = 35` estudiantes tomaron el cuestionario y el Tema 2 tiene `11+12+6 = 29` estudiantes y el Tema 3 tiene 42 estudiantes, y así sucesivamente.

Queremos hacer gráficos de barras y circulares interactivos. Por ejemplo, un puntero del mouse en una de las barras cambiará el gráfico circular en consecuencia y viceversa.

Con la combinación interactiva de gráfico de barras y gráfico circular, donde el gráfico de barras muestra la cantidad de estudiantes que han interactuado con un tema en particular (contestó el cuestionario) y un gráfico circular que muestra la clasificación del desempeño de los estudiantes en categorías de "bajo, medio, alto", podemos Visualice nuestros datos y obtenga más análisis de los mismos.

## Consejos y recursos:

### Instrucciones paso a paso:

[**Introducción a D3:**](https://d3js.org) donde puede obtener información sobre selecciones, propiedades dinámicas y transiciones en D3.js.

*   En la función javascript principal, escriba una función para manejar el histograma (gráfico de barras). El histograma mostrará el número total de estudiantes que han respondido la prueba (interactuado con ese tema) en 15 temas.

    *   (Aquí está el [**tutorial**](https://bost.ocks.org/mike/bar/) donde puede aprender cómo hacer un gráfico de barras utilizando la biblioteca de JavaScript D3. El primer tutorial enseña cómo hacer una versión básica en HTML, luego un gráfico más completo en Gráficos de vectores escalables (SVG), y por último transiciones animadas entre vistas.)
*   [Crear SVG para histograma](http://codepen.io/SundeepB/pen/CxveH)

*   Cree una función para el mapeo del eje xy agregue el eje x al histograma SVG

*   Cree una función para el mapeo del eje y, y cree barras para que el histograma contenga rectángulos y etiquetas de temas.

*   Crea los rectángulos y etiquetas de temas.

*   Crear una función para actualizar las barras. Esto será utilizado por el gráfico circular

*   Escribe una función para manejar pieChart. - El gráfico circular tendrá tres secciones: Baja, Media y Alta para representar los puntajes.

    *   [**Tutorial**](http://zeroviscosity.com/d3-js-step-by-step/step-1-a-basic-pie-chart) donde puede aprender cómo hacer un gráfico circular, luego transiciones entre vistas y cómo crear una leyenda.
*   Crear svg para el gráfico circular.

*   Crear una función para dibujar los arcos de las porciones de la tarta: las porciones de la tarta serán Baja, Media y Alta

*   Crea una función para calcular los ángulos de la porción circular.

*   Dibuja las rebanadas de pastel.

*   Crear una función para actualizar el gráfico circular. Esto será utilizado por histograma.

*   Calcular la frecuencia total por segmento para todos los temas.

*   Calcule la frecuencia total por estado para todos los segmentos.

## Resultado del análisis de datos y lo que podemos inferir de la visualización:

*   El gráfico circular inicial muestra la clasificación agregada de todos los puntajes de los estudiantes en todos los temas combinados en tres categorías "bajo, medio, alto"

*   Gráfico de barras inicial que muestra el número de estudiantes que han interactuado en ese tema en particular

*   Cualquier categoría seleccionada del gráfico circular actualizará el gráfico de barras, mostrando el número de estudiantes que han interactuado en diversos temas con puntaje perteneciente a esa categoría en particular.

*   Las capturas de pantalla a continuación muestran el movimiento del mouse en la sección "Media" y la sección "Alta" del gráfico circular, respectivamente, y para esa sección en particular, los gráficos de barras temáticos y el número de estudiantes.

![captura de pantalla 2016-05-17 a las 5 13 53 pm](//discourse-user-assets.s3.amazonaws.com/original/2X/1/106f06d412df6db5b4a421dc4769d22695cbec72.png)

![captura de pantalla 2016-05-17 a las 5 14 05 pm](//discourse-user-assets.s3.amazonaws.com/original/2X/7/7b23ebe89f74f11090984dbc4dc68212e3beceb3.png)

*   Cualquier barra de gráfico de barras seleccionada actualizará el gráfico circular que muestra la clasificación de todos los estudiantes con puntaje en ese tema en particular en tres categorías: Bajo, Medio y Alto. La captura de pantalla a continuación muestra el cursor del mouse sobre el Tema 2 y, para ese tema en particular, cuántos estudiantes están categorías baja, media y alta

![captura de pantalla 2016-05-17 a las 5 13 26 h.](//discourse-user-assets.s3.amazonaws.com/original/2X/7/7bd7c613bdb882f2b7c1f76f9778a1bda3e886dd.png)

Referencias: [1\] Ejemplos de \[https://d3js.org](https://d3js.org) [2\] D3.js Introducción - \[https://www.dashingd3js.com/why-build-with-d3js](https://www.dashingd3js.com/why-build-with-d3js)


text:
laughing-octo-ironman
=====================


text:
using System;
using Foundation;
using CoreImage;
using UIKit;
using ObjCRuntime;

namespace StateRestoration
{
	public class ImageFilter : UIStateRestoring
	{
		const string ActiveKey = "kImageFilterActiveKey";

		public bool Active { get; set; }

		public bool Dirty { get; set; }

		public float Value { get; set; }

		Class restorationClass;

		public override Class ObjectRestorationClass {
			get {
				return restorationClass = restorationClass ?? new Class (RestorationType);
			}
		}

		public Type RestorationType { get; set; }

		public ImageFilter (bool useDefaultState)
		{
			Dirty = true;
			Active = useDefaultState;
		}

		public override void EncodeRestorableState (NSCoder coder)
		{
			coder.Encode (Active, ActiveKey);
		}

		public override void DecodeRestorableState (NSCoder coder)
		{
			if (coder.ContainsKey (ActiveKey))
				Active = coder.DecodeBool (ActiveKey);
		}
	}
}