text:
<!--
    Please leave this section at the top of the change log.

    Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:

    ## Current Release
    * Overview of change #1
        - Additional information about change #1
    * Overview of change #2
        - Additional information about change #2
        - Additional information about change #2
    * Overview of change #3
    * Overview of change #4
        - Additional information about change #4

    ## YYYY.MM.DD - Version X.Y.Z (Previous Release)
    * Overview of change #1
        - Additional information about change #1
-->
## Current Release

* Updated Set-AzureRmVMChefExtension cmdlet to add following new options :
    - JsonAttribute : A JSON string to be added to the first run of chef-client. e.g. -JsonAttribute '{"container_service": {"chef-init-test": {"command": "C:\\opscode\\chef\\bin"}}}'

    - ChefServiceInterval : Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field. e.g. -ChefServiceInterval 45

## Version 2.3.0
* Update formats for list of VMs, VMScaleSets and ContainerService
    - The default format of Get-AzureRmVM, Get-AzureRmVmss and Get-AzureRmContainerService is not table format when these cmdlets call List Operation
* Fix overprovision issue for VMScaleSet
    - Because of the bug in Compute client library (and Swagger spec) regarding overprovision property of VMScaleSet, this property did not show up correctly.
* Better piping scenario for VMScaleSets and ContainerService cmdlets
    - VMScaleSet and ContainerService now have "ResourceGroupName" property, so when piping Get command to Delete/Update command, -ResourceGroupName is not required.
* Separate paremater sets for Set-AzureRmVM with Generalized and Redeploy parameter
* Reduce time taken by Get-AzureRmVMDiskEncryptionStatus cmdlet from two minutes to under five seconds
* Allow Set-AzureRmVMDiskEncryptionStatus to be used with VHDs residing in multiple resource groups


text:
package authenticator.operations.OperationsUtils;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Nullable;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.Mac;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

import org.json.JSONException;
import org.spongycastle.util.encoders.Hex;

import authenticator.Authenticator;
import authenticator.GCM.dispacher.Device;
import authenticator.GCM.dispacher.Dispacher;
import authenticator.Utils.CryptoUtils;
import authenticator.Utils.EncodingUtils;
import authenticator.walletCore.exceptions.UnableToCompleteTxSigningException;
import authenticator.walletCore.utils.BAPassword;
import authenticator.operations.OperationsUtils.CommunicationObjects.SignMessage;
import authenticator.protobuf.ProtoConfig.ATAddress;
import authenticator.protobuf.ProtoConfig.ATGCMMessageType;
import authenticator.protobuf.ProtoConfig.ATOperationType;
import authenticator.protobuf.ProtoConfig.PairedAuthenticator;
import authenticator.protobuf.ProtoConfig.PendingRequest;
import authenticator.walletCore.WalletOperation;

import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.TransactionInput;
import org.bitcoinj.core.TransactionOutPoint;
import org.bitcoinj.core.TransactionOutput;
import org.bitcoinj.crypto.DeterministicKey;
import org.bitcoinj.crypto.HDKeyDerivation;
import org.bitcoinj.crypto.TransactionSignature;
import org.bitcoinj.script.Script;
import org.bitcoinj.script.ScriptBuilder;

import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;

public class SignProtocol {

	/**
	 *
	 * @param wallet
	 * @param WALLET_PW
	 * @param tx
	 * @param pairingID
	 * @return
	 * @throws Exception
	 */
	static public byte[] prepareTX(WalletOperation wallet,
			@Nullable BAPassword WALLET_PW,
			Transaction tx,
			String pairingID) throws Exception {
		//Create the payload
		//PairedAuthenticator  pairingObj = Authenticator.getWalletOperation().getPairingObject(pairingID);
		String formatedTx = EncodingUtils.getStringTransaction(tx);
		System.out.println("Raw unSigned Tx - " + formatedTx);
		//Get pub keys and indexes
		ArrayList<byte[]> pubKeysArr = new ArrayList<byte[]>();
		ArrayList<Integer> indexArr = new ArrayList<Integer>();
		for(TransactionInput in:tx.getInputs()){
			String inAddress = in.getConnectedOutput().getScriptPubKey().getToAddress(wallet.getNetworkParams()).toString();
			ATAddress atAdd = wallet.findAddressInAccounts(inAddress);
			ECKey pubkey = wallet.getPrivECKeyFromAccount(atAdd.getAccountIndex(),
																	atAdd.getType(),
																	atAdd.getKeyIndex(),
																	WALLET_PW,
																	true);

			pubKeysArr.add(pubkey.getPubKey());
			indexArr.add(atAdd.getKeyIndex());
		}

		SignMessage signMsgPayload = new SignMessage()
						.setInputNumber(tx.getInputs().size())
						.setTxString(formatedTx)
						.setKeyIndexArray(pubKeysArr, indexArr)
						.setVersion(1)
						.setTestnet(false);
						;
		byte[] jsonBytes = signMsgPayload.serializeToBytes();

		SecretKey secretkey = CryptoUtils.secretKeyFromHexString(wallet.getAESKey(pairingID));
		return CryptoUtils.encryptPayloadWithChecksum(jsonBytes, secretkey);
	}

	/**
	 *
	 * @param wallet
	 * @param WALLET_PW
	 * @param tx
	 * @param AuthSigs
	 * @param po
	 * @throws UnableToCompleteTxSigningException
	 */
	@SuppressWarnings({ "static-access", "deprecation", "unused" })
	static public void complete(WalletOperation wallet,
			@Nullable BAPassword WALLET_PW,
			Transaction tx,
			ArrayList<byte[]> AuthSigs,
			PairedAuthenticator po) throws UnableToCompleteTxSigningException
	 {
		try{
			//Prep the keys needed for signing
			byte[] key = Hex.decode(po.getMasterPublicKey());
			byte[] chain = Hex.decode(po.getChainCode());

			//Loop to create a signature for each input
			int i = 0;
			for(TransactionInput in: tx.getInputs())  {
				// We search the TransactionOutput because we build the Tx from raw hex data, not parent Tx is set.
				TransactionOutPoint txOp = in.getOutpoint();
				TransactionOutput out = wallet.findTransactionOutpointByHash(txOp.getHash().toString(), txOp.getIndex());
				if(out == null)
					throw new UnableToCompleteTxSigningException("Cannot find corresponding transaction outout for input:\n " + in.toString());

				String inAddress = out.getScriptPubKey().getToAddress(wallet.getNetworkParams()).toString();
				ATAddress atAdd = wallet.findAddressInAccounts(inAddress);
				//Authenticator Key
				ECKey authKey = wallet.getPairedAuthenticatorKey(po, atAdd.getKeyIndex());

				ECKey walletKey = wallet.getPrivECKeyFromAccount(atAdd.getAccountIndex(),
																					atAdd.getType(),
																					atAdd.getKeyIndex(),
																					WALLET_PW,
																					true);

				// Create Program for the script
				List<ECKey> keys = ImmutableList.of(authKey, walletKey);
				Script scriptpubkey = ScriptBuilder.createMultiSigOutputScript(2,keys);

				//Create P2SH
				// IMPORTANT - AuthSigs and the signiture we create here should refer to the same input !!
				TransactionSignature sig1 = TransactionSignature.decodeFromBitcoin(AuthSigs.get(i), true);
				TransactionSignature sig2 = tx.calculateSignature(i, walletKey, scriptpubkey, Transaction.SigHash.ALL, false);
				List<TransactionSignature> sigs = ImmutableList.of(sig1, sig2);
				Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(sigs, scriptpubkey);

				in.setScriptSig(inputScript);

				i++;
			}
		}
		catch (Exception e){
			//wallet.disconnectInputs(tx.getInputs());
			e.printStackTrace();
			throw new UnableToCompleteTxSigningException("Unable to finish transaction signing");
		}
	 }

	/**
	 *
	 *
	 * @param pairingID
	 * @param txMessage
	 * @return
	 * @throws JSONException
	 * @throws IOException
	 */
	static public String sendGCM(WalletOperation wallet,
			String pairingID,
			@Nullable String txMessage,
			String extIP,
			String intIP) throws JSONException, IOException{
		Dispacher disp;
		disp = new Dispacher(null,null);
		//Send the encrypted payload over to the Authenticator and wait for the response.
		SecretKey secretkey = CryptoUtils.secretKeyFromHexString(wallet.getAESKey(pairingID));
		PairedAuthenticator  po = wallet.getPairingObject(pairingID);
		byte[] gcmID = po.getGCM().getBytes();
		assert(gcmID != null);
		Device d = new Device(po.getChainCode().getBytes(),
				po.getMasterPublicKey().getBytes(),
				gcmID,
				pairingID.getBytes(),
				secretkey);

		// returns the request ID
		return disp.dispachMessage(ATGCMMessageType.SignTX, d, new String[]{ txMessage, extIP, intIP });
	 }

	static public PendingRequest generatePendingRequest(Transaction tx,
			byte[] cypherBytes,
			String pairingID,
			String reqID,
			@Nullable String txLabel,
			@Nullable String destinationDescription){
		PendingRequest.Builder pr = PendingRequest.newBuilder();
		   pr.setPairingID(pairingID);
		   pr.setRequestID(reqID);
		   pr.setOperationType(ATOperationType.SignAndBroadcastAuthenticatorTx);
		   pr.setPayloadToSendInCaseOfConnection(ByteString.copyFrom(cypherBytes));
		   pr.setRawTx(EncodingUtils.getStringTransaction(tx));
		   pr.setTxLabel(txLabel);
		   pr.setTxDestinationDescription(destinationDescription);
		   PendingRequest.Contract.Builder cb = PendingRequest.Contract.newBuilder();
					cb.setShouldSendPayloadOnConnection(true);
					cb.setShouldReceivePayloadAfterSendingPayloadOnConnection(true);
					cb.setShouldLetPendingRequestHandleRemoval(true);
		   pr.setContract(cb.build());

		   return pr.build();
	}

	public enum AuthenticatorAnswerType{
		Authorized,
		NotAuthorized,
		/**
		 * Possible when the user only watches the transaction but doesn't approve or disapproves
		 */
		DoNothing
	}
}

redpajama_set_name: RedPajamaGithub


text:
typedef NS_ENUM(NSInteger, kmEmotionType) {
	kmEmotionTypeClassic = 1,
	kmEmotionTypeGif= 2,
};

@interface kmEmotionManager : NSObject {

}

@property (nonatomic, assign) kmEmotionType emotionType;

@property (nonatomic, copy) NSString *emotionFilePrefix;
@property (nonatomic, copy) NSString *emotionFileSuffix;
@property (nonatomic, copy) NSString *emotionResourceDir;

@property (nonatomic, copy) NSString *emotionName;

@property (nonatomic, strong) NSMutableArray *emotions;

@end


text:
VirtualRoad::VirtualRoad(glm::vec3 position, glm::vec3 respawn, glm::vec3 normal, glm::vec3 forward, glm::vec3 right, glm::vec3 leftWall, glm::vec3 rightWall, uint32_t unknown) {
    this->position  = position;
    this->respawn   = respawn;
    this->normal    = normal;
    this->forward   = forward;
    this->right     = right;
    this->leftWall  = leftWall;
    this->rightWall = rightWall;
    this->unknown   = unknown;
}


text:
from setuptools import setup, find_packages

setup(
    name='prometheus-es-exporter',
    version='0.5.0.dev1',
    description='Elasticsearch query Prometheus exporter',
    url='https://github.com/Braedon/prometheus-es-exporter',
    author='Braedon Vickers',
    author_email='braedon.vickers@gmail.com',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Topic :: System :: Monitoring',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],
    keywords='monitoring prometheus exporter elasticsearch',
    packages=find_packages(exclude=['tests']),
    install_requires=[
        'elasticsearch',
        'jog',
        'prometheus-client'
    ],
    entry_points={
        'console_scripts': [
            'prometheus-es-exporter=prometheus_es_exporter:main',
        ],
    },
)


