text:
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 * -------------------------------------------------------------------
 */
/*
------------------------------------------------------------------------------

   PacketVideo Corp.
   MP3 Decoder Library

   Filename: pv_mp3_huffman.h

   Date: 09/21/2007

------------------------------------------------------------------------------
 REVISION HISTORY

 Description:
------------------------------------------------------------------------------
 INCLUDE DESCRIPTION

------------------------------------------------------------------------------
 REFERENCES

 [1] ISO MPEG Audio Subgroup Software Simulation Group (1996)
     ISO 13818-3 MPEG-2 Audio Decoder - Lower Sampling Frequency Extension

------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; CONTINUE ONLY IF NOT ALREADY DEFINED
----------------------------------------------------------------------------*/

#ifndef PV_MP3_HUFFMAN_H
#define PV_MP3_HUFFMAN_H

/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/

#include "pvmp3_audio_type_defs.h"
#include "s_mp3bits.h"
#include "s_tmp3dec_file.h"

/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; EXTERNAL VARIABLES REFERENCES
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; DEFINES AND SIMPLE TYPEDEF'S
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/

#ifdef __cplusplus
extern "C"
{
#endif

    int32 pvmp3_huffman_parsing(int32 is[SUBBANDS_NUMBER*FILTERBANK_BANDS],
    granuleInfo *grInfo,
    tmp3dec_file   *pVars,
    int32 part2_start,
    mp3Header *info);

    void pvmp3_huffman_quad_decoding(struct huffcodetab *h,
                                     int32 *is,
                                     tmp3Bits *pMainData);

    void pvmp3_huffman_pair_decoding(struct huffcodetab *h,
                                     int32 *is,
                                     tmp3Bits *pMainData);

    void pvmp3_huffman_pair_decoding_linbits(struct huffcodetab *h,
            int32 *is,
            tmp3Bits *pMainData);

#ifdef __cplusplus
}
#endif

/*----------------------------------------------------------------------------
; END
----------------------------------------------------------------------------*/

#endif


text:
package fr.jayasoft.ivy.resolver;

import fr.jayasoft.ivy.LatestStrategy;

public interface HasLatestStrategy {
    public LatestStrategy getLatestStrategy();
    public void setLatestStrategy(LatestStrategy latestStrategy);
    public String getLatest();
}

redpajama_set_name: RedPajamaGithub


text:
namespace ibpm {

#define LOOP_OVER_ALL_OUTPUTS( a )                                          \
    vector<Entry>::iterator entry;                                          \
    bool successful = true;                                                 \
    for (entry = _outputs.begin(); entry != _outputs.end(); ++entry) {      \
        bool result = (entry->output)->a;                                   \
        successful = successful && result;                                  \
    }                                                                       \
    return successful;

Logger::Logger() {
    _hasBeenInitialized = false;
}

void Logger::addOutput(Output* output, int numSkip) {
    Entry entry;
    entry.output = output;
    entry.numSkip = numSkip;
    _outputs.push_back(entry);
}

/// \brief Call all output routines needed at the current timestep,.
bool Logger::doOutput(const State& x) {
    assert( _hasBeenInitialized );
    vector<Entry>::iterator entry;
    bool successful = true;
    for (entry = _outputs.begin(); entry != _outputs.end(); ++entry) {
        if ( entry->shouldBeCalled( x ) ) {
            bool result = (entry->output)->doOutput( x );
            successful = successful && result;
        }
    }
    return successful;
}

/// \brief Call all output routines needed at the current timestep, using baseflow.
bool Logger::doOutput(const BaseFlow& q, const State& x) {
	assert( _hasBeenInitialized );
    vector<Entry>::iterator entry;
    bool successful = true;
    for (entry = _outputs.begin(); entry != _outputs.end(); ++entry) {
        if ( entry->shouldBeCalled( x ) ) {
            bool result = (entry->output)->doOutput( q , x );
            successful = successful && result;
        }
    }
    return successful;
}

// Initialize all of the output routines.
bool Logger::init() {
    _hasBeenInitialized = true;
    LOOP_OVER_ALL_OUTPUTS( init() );
}

/// Clean up all of the output routines.
bool Logger::cleanup() {
    assert( _hasBeenInitialized );
    LOOP_OVER_ALL_OUTPUTS( cleanup() );
}

#undef LOOP_OVER_ALL_OUTPUTS

} // namespace


text:
.class public interface abstract Landroid/support/v4/internal/view/SupportMenu;
.super Ljava/lang/Object;
.source "SupportMenu.java"

# interfaces
.implements Landroid/view/Menu;

# static fields
.field public static final CATEGORY_MASK:I = -0x10000

.field public static final CATEGORY_SHIFT:I = 0x10

.field public static final USER_MASK:I = 0xffff

.field public static final USER_SHIFT:I


text:
/**
 * Принимает произвольный массив или ObservableArray в original и проксирует его в IStreamList (подгружает его элементы
 * порциями по limit)
 */
croc.Class.define('croc.data.StreamingProxy', {
    extend: croc.data.ObservableArray,
    implement: croc.data.IStreamList,

    events: {
        /**
         *
         */
        error: null
    },

    properties: {
        /**
         * Есть ли ещё неподгруженные элементы
         * @type {boolean}
         */
        hasMoreItems: {
            type: 'boolean',
            __setter: null,
            event: true
        },

        /**
         * Идёт ли в данный момент подгрузка элементов
         * @type {boolean}
         */
        loading: {
            __setter: null,
            event: true
        }
    },

    options: {
        /**
         * @type {boolean}
         */
        autoLoadRemoteItems: {
            value: true
        },

        /**
         * Оригинальный массив, который будет проксироваться в поток
         * @type {Array|croc.data.IObservableList}
         */
        original: {
            type: ['array', 'croc.data.IObservableList'],
            required: true
        },

        /**
         * Количество единовременно подгружаемых элементов
         * @type {number}
         */
        limit: {
            type: 'number',
            value: 10
        }
    },

    construct: function(options) {
        var disposer = this._getDisposer();

        if (Array.isArray(options.original)) {
            options.original = new croc.data.ObservableArray({original: options.original});
        }
        this.__rawArray = options.original;
        this.__limit = options.limit;
        options.original = this.__rawArray.getArray().slice(0, this.__limit);

        croc.data.StreamingProxy.superclass.construct.apply(this, arguments);

        var isStream = croc.Interface.check(this.__rawArray, 'croc.data.IStreamList');
        var observable = croc.Object.createModel({
            hasMoreItems: false,
            loading: false
        });

        if (isStream) {
            disposer.addBinding(this.__rawArray, 'hasMoreItems', observable, 'hasMoreItems');
            disposer.addBinding(this.__rawArray, 'loading', observable, 'loading');
            disposer.addListener(this.__rawArray, 'error', function() {
                this.fireEvent.apply(this, arguments);
            }, this);
        }

        disposer.addCallbacks(
            croc.Object.multiBind(
                this, 'length',
                this.__rawArray, 'length',
                observable, 'hasMoreItems',
                this, '__hasMoreItems',
                function(myLength, rawLength, hasMoreItems) {
                    return myLength < rawLength || hasMoreItems;
                }),
            croc.Object.multiBind(
                this, 'length',
                this.__rawArray, 'length',
                observable, 'loading',
                this, '__loading',
                function(myLength, rawLength, loading) {
                    return myLength === rawLength && loading;
                })
        );

        disposer.addListener(this.__rawArray, 'change', function(index, remove, insert) {
            var length = this.getLength();
            if (index === length && this.__appendOnLoad) {
                this.prepareMore();
            }
            else if (index < Math.max(length, this.__limit)) {
                var maxLength = this.__limit * Math.max(
                        Math.ceil((length - Math.min(remove.length, length - index)) / this.__limit),
                        1);

                if (index >= maxLength) {
                    this.splice(maxLength, length - maxLength);
                }
                else {
                    var tailLength = maxLength - index;
                    var tail = insert.length >= tailLength ?
                        insert.slice(0, tailLength) :
                        insert.concat(
                            this.getArray().slice(index + remove.length, maxLength + remove.length - insert.length)
                        );
                    this.splice.apply(this, [index, length - index + 1].concat(tail));
                }
            }
            this.__appendOnLoad = false;
        }, this);

        if (isStream) {
            this.listenChanges(function() {
                if (this.getLength() === this.__rawArray.getLength() && this.__rawArray.getHasMoreItems()) {
                    this.__appendOnLoad = true;
                }
                if (options.autoLoadRemoteItems && this.getLength() > 0 &&
                    this.getLength() > this.__rawArray.getLength() - this.__limit &&
                    this.__rawArray.getHasMoreItems() && !this.__rawArray.getLoading()) {
                    this.__rawArray.prepareMore();
                }
            }, this);
        }
    },

    members: {
        /**
         * Количество элементов, которые единовременно подгружаются в поток по-умолчанию
         * @type {number}
         */
        getDefaultCount: function() {
            return this.__limit;
        },

        /**
         * Алиас для getArray()[index]
         * @param {Number} index
         * @return {*}
         */
        getItem: function(index) {
            if (index >= this.getLength()) {
                this.prepareMore(Math.ceil((index + 1 - this.getLength()) / this.__limit) * this.__limit);
            }
            return croc.data.StreamingProxy.superclass.getItem.apply(this, arguments);
        },

        /**
         * Возвращает индекс элемента ещё не полученного в поток, если его возможно получить. Иначе возвращает null.
         * @param item
         * @returns {number}
         */
        indexInStream: function(item) {
            return this.__rawArray.indexOf(item);
        },

        /**
         * Пометить модель неактуальной. Если removeElements===false, то элементы будут удалены при следующей подгрузке
         * новых элементов
         * @param {boolean} [removeElements=true]
         */
        invalidateElements: function(removeElements) {
            if (removeElements) {
                this.__rawArray.removeAll();
            }
        },

        /**
         * Актуальна ли модель
         * @returns {boolean}
         */
        isActualElements: function() {
            return true;
        },

        /**
         * Есть ли гарантия, что поток пополняется синхронно
         * @returns {boolean}
         */
        isSync: function() {
            return !croc.Interface.check(this.__rawArray, 'croc.data.IStreamList') || !this.__rawArray.getLoading();
        },

        /**
         * Если элементы ещё не подгружены, то подгружает их
         * в данный момент работает последовательно
         * @param {number} [count=undefined]
         */
        prepareMore: function(count) {
            if (count === undefined) {
                count = this.__limit;
            }

            if (this.getHasMoreItems()) {
                this.append(this.__rawArray.getArray().slice(this.getLength(), this.getLength() + count));
            }
        }
    }
});


