text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'UserProfile'
        db.create_table(u'ecg_balancing_userprofile', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.OneToOneField')(related_name=u'profile', unique=True, to=orm['auth.User'])),
        ))
        db.send_create_signal(u'ecg_balancing', ['UserProfile'])

        # Adding M2M table for field companies on 'UserProfile'
        m2m_table_name = db.shorten_name(u'ecg_balancing_userprofile_companies')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('userprofile', models.ForeignKey(orm[u'ecg_balancing.userprofile'], null=False)),
            ('company', models.ForeignKey(orm[u'ecg_balancing.company'], null=False))
        ))
        db.create_unique(m2m_table_name, ['userprofile_id', 'company_id'])

    def backwards(self, orm):
        # Deleting model 'UserProfile'
        db.delete_table(u'ecg_balancing_userprofile')

        # Removing M2M table for field companies on 'UserProfile'
        db.delete_table(db.shorten_name(u'ecg_balancing_userprofile_companies'))

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'ecg_balancing.company': {
            'Meta': {'object_name': 'Company'},
            'activities': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
            'employees_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'fax': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'foundation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'industry': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'managing_directors': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'model_creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'owners': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
            'revenue': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'street': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'website': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'zipcode': ('django.db.models.fields.PositiveIntegerField', [], {})
        },
        u'ecg_balancing.companybalance': {
            'Meta': {'object_name': 'CompanyBalance'},
            'auditor': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'common_good': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'company': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'balance'", 'to': u"orm['ecg_balancing.Company']"}),
            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'matrix': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'company_balances'", 'to': u"orm['ecg_balancing.ECGMatrix']"}),
            'peer_companies': ('django.db.models.fields.related.ManyToManyField', [], {'max_length': '255', 'to': u"orm['ecg_balancing.Company']", 'null': 'True', 'symmetrical': 'False', 'blank': 'True'}),
            'process_description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'prospect': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'year': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
        },
        u'ecg_balancing.companybalanceindicator': {
            'Meta': {'object_name': 'CompanyBalanceIndicator'},
            'company_balance': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'company_balance'", 'to': u"orm['ecg_balancing.CompanyBalance']"}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'evaluation': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'indicator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'company_balance'", 'to': u"orm['ecg_balancing.Indicator']"})
        },
        u'ecg_balancing.ecgmatrix': {
            'Meta': {'object_name': 'ECGMatrix'},
            'contact': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'version': ('django.db.models.fields.CharField', [], {'default': "u'4.1'", 'max_length': '6'})
        },
        u'ecg_balancing.indicator': {
            'Meta': {'object_name': 'Indicator'},
            'contact': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
            'ecg_value': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'matrix': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'indicators'", 'to': u"orm['ecg_balancing.ECGMatrix']"}),
            'max_evaluation': ('django.db.models.fields.IntegerField', [], {}),
            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'parent_indicator'", 'null': 'True', 'to': u"orm['ecg_balancing.Indicator']"}),
            'stakeholder': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'subindicator_number': ('django.db.models.fields.IntegerField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        },
        u'ecg_balancing.userprofile': {
            'Meta': {'object_name': 'UserProfile'},
            'companies': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['ecg_balancing.Company']", 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "u'profile'", 'unique': 'True', 'to': u"orm['auth.User']"})
        },
        u'ecg_balancing.userrole': {
            'Meta': {'object_name': 'UserRole'},
            'company': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ecg_balancing.Company']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'role': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
        }
    }

    complete_apps = ['ecg_balancing']


text:
import React from 'react'
import {mount} from 'enzyme'
import {ThemeProvider} from 'glamorous'
import GlobalStyles from '../../styles/global-styles'
import LocaleChooser from '../locale-chooser'

const {supportedLocales, fallbackLocale} = require('../../config.json')

test('a closed locale-chooser', () => {
  setHost()
  const wrapper = mountLocaleChooser()
  testClosedState(wrapper)
})

test('an open locale-chooser', () => {
  setHost()
  const wrapper = mountLocaleChooser()
  const toggle = wrapper.find('button')
  const selector = wrapper.find('ul')
  toggle.simulate('click')

  expect(toggle.getDOMNode().getAttribute('aria-expanded')).toEqual('true')
  expect(selector.getDOMNode().getAttribute('aria-hidden')).toEqual('false')
  expect(
    selector.childAt(0).find('a').getDOMNode() === document.activeElement,
  ).toBe(true)
})

test('pressing the escape key closes the locale-selector', () => {
  setHost()
  const wrapper = mountLocaleChooser()
  const toggle = wrapper.find('button')
  toggle.simulate('click')
  document.dispatchEvent(new KeyboardEvent('keydown', {keyCode: 27}))

  testClosedState(wrapper)
})

test('an outside click closes the locale-selector', () => {
  setHost()
  const wrapper = mountLocaleChooser()
  const toggle = wrapper.find('button')
  toggle.simulate('click')
  document.dispatchEvent(new Event('click'))

  testClosedState(wrapper)
})

test('creates localization links', () => {
  supportedLocales.forEach(l => {
    setHost(l)
    testLocalizationLinks()
  })
})

function mountLocaleChooser() {
  return mount(
    <ThemeProvider theme={GlobalStyles}>
      <LocaleChooser />
    </ThemeProvider>,
  )
}

const host = 'glamorous.rocks'
function setHost(lang = fallbackLocale) {
  process.env.LOCALE = lang

  // why can't we just do window.location.host = 'foo'?
  // https://github.com/facebook/jest/issues/890
  Object.defineProperty(window.location, 'host', {
    writable: true,
    value: `${lang === fallbackLocale ? '' : `${lang}.`}${host}`,
  })

  Object.defineProperty(window.location, 'protocol', {
    writable: true,
    value: 'https:',
  })

  Object.defineProperty(window.location, 'pathname', {
    writable: true,
    value: '/',
  })
}

function testClosedState(wrapper) {
  const toggle = wrapper.find('button')
  const selector = wrapper.find('ul')

  expect(toggle.getDOMNode().getAttribute('aria-expanded')).toEqual('false')
  expect(selector.getDOMNode().getAttribute('aria-hidden')).toEqual('true')
}

function testLocalizationLinks() {
  const wrapper = mountLocaleChooser()
  const links = wrapper.find('a')

  expect(links.length).toBe(supportedLocales.length + 1)
  supportedLocales.forEach((l, i) => {
    const prefix = l === fallbackLocale ? '' : `${l}.`
    expect(links.at(i).getDOMNode().getAttribute('href')).toEqual(
      `https://${prefix}${host}/`,
    )
  })
  expect(
    links.at(supportedLocales.length).getDOMNode().getAttribute('href'),
  ).toEqual(
    'https://github.com/kentcdodds/glamorous-website/blob/master/other/CONTRIBUTING_DOCUMENTATION.md',
  )
}

redpajama_set_name: RedPajamaGithub


text:
.class public Landroid/bluetooth/BluetoothTetheringDataTracker;
.super Ljava/lang/Object;
.source "BluetoothTetheringDataTracker.java"

# interfaces
.implements Landroid/net/NetworkStateTracker;

# static fields
.field private static final NETWORKTYPE:Ljava/lang/String; = "BLUETOOTH_TETHER"

.field private static final TAG:Ljava/lang/String; = "BluetoothTethering"

.field private static mIface:Ljava/lang/String;

.field public static sInstance:Landroid/bluetooth/BluetoothTetheringDataTracker;

# instance fields
.field private mBluetoothPan:Landroid/bluetooth/BluetoothPan;

.field private mContext:Landroid/content/Context;

.field private mCsHandler:Landroid/os/Handler;

.field private mDefaultGatewayAddr:Ljava/util/concurrent/atomic/AtomicInteger;

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

.field private mDevice:Landroid/bluetooth/BluetoothDevice;

.field private mLinkCapabilities:Landroid/net/LinkCapabilities;

.field private mLinkProperties:Landroid/net/LinkProperties;

.field private mNetworkInfo:Landroid/net/NetworkInfo;

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

.field private mProfileServiceListener:Landroid/bluetooth/BluetoothProfile$ServiceListener;

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

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

    .prologue
    const/4 v4, 0x0

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

    .line 47
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

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

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mTeardownRequested:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 48
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

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

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mPrivateDnsRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 49
    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-direct {v0, v4}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDefaultGatewayAddr:Ljava/util/concurrent/atomic/AtomicInteger;

    .line 50
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

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

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDefaultRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 103
    new-instance v0, Landroid/bluetooth/BluetoothTetheringDataTracker$1;

    invoke-direct {v0, p0}, Landroid/bluetooth/BluetoothTetheringDataTracker$1;-><init>(Landroid/bluetooth/BluetoothTetheringDataTracker;)V

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mProfileServiceListener:Landroid/bluetooth/BluetoothProfile$ServiceListener;

    .line 66
    new-instance v0, Landroid/net/NetworkInfo;

    const/4 v1, 0x7

    const-string v2, "BLUETOOTH_TETHER"

    const-string v3, ""

    invoke-direct {v0, v1, v4, v2, v3}, Landroid/net/NetworkInfo;-><init>(IILjava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    .line 67
    new-instance v0, Landroid/net/LinkProperties;

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

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkProperties:Landroid/net/LinkProperties;

    .line 68
    new-instance v0, Landroid/net/LinkCapabilities;

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

    iput-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkCapabilities:Landroid/net/LinkCapabilities;

    .line 70
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v0, v4}, Landroid/net/NetworkInfo;->setIsAvailable(Z)V

    .line 71
    invoke-virtual {p0, v4}, Landroid/bluetooth/BluetoothTetheringDataTracker;->setTeardownRequested(Z)V

    .line 72
    return-void
.end method

.method static synthetic access$002(Landroid/bluetooth/BluetoothTetheringDataTracker;Landroid/bluetooth/BluetoothPan;)Landroid/bluetooth/BluetoothPan;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 43
    iput-object p1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mBluetoothPan:Landroid/bluetooth/BluetoothPan;

    return-object p1
.end method

.method static synthetic access$100()Ljava/lang/String;
    .locals 1

    .prologue
    .line 43
    sget-object v0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mIface:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$200(Landroid/bluetooth/BluetoothTetheringDataTracker;)Landroid/net/LinkProperties;
    .locals 1
    .parameter "x0"

    .prologue
    .line 43
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkProperties:Landroid/net/LinkProperties;

    return-object v0
.end method

.method static synthetic access$202(Landroid/bluetooth/BluetoothTetheringDataTracker;Landroid/net/LinkProperties;)Landroid/net/LinkProperties;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 43
    iput-object p1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkProperties:Landroid/net/LinkProperties;

    return-object p1
.end method

.method static synthetic access$300(Landroid/bluetooth/BluetoothTetheringDataTracker;)Landroid/net/NetworkInfo;
    .locals 1
    .parameter "x0"

    .prologue
    .line 43
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    return-object v0
.end method

.method static synthetic access$400(Landroid/bluetooth/BluetoothTetheringDataTracker;)Landroid/os/Handler;
    .locals 1
    .parameter "x0"

    .prologue
    .line 43
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mCsHandler:Landroid/os/Handler;

    return-object v0
.end method

.method public static declared-synchronized getInstance()Landroid/bluetooth/BluetoothTetheringDataTracker;
    .locals 2

    .prologue
    .line 75
    const-class v1, Landroid/bluetooth/BluetoothTetheringDataTracker;

    monitor-enter v1

    :try_start_0
    sget-object v0, Landroid/bluetooth/BluetoothTetheringDataTracker;->sInstance:Landroid/bluetooth/BluetoothTetheringDataTracker;

    if-nez v0, :cond_0

    new-instance v0, Landroid/bluetooth/BluetoothTetheringDataTracker;

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

    sput-object v0, Landroid/bluetooth/BluetoothTetheringDataTracker;->sInstance:Landroid/bluetooth/BluetoothTetheringDataTracker;

    .line 76
    :cond_0
    sget-object v0, Landroid/bluetooth/BluetoothTetheringDataTracker;->sInstance:Landroid/bluetooth/BluetoothTetheringDataTracker;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v1

    return-object v0

    .line 75
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

# virtual methods
.method public Clone()Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/CloneNotSupportedException;
        }
    .end annotation

    .prologue
    .line 80
    new-instance v0, Ljava/lang/CloneNotSupportedException;

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

    throw v0