text:
import datetime

import fixtures
from oslo_config import cfg
from oslo_config import fixture as fixture_config
from sqlalchemy import delete, MetaData, insert, bindparam
import testtools

from monasca_api.common.repositories.sqla import models

CONF = cfg.CONF

class TestNotificationMethodRepoDB(testtools.TestCase, fixtures.TestWithFixtures):
    @classmethod
    def setUpClass(cls):
        from sqlalchemy import engine_from_config

        engine = engine_from_config({'url': 'sqlite://'}, prefix='')

        qry = open('monasca_api/tests/sqlite_alarm.sql', 'r').read()
        sconn = engine.raw_connection()
        c = sconn.cursor()
        c.executescript(qry)
        sconn.commit()
        c.close()
        cls.engine = engine

        def _fake_engine_from_config(*args, **kw):
            return cls.engine
        cls.fixture = fixtures.MonkeyPatch(
            'sqlalchemy.create_engine', _fake_engine_from_config)
        cls.fixture.setUp()

        metadata = MetaData()
        cls.nm = models.create_nm_model(metadata)
        cls._delete_nm_query = delete(cls.nm)
        cls._insert_nm_query = (insert(cls.nm)
                                .values(
                                    id=bindparam('id'),
                                    tenant_id=bindparam('tenant_id'),
                                    name=bindparam('name'),
                                    type=bindparam('type'),
                                    address=bindparam('address'),
                                    period=bindparam('period'),
                                    created_at=bindparam('created_at'),
                                    updated_at=bindparam('updated_at')))

    @classmethod
    def tearDownClass(cls):
        cls.fixture.cleanUp()

    def setUp(self):
        super(TestNotificationMethodRepoDB, self).setUp()

        self._fixture_config = self.useFixture(
            fixture_config.Config(cfg.CONF))
        self._fixture_config.config(url='sqlite://',
                                    group='database')

        from monasca_api.common.repositories.sqla import notifications_repository as nr

        self.repo = nr.NotificationsRepository()
        self.default_nms = [{'id': '123',
                             'tenant_id': '444',
                             'name': 'MyEmail',
                             'type': 'EMAIL',
                             'address': 'a@b',
                             'period': 0,
                             'created_at': datetime.datetime.now(),
                             'updated_at': datetime.datetime.now()},
                            {'id': '124',
                             'tenant_id': '444',
                             'name': 'OtherEmail',
                             'type': 'EMAIL',
                             'address': 'a@b',
                             'period': 0,
                             'created_at': datetime.datetime.now(),
                             'updated_at': datetime.datetime.now()}]

        with self.engine.connect() as conn:
            conn.execute(self._delete_nm_query)
            conn.execute(self._insert_nm_query, self.default_nms)

    def test_fixture_and_setup(self):
        class A(object):
            def __init__(self):
                from sqlalchemy import create_engine
                self.engine = create_engine(None)

        a = A()
        expected_list_tables = ['alarm',
                                'alarm_action',
                                'alarm_definition',
                                'alarm_definition_severity',
                                'alarm_metric',
                                'alarm_state',
                                'metric_definition',
                                'metric_definition_dimensions',
                                'metric_dimension',
                                'notification_method',
                                'notification_method_type',
                                'sub_alarm',
                                'sub_alarm_definition',
                                'sub_alarm_definition_dimension']

        self.assertEqual(self.engine, a.engine)
        self.assertEqual(self.engine.table_names(), expected_list_tables)

    def test_should_create(self):
        from monasca_api.common.repositories import exceptions
        nmA = self.repo.create_notification('555',
                                            'MyEmail',
                                            'EMAIL',
                                            'a@b',
                                            0)
        nmB = self.repo.list_notification('555', nmA)

        self.assertEqual(nmA, nmB['id'])

        self.assertRaises(exceptions.AlreadyExistsException,
                          self.repo.create_notification,
                          '555',
                          'MyEmail',
                          'EMAIL',
                          'a@b',
                          0)

    def test_should_exists(self):
        from monasca_api.common.repositories import exceptions
        self.assertTrue(self.repo.list_notification("444", "123"))
        self.assertRaises(exceptions.DoesNotExistException,
                          self.repo.list_notification, "444", "1234")
        self.assertRaises(exceptions.DoesNotExistException,
                          self.repo.list_notification, "333", "123")

    def test_should_find_by_id(self):
        nm = self.repo.list_notification('444', '123')
        self.assertEqual(nm['id'], '123')
        self.assertEqual(nm['type'], 'EMAIL')
        self.assertEqual(nm['address'], 'a@b')

    def test_should_find(self):
        nms = self.repo.list_notifications('444', None, None, 1)
        self.assertEqual(nms, self.default_nms)
        nms = self.repo.list_notifications('444', None, 2, 1)
        self.assertEqual(nms, [])

    def test_update(self):
        import copy
        self.repo.update_notification('123', '444', 'Foo', 'EMAIL', 'abc', 0)
        nm = self.repo.list_notification('444', '123')
        new_nm = copy.deepcopy(self.default_nms[0])
        new_nm['name'] = 'Foo'
        new_nm['type'] = 'EMAIL'
        new_nm['address'] = 'abc'
        new_nm['created_at'] = nm['created_at']
        new_nm['updated_at'] = nm['updated_at']
        self.assertEqual(nm, new_nm)
        from monasca_api.common.repositories import exceptions
        self.assertRaises(exceptions.DoesNotExistException,
                          self.repo.update_notification,
                          'no really id',
                          'no really tenant',
                          '',
                          '',
                          '',
                          0)

    def test_should_delete(self):
        from monasca_api.common.repositories import exceptions
        self.repo.delete_notification('444', '123')
        self.assertRaises(exceptions.DoesNotExistException,
                          self.repo.list_notification, '444', '123')
        self.assertRaises(exceptions.DoesNotExistException,
                          self.repo.delete_notification, 'no really tenant', '123')

    def test_should_update_duplicate_with_same_values(self):
        import copy
        self.repo.update_notification('123', '444', 'Foo', 'EMAIL', 'abc', 0)
        self.repo.update_notification('123', '444', 'Foo', 'EMAIL', 'abc', 0)
        nm = self.repo.list_notification('444', '123')
        new_nm = copy.deepcopy(self.default_nms[0])
        new_nm['name'] = 'Foo'
        new_nm['type'] = 'EMAIL'
        new_nm['address'] = 'abc'
        new_nm['created_at'] = nm['created_at']
        new_nm['updated_at'] = nm['updated_at']
        self.assertEqual(nm, new_nm)