text:
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.content.browser.remoteobjects;

import static org.hamcrest.Matchers.isIn;
import static org.hamcrest.Matchers.not;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.chromium.base.test.BaseRobolectricTestRunner;

import java.util.HashSet;
import java.util.Set;

/**
 * Tests the object registry, which maintains bidirectional object/ID mappings.
 */
@RunWith(BaseRobolectricTestRunner.class)
public final class RemoteObjectRegistryTest {
    @Test
    public void testMaintainsRetainingSet() {
        // This is how the registry is expected to keep itself alive, despite only being held weakly
        // from its main consumer.
        Set<RemoteObjectRegistry> retainingSet = new HashSet<>();
        RemoteObjectRegistry registry = new RemoteObjectRegistry(retainingSet);
        Assert.assertThat(registry, isIn(retainingSet));
        registry.close();
        Assert.assertThat(registry, not(isIn(retainingSet)));
    }

    @Test
    public void testGetObjectId() {
        // We should get an ID that can be used to retrieve the object.
        Set<RemoteObjectRegistry> retainingSet = new HashSet<>();
        RemoteObjectRegistry registry = new RemoteObjectRegistry(retainingSet);
        Object o = new Object();
        int id = registry.getObjectId(o, null);
        Assert.assertSame(o, registry.getObjectById(id));
    }

    @Test
    public void testGetObjectIdSame() {
        // The ID should be the same if retrieved twice.
        Set<RemoteObjectRegistry> retainingSet = new HashSet<>();
        RemoteObjectRegistry registry = new RemoteObjectRegistry(retainingSet);
        Object o = new Object();
        int id = registry.getObjectId(o, null);
        Assert.assertEquals(id, registry.getObjectId(o, null));
    }

    @Test
    public void testGetObjectIdAfterRemoval() {
        // It should still work if we have previously added and removed the object.
        Set<RemoteObjectRegistry> retainingSet = new HashSet<>();
        RemoteObjectRegistry registry = new RemoteObjectRegistry(retainingSet);
        Object o = new Object();
        int id = registry.getObjectId(o, null);
        registry.unrefObjectById(id);
        int id2 = registry.getObjectId(o, null);
        Assert.assertSame(o, registry.getObjectById(id2));
    }

    @Test
    public void testReturnsNullForNonExistentObject() {
        Set<RemoteObjectRegistry> retainingSet = new HashSet<>();
        RemoteObjectRegistry registry = new RemoteObjectRegistry(retainingSet);
        Assert.assertNull(registry.getObjectById(123));
    }
}


text:
'use strict';
const mBuffer = require('../misc/buffer.js');

const EchonetLitePropertyParser = function() {
	this.lang = 'en';
	this.descs = {
		'en': {
			'TIM': {
				'field': 'Timer operation setting',
				'values': {
					0x41: 'ON',
					0x42: 'OFF'
				}
			}
		},
		'ja': {
			'TIM': {
				'field': 'タイマ動作設定',
				'values': {
					0x41: 'ON',
					0x42: 'OFF'
				}
			}
		}
	}
	this.desc = this.descs[this.lang];
};

EchonetLitePropertyParser.prototype.setLang = function(lang) {
	if(this.descs[lang]) {
		this.desc = this.descs[lang];
		this.lang = lang;
	}
	return this.lang;
};

EchonetLitePropertyParser.prototype.parse = function(buf) {
	let structure = [];
	// Check the length of the buffer
	if(buf.length !== 1) {
		return null;
	}
	// Timer operation setting
	let tim_buf = buf.slice(0, 1);
	let tim_key = 'TIM';
	let tim_value = tim_buf.readUInt8(0);
	let tim = {
		'key'   : tim_key,
		'field' : this.desc[tim_key]['field'],
		'value' : tim_value,
		'buffer': tim_buf,
		'hex'   : mBuffer.convBufferToHexString(tim_buf),
		'desc'  : this.desc[tim_key]['values'][tim_value]
	};
	structure.push(tim);

	let parsed = {
		'message': {
			'timer': (tim_value === 0x41) ? true : false
		},
		'structure': structure
	}
	return parsed;
};

EchonetLitePropertyParser.prototype.create = function(data) {
	if(typeof(data) !== 'object') {
		throw new Error('The 1st argument "data" must be an object.');
	}
	let timer = data['timer'];
	if(typeof(timer) !== 'boolean') {
		throw new Error('The "timer" property in the 1st argument "data" is invalid.');
	}
	var buf = Buffer.alloc(1);
	var timer_value = timer ? 0x41 : 0x42;
	buf.writeUInt8(timer_value);
	return buf;
};

module.exports = new EchonetLitePropertyParser();


text:
namespace tyr {

class Semaphore : private UnCopyable {
  HANDLE sem_ = nullptr;
public:
  explicit Semaphore(uint32_t value) tyr_noexcept
    : sem_(CreateSemaphore(nullptr, value, INT_MAX, nullptr)) {
    TYR_ASSERT(nullptr != sem_);
  }

  ~Semaphore(void) {
    TYR_ASSERT(CloseHandle(sem_));
  }

  void Post(void) {
    TYR_ASSERT(ReleaseSemaphore(sem_, 1, nullptr));
  }

  void Wait(void) {
    TYR_ASSERT(WAIT_OBJECT_0 == WaitForSingleObject(sem_, INFINITE));
  }

  bool TryWait(void) {
    return WAIT_OBJECT_0 == WaitForSingleObject(sem_, 0);
  }
};

}

#endif  // __TYR_WIN_SEM_HEADER_H__


text:
package com.supremainc.biostar2.fragment;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.supremainc.biostar2.BuildConfig;
import com.supremainc.biostar2.R;
import com.supremainc.biostar2.adapter.FingerPrintAdapter;
import com.supremainc.biostar2.datatype.BioMiniTemplate;
import com.supremainc.biostar2.meta.Setting;
import com.supremainc.biostar2.provider.BioMiniDataProvider;
import com.supremainc.biostar2.sdk.models.v2.common.ResponseStatus;
import com.supremainc.biostar2.sdk.models.v2.common.VersionData;
import com.supremainc.biostar2.sdk.models.v2.device.Device;
import com.supremainc.biostar2.sdk.models.v2.device.FingerprintVerify;
import com.supremainc.biostar2.sdk.models.v2.device.ListDevice;
import com.supremainc.biostar2.sdk.models.v2.fingerprint.FingerPrints;
import com.supremainc.biostar2.sdk.models.v2.fingerprint.ListFingerprintTemplate;
import com.supremainc.biostar2.sdk.models.v2.fingerprint.ScanFingerprintTemplate;
import com.supremainc.biostar2.sdk.models.v2.user.User;
import com.supremainc.biostar2.view.SubToolbar;
import com.supremainc.biostar2.widget.ScreenControl.ScreenType;
import com.supremainc.biostar2.widget.popup.Popup.OnPopupClickListener;
import com.supremainc.biostar2.widget.popup.Popup.PopupType;
import com.supremainc.biostar2.widget.popup.SeekBarPopup;
import com.supremainc.biostar2.widget.popup.SelectCustomData;
import com.supremainc.biostar2.widget.popup.SelectPopup;
import com.supremainc.biostar2.widget.popup.SelectPopup.OnSelectResultListener;
import com.supremainc.biostar2.widget.popup.SelectPopup.SelectType;
import com.supremainc.biostar2.widget.popup.ToastPopup;

import java.io.Serializable;
import java.util.ArrayList;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import static com.supremainc.biostar2.provider.BioMiniDataProvider.UFA_OK;

public class FingerprintFragment extends BaseFragment {
    private static final int MODE_DELETE = 1;
    private SelectPopup<ListDevice> mSelectDevicePopup;
    private SubToolbar mSubToolbar;
    private User mUserInfo;
    private FingerPrintAdapter mItemAdapter;

    private String mDeviceId;
    private ListFingerprintTemplate mFingerprintTemplate;
    private boolean mIsDisableModify;
    private boolean mIsTwiceInput;
    private int mQuality = 80;
    private int mScanQuality1st = 0;
    private int mScanQuality2nd = 0;
    private int mReplacePosition = -1;
    private SeekBarPopup mSeekBarPopup;
    private BioMiniDataProvider mBioMiniDataProvider;
    private BioMiniTemplate mBioMiniTemplate0;
    private BioMiniTemplate mBioMiniTemplate1;
    private boolean mIsBioMiniRescan;
    private BroadcastReceiver mUsbReceiver;
    private Callback<FingerPrints> mFingerPrintListener = new Callback<FingerPrints>() {
        @Override
        public void onFailure(Call<FingerPrints> call, Throwable t) {
            if (isIgnoreCallback(call, true)) {
                return;
            }
            showErrorPopup(t.getMessage(), true);
        }

        @Override
        public void onResponse(Call<FingerPrints> call, Response<FingerPrints> response) {
            if (isIgnoreCallback(call, response, true)) {
                return;
            }
            if (isInvalidResponse(response, true, true)) {
                return;
            }
            mUserInfo.fingerprint_templates = response.body().records;
            mUserInfo.card_count = mUserInfo.fingerprint_templates.size();
            refreshValue();
        }
    };
    private Callback<ResponseStatus> mModifyFingerPrintListener = new Callback<ResponseStatus>() {
        @Override
        public void onFailure(Call<ResponseStatus> call, Throwable t) {
            if (isIgnoreCallback(call, true)) {
                return;
            }
            showErrorPopup(t.getMessage(), true);
        }

        @Override
        public void onResponse(Call<ResponseStatus> call, Response<ResponseStatus> response) {
            if (isIgnoreCallback(call, response, false)) {
                return;
            }
            if (isInvalidResponse(response, true, true)) {
                return;
            }
            request(mUserDataProvider.getFingerPrints(mUserInfo.user_id, mFingerPrintListener));
        }
    };
    private Callback<FingerprintVerify> mScanConfirmListener = new Callback<FingerprintVerify>() {
        @Override
        public void onFailure(Call<FingerprintVerify> call, Throwable t) {
            showRetryPopup(t.getMessage(), new OnPopupClickListener() {
                @Override
                public void OnPositive() {
                    scanVerify();
                }

                @Override
                public void OnNegative() {
                    clearValue();
                }
            });
        }

        @Override
        public void onResponse(Call<FingerprintVerify> call, Response<FingerprintVerify> response) {
            if (isIgnoreCallback(call, response, true)) {
                return;
            }
            if (isInvalidResponse(response, false, false) || !response.body().verify_result) {
                mPopup.show(PopupType.ALERT, getString(R.string.info), getString(R.string.fail_verify_finger), new OnPopupClickListener() {
                    @Override
                    public void OnPositive() {
                        clearValue();
                    }

                    @Override
                    public void OnNegative() {
                        clearValue();
                    }
                }, getString(R.string.ok), null, false);
                return;
            }
            sucess();
        }
    };