.end method

.method public defaultRouteSet(Z)V
    .locals 1
    .parameter "enabled"

    .prologue
    .line 251
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDefaultRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 252
    return-void
.end method

.method public getDefaultGatewayAddr()I
    .locals 1

    .prologue
    .line 237
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDefaultGatewayAddr:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v0

    return v0
.end method

.method public getLinkCapabilities()Landroid/net/LinkCapabilities;
    .locals 2

    .prologue
    .line 230
    new-instance v0, Landroid/net/LinkCapabilities;

    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkCapabilities:Landroid/net/LinkCapabilities;

    invoke-direct {v0, v1}, Landroid/net/LinkCapabilities;-><init>(Landroid/net/LinkCapabilities;)V

    return-object v0
.end method

.method public declared-synchronized getLinkProperties()Landroid/net/LinkProperties;
    .locals 2

    .prologue
    .line 220
    monitor-enter p0

    :try_start_0
    new-instance v0, Landroid/net/LinkProperties;

    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkProperties:Landroid/net/LinkProperties;

    invoke-direct {v0, v1}, Landroid/net/LinkProperties;-><init>(Landroid/net/LinkProperties;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized getNetworkInfo()Landroid/net/NetworkInfo;
    .locals 1

    .prologue
    .line 213
    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public getTcpBufferSizesPropName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 259
    const-string/jumbo v0, "net.tcp.buffersize.wifi"

    return-object v0
.end method

.method public declared-synchronized isAvailable()Z
    .locals 1

    .prologue
    .line 148
    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isAvailable()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public isDefaultRouteSet()Z
    .locals 1

    .prologue
    .line 244
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDefaultRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

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

    move-result v0

    return v0
.end method

.method public isIdleGemini(I)Z
    .locals 1
    .parameter "radioNum"

    .prologue
    .line 319
    const/4 v0, 0x1

    return v0
.end method

.method public isPrivateDnsRouteSet()Z
    .locals 1

    .prologue
    .line 199
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mPrivateDnsRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

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

    move-result v0

    return v0
.end method

.method public isTeardownRequested()Z
    .locals 1

    .prologue
    .line 88
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mTeardownRequested:Ljava/util/concurrent/atomic/AtomicBoolean;

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

    move-result v0

    return v0
.end method

.method public privateDnsRouteSet(Z)V
    .locals 1
    .parameter "enabled"

    .prologue
    .line 206
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mPrivateDnsRouteSet:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 207
    return-void
.end method

.method public reconnect()Z
    .locals 2

    .prologue
    .line 131
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mTeardownRequested:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x0

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

    .line 133
    const/4 v0, 0x1

    return v0
.end method

.method public reconnectGemini(I)Z
    .locals 1
    .parameter "radioNum"

    .prologue
    .line 311
    const/4 v0, 0x1

    return v0
.end method

.method public setDependencyMet(Z)V
    .locals 0
    .parameter "met"

    .prologue
    .line 307
    return-void
.end method

.method public setPolicyDataEnable(Z)V
    .locals 3
    .parameter "enabled"

    .prologue
    .line 192
    const-string v0, "BluetoothTethering"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "ignoring setPolicyDataEnable("

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

    move-result-object v1

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

    move-result-object v1

    const-string v2, ")"

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 193
    return-void
.end method

.method public setRadio(Z)Z
    .locals 1
    .parameter "turnOn"

    .prologue
    .line 141
    const/4 v0, 0x1

    return v0
.end method

.method public setTeardownRequested(Z)V
    .locals 1
    .parameter "isRequested"

    .prologue
    .line 84
    iget-object v0, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mTeardownRequested:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 85
    return-void
.end method

.method public setUserDataEnable(Z)V
    .locals 3
    .parameter "enabled"

    .prologue
    .line 187
    const-string v0, "BluetoothTethering"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "ignoring setUserDataEnable("

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

    move-result-object v1

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

    move-result-object v1

    const-string v2, ")"

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 188
    return-void
.end method

.method public startMonitoring(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 4
    .parameter "context"
    .parameter "target"

    .prologue
    .line 95
    iput-object p1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mContext:Landroid/content/Context;

    .line 96
    iput-object p2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mCsHandler:Landroid/os/Handler;

    .line 97
    invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;

    move-result-object v0

    .line 98
    .local v0, adapter:Landroid/bluetooth/BluetoothAdapter;
    if-eqz v0, :cond_0

    .line 99
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mContext:Landroid/content/Context;

    iget-object v2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mProfileServiceListener:Landroid/bluetooth/BluetoothProfile$ServiceListener;

    const/4 v3, 0x5

    invoke-virtual {v0, v1, v2, v3}, Landroid/bluetooth/BluetoothAdapter;->getProfileProxy(Landroid/content/Context;Landroid/bluetooth/BluetoothProfile$ServiceListener;I)Z

    .line 101
    :cond_0
    return-void
.end method

.method public declared-synchronized startReverseTether(Ljava/lang/String;Landroid/bluetooth/BluetoothDevice;)V
    .locals 2
    .parameter "iface"
    .parameter "device"

    .prologue
    .line 264
    monitor-enter p0

    :try_start_0
    sput-object p1, Landroid/bluetooth/BluetoothTetheringDataTracker;->mIface:Ljava/lang/String;

    .line 265
    iput-object p2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mDevice:Landroid/bluetooth/BluetoothDevice;

    .line 266
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Landroid/bluetooth/BluetoothTetheringDataTracker$2;

    invoke-direct {v1, p0}, Landroid/bluetooth/BluetoothTetheringDataTracker$2;-><init>(Landroid/bluetooth/BluetoothTetheringDataTracker;)V

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

    .line 288
    .local v0, dhcpThread:Ljava/lang/Thread;
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 289
    monitor-exit p0

    return-void

    .line 264
    .end local v0           #dhcpThread:Ljava/lang/Thread;
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method

.method public startUsingNetworkFeature(Ljava/lang/String;II)I
    .locals 1
    .parameter "feature"
    .parameter "callingPid"
    .parameter "callingUid"

    .prologue
    .line 165
    const/4 v0, -0x1

    return v0
.end method

.method public declared-synchronized stopReverseTether(Ljava/lang/String;)V
    .locals 5
    .parameter "iface"

    .prologue
    .line 292
    monitor-enter p0

    :try_start_0
    invoke-static {p1}, Landroid/net/NetworkUtils;->stopDhcp(Ljava/lang/String;)Z

    .line 294
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mLinkProperties:Landroid/net/LinkProperties;

    invoke-virtual {v1}, Landroid/net/LinkProperties;->clear()V

    .line 295
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/net/NetworkInfo;->setIsAvailable(Z)V

    .line 296
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

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

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-virtual {v1, v2, v3, v4}, Landroid/net/NetworkInfo;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 298
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mCsHandler:Landroid/os/Handler;

    const/4 v2, 0x3

    iget-object v3, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v1, v2, v3}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

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

    .line 301
    iget-object v1, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mCsHandler:Landroid/os/Handler;

    const/4 v2, 0x1

    iget-object v3, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v1, v2, v3}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    .line 302
    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 303
    monitor-exit p0

    return-void

    .line 292
    .end local v0           #msg:Landroid/os/Message;
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1
.end method