text:
"""
Created on 4 Mar 2019

@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""

from scs_core.aqcsv.specification.qualifier import Qualifier
from scs_core.data.json import JSONify

# --------------------------------------------------------------------------------------------------------------------

print("list...")
for qualifier in Qualifier.instances():
    print(qualifier)
print("-")

print("find...")
code = None
qualifier = Qualifier.instance(code)
print("code:%s qualifier:%s" % (code, qualifier))
print("-")

code = "BL"
qualifier = Qualifier.instance(code)
print("code:%s qualifier:%s" % (code, qualifier))

jdict = qualifier.as_json()
print(JSONify.dumps(qualifier))
print("-")

remade = Qualifier.construct_from_jdict(jdict)
print(remade)

equality = remade == qualifier
print("remade == qualifier: %s" % equality)
print("-")


text:
import * as assert from "assert";
import { Enumerable, sequenceequal, sequenceequalp } from "../../src/enumerable";

it('sequenceequal', function () {
    assert.deepEqual(sequenceequal([1, 2, 3], [1, 2, 3], [1, 2, 3]), true);
    assert.deepEqual(Enumerable.from([1, 2, 3]).sequenceequal([1, 2, 3]), true);
    assert.deepEqual(Enumerable.from([]).sequenceequal([]), true);
    assert.deepEqual(Enumerable.from([1, 2, 3]).sequenceequal([1, 2]), false);
    assert.deepEqual(Enumerable.from([1, 2, 3]).sequenceequal([1, 2, 3], [1, 3, 3]), false);

    assert.deepEqual(sequenceequalp([1, 2, 3])([1, 2, 3]), true);
});

export const samples = [
    () => sequenceequal([1, 2, 3], [1, 2, 3]),
    () => sequenceequal([1, 2, 3], [1, 2, 2]),
    () => sequenceequal([1, 2, 3], [1, 2])
];

export const linq = "SequenceEqual";
export const rxjs = "sequenceEqual";


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>natusfera.gbif.es: 500 Error interno</title>
  <link href="/assets/blueprint/screen.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="/assets/blueprint/plugins/buttons/buttons.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="/assets/index.css" media="screen" rel="stylesheet" type="text/css" />

Observaciones

Especies

Gente

Lugares

Me he comido a Natusfera, por eso no funciona.

(¡Lo sentimos! Algo salió mal. Le echaremos un vistazo lo más pronto posible)

Imagen tomada por otolithe (olivier roux). Ve la original aquí. Algunos derechos reservados.


text:
from flask import g, render_template, request

from tsundiary import app
from tsundiary.views import page_not_found
from tsundiary.models import db

@app.route('/settings')
def edit_settings():
    if not g.user:
        return page_not_found()

    private = (g.user.publicity == 0)
    return render_template('settings.html', private=private)

@app.route('/change_setting', methods=['POST'])
def edit_settings_action():
    if not g.user:
        return page_not_found()

    setting_name = request.form.get('setting_name')
    setting_value = request.form.get('setting_value')

    if setting_name == 'private':
        # True
        if int(setting_value):
            g.user.publicity = 0
        else:
            g.user.publicity = 2
        db.session.commit()
        return 'saved!'
    elif setting_name == 'secret_days':
        if setting_value == 'Hidden':
            g.user.publicity = 1
        elif setting_value == 'Forever':
            g.user.publicity = 0
        else:
            g.user.publicity = 2
            g.user.secret_days = int(setting_value)
        db.session.commit()
        return 'saved!'
    elif setting_name == 'theme':
        g.user.theme = setting_value
        db.session.commit()
        return 'refresh to see theme'
    elif setting_name == 'color':
        # User selection of color is taken as a suggestion only.
        # Each theme will incorporate the colors differently.
        g.user.color = setting_value
        print("I am now a", g.user.color)
        db.session.commit()
        return 'refresh to see color'
    else:
        return 'error'
    return 'Jim messed up'

@app.route('/change_password', methods=['POST'])
def change_password():
    if not g.user:
        return page_not_found()

    old_pass = request.form.get('old_pass')
    new_pass = request.form.get('new_pass')

    if len(new_pass) < 3:
        return 'Please enter a new password at least 3 characters long.'

    if g.user.verify_password(old_pass):
        g.user.set_password(new_pass)
        db.session.commit()
        return 'password changed!'
    else:
        return 'wrong old password'


text:
#include <linux/mutex.h>
#include <linux/list.h>
#include "adf_cfg.h"
#include "adf_common_drv.h"

static LIST_HEAD(accel_table);
static LIST_HEAD(vfs_table);
static DEFINE_MUTEX(table_lock);
static uint32_t num_devices;
static u8 id_map[ADF_MAX_DEVICES];

struct vf_id_map {
	u32 bdf;
	u32 id;
	u32 fake_id;
	bool attached;
	struct list_head list;
};

static int adf_get_vf_id(struct adf_accel_dev *vf)
{
	return ((7 * (PCI_SLOT(accel_to_pci_dev(vf)->devfn) - 1)) +
		PCI_FUNC(accel_to_pci_dev(vf)->devfn) +
		(PCI_SLOT(accel_to_pci_dev(vf)->devfn) - 1));
}

static int adf_get_vf_num(struct adf_accel_dev *vf)
{
	return (accel_to_pci_dev(vf)->bus->number << 8) | adf_get_vf_id(vf);
}

static struct vf_id_map *adf_find_vf(u32 bdf)
{
	struct list_head *itr;

	list_for_each(itr, &vfs_table) {
		struct vf_id_map *ptr =
			list_entry(itr, struct vf_id_map, list);

		if (ptr->bdf == bdf)
			return ptr;
	}
	return NULL;
}

static int adf_get_vf_real_id(u32 fake)
{
	struct list_head *itr;

	list_for_each(itr, &vfs_table) {
		struct vf_id_map *ptr =
			list_entry(itr, struct vf_id_map, list);
		if (ptr->fake_id == fake)
			return ptr->id;
	}
	return -1;
}

/**
 * adf_clean_vf_map() - Cleans VF id mapings
 *
 * Function cleans internal ids for virtual functions.
 * @vf: flag indicating whether mappings is cleaned
 *	for vfs only or for vfs and pfs
 */
void adf_clean_vf_map(bool vf)
{
	struct vf_id_map *map;
	struct list_head *ptr, *tmp;

	mutex_lock(&table_lock);
	list_for_each_safe(ptr, tmp, &vfs_table) {
		map = list_entry(ptr, struct vf_id_map, list);
		if (map->bdf != -1) {
			id_map[map->id] = 0;
			num_devices--;
		}

		if (vf && map->bdf == -1)
			continue;

		list_del(ptr);
		kfree(map);
	}
	mutex_unlock(&table_lock);
}
EXPORT_SYMBOL_GPL(adf_clean_vf_map);

/**
 * adf_devmgr_update_class_index() - Update internal index
 * @hw_data:  Pointer to internal device data.
 *
 * Function updates internal dev index for VFs
 */
void adf_devmgr_update_class_index(struct adf_hw_device_data *hw_data)
{
	struct adf_hw_device_class *class = hw_data->dev_class;
	struct list_head *itr;
	int i = 0;

	list_for_each(itr, &accel_table) {
		struct adf_accel_dev *ptr =
				list_entry(itr, struct adf_accel_dev, list);

		if (ptr->hw_device->dev_class == class)
			ptr->hw_device->instance_id = i++;

		if (i == class->instances)
				break;
	}
}
EXPORT_SYMBOL_GPL(adf_devmgr_update_class_index);

static unsigned int adf_find_free_id(void)
{
	unsigned int i;

	for (i = 0; i < ADF_MAX_DEVICES; i++) {
		if (!id_map[i]) {
			id_map[i] = 1;
			return i;
		}
	}
	return ADF_MAX_DEVICES + 1;
}

/**
 * adf_devmgr_add_dev() - Add accel_dev to the acceleration framework
 * @accel_dev:  Pointer to acceleration device.
 * @pf:		Corresponding PF if the accel_dev is a VF
 *
 * Function adds acceleration device to the acceleration framework.
 * To be used by QAT device specific drivers.
 *
 * Return: 0 on success, error code otherwise.
 */
int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev,
		       struct adf_accel_dev *pf)
{
	struct list_head *itr;
	int ret = 0;

	if (num_devices == ADF_MAX_DEVICES) {
		dev_err(&GET_DEV(accel_dev), "Only support up to %d devices\n",
			ADF_MAX_DEVICES);
		return -EFAULT;
	}

	mutex_lock(&table_lock);
	atomic_set(&accel_dev->ref_count, 0);

	/* PF on host or VF on guest */
	if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) {
		struct vf_id_map *map;

		list_for_each(itr, &accel_table) {
			struct adf_accel_dev *ptr =
				list_entry(itr, struct adf_accel_dev, list);

			if (ptr == accel_dev) {
				ret = -EEXIST;
				goto unlock;
			}
		}

		list_add_tail(&accel_dev->list, &accel_table);
		accel_dev->accel_id = adf_find_free_id();
		if (accel_dev->accel_id > ADF_MAX_DEVICES) {
			ret = -EFAULT;
			goto unlock;
		}
		num_devices++;
		map = kzalloc(sizeof(*map), GFP_KERNEL);
		if (!map) {
			ret = -ENOMEM;
			goto unlock;
		}
		map->bdf = ~0;
		map->id = accel_dev->accel_id;
		map->fake_id = map->id;
		map->attached = true;
		list_add_tail(&map->list, &vfs_table);
	} else if (accel_dev->is_vf && pf) {
		/* VF on host */
		struct adf_accel_vf_info *vf_info;
		struct vf_id_map *map;

		vf_info = pf->pf.vf_info + adf_get_vf_id(accel_dev);

		map = adf_find_vf(adf_get_vf_num(accel_dev));
		if (map) {
			struct vf_id_map *next;

			accel_dev->accel_id = map->id;
			list_add_tail(&accel_dev->list, &accel_table);
			map->fake_id++;
			map->attached = true;
			next = list_next_entry(map, list);
			while (next && &next->list != &vfs_table) {
				next->fake_id++;
				next = list_next_entry(next, list);
			}

			ret = 0;
			goto unlock;
		}

		map = kzalloc(sizeof(*map), GFP_KERNEL);
		if (!map) {
			ret = -ENOMEM;
			goto unlock;
		}
		accel_dev->accel_id = adf_find_free_id();
		if (accel_dev->accel_id > ADF_MAX_DEVICES) {
			kfree(map);
			ret = -EFAULT;
			goto unlock;
		}
		num_devices++;
		list_add_tail(&accel_dev->list, &accel_table);
		map->bdf = adf_get_vf_num(accel_dev);
		map->id = accel_dev->accel_id;
		map->fake_id = map->id;
		map->attached = true;
		list_add_tail(&map->list, &vfs_table);
	}
unlock:
	mutex_unlock(&table_lock);
	return ret;
}
EXPORT_SYMBOL_GPL(adf_devmgr_add_dev);

struct list_head *adf_devmgr_get_head(void)
{
	return &accel_table;
}

/**
 * adf_devmgr_rm_dev() - Remove accel_dev from the acceleration framework.
 * @accel_dev:  Pointer to acceleration device.
 * @pf:		Corresponding PF if the accel_dev is a VF
 *
 * Function removes acceleration device from the acceleration framework.
 * To be used by QAT device specific drivers.
 *
 * Return: void
 */
void adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev,
		       struct adf_accel_dev *pf)
{
	mutex_lock(&table_lock);
	if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) {
		id_map[accel_dev->accel_id] = 0;
		num_devices--;
	} else if (accel_dev->is_vf && pf) {
		struct vf_id_map *map, *next;

		map = adf_find_vf(adf_get_vf_num(accel_dev));
		if (!map) {
			dev_err(&GET_DEV(accel_dev), "Failed to find VF map\n");
			goto unlock;
		}
		map->fake_id--;
		map->attached = false;
		next = list_next_entry(map, list);
		while (next && &next->list != &vfs_table) {
			next->fake_id--;
			next = list_next_entry(next, list);
		}
	}
unlock:
	list_del(&accel_dev->list);
	mutex_unlock(&table_lock);
}
EXPORT_SYMBOL_GPL(adf_devmgr_rm_dev);

struct adf_accel_dev *adf_devmgr_get_first(void)
{
	struct adf_accel_dev *dev = NULL;

	if (!list_empty(&accel_table))
		dev = list_first_entry(&accel_table, struct adf_accel_dev,
				       list);
	return dev;
}

/**
 * adf_devmgr_pci_to_accel_dev() - Get accel_dev associated with the pci_dev.
 * @accel_dev:  Pointer to pci device.
 *
 * Function returns acceleration device associated with the given pci device.
 * To be used by QAT device specific drivers.
 *
 * Return: pointer to accel_dev or NULL if not found.
 */
struct adf_accel_dev *adf_devmgr_pci_to_accel_dev(struct pci_dev *pci_dev)
{
	struct list_head *itr;

	mutex_lock(&table_lock);
	list_for_each(itr, &accel_table) {
		struct adf_accel_dev *ptr =
				list_entry(itr, struct adf_accel_dev, list);

		if (ptr->accel_pci_dev.pci_dev == pci_dev) {
			mutex_unlock(&table_lock);
			return ptr;
		}
	}
	mutex_unlock(&table_lock);
	return NULL;
}
EXPORT_SYMBOL_GPL(adf_devmgr_pci_to_accel_dev);

struct adf_accel_dev *adf_devmgr_get_dev_by_id(uint32_t id)
{
	struct list_head *itr;
	int real_id;

	mutex_lock(&table_lock);
	real_id = adf_get_vf_real_id(id);
	if (real_id < 0)
		goto unlock;

	id = real_id;

	list_for_each(itr, &accel_table) {
		struct adf_accel_dev *ptr =
				list_entry(itr, struct adf_accel_dev, list);
		if (ptr->accel_id == id) {
			mutex_unlock(&table_lock);
			return ptr;
		}
	}
unlock:
	mutex_unlock(&table_lock);
	return NULL;
}

int adf_devmgr_verify_id(uint32_t id)
{
	if (id == ADF_CFG_ALL_DEVICES)
		return 0;

	if (adf_devmgr_get_dev_by_id(id))
		return 0;

	return -ENODEV;
}

static int adf_get_num_dettached_vfs(void)
{
	struct list_head *itr;
	int vfs = 0;

	mutex_lock(&table_lock);
	list_for_each(itr, &vfs_table) {
		struct vf_id_map *ptr =
			list_entry(itr, struct vf_id_map, list);
		if (ptr->bdf != ~0 && !ptr->attached)
			vfs++;
	}
	mutex_unlock(&table_lock);
	return vfs;
}

void adf_devmgr_get_num_dev(uint32_t *num)
{
	*num = num_devices - adf_get_num_dettached_vfs();
}

/**
 * adf_dev_in_use() - Check whether accel_dev is currently in use
 * @accel_dev: Pointer to acceleration device.
 *
 * To be used by QAT device specific drivers.
 *
 * Return: 1 when device is in use, 0 otherwise.
 */
int adf_dev_in_use(struct adf_accel_dev *accel_dev)
{
	return atomic_read(&accel_dev->ref_count) != 0;
}
EXPORT_SYMBOL_GPL(adf_dev_in_use);

/**
 * adf_dev_get() - Increment accel_dev reference count
 * @accel_dev: Pointer to acceleration device.
 *
 * Increment the accel_dev refcount and if this is the first time
 * incrementing it during this period the accel_dev is in use,
 * increment the module refcount too.
 * To be used by QAT device specific drivers.
 *
 * Return: 0 when successful, EFAULT when fail to bump module refcount
 */
int adf_dev_get(struct adf_accel_dev *accel_dev)
{
	if (atomic_add_return(1, &accel_dev->ref_count) == 1)
		if (!try_module_get(accel_dev->owner))
			return -EFAULT;
	return 0;
}
EXPORT_SYMBOL_GPL(adf_dev_get);

/**
 * adf_dev_put() - Decrement accel_dev reference count
 * @accel_dev: Pointer to acceleration device.
 *
 * Decrement the accel_dev refcount and if this is the last time
 * decrementing it during this period the accel_dev is in use,
 * decrement the module refcount too.
 * To be used by QAT device specific drivers.
 *
 * Return: void
 */
void adf_dev_put(struct adf_accel_dev *accel_dev)
{
	if (atomic_sub_return(1, &accel_dev->ref_count) == 0)
		module_put(accel_dev->owner);
}
EXPORT_SYMBOL_GPL(adf_dev_put);

/**
 * adf_devmgr_in_reset() - Check whether device is in reset
 * @accel_dev: Pointer to acceleration device.
 *
 * To be used by QAT device specific drivers.
 *
 * Return: 1 when the device is being reset, 0 otherwise.
 */
int adf_devmgr_in_reset(struct adf_accel_dev *accel_dev)
{
	return test_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
}
EXPORT_SYMBOL_GPL(adf_devmgr_in_reset);

/**
 * adf_dev_started() - Check whether device has started
 * @accel_dev: Pointer to acceleration device.
 *
 * To be used by QAT device specific drivers.
 *
 * Return: 1 when the device has started, 0 otherwise
 */
int adf_dev_started(struct adf_accel_dev *accel_dev)
{
	return test_bit(ADF_STATUS_STARTED, &accel_dev->status);
}
EXPORT_SYMBOL_GPL(adf_dev_started);


text:
\documentclass[11pt, a4paper]{article}

\usepackage{titling}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{caption}

\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\large#1\end{center}
    \vskip0.5em}%
}

\newcommand{\specialcell}[2][c]{%
  \begin{tabular}[#1]{@{}l@{}}#2\end{tabular}}

\setlength{\oddsidemargin}{0.5cm}
\setlength{\evensidemargin}{0.5cm}
\setlength{\topmargin}{-1.6cm}
\setlength{\leftmargin}{0.5cm}
\setlength{\rightmargin}{0.5cm}
\setlength{\textheight}{24.00cm}
\setlength{\textwidth}{15.00cm}
\parindent 0pt
\parskip 5pt
\pagestyle{plain}
\usepackage[numbers]{natbib}
\usepackage{capt-of}
\usepackage{graphicx,url}

\begin{document}

\title{CITS3401 Data Exploration \& Mining Project 1}
\subtitle{Healthy Burgers Fast Food Chain}
\author{Aleck Greenham 20362627 \\ Ash Tyndall 20915779}
\date{26th April 2013}

\maketitle

\section*{Abstract}

This document details the design of a data cube suitable for the \textit{Healthy Burgers} franchise, a fast-food restaurant chain with stores in three countries, to aid management in its plans for improving sales and global expansion. Where the system requirements \cite{designdoc} were ambiguous or incomplete, reasonable assumptions were made and documented.

\section*{Introduction}

The client, Healthy Burgers, wishes to mine historical sales data from their nine stores spread across three countries in Australasia to aid management in making decisions regarding global expansion of the franchise and improving sales at existing restaurants. Each restaurant maintains a Online Transaction Processing (OLTP) database and there are aggregate databases at the state, country and worldwide levels. The company maintains data on sales, products, suppliers and restaurants. The purpose of this document is to detail the design of a data cube to extract data from these databases that will support the decisions faced by Healthy Burgers management.

\section*{Limitations}

It is outside the scope of this assessment to address the importing of data from the heterogeneous OLTP restaurant databases, including the cleaning of data. It shall be assumed that the data is complete, easily available and in the desired formats. It is acknowledged, however, that this would not be the case in real industry applications.

A detailed interpretation of the results of the OLAP operations is also outside the scope of this assessment. It falls to Healthy Burgers management to fully interpret and make recommendations or decisions based on the data stored within the data warehouse.

\section*{Requirements}

Table \ref{tab:requirements} is a summary of authors' interpretation of the initial requirements:

\begin{table}

\begin{tabular}{|l|l|l|}

\hline
\textbf{Object} & \textbf{Properties} & \textbf{Restrictions} \\
\hline

Country & & Australia, New Zealand, Singapore \\
\hline

\multirow{3}{3cm}{Store} & Interior Design  & 3 restaurants in each country \\
 	& Facility Type & 3 different interior designs \\
	& & Facilities are `dine in', `drive through' and `both' \\
\hline

\multirow{3}{3cm}{Combo Meal} & Price Category & 6 different combo meals \\
	& Calorie Value & Not all stores have combo meals \\
	& Products & Divided into 3 different price categories \\

\hline

\multirow{2}{3cm}{Supplier} & & There are 2 suppliers \\
	& & Suppliers do 3 combo meals each\\
\hline

\multirow{2}{3cm}{Sale} & Date & Date Between 2008 and 2012 \\
	& Combo &  \\
\hline

\multirow{2}{3cm}{Sales Period} & & Has 2 combo meals \\
	& & Can be `breakfast', `lunch' or `dinner' \\
\hline

Promotional Period & & 6 promotional periods per year\\

\hline

\end{tabular}

\caption{System Requirements Summary}
\label{tab:requirements}

\end{table}

\subsection*{Assumptions}

The following assumptions were made:

\begin{itemize}
	\item To make the initial requirements \cite{designdoc} sufficiently complete
	\item To make the design scenario as realistic as possible
	\item For the sake of simplicity or clarity (where realism was impossible, impractical or outside the scope of assessment)
\end{itemize}

\begin{enumerate}
	\item The type of ingredients are not important, only their supplier - i.e. the supplier is a proxy for how desirable the ingredients they supply are.
	\item There are six combo meals globally.
	\item There are 3 sales periods, each with 2 combo meals, and only 6 combo meals to choose from. If it's true that not all stores sell all the combo meals, then some combo meals must be shared between sales periods.
	\item All non-combo products sold are not of interest (because they have no relation with any of the other data fields).
	\item The same suppliers provide the ingredients for same combo meals, globally.
	\item A promotional period has it's own 6 combo meals (thus the combo meals change every 2 months).
	\item The price of combo meals is set at the store level.
\end{enumerate}

\section*{Schema Design}

A Star Schema was chosen as the design document \cite{designdoc} states Healthy Burgers is only interested in sales, which removes the need to have multiple fact tables (i.e. a Constellation Schema). Table \ref{tab:dimensions} shows the dimension tables used in the solution implementation.

The time values have been split into a number of different dimensions to facilitate the comparison of different time periods against each other. An example query is comparing the total sales during each sales period (Breakfast, Lunch or Dinner) across each promotional period (1st promotion, 2nd promotion, etc.) to find out whether a promotion was particularly successful for a given sales period.

The remaining data has been split up into dimensions to accommodate queries that would be reasonably expected to be of interest to Healthy Burgers management.

\begin{table}
\begin{minipage}{0.6\textwidth}
\begin{tabular}{| p{.4\textwidth} | p{.5\textwidth} |}
\hline
	\textbf{Dimension} & \textbf{Fields} \\
	\hline

	\multirow{2}{.2\textwidth}{Store} & store\_key \\
	& country \\
	\hline

	Design & design\_key \\
	\hline

	Facilities & facility\_key \\
	\hline

	SalesPeriod & sales\_period\_key \\
	\hline

	PromotionalPeriod & promotional\_period\_key \\
	\hline

	Years & years\_key \\
	\hline

	\multirow{2}{.2\textwidth}{Combos} & combo\_key \\
	& calories \\
	\hline

	Suppliers & supplier\_key \\
	\hline

	Price Range & price\_range\_key \\
	\hline

	Calorie Range & calorie\_range\_key \\
	\hline

	\end{tabular}
	\caption{Dimension Tables}
	\label{tab:dimensions}

\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{tabular}{| p{.25\textwidth} | p{.6\textwidth} |}
	\hline
	\textbf{Field Type} & \textbf{Field} \\
	\hline
	\multirow{10}{.25\textwidth}{Dimension Keys} & store\_key \\
		& design\_key \\
		& facility\_key \\
		& sales\_period\_key \\
		& promotional\_period\_key \\
		& years\_key \\
		& combo\_key \\
		& supplier\_key \\
		& price\_range\_key \\
		& calorie\_range\_key \\
	\hline

	Measures & total\_sales\_in\_dollars \\
	\hline

	\end{tabular}
	\caption{Fact Table}
	\label{tab:facts}
\end{minipage}
\end{table}

The requirements state that Healthy Burgers is only interested in a single measurement: sales in dollars; this is reflected in the fact table which consists of keys to all the of available dimensions, and the total sales in dollars.

\section*{Implementation}

\subsection*{Data Generation}

A Python script (\texttt{genvals.py}) authored by Tyndall generated random data that fit within the restrictions imposed by the initial requirements and what was considered realistic. Product names were generated from random dictionary words; product attributes such as price and calorie values were normally variate around a realistic mean and standard deviation. The rest of the data was similarly generated.

In an endeavour to make the data as realistic as feasibly possible, care was taken to influence it in a variety of sensible ways. Sales were positively correlated with increasing caloric content, and similarly correlated with decreasing price.
Different suppliers and store designs affect sales and countries enjoy different sales periods to different extents.

\subsection*{Data Import}

An Excel workbook (\texttt{data-import.xlsx}) was developed with two worksheets to handle the generation of the attribute structure required by Palo; data cleaning and categorisation; and fact insertion. You can see examples of their function in \texttt{create-structure.png} and \texttt{create-data.png}.

\includegraphics[width=15cm]{diagrams/create-data}

Palo's Import Wizard takes the input CSV file (\texttt{fulldata.csv}) generated by the Python script, and places it line-by-line in the first worksheet (``1. Create Structure'').
This worksheet's formulas are recalulated for each row as Palo iterates through them, and thus detects new categories as they appear in the data, creating the appropriate attributes and nesting structure in the OLAP database.

The Import Wizard is then used again on the second worksheet (``2. Create Data''). This worksheet then adds the Sales facts to the Sales data cube.

This 2-step process is necessary, as Palo strongly recommends against combining the \texttt{PALO.EADD} and \texttt{PALO.SETDATA} formulas in the same worksheet when using the Import Wizard.

\includegraphics[width=15cm]{diagrams/create-structure}

\section*{Interesting Scenarios}

Scenarios were chosen for their perceived relevance and interest to Healthy Burgers management for their goals of expanding the Healthy Burgers franchise into other countries, and to replicate the success of existing stores and products where possible, to increase sales and popularity.

Accompanying screenshots for each scenario may be found in the Appendices. The reader should note that although these images are technically not full screen, they do include enough details to verify they are indeed legitimate outputs of the Palo server/Excel plugin. Electronic copies should also be available with this submission.

\subsection*{Total sales in dollars per year by facility type}

It is of interest to Healthy Burgers to know the facility types positively correlated with large amounts of sales to aid in the decision of what facilities to offer in new restaurants. It is also useful for deciding whether to expand existing restaurants to offer new facilities, or whether to close existing facilities because they do not warrant the additional cost of running them.

\subsection*{Total sales in dollars per year by interior design}

Similar to facility types, the correlation between interior designs and total sales can be used for deciding the layouts of new restaurants or whether or not to renovate existing branches to be consistent with the more profitable operations - if this is indeed deemed an important factor in their success.

\subsection*{Total sales in dollars per category of calories by price bracket}

If high calorie meals are indeed more popular - and the data should be consulted to confirm this suspicion - then it is of interest to Healthy Burgers to ascertain how much people are willing to pay per calorie when it comes in the form of the different meals offered in the combos. This can be used to anticipate the success and pricing of future meals offered at both existing and future restaurants, to maximise profits.

\subsection*{Total sales in dollars per products supplied by suppliers by year}

Essentially, this offers an indication of how much profit Healthy Burgers is making from the products whose ingredients are provided by each supplier. This will reveal any correlations or trends regarding consumer preference for the ingredients of one supplier over another. This may also be used to help shape the future pricing of products, identifying and meals or combos that are currently over or under priced.

\subsection*{Total sales in dollars per sales period by country}

Total sales per country is of obvious utility for expanding the franchises stores. Countries may be identified as having significantly large sales and prove a sound choice for future restaurants. Alternatively, it may be decided that these countries are saturated in terms of similar restaurants and future expansion should take place elsewhere.

\begin{thebibliography}{9}

\bibitem{designdoc}
	CITS3401 Data Exploration and Mining - Project 1,
	http://undergraduate.csse.uwa.edu.au/units/CITS3401/labs/proj1-2013.html

\end{thebibliography}

\bibliographystyle{IEEEtranN}

\appendix
\section{Total sales in dollars per year by facility type}
\includegraphics[width=15cm]{diagrams/FacilitiesVsYears}

\section{Total sales in dollars per year by interior design}
\includegraphics[width=15cm]{diagrams/DesignsVsYears}

\section{Total sales in dollars per category of calories by price bracket}
\includegraphics[width=15cm]{diagrams/PriceVsCalories}

\section{Total sales in dollars per products supplied by suppliers by year}
\includegraphics[width=15cm]{diagrams/SuppliersVsYears}

\section{Total sales in dollars per sales period by country}
\includegraphics[width=15cm]{diagrams/CountryVsSalesPeriod}
\end{document}


text:
#include <stdlib.h>
#include <stdio.h>

extern "C" {
void* mi_calloc(size_t, size_t);
void mi_free(void*);
void* mi_calloc_aligned(size_t count, size_t size, size_t alignment);

void* konan_calloc_impl(size_t n_elements, size_t elem_size) {
 return mi_calloc(n_elements, elem_size);
}

void* konan_calloc_aligned_impl(size_t count, size_t size, size_t alignment) {
  return mi_calloc_aligned(count, size, alignment);
}

void konan_free_impl (void* mem) {
  mi_free(mem);
}
}  // extern "C"


text:
{{item.sc()}}: {{item.name}}

                <button ng-click="saveEdit(item)" type="button" class="btn btn-success">

                </button>

Редактировать

                            <input type="checkbox" ng-model="item.action">Активность

                            <input type="text" class="form-control" ng-model="item.name">

                                <select class="form-control" ng-model="child.id">
                                    <option ng-repeat="option in items | orderBy:'name'" value="{{option.id}}">
                                        {{option.name}}
                                    </option>
                                </select>
                                <button type="button" class="btn btn-default" ng-click="removeSubdivision(child)">x</button>

                            Зарегистрирован в системе

                                {{item.createdAt | date:'dd.MM.yyyy HH:mm'}}

                            Последний раз редактировалось

                                {{item.updatedAt | date:'dd.MM.yyyy HH:mm'}}

                            Сохранить

Информация

                                {{key}}
                                {{value | date:'dd.MM.yyyy' }}


text:
<?xml version="1.0" encoding="utf-8"?>
<testSuite name="The TestSuite" xmlns="http://NBi/TestSuite">
	<test name="With table attribute">
		<system-under-test>
			<structure>
				<column caption="column" table="table" perspective="perspective" connectionString="connectionString"/>
			</structure>
		</system-under-test>
		<assert>
			<exists/>
		</assert>
	</test>
</testSuite>


text:
function coloredEcho(){
    local exp=$1;
    local color=$2;
    if ! [[ $color =~ '^[0-9]$' ]] ; then
       case $(echo $color | tr '[:upper:]' '[:lower:]') in
        black) color=0 ;;
        red) color=1 ;;
        green) color=2 ;;
        yellow) color=3 ;;
        blue) color=4 ;;
        magenta) color=5 ;;
        cyan) color=6 ;;
        white|*) color=7 ;; # white or invalid color
       esac
    fi
    tput setaf $color;
    echo -e $exp;
    tput sgr0;
}

sleep 5

~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addnode 192.168.56.3:28333 add
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addnode 192.168.56.2:28333 add
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addnode 192.168.56.3:28333 add

~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente1 357d626250e41eb0390d60e4c33859369681fec371ab532e428b63059e97c6a7
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente1 357d626250e41eb0390d60e4c33859369681fec371ab532e428b63059e97c6a7
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente1 357d626250e41eb0390d60e4c33859369681fec371ab532e428b63059e97c6a7
sleep 0.5
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente2 26ff76d0f66b8403bda6534fce3dbcaf47ffd5eb7e06720dd3d58aee587a39a5
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente2 26ff76d0f66b8403bda6534fce3dbcaf47ffd5eb7e06720dd3d58aee587a39a5
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente2 26ff76d0f66b8403bda6534fce3dbcaf47ffd5eb7e06720dd3d58aee587a39a5
sleep 0.5
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente3 450da364ae10b42c83f180d01fecf5cbd0901d4b1b8eed22d8490d46a42a65e7
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente3 450da364ae10b42c83f180d01fecf5cbd0901d4b1b8eed22d8490d46a42a65e7
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd addwitnesstouser utente3 450da364ae10b42c83f180d01fecf5cbd0901d4b1b8eed22d8490d46a42a65e7
sleep 0.5
coloredEcho "starting miner..." yellow
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd setgenerate true 1
sleep 0.5
coloredEcho "Creating structure" yellow
# Transazione di struttura
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd sendrawtransaction 01000000000d0c5f7374727563747572655f3108077574656e74653129287b22726f7773223a332c22636f6c756d6e73223a332c226f72646572223a227574656e746531227dc59b0000
coloredEcho "\nwait a moment for the dht to be ready" red
sleep 5
coloredEcho "\nPress any button when the dht is loaded" blue
read -n1
coloredEcho "Publishing order for structure" yellow
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd dhtput utente1 order s '["utente1","utente2"]' utente1 0
coloredEcho "Publishing signatures for accumulator" yellow
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd dhtput utente1 signature s '{"utente1":"HwctHmA3eskXqU8XZvZ5UYOuv6kLyPvfk440kpfXQXaXtjhb/CQuzg+bUscIQc9vNk7eXPH46Xkmq7ICQ8dnePw=","utente2":"IPyAistijtTqgXLTmC1Z1w4er5EZAEDlCRGDScfV+uQbImH4p3agJ8xHsD/OiyCdclevSo2kFCDBE0HaepIiSYM="}' utente1 0
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd dhtput utente2 signature s '{"utente1":"H8EmLQjjAwjtYzSldmKi/SqCx4wBvfxqZsCW9Td4+GFdCG1BQluI293q4WEPZMtZnAfiNBwbyfZx40t80bXTxpo=","utente2":"IPrI4rpbaoVuuDu4hMAJ8m9B8ec0pxm5XjCEkbiwErnBqSn1tPzBTS82o8i+qh2mNjEpwNjiQR9/g6cKdIIrfhI="}' utente2 0
sleep 2
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente1 1 \"Primo post utente1\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente1 2 \"Vendo_vino_buono\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente2 1 \"Ciao_sono_utente2\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente2 2 \"Vendo_vino_buonissimo\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente3 1 \"test_di_messaggio\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd follow utente1 [\"utente1\",\"utente2\",\"utente3\"]
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd follow utente2 [\"utente1\",\"utente2\"]
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd follow utente3 [\"utente1\",\"utente2\"]
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd dhtput utente1 home s [\"utente1\",\"utente2\"] utente1 0

coloredEcho "\nPress a button to publish the new accumulator with related signatures" blue
read -n1
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd dhtput utente1 order s [\"utente1\",\"utente2\",\"utente3\"] utente1 1
sleep 2
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd sendrawtransaction 010000000009085f61646d696e5f3208077574656e746532212007eedc174ba9061088bc764189ecb85d351a615f0ca5781c77436735f23224c5afed0000
coloredEcho "\nWait for the transaction to be included in the blockchain" red
read -n1
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd newpostmsg utente3 1 \"test_di_messaggio\"
~/accumunet/twisterd -genproclimit=1 -rpcuser=user -rpcpassword=pwd follow utente1 [\"utente1\",\"utente2\",\"utente3\"]

echo "done!"


text:
<?php

namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;

class CustomExpressionLanguageFunctionTest extends TestCase
{
    public function testDump()
    {
        $container = new ContainerBuilder();
        $container->register('test', 'stdClass')
            ->setPublic(true)
            ->setArguments([new Expression('custom_func("foobar")')]);

        $container->addExpressionLanguageProvider(new class() implements ExpressionFunctionProviderInterface {
            public function getFunctions(): array
            {
                return [
                    ExpressionFunction::fromPhp('strtolower', 'custom_func'),
                ];
            }
        });
        $container->compile();

        $dump = new PhpDumper($container);
        $dumped = $dump->dump();

        $this->assertStringContainsString('strtolower("foobar")', $dumped);
    }
}


text:
{{title}}

{{title}}

{{subtitle}}

            <tactics-carousel-control [options]="carouselOptions"></tactics-carousel-control>

        <mat-button-toggle-group #viewOption="matButtonToggleGroup" class="toolbox"
                [value]="view" (change)="onViewChange($event)" [ngClass]="{'hidden': collapsed}">
            <mat-button-toggle value="carousel" matTooltip="Carousel View">
                <mat-icon class="mat-24" aria-hidden="true" aria-label="view wide table">view_carousel</mat-icon>
            </mat-button-toggle>

            <mat-button-toggle value="heatmap" matTooltip="HeatMap View">
                <mat-icon class="mat-24" aria-hidden="true" aria-label="view heat map">view_comfy</mat-icon>
            </mat-button-toggle>
        </mat-button-toggle-group>

        <button *ngIf="collapsible && collapsed" mat-icon-button class="mat-24 collapser"
                (click)="collapsed = false" matTooltip="Expand Card">
            <mat-icon>fullscreen</mat-icon>
        </button>
        <button *ngIf="collapsible && !collapsed" mat-icon-button class="mat-24 collapser"
                (click)="collapsed = true" matTooltip="Collapse Card">
            <mat-icon>fullscreen_exit</mat-icon>
        </button>

    <tactics-carousel #carousel [hidden]="collapsed || !isCarouselView" [frameworks]="frameworks" [chains]="chains"
            [targets]="targets" [options]="carouselOptions"></tactics-carousel>

    <tactics-treemap #treemap [hidden]="collapsed || !isTreemapView" [frameworks]="frameworks" [chains]="chains"
            [targets]="targets" [options]="treemapOptions"></tactics-treemap>

    <tactics-heatmap #heatmap [hidden]="collapsed || !isHeatmapView" [frameworks]="frameworks" [chains]="chains"
            [targets]="targets" [options]="heatmapOptions"></tactics-heatmap>

<tactics-tooltip #tooltips (hover)="onHover($event)" (click)="onClick($event)"></tactics-tooltip>


text:
package com.intellij.xml.util.documentation;

import com.intellij.psi.xml.XmlTag;
import com.intellij.xml.util.documentation.HtmlAttributeDescriptor;

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

/**
 * Created by IntelliJ IDEA.
 * User: maxim
 * Date: 24.12.2004
 * Time: 23:53:45
 * To change this template use File | Settings | File Templates.
 */
class CompositeAttributeTagDescriptor extends HtmlAttributeDescriptor {
  List<HtmlAttributeDescriptor> attributes = new LinkedList<HtmlAttributeDescriptor>();

  HtmlAttributeDescriptor findHtmlAttributeInContext(XmlTag tag) {
    if (tag == null) return null;
    String contextName = tag.getName();

    for (Iterator<HtmlAttributeDescriptor> iterator = attributes.iterator(); iterator.hasNext();) {
      HtmlAttributeDescriptor attributeDescriptor = iterator.next();

      if (attributeDescriptor.isValidParentTagName(contextName)) {
        return attributeDescriptor;
      }
    }

    return null;
  }
}


text:
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(StoreAnimator))]
public class StoreAnimatorEditor : Editor {
    private StoreAnimator script;

    public override void OnInspectorGUI() {
        base.OnInspectorGUI();
        script = (StoreAnimator)target;

        if (!script.e_storeAllLayers) {
            Animator animator = script.GetComponent<Animator>();
            PrepareLayerMask(animator);
            if (animator) {
                for (int i = 0; i < animator.layerCount; i++) {
                    using (new Horizontal()) {
                        GUILayout.Label("      >       ");
                        bool before = GetLayerActive(i);
                        bool after;
                        if (GUILayout.Toggle(before, animator.GetLayerName(i))) {
                            after = true;
                            if (before != after) {
                                Undo.RecordObject(script, "usng: Store Animator layer mask");
                                SetLayerActive(i);
                            }
                        }
                        else {
                            after = false;
                            if (before != after) {
                                Undo.RecordObject(script, "usng: Store Animator layer mask");
                                SetLayerInactive(i);
                            }
                        }
                        GUILayout.FlexibleSpace();
                    }
                }

                for (int i = 0; i < script.e_layerMask.Length; i++) {
                    string s = "";
                    for (int i2 = 0; i2 < 8; i2++) {
                        s += (((script.e_layerMask[i] >> i2) & 1).ToString());
                    }
                    EditorGUILayout.LabelField(s);
                }
            }
        }
    }

    /// <summary>
    /// Makes sure that there are enough layermask segments in the layermask array.
    /// </summary>
    /// <param name="animator">The Animator component.</param>
    private void PrepareLayerMask(Animator animator) {
        int size = animator.layerCount / 8 + 1;
        if (script.e_layerMask.Length != size) {
            byte[] newMask = new byte[size];
            for (int i = 0; i < script.e_layerMask.Length; i++) {
                newMask[i] = script.e_layerMask[i];
            }
            script.e_layerMask = newMask;
        }
    }

    /// <summary>
    /// Checks whether we want to store a specific layer.
    /// </summary>
    /// <param name="i">The layer's index.</param>
    /// <returns>True, if we want to store it.</returns>
    private bool GetLayerActive(int i) {
        byte maskSegment = script.e_layerMask[i / 8];
        byte offset = (byte)(i % 8);
        return (maskSegment >> offset & 1) == 1;
    }

    /// <summary>
    /// Marks a specific layer to be stored in the layermask.
    /// </summary>
    /// <param name="i">The layer's index.</param>
    private void SetLayerActive(int i) {
        byte offset = (byte)(i % 8);
        script.e_layerMask[i / 8] |= (byte)(1 << offset);
    }

    /// <summary>
    /// Clears a specific layer in the layermask, so it doesn't get stored.
    /// </summary>
    /// <param name="i">The layer's index.</param>
    private void SetLayerInactive(int i) {
        byte offset = (byte)(i % 8);
        script.e_layerMask[i / 8] &= (byte)(~(1 << offset));
    }
}


text:
     Go Back

Job Contract

        {{created | date:'dd/MM/yyyy'}}

        <address class="offset8">
            {{quote.business.business}}
            ABN: {{quote.business.abn}}
            {{quote.business.address1}}
            {{quote.business.address2}}
            {{quote.business.tel}}
            {{quote.business.email}}

        </address>

            {{quote.client}}
            {{quote.address}}

        {{contract.dear}}
        {{contract.title}}

{{contract.intro}}

Works to include

{{work.title}}

{{item.content}}

{{work.note}}

Costing overview

                        Works
                        Price

                        {{work.title}}
                        {{work.finalPrice | noFractionCurrency}}

                        Total
                        {{quote.finalPrice | noFractionCurrency}}

Pricing structure

{{contract.paymentIntro}}

                        Payment
                        Percent

                        {{payment.title}}
                        {{payment.portion | percentf}}

{{s.content}}

Date: {{created | date:'dd/MM/yyyy'}}

{{quote.client}}

Sign _____________________________

{{quote.business.business}}

Sign _____________________________


text:
package ti.modules.titanium.media;

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

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.Log;
import org.appcelerator.titanium.util.TiConfig;
import org.appcelerator.titanium.util.TiConvert;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.os.ResultReceiver;

@Kroll.proxy(creatableInModule=MediaModule.class)
public class VideoPlayerProxy extends KrollProxy
{
	private static final String LCAT = "VideoPlayerProxy";
	private static final boolean DBG = TiConfig.LOGD;

	protected static final int CONTROL_MSG_LOAD = 100;
	protected static final int CONTROL_MSG_COMPLETE = 101;

	private Handler controlHandler;
	private Messenger activityMessenger;
	private List<TiViewProxy> children = Collections.synchronizedList(new ArrayList<TiViewProxy>());
	private boolean play;
	private int mediaControlStyle = MediaModule.VIDEO_CONTROL_DEFAULT;
	private int scalingMode = MediaModule.VIDEO_SCALING_ASPECT_FIT;

	public VideoPlayerProxy(TiContext tiContext)
	{
		super(tiContext);
	}

	public void handleCreationDict(KrollDict options)
	{
		final TiContext tiContext = getTiContext();
		final Intent intent = new Intent(tiContext.getActivity(), TiVideoActivity.class);

		String url = null;
		if (options.containsKey(TiC.PROPERTY_CONTENT_URL)) {
			url = TiConvert.toString(options, TiC.PROPERTY_CONTENT_URL);
			Log.w(LCAT, "contentURL is deprecated, use url instead");
		} else if (options.containsKey(TiC.PROPERTY_URL)) {
			url = TiConvert.toString(options, TiC.PROPERTY_URL);
		}

		if (url != null) {
			url = tiContext.resolveUrl(null, url);
			if (DBG) {
				Log.d(LCAT, "Video source: " + url);
			}
			intent.putExtra(TiC.PROPERTY_CONTENT_URL, url);
		}
		if (options.containsKey(TiC.PROPERTY_BACKGROUND_COLOR)) {
			intent.putExtra(TiC.PROPERTY_BACKGROUND_COLOR, TiConvert.toColor(options, TiC.PROPERTY_BACKGROUND_COLOR));
		}
		if (options.containsKey(TiC.PROPERTY_PLAY)) {
			intent.putExtra(TiC.PROPERTY_PLAY, TiConvert.toBoolean(options, TiC.PROPERTY_PLAY));
		}
		if (options.containsKey(TiC.PROPERTY_MEDIA_CONTROL_STYLE)) {
			mediaControlStyle = TiConvert.toInt(options, TiC.PROPERTY_MEDIA_CONTROL_STYLE);
		}
		intent.putExtra(TiC.PROPERTY_MEDIA_CONTROL_STYLE, mediaControlStyle);

		if (options.containsKey(TiC.PROPERTY_SCALING_MODE)) {
			scalingMode = TiConvert.toInt(options, TiC.PROPERTY_SCALING_MODE);
		}
		intent.putExtra(TiC.PROPERTY_SCALING_MODE, scalingMode);

		controlHandler = createControlHandler();
		intent.putExtra(TiC.PROPERTY_MESSENGER, new Messenger(controlHandler));

		ResultReceiver messengerReceiver = new ResultReceiver(controlHandler) {
			@Override
			protected void onReceiveResult(int resultCode, Bundle resultData) {
				super.onReceiveResult(resultCode, resultData);
				setActivityMessenger((Messenger)resultData.getParcelable("messenger"));
				if (DBG) {
					Log.d(LCAT, "TiVideoActivity messenger received. Releasing latch");
				}
			}
		};
		intent.putExtra(TiC.PROPERTY_MESSENGER_RECEIVER, messengerReceiver);
		tiContext.getActivity().startActivity(intent);
	}

	protected void setActivityMessenger(Messenger messenger)
	{
		activityMessenger = messenger;
		synchronized (children) {
			for (TiViewProxy child : children) {
				sendAddMessage(child);
			}
		}
		if (play) {
			sendPlayMessage();
		}
	}

	@Kroll.method
	public void add(TiViewProxy proxy)
	{
		if (activityMessenger != null) {
			sendAddMessage(proxy);
		} else {
			synchronized (children) {
				children.add(proxy);
			}
		}
	}

	protected void sendAddMessage(TiViewProxy proxy)
	{
		Message msg = Message.obtain();
		msg.what = TiVideoActivity.MSG_ADD_VIEW;
		msg.obj = proxy;
		try {
			activityMessenger.send(msg);
		} catch (RemoteException e) {
			Log.w(LCAT, "Unable to add view, Activity is no longer available: " + e.getMessage());
		}
	}

	@Kroll.method
	public void play()
	{
		if (activityMessenger != null) {
			sendPlayMessage();
		} else {
			play = true;
		}
	}

	protected void sendPlayMessage()
	{
		try {
			Message msg = Message.obtain();
			msg.what = TiVideoActivity.MSG_PLAY;
			activityMessenger.send(msg);
		} catch (RemoteException e) {
			Log.w(LCAT, "Unable to send play message: " + e.getMessage());
		}
	}

	@Kroll.method
	public void pause()
	{
		if (activityMessenger != null) {
			try {
				Message msg = Message.obtain();
				msg.what = TiVideoActivity.MSG_PAUSE_PLAYBACK;
				activityMessenger.send(msg);
			} catch (RemoteException e) {
				Log.w(LCAT, "Unable to send pause message: " + e.getMessage());
			}
		}
	}

	@Kroll.method
	public void start()
	{
		if (activityMessenger != null) {
			try {
				Message msg = Message.obtain();
				msg.what = TiVideoActivity.MSG_START_PLAYBACK;
				activityMessenger.send(msg);
			} catch (RemoteException e) {
				Log.w(LCAT, "Unable to send start message: " + e.getMessage());
			}
		}
	}

	@Kroll.method
	public void stop()
	{
		if (activityMessenger != null) {
			try {
				Message msg = Message.obtain();
				msg.what = TiVideoActivity.MSG_STOP_PLAYBACK;
				activityMessenger.send(msg);
			} catch (RemoteException e) {
				Log.w(LCAT, "Unable to send stop message: " + e.getMessage());
			}
		} else {
			play = false;
		}
	}

	@Kroll.method
	public void hide()
	{
		if (activityMessenger != null) {
			try {
				Message msg = Message.obtain();
				msg.what = TiVideoActivity.MSG_HIDE;
				activityMessenger.send(msg);
			} catch (RemoteException e) {
				Log.w(LCAT, "Unable to send hide message: " + e.getMessage());
			}
		}
	}

	@Kroll.getProperty @Kroll.method
	public int getMediaControlStyle() {
		return mediaControlStyle;
	}

	@Kroll.setProperty @Kroll.method
	public void setMediaControlStyle(int style) {
		if (style != mediaControlStyle) {
			mediaControlStyle = style;
			if (activityMessenger != null) {
				try {
					Message msg = Message.obtain();
					msg.what = TiVideoActivity.MSG_MEDIA_CONTROL_STYLE_CHANGE;
					msg.arg1 = mediaControlStyle;
					activityMessenger.send(msg);
				} catch (RemoteException e) {
					Log.w(LCAT, "Unable to send media control style change message: " + e.getMessage());
				}
			}
		}
	}

	@Kroll.getProperty @Kroll.method
	public int getScalingMode() {
		return scalingMode;
	}

	@Kroll.setProperty @Kroll.method
	public void setScalingMode(int mode) {
		if (mode != scalingMode) {
			scalingMode = mode;
			if (activityMessenger != null) {
				try {
					Message msg = Message.obtain();
					msg.what = TiVideoActivity.MSG_SCALING_MODE_CHANGE;
					msg.arg1 = scalingMode;
					activityMessenger.send(msg);
				} catch (RemoteException e) {
					Log.w(LCAT, "Unable to send scaling mode message: " + e.getMessage());
				}
			}
		}
	}

	private Handler createControlHandler()
	{
		return new Handler(new Handler.Callback() {
			@Override
			public boolean handleMessage(Message msg)
			{
				switch (msg.what) {
					case CONTROL_MSG_LOAD : {
						if (DBG) {
							Log.i(LCAT, "Video Loaded message received from TiVideoActivity");
						}

						fireEvent("load", null);
						return true;
					}
					case CONTROL_MSG_COMPLETE : {
						if (DBG) {
							Log.i(LCAT, "Video playback message received from TiVideoActivity");
						}
						fireEvent("complete", null);
						return true;
					}
				}
				return false;
			}
		});
	}
}


text:
package com.github.twitch4j.pubsub.domain;

import lombok.Data;

@Data
public class CheerbombData {
    private String userID;
    private String displayName;
    private String userLogin;
    private Integer selectedCount;
    private String triggerType;
    private Integer triggerAmount;
    private Integer totalRewardCount;
    private String domain;
}


text:
Welcome to lazy-object-proxy's documentation!
======================================

Contents:

.. toctree::
   :maxdepth: 2

   readme
   installation
   usage
   reference/index
   contributing
   authors
   changelog

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
<?php

require_once(dirname(__FILE__).'/../lib/BaseSfMenuItemComponents.class.php');

/**
 * sfDoctrineMenuItem components.
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Gregory Schurgast <michkinn@gmail.com>
 * @author     Gordon Franke <info@nevalon.de>
 * @version    SVN: $Id: sfDoctrineMenuItemComponents.class.php 7745 2008-03-05 11:05:33Z michkinn $
 */

class sfMenuItemComponents extends BaseSfMenuItemComponents
{
}


text:
@interface WeViewFlowLayout ()

@property (nonatomic) BOOL rightToLeft;

@end

#pragma mark -

@implementation WeViewFlowLayout

+ (WeViewFlowLayout *)flowLayout
{
    WeViewFlowLayout *layout = [[WeViewFlowLayout alloc] init];
    return layout;
}

- (CGSize)minSizeOfContentsView:(UIView *)view
                       subviews:(NSArray *)subviews
                   thatFitsSize:(CGSize)guideSize
{
    if ([subviews count] < 1)
    {
        return [self insetSizeOfView:view];
    }

    guideSize = CGSizeMax(guideSize, CGSizeZero);
    BOOL debugMinSize = [self debugMinSize];
    int indent = 0;
    if (debugMinSize)
    {
        indent = [self viewHierarchyDistanceToWindow:view];
        NSLog(@"%@+ [%@ (%@) minSizeOfContentsView: %@] thatFitsSize: %@",
              [self indentPrefix:indent],
              [self class],
              view.debugName,
              [view class],
              NSStringFromCGSize(guideSize));
    }

    NSUInteger subviewCount = [subviews count];

    CGRect contentBounds = [self contentBoundsOfView:view
                                             forSize:guideSize];

    if (debugMinSize)
    {
        NSLog(@"%@ contentBounds: %@, guideSize: %@, insetSizeOfView: %@",
              [self indentPrefix:indent + 1],
              FormatCGRect(contentBounds),
              FormatCGSize(guideSize),
              FormatCGSize([self insetSizeOfView:view]));
    }

    BOOL hasNonEmptyGuideSize = (guideSize.width > 0) || (guideSize.height > 0);

    CGSize subviewDesiredSizes[subviewCount];
    [self findDesiredSizes:&(subviewDesiredSizes[0])
                ofSubviews:subviews
          subviewGuideSize:hasNonEmptyGuideSize ? contentBounds.size : CGSizeZero
            maxSubviewSize:contentBounds.size
                  cropSize:hasNonEmptyGuideSize];

    CGRect cellBounds[subviewCount];
    CGSize bodySize = [self arrangeCells:&(cellBounds[0])
                     subviewDesiredSizes:&(subviewDesiredSizes[0])
                                subviews:subviews
                                    view:view
                           contentBounds:contentBounds
                        findBodySizeOnly:YES];

    CGSize result = CGSizeAdd([self insetSizeOfView:view],
                              bodySize);

    if (debugMinSize)
    {
        NSLog(@"%@ result: %@",
              [self indentPrefix:indent + 1],
              NSStringFromCGSize(result));
    }

    return result;
}

- (void)findDesiredSizes:(CGSize *)subviewDesiredSizes
              ofSubviews:(NSArray *)subviews
        subviewGuideSize:(CGSize)subviewGuideSize
          maxSubviewSize:(CGSize)maxSubviewSize
                cropSize:(BOOL)cropSize
{
    NSUInteger subviewCount = [subviews count];
    BOOL cropSubviewOverflow = [self cropSubviewOverflow];
    for (int i=0; i < subviewCount; i++)
    {
        UIView* subview = subviews[i];
        CGSize subviewSize = [self desiredItemSize:subview
                                           maxSize:subviewGuideSize];

        if (cropSubviewOverflow && cropSize)
        {
            subviewSize = CGSizeMin(subviewSize, maxSubviewSize);
        }
        subviewDesiredSizes[i] = subviewSize;
    }
}

- (CGSize)arrangeCells:(CGRect *)cellBounds
   subviewDesiredSizes:(CGSize *)subviewDesiredSizes
              subviews:(NSArray *)subviews
                  view:(UIView *)view
         contentBounds:(CGRect)contentBounds
      findBodySizeOnly:(BOOL)findBodySizeOnly
{
    NSUInteger subviewCount = [subviews count];

    // Simulate layout process.
    // xOffset is the x value for left-to-right layouts and the inverse
    // (the distance from the right edge) for right-to-left layouts.
    int xOffset = 0;
    int y = 0;
    int rowWidth = 0, rowHeight = 0;
    int itemsInRow = 0;
    int totalBodyWidth = 0;
    int row = 0;
    int cellRows[subviewCount];
    int hSpacing = ceilf(self.hSpacing);
    int vSpacing = ceilf(self.vSpacing);
    UIView *lastSubview = nil;
    for (int i=0; i < subviewCount; i++)
    {
        UIView *subview = subviews[i];
        if (lastSubview)
        {
            xOffset += (self.rightToLeft
                        ? subview.rightSpacingAdjustment
                        : subview.leftSpacingAdjustment);
        }

        int proposedRowWidth = xOffset + subviewDesiredSizes[i].width;
        if (itemsInRow > 0 &&
            proposedRowWidth > contentBounds.size.width)
        {
            // Overflow; start new row.
            y += rowHeight + vSpacing;
            xOffset = 0;
            itemsInRow = 0;
            rowWidth = 0;
            rowHeight = 0;
            lastSubview = nil;
            row++;
        }

        CGRect cell = CGRectZero;
        // For right-to-left layouts, reverse the direction of the x-offset.
        // The "row" will not end up aligned against the origin, but that will be
        // corrected below.
        cell.origin.x = (self.rightToLeft
                         ? -(xOffset + subviewDesiredSizes[i].width)
                         : +xOffset);
        cell.origin.y = y;
        cell.size = subviewDesiredSizes[i];
        cellBounds[i] = cell;
        cellRows[i] = row;

        rowWidth = xOffset + subviewDesiredSizes[i].width;
        rowHeight = MAX(rowHeight, subviewDesiredSizes[i].height);
        xOffset += subviewDesiredSizes[i].width + hSpacing;
        xOffset += (self.rightToLeft
                    ? subview.leftSpacingAdjustment
                    : subview.rightSpacingAdjustment);

        itemsInRow++;
        totalBodyWidth = MAX(totalBodyWidth, rowWidth);
        lastSubview = subview;
    }
    int totalBodyHeight = y + rowHeight;

    if (findBodySizeOnly)
    {
        return CGSizeMake(totalBodyWidth, totalBodyHeight);
    }

    const int rowCount = row + 1;

    int extraVSpace = MAX(0, contentBounds.size.height - totalBodyHeight);
    int vAdjustment = 0;
    {
        // Align rows vertically.
        switch (self.vAlign)
        {
            case V_ALIGN_TOP:
                vAdjustment = 0;
                break;
            case V_ALIGN_CENTER:
                vAdjustment = roundf(extraVSpace / 2);
                break;
            case V_ALIGN_BOTTOM:
                vAdjustment = extraVSpace;
                break;
            default:
                WeViewAssert(0);
                break;
        }
    }

    int left = contentBounds.origin.x;
    int top = contentBounds.origin.y;

    for (row=0; row < rowCount; row++)
    {
        int firstCellInRow = (int) subviewCount;
        int lastCellInRow = -1;

        // Find cells in row.
        for (int i=0; i < subviewCount; i++)
        {
            if (cellRows[i] == row)
            {
                firstCellInRow = MIN(firstCellInRow, i);
                lastCellInRow = MAX(lastCellInRow, i);
            }
        }

        WeViewAssert(firstCellInRow < subviewCount);
        WeViewAssert(lastCellInRow >= 0);
        WeViewAssert(firstCellInRow <= lastCellInRow);

        CGFloat rowHeight = 0;
        CGFloat rowMinX = 0;
        for (int i=firstCellInRow; i <= lastCellInRow; i++)
        {
            rowHeight = MAX(rowHeight, cellBounds[i].size.height);
            rowMinX = MIN(rowMinX, cellBounds[i].origin.x);
        }
        // Left-align the contents of each row so that the left-most subview in the row has x=0.
        // This won't be necessary for left-to-right layouts but is essential for right-to-left.
        for (int i=firstCellInRow; i <= lastCellInRow; i++)
        {
            CGRect cell = cellBounds[i];
            cell.origin.x -= rowMinX;
            cellBounds[i] = cell;
        }

        int rowWidth = (self.rightToLeft
                        ? (cellBounds[firstCellInRow].origin.x + cellBounds[firstCellInRow].size.width)
                        : (cellBounds[lastCellInRow].origin.x + cellBounds[lastCellInRow].size.width));
        // rowWidth might be wider than contentBounds.size.width in the overflow case.
        int extraRowSpace = contentBounds.size.width - rowWidth;
        int hAdjustment = 0;
        {
            // Align row horizontally.
            switch (self.hAlign)
            {
                case H_ALIGN_LEFT:
                    hAdjustment = 0;
                    break;
                case H_ALIGN_CENTER:
                    hAdjustment = roundf(extraRowSpace / 2);
                    break;
                case H_ALIGN_RIGHT:
                    hAdjustment = extraRowSpace;
                    break;
                default:
                    WeViewAssert(0);
                    break;
            }
        }

        for (int i=firstCellInRow; i <= lastCellInRow; i++)
        {
            CGRect cell = cellBounds[i];
            // All cells in row should have height of row.
            cell.size.height = rowHeight;
            // Apply alignment adjustments.
            cell.origin.x += left + hAdjustment;
            cell.origin.y += top + vAdjustment;
            cellBounds[i] = cell;
        }
    }

    return CGSizeMake(totalBodyWidth, totalBodyHeight);
}

- (void)layoutContentsOfView:(UIView *)view
                    subviews:(NSArray *)subviews
{
    if ([subviews count] < 1)
    {
        return;
    }

    BOOL debugLayout = [self debugLayout];
    int indent = 0;
    CGSize guideSize = view.size;
    guideSize = CGSizeMax(guideSize, CGSizeZero);
    if (debugLayout)
    {
        indent = [self viewHierarchyDistanceToWindow:view];
        NSLog(@"%@+ [%@ (%@) layoutContentsOfView: %@] : %@",
              [self indentPrefix:indent],
              [self class],
              view.debugName,
              [view class],
              NSStringFromCGSize(guideSize));
    }

    NSUInteger subviewCount = [subviews count];

    CGRect contentBounds = [self contentBoundsOfView:view
                                             forSize:guideSize];

    if (debugLayout)
    {
        NSLog(@"%@ contentBounds: %@, guideSize: %@, insetSizeOfView: %@",
              [self indentPrefix:indent + 1],
              FormatCGRect(contentBounds),
              FormatCGSize(guideSize),
              FormatCGSize([self insetSizeOfView:view]));
    }

    CGSize subviewDesiredSizes[subviewCount];
    [self findDesiredSizes:&(subviewDesiredSizes[0])
                ofSubviews:subviews
          subviewGuideSize:contentBounds.size
            maxSubviewSize:contentBounds.size
                  cropSize:YES];

    CGRect cellBounds[subviewCount];
    [self arrangeCells:&(cellBounds[0])
   subviewDesiredSizes:&(subviewDesiredSizes[0])
              subviews:subviews
                  view:view
         contentBounds:contentBounds
      findBodySizeOnly:NO];

    // Calculate and apply the subviews' frames.
    CellPositioningMode cellPositioning = [self cellPositioning];
    for (int i=0; i < subviewCount; i++)
    {
        UIView* subview = subviews[i];

        [self positionSubview:subview
                  inSuperview:view
                     withSize:subviewDesiredSizes[i]
                 inCellBounds:cellBounds[i]
              cellPositioning:cellPositioning];

        if (debugLayout)
        {
            NSLog(@"%@ - final layout[%d] %@: %@, cellBounds: %@, subviewSize: %@",
                  [self indentPrefix:indent + 2],
                  i,
                  [subview class],
                  FormatCGRect(subview.frame),
                  FormatCGRect(cellBounds[i]),
                  FormatCGSize(subviewDesiredSizes[i]));
        }
    }
}

- (WeViewFlowLayout *)setIsRightToLeft {
    return [self setIsRightToLeft:YES];
}

- (WeViewFlowLayout *)setIsRightToLeft:(BOOL)value {
    self.rightToLeft = value;

    [self propertyChanged];

    return self;
}

@end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

	<title>Network Web Sockets Test Console</title>

Network Web Sockets Test Console

Connection Status: - Idle

			Service Name:
			<input id="name" type="text" size="80" value="adhocservice">
			<input type=button id="connectBtn" value="Connect" onclick="connect()">
			<input type=button id="disconnectBtn" value="Disconnect" disabled="disabled" onclick="disconnect()">

			Peer Count: -

			Message Contents:

			<textarea id="text" type="text" rows="4" cols="80" disabled="disabled"></textarea>

Broadcast Messaging

			<input type="radio" name="messageTarget" value="*" checked>
			Broadcast to all connected peers

Direct Messaging

			Not available. No peers connected

			<input type=button id="messageBtn" value="Send Message" disabled="disabled" onclick="send()">

Log:


text:
BSLS_IDENT_RCSID(bbldc_daycountconvention_cpp,"$Id$ $CSID$")

#include <bslim_printer.h>

#include <bslmf_assert.h>

#include <bsl_ostream.h>

namespace BloombergLP {

BSLMF_ASSERT(bbldc::DayCountConvention::e_ACTUAL_360
           < bbldc::DayCountConvention::e_PERIOD_ICMA_ACTUAL_ACTUAL);

namespace bbldc {

                        // -------------------------
                        // struct DayCountConvention
                        // -------------------------

// CLASS METHODS
bsl::ostream& DayCountConvention::print(
                                       bsl::ostream&            stream,
                                       DayCountConvention::Enum value,
                                       int                      level,
                                       int                      spacesPerLevel)
{
    bslim::Printer printer(&stream, level, spacesPerLevel);
    printer.start(true);  // 'true' -> suppress '['
    stream << toAscii(value);
    printer.end(true);    // 'true' -> suppress ']'

    return stream;
}

const char *DayCountConvention::toAscii(Enum convention)
{
#define CASE(X) case(e_ ## X): return #X

    switch (convention) {
      CASE(ACTUAL_360);                                               // RETURN
      CASE(ACTUAL_365_FIXED);                                         // RETURN
      CASE(ISDA_ACTUAL_ACTUAL);                                       // RETURN
      CASE(ISMA_30_360);                                              // RETURN
      CASE(PSA_30_360_EOM);                                           // RETURN
      CASE(SIA_30_360_EOM);                                           // RETURN
      CASE(SIA_30_360_NEOM);                                          // RETURN
      CASE(PERIOD_ICMA_ACTUAL_ACTUAL);                                // RETURN
      default: {
        return "(* Unknown Enumerator *)";                            // RETURN
      } break;
    }

#undef CASE
}

}  // close package namespace
}  // close enterprise namespace

// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------


text:
// Copyright (c) 2010-2013 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if DIRECTX11_1
using System;
using System.Collections.Generic;
using System.Text;

namespace SharpDX.Direct2D1
{
    public partial class ResourceTexture
    {
        /// <summary>
        /// Initializes a new instance of <see cref="BlendTransform"/> class
        /// </summary>
        /// <param name="context">The effect context</param>
        /// <param name="resourceId">A unique identifier to the resource</param>
        /// <param name="resourceTextureProperties">The description of the resource</param>
        /// <unmanaged>HRESULT ID2D1EffectContext::CreateResourceTexture([In, Optional] const GUID* resourceId,[In] const D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties,[In, Buffer, Optional] const unsigned char* data,[In, Buffer, Optional] const unsigned int* strides,[In] unsigned int dataSize,[Out] ID2D1ResourceTexture** resourceTexture)</unmanaged>
        public ResourceTexture(EffectContext context, System.Guid resourceId, SharpDX.Direct2D1.ResourceTextureProperties resourceTextureProperties) : base(IntPtr.Zero)
        {
            CreateResourceTexture(context, resourceId, resourceTextureProperties, null, null, this);
        }

        /// <summary>
        /// Initializes a new instance of <see cref="BlendTransform"/> class
        /// </summary>
        /// <param name="context">The effect context</param>
        /// <param name="resourceId">A unique identifier to the resource</param>
        /// <param name="resourceTextureProperties">The description of the resource</param>
        /// <unmanaged>HRESULT ID2D1EffectContext::CreateResourceTexture([In, Optional] const GUID* resourceId,[In] const D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties,[In, Buffer, Optional] const unsigned char* data,[In, Buffer, Optional] const unsigned int* strides,[In] unsigned int dataSize,[Out] ID2D1ResourceTexture** resourceTexture)</unmanaged>
        public ResourceTexture(EffectContext context, System.Guid resourceId, SharpDX.Direct2D1.ResourceTextureProperties resourceTextureProperties, byte[] data, int[] strides)
            : base(IntPtr.Zero)
        {
            CreateResourceTexture(context, resourceId, resourceTextureProperties, data, strides, this);
        }

        private unsafe static void CreateResourceTexture(EffectContext context, System.Guid resourceId, SharpDX.Direct2D1.ResourceTextureProperties resourceTextureProperties, byte[] data, int[] strides, ResourceTexture outTexture)
        {
            var resourceTexturePropertiesNative = new ResourceTextureProperties.__Native();
            resourceTextureProperties.__MarshalTo(ref resourceTexturePropertiesNative);

            if (resourceTextureProperties.Extents == null || resourceTextureProperties.Extents.Length != resourceTextureProperties.Dimensions)
                throw new ArgumentException("Extents array must be same size than dimensions", "resourceTextureProperties");

            if (resourceTextureProperties.ExtendModes == null || resourceTextureProperties.ExtendModes.Length != resourceTextureProperties.Dimensions)
                throw new ArgumentException("ExtendModes array must be same size than dimensions", "resourceTextureProperties");

            fixed (void* pExtents = resourceTextureProperties.Extents) {
                fixed (void* pExtendModes = resourceTextureProperties.ExtendModes) {
                    resourceTexturePropertiesNative.ExtentsPointer = (IntPtr)pExtents;
                    resourceTexturePropertiesNative.ExtendModesPointer = (IntPtr)pExtendModes;
                    context.CreateResourceTexture(resourceId, new IntPtr(&resourceTexturePropertiesNative), data, strides, data == null ? 0 : data.Length, outTexture);
                }
            }
        }
    }
}
#endif


text:
module FullCloneSelf
  def full_clone(_progress=nil)
    self
  end
end

# Numeric supports full clone.
class Numeric
  include FullCloneSelf
end

# NilClass supports full clone.
class NilClass
  include FullCloneSelf
end

# TrueClass supports full clone.
class TrueClass
  include FullCloneSelf
end

# FalseClass supports full clone.
class FalseClass
  include FullCloneSelf
end

# Symbols support full clone.
class Symbol
  include FullCloneSelf
end

# Regular expressions support full clone.
class Regexp
  include FullCloneSelf
end

# Threads support full clone.
class Thread
  include FullCloneSelf
end


text:
var util = require('../util');

function JsonBuilder() { }

JsonBuilder.prototype.build = function(value, shape) {
  return JSON.stringify(translate(value, shape));
};

function translate(value, shape) {
  if (!shape || value === undefined || value === null) return undefined;

  switch (shape.type) {
    case 'structure': return translateStructure(value, shape);
    case 'map': return translateMap(value, shape);
    case 'list': return translateList(value, shape);
    default: return translateScalar(value, shape);
  }
}

function translateStructure(structure, shape) {
  var struct = {};
  util.each(structure, function(name, value) {
    var memberShape = shape.members[name];
    if (memberShape) {
      if (memberShape.location !== 'body') return;
      var locationName = memberShape.isLocationName ? memberShape.name : name;
      var result = translate(value, memberShape);
      if (result !== undefined) struct[locationName] = result;
    }
  });
  return struct;
}

function translateList(list, shape) {
  var out = [];
  util.arrayEach(list, function(value) {
    var result = translate(value, shape.member);
    if (result !== undefined) out.push(result);
  });
  return out;
}

function translateMap(map, shape) {
  var out = {};
  util.each(map, function(key, value) {
    var result = translate(value, shape.value);
    if (result !== undefined) out[key] = result;
  });
  return out;
}

function translateScalar(value, shape) {
  return shape.toWireFormat(value);
}

module.exports = JsonBuilder;


text:
from test import helper
from unittest import TestCase

import pytest

from marrow.package.canonical import name

xfail_qualname = pytest.mark.xfail(
		not hasattr(helper.Example, '__qualname__'),
		raises = LookupError,
		reason = "Requires __qualname__ support introduced in Python 3.3."
	)

class TestResolver(TestCase):
	"""This test suite identifies the capabilities of your interpreter.

	If a test is skipped/xfails a reason will be given outlining the implication for your own applications.
	"""

	@xfail_qualname
	def test__resolve__of_a_closure(self):
		def closure():
			pass

		assert name(closure) == 'test.test_canonical:TestResolver.test__resolve__of_a_closure.<locals>.closure'

	def test__resolve__of_a_module_level_class(self):
		assert name(helper.Example) == 'test.helper:Example'

	def test__resolve__of_a_module_level_class_classmethod(self):
		assert name(helper.Example.classmethod) == 'test.helper:Example.classmethod'

	def test__resolve__of_a_module_level_class_instance(self):
		assert name(helper.instance) == 'test.helper:Example'

	def test__resolve__of_a_module_level_class_method(self):
		assert name(helper.Example.instance) == 'test.helper:Example.instance'

	def test__resolve__of_a_module_level_class_staticmethod(self):
		assert name(helper.Example.staticmethod) == 'test.helper:Example.staticmethod'

	def test__resolve__of_a_module_level_function(self):
		assert name(helper.bare) == 'test.helper:bare'

	def test__resolve__of_a_module_level_instance_classmethod(self):
		assert name(helper.instance.classmethod) == 'test.helper:Example.classmethod'

	def test__resolve__of_a_module_level_instance_method(self):
		assert name(helper.instance.instance) == 'test.helper:Example.instance'

	def test__resolve__of_a_module_level_instance_staticmethod(self):
		assert name(helper.instance.staticmethod) == 'test.helper:Example.staticmethod'

	@xfail_qualname
	def test__resolve__of_a_nested_class_deep(self):
		assert name(helper.Example.Pandora.Box) == 'test.helper:Example.Pandora.Box'

	@xfail_qualname
	def test__resolve__of_a_nested_class_deep_method(self):
		assert name(helper.Example.Pandora.Box.nested) == 'test.helper:Example.Pandora.Box.nested'

	def test__resolve__of_a_nested_class_shallow(self):
		assert name(helper.Example.Pandora) == 'test.helper:Example.Pandora'

	def test__resolve__of_a_module_level_decorated_function(self):
		assert name(helper.decorated_shallow) == 'test.helper:decorated_shallow'

	def test__resolve__of_a_module_level_decorated_decorated_function(self):
		assert name(helper.decorated_deep) == 'test.helper:decorated_deep'

	def test__resolve__of_a_module_level_decorated_method(self):
		assert name(helper.Example.decorated_shallow) == 'test.helper:Example.decorated_shallow'

	def test__resolve__of_a_module_level_decorated_decorated_method(self):
		assert name(helper.Example.decorated_deep) == 'test.helper:Example.decorated_deep'


text:
/*
 * File:   Current.h
 * Author: Rick
 *
 * Created on March 27, 2015, 3:06 AM
 */

#ifndef CURRENT_H
#define	CURRENT_H

#define NUMFALTS 6

extern float Current_Get();
void Current_Convert();
void Current_Filter();
void Current_Read();
extern char Current_Fault();

#endif	/* CURRENT_H */