    private SubToolbar.SubToolBarListener mSubToolBarEvent = new SubToolbar.SubToolBarListener() {
        @Override
        public void onClickSelectAll() {
            if (mSubToolbar.showReverseSelectAll()) {
                if (mItemAdapter != null) {
                    mItemAdapter.selectChoices();
                    mSubToolbar.setSelectedCount(mItemAdapter.getCheckedItemCount());
                }
            } else {
                if (mItemAdapter != null) {
                    mItemAdapter.clearChoices();
                    mSubToolbar.setSelectedCount(0);
                }
            }
        }
    };

    private SeekBarPopup.OnResult mOnChangeQualityResult = new SeekBarPopup.OnResult() {
        @Override
        public void OnResult(String data) {
            if (data != null && !data.isEmpty()) {
                mQuality = Integer.valueOf(data);
                scanFinger();
            } else {
                reScan();
            }
        }
    };
    private Callback<ScanFingerprintTemplate> mScanListener = new Callback<ScanFingerprintTemplate>() {
        @Override
        public void onFailure(Call<ScanFingerprintTemplate> call, Throwable t) {
            if (isIgnoreCallback(call, true)) {
                return;
            }
            showRetryPopup(t.getMessage(), new OnPopupClickListener() {
                @Override
                public void OnPositive() {
                    reScan();
                    //scanFinger();
                }

                @Override
                public void OnNegative() {
                    clearValue();
                }
            });
        }

        @Override
        public void onResponse(Call<ScanFingerprintTemplate> call, Response<ScanFingerprintTemplate> response) {
            if (isIgnoreCallback(call, response, true)) {
                return;
            }
            if (!response.isSuccessful() || response.body() == null) {
//                if (response.errorBody() != null) {
//                    try {
//                        ResponseStatus responseClass = (ResponseStatus) mGson.fromJson(response.errorBody().string(), ResponseStatus.class);
//                        if (Device.SCAN_QUALITY_IS_LOW.equals(responseClass.status_code)) {
//                            showRetryPopup(getString(R.string.low_quality), new OnPopupClickListener() {
//                                @Override
//                                public void OnPositive() {
//                                    reScan();
//                                }
//
//                                @Override
//                                public void OnNegative() {
//                                    clearValue();
//                                }
//                            });
//
//                            return;
//                        }
//                    } catch (Exception e) {
//
//                    }
//                }
                String error = getResponseErrorMessage(response);
                if (error.contains(Device.SCAN_QUALITY_IS_LOW)) {
                    error = getString(R.string.low_quality);
                }
                onFailure(call, new Throwable(error));
                return;
            }
            int scanQuality = 0;
            if (response.body().enroll_quality != null) {
                scanQuality = Integer.valueOf(response.body().enroll_quality);
            }

            if (mFingerprintTemplate == null) {
                mFingerprintTemplate = new ListFingerprintTemplate();
                mFingerprintTemplate.template0 = response.body().template0;
                mFingerprintTemplate.template1 = response.body().template0;
            }

            if (mIsTwiceInput) {
                mScanQuality2nd = scanQuality;
            } else {
                mScanQuality1st = scanQuality;
            }

            if (mQuality > scanQuality) {
                reScan();
                return;
            }

            if (mIsTwiceInput) {
                mIsTwiceInput = false;
                mFingerprintTemplate.template1 = response.body().template0;
                scanVerify();
            } else {
                mIsTwiceInput = true;
                scanFinger();
            }
        }
    };

    public FingerprintFragment() {
        super();
        setType(ScreenType.FINGERPRINT_REGISTER);
        TAG = getClass().getSimpleName() + String.valueOf(System.currentTimeMillis());
    }

    private void scanVerify() {
        mHandler.postDelayed(new Runnable() {
                                 @Override
                                 public void run() {
                                     mPopup.show(PopupType.FINGERPRINT_CONFIRM, mItemAdapter.getName(mReplacePosition), "1" + getString(R.string.st) + " " + getString(R.string.quality) + " " + mScanQuality1st + "\n" + "2" + getString(R
                                                     .string.nd) + " " + getString(R.string.quality) + " " + mScanQuality2nd + "\n" + getString(R.string
                                                     .verify_finger),
                                             null,
                                             null, null,
                                             false);
                                     request(mDeviceDataProvider.verifyFingerprint(mDeviceId, mFingerprintTemplate, mScanConfirmListener));
                                 }
                             }
                , 1000);
    }

    private void showGuideScanFinger() {
        PopupType type = PopupType.FINGERPRINT;
        String body = "\n" + getString(R.string.finger_on_device);

        if (mIsTwiceInput) {
            type = PopupType.FINGERPRINT_AGAGIN;
            body = "1" + getString(R.string.st) + " " + getString(R.string.quality) + " " + mScanQuality1st + "\n" + getString(R.string.finger_on_device_same);
        }
        mPopup.show(type, mItemAdapter.getName(mReplacePosition), body, null,
                null, null, false);
    }