.method public stopUsingNetworkFeature(Ljava/lang/String;II)I
    .locals 1
    .parameter "feature"
    .parameter "callingPid"
    .parameter "callingUid"

    .prologue
    .line 182
    const/4 v0, -0x1

    return v0
.end method

.method public teardown()Z
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 118
    iget-object v2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mTeardownRequested:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v2, v3}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 119
    iget-object v2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mBluetoothPan:Landroid/bluetooth/BluetoothPan;

    if-eqz v2, :cond_0

    .line 120
    iget-object v2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mBluetoothPan:Landroid/bluetooth/BluetoothPan;

    invoke-virtual {v2}, Landroid/bluetooth/BluetoothPan;->getConnectedDevices()Ljava/util/List;

    move-result-object v2

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

    move-result-object v1

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

    move-result v2

    if-eqz v2, :cond_0

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

    move-result-object v0

    check-cast v0, Landroid/bluetooth/BluetoothDevice;

    .line 121
    .local v0, device:Landroid/bluetooth/BluetoothDevice;
    iget-object v2, p0, Landroid/bluetooth/BluetoothTetheringDataTracker;->mBluetoothPan:Landroid/bluetooth/BluetoothPan;

    invoke-virtual {v2, v0}, Landroid/bluetooth/BluetoothPan;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z

    goto :goto_0

    .line 124
    .end local v0           #device:Landroid/bluetooth/BluetoothDevice;
    .end local v1           #i$:Ljava/util/Iterator;
    :cond_0
    return v3
.end method

.method public teardownGemini(I)Z
    .locals 1
    .parameter "radioNum"

    .prologue
    .line 315
    const/4 v0, 0x1

    return v0
.end method


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Amplitude of Low Frequency Fluctuations (ALFF) and fractional ALFF (f/ALFF) — C-PAC 0.3.9 Alpha documentation</title>

    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-3.2.0/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-3.2.0/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />

    <link rel="top" title="C-PAC 0.3.9 Alpha documentation" href="index.html" />
    <link rel="up" title="Outputs and Measures" href="derivs.html" />
    <link rel="next" title="Voxel-Mirrored Homotopic Connectivity (VMHC)" href="vmhc.html" />
    <link rel="prev" title="Seed-based Correlation Analysis (SCA)" href="sca.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

Amplitude of Low Frequency Fluctuations (ALFF) and fractional ALFF (f/ALFF)¶

Introduction & Background¶

Slow fluctuations in activity are a fundamental feature of the resting brain, and their presence is key to determining correlated activity between brain regions and defining resting state networks. The relative magnitude of these fluctuations can differ between brain regions and between subjects, and thus may act as a marker of individual differences or dysfunction. Amplitude of Low Frequency Fluctuations (ALFF; Zang et al., 2007) and fractional Amplitude of Low Frequency Fluctuations (f/ALFF; Zou et al., 2008) are related measures that quantify the amplitude of these low frequency oscillations (LFOs).

ALFF is defined as the total power within the frequency range between 0.01 and 0.1 Hz, and thus indexes the strength or intensity of LFO. f/ALFF is defined as the power within the low-frequency range (0.01-0.1 Hz) divided by the total power in the entire detectable frequency range, and represents the relative contribution of specific LFO to the whole frequency range (Zuo et al., 2010).

Computation and Analysis Considerations¶

All computations are performed in a subject’s native space. After transforming voxel time series frequency information into the power domain, calculation of these measures is relatively simple. ALFF is calculated as the sum of amplitudes within a specific low frequency range. f/ALFF is calculated as a fraction of the sum of amplitudes across the entire frequency range detectable in a given signal. For both measures, amplitudes in subject-level maps are transformed into Z-scores to create standardized subject-level maps. Anatomical images and Z-score maps are then transformed into MNI152 standard space. For more detail on how CPAC computes these steps, please see the ALFF and f/ALFF Page of the developer documentation.

Though both ALFF and f/ALFF are sensitive mostly to signal from gray matter, ALFF is more prone to noise from physiological sources, particularly near the ventricles and large blood vessels (Zuo et al., 2008;2010). The figure below (from Zuo et al., 2010) shows areas in which ALFF shows higher amplitude than f/ALFF, as well as the relative sensitivity of these measures to gray matter.

Both ALFF and f/ALFF show moderate to high test-retest reliability in gray matter regions, but reliability for ALFF tends to be higher than for fALFF (Zuo et al., 2010). As it is more reliable, ALFF may be more sensitive to differences between groups and individuals. The figure below (also from Zuo et al., 2010) shows differences in test-retest reliability as measured by Intraclass Correlation (ICC; Shrout and Fleiss, 1979).

