text:
package com.github.robozonky.internal.remote;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;

import java.util.List;
import java.util.function.Function;
import java.util.function.LongConsumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import com.github.robozonky.internal.util.stream.PageSource;

@ExtendWith(MockitoExtension.class)
class EntityCollectionPageSourceTest {

    private static final Select SELECT = new Select();
    private static final Function<Object, List<Integer>> FUNCTION = o -> IntStream.range(0, 1000)
        .boxed()
        .collect(Collectors.toList());
    private static final int PAGE_SIZE = 100;

    @Mock
    private PaginatedApi<Integer, Object> api;

    @Test
    void firstPage() {
        final List<Integer> allResults = FUNCTION.apply(null);
        final List<Integer> subpage = allResults.subList(0, PAGE_SIZE);
        when(api.execute(eq(FUNCTION), eq(SELECT), eq(0), eq(PAGE_SIZE)))
            .thenReturn(new PaginatedResult<>(subpage, allResults.size()));
        final PageSource<Integer> source = new EntityCollectionPageSource<>(api, FUNCTION, SELECT, PAGE_SIZE);
        final LongConsumer consumer = mock(LongConsumer.class);
        final List<Integer> result = source.fetch(0, 1, consumer);
        assertThat(result).containsExactly(subpage.toArray(new Integer[PAGE_SIZE]));
        verify(consumer).accept(eq((long) allResults.size()));
    }

    @Test
    void negativePageWorksAsFirstPage() {
        final List<Integer> allResults = FUNCTION.apply(null);
        final List<Integer> subpage = allResults.subList(0, PAGE_SIZE);
        when(api.execute(eq(FUNCTION), eq(SELECT), eq(0), eq(PAGE_SIZE)))
            .thenReturn(new PaginatedResult<>(subpage, allResults.size()));
        final PageSource<Integer> source = new EntityCollectionPageSource<>(api, FUNCTION, SELECT, PAGE_SIZE);
        final LongConsumer consumer = mock(LongConsumer.class);
        final List<Integer> result = source.fetch(-1, 1, consumer);
        assertThat(result).containsExactly(subpage.toArray(new Integer[PAGE_SIZE]));
        verify(consumer).accept(eq((long) allResults.size()));
    }

    @Test
    void secondPage() {
        final List<Integer> allResults = FUNCTION.apply(null);
        final List<Integer> subpage = allResults.subList(PAGE_SIZE, 2 * PAGE_SIZE);
        when(api.execute(eq(FUNCTION), eq(SELECT), eq(1), eq(PAGE_SIZE)))
            .thenReturn(new PaginatedResult<>(subpage, allResults.size()));
        final PageSource<Integer> source = new EntityCollectionPageSource<>(api, FUNCTION, SELECT, PAGE_SIZE);
        final LongConsumer consumer = mock(LongConsumer.class);
        final List<Integer> result = source.fetch(PAGE_SIZE, 1, consumer);
        assertThat(result).containsExactly(subpage.toArray(new Integer[PAGE_SIZE]));
        verify(consumer).accept(eq((long) allResults.size()));
    }
}


text:
#include "ScriptSystem.h"

#include <yave/ecs/EntityWorld.h>
#include <yave/components/TransformableComponent.h>

#include <y/utils/log.h>
#include <y/utils/format.h>

namespace yave {

ScriptSystem::ScriptSystem() : ecs::System("ScriptSystem") {
    _state.open_libraries();

    script::bind_math_types(_state);
    script::bind_ecs_types(_state);

    script::bind_component_type<TransformableComponent>(_state);
}

void ScriptSystem::update(ecs::EntityWorld& world, float dt) {
    ScriptWorldComponent* scripts_comp = world.get_or_add_world_component<ScriptWorldComponent>();

    _state["world"] = &world;

    for(auto& one_shot : scripts_comp->one_shot()) {
        if(!one_shot.done) {
            one_shot.done = true;
            try {
                _state.safe_script(one_shot.code);
            } catch(std::exception& e) {
                log_msg(fmt("Lua error in one shot: %", e.what()), Log::Error);
            }
        }
    }

    for(auto& script : scripts_comp->scripts()) {
        y_profile_dyn_zone(script.name.data());
        try {
            _state.safe_script(script.code);
        } catch(std::exception& e) {
            log_msg(fmt("Lua error in %: %", script.name, e.what()), Log::Error);
        }
    }
}

}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {
  Component
} from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  DrawerLayoutAndroid,
  ActivityIndicator,
  Modal
} from 'react-native';

//实现了Android 的DrawerLayout效果,

class RN_Day07 extends Component {
  constructor(props) {
    super(props);

    this.state = {
      animating: true,
    };

    this.openDrawer = this.openDrawer.bind(this);
  }

  setToggleTimeOut() {
    // var laoding = !this.state.animating;
    // var self = this;
    // setTimeout(function() {
    //   self.setState({
    //     animating: laoding,
    //   });
    //   self.setToggleTimeOut();
    // }, 1900);

    /**上面是之前的写法,下面是ES6最新写法,我感觉这个是retrolambda语法*/
    setTimeout(() => {
      // prepend 10 items
      //此处还不会更新
      this.setState({
        animating: !this.state.animating,
      });
      //this.setToggleTimeOut();
    }, 2000);
  }

  /**在第一次渲染后调用,只在客户端。之后组件已经生成了对应的DOM结构,可以通过this.getDOMNode()来进行访问。 如果你想和其他JavaScript框架一起使用,可以在这个方法中调用setTimeout, setInterval或者发送AJAX请求等操作(防止异部操作阻塞UI)。*/
  componentDidMount() {
    this.setToggleTimeOut();
  }

  openDrawer() {
    this.drawer.openDrawer();
  }

  render() {
    const navigationView = (
      <View style={{flex: 1, backgroundColor:'#FAFAFA'}}>
        <Text style={{marginTop: 10,marginLeft:20,fontSize: 15, textAlign:'left'}}>消息</Text>
        <Text style={{marginTop: 10,marginLeft:20,fontSize: 15, textAlign:'left'}}>设置</Text>
      </View>
    );

    const indicator = (
      <ActivityIndicator
          animating = {this.state.animating}
          style = {[styles.centering]}
          size = {'large'}
      />
    );

    const drawerLayout = (
      <DrawerLayoutAndroid
          ref={component => this.drawer = component}
          drawerWidth = {300}
          renderNavigationView ={()=>navigationView}
          drawerPostion = {DrawerLayoutAndroid.positions.Left} >
          <View style={{flex: 1, alignItems: 'center'}}>
            <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>Hello</Text>
            <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text>
          </View>
      </DrawerLayoutAndroid>
    );

    return (
      <View style={styles.container}>

       {
        /**初始化的时候用来做加载的View*/
        this.state.animating?indicator:null
       }
      {this.state.animating?null:drawerLayout}

      </View>
    );
  }
}