    private void scanFinger() {
        if (isInValidCheck()) {
            return;
        }
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                if (mIsBioMiniRescan) {
                    int result = mBioMiniDataProvider.findDevice();
                    if (result == UFA_OK) {
                        scanBioMini();
                        return;
                    }
                    mIsBioMiniRescan = false;
                    mToastPopup.show(ToastPopup.TYPE_DEFAULT, getString(R.string.portable), BioMiniDataProvider.getMessage(result));
                    return;
                }
                showGuideScanFinger();
                request(mDeviceDataProvider.scanFingerprint(mDeviceId, mQuality, false, mScanListener));
            }
        });
    }

    private void sucess() {
        mPopup.show(PopupType.FINGERPRINT_CONFIRM, mItemAdapter.getName(mReplacePosition), getString(R.string.scan_success), new OnPopupClickListener() {
            @Override
            public void OnPositive() {
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        if (BuildConfig.DEBUG) {
                            Log.i(TAG, "mReplacePosition:" + mReplacePosition + " size:" + mUserInfo.fingerprint_templates.size());
                        }
                        if (mReplacePosition == -1 || mReplacePosition >= mUserInfo.fingerprint_templates.size()) {
                            try {
                                mUserInfo.fingerprint_templates.add(mFingerprintTemplate.clone());
                            } catch (CloneNotSupportedException e) {
                                e.printStackTrace();
                            }
                        } else {
                            try {
                                mUserInfo.fingerprint_templates.set(mReplacePosition, mFingerprintTemplate.clone());
                            } catch (CloneNotSupportedException e) {
                                e.printStackTrace();
                            }
                        }
                        refreshValue();
                        if (VersionData.getCloudVersion(mActivity) > 1) {
                            mPopup.showWait(mCancelExitListener);
                            request(mUserDataProvider.modifyFingerPrints(mUserInfo.user_id, mUserInfo.fingerprint_templates, mModifyFingerPrintListener));
                        }
                    }
                });
            }

            @Override
            public void OnNegative() {
                clearValue();
            }
        }, getString(R.string.ok), null, false);
    }

    private void clearValue() {
        mReplacePosition = -1;
        mFingerprintTemplate = null;
        mIsTwiceInput = false;
        mIsBioMiniRescan = false;
        mBioMiniTemplate0 = null;
        mBioMiniTemplate1 = null;
    }

    private void deleteConfirm(int selectedCount) {
        mPopup.show(PopupType.ALERT, getString(R.string.delete_confirm_question), getString(R.string.selected_count) + " " + selectedCount, new OnPopupClickListener() {
            @Override
            public void OnNegative() {
            }

            @Override
            public void OnPositive() {
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        if (VersionData.getCloudVersion(mActivity) > 1) {
                            int i = mItemAdapter.getCount() - 1;
                            ArrayList<ListFingerprintTemplate> fingerprintTemplates = (ArrayList<ListFingerprintTemplate>) mUserInfo.fingerprint_templates.clone();
                            for (; i >= 0; i--) {
                                boolean isCheck = mItemAdapter.isItemChecked(i);
                                if (isCheck) {
                                    fingerprintTemplates.remove(i);
                                }
                            }
                            mPopup.showWait(mCancelExitListener);
                            request(mUserDataProvider.modifyFingerPrints(mUserInfo.user_id, fingerprintTemplates, mModifyFingerPrintListener));
                        } else {
                            int i = mItemAdapter.getCount() - 1;
                            for (; i >= 0; i--) {
                                boolean isCheck = mItemAdapter.isItemChecked(i);
                                if (isCheck) {
                                    mUserInfo.fingerprint_templates.remove(i);
                                }
                            }
                            refreshValue();
                        }
                    }
                });
            }
        }, getString(R.string.ok), getString(R.string.cancel));
    }

    private void initValue(Bundle savedInstanceState) {
        if (mUserInfo == null) {
            mUserInfo = getExtraData(User.TAG, savedInstanceState);
        }
        if (mBioMiniDataProvider == null) {
            mBioMiniDataProvider = BioMiniDataProvider.getInstance(mActivity);
        }
        Boolean disable = getExtraData(Setting.DISABLE_MODIFY, savedInstanceState);
        if (disable != null) {
            mIsDisableModify = disable;
        }

        if (mSubToolbar == null) {
            mSubToolbar = (SubToolbar) mRootView.findViewById(R.id.subtoolbar);
            mSubToolbar.init(mSubToolBarEvent, getActivity());
            mSubToolbar.setVisibleSearch(false, null);
            mSubToolbar.showMultipleSelectInfo(false, 0);
        }
        if (mUserInfo.fingerprint_templates == null) {
            mUserInfo.fingerprint_templates = new ArrayList<ListFingerprintTemplate>();
        }
        if (mSeekBarPopup == null) {
            mSeekBarPopup = new SeekBarPopup(getActivity());
            mSeekBarPopup.setRange(20, 100, 20);
        }
        if (mItemAdapter == null) {
            mItemAdapter = new FingerPrintAdapter(mActivity, mUserInfo.fingerprint_templates, getListView(), new OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    if (mSubToolbar == null) {
                        return;
                    }
                    if (mSubMode == MODE_DELETE) {
                        mSubToolbar.setSelectAllViewOff();
                        int count = mItemAdapter.getCheckedItemCount();
                        mSubToolbar.setSelectedCount(count);
                        if (count == mItemAdapter.getCount()) {
                            if (!mSubToolbar.getSelectAll()) {
                                mSubToolbar.showReverseSelectAll();
                            }
                        }
                    } else {
                        mReplacePosition = position;
                        showSelectDevice();
                    }
                }
            }, mPopup, null, mIsDisableModify);
        }
        refreshValue();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onDestroy() {
        if (mUserInfo.fingerprint_templates != null) {
            try {
                mUserInfo.fingerprint_count = mUserInfo.fingerprint_templates.size();
                mUserInfo.fingerprint_template_count = mUserInfo.fingerprint_templates.size();
                sendLocalBroadcast(Setting.BROADCAST_UPDATE_FINGER, (Serializable) mUserInfo.clone());
            } catch (Exception e) {

            }
        }
        if (mItemAdapter != null) {
            mItemAdapter.clearItems();
        }
        if (mUsbReceiver != null) {
            getActivity().unregisterReceiver(mUsbReceiver);
            mUsbReceiver = null;
        }
        int unint = mBioMiniDataProvider.unInitDevice();
        //      Log.e(TAG,"unInit:"+mBioMiniDataProvider.getMessage(unint));
        super.onDestroy();
    }

    @Override
    protected void registerBroadcast() {
        if (mUsbReceiver == null) {
            mUsbReceiver = new BroadcastReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                    mIsBioMiniRescan = false;
                    mBioMiniDataProvider.unInitDevice();
                }
            };
        }
        getActivity().registerReceiver(mUsbReceiver, new IntentFilter("android.hardware.usb.action.USB_DEVICE_DETACHED"));
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (super.onOptionsItemSelected(item)) {
            return true;
        }
        switch (item.getItemId()) {
            case R.id.action_delete_confirm:
                int selectedCount = mItemAdapter.getCheckedItemCount();
                if (selectedCount < 1) {
                    mToastPopup.show(getString(R.string.selected_none), null);
                    return true;
                }
                deleteConfirm(selectedCount);
                break;
            case R.id.action_add:
                if (mUserInfo.fingerprint_templates.size() >= 10) {
                    mToastPopup.show(getString(R.string.max_size), null);
                    return true;
                }
                mReplacePosition = mUserInfo.fingerprint_templates.size();
                showSelectDevice();
                break;
            case R.id.action_delete:
                setSubMode(MODE_DELETE);
                break;
            default:
                break;
        }
        return true;
    }

    @Override
    public boolean onSearch(String query) {
        if (super.onSearch(query)) {
            return true;
        }
        if (mSelectDevicePopup != null && mSelectDevicePopup.isExpand()) {
            mSelectDevicePopup.onSearch(query);
        }
        return true;
    }

    @Override
    protected void setSubMode(int mode) {
        mSubMode = mode;
        switch (mode) {
            case MODE_NORMAL:
                mItemAdapter.setChoiceMode(ListView.CHOICE_MODE_NONE);
                mSubToolbar.showMultipleSelectInfo(false, 0);
                break;
            case MODE_DELETE:
                mItemAdapter.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
                mSubToolbar.showMultipleSelectInfo(true, mItemAdapter.getCheckedItemCount());
                break;
        }
        mActivity.invalidateOptionsMenu();
    }

    private void onCreateMenu(Menu menu, MenuInflater inflater) {
        switch (mSubMode) {
            default:
            case MODE_NORMAL:
                initActionbar(getString(R.string.fingerprint));
                inflater.inflate(R.menu.add_delete, menu);
                break;
            case MODE_DELETE:
                initActionbar(getString(R.string.delete_fingerprint));
                inflater.inflate(R.menu.delete_confirm, menu);
                break;
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        setResID(R.layout.fragment_list);
        super.onCreateView(inflater, container, savedInstanceState);
        if (!mIsReUsed) {
            initValue(savedInstanceState);
            initActionbar(getString(R.string.fingerprint));
            mRootView.invalidate();
        }

        if (mUserInfo == null) {
            //         Log.e(TAG, "data is null");
            mHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mToastPopup.show(getString(R.string.none_data), null);
                    mScreenControl.backScreen();
                }
            }, 1000);
            return null;
        }
        if (VersionData.getCloudVersion(mActivity) > 1) {
            if (!mIsDisableModify) {
                mPopup.showWait(mCancelExitListener);
                request(mUserDataProvider.getFingerPrints(mUserInfo.user_id, mFingerPrintListener));
            }
        }
        return mRootView;
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        User bundleItem = null;
        try {
            bundleItem = (User) mUserInfo.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return;
        }
        outState.putSerializable(User.TAG, bundleItem);
        outState.putSerializable(Setting.DISABLE_MODIFY, mIsDisableModify);
    }

    @Override
    public void onPrepareOptionsMenu(Menu menu) {
        menu.clear();
        if (mIsDisableModify) {
            return;
        }
        onCreateMenu(menu, mActivity.getMenuInflater());
        super.onPrepareOptionsMenu(menu);
    }

    private void refreshValue() {
        clearValue();
        if (mUserInfo.fingerprint_templates == null) {
            mUserInfo.fingerprint_templates = new ArrayList<ListFingerprintTemplate>();
        }
        if (mItemAdapter != null) {
            mItemAdapter.setData(mUserInfo.fingerprint_templates);
            mItemAdapter.clearChoices();
        }
        if (mSelectDevicePopup == null) {
            mSelectDevicePopup = new SelectPopup<ListDevice>(mActivity, mPopup);
        }
        if (mSubToolbar != null) {
            mSubToolbar.setSelectedCount(mItemAdapter.getCheckedItemCount());
            if (mItemAdapter != null) {
                mSubToolbar.setTotal(mItemAdapter.getCount());
            }
        }
    }

    private void scanBioMini() {
        if (isInValidCheck()) {
            return;
        }
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                int result = mBioMiniDataProvider.initDevice(BioMiniDataProvider.FingerTemplateType.UFA_TEMPLATE_TYPE_SUPREMA);
                if (result == UFA_OK || result == BioMiniDataProvider.UFA_ERR_ALREADY_INITIALIZED) {
                    if (mBioMiniTemplate0 == null) {
                        mBioMiniTemplate0 = new BioMiniTemplate();
                    }
                    if (mBioMiniTemplate1 == null) {
                        mBioMiniTemplate1 = new BioMiniTemplate();
                    }
                    showGuideScanFinger();
                    mHandler.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            if (isInValidCheck()) {
                                return;
                            }
                            int result;
                            if (mIsTwiceInput) {
                                result = mBioMiniDataProvider.scanFingerPrint(mBioMiniTemplate1);
                            } else {
                                result = mBioMiniDataProvider.scanFingerPrint(mBioMiniTemplate0);
                            }
                            mPopup.dismiss();
                            if (result == UFA_OK) {
                                int quality;
                                if (mFingerprintTemplate == null) {
                                    mFingerprintTemplate = new ListFingerprintTemplate();
                                }
                                if (mIsTwiceInput) {
                                    quality = mBioMiniTemplate1.getQuality()[0];
                                    mScanQuality2nd = quality;
                                    mFingerprintTemplate.template1 = mBioMiniTemplate1.getTemplateString();
                                } else {
                                    quality = mBioMiniTemplate0.getQuality()[0];
                                    mScanQuality1st = quality;
                                    mFingerprintTemplate.template0 = mBioMiniTemplate0.getTemplateString();
                                }
                                if (quality < mQuality) {
                                    showRetryPopup(getString(R.string.low_quality), new OnPopupClickListener() {
                                        @Override
                                        public void OnPositive() {
                                            reScan();
                                        }

                                        @Override
                                        public void OnNegative() {
                                            clearValue();
                                        }
                                    });
                                    return;
                                }

                                if (mIsTwiceInput == true) {
                                    mIsTwiceInput = false;
                                    //scanVerify();
                                    mPopup.show(PopupType.FINGERPRINT_CONFIRM, mItemAdapter.getName(mReplacePosition), "1" + getString(R.string.st) + " " + getString(R.string.quality) + " " + mScanQuality1st + "\n" + "2" + getString(R
                                                    .string.nd) + " " + getString(R.string.quality) + " " + mScanQuality2nd + "\n" + getString(R.string
                                                    .verify_finger),
                                            null,
                                            null, null,
                                            false);
                                    mHandler.postDelayed(new Runnable() {
                                        @Override
                                        public void run() {
                                            if (mBioMiniDataProvider.verify(mBioMiniTemplate0,mBioMiniTemplate1) == UFA_OK) {
                                                sucess();
                                            } else {
                                                mPopup.show(PopupType.ALERT, getString(R.string.info), getString(R.string.fail_verify_finger), new OnPopupClickListener() {
                                                    @Override
                                                    public void OnPositive() {
                                                        clearValue();
                                                    }

                                                    @Override
                                                    public void OnNegative() {
                                                        clearValue();
                                                    }
                                                }, getString(R.string.ok), null, false);
                                            }
                                        }
                                    },1000);
                                } else {
                                    mIsTwiceInput = true;
                                    scanBioMini();
                                }
                            } else {
                                mPopup.show(PopupType.ALERT, getString(R.string.portable), BioMiniDataProvider.getMessage(result), null, null, null);
                            }
                        }
                    }, 1000);

                } else {
                    clearValue();
                    if (isInValidCheck()) {
                        return;
                    }
                    mToastPopup.show(ToastPopup.TYPE_DEFAULT, getString(R.string.portable), BioMiniDataProvider.getMessage(result));
                    return;
                }
            }
        });
    }

    private void showSelectDevice() {
        if (mIsDisableModify) {
            return;
        }
        mIsBioMiniRescan = false;
        mSelectDevicePopup.show(SelectType.DEVICE_FINGERPRINT_BIOMINI, new OnSelectResultListener<ListDevice>() {
            @Override
            public void OnResult(ArrayList<ListDevice> selectedItem, boolean isPositive) {
                if (isInValidCheck()) {
                    return;
                }
                if (selectedItem == null) {
                    clearValue();
                    return;
                }
                mDeviceId = selectedItem.get(0).id;
                if (mDeviceId == null) {
                    return;
                }
                if (mDeviceId.equals("-10")) {
                    int result = mBioMiniDataProvider.findDevice();
                    if (result == UFA_OK) {
                        mIsBioMiniRescan = true;
                        scanBioMini();
                        return;
                    } else {
                        mToastPopup.show(ToastPopup.TYPE_DEFAULT, getString(R.string.portable), BioMiniDataProvider.getMessage(result));
                    }
                    return;
                }
                scanFinger();
            }
        }, null, getString(R.string.select_device_orginal), false, true);

    }

    private void reScan() {
        if (isInValidCheck()) {
            return;
        }
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                SelectPopup<SelectCustomData> selectPopup = new SelectPopup<SelectCustomData>(mActivity, mPopup);
                ArrayList<SelectCustomData> linkType = new ArrayList<SelectCustomData>();
                linkType.add(new SelectCustomData(getString(R.string.rescan_default), 0, false));
                linkType.add(new SelectCustomData(getString(R.string.rescan_change), 1, false));
                selectPopup.show(SelectPopup.SelectType.CUSTOM, new SelectPopup.OnSelectResultListener<SelectCustomData>() {
                    @Override
                    public void OnResult(ArrayList<SelectCustomData> selectedItem, boolean isPositive) {
                        if (isInValidCheck() || selectedItem == null) {
                            mIsTwiceInput = false;
                            return;
                        }
                        int select = selectedItem.get(0).getIntId();
                        if (select == 0) {
                            mQuality = 80;
                            scanFinger();
                            return;
                        } else {
                            mSeekBarPopup.show(getString(R.string.rescan_change), mOnChangeQualityResult, mQuality);
                        }
                    }
                }, linkType, getString(R.string.rescan), false);
            }
        });
    }
}