Finally, as these measures require a constant timecourse on which to do frequency and power analyses, they cannot be run on scrubbed data (Power et al., 2012) in which volumes with excessive movement have been removed.

Applications and Recommendations¶

ALFF and f/ALFF have been used to uncover differences in amplitude power both between subjects and between conditions. Zang et al. (2007) found that children with ADHD show reduced ALFF amplitude in some brain areas and increased amplitude in others compared to controls, while Yan and colleagues (2009) saw increased amplitude in the Default Mode Network during Eyes Open vs. Eyes Closed resting periods. Changes in f/ALFF have also been observed with aging (Hu et al., 2013).

The increased specificity to the gray matter signal for f/ALFF compared to ALFF may suggest favoring the former, but doing so would come at the cost of reduced test-retest reliability. As such, in order to maximize the reliability across subjects while providing sufficient specificity to examine individual differences, reporting both measures is recommended (Zuo et al., 2010).

Configuring CPAC to Run ALFF and f/ALFF¶

Calculate ALFF and f/ALFF - [Off, On]: Calculate Amplitude of Low Frequency Fluctuations (ALFF) and and fractional ALFF (f/ALFF) for all voxels.

f/ALFF High-Pass Cutoff - [decimal]: Frequency cutoff (in Hz) for the high-pass filter used when calculating f/ALFF.

f/ALFF Low-Pass Cutoff - [decimal]: Frequency cutoff (in Hz) for the low-pass filter used when calculating f/ALFF

Configuration Using a YAML File¶

To configure ALFF and f/ALFF options within a YAML file, add the following lines to your file (with appropriate substitutions for paths):

runALFF : [1]
highPassFreqALFF : [0.01]
lowPassFreqALFF : [0.1]

References¶

Power, J. D., Barnes, K. A., Snyder, A. Z., Schlaggar, B. L., & Petersen, S. E. (2012). Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion. Neuroimage, 59(3), 2142–2154.

Sien Hu, Herta H.-A. Chao, Sheng Zhang, Jaime S. Ide, Chiang-Shan R. Li (2013), Changes in cerebral morphometry and amplitude of low-frequency fluctuations of BOLD signals during healthy aging: correlation with inhibitory control. Brain Structure and Function

Shrout, P.E., Fleiss, J.L., 1979. Intraclass correlations: uses in assessing rater reliability.
Psychol. Bull. 86, 420–428.

Zang, Y.-F., He, Y., Zhu, C.-Z., Cao, Q.-J., Sui, M.-Q., Liang, M., Tian, L.-X., et al. (2007). Altered baseline brain activity in children with ADHD revealed by resting-state functional MRI. Brain & development, 29(2), 83–91.

Zou, Q.-H., Zhu, C.-Z., Yang, Y., Zuo, X.-N., Long, X.-Y., Cao, Q.-J., Wang, Y.-F., et al. (2008). An improved approach to detection of amplitude of low-frequency fluctuation (ALFF) for resting-state fMRI: Fractional ALFF. Journal of neuroscience methods, 172(1), 137–141.

Zuo, X.-N., Di Martino, A., Kelly, C., Shehzad, Z. E., Gee, D. G., Klein, D. F., Castellanos, F. X., et al. (2010). The oscillating brain: complex and reliable. Neuroimage, 49(2), 1432–1445.

      Back to top

        © Copyright 2015, C-PAC Team.

      Created using Sphinx 1.3.1.


text:
cask 'font-quivira' do
  version :latest
  sha256 :no_check

  url 'http://www.quivira-font.com/files/Quivira.otf'
  name 'Quivira'
  homepage 'http://www.quivira-font.com/downloads.php'

  font 'Quivira.otf'
end


text:
export function createNewEvent(eventName: string, bubbles = false, cancelable = false) {
  let evt = document.createEvent('CustomEvent');
  evt.initCustomEvent(eventName, bubbles, cancelable, null);
  return evt;
}


text:
var ping = function () {
    return "pong";
};

anything.prototype.ping = ping;


text:
.. complexity documentation master file, created by
   sphinx-quickstart on Tue Jul  9 22:26:36 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to tg-react's documentation!
=================================================================

Helpers for react based applications running on django.

Contents:

.. toctree::
   :maxdepth: 2

   getting_started
   tips
   contributing
   modules
   changelog


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

<title>MenuAnonymous</title>
<meta name="date" content="2017-02-09">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Class MenuAnonymous

java.lang.Object

Menu

MenuAnonymous

public class MenuAnonymous
extends Menu

Created by chloe on 04/02/17.

Field Summary

Fields inherited from class Menu

menuEntries, name

Constructor Summary

Constructors

Constructor and Description

MenuAnonymous()

Initialise le menuAnonymous.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
menuChooseEntry()

Définie le comportement des différentes entrées du menu.

Methods inherited from class Menu

displayMenu

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MenuAnonymous

public MenuAnonymous()

Initialise le menuAnonymous.

Method Detail

menuChooseEntry

public void menuChooseEntry()

Définie le comportement des différentes entrées du menu.

Specified by:

menuChooseEntry in class Menu

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
using MatterHackers.Agg;
using MatterHackers.Agg.PlatformAbstract;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.MeshVisualizer;
using MatterHackers.VectorMath;
using System;
using System.IO;

namespace MatterHackers.MatterControl.PartPreviewWindow
{
	public class PartPreviewContent : GuiWidget
	{
		private EventHandler unregisterEvents;

		private View3DWidget partPreviewView;
		private ViewGcodeBasic viewGcodeBasic;
		private TabControl tabControl;
		private Tab layerViewTab;
		private View3DWidget.AutoRotate autoRotate3DView;
		private View3DWidget.OpenMode openMode;
		private View3DWidget.WindowMode windowMode;

		public PartPreviewContent(PrintItemWrapper printItem, View3DWidget.WindowMode windowMode, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
		{
			this.openMode = openMode;
			this.autoRotate3DView = autoRotate3DView;
			this.windowMode = windowMode;

			BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
			this.AnchorAll();
			this.Load(printItem);

			// We do this after showing the system window so that when we try and take focus of the parent window (the system window)
			// it exists and can give the focus to its child the gcode window.
			if (printItem != null
				&& Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
			{
				SwitchToGcodeView();
			}
		}

		public void Reload(PrintItemWrapper printItem)
		{
			this.CloseAllChildren();
			this.Load(printItem);
		}

		private void Load(PrintItemWrapper printItem)
		{
			tabControl = new TabControl();
			tabControl.TabBar.BorderColor = new RGBA_Bytes(0, 0, 0, 0);

			tabControl.TabBar.Padding = new BorderDouble(top: 6);

			RGBA_Bytes selectedTabColor;
			if (UserSettings.Instance.DisplayMode == ApplicationDisplayType.Responsive)
			{
				tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
				selectedTabColor = ActiveTheme.Instance.TabLabelSelected;
			}
			else
			{
				tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.TransparentLightOverlay;
				selectedTabColor = ActiveTheme.Instance.SecondaryAccentColor;
			}

			double buildHeight = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.build_height);

			// put in the 3D view
			partPreviewView = new View3DWidget(printItem,
				new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
				ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center),
				ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape),
				windowMode,
				autoRotate3DView,
				openMode);

			TabPage partPreview3DView = new TabPage(partPreviewView, string.Format("3D {0} ", "View".Localize()).ToUpper());

			// put in the gcode view
			ViewGcodeBasic.WindowMode gcodeWindowMode = ViewGcodeBasic.WindowMode.Embeded;
			if (windowMode == View3DWidget.WindowMode.StandAlone)
			{
				gcodeWindowMode = ViewGcodeBasic.WindowMode.StandAlone;
			}