const styles = StyleSheet.create({
  centering: {
    justifyContent: 'center',
    padding: 8,

    alignItems: 'center',
    height: 80,
  },
  container: {
    flex: 1,
    justifyContent: 'center',
    backgroundColor: '#F5FCFF',
    // alignItems: 'center',android中当使用DrawerLayoutAndroid 组件时添加了alignItems : 'center' 样式后会出现一个异常
    //folly::toJson: JSON object value was a Nan or INF 详情见https://github.com/skv-headless/react-native-scrollable-tab-view/issues/115
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('RN_Day07', () => RN_Day07);


text:
package com.sun.jini.test.spec.javaspace.conformance;

import java.util.logging.Level;

// net.jini
import net.jini.core.lease.Lease;
import net.jini.core.transaction.Transaction;
import net.jini.core.event.EventRegistration;

// com.sun.jini
import com.sun.jini.qa.harness.TestException;
import com.sun.jini.qa.harness.QAConfig;

/**
 * TransactionNotifyLeaseANYTest asserts, that for notify with
 * Lease.ANY lease time within the non null transaction:
 * 1) A notify request's matching is done as it is for read
 * 2) Writing an entry into a space might generate notifications
 *    to registered objects.
 * 3) When matching entries arrive, the specified RemoteEventListener will
 *    eventually be notified by invoking listener's notify method.
 *
 *
 */
public class TransactionNotifyLeaseANYTest extends AbstractTestBase {

    /**
     * Sets up the testing environment.
     *
     * @param config QAConfig from the runner for setup.
     */
    public void setup(QAConfig config) throws Exception {

        // mandatory call to parent
        super.setup(config);

        // get an instance of Transaction Manager
        mgr = getTxnManager();
    }

    /**
     * This method asserts, that for notify with Lease.ANY
     * lease time within the non null transaction:
     * 1) A notify request's matching is done as it is for read
     * 2) Writing an entry into a space might generate notifications
     *    to registered objects.
     * 3) When matching entries arrive, the specified RemoteEventListener will
     *    eventually be notified by invoking listener's notify method.
     *
     *
Notes:
For more information see the JavaSpaces specification
     * section 2.7.

     */
    public void run() throws Exception {
        NotifyCounter[] ncs = new NotifyCounter[12];
        EventRegistration[] ers = new EventRegistration[12];
        boolean[] failMatrix = new boolean[12];
        boolean failed = false;
        long[] evMatrix = new long[] {
            3, 3, 3, 0, 0, 0, 0, 0, 9, 6, 6, 9 };
        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        SimpleEntry sampleEntry3 = new SimpleEntry("TestEntry #1", 2);
        SimpleEntry template;
        Transaction txn;
        int i;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
                    "Space is not empty in the beginning.");
        }

        // create the non null transaction
        txn = getTransaction();

        // init 3 RemoteEvent counters for each of sample entries
        ncs[0] = new NotifyCounter(sampleEntry1, Lease.ANY);
        ncs[1] = new NotifyCounter(sampleEntry2, Lease.ANY);
        ncs[2] = new NotifyCounter(sampleEntry3, Lease.ANY);

        // init 5 counters with wrong templates
        template = new SimpleEntry("TestEntry #3", 1);
        ncs[3] = new NotifyCounter(template, Lease.ANY);

        // 2-nd wrong template
        template = new SimpleEntry("TestEntry #1", 3);
        ncs[4] = new NotifyCounter(template, Lease.ANY);

        // 3-rd wrong template
        template = new SimpleEntry("TestEntry #3", 3);
        ncs[5] = new NotifyCounter(template, Lease.ANY);

        // 4-th wrong template
        template = new SimpleEntry(null, 3);
        ncs[6] = new NotifyCounter(template, Lease.ANY);

        // 5-th wrong template
        template = new SimpleEntry("TestEntry #3", null);
        ncs[7] = new NotifyCounter(template, Lease.ANY);

        // init counter with null entry as a template
        ncs[8] = new NotifyCounter(null, Lease.ANY);

        // init 3 counters with null values for different fields
        template = new SimpleEntry("TestEntry #1", null);
        ncs[9] = new NotifyCounter(template, Lease.ANY);

        // 2-nd template
        template = new SimpleEntry(null, 2);
        ncs[10] = new NotifyCounter(template, Lease.ANY);

        // 3-rd template
        template = new SimpleEntry(null, null);
        ncs[11] = new NotifyCounter(template, Lease.ANY);

        // now register all counters
        for (i = 0; i < 12; i++) {
            ers[i] = space.notify(ncs[i].getTemplate(), txn, ncs[i],
                    ncs[i].getLeaseTime(), null);
	    ers[i] = prepareRegistration(ers[i]);
        }

        // sleep for a while to let all listeners register properly
        Thread.sleep(timeout1);
        logDebugText("now sleeping for " + timeout1
                + " to let all listeners register properly.");

        /*
         * write 3 sample entries to the space 3 times
         * within the transaction
         */
        space.write(sampleEntry1, txn, leaseForeverTime);
        space.write(sampleEntry1, txn, leaseForeverTime);
        space.write(sampleEntry1, txn, leaseForeverTime);
        space.write(sampleEntry2, txn, leaseForeverTime);
        space.write(sampleEntry2, txn, leaseForeverTime);
        space.write(sampleEntry2, txn, leaseForeverTime);
        space.write(sampleEntry3, txn, leaseForeverTime);
        space.write(sampleEntry3, txn, leaseForeverTime);
        space.write(sampleEntry3, txn, leaseForeverTime);
        logDebugText("3 sample entries have been written"
                + " to the space 3 times.");

        // wait for a while to let all listeners get notifications
        logDebugText("now sleeping for " + timeout1
                + " to let all listeners get notifications.");
        Thread.sleep(timeout1);

        // check, that listeners got required number of notifications
        for (i = 0; i < 12; i++) {
            if (ncs[i].getEventsNum(ers[i]) != evMatrix[i]) {
                failed = true;
                failMatrix[i] = true;
            } else {
                failMatrix[i] = false;
            }
        }

        for (i = 0; i < 12; i++) {
            if (failMatrix[i]) {
                logDebugText("FAILED: " + ncs[i] + " has got "
                        + ncs[i].getEventsNum(ers[i])
                        + " notifications instead of " + evMatrix[i]
                        + " required.");
            } else {
                logDebugText(ncs[i].toString() + " has got "
                        + ncs[i].getEventsNum(ers[i])
                        + " notifications as expected");
            }
        }

        // commit the transaction
        txnCommit(txn);

        // check: we fail of pass
        if (failed) {
            throw new TestException(
                    "Not all listeners've got expected number of events.");
        }
    }
}


text:
package com.google.enterprise.connector.dctm.dctmdfcwrap;

import com.google.enterprise.connector.dctm.dfcwrap.IAttr;
import com.google.enterprise.connector.dctm.dfcwrap.IType;
import com.google.enterprise.connector.spi.RepositoryException;

import com.documentum.fc.client.IDfType;
import com.documentum.fc.common.DfException;

public class DmType implements IType {
  private final IDfType idfType;

  public DmType(IDfType idfType) {
    this.idfType = idfType;
  }

  @Override
  public int getTypeAttrCount() throws RepositoryException {
    try {
      return idfType.getTypeAttrCount();
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }

  @Override
  public IType getSuperType() throws RepositoryException {
    IDfType idfSuperType;
    try {
      idfSuperType = idfType.getSuperType();
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
    return (idfSuperType == null) ? null : new DmType(idfSuperType);
  }

  @Override
  public boolean isSubTypeOf(String type) throws RepositoryException {
    try {
      return idfType.isSubTypeOf(type);
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }

  @Override
  public String getName() throws RepositoryException {
    try {
      return idfType.getName();
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }

  @Override
  public IAttr getTypeAttr(int attrIndex) throws RepositoryException {
    try {
      return new DmAttr(idfType.getTypeAttr(attrIndex));
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }

  @Override
  public String getTypeAttrNameAt(int attrIndex) throws RepositoryException {
    try {
      return idfType.getTypeAttrNameAt(attrIndex);
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }

  @Override
  public String getDescription() throws RepositoryException {
    try {
      return idfType.getDescription();
    } catch (DfException de) {
      throw new RepositoryException(de);
    }
  }
}


text:
/*
 * Written by Nitin Kumar Maharana
 * nitin.maharana@gmail.com
 */

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:
    TreeNode* invertTree(TreeNode* root) {
        if(root == nullptr)
            return root;

        TreeNode *temp;

        temp = root->left;
        root->left = invertTree(root->right);
        root->right = invertTree(temp);

        return root;
    }
};


text:
IP Address resource allows to assign an IP.

## Example Usage

Creating an IP address:
```
resource "solidserver_ip_address" "myFirstIPAddress" {
  space   = "${solidserver_ip_space.myFirstSpace.name}"
  subnet  = "${solidserver_ip_subnet.myFirstIPSubnet.name}"
  name    = "myfirstipaddress"
  device  = "${solidserver_device.myFirstDevice.name}"
  class   = "AWS_VPC_ADDRESS"
  class_parameters = {
    interfaceid = "eni-d5b961d5"
  }
}
```

## Argument Reference

* `space` - (Required) The name of the space into which creating the IP address.
* `subnet` - (Required) The name of the subnet into which creating the IP address.
* `pool` - (Optional) The name of the pool into which creating the IP address.
* `request_ip` - (Optional) An optional request for a specific IP address. If this address is unavailable the provisioning request will fail.
* `name` - (Required) The name of the IP address to create. If a FQDN is specified and SOLIDServer is configured to sync IPAM to DNS, this will create the appropriate DNS A Record.
* `device` - (Optional) Device Name to associate with the IP address (Require a 'Device Manager' license).
* `class` - (Optional) An optional object class name allowing to store and display custom meta-data.
* `class_parameters` - (Optional) An optional object class parameters allowing to store and display custom meta-data as key/value.

## Attribute Reference

* `id` - The id of the IP Address.
* `name` - The name of the IP Address.
* `address` - The IP Address itself.
* `space` - The parent IP Space of the IP Address.
* `subnet` - The parent IP Subnet of the IP Address.
* `pool` - The parent IP Pool of the IP Address (if any).
* `request_ip` - The requested IP Address (if any).
* `mac` - The MAC address of the IP Address.
* `device` - The Device Name associated with the IP address.
* `class` - The class name of the IP Address.
* `class_parameters` - The class parameters of the IP Address.


text:
title: get_mode
page_title: get_mode - RadEditor
description: Check our Web Forms article about get_mode.
slug: editor/client-side-programming/methods/get_mode
tags: get_mode
published: True
position: 7
---

# get_mode

Returns the editor's mode:

|  **function**  **get_mode()**  |  |  |
| ------ | ------ | ------ |
| **returned value: 1** | **integer** |represents Design mode|
| **returned value: 2** | **integer** |represents HTML mode|
| **returned value: 4** | **integer** |represents Preview mode|

The following example demonstrates how to check the current mode of Telerik RadEditor:

````ASP.NET
<script type="text/javascript">
	function OnClientLoad(editor, args)
	{
		editor.add_modeChange(function(sender, args)
		{
			var mode = sender.get_mode();
			switch (mode)
			{
				case 1:
					alert( "We are in Design mode");
					//do something
					break;
				case 2:
					alert( "We are in Html mode");
					//do something
					break;
				case 4:
					alert( "We are in Preview mode");
					//do something
					break;
			}
		});
	}
</script>
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1">
</telerik:radeditor>
````


text:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE IF NOT EXISTS `aggregate` (
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `aggregate_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `updated` datetime NOT NULL,
  `version` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`aggregate_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `event` (
  `sequence_number` int(11) NOT NULL AUTO_INCREMENT,
  `aggregate_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `aggregate_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `event_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `state_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `data` longtext COLLATE utf8_unicode_ci NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`sequence_number`),
  KEY `event_aggregate_id_type` (`aggregate_id`,`aggregate_type`),
  KEY `event_created` (`created`),
  KEY `event_state_hash` (`state_hash`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;

CREATE TABLE IF NOT EXISTS `snapshot` (
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `aggregate_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `data` longtext COLLATE utf8_unicode_ci,
  `version` int(11) NOT NULL,
  PRIMARY KEY (`aggregate_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `issue` (
  `issue_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `state` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `last_updated` datetime NOT NULL,
  `state_hash` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`issue_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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

from feedhq.utils import get_redis_connection
from rache import REDIS_KEY, job_key

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Deleting field 'UniqueFeed.hub'
        db.delete_column(u'feeds_uniquefeed', 'hub')

        # Deleting field 'UniqueFeed.last_loop'
        db.delete_column(u'feeds_uniquefeed', 'last_loop')

        # Deleting field 'UniqueFeed.backoff_factor'
        db.delete_column(u'feeds_uniquefeed', 'backoff_factor')

        # Deleting field 'UniqueFeed.link'
        db.delete_column(u'feeds_uniquefeed', 'link')

        # Deleting field 'UniqueFeed.etag'
        db.delete_column(u'feeds_uniquefeed', 'etag')

        # Deleting field 'UniqueFeed.subscribers'
        db.delete_column(u'feeds_uniquefeed', 'subscribers')

        # Deleting field 'UniqueFeed.title'
        db.delete_column(u'feeds_uniquefeed', 'title')

        # Deleting field 'UniqueFeed.modified'
        db.delete_column(u'feeds_uniquefeed', 'modified')

        # Deleting field 'UniqueFeed.last_update'
        db.delete_column(u'feeds_uniquefeed', 'last_update')

        redis = get_redis_connection()
        jobs = redis.zrange(REDIS_KEY, 0, -1)
        for job in jobs:
            redis.hdel(job_key(job.decode('utf-8')), 'request_timeout')

    def backwards(self, orm):
        # Adding field 'UniqueFeed.hub'
        db.add_column(u'feeds_uniquefeed', 'hub',
                      self.gf('feedhq.feeds.fields.URLField')(null=True, blank=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.last_loop'
        db.add_column(u'feeds_uniquefeed', 'last_loop',
                      self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.backoff_factor'
        db.add_column(u'feeds_uniquefeed', 'backoff_factor',
                      self.gf('django.db.models.fields.PositiveIntegerField')(default=1),
                      keep_default=False)

        # Adding field 'UniqueFeed.link'
        db.add_column(u'feeds_uniquefeed', 'link',
                      self.gf('feedhq.feeds.fields.URLField')(default='', blank=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.etag'
        db.add_column(u'feeds_uniquefeed', 'etag',
                      self.gf('django.db.models.fields.CharField')(max_length=1023, null=True, blank=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.subscribers'
        db.add_column(u'feeds_uniquefeed', 'subscribers',
                      self.gf('django.db.models.fields.PositiveIntegerField')(default=1, db_index=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.title'
        db.add_column(u'feeds_uniquefeed', 'title',
                      self.gf('django.db.models.fields.CharField')(default='', max_length=2048, blank=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.modified'
        db.add_column(u'feeds_uniquefeed', 'modified',
                      self.gf('django.db.models.fields.CharField')(max_length=1023, null=True, blank=True),
                      keep_default=False)

        # Adding field 'UniqueFeed.last_update'
        db.add_column(u'feeds_uniquefeed', 'last_update',
                      self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True),
                      keep_default=False)

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'feeds.category': {
            'Meta': {'ordering': "('order', 'name', 'id')", 'unique_together': "(('user', 'slug'), ('user', 'name'))", 'object_name': 'Category'},
            'color': ('django.db.models.fields.CharField', [], {'default': "'black'", 'max_length': '50'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '1023', 'db_index': 'True'}),
            'order': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'categories'", 'to': u"orm['profiles.User']"})
        },
        u'feeds.entry': {
            'Meta': {'ordering': "('-date', '-id')", 'object_name': 'Entry', 'index_together': "(('user', 'date'), ('user', 'read'), ('user', 'starred'), ('user', 'broadcast'))"},
            'author': ('django.db.models.fields.CharField', [], {'max_length': '1023', 'blank': 'True'}),
            'broadcast': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
            'feed': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'entries'", 'null': 'True', 'to': u"orm['feeds.Feed']"}),
            'guid': ('feedhq.feeds.fields.URLField', [], {'db_index': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'link': ('feedhq.feeds.fields.URLField', [], {'db_index': 'True'}),
            'read': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'read_later_url': ('feedhq.feeds.fields.URLField', [], {'blank': 'True'}),
            'starred': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'subtitle': ('django.db.models.fields.TextField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entries'", 'to': u"orm['profiles.User']"})
        },
        u'feeds.favicon': {
            'Meta': {'object_name': 'Favicon'},
            'favicon': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'url': ('feedhq.feeds.fields.URLField', [], {'unique': 'True', 'db_index': 'True'})
        },
        u'feeds.feed': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Feed'},
            'category': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'feeds'", 'null': 'True', 'to': u"orm['feeds.Category']"}),
            'favicon': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'img_safe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '1023'}),
            'unread_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
            'url': ('feedhq.feeds.fields.URLField', [], {}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'feeds'", 'to': u"orm['profiles.User']"})
        },
        u'feeds.uniquefeed': {
            'Meta': {'object_name': 'UniqueFeed'},
            'error': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'db_column': "'muted_reason'", 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'muted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'url': ('feedhq.feeds.fields.URLField', [], {'unique': 'True'})
        },
        u'profiles.user': {
            'Meta': {'object_name': 'User', 'db_table': "'auth_user'"},
            'allow_media': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.CharField', [], {'max_length': '75'}),
            'endless_pages': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'entries_per_page': ('django.db.models.fields.IntegerField', [], {'default': '50'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
            'font': ('django.db.models.fields.CharField', [], {'default': "'palatino'", 'max_length': '75'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
            'oldest_first': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'read_later': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'read_later_credentials': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'sharing_email': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'sharing_gplus': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'sharing_twitter': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'timezone': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '75'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
        }
    }

    complete_apps = ['feeds']


text:
namespace LastfmScrobbler.Utils
{
    using MediaBrowser.Controller.Entities;
    using Models;
    using System;
    using System.Linq;

    public static class UserHelpers
    {
        public static LastfmUser GetUser(User user)
        {
            if (user == null)
                return null;

            if (Plugin.Instance.PluginConfiguration.LastfmUsers == null)
                return null;

            return GetUser(user.Id);
        }

        public static LastfmUser GetUser(Guid userId)
        {
            return Plugin.Instance.PluginConfiguration.LastfmUsers.FirstOrDefault(u => u.MediaBrowserUserId.Equals(userId));
        }

        public static LastfmUser GetUser(string userGuid)
        {
            Guid g;
            if (Guid.TryParse(userGuid, out g))
                return GetUser(g);

            return null;
        }
    }
}


text:
<?php

namespace SP\Attempt\Test;

use SP\Attempt\Attempt;
use PHPUnit_Framework_TestCase;

/**
 * @coversDefaultClass SP\Attempt\Attempt
 */
class AttemptTest extends PHPUnit_Framework_TestCase
{
    /**
     * @covers ::__construct
     * @covers ::getCallback
     * @covers ::getTimeout
     * @covers ::getStep
     * @covers ::getTries
     * @covers ::getCurrent
     * @covers ::hasTriesLeft
     */
    public function testConstruct()
    {
        $callback = function () {
            return true;
        };

        $attempt = new Attempt($callback);

        $this->assertSame($callback, $attempt->getCallback());
        $this->assertSame(2000, $attempt->getTimeout());
        $this->assertSame(50, $attempt->getStep());
        $this->assertSame(40, $attempt->getTries());
        $this->assertSame(0, $attempt->getCurrent());
        $this->assertSame(true, $attempt->hasTriesLeft());
    }

    /**
     * @covers ::execute
     * @covers ::getCurrent
     */
    public function testExecute()
    {
        $increment = 0;

        $callback = function (Attempt $attempt) use (& $increment) {
            $increment += 1;
            return $attempt->getCurrent() === 3;
        };

        $attempt = new Attempt($callback);

        $attempt->execute();

        $this->assertEquals(4, $attempt->getCurrent());
        $this->assertEquals(
            4,
            $increment,
            'The function should be called the same amount of times as reported by getCurrent'
        );
    }

    /**
     * @covers ::executeOrFail
     */
    public function testExecuteOrFail()
    {
        $increment = 0;

        $callback = function (Attempt $attempt) use (& $increment) {
            $increment += 1;
            return $attempt->getCurrent() === 3;
        };

        $attempt = new Attempt($callback);

        $attempt->executeOrFail();

        $this->assertEquals(4, $attempt->getCurrent());
        $this->assertEquals(
            4,
            $increment,
            'The function should be called the same amount of times as reported by getCurrent'
        );
    }

    /**
     * @covers ::execute
     * @covers ::getCurrent
     * @covers ::setTimeout
     * @covers ::setStep
     */
    public function testExecuteTimeout()
    {
        $increment = 0;

        $callback = function (Attempt $attempt) use (& $increment) {
            $increment += 1;
            return false;
        };

        $attempt = new Attempt($callback);
        $attempt->setTimeout(200);
        $attempt->setStep(80);

        $attempt->execute();

        $this->assertEquals(3, $attempt->getCurrent());
        $this->assertEquals(
            3,
            $increment,
            'The function should be called the same amount of times as reported by getCurrent'
        );
    }

    /**
     * @covers ::executeOrFail
     */
    public function testExecuteOrFailTimeout()
    {
        $callback = function () {
            return false;
        };

        $attempt = new Attempt($callback);
        $attempt->setTimeout(80);

        $this->setExpectedException('RuntimeException', 'Timed out attempting to execute callback');

        $attempt->executeOrFail();
    }
}


text:
==========
Developers
==========

* Florian Wilhelm <florian.wilhelm@gmail.com>
* Ian Mackay <ianmackay00@gmail.com>


text:
from language.glsl import ast as glsl
from . slotstruct import SlotStruct

import re
invalidNameChar = re.compile('[^\w\d_]')

# HACK does not ensure the first character is not a digit.
def ensureValidName(name):
	return re.sub(invalidNameChar, '_', name)

# A pool contains O objects and F fields.
class PoolImplementation(object):
	def __init__(self, poolinfo, basename):
		self.poolinfo = poolinfo

		# HACK
		poolinfo.impl = self

		self.basename = basename
		self.stores   = {}
		self.types    = {}

		self.struct = SlotStruct(poolinfo)

		#self.struct.dump()
		#print

	def _getFieldRef(self, field, slotinfo):
		key = field, slotinfo
		if not key in self.stores:
			fieldimpl = slotinfo.getPoolInfo().impl
			t = fieldimpl.struct.ast

			name = "%s_%s_%s" % (self.basename, field.type, field.name.pyobj)
			name = ensureValidName(name)
			lcl  = glsl.Local(t, name)
			self.stores[key] = lcl
		else:
			lcl = self.stores[key]

		return lcl

	def _deref(self, ref, index):
		if self.poolinfo.isSingleUnique():
			return ref
		else:
			return glsl.GetSubscript(ref, index)

	def getType(self, index):
		assert self.poolinfo.typeTaken
		#assert False, "hack"

		return glsl.Load(index, 'type')

	def getField(self, index, field, slotinfo):
		assert slotinfo.isSlotInfo(), slotinfo
		ref = self._getFieldRef(field, slotinfo)
		return self._deref(ref, index)

	def getValue(self, index, type):
		assert self.struct.inlined
		return index

	def allocate(self, translator, slot, g):
		if self.poolinfo.isSingleUnique():
			return []
		else:
			src = translator.slotRef(translator.makeConstant(0), slot)
			return translator.assignmentTransfer(src, g)


text:
extern const char kChromeInterstitialSslPath[];
extern const char kChromeInterstitialCaptivePortalPath[];
extern const char kChromeInterstitialSafeBrowsingPath[];

// Query keys and values for chrome://interstitials/ssl
extern const char kChromeInterstitialSslUrlQueryKey[];
extern const char kChromeInterstitialSslOverridableQueryKey[];
extern const char kChromeInterstitialSslStrictEnforcementQueryKey[];
extern const char kChromeInterstitialSslTypeQueryKey[];
extern const char kChromeInterstitialSslTypeHpkpFailureQueryValue[];
extern const char kChromeInterstitialSslTypeCtFailureQueryValue[];

// Query keys and values for chrome://interstitials/safe_browsing
extern const char kChromeInterstitialSafeBrowsingUrlQueryKey[];
extern const char kChromeInterstitialSafeBrowsingTypeQueryKey[];
extern const char kChromeInterstitialSafeBrowsingTypeMalwareValue[];
extern const char kChromeInterstitialSafeBrowsingTypePhishingValue[];
extern const char kChromeInterstitialSafeBrowsingTypeUnwantedValue[];
extern const char kChromeInterstitialSafeBrowsingTypeClientsideMalwareValue[];
extern const char kChromeInterstitialSafeBrowsingTypeClientsidePhishingValue[];
extern const char kChromeInterstitialSafeBrowsingTypeBillingValue[];

#endif  // IOS_CHROME_BROWSER_UI_WEBUI_INTERSTITIALS_INTERSTITIAL_UI_CONSTANTS_H_


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

-->
<resources>

	<!-- AVAILABLE FONT FAMILIES

		Roboto regular                  [sans-serif]
		Roboto italic                   [sans-serif]
		Roboto bold                     [sans-serif]
		Roboto bold italic              [sans-serif]
		Roboto-Light                    [sans-serif-light]
		Roboto-Light italic             [sans-serif-light]
		Roboto-Thin                     [sans-serif-thin] (since Android 4.2)
		Roboto-Thin italic              [sans-serif-thin] (since Android 4.2)
		Roboto-Condensed                [sans-serif-condensed]
		Roboto-Condensed italic         [sans-serif-condensed]
		Roboto-Condensed bold           [sans-serif-condensed]
		Roboto-Condensed bold italic    [sans-serif-condensed]
		Roboto-Medium                   [sans-serif-medium] (since Android 5.0)
		Roboto-Medium italic            [sans-serif-medium] (since Android 5.0)

	-->

	<!-- ### NAVIGATION ======================================================================== -->

	<!-- TextAppearance style for title TextView widget of Navigation HeaderView. -->
	<style name="Ui.TextAppearance.Widget.TextView.HeaderView.Title" parent="Ui.TextAppearance.Widget.TextView.Medium">
		<item name="android:textColor">@android:color/white</item>
	</style>

	<!-- TextAppearance style for subtitle TextView widget of Navigation HeaderView. -->
	<style name="Ui.TextAppearance.Widget.TextView.HeaderView.Subtitle" parent="Ui.TextAppearance.Widget">
		<item name="android:textColor">@android:color/white</item>
	</style>

	<!-- TextAppearance style for title TextView widget of NavigationItemView. -->
	<style name="Ui.TextAppearance.Widget.TextView.NavigationItem.Title" parent="Ui.TextAppearance.Widget.TextView.Medium">
		<item name="android:textColor">@color/ui_navigation_item_text</item>
	</style>

	<!-- Light TextAppearance style for title TextView widget of NavigationItemView. -->
	<style name="Ui.TextAppearance.Light.Widget.TextView.NavigationItem.Title" parent="Ui.TextAppearance.Widget.TextView.NavigationItem.Title">
		<item name="android:textColor">@color/ui_light_navigation_item_text</item>
	</style>

	<!-- TextAppearance style for subheader TextView widget of Navigation. -->
	<style name="Ui.TextAppearance.Widget.TextView.Navigation.Subheader" parent="Ui.TextAppearance.Widget.TextView.NavigationItem.Title">
		<item name="android:textColor">@color/ui_navigation_subheader_text</item>
	</style>

	<!-- Light TextAppearance style for subheader TextView widget of Navigation. -->
	<style name="Ui.TextAppearance.Light.Widget.TextView.Navigation.Subheader" parent="Ui.TextAppearance.Widget.TextView.Navigation.Subheader">
		<item name="android:textColor">@color/ui_light_navigation_subheader_text</item>
	</style>
</resources>


text:
// Copyright (c) Andy Sipe. All rights reserved. Licensed under the MIT License (MIT). See License.txt in the project root for license information.

using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Maddir.UnitTests")]
[assembly: AssemblyDescription("Maddir.UnitTests")]
[assembly: AssemblyProduct("Maddir.UnitTests")]
[assembly: Guid("31b35a63-4e0a-4e2a-9644-cda61e6a4077")]


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

<title>FlavorEvent (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="java.awt.datatransfer.FlavorEvent class">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

java.awt.datatransfer

Class FlavorEvent

java.lang.Object

java.util.EventObject

java.awt.datatransfer.FlavorEvent

All Implemented Interfaces:

Serializable

public class FlavorEvent
extends EventObject

FlavorEvent is used to notify interested parties
 that available DataFlavors have changed in the
 Clipboard (the event source).

Since:

1.5

See Also:

FlavorListener,
Serialized Form

Field Summary

Fields inherited from class java.util.EventObject

source

Constructor Summary

Constructors

Constructor and Description

FlavorEvent(Clipboard source)

Constructs a FlavorEvent object.

Method Summary

Methods inherited from class java.util.EventObject

getSource, toString

Methods inherited from class java.lang.Object

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

Constructor Detail

FlavorEvent

public FlavorEvent(Clipboard source)

Constructs a FlavorEvent object.

Parameters:

source - the Clipboard that is the source of the event

Throws:

IllegalArgumentException - if the source is null

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
require "helper"
require "logger"

describe Google::Cloud::Logging::AsyncWriter, :mock_logging do
  let(:log_name) { "web_app_log" }
  let(:resource) do
    Google::Cloud::Logging::Resource.new.tap do |r|
      r.type = "gce_instance"
      r.labels["zone"] = "global"
      r.labels["instance_id"] = "abc123"
    end
  end
  let(:labels1) { { "env" => "production" } }
  let(:labels2) { { "env" => "staging" } }
  let(:write_res) { Google::Logging::V2::WriteLogEntriesResponse.new }
  let(:async_writer) { Google::Cloud::Logging::AsyncWriter.new logging, Google::Cloud::Logging::AsyncWriter::DEFAULT_MAX_QUEUE_SIZE, true }

  def entries payload, labels = labels1
    Array(payload).map { |str|
      logging.entry(
        log_name: log_name,
        resource: resource,
        severity: :INFO,
        labels: labels,
        payload: str
      )
    }
  end

  def write_req_args payload, labels = labels1
    full_log_name = "projects/test/logs/#{log_name}"
    entries = Array(payload).map do |str|
      Google::Logging::V2::LogEntry.new(
        text_payload: str,
        severity: :INFO,
        resource: resource.to_grpc,
        log_name: full_log_name,
        labels: labels
      )
    end
    [entries, log_name: full_log_name, resource: resource.to_grpc, labels: labels, partial_success: true, options: default_options]
  end

  it "writes a single entry" do
    mock = Minitest::Mock.new
    logging.service.mocked_logging = mock

    mock.expect :write_log_entries, write_res, write_req_args("payload1")

    async_writer.write_entries(
      entries("payload1"),
      log_name: log_name,
      resource: resource,
      labels: labels1
    )
    async_writer.stop! 1

    mock.verify
  end

  it "combines related entries" do
    mock = Minitest::Mock.new
    logging.service.mocked_logging = mock

    mock.expect :write_log_entries, write_res, write_req_args(["payload1", "payload2"], labels1)

    async_writer.suspend
    async_writer.write_entries(
      entries("payload1"),
      log_name: log_name,
      resource: resource,
      labels: labels1
    )
    async_writer.write_entries(
      entries("payload2"),
      log_name: log_name,
      resource: resource,
      labels: labels1
    )
    async_writer.resume
    async_writer.stop! 1

    mock.verify
  end

  it "separates unrelated entries" do
    mock = Minitest::Mock.new
    logging.service.mocked_logging = mock

    mock.expect :write_log_entries, write_res, write_req_args(["payload1"], labels1)
    mock.expect :write_log_entries, write_res, write_req_args("payload2", labels2)

    async_writer.suspend
    async_writer.write_entries(
      entries("payload1", labels1),
      log_name: log_name,
      resource: resource,
      labels: labels1
    )
    async_writer.write_entries(
      entries("payload2", labels2),
      log_name: log_name,
      resource: resource,
      labels: labels2
    )
    async_writer.resume

    wait_result = wait_until_true {
      async_writer.instance_variable_get(:@queue).size == 0
    }

    wait_result.must_equal :completed

    async_writer.stop! 1

    mock.verify
  end
end


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

001
016
017package net.ljcomputing.people.web.config;
018
019import javax.servlet.ServletContext;
020import javax.servlet.ServletContextEvent;
021import javax.servlet.ServletContextListener;
022import javax.servlet.ServletException;
023import javax.servlet.ServletRegistration;
024
025import org.slf4j.Logger;
026import org.slf4j.LoggerFactory;
027import org.springframework.boot.SpringApplication;
028import org.springframework.boot.builder.SpringApplicationBuilder;
029import org.springframework.boot.context.web.SpringBootServletInitializer;
030import org.springframework.context.annotation.Bean;
031import org.springframework.context.annotation.ComponentScan;
032import org.springframework.context.annotation.Configuration;
033import org.springframework.context.annotation.Import;
034import org.springframework.web.WebApplicationInitializer;
035import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
036import org.springframework.web.servlet.DispatcherServlet;
037import org.springframework.web.servlet.config.annotation.EnableWebMvc;
038
039import net.ljcomputing.gson.config.GsonWebMvcConfigurerAdapter;
040import net.ljcomputing.people.PeopleApplication;
041
042/**
043 * People deployment configuration class.
044 *
045 * @author James G. Willmore
046 *
047 */
048@Configuration
049@ComponentScan(basePackages = { "net.ljcomputing.core", "net.ljcomputing.people" })
050@EnableWebMvc
051@Import({ GsonWebMvcConfigurerAdapter.class, PeopleApplication.class })
052public class PeopleWebConfiguration extends SpringBootServletInitializer implements WebApplicationInitializer {
053        private static Logger logger = LoggerFactory.getLogger(PeopleWebConfiguration.class);
054
055        @Bean
056        protected ServletContextListener listener() {
057                return new ServletContextListener() {
058
059                        @Override
060                        public void contextInitialized(ServletContextEvent sce) {
061                                System.out.println("contextInitialized");
062                                logger.info("ServletContext initialized");
063                        }
064
065                        @Override
066                        public void contextDestroyed(ServletContextEvent sce) {
067                                System.out.println("contextDestroyed");
068                                logger.info("ServletContext destroyed");
069                        }
070
071                };
072        }
073
074        public static void main(String[] args) throws Exception {
075                SpringApplication.run(PeopleWebConfiguration.class, args);
076        }
077
078        protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
079                System.out.println("configure");
080                logger.debug("Configuring ... ");
081                return builder.showBanner(true).sources(PeopleWebConfiguration.class).web(true).logStartupInfo(true);
082        }
083
084        public void onStartup(ServletContext container) throws ServletException {
085                logger.info("onStartup ...");
086                AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
087                ctx.register(PeopleWebConfiguration.class);
088                ctx.setServletContext(container);
089
090                DispatcherServlet ds = new DispatcherServlet(ctx);
091                ServletRegistration.Dynamic servlet = container.addServlet("dispatcherServlet", ds);
092
093                servlet.setInitParameter("throwExceptionIfNoHandlerFound", "true");
094                servlet.setLoadOnStartup(1);
095                servlet.addMapping("/");
096
097                logger.warn("servlet name: {}", servlet.getName());
098                logger.warn("servlet throwExceptionIfNoHandlerFound: {}",
099                                servlet.getInitParameter("throwExceptionIfNoHandlerFound"));
100        }
101
102}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd">

<!--
  * plugins/gateways/resolver/locale/el_GR/locale.xml
  *
  * Copyright (c) 2003-2013 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Localization strings for the Greek locale.
  *
  * Translation by University of Patras, Library & Information Service
  * Vassilis Barkayannis (barkayannis@upatras.gr),
  * Panos Georgiou (panos@lis.upatras.gr),
  * Giannis Tsakonas (john@lis.upatras.gr),
  * Kiriazis Vasilis (vaskir@lis.upatras.gr),
  * Papaxristopoulos Leonidas (leonidasp@lis.upatras.gr)
  *
  -->

<locale name="el_GR" full_name="Greek">
	<message key="plugins.gateways.resolver.displayName">Resolver Plugin</message>
	<message key="plugins.gateways.resolver.description">Το plugin αυτό αναλύει τεύχη και άρθρα σύμφωνα με τις πληροφορίες παραπομπής.</message>
	<message key="plugins.gateways.resolver.errors.errorMessage">Δεν ειναι δυνατή η ανάλυση μιας μοναδικής οντότητας με την χρήση των συγκεκριμένων πληροφοριών παραπομπής. Σιγουρευτείτε ότι οι σχετικές πληροφορίες είναι αναλυτικές και αναφέρονται σε μια οντότητα στην συγκεκριμένη εγκατάσταση του OJS.</message>
	<message key="plugins.gateways.resolver.exportHoldings">Εξαγωγή Πληροφοριών</message>
</locale>


text:
class SessionsController < ApplicationController
  def new
  end

  def create
    reset_session
    user = User.find_by_username(params[:username]).try(:authenticate, params[:password])
    if user && user.activated
      if params[:remember_me]
        cookies.permanent[:auth_token] = user.auth_token
      else
        cookies[:auth_token] = user.auth_token
      end
      flash_message :success, t(:loggedin)
      redirect_to notes_path
    else
      if user && !user.activated
        link = ActionController::Base.helpers.link_to t(:requestactivation), resend_activation_path(username: user.username)
        flash_now :danger, "#{t :notactivated} #{link}".html_safe
      else
        flash_now :danger, t(:loginfailed)
      end
      render 'new'
    end
  end

  def destroy
    # Generate a new auth token (before_save action)
    current_user.save! if current_user
    cookies.delete :auth_token
    reset_session
    flash_message :success, t(:loggedout)
    redirect_to login_path
  end

  def create_oauth
    reset_session
    auth = Authorization.find_by provider: auth_hash['provider'], uid: auth_hash['uid']
    if auth
      user = auth.user
      flash_message :success, t(:loggedin)
    else
      user = User.find_by email: auth_hash['info']['email']
      if !user
        user = User.new username: auth_hash['info']['name'], email: auth_hash['info']['email']
        user.password = SecureRandom.urlsafe_base64
        user.activated = true
        flash_message :success, t(:oauth_usercreated)
      else
        flash_message :success, t(:oauth_connected)
      end
      user.authorizations.build provider: auth_hash['provider'], uid: auth_hash['uid']
      user.save!
    end
    cookies.permanent[:auth_token] = user.auth_token
    redirect_to notes_path
  end

  def oauth_failed
    flash_message :danger, t(:oauth_failed)
    redirect_to login_path
  end

  private
    def auth_hash
      request.env['omniauth.auth']
    end
end


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Microsoft.Extensions.FileProviders.Embedded</name>
    </assembly>
    <members>
        <member name="T:Microsoft.Extensions.FileProviders.EmbeddedFileProvider">
            <summary>
            Looks up files using embedded resources in the specified assembly.
            This file provider is case sensitive.
            </summary>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.EmbeddedFileProvider.#ctor(System.Reflection.Assembly)">
            <summary>
            Initializes a new instance of the <see cref="T:Microsoft.Extensions.FileProviders.EmbeddedFileProvider" /> class using the specified
            assembly and empty base namespace.
            </summary>
            <param name="assembly">The assembly that contains the embedded resources.</param>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.EmbeddedFileProvider.#ctor(System.Reflection.Assembly,System.String)">
            <summary>
            Initializes a new instance of the <see cref="T:Microsoft.Extensions.FileProviders.EmbeddedFileProvider" /> class using the specified
            assembly and base namespace.
            </summary>
            <param name="assembly">The assembly that contains the embedded resources.</param>
            <param name="baseNamespace">The base namespace that contains the embedded resources.</param>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.EmbeddedFileProvider.GetFileInfo(System.String)">
            <summary>
            Locates a file at the given path.
            </summary>
            <param name="subpath">The path that identifies the file. </param>
            <returns>
            The file information. Caller must check Exists property. A <see cref="T:Microsoft.Extensions.FileProviders.NotFoundFileInfo" /> if the file could
            not be found.
            </returns>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.EmbeddedFileProvider.GetDirectoryContents(System.String)">
            <summary>
            Enumerate a directory at the given path, if any.
            This file provider uses a flat directory structure. Everything under the base namespace is considered to be one
            directory.
            </summary>
            <param name="subpath">The path that identifies the directory</param>
            <returns>
            Contents of the directory. Caller must check Exists property. A <see cref="T:Microsoft.Extensions.FileProviders.NotFoundDirectoryContents" /> if no
            resources were found that match <paramref name="subpath" />
            </returns>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.EmbeddedFileProvider.Watch(System.String)">
            <summary>
            Embedded files do not change.
            </summary>
            <param name="pattern">This parameter is ignored</param>
            <returns>A <see cref="T:Microsoft.Extensions.FileProviders.NullChangeToken" /></returns>
        </member>
        <member name="T:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo">
            <summary>
            Represents a file embedded in an assembly.
            </summary>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.#ctor(System.Reflection.Assembly,System.String,System.String,System.DateTimeOffset)">
            <summary>
            Initializes a new instance of <see cref="T:Microsoft.Extensions.FileProviders.EmbeddedFileProvider"/> for an assembly using <paramref name="resourcePath"/> as the base
            </summary>
            <param name="assembly">The assembly that contains the embedded resource</param>
            <param name="resourcePath">The path to the embedded resource</param>
            <param name="name">An arbitrary name for this instance</param>
            <param name="lastModified">The <see cref="T:System.DateTimeOffset" /> to use for <see cref="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.LastModified" /></param>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.Exists">
            <summary>
            Always true.
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.Length">
            <summary>
            The length, in bytes, of the embedded resource
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.PhysicalPath">
            <summary>
            Always null.
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.Name">
            <summary>
            The name of embedded file
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.LastModified">
            <summary>
            The time, in UTC, when the <see cref="T:Microsoft.Extensions.FileProviders.EmbeddedFileProvider"/> was created
            </summary>
        </member>
        <member name="P:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.IsDirectory">
            <summary>
            Always false.
            </summary>
        </member>
        <member name="M:Microsoft.Extensions.FileProviders.Embedded.EmbeddedResourceFileInfo.CreateReadStream">
            <inheritdoc />
        </member>
    </members>
</doc>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Participate extends CI_Controller {

	public function index(){
		$this->logged_in();
		$data['participates'] = $this->participate->all();
		$this->load->view('/participate/index', $data);
	}

	public function new_participate(){
		$data['users'] = $this->user->all();
		$data['projects'] = $this->project->all();
		$this->load->view('/participate/new_participate', $data);
	}

	public function create(){
		$data = $_POST;
		$this->participate->create($data);
		$this->session->set_flashdata('message', 'Cadastrado com sucesso');
		redirect('/participate/index');
	}

	public function update(){
		$data = $_POST;
		$this->participate->update($data, $_POST['idParticipa']);
		$data['users'] = $this->user->all();
		$data['projects'] = $this->project->all();

		$this->session->set_flashdata('message', 'Atualizado com sucesso');
		redirect('/participate/index');
	}

	public function edit(){
		$data['projects'] = $this->project->all();
		$data['users'] = $this->user->all();
		$data['participate'] = $this->participate->find($_GET['idParticipa']);
		$this->load->view('/participate/edit', $data);
	}

	public function show(){
		$data['projects'] = $this->project->all();
		$data['users'] = $this->user->all();
		$data['participate'] = $this->participate->find($_GET['idParticipa']);
		$this->load->view('/participate/show', $data);
	}

	public function destroy(){
		$this->participate->destroy($_GET['idParticipa']);
		$this->session->set_flashdata('message', 'Deletado com sucesso');
		redirect('/participate/index');
	}

	public function send_file($data) {
	  $config['upload_path']          = '/home/ronanmiotto/php/nipeti/projects/';
	  $config['allowed_types']        = 'pdf|doc|docx';
		$config['encrypt_name'] 				= true;

	  $this->load->library('upload', $config);

		$this->upload->initialize($config);

	  if ( ! $this->upload->do_upload('arquivo')) {
	    $error = array('error' => $this->upload->display_errors());
	    $this->load->view('upload_form', $error);
	  }
  }

	private function logged_in(){
    $this->session->userdata('logged_in') == true ? '' : redirect('/login/index');
  }

	private function students(){
		// 1: professor 2: estudante
		return $this->user->get_by(2);
	}
}


text:
@interface FLTestResult ()
@property (readwrite, strong, nonatomic) NSError* error;
@property (readwrite, assign, nonatomic) NSUInteger expectedCount;
@property (readwrite, assign, nonatomic) NSUInteger count;
@property (readwrite, strong, nonatomic) NSString* testName;
@end

@implementation FLTestResult
@synthesize error = _error;
@synthesize expectedCount = _expectedCount;
@synthesize count = _count;
@synthesize testName = _testName;

+ (id) testResult {
    return FLAutorelease([[[self class] alloc] init]);
}

- (void) setPassed {
    ++_count;
}

- (BOOL) passed {
    return !self.error && _count == _expectedCount;
}

#if FL_MRC
- (void) dealloc {
    [_testName release];
    [_error release];
    [super dealloc];
}
#endif

- (id) initWithExpectedCount:(NSUInteger) count {
    self = [super init];
    if(self) {
        _expectedCount = count;
        self.testName = NSStringFromClass([self class]);
    }
    return self;
}

- (id) init {
    return [self initWithExpectedCount:1];
}

- (NSString*) description {
    return [NSString stringWithFormat:@"%@ { testName: %@, passed: %@, error: %@ }", [super description], self.testName, self.passed ? @"YES" : [NSString stringWithFormat:@"NO (%d of %d)", (int)_count, (int)_expectedCount],
            [_error description]];
}

@end

@implementation FLCountedTestResult
@dynamic count;
@dynamic expectedCount;

+ (id) countedTestResult:(NSUInteger) expectedCount {
    return FLAutorelease([[[self class] alloc] initWithExpectedCount:expectedCount]);
}

@end


text:
if (typeof(QTP) == "undefined") {
	/** QTP is a namespace for QuickTime Player javascript objects. */
	QTP = {};
}

/**
 * Creates an object which listens for a mouse click, intercepts it, and creates a DOM element
 * in response.  Creates a QTP.Movie using the url parameter, and a QTP.MovieController
 * object for that movie.
 * @param {String} url Initializes the object's url member
 * @class Popup
 * @constructor
 */
QTP.Popup = function(url)
{
	this.url = url;
};

/**
 * URL to use when activating the popup DOM element.
 * @type String
 */
QTP.Popup.prototype.url = null;
/**
 * Caches whether the DOM element is currently popped up.
 * @type boolean
 */
QTP.Popup.prototype.poppedUp = false;
/**
 * Caches the DOM div element which contains the popup.
 * @type DOMElement
 */
QTP.Popup.prototype.popupDiv = null;
/**
 * Caches the movie created when the popup is activated.
 * @type QTP.Movie
 */
QTP.Popup.prototype.movie = null;
/**
 * Determines whether to allow the popup to fade into existence.  Set this
 * to false to disable the fade behavior.
 * @type boolean
 */
QTP.Popup.prototype.fadeIn = true;
/**
 * Determines whether to discover the movie's natural size, and then to manually
 * set the movie to that size.  Set this to false to disable the autoSize
 * behavior.
 * @type boolean
 */
QTP.Popup.prototype.autoSize = true;
/**
 * Sets the default className of the movieController DOM element.  Set this to another String
 * to change the defailt controller className.
 * @type String
 */
QTP.Popup.prototype.controllerType = 'Pro';
QTP.Popup.prototype.attributes = {
		controller: 'false',
		autoplay: 'true',
		bgcolor: 'black',
		scale: 'aspect',
		postdomevents: 'true'
	};

/**
 * Walks through the DOM heirarchy, looking for <a> tags with a rel
 * attribute of 'qtpopup'.  For each it finds, the function creates a new Popup
 * object and attaches the object to the link as its popup member.  The Popup
 * object listens for the link's click event.
 * @example
 * <script type="javascript" src="qtp_library.js"></script>
 * <script type="javascript" src="qtp_ui.js"></script>
 * <script type="javascript" src="qtp_controller.js"></script>
 * <script type="javascript" src="qtp_popup.js"></script>
 * ...
 * <a href="myMovie.mov" rel="qtpopup">
 */
QTP.Popup.instantiatePopups = function()
{
	if (navigator.platform.indexOf('iPhone') > -1)
		return;

	var links = $A(document.getElementsByTagName('a'));
	var controllers = links.findAll(function(link){ return link.rel && link.rel == 'qtpopup'; });

	controllers.each(function(link){
			if(link.popup)
				return;
			var popup = new QTP.Popup(link.href);
			link.popup = popup;

			var img = document.createElement('span');
			img.className = 'qtpopupbutton';
			link.appendChild(img);

			var listener = popup.popupListener.bindAsEventListener(popup);
			Event.observe(link, 'click', listener);
		});
};

/**
 * Static utility function which converts a query string to a hash of key:value pairs.
 * @param {String} query A url-style query string
 * @returns Object A hash object of key:value pairs
 */
QTP.Popup.toQueryParams = function(query)
{
	var hash = {};

	if(typeof(query) == 'undefined')
		return hash;

	query.split('&').each(function(param){
			var pair = param.split('=');
			hash[pair[0]] = pair.length > 1 ? pair[1] : pair[0];
		});

	return hash;
};

/**
 * Static utility function which will call a handler when the element param is either loaded, or
 * emits a qt_loadmetadata event; whichever comes first.
 * @param {DOMElement} element A video or object/embed element.
 * @param {Function} handler A callback method
 */
QTP.Popup.pollOrListenForLoad = function(element, handler)
{
	if( !typeof(element.GetPluginStatus) == 'undefined' &&
		(element.GetPluginStatus() == 'playable' || element.GetPluginStatus() == 'complete'))
	{
		// short circuit
		handler();
		return;
	}

	Event.observe(element, 'qt_loadedmetadata', handler);

	var timer = function() {
		if(!timer._stoppedListener)
		{
			if(typeof(element.GetQuickTimeVersion) == 'undefined')
			{
				setTimeout(timer, 100);
				return;
			}

			var version = element.GetQuickTimeVersion().split('.');
			if(!(version[0] < 7 || version[1] < 2 || version[2] < 1))
			{
				// just use the observer
				return;
			}

			// cancel the listener
			Event.stopObserving(element, 'qt_loadedmetadata', handler);
			timer._stoppedListener = true;
		}

		if( typeof(element.GetPluginStatus) == 'undefined' ||
		 !(element.GetPluginStatus() == 'playable' || element.GetPluginStatus() == 'complete'))
		{
			setTimeout(timer, 100);
			return;
		}

		handler();
	}

	timer();
}

/**
 * Event listener which calls popup() once, and prevents the popup action from
 * being called again.  The listener will become active again once closePopup() is
 * called.
 * @param {Event} event The instigating event
 */
QTP.Popup.prototype.popupListener = function(event)
{
	event.stopPropagation();
	event.preventDefault();

	if(this.poppedUp)
		return;
	this.poppedUp = true;

	this.popup();
	return true;
};

/**
 * Creates the popup DOM object, instantiates a new QTP.Movie, and inserts the whole into the document
 * body.  The fade behavior is controlled by the fade property.  The autoSize behavior
 * is controlled by the autoSize property.  The css className of the instantiated
 * QTP.MovieController element is controlled by the controllerType property.
 */
QTP.Popup.prototype.popup = function()
{
	var url = this.url;

	var div = document.createElement('div');
	var background = document.createElement('div');
	var wrapper1 = document.createElement('div');
	var wrapper2 = document.createElement('div');
	var spinner = document.createElement('div');
	var moviewrapper = document.createElement('div');
	var close = document.createElement('div');
//	var openinplayer = document.createElement('div');
	var controller = new QTP.MovieController(this.controllerType);
	div.className = 'qtpopup';
	background.className = 'qtpopupbackground';
	wrapper1.className = 'qtpopupwrapper1';
	wrapper2.className = 'qtpopupwrapper2';
	moviewrapper.className = 'qtpopupmovie';
	close.className = 'qtpopupclose';
	spinner.className = 'qtpopupprogress';
//	openinplayer.className = 'qtpopupopeninplayer';

//	Event.observe(openinplayer, 'click', this.openFullscreen.bindAsEventListener(this));
	Event.observe(close, 'click', this.closePopup.bindAsEventListener(this));
	Event.observe(background, 'click', this.closePopup.bindAsEventListener(this));

	if(this.fadeIn)
	{
		// set up fade in
		background.style.opacity = 0.0;
		background.style.webkitTransition = 'opacity 0.25s ease-in';
		spinner.style.opacity = 0.0;
		spinner.style.webkitTransition =  'opacity 0.25s ease-in';
	}

	// add the elements to the DOM
	moviewrapper.appendChild(spinner);
	wrapper2.appendChild(spinner);
	wrapper1.appendChild(wrapper2);
	div.appendChild(wrapper1);
	div.appendChild(background);
	document.body.appendChild(div);

	if(this.fadeIn)
	{
		// fade in
		background.style.removeProperty('opacity');
		spinner.style.removeProperty('opacity')
	}

	// allow the user to override the attributes
	var args = url.indexOf('?') > -1 ? QTP.Popup.toQueryParams(url.split('?')[1]) : [];
	var attributes = this.attributes;
	for(key in args) { attributes[key] = args[key]; }

	attributes.src = url;
	var movie = new QTP.Movie(attributes);

	// size the movie to its default size, but
	// not until it's loaded
	if(this.autoSize && (!args.width || !args.height))
		QTP.Popup.pollOrListenForLoad(movie.element, function()
			{
				var dims = movie.element.GetRectangle().split(',');
				var matrix = movie.element.GetMatrix().split(/$/m);
				matrix.each(function(row, index){ matrix[index] = row.split(/,/); });
				// invert the width and height matrix adjustments
				dims[2] /= matrix[0][0];
				dims[3] /= matrix[1][1];
				movie.element.setAttribute('width',dims[2]);
				movie.element.setAttribute('height',dims[3]);
			});

	this.movie = movie;

	controller.setMovie(movie);
	moviewrapper.appendChild(movie.element);
	moviewrapper.appendChild(close);
	moviewrapper.appendChild(document.createElement('br'));
//	moviewrapper.appendChild(openinplayer);
	moviewrapper.appendChild(controller.element);

	// add the movie to the DOM
	setTimeout(function() {
		wrapper2.removeChild(spinner);
		wrapper2.appendChild(moviewrapper);
		}, this.fadeIn ? 250 : 0);

	div.movie = movie;

	this.popupDiv = div;
	this.moviewrapper = moviewrapper;
	this.controller = controller;
};

/**
 * Stops the movie playback, removes the popup DOM element from the DOM tree, and empties its members.
 * This function will reset the popupListener() behavior, so that the user can once again
 * click on a qtpopup link.
 */
QTP.Popup.prototype.closePopup = function(event)
{
	event.stopPropagation();
	event.preventDefault();

	if(!this.poppedUp)
		return;
	this.poppedUp = false;

	if(typeof(this.movie.element.Stop) != 'undefined')
		this.movie.element.Stop();
	this.popupDiv.style.display = 'hidden';
	document.body.removeChild(this.popupDiv);
	this.popupDiv = null;
	this.movie = null;

	return true;
};

/**
 * For object/embed tag movies, this will cause the movie URL to be opened in QuickTime Player.
 * But for video tag movies, this function will have no effect.
 */
QTP.Popup.prototype.openInPlayer = function(event)
{
	event.stopPropagation();
	event.preventDefault();

	var movie = this.movie;

	movie.element.Stop();
	movie.addParameter('href', this.href);
	movie.addParameter('target', 'quicktimeplayer');
	movie.addParameter('autohref', 'true');

	QTP.Popup.closePopup.call(this, event);
};

/**
 * Creates a new child browser window, with no menu-, tool-, or scrollbars.  This window's
 * initial size will be the available screen size, and will contain the same movie object as
 * the popup.
 */
QTP.Popup.prototype.openFullscreen = function(event)
{
	var dims = [window.screen.availLeft,
				window.screen.availTop,
				window.screen.availWidth,
				window.screen.availHeight];

	var settings = "left="+dims[0]+",top="+dims[1]+",width="
					+dims[2]+",height="+dims[3]+",menubar=no,toolbar=no,location=no,"
					+"resizable=yes,scrollbars=no,dependent=yes"

	var url = "Fullscreen.html?" + escape(this.url);
	var child = window.open(url, "child", settings);
	this.closePopup(event);
}

Event.observe(window, 'load', QTP.Popup.instantiatePopups);


text:
package net.kiberion.swampmachine.gui.composition.elements;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import lombok.Getter;
import lombok.Setter;
import net.kiberion.swampmachine.entities.spatial.api.Position;
import net.kiberion.swampmachine.entityblocks.api.IdHolderBlock;

@JsonDeserialize(using = CompositionElementDeserializer.class)
public class CompositionElement implements IdHolderBlock, Comparable<CompositionElement> {

    @Getter
    @Setter
    private String type;

    @Getter
    @Setter
    private String id;

    @Getter
    @Setter
    private Position position;

    @Getter
    private Map<String, Object> properties = new HashMap<>();

    @Getter
    private CompositionElement parent;

    @Getter
    @Setter
    private int zIndex = 50; // The z-index property specifies the stack order
                             // of an element. An element with greater stack
                             // order is always in front of an element with a
                             // lower stack order.

    @Override
    public String toString() {
        return type + ": " + id;
    }

    @Override
    public int compareTo(CompositionElement o) {
        if (o == null) {
            return 1;
        }
        return Integer.compare(zIndex, o.getZIndex());
    }
}