text:
                <form action="#" enctype="application/x-www-form-urlencoded" class="form-contact">

                            <input name="name" type="text" class="input-text form-element" placeholder="Your Name">

                            <input name="email" type="email" class="input-text form-element"
                                   placeholder="Email Address">

                            <input name="subject" type="text" class="input-text form-element"
                                   placeholder="Subject">

                            <textarea placeholder="" name="text" id="" class="form-element input-text contact-textarea"></textarea>

                            <button type="submit" class="contact-btn form-element input-submit btn-pad">Submit</button>

                </form>


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Asparagus Omelet</title>
      <categories>
        <cat>Cheese/eggs</cat>
        <cat>Vegetables</cat></categories>
      <yield>2</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>pounds</unit></amt>
        <item>Asparagus, trimmed</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit>tablespoons</unit></amt>
        <item>Butter</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Small clove garlic,minced</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>pounds</unit></amt>
        <item>Mushrooms, sliced</item></ing>
      <ing>
        <amt>
          <qty>4</qty>
          <unit>x</unit></amt>
        <item>Eggs, lightly beaten</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit>tablespoons</unit></amt>
        <item>Milk</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>teaspoons</unit></amt>
        <item>Salt</item></ing>
      <ing>
        <amt>
          <qty>1/4</qty>
          <unit>teaspoons</unit></amt>
        <item>Crushed dried basil or</item></ing>
      <ing>
        <amt>
          <qty>3/4</qty>
          <unit>teaspoons</unit></amt>
        <item>Minced fresh basil..........</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>dash</unit></amt>
        <item>Freshly ground black pepper</item></ing></ingredients>
    <directions>
      <step>      Cut asparagus in 1 inch pieces; cook in boiling salted water until
  tender, about 2 to 4 minutes.
   Drain thoroughly.
      Melt 1 T butter in 8 inch skillet, preferably one with non-stick
  lining; saute garlic and mushrooms until done and moisture has evaporated.
  Remove from pan; keep warm.
      In a small bowl, combine eggs, milk, salt, basil and pepper. Melt
  remaining butter in skillet until foamy, swirling it around pan to coat
  evenly.  When hot enough that a drop of water sizzles when dropped in, pour
  in egg mixture.  Tip pan so eggs coat skillet evenly. As eggs cook,
  periodically lift up cooked edges, tilt pan and let uncooked egg run
  underneath.
   When eggs are cooked, but surface is still shiny, place asparagus and
  mushrooms on one side; slide out of pan, folding side without vegetables
  over top.
   Serve immediately

  From Gemini's MASSIVE MealMaster collection at www.synapse.com/~gemini

</step></directions></recipe></recipeml>


text:
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { isPresent } from '../../util/util';
import { PORTAL_TOAST } from '../app/app-constants';
import { ToastCmp } from './toast-component';
import { ToastSlideIn, ToastSlideOut, ToastMdSlideIn, ToastMdSlideOut, ToastWpPopOut, ToastWpPopIn } from './toast-transitions';
import { ViewController } from '../../navigation/view-controller';
/**
 * @hidden
 */
var Toast = (function (_super) {
    __extends(Toast, _super);
    /**
     * @param {?} app
     * @param {?=} opts
     * @param {?=} config
     */
    function Toast(app, opts, config) {
        if (opts === void 0) { opts = {}; }
        var _this = this;
        opts.dismissOnPageChange = isPresent(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
        _this = _super.call(this, ToastCmp, opts, null) || this;
        _this._app = app;
        // set the position to the bottom if not provided
        if (!opts.position || !_this.isValidPosition(opts.position)) {
            opts.position = TOAST_POSITION_BOTTOM;
        }
        _this.isOverlay = true;
        config.setTransition('toast-slide-in', ToastSlideIn);
        config.setTransition('toast-slide-out', ToastSlideOut);
        config.setTransition('toast-md-slide-in', ToastMdSlideIn);
        config.setTransition('toast-md-slide-out', ToastMdSlideOut);
        config.setTransition('toast-wp-slide-out', ToastWpPopOut);
        config.setTransition('toast-wp-slide-in', ToastWpPopIn);
        return _this;
    }
    /**
     * @hidden
     * @param {?} direction
     * @return {?}
     */
    Toast.prototype.getTransitionName = function (direction) {
        var /** @type {?} */ key = 'toast' + (direction === 'back' ? 'Leave' : 'Enter');
        return this._nav && this._nav.config.get(key);
    };
    /**
     * @hidden
     * @param {?} position
     * @return {?}
     */
    Toast.prototype.isValidPosition = function (position) {
        return position === TOAST_POSITION_TOP || position === TOAST_POSITION_MIDDLE || position === TOAST_POSITION_BOTTOM;
    };
    /**
     * @param {?} message
     * @return {?}
     */
    Toast.prototype.setMessage = function (message) {
        this.data.message = message;
        return this;
    };
    /**
     * @param {?} dur
     * @return {?}
     */
    Toast.prototype.setDuration = function (dur) {
        this.data.duration = dur;
        return this;
    };
    /**
     * @param {?} pos
     * @return {?}
     */
    Toast.prototype.setPosition = function (pos) {
        this.data.position = pos;
        return this;
    };
    /**
     * @param {?} cssClass
     * @return {?}
     */
    Toast.prototype.setCssClass = function (cssClass) {
        this.data.cssClass = cssClass;
        return this;
    };
    /**
     * @param {?} closeButton
     * @return {?}
     */
    Toast.prototype.setShowCloseButton = function (closeButton) {
        this.data.showCloseButton = closeButton;
        return this;
    };
    /**
     * Present the toast instance.
     *
     * @param {?=} navOptions
     * @return {?}
     */
    Toast.prototype.present = function (navOptions) {
        if (navOptions === void 0) { navOptions = {}; }
        navOptions.disableApp = false;
        return this._app.present(this, navOptions, PORTAL_TOAST);
    };
    /**
     * Dismiss all toast components which have been presented.
     * @return {?}
     */
    Toast.prototype.dismissAll = function () {
        this._nav && this._nav.popAll();
    };
    return Toast;
}(ViewController));
export { Toast };
function Toast_tsickle_Closure_declarations() {
    /** @type {?} */
    Toast.prototype._app;
}
var /** @type {?} */ TOAST_POSITION_TOP = 'top';
var /** @type {?} */ TOAST_POSITION_MIDDLE = 'middle';
var /** @type {?} */ TOAST_POSITION_BOTTOM = 'bottom';
//# sourceMappingURL=toast.js.map


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-pie-chart',

  included: function(app) {
    this._super.included(app);

    app.import('vendor/pie-chart.css');
  },
  isDevelopingAddon: function() {
    return true;
  }
};


text:
from distutils.log import Log
import apache_beam as beam
import logging
from error.logging_handler import LoggingHandler
from models.execution import Execution
from .megalista_step import MegalistaStep
from config.logging import LoggingConfig

class LastStep(MegalistaStep):
    def expand(self, executions):
        return (
            executions
            | beam.Flatten()
            | beam.CombineGlobally(CombineExecutionsFn())
            | beam.ParDo(PrintResultsDoFn())
        )

class CombineExecutionsFn(beam.CombineFn):
  def create_accumulator(self):
    return {}

  def add_input(self, accumulator, input: Execution):
    key = f"{input.source.source_name} -> {input.destination.destination_name}"
    if key not in accumulator:
      accumulator[key] = input
    return accumulator

  def merge_accumulators(self, accumulators):
    merged = {}
    for accum in accumulators:
      for item in accum.items():
        key = item[0]
        if key not in merged:
          merged[key] = item[1]
    return merged

  def extract_output(self, accumulator):
    return accumulator

class PrintResultsDoFn(beam.DoFn):
    def process(self, executions):
        logging_handler = LoggingConfig.get_logging_handler()

        if logging_handler is None:
          logging.getLogger("megalista").info(f"Clould not find error interception handler. Skipping error intereception.")
        else:
          if logging_handler.has_errors:
            logging.getLogger("megalista.LOG").error(f"SUMMARY OF ERRORS:\n{LoggingHandler.format_records(logging_handler.error_records)}")


text:
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    createActions();

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::exit()
{
    close();
}