			viewGcodeBasic = new ViewGcodeBasic(printItem,
				new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
				ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center),
				ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape), gcodeWindowMode);

			if (windowMode == View3DWidget.WindowMode.StandAlone)
			{
				partPreviewView.Closed += (s, e) => Close();
				viewGcodeBasic.Closed += (s, e) => Close();
			}

			TabPage layerView = new TabPage(viewGcodeBasic, "Layer View".Localize().ToUpper());

			int tabPointSize = 16;
            // add the correct tabs based on whether we are stand alone or embedded
            Tab threeDViewTab;
            if (windowMode == View3DWidget.WindowMode.StandAlone || UserSettings.Instance.IsTouchScreen)
			{
                threeDViewTab = new SimpleTextTabWidget(partPreview3DView, "3D View Tab", tabPointSize,
                    selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(threeDViewTab);
                layerViewTab = new SimpleTextTabWidget(layerView, "Layer View Tab", tabPointSize,
                    selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(layerViewTab);
			}
			else
			{
                threeDViewTab = new PopOutTextTabWidget(partPreview3DView, "3D View Tab", new Vector2(590, 400), tabPointSize);
                tabControl.AddTab(threeDViewTab);
				layerViewTab = new PopOutTextTabWidget(layerView, "Layer View Tab", new Vector2(590, 400), tabPointSize);
				tabControl.AddTab(layerViewTab);
			}

            threeDViewTab.ToolTipText = "Preview 3D Design".Localize();
            layerViewTab.ToolTipText = "Preview layer Tool Paths".Localize();

            this.AddChild(tabControl);
		}

		public void SwitchToGcodeView()
		{
			tabControl.TabBar.SelectTab(layerViewTab);
			viewGcodeBasic.Focus();
		}

		public override void OnClosed(ClosedEventArgs e)
		{
			unregisterEvents?.Invoke(this, null);
			base.OnClosed(e);
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:background="@drawable/ease_mm_listitem"
    android:gravity="center_vertical">

    <RelativeLayout
        android:id="@+id/rl_group"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/avatar"
            android:layout_width="55dp"
            android:layout_height="55dp"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="4dp"
            android:padding="5dp"
            android:src="@drawable/em_roominfo_add_btn" />

        <TextView
            android:id="@+id/name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="7dp"
            android:layout_toRightOf="@id/avatar"
            android:text="@string/newchat"
            android:textColor="#8C8C8C"
            android:textSize="18sp" />
    </RelativeLayout>

    <TextView
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/rl_group"
        android:background="#E0E0E0"
        android:visibility="gone" />

</RelativeLayout>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>kathab</artifactId>
    <groupId>org.boazglean.kathab</groupId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <groupId>org.boazglean.kathab.dhtml</groupId>
  <artifactId>dhtml</artifactId>
  <packaging>pom</packaging>
  <name>${project.version} - ${project.groupId}:${project.artifactId}</name>
  <modules>
    <module>dhtml-webapp</module>
    <module>dhtml-rpm</module>
    <module>dhtml-functionaltests</module>
  </modules>
</project>


text:
package net.kemitix.ldapmanager.actions.rename;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import javax.naming.Name;

/**
 * Raised when a Name is to be renamed.
 *
 * @author Paul Campbell (pcampbell@kemitix.net)
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public final class RenameRequestEvent {

    @Getter
    private final Name dn;

    /**
     * Create new RenameRequestEvent.
     *
     * @param dn The DN to be renamed.
     *
     * @return the event.
     */
    public static RenameRequestEvent create(final Name dn) {
        return new RenameRequestEvent(dn);
    }
}


text:
package com.robert.rpc.compress;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

import org.iq80.snappy.Snappy;

public class Compressor {

	private static ThreadLocal<byte[]> dataThreadLocal;

	static {
		dataThreadLocal = new ThreadLocal<byte[]>() {
			protected byte[] initialValue() {
				return new byte[Snappy.maxCompressedLength(5 * 1024)];
			}
		};
	}

	public static byte[] compress(byte[] data) {
		if (data == null || data.length == 0) {
			return null;
		}
		byte[] compressedData = dataThreadLocal.get();
		if (compressedData.length < Snappy.maxCompressedLength(data.length)) {
			compressedData = new byte[Snappy.maxCompressedLength(data.length)];
		} else {
			Arrays.fill(compressedData, (byte)0);
		}
		int compressSize = Snappy.compress(data, 0, data.length,
				compressedData, 0);
		return Arrays.copyOf(compressedData, compressSize);
	}

	public static byte[] decompress(byte[] compressedData) {
		if (compressedData == null || compressedData.length == 0) {
			return null;
		}
		return Snappy.uncompress(compressedData, 0, compressedData.length);
	}
}


text:
package org.apache.sling.testing.tools.jarexec;

import java.util.Timer;
import java.util.TimerTask;

import org.apache.commons.exec.ProcessDestroyer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** Simple ProcessDestroyer for a single process, meant to be used
 *  with our JarExecutor.
 */
class ShutdownHookSingleProcessDestroyer implements ProcessDestroyer, Runnable {

    private final Logger log = LoggerFactory.getLogger(getClass());
    private Thread shutdownHookThread;
    private Process process;
    private final int timeoutSeconds;
    private final String processInfo;
    private boolean waitOnShutdown = false;

    public ShutdownHookSingleProcessDestroyer(String processInfo, int timeoutSeconds) {
        this.processInfo = processInfo;
        this.timeoutSeconds = timeoutSeconds;
    }

    public boolean getWaitOnShutdown() {
        return waitOnShutdown;
    }

    public void setWaitOnShutdown(boolean waitOnShutdown) {
        this.waitOnShutdown = waitOnShutdown;
    }

    public synchronized boolean add(Process p) {
        if(process != null) {
            throw new IllegalStateException("Process already set: " + process);
        }

        if(shutdownHookThread == null) {
            shutdownHookThread = new Thread(this, getClass().getSimpleName());
            Runtime.getRuntime().addShutdownHook(shutdownHookThread);
        }

        process = p;
        return true;
    }

    public synchronized boolean remove(Process p) {
        p = null;
        return true;
    }

    public int size() {
        return 1;
    }

    public void run() {
        destroyProcess(waitOnShutdown);
    }

   public void destroyProcess(boolean waitForIt) {
       Process toDestroy = null;
       synchronized (this) {
           toDestroy = process;
           process = null;
       }

       if(toDestroy == null) {
           return;
       }

       toDestroy.destroy();

       if(waitForIt) {
           log.info("Waiting for destroyed process {} to exit (timeout={} seconds)", processInfo, timeoutSeconds);
           final Thread mainThread = Thread.currentThread();
           final Timer t = new Timer(true);
           final TimerTask task = new TimerTask() {
                @Override
                public void run() {
                    mainThread.interrupt();
                }
           };
           t.schedule(task, timeoutSeconds * 1000L);
           try {
               toDestroy.waitFor();
               try {
                   final int exit = toDestroy.exitValue();
                   log.info("Process {} ended with exit code {}", processInfo, exit);
               } catch(IllegalStateException ise) {
                   log.error("Failed to destroy process " + processInfo);
               }
           } catch (InterruptedException e) {
               log.error("Timeout waiting for process " + processInfo + " to exit");
            } finally {
                t.cancel();
            }
       }
   }
}


text:
package main

import (
	"fmt"
	"github.com/abates/AdventOfCode/2016/util"
	"strings"
)

func main() {
	program := make([][]string, 0)
	for _, line := range util.ReadInput() {
		program = append(program, strings.Split(line, " "))
	}
	//part1(program)
	part2(program)
}

func part1(program [][]string) {
	c := util.NewComputer()
	c.SetRegister("a", 7)
	c.Run(program)

	fmt.Printf("Computer state:\n%s\n", c)
}

func part2(program [][]string) {
	c := util.NewComputer()
	c.SetRegister("a", 12)
	c.Run(program)

	fmt.Printf("Computer state:\n%s\n", c)
}


text:
/**
 *
 */
package com.mrtheb.flume.source.http;

import java.io.BufferedReader;
import java.lang.reflect.Type;
import java.nio.charset.UnsupportedCharsetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.event.EventBuilder;
import org.apache.flume.event.JSONEvent;
import org.apache.flume.source.http.HTTPBadRequestException;
import org.apache.flume.source.http.HTTPSourceHandler;
import org.apache.flume.source.http.JSONHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;

/**
 * @author mlabbe
 *
 */
public class ForgivingJSONHandler implements HTTPSourceHandler {

	  private static final Logger LOG = LoggerFactory.getLogger(JSONHandler.class);
	  private final Type listType =
	          new TypeToken<List<JSONEvent>>() {
	          }.getType();
	  private final Gson gson;

	  public ForgivingJSONHandler() {
	    gson = new GsonBuilder().disableHtmlEscaping().create();
	  }

	  /**
	   * {@inheritDoc}
	   */
	  @Override
	  public List<Event> getEvents(HttpServletRequest request) throws Exception {
	    BufferedReader reader = request.getReader();
	    String charset = request.getCharacterEncoding();
	    //UTF-8 is default for JSON. If no charset is specified, UTF-8 is to
	    //be assumed.
	    if (charset == null) {
	      LOG.debug("Charset is null, default charset of UTF-8 will be used.");
	      charset = "UTF-8";
	    } else if (!(charset.equalsIgnoreCase("utf-8")
	            || charset.equalsIgnoreCase("utf-16")
	            || charset.equalsIgnoreCase("utf-32"))) {
	      LOG.error("Unsupported character set in request {}. "
	              + "JSON handler supports UTF-8, "
	              + "UTF-16 and UTF-32 only.", charset);
	      throw new UnsupportedCharsetException("JSON handler supports UTF-8, "
	              + "UTF-16 and UTF-32 only.");
	    }

	    /*
	     * Gson throws Exception if the data is not parseable to JSON.
	     * Need not catch it since the source will catch it and return error.
	     */
	    List<Event> eventList = new ArrayList<Event>(0);
	    try {
	      eventList = gson.fromJson(reader, listType);
	    } catch (JsonSyntaxException ex) {
	      throw new HTTPBadRequestException("Request has invalid JSON Syntax.", ex);
	    }

	    for (Event e : eventList) {
	      ((JSONEvent) e).setCharset(charset);
	    }
	    return getSimpleEvents(eventList);
	  }

	  @Override
	  public void configure(Context context) {
	  }

	  private List<Event> getSimpleEvents(List<Event> events) {
	    List<Event> newEvents = new ArrayList<Event>(events.size());
	    for(Event e:events) {
	    	for(Map.Entry<String, String> h : e.getHeaders().entrySet()) {
	    		if (h.getValue() == null) {
	    			h.setValue("NULL");
	    		}
	    	}
	      newEvents.add(EventBuilder.withBody(e.getBody(), e.getHeaders()));
	    }
	    return newEvents;
	  }
	}


text:
layout: page
title: Mindfulness in young people's services
main_image_path:
style: practice
main_nav: false
sidebar: practice-sidebar.html
---

Since 2010, CAMHS practitioners within Sussex Partnership Foundation Trust and Brighton & Hove Council have been working in partnership to develop, deliver and evaluate a seven-week MBCT-adapted course for young people (14-18 years) coping with stress, anxiety and depression.

With research and supervision support from the Sussex Mindfulness Centre, and the help and feedback from young people and parents, the course continues to be revised and developed to meet the needs of young people locally.

Young People from Brighton and Hove CAMHS are currently working with Surrey University to develop a Mindfulness App for young people.

Our lead for mindfulness in child and adolescent services, Dr Brenda Davis, is speaking at this national conference.

For more information about Mindfulness in CAMHS please contact Dr Lana Jackson (Brighton & Hove Community CAMHS)  lana.Jackson@bsuh.nhs.uk and Brenda Davis (Brighton & Hove Specialist CAMHS) brenda.davis@spft.nhs.uk

Mindfulness in paediatrics

Sussex Mindfulness in CAMHS Special Interest Group (SIG)

Mindfulness drop-ins for young people

Feedback from Young People

I’m a lot better about going to school and when I’m at school I don’t get so nervous. I don’t think about what other people are thinking about as much. It helps me to concentrate more on what I’m doing
(female 17yrs).

I catch myself earlier in panic stages, and can calm down better
(female,15 years).

I know how to take a breather which I can use throughout life
(Male, 16yrs).

	{% include {{ page.sidebar }} %}


text:
package org.apache.coyote;

import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * Simple wrapper for a {@link ByteBuffer} that remembers if the buffer has been
 * flipped or not.
 */
public class ByteBufferHolder {

    private final ByteBuffer buf;
    private final AtomicBoolean flipped;

    public ByteBufferHolder(ByteBuffer buf, boolean flipped) {
       this.buf = buf;
       this.flipped = new AtomicBoolean(flipped);
    }

    public ByteBuffer getBuf() {
        return buf;
    }

    public boolean isFlipped() {
        return flipped.get();
    }

    public boolean flip() {
        if (flipped.compareAndSet(false, true)) {
            buf.flip();
            return true;
        } else {
            return false;
        }
    }

    public boolean hasData() {
        if (flipped.get()) {
            return buf.remaining()>0;
        } else {
            return buf.position()>0;
        }
    }
}


text:
/* Core */
body {color: #333;}
#rt-header {color: #aaa;}
#rt-bottom {color: #333;}
.rt-container {background: #fff;}
a:hover {color: #000;}
#rt-footer, #rt-copyright {color: #ddd;}
#rt-sidebar-a {background-color:#eee;}
#rt-sidebar-b {background-color:#fff;}
#rt-sidebar-c {background-color:#fff;}
#gantry-viewswitcher {margin: 0 auto 1em;position: relative;}

/* Navigation - Core */
#rt-menu ul.menu li a, .menutop.theme-fusion li.root > .item, .menu-type-splitmenu .menutop.theme-splitmenu li .item {color: #fff;}
.menutop.theme-fusion li.parent.root > .item span, .menu-type-splitmenu .menutop.theme-splitmenu li.parent .item span {background: url(../images/menus/menutop-daddy.png) 100% 50% no-repeat;}

/* Navigation - Hovers */
#rt-menu ul.menu li a:hover, .menutop.theme-fusion li.root > .item:hover, .menutop.theme-fusion li.active.root.f-mainparent-itemfocus > .item, .menutop.theme-fusion li.root.f-mainparent-itemfocus > .item, .menu-type-splitmenu .menutop.theme-splitmenu li:hover > .item {background: #444;color: #fff;}

/* Navigation - Active */
#rt-menu ul.menu li.active a, #rt-menu ul.menu li.active a:hover, .menutop.theme-fusion li.root.active > .item, .menutop.theme-fusion li.root.active > .item:hover, .menu-type-splitmenu .menutop.theme-splitmenu li.active .item {background: #fff;color: #000;}

/* Navigation - Dropdowns */
.menutop.theme-fusion .fusion-submenu-wrapper {background: #444;}
.menutop.theme-fusion .fusion-submenu-wrapper.level3, .menutop.theme-fusion .fusion-submenu-wrapper.level4, .menutop.theme-fusion .fusion-submenu-wrapper.level5, .menutop.theme-fusion .fusion-submenu-wrapper.level6 {background: #515151;}
.menutop.theme-fusion ul li > .item {color: #fff;}
.menutop.theme-fusion ul li > .item:hover, .menutop.theme-fusion ul li.f-menuparent-itemfocus > .item {background: #333;color: #ccc;}
.menutop.theme-fusion ul li > .daddy span {background: url(../images/menus/dropdown-daddy.png) 100% 50% no-repeat;}
.menutop.theme-fusion .fusion-grouped ol li > .item {background: url(../images/menus/menu-arrow.png) 5px 50% no-repeat;}


text:
<data:SprdApiDataSourceClass xmlns:data="sprd.data" xmlns:conf="js.conf">
    <conf:DataSourceConfiguration>
        <conf:ResourceConfiguration modelClassName="sprd.model.Registration" path="register" signatureRequired="true"/>
        <conf:ResourceConfiguration path="languages" modelClassName="sprd.model.Language"/>
        <conf:ResourceConfiguration path="countries" modelClassName="sprd.model.Country"/>
        <conf:ResourceConfiguration path="priceStrategies" modelClassName="sprd.model.PriceStrategy"/>
        <conf:ResourceConfiguration path="shops" modelClassName="sprd.model.Shop" sessionRequired="true">
            <conf:ResourceConfiguration path="address" modelClassName="sprd.model.Address"/>
            <conf:ResourceConfiguration path="applications" modelClassName="sprd.model.Application"
                                        sessionRequired="true"/>
            <conf:ResourceConfiguration path="applications" modelClassName="sprd.model.application.ShopApplication"
                                        sessionRequired="true"/>
            <conf:ResourceConfiguration path="applications"
                                        modelClassName="sprd.model.application.ConfomatApplication"
                                        sessionRequired="true"/>
            <conf:ResourceConfiguration path="articles" modelClassName="sprd.model.Article"/>
            <conf:ResourceConfiguration path="articleCategories" modelClassName="sprd.model.ArticleCategory"/>
            <conf:ResourceConfiguration path="designCategories" modelClassName="sprd.model.DesignCategory">
                <conf:ResourceConfiguration path="designs" modelClassName="sprd.model.Design"/>
            </conf:ResourceConfiguration>
            <conf:ResourceConfiguration path="printTypes" modelClassName="sprd.model.PrintType"/>
            <conf:ResourceConfiguration path="designs" modelClassName="sprd.model.Design" signatureRequired="true"/>
            <conf:ResourceConfiguration path="designCategories" modelClassName="sprd.model.DesignCategory"/>

            <conf:ResourceConfiguration path="productTypes" modelClassName="sprd.model.ProductType">
                <conf:ResourceConfiguration path="stockStates" modelClassName="sprd.model.StockState"
                                            collectionClassName="sprd.collection.StockStates"/>
            </conf:ResourceConfiguration>
            <conf:ResourceConfiguration path="discountScales" modelClassName="sprd.model.DiscountScale"/>
            <conf:ResourceConfiguration path="fontFamilies" modelClassName="sprd.model.FontFamily"/>
            <conf:ResourceConfiguration path="products" modelClassName="sprd.model.Product" signatureRequired="true"/>
            <conf:ResourceConfiguration path="productTypeDepartments"
                                        modelClassName="sprd.model.ProductTypeDepartment"/>
            <conf:ResourceConfiguration path="shippingTypes" modelClassName="sprd.model.ShippingType"/>
            <conf:ResourceConfiguration path="shippingOptions" modelClassName="sprd.model.ShippingOption"/>

            <conf:ResourceConfiguration path="applications" modelClassName="sprd.model.Application"/>
            <conf:ResourceConfiguration path="design-uploads" modelClassName="sprd.model.DesignUpload" processor="UploadDesignProcessor" signatureRequired="true"/>
        </conf:ResourceConfiguration>
        <conf:ResourceConfiguration path="currencies" modelClassName="sprd.model.Currency">

        </conf:ResourceConfiguration>
        <conf:ResourceConfiguration path="baskets" modelClassName="sprd.model.Basket" processor="BasketProcessor"
                                    apiKeyRequired="true" parseResponse="true">
            <conf:ResourceConfiguration path="items" modelClassName="sprd.model.BasketItem"
                                        processor="BasketItemProcessor" apiKeyRequired="true"/>
            <conf:ResourceConfiguration path="paymentTypes" modelClassName="sprd.model.PaymentType"
                                        apiKeyRequired="true"
                                        checkoutTokenRequired="true"/>
            <conf:ResourceConfiguration path="delivery" modelClassName="sprd.model.Delivery" apiKeyRequired="true"
                                        checkoutTokenRequired="true" sessionPreferred="true"/>
            <conf:ResourceConfiguration path="delivery/applyAmazon" modelClassName="sprd.model.AmazonDelivery" apiKeyRequired="true"
                                        checkoutTokenRequired="true" sessionPreferred="true"/>

            <conf:ResourceConfiguration path="coupons" modelClassName="sprd.model.Coupon" apiKeyRequired="true"
                                        checkoutTokenRequired="true"
                                        sessionPreferred="true"/>
            <conf:ResourceConfiguration path="checkout" modelClassName="sprd.model.Checkout" apiKeyRequired="true"
                                        checkoutTokenRequired="true" sessionPreferred="true"/>
            <conf:ResourceConfiguration path="checkoutCreditCard" modelClassName="sprd.model.Checkout.CreditCard" sessionPreferred="true" checkoutTokenRequired="true"/>
            <conf:ResourceConfiguration path="authorize3ds" modelClassName="sprd.model.Checkout.Authorize3ds"/>
        </conf:ResourceConfiguration>
        <conf:ResourceConfiguration modelClassName="sprd.model.CombinedBasket" path="combinedBaskets"
                                    apiKeyRequired="true" checkoutTokenRequired="true"/>
        <conf:ResourceConfiguration path="users" modelClassName="sprd.model.User">
            <conf:ResourceConfiguration path="shops" modelClassName="sprd.model.Shop" sessionRequired="true">
                <conf:ResourceConfiguration path="articles" modelClassName="sprd.model.Article"/>
            </conf:ResourceConfiguration>

            <conf:ResourceConfiguration path="printTypes" modelClassName="sprd.model.PrintType" sessionRequired="true"
                                        signatureRequired="true"/>
            <conf:ResourceConfiguration path="designs" modelClassName="sprd.model.Design" signatureRequired="true"
                                        apiKeyRequired="true"/>
            <conf:ResourceConfiguration path="products" modelClassName="sprd.model.Product" sessionRequired="true"
                                        apiKeyRequired="true" signatureRequired="true"/>
            <conf:ResourceConfiguration path="designCategories" modelClassName="sprd.model.DesignCategory"
                                        sessionRequired="true" signatureRequired="true">
                <conf:ResourceConfiguration path="designs" modelClassName="sprd.model.Design" apiKeyRequired="true"
                                            signatureRequired="true"/>
            </conf:ResourceConfiguration>

            <conf:ResourceConfiguration path="fontFamilies" modelClassName="sprd.model.FontFamily" apiKeyRequired="true"
                                        signatureRequired="true"/>
            <conf:ResourceConfiguration path="productTypeDepartments"
                                        modelClassName="sprd.model.ProductTypeDepartment" apiKeyRequired="true" signatureRequired="true"/>
            <conf:ResourceConfiguration path="shippingTypes" modelClassName="sprd.model.ShippingType"/>
            <conf:ResourceConfiguration path="labels" modelClassName="sprd.model.Label" sessionRequired="true"/>
            <conf:ResourceConfiguration path="objectLabels" modelClassName="sprd.model.ObjectLabel"
                                        sessionRequired="true"/>

            <conf:ResourceConfiguration path="productTypes" modelClassName="sprd.model.ProductType"
                                        sessionRequired="true" signatureRequired="true">
                <conf:ResourceConfiguration path="stockStates" modelClassName="sprd.model.StockState"
                                            collectionClassName="sprd.collection.StockStates"/>
            </conf:ResourceConfiguration>
            <conf:ResourceConfiguration path="addresses" modelClassName="sprd.model.UserAddress"
                                        sessionRequired="true"/>

        </conf:ResourceConfiguration>

        <conf:ResourceConfiguration path="sessions" modelClassName="sprd.model.Session" apiKeyRequired="true" signatureRequired="true"/>
        <conf:ResourceConfiguration path="messages" modelClassName="sprd.model.Message" signatureRequired="true"/>

        <conf:ResourceConfiguration path="labels" modelClassName="sprd.model.Label"/>
        <conf:ResourceConfiguration path="labelTypes" modelClassName="sprd.model.LabelType" sessionRequired="true"/>
        <conf:ResourceConfiguration path="objectLabels" modelClassName="sprd.model.ObjectLabel"
                                    signatureRequired="true"/>
        <conf:ResourceConfiguration path="objectTypes" modelClassName="sprd.model.ObjectType"/>

        <conf:ResourceConfiguration path="orders" modelClassName="sprd.model.Order"
                                    apiKeyRequired="true" sessionRequired="true" signatureRequired="true"
                                    authTokenRequired="true">
            <conf:ResourceConfiguration path="items" modelClassName="sprd.model.OrderItem"
                                        processor="OrderItemProcessor"/>
            <conf:ResourceConfiguration path="paymentTypes" modelClassName="sprd.model.PaymentType"
                                        apiKeyRequired="true" checkoutTokenRequired="true" authTokenRequired="true"/>
            <conf:ResourceConfiguration path="repay" modelClassName="sprd.model.Checkout" apiKeyRequired="true"
                                        checkoutTokenRequired="true" authTokenRequired="true"/>
            <conf:ResourceConfiguration path="repayWithCreditCard" modelClassName="sprd.model.Checkout.CreditCard"
                                        checkoutTokenRequired="true" authTokenRequired="true"/>
            <conf:ResourceConfiguration path="authorize3ds" modelClassName="sprd.model.Checkout.Authorize3ds"/>
        </conf:ResourceConfiguration>

    </conf:DataSourceConfiguration>
</data:SprdApiDataSourceClass>


text:
//
// Revit IFC Import library: this library works with Autodesk(R) Revit(R) to import IFC files.
// Copyright (C) 2015  Autodesk, Inc.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.IFC;
using Revit.IFC.Common.Utility;
using Revit.IFC.Common.Enums;
using Revit.IFC.Import.Enums;
using Revit.IFC.Import.Utility;

namespace Revit.IFC.Import.Data
{
    public class IFCStyledItem : IFCRepresentationItem
    {
        private IFCRepresentationItem m_Item = null;

        private IFCPresentationStyleAssignment m_Styles = null;

        private string m_Name = null;

        // Currently the only created element would be a material.  May expand to a list of elements.
        private ElementId m_CreatedElementId = ElementId.InvalidElementId;

        /// <summary>
        /// The optional associated representation item.
        /// </summary>
        public IFCRepresentationItem Item
        {
            get { return m_Item; }
            protected set { m_Item = value; }
        }

        /// <summary>
        /// Get the styles associated with the IfcStyledItem.
        /// Note that the IFC specification allows a set of these, but usage restricts this to one item.
        /// </summary>
        public IFCPresentationStyleAssignment Styles
        {
            get { return m_Styles; }
            protected set { m_Styles = value; }
        }

        /// <summary>
        /// The optional name of the styled item.
        /// </summary>
        public string Name
        {
            get { return m_Name; }
            protected set { m_Name = value; }
        }

        /// <summary>
        /// Returns the main element id associated with this material.
        /// </summary>
        /// <param name="scope">The containing import scope.</param>
        /// <remarks>The creator argument is ignored, as it is taken into account when creating the material.</remarks>
        public override ElementId GetMaterialElementId(IFCImportShapeEditScope scope)
        {
            return m_CreatedElementId;
        }

        /// <summary>
        /// Does a top-level check to see if this styled item may be equivalent to another styled item.
        /// </summary>
        /// <param name="otherEntity">The other styled item.</param>
        /// <returns>False if they don't have the same handles, null otherwise.</returns>
        public override bool? MaybeEquivalentTo(IFCEntity otherEntity)
        {
            bool? maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity);
            if (maybeEquivalentTo.HasValue)
                return maybeEquivalentTo.Value;

            if (!(otherEntity is IFCStyledItem))
                return false;

            IFCStyledItem other = otherEntity as IFCStyledItem;

            if (!IFCRoot.Equals(Item, other.Item))
                return false;

            if (!IFCRoot.Equals(Styles, other.Styles))
                return false;

            return null;
        }

        /// <summary>
        /// Does a top-level check to see if this entity is equivalent to otherEntity.
        /// </summary>
        /// <param name="otherEntity">The other IFCEntity.</param>
        /// <returns>True if they are equivalent, false if they aren't.</returns>
        /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types.  This is intended
        /// to make a final decision, and will err on the side of deciding that entities aren't equivalent.</remarks>
        public override bool IsEquivalentTo(IFCEntity otherEntity)
        {
            bool? maybeEquivalentTo = MaybeEquivalentTo(otherEntity);
            if (maybeEquivalentTo.HasValue)
                return maybeEquivalentTo.Value;

            // If it passes all of the Maybe tests and doesn't come back false, good enough.
            return true;
        }

        protected IFCStyledItem()
        {
        }

        override protected void Process(IFCAnyHandle styledItem)
        {
            base.Process(styledItem);

            IFCAnyHandle item = IFCImportHandleUtil.GetOptionalInstanceAttribute(styledItem, "Item");
            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(item))
                Item = IFCRepresentationItem.ProcessIFCRepresentationItem(item);

            Name = IFCImportHandleUtil.GetOptionalStringAttribute(styledItem, "Name", null);

            List<IFCAnyHandle> styles = IFCAnyHandleUtil.GetAggregateInstanceAttribute<List<IFCAnyHandle>>(styledItem, "Styles");
            if (styles == null || styles.Count == 0 || IFCAnyHandleUtil.IsNullOrHasNoValue(styles[0]))
                Importer.TheLog.LogMissingRequiredAttributeError(styledItem, "Styles", true);
            if (styles.Count > 1)
                Importer.TheLog.LogWarning(styledItem.StepId, "Multiple presentation styles found for IfcStyledItem - using first.", false);

            Styles = IFCPresentationStyleAssignment.ProcessIFCPresentationStyleAssignment(styles[0]);
        }

        protected IFCStyledItem(IFCAnyHandle item)
        {
            Process(item);
        }

        /// <summary>
        /// Get the IFCSurfaceStyle associated with this IFCStyledItem.
        /// </summary>
        /// <returns>The IFCSurfaceStyle, if any.</returns>
        public IFCSurfaceStyle GetSurfaceStyle()
        {
            IFCPresentationStyleAssignment styles = Styles;
            if (styles != null)
            {
                ISet<IFCPresentationStyle> presentationStyles = styles.Styles;
                foreach (IFCPresentationStyle presentationStyle in presentationStyles)
                {
                    if (presentationStyle is IFCSurfaceStyle)
                        return (presentationStyle as IFCSurfaceStyle);
                }
            }

            return null;
        }

        /// <summary>
        /// Creates a Revit material based on the information contained in this class.
        /// </summary>
        /// <param name="doc">The document.</param>
        public void Create(IFCImportShapeEditScope shapeEditScope)
        {
            // TODO: support cut pattern id and cut pattern color.
            if (m_CreatedElementId != ElementId.InvalidElementId || !IsValidForCreation)
                return;

            try
            {
                // If the styled item or the surface style has a name, use it.
                IFCSurfaceStyle surfaceStyle = GetSurfaceStyle();
                if (surfaceStyle == null)
                {
                    // We only handle surface styles at the moment; log file should already reflect any other unhandled styles.
                    IsValidForCreation = true;
                    return;
                }

                string forcedName = surfaceStyle.Name;
                if (string.IsNullOrWhiteSpace(forcedName))
                    forcedName = Name;

                string suggestedName = null;
                if (Item != null)
                {
                    IFCProduct creator = shapeEditScope.Creator;
                    suggestedName = creator.GetTheMaterialName();
                }

                m_CreatedElementId = surfaceStyle.Create(shapeEditScope.Document, forcedName, suggestedName, Id);
            }
            catch (Exception ex)
            {
                IsValidForCreation = false;
                Importer.TheLog.LogCreationError(this, ex.Message, false);
            }
        }

        /// <summary>
        /// Processes an IfcStyledItem entity handle.
        /// </summary>
        /// <param name="ifcStyledItem">The IfcStyledItem handle.</param>
        /// <returns>The IFCStyledItem object.</returns>
        public static IFCStyledItem ProcessIFCStyledItem(IFCAnyHandle ifcStyledItem)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcStyledItem))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcStyledItem);
                return null;
            }

            IFCEntity styledItem;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcStyledItem.StepId, out styledItem))
                styledItem = new IFCStyledItem(ifcStyledItem);
            return (styledItem as IFCStyledItem);
        }
    }
}


text:
yum -y upgrade
yum -y localinstall https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
yum -y install puppet rsync