void MainWindow::createActions()
{

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/cb_listview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:scrollbars="none" >
    </ListView>

</LinearLayout>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Cladosporium scabies Cooke, 1903

### Remarks
null


text:
package com.github.jberkel.whassup;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.github.jberkel.whassup.model.WhatsAppMessage;

import java.io.IOException;
import java.util.List;

public class ExampleActivity extends Activity {
    private static final String TAG = ExampleActivity.class.getSimpleName();

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("ExampleActivity", "onCreate()");

        Whassup whassup = new Whassup(getApplicationContext());

        fetchMessageCursor(whassup);
        fetchMessages(whassup);
    }

    private void fetchMessages(Whassup whassup) {
        try {
            List<WhatsAppMessage> messages = whassup.getMessages();
            Log.d(TAG, "got " + messages);
        } catch (IOException e) {
            Log.e(TAG, "error getting messages", e);
            Toast.makeText(this, "Error decrypting:" + e.getMessage(), Toast.LENGTH_LONG).show();
        }
    }

    private void fetchMessageCursor(Whassup whassup) {
        Cursor cursor = null;
        try {
            cursor = whassup.queryMessages();

            if (cursor != null) {
                while (cursor.moveToNext()) {
                    WhatsAppMessage m = new WhatsAppMessage(cursor);
                    Log.d(TAG, "got "+m);
                }
            } else {
                Log.w(TAG, "no cursor");
            }
        } catch (IOException e) {
            Log.e(TAG, "error getting messages", e);
            Toast.makeText(this, "Error decrypting:" + e.getMessage(), Toast.LENGTH_LONG).show();
        } finally {
            if (cursor != null) cursor.close();
        }
    }
}


text:
import _extends from 'babel-runtime/helpers/extends';
import getRouteParams from 'react-router/lib/getRouteParams';

export default function mergeRouteParams(prevParams, route, routerProps) {
  var params = _extends({}, prevParams, getRouteParams(route, routerProps.params));

  if (!route.prepareParams) {
    return params;
  }

  // Depending on how we get here, routerProps won't always be the same, but it
  // will always have location, params, and routes, which are all that could
  // possibly be relevant here. Anybody using anything else from routerProps
  // deserves whatever they get.
  return route.prepareParams(params, routerProps);
}


text:
namespace AppStudio.DataProviders.Instagram
{
    public class InstagramDataConfig
    {
        public InstagramQueryType QueryType { get; set; }

        public string Query { get; set; }
    }

    public enum InstagramQueryType
    {
        Tag,
        Id
    }

    public class InstagramOAuthTokens
    {
        public string ClientId { get; set; }
    }
}


text:
import { sortBy } from "lodash-es";
import { getUser } from "./page-context";
import { signatureCompare } from "./pulldasher/sort";
import { PullData, Signature, CommitStatus, StatusState, CommentSource, SignatureGroup } from "./types";

export class Pull extends PullData {
   cr_signatures: SignatureGroup;
   qa_signatures: SignatureGroup;

   constructor(data: PullData) {
      super();
      Object.assign(this, data);

      this.cr_signatures = computeSignatures(data.status.allCR);
      this.qa_signatures = computeSignatures(data.status.allQA);
   }

   isOpen(): boolean {
      return this.state == 'open';
   }

   getUrl(): string {
      return 'https://github.com/' + this.repo + '/pull/' + this.number;
   }

   getRepoName(): string {
      return this.repo.replace(/.*\//g, '');
   }

   // Returns a string that is stable and unique to this pull
   getKey(): string {
      return this.repo + "#" + this.number;
   }

   isMine(): boolean {
      return this.user.login == getUser();
   }

   isCrDone(): boolean {
      return this.cr_signatures.current.length >= this.status.cr_req;
   }

   isQaDone(): boolean {
      return this.qa_signatures.current.length >= this.status.qa_req;
   }

   isCiBlocked(): boolean {
      return !this.getDevBlock() && !this.hasPassedCI();
   }

   hasOutdatedSig(user: string) {
      return this.cr_signatures.old.some((sig) => sig.data.user.login == user) ||
             this.qa_signatures.old.some((sig) => sig.data.user.login == user);
   }

   hasCurrentSig(user: string) {
      return this.cr_signatures.current.some((sig) => sig.data.user.login == user) ||
             this.qa_signatures.current.some((sig) => sig.data.user.login == user);
   }

   getDevBlock(): Signature | null {
      return this.status.dev_block[0];
   }

   /**
    * Returns true if the pull request is in a draft state
    */
   isDraft(): boolean {
      return this.draft;
   }

   /**
    * Returns true if the CI requirement has been met
    */
   hasPassedCI(): boolean {
      const statuses = this.buildStatuses();
      return this.getRequiredBuildStatuses().every((context) => {
         const status = statuses.find(status => status.data.context == context);
         return status && isSuccessfulStatus(status);
      });
   }

   /**
    * Returns true if there are required CI statues OR if there are *any* CI
    * statuses
    */
   isCiRequired(): boolean {
      return this.getRequiredBuildStatuses().length > 0 ||
         this.buildStatuses().length > 0;
   }

   isReady(): boolean {
      return this.hasMetDeployRequirements()
         && !this.getDevBlock()
         && !this.getDeployBlock();
   }

   isDeployBlocked(): boolean {
      return this.hasMetDeployRequirements()
         && !this.getDevBlock()
         && (!!this.getDeployBlock() || !this.isCiRequired());
   }

   hasMetDeployRequirements(): boolean {
      return this.isQaDone()
         && this.isCrDone()
         && this.hasPassedCI();
   }

   getDeployBlock(): Signature | null {
      return this.status.deploy_block[0];
   }

   getLabel(title: string) {
      return this.labels.find((label) => label.title == title);
   }

   buildStatuses(): CommitStatus[] {
      return this.status.commit_statuses;
   }

   hasBuildStatus(context: string): boolean {
      return this.status.commit_statuses.some((status) => status.data.context === context);
   }

   buildStatusesWithRequired(): CommitStatus[] {
      const statuses = this.buildStatuses();
      (this.repoSpec?.requiredStatuses || []).forEach((requiredContext) => {
         if (!this.hasBuildStatus(requiredContext)) {
            statuses.push({
               data: {
                  sha: "unknown", // unused and doesn't matter
                  target_url: null,
                  description: "Missing (not started)",
                  state: StatusState.pending,
                  context: requiredContext,
               }
            });
         }
      });
      return sortBy(statuses, [status => status.data.context.toLowerCase()]);
   }

   getRequiredBuildStatuses(): string[] {
      return this.repoSpec?.requiredStatuses
         // If there are no required statuses, then all existing statuses
         // are required to be passing
         ?? this.buildStatuses().map((status) => status.data.context);
   }

   url() {
      return 'https://github.com/' + this.repo + '/pull/' + this.number;
   }

   linkToSignature(sig: Signature): string {
      const isReview = sig.data.source_type === CommentSource.review;
      const linkIdPrefix = isReview ? "pullrequestreview" : "issuecomment";
      return this.url() + `#${linkIdPrefix}-${sig.data.comment_id}`;
   }
}

function computeSignatures(signatures: Signature[]): SignatureGroup {
   const groups: SignatureGroup = {
      current: [],
      old: [],
   };
   const users: Record<string, boolean> = {};

   signatures
   .sort(signatureCompare)
   .forEach(function(signature) {
      if (users[signature.data.user.login]) {
         return;
      }

      if (signature.data.active) {
         groups.current.push(signature);
      } else {
         groups.old.push(signature);
      }

      users[signature.data.user.login] = true;
   });

   return groups;
}

function isSuccessfulStatus(status: CommitStatus) {
   return status.data.state === 'success';
}


text:
package com.bupt.zk.service.impl;

import org.hibernate.envers.Audited;
import org.springframework.beans.factory.annotation.Autowired;

import com.bupt.zk.dao.UserDao;
import com.bupt.zk.entity.User;
import com.bupt.zk.service.UserService;

/**
 * @author ycsun E-mail:stevesun521@gmail.com
 * @version 创建时间:2013-7-17 下午9:30:31 类说明
 */
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;

	@Override
	public boolean regUser(User user) {
		userDao.save(user);
		return false;
	}

	@Override
	public boolean deleteUser(int userId) {
		userDao.delete(userId);
		return false;
	}

	@Override
	public boolean updateUser(User user) {
		userDao.update(user);
		return false;
	}

	@Override
	public boolean isLogin(String username, String password) {
		boolean isLogin=false;
		if(userDao.getUser(username, password)!=null){
			isLogin=true;
		}
		return isLogin;
	}

}


text:
//
//  Created by Eddy Borja.
//  Copyright (c) 2014 Eddy Borja. All rights reserved.

#import "EBCaptionView.h"
#import <QuartzCore/QuartzCore.h>

const NSInteger MaximumNumberOfCaptionLines = 1000000;
const NSInteger MaximumCaptionTextHeight = 10000000;

static NSString *FrameKeyPath = @"frame";

@interface EBCaptionView ()
@property (strong) UILabel *textLabel;
@property (strong) CAGradientLayer *captionLayer;
@end

#pragma mark - EBCaptionScrollView
@implementation EBCaptionView

- (id)init
{
    self = [super init];
    if (self) {
        [self initialize];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initialize];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    UILabel *captionLabel = [self newCaptionLabel];
    [self setTextLabel:captionLabel];
    [self setDelegate:self];
    [self setBackgroundColor:[UIColor clearColor]];
    [self setScrollEnabled:NO];
    [self setBounces:YES];
    [self setAlwaysBounceVertical:YES];
    [self setShowsHorizontalScrollIndicator:NO];
    [self setShowsVerticalScrollIndicator:NO];
    [self setAutoresizingMask:UIViewAutoresizingFlexibleWidth|
     UIViewAutoresizingFlexibleHeight];
    [self beginObservations];
    [self loadContentViews];
    UIDevice *device = [UIDevice currentDevice];
    [device beginGeneratingDeviceOrientationNotifications];
    NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
    [nc addObserver:self selector:@selector(orientationChanged:)        name:UIDeviceOrientationDidChangeNotification
             object:device];
    UIColor * highColor = [UIColor clearColor];
    UIColor * lowColor = [UIColor blackColor];

    //The gradient, simply enough.  It is a rectangle
    self.captionLayer = [CAGradientLayer layer];
    [self.captionLayer setFrame:[self bounds]];
    [self.captionLayer setColors:@[(id)[highColor CGColor], (id)[lowColor CGColor]]];
    [self.layer insertSublayer:self.captionLayer atIndex:0];
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
    [self stopObservations];
}

#pragma mark - Key Value Observing

- (void)beginObservations
{
    [self addObserver:self forKeyPath:FrameKeyPath options:NSKeyValueObservingOptionNew context:nil];

}

- (void)stopObservations
{
    [self removeObserver:self forKeyPath:FrameKeyPath];
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
    if(object == self && [keyPath isEqualToString:FrameKeyPath]){
        NSLog(@"Update caption");
        [self setNeedsDisplay];
    }
}

#pragma mark - Views

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self resetContentSize];
}

#pragma mark - Loading

- (void)loadContentViews
{
    NSArray *contentViews = [self captionContentViews];
    for(UIView *view in contentViews){
        [self addSubview:view];
    }

    [self resetContentSize];
}

#pragma mark - Setters

- (void)setCaption:(NSString *)string
{
    NSAssert(self.textLabel, @"Got to have a text label for caption view in order to set caption.");

    [self.textLabel setText:nil];
    if([string isEqualToString:@""] || string == nil){
        [self.textLabel setText:@""];
        [self setHidden:YES];
        [self resetContentSize];
        [self resetContentOffset];
        return;
    } else {
        [self setHidden:NO];
    }

    CGFloat totalFadeDuration = 0.2;
    [UIView animateWithDuration:totalFadeDuration/2.0
                          delay:0
                        options:UIViewAnimationCurveEaseOut|
                                UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         [self.textLabel setAlpha:0];
                     }
                     completion:^(BOOL finished){
                         [self.textLabel setText:string];
                         [self setFrameForLabel:self.textLabel
                                     withString:string
                                    maximumSize:CGSizeMake(self.frame.size.width - 40,
                                                    MaximumCaptionTextHeight)];
                         [self resetContentSize];
                         [self resetContentOffset];

                         [UIView animateWithDuration:totalFadeDuration/2.0
                                               delay:0
                                             options:UIViewAnimationCurveEaseOut|
                                                     UIViewAnimationOptionBeginFromCurrentState
                                          animations:^{
                             [self.textLabel setAlpha:1];
                                          }
                                          completion:nil];
                     }];

    if([string isEqualToString:@""] || string == nil){
        [self setHidden:YES];
    } else {
        [self setHidden:NO];
    }
}

- (void)setAttributedCaption:(NSAttributedString *)attributedString
{
    NSAssert(self.textLabel, @"Got to have a text label for caption view in order to set caption.");

    [self.textLabel setAttributedText:nil];
    if([attributedString.string isEqualToString:@""] || attributedString == nil){
        [self.textLabel setText:@""];
        [self setHidden:YES];
        [self resetContentSize];
        [self resetContentOffset];
        return;
    } else {
        [self setHidden:NO];
    }

    CGFloat totalFadeDuration = 0.2;
    [UIView animateWithDuration:totalFadeDuration/2.0
                          delay:0
                        options:UIViewAnimationCurveEaseOut|
     UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         [self.textLabel setAlpha:0];
                     }
                     completion:^(BOOL finished){
                         [self.textLabel setAttributedText:attributedString];
                         [self setFrameForLabel:self.textLabel
                                     withString:[attributedString string]
                                    maximumSize:CGSizeMake(self.frame.size.width - 40,
                                                    MaximumCaptionTextHeight)];
                         [self resetContentSize];
                         [self resetContentOffset];

                         [UIView animateWithDuration:totalFadeDuration/2.0
                                               delay:0
                                             options:UIViewAnimationCurveEaseOut|
                          UIViewAnimationOptionBeginFromCurrentState
                                          animations:^{
                                              [self.textLabel setAlpha:1];
                                          }
                                          completion:nil];
                     }];
}

- (void)setFrameForLabel:(UILabel *)label
              withString:(NSString *)string
             maximumSize:(CGSize)maximumSize
{
    CGRect expectedLabelSize = [string boundingRectWithSize:maximumSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: label.font} context:nil];

    CGRect newFrame = label.frame;
    newFrame.origin.x = newFrame.origin.x == 0 ? 20 : newFrame.origin.x;
    newFrame.size.height = expectedLabelSize.size.height;
    newFrame.size.width = maximumSize.width;
    [label setFrame:newFrame];
}

- (void)resetContentSize
{
    CGRect subviewsRect = CGRectZero;
    for(UIView *view in self.subviews){
        subviewsRect = CGRectUnion(subviewsRect, view.frame);
    }

    CGFloat contentHeight = subviewsRect.size.height + 10;
    [self setContentSize:CGSizeMake(1, contentHeight)];
    CGFloat topInset = self.bounds.size.height - contentHeight;
    [self setContentInset:UIEdgeInsetsMake(topInset, 0, 0, 0)];
    CGRect layerBounds = subviewsRect;
    layerBounds.size = CGSizeMake(layerBounds.size.width + 20, layerBounds.size.height + 20);
    [self.captionLayer setFrame:layerBounds];
}

- (void)setMaxContentSize
{
    CGRect subviewsRect = CGRectZero;
    for(UIView *view in self.subviews){
        subviewsRect = CGRectUnion(subviewsRect, view.frame);
    }

    CGFloat contentHeight = subviewsRect.size.height + 10;
    [self setContentSize:CGSizeMake(1, contentHeight)];
    CGFloat topInset = self.bounds.size.height - contentHeight;
    [self setContentInset:UIEdgeInsetsMake(topInset, 0, 0, 0)];
}

- (void)resetContentOffset
{
    [self setContentOffset:
     CGPointMake(-self.contentInset.left,
                 -self.contentInset.top)];
}

#pragma mark - Getters

- (NSArray *)captionContentViews
{
    NSAssert(self.textLabel,
             @"Caption textLabel property must be set before requesting contentViews");
    return @[self.textLabel];
}

- (CGSize)captionContentSize
{
    NSAssert(self.textLabel,
             @"Caption textLabel property must be set before requesting content size");
    return self.textLabel.frame.size;
}

#pragma mark - Overrides

- (void)drawRect:(CGRect)rect
{
    [super drawRect:rect];

    CGPoint lineEndPoints[] =  {CGPointMake(0, CGRectGetMaxY(rect)),
        CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect))
    };

    CGContextRef context = UIGraphicsGetCurrentContext();
    CGFloat strokeColor[4] = {1,1,1,0.35};
    CGContextSetStrokeColor(context, strokeColor);
    CGContextSetLineWidth(context, 2);
    CGContextAddLines(context, lineEndPoints, 2);
    CGContextStrokePath(context);
}

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
    return NO;
}

#pragma mark - Factory Methods

- (UILabel *)newCaptionLabel
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
    [label setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
    [label setNumberOfLines:MaximumNumberOfCaptionLines];
    [label setBackgroundColor:[UIColor clearColor]];
    [label setTextColor:[UIColor whiteColor]];
    [label setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:15]];
    [label setShadowColor:[UIColor colorWithWhite:0 alpha:0.5]];
    [label setShadowOffset:CGSizeMake(0, 1)];
    return label;
}

- (void)orientationChanged:(NSNotification *)note
{
    [self setFrameForLabel:self.textLabel
                withString:self.textLabel.text
               maximumSize:CGSizeMake(self.frame.size.width - 40,
                                      MaximumCaptionTextHeight)];
    [self resetContentSize];
    [self resetContentOffset];
}
@end


text:
import PropTypes from 'prop-types';

const Social = ({ url, ...rest }) => (
  <a className="social" {...rest}>
    <style jsx>{`
      @import './styles/variables.css';

      .social {
        display: inline-block;
        background-color: var(--page-bg-color-dark);
        background-image: ${`url(${url})`};
        background-position: center;
        background-repeat: no-repeat;
        background-size: 50%;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 100%;
        margin: 0 0.5rem;

        &:hover,
        &:active {
          background-color: var(--page-bg-color-dark-highlight);
        }
      }
    `}</style>
  </a>
);

Social.propTypes = {
  href: PropTypes.string.isRequired,
  title: PropTypes.string.isRequired,
  url: PropTypes.string.isRequired,
};

const GitHub = ({ href }) => (
  <Social href={href} url="/static/icons/github.svg" title="GitHub" />
);

GitHub.propTypes = {
  href: PropTypes.string.isRequired,
};

const GitLab = ({ href }) => (
  <Social href={href} url="/static/icons/gitlab.svg" title="GitLab" />
);

GitLab.propTypes = {
  href: PropTypes.string.isRequired,
};

const LinkedIn = ({ href }) => (
  <Social href={href} url="/static/icons/linkedin.svg" title="LinkedIn" />
);

LinkedIn.propTypes = {
  href: PropTypes.string.isRequired,
};

const Twitter = ({ href }) => (
  <Social href={href} url="/static/icons/twitter.svg" title="Twitter" />
);

Twitter.propTypes = {
  href: PropTypes.string.isRequired,
};

const CodePen = ({ href }) => (
  <Social href={href} url="/static/icons/codepen.svg" title="CodePen" />
);

CodePen.propTypes = {
  href: PropTypes.string.isRequired,
};

export { Social as default, GitHub, GitLab, LinkedIn, Twitter, CodePen };


text:
// Karma configuration
// Generated on Wed Apr 15 2015 18:46:41 GMT+0200 (CEST)

module.exports = function(config) {
	'use strict';

	/fi* global config */
	config.set({

		// base path that will be used to resolve all patterns (eg. files, exclude)
		basePath: '',

		// frameworks to use
		// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
		frameworks: ['jasmine'],

		// list of files / patterns to load in the browser
		files: [
			'src/**/*.module.js'
			, 'src/**/*.js'
			,'test/**/*.js'
		],

		// list of files to exclude
		exclude: [
		],

		// preprocess matching files before serving them to the browser
		// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
		preprocessors: {
		  // source files, that you wanna generate coverage for
		  // do not include tests or libraries
		  // (these files will be instrumented by Istanbul)
		  'src/**/*.js': ['coverage']
		},

		// test results reporter to use
		// possible values: 'dots', 'progress'
		// available reporters: https://npmjs.org/browse/keyword/karma-reporter
		reporters: ['progress', 'coverage'],

		// web server port
		port: 9876,

		// enable / disable colors in the output (reporters and logs)
		colors: true,

		// level of logging
		// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
		logLevel: config.LOG_INFO,

		// enable / disable watching file and executing tests whenever any file changes
		autoWatch: true,

		// start these browsers
		// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
		browsers: ['PhantomJS'],

		// Continuous Integration mode
		// if true, Karma captures browsers, runs the tests and exits
		singleRun: false,

		// optionally, configure the reporter
		coverageReporter: {
			type : 'html',
			dir : 'coverage/'
		}
	});
};


text:
Documentation
=============

Installation
------------
* [Getting Started](/documentation/getting-started)
* [Working with Entity Models](/documentation/working-with-entity-models)
* [Introduction](/documentation/introduction)
* [Advanced Features](/documentation/advanced-features)
* [Is it an ORM?](/documentation/is-it-an-orm)
* [Performance](/documentation/performance)


text:
package com.redhat.ceylon.compiler.typechecker.model;

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

/**
 * Describes data specific to module imports
 *
 * @author Emmanuel Bernard <emmanuel@hibernate.org>
 */
public class ModuleImport implements Annotated {
    private final boolean optional;
    private final boolean export;
    private final Module module;
    private List<Annotation> annotations = new ArrayList<Annotation>();

    public ModuleImport(Module module, boolean optional, boolean export) {
        this.module = module;
        this.optional = optional;
        this.export = export;
    }

    public boolean isOptional() {
        return optional;
    }

    public boolean isExport() {
        return export;
    }

    public Module getModule() {
        return module;
    }

    @Override
    public List<Annotation> getAnnotations() {
        return annotations;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("ModuleImport");
        sb.append("{module=").append(module.getNameAsString()).append(", ").append(module.getVersion());
        sb.append(", optional=").append(optional);
        sb.append(", export=").append(export);
        sb.append('}');
        return sb.toString();
    }
}


text:
package org.cloudbus.cloudsim.core;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import org.cloudbus.cloudsim.Log;

/**
 * A Cloud Information Service (CIS) is an entity that provides cloud resource registration,
 * indexing and discovery services. The Cloud hostList tell their readiness to process Cloudlets by
 * registering themselves with this entity. Other entities such as the resource broker can contact
 * this class for resource discovery service, which returns a list of registered resource IDs. In
 * summary, it acts like a yellow page service. This class will be created by CloudSim upon
 * initialisation of the simulation. Hence, do not need to worry about creating an object of this
 * class.
 *
 * @author Manzur Murshed
 * @author Rajkumar Buyya
 * @since CloudSim Toolkit 1.0
 */
public class CloudInformationService extends SimEntity {

	/** For all types of hostList. */
	private final List<Integer> resList;

	/** Only for AR hostList. */
	private final List<Integer> arList;

	/** List of all regional GIS. */
	private final List<Integer> gisList;

	/**
	 * Allocates a new CloudInformationService object.
	 *
	 * @param name the name to be associated with this entity (as required by SimEntity class)
	 * @throws Exception This happens when creating this entity before initialising CloudSim package
	 *             or this entity name is <tt>null</tt> or empty
	 * @pre name != null
	 * @post $none
	 */
	public CloudInformationService(String name) throws Exception {
		super(name);
		resList = new LinkedList<Integer>();
		arList = new LinkedList<Integer>();
		gisList = new LinkedList<Integer>();
	}

	/**
	 * Starts the CloudInformationService entity.
	 */
	@Override
	public void startEntity() {
	}

	/**
	 * Processes events scheduled for this entity.
	 *
	 * @param ev the event to be handled.
	 * @see SimEntity#processEvent(SimEvent)
	 */
	@Override
	public void processEvent(SimEvent ev) {
		int id = -1;  // requester id
		switch (ev.getTag()) {
		// storing regional GIS id
			case CloudSimTags.REGISTER_REGIONAL_GIS:
				gisList.add((Integer) ev.getData());
				break;

			// request for all regional GIS list
			case CloudSimTags.REQUEST_REGIONAL_GIS:

				// Get ID of an entity that send this event
				id = ((Integer) ev.getData()).intValue();

				// Send the regional GIS list back to sender
				super.send(id, 0L, ev.getTag(), gisList);
				break;

			// A resource is requesting to register.
			case CloudSimTags.REGISTER_RESOURCE:
				resList.add((Integer) ev.getData());
				break;

			// A resource that can support Advance Reservation
			case CloudSimTags.REGISTER_RESOURCE_AR:
				resList.add((Integer) ev.getData());
				arList.add((Integer) ev.getData());
				break;

			// A Broker is requesting for a list of all hostList.
			case CloudSimTags.RESOURCE_LIST:

				// Get ID of an entity that send this event
				id = ((Integer) ev.getData()).intValue();

				// Send the resource list back to the sender
				super.send(id, 0L, ev.getTag(), resList);
				break;

			// A Broker is requesting for a list of all hostList.
			case CloudSimTags.RESOURCE_AR_LIST:

				// Get ID of an entity that send this event
				id = ((Integer) ev.getData()).intValue();

				// Send the resource AR list back to the sender
				super.send(id, 0L, ev.getTag(), arList);
				break;

			default:
				processOtherEvent(ev);
				break;
		}
	}

	/**
	 * Shutdowns the CloudInformationService.
	 */
	@Override
	public void shutdownEntity() {
		notifyAllEntity();
	}

	/**
	 * Gets the list of all CloudResource IDs, including hostList that support Advance Reservation.
	 *
	 * @return LinkedList containing resource IDs. Each ID is represented by an Integer object.
	 * @pre $none
	 * @post $none
	 */
	public List<Integer> getList() {
		return resList;
	}

	/**
	 * Gets the list of CloudResource IDs that <b>only</b> support Advanced Reservation.
	 *
	 * @return LinkedList containing resource IDs. Each ID is represented by an Integer object.
	 * @pre $none
	 * @post $none
	 */
	public List<Integer> getAdvReservList() {
		return arList;
	}

	/**
	 * Checks whether a given resource ID supports Advanced Reservations or not.
	 *
	 * @param id a resource ID
	 * @return <tt>true</tt> if this resource supports Advanced Reservations, <tt>false</tt>
	 *         otherwise
	 * @pre id != null
	 * @post $none
	 */
	public boolean resourceSupportAR(Integer id) {
		if (id == null) {
			return false;
		}

		return resourceSupportAR(id.intValue());
	}

	/**
	 * Checks whether a given resource ID supports Advanced Reservations or not.
	 *
	 * @param id a resource ID
	 * @return <tt>true</tt> if this resource supports Advanced Reservations, <tt>false</tt>
	 *         otherwise
	 * @pre id >= 0
	 * @post $none
	 */
	public boolean resourceSupportAR(int id) {
		boolean flag = false;
		if (id < 0) {
			flag = false;
		} else {
			flag = checkResource(arList, id);
		}

		return flag;
	}

	/**
	 * Checks whether the given CloudResource ID exists or not.
	 *
	 * @param id a CloudResource id
	 * @return <tt>true</tt> if the given ID exists, <tt>false</tt> otherwise
	 * @pre id >= 0
	 * @post $none
	 */
	public boolean resourceExist(int id) {
		boolean flag = false;
		if (id < 0) {
			flag = false;
		} else {
			flag = checkResource(resList, id);
		}

		return flag;
	}

	/**
	 * Checks whether the given CloudResource ID exists or not.
	 *
	 * @param id a CloudResource id
	 * @return <tt>true</tt> if the given ID exists, <tt>false</tt> otherwise
	 * @pre id != null
	 * @post $none
	 */
	public boolean resourceExist(Integer id) {
		if (id == null) {
			return false;
		}
		return resourceExist(id.intValue());
	}

	// //////////////////////// PROTECTED METHODS ////////////////////////////

	/**
	 * This method needs to override by a child class for processing other events. These events are
	 * based on tags that are not mentioned in {@link #body()} method.
	 *
	 * @param ev a Sim_event object
	 * @pre ev != null
	 * @post $none
	 */
	protected void processOtherEvent(SimEvent ev) {
		if (ev == null) {
			Log.printLine("CloudInformationService.processOtherEvent(): "
					+ "Unable to handle a request since the event is null.");
			return;
		}

		Log.printLine("CloudInformationSevice.processOtherEvent(): " + "Unable to handle a request from "
				+ CloudSim.getEntityName(ev.getSource()) + " with event tag = " + ev.getTag());
	}

	/**
	 * Notifies the registered entities about the end of simulation. This method should be
	 * overridden by the child class
	 */
	protected void processEndSimulation() {
		// this should be overridden by the child class
	}

	// ////////////////// End of PROTECTED METHODS ///////////////////////////

	/**
	 * Checks for a list for a particular resource id.
	 *
	 * @param list list of hostList
	 * @param id a resource ID
	 * @return true if a resource is in the list, otherwise false
	 * @pre list != null
	 * @pre id > 0
	 * @post $none
	 */
	private boolean checkResource(Collection<Integer> list, int id) {
		boolean flag = false;
		if (list == null || id < 0) {
			return flag;
		}

		Integer obj = null;
		Iterator<Integer> it = list.iterator();

		// a loop to find the match the resource id in a list
		while (it.hasNext()) {
			obj = it.next();
			if (obj.intValue() == id) {
				flag = true;
				break;
			}
		}

		return flag;
	}

	/**
	 * Tells all registered entities the end of simulation.
	 *
	 * @pre $none
	 * @post $none
	 */
	private void notifyAllEntity() {
		Log.printLine(super.getName() + ": Notify all CloudSim entities for shutting down.");

		signalShutdown(resList);
		signalShutdown(gisList);

		// reset the values
		resList.clear();
		gisList.clear();
	}

	/**
	 * Sends a signal to all entity IDs mentioned in the given list.
	 *
	 * @param list List storing entity IDs
	 * @pre list != null
	 * @post $none
	 */
	protected void signalShutdown(Collection<Integer> list) {
		// checks whether a list is empty or not
		if (list == null) {
			return;
		}

		Iterator<Integer> it = list.iterator();
		Integer obj = null;
		int id = 0;     // entity ID

		// Send END_OF_SIMULATION event to all entities in the list
		while (it.hasNext()) {
			obj = it.next();
			id = obj.intValue();
			super.send(id, 0L, CloudSimTags.END_OF_SIMULATION);
		}
	}

}


text:
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/tom/x_os/install/include".split(';') if "/home/tom/x_os/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "gait_generation;ihmc_msgs;roscpp;std_msgs;tf2_ros;trajectory_generation".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-lsatellite_dish_driver".split(';') if "-lsatellite_dish_driver" != "" else []
PROJECT_NAME = "satellite_dish_driver"
PROJECT_SPACE_DIR = "/home/tom/x_os/install"
PROJECT_VERSION = "0.0.0"