text:
<?php
/**
 * AccountTest
 *
 * PHP version 5
 *
 * @category Class
 * @package  SidneyAllen\XeroPHP
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Accounting API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * OpenAPI spec version: 2.0.0
 * Contact: api@xero.com
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 3.3.4
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Please update the test case below to test the model.
 */

namespace SidneyAllen\XeroPHP;

/**
 * AccountTest Class Doc Comment
 *
 * @category    Class
 * @description Account
 * @package     SidneyAllen\XeroPHP
 * @author      OpenAPI Generator team
 * @link        https://openapi-generator.tech
 */
class AccountTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Setup before running any test case
     */
    public static function setUpBeforeClass()
    {
    }

    /**
     * Setup before running each test case
     */
    public function setUp()
    {
    }

    /**
     * Clean up after running each test case
     */
    public function tearDown()
    {
    }

    /**
     * Clean up after running all test cases
     */
    public static function tearDownAfterClass()
    {
    }

    /**
     * Test "Account"
     */
    public function testAccount()
    {
    }

    /**
     * Test attribute "code"
     */
    public function testPropertyCode()
    {
    }

    /**
     * Test attribute "name"
     */
    public function testPropertyName()
    {
    }

    /**
     * Test attribute "account_id"
     */
    public function testPropertyAccountId()
    {
    }

    /**
     * Test attribute "type"
     */
    public function testPropertyType()
    {
    }

    /**
     * Test attribute "bank_account_number"
     */
    public function testPropertyBankAccountNumber()
    {
    }

    /**
     * Test attribute "status"
     */
    public function testPropertyStatus()
    {
    }

    /**
     * Test attribute "description"
     */
    public function testPropertyDescription()
    {
    }

    /**
     * Test attribute "bank_account_type"
     */
    public function testPropertyBankAccountType()
    {
    }

    /**
     * Test attribute "currency_code"
     */
    public function testPropertyCurrencyCode()
    {
    }

    /**
     * Test attribute "tax_type"
     */
    public function testPropertyTaxType()
    {
    }

    /**
     * Test attribute "enable_payments_to_account"
     */
    public function testPropertyEnablePaymentsToAccount()
    {
    }

    /**
     * Test attribute "show_in_expense_claims"
     */
    public function testPropertyShowInExpenseClaims()
    {
    }

    /**
     * Test attribute "class"
     */
    public function testPropertyClass()
    {
    }

    /**
     * Test attribute "system_account"
     */
    public function testPropertySystemAccount()
    {
    }

    /**
     * Test attribute "reporting_code"
     */
    public function testPropertyReportingCode()
    {
    }

    /**
     * Test attribute "reporting_code_name"
     */
    public function testPropertyReportingCodeName()
    {
    }

    /**
     * Test attribute "has_attachments"
     */
    public function testPropertyHasAttachments()
    {
    }

    /**
     * Test attribute "updated_date_utc"
     */
    public function testPropertyUpdatedDateUtc()
    {
    }

    /**
     * Test attribute "validation_errors"
     */
    public function testPropertyValidationErrors()
    {
    }
}


text:
//
//  AddressListController.m
//  GKCommerce
//
//  Created by 小悟空 on 11/15/14.
//  Copyright (c) 2014 GKCommerce. All rights reserved.
//

#import "GKAddressListController.h"
#import "AddressListTableViewCell.h"
#import "AddressEditController.h"

@interface GKAddressListController ()

@end

@implementation GKAddressListController
//objection_requires(@"service")
objection_requires_sel(@selector(service))
- (id)init
{
  self = [self initWithNibName:@"AddressListView" bundle:nil];
  if (self) {
  }
  return self;
}

- (id)initWithUser:(GKUser *)user
{
  self = [self init];
  if (self) {
    self.user = user;
      [self setup];
  }
  return self;
}

- (id)initWithAddress:(NSArray *)addresses
{
  self = [self init];
  self.addresses = addresses;
  return self;
}

- (void)setup
{

}

- (void)viewDidLoad
{
  [super viewDidLoad];

  UIBarButtonItem *rightButton;
  rightButton = [[UIBarButtonItem alloc]
                 initWithTitle:@"新增" style:UIBarButtonItemStylePlain
                 target:self action:@selector(didTapAddAddress:)];
  self.navigationItem.rightBarButtonItem = rightButton;

  for (NSString *identifier in @[@"AddressListTableViewCell"])
    [self.tableView registerNib:[UINib nibWithNibName:identifier bundle:nil]
         forCellReuseIdentifier:identifier];

  RAC(self, addresses) = [self.service addressesWithUser:self.user];
  [RACObserve(self, addresses) subscribeNext:^(NSArray *address) {
    [self.tableView reloadData];
  }];
}

- (void)didTapAddAddress:(id)sender
{
    AddressEditController *controller;
    controller = [[AddressEditController alloc]
                  initWithAddress:nil user:self.user];
    [self.navigationController pushViewController:controller animated:YES];
}

- (void)didReceiveMemoryWarning
{
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section
{
  return self.addresses.count;
}

- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
  return 89.0f;
}

- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
  AddressListTableViewCell *cell;
  GKAddress *address;
  cell = [tableView
          dequeueReusableCellWithIdentifier:@"AddressListTableViewCell"];
  address = [self.addresses objectAtIndex:indexPath.row];
  cell.address = address;

  return cell;
}

- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    GKAddress *address;
    AddressEditController *controller;
    address = self.addresses[indexPath.row];
    controller = [[AddressEditController alloc]
                  initWithAddress:address user:self.user];
    [self.navigationController pushViewController:controller animated:YES];
}

/*
 #pragma mark - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end

redpajama_set_name: RedPajamaGithub


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.conf4j</groupId>
    <artifactId>conf4j</artifactId>
    <version>2018.10.2-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>conf4j</name>
    <description>Easy to use configuration management library for Java</description>
    <url>https://github.com/conf4j/conf4j</url>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/conf4j/conf4j/issues</url>
    </issueManagement>
    <scm>
        <connection>scm:git:https://github.com/conf4j/conf4j.git</connection>
        <developerConnection>scm:git:git@github.com:conf4j/conf4j.git</developerConnection>
        <url>https://github.com/conf4j/conf4j</url>
      <tag>HEAD</tag>
  </scm>

    <properties>
        <jackson.version>2.9.7</jackson.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <modules>
        <module>conf4j-all</module>
        <module>conf4j-consul</module>
        <module>conf4j-core</module>
        <module>conf4j-etcd</module>
        <module>ext-bean-validation</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <format>xml</format>
                    <maxmem>256m</maxmem>
                    <aggregate>true</aggregate>
                    <check />
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.0.0</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.25</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>23.0</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.11.1</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.2.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>1.6</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>1.9.1</version>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>3.1.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <developers>
        <developer>
            <name>Asaf Alima</name>
            <url>https://github.com/asafalima</url>
        </developer>
    </developers>
</project>


text:
"""New program modal"""

from lib import base
from lib.constants import locator
import lib.page.widget.info

class EditProgramModal(base.Modal):
  """Class representing a modal visible after clicking the settings button
  in the info widget and selecting edit"""

  _locators = locator.ModalCreateNewProgram

  def __init__(self, driver):
    super(EditProgramModal, self).__init__(driver)
    # user input elements
    self.ui_title = base.TextInputField(self._driver,
                                        self._locators.UI_TITLE)
    self.ui_description = base.Iframe(
        self._driver, self._locators.UI_DESCRIPTION)
    self.ui_notes = base.Iframe(self._driver,
                                self._locators.NOTES_UI)
    self.ui_code = base.TextInputField(self._driver,
                                       self._locators.UI_CODE)
    self.ui_state = base.Dropdown(self._driver, self._locators.UI_STATE)
    self.ui_show_optional_fields = base.Toggle(
        self._driver,
        self._locators.BUTTON_SHOW_ALL_OPTIONAL_FIELDS)
    self.ui_primary_contact = base.TextFilterDropdown(
        self._driver,
        self._locators.UI_PRIMARY_CONTACT,
        self._locators.DROPDOWN_CONTACT)
    self.ui_secondary_contact = base.TextFilterDropdown(
        self._driver,
        self._locators.UI_SECONDARY_CONTACT,
        self._locators.DROPDOWN_CONTACT)
    self.ui_program_url = base.TextInputField(
        self._driver, self._locators.UI_PROGRAM_URL)
    self.ui_reference_url = base.TextInputField(
        self._driver, self._locators.UI_REFERENCE_URL)
    self.ui_effective_date = base.DatePicker(
        self._driver,
        self._locators.DATE_PICKER,
        self._locators.UI_EFFECTIVE_DATE)
    self.ui_stop_date = base.DatePicker(
        self._driver,
        self._locators.DATE_PICKER,
        self._locators.UI_STOP_DATE)

    # static elements
    self.title = base.Label(self._driver, self._locators.TITLE)
    self.description = base.Label(self._driver, self._locators.DESCRIPTION)
    self.program_url = base.Label(self._driver, self._locators.PROGRAM_URL)
    self.button_save_and_close = base.Button(
        self._driver,
        self._locators.BUTTON_SAVE_AND_CLOSE)

  def enter_title(self, text):
    """Enters the text into the title base.

    Args:
        text (str or unicode)
    """
    self.ui_title.enter_text(text)

  def enter_description(self, description):
    """Enters the text into the description element

    Args:
        description (str or unicode)
    """
    self.ui_description.find_iframe_and_enter_data(description)

  def enter_notes(self, notes):
    """Enters the text into the notes element

    Args:
        notes (str)
    """
    self.ui_notes.find_iframe_and_enter_data(notes)

  def enter_code(self, code):
    """Enters the text into the code element

    Args:
        code (str or unicode)
    """
    self.ui_code.enter_text(code)

  def select_state(self, state):
    """Selects a state from the dropdown"""
    raise NotImplementedError

  def toggle_optional_fields(self):
    """Shows or hides optional fields"""
    raise NotImplementedError

  def filter_and_select_primary_contact(self, text):
    """Enters the text into the primary contact element"""
    # pylint: disable=invalid-name
    self.ui_primary_contact.filter_and_select_first(text)

  def filter_and_select_secondary_contact(self, text):
    """Enters the text into the secondary contact element"""
    # pylint: disable=invalid-name
    self.ui_secondary_contact.filter_and_select_first(text)

  def enter_program_url(self, url):
    """Enters the program url for this program object

    Args:
        url (str)
    """
    self.ui_program_url.enter_text(url)

  def enter_reference_url(self, url):
    """Enters the reference url for this program object

    Args:
        url (str)
    """
    self.ui_reference_url.enter_text(url)

  def enter_effective_date_start_month(self, day):
    """Selects from datepicker the start date
    Args:
      day (int): for more info see base.DatePicker.select_day_in_current_month
    """
    # pylint: disable=invalid-name
    self.ui_effective_date.select_day_in_current_month(day)

  def enter_stop_date_end_month(self, day):
    """Selects from datepicker the end date
    Args:
      day (int): for more info see base.DatePicker.select_day_in_current_month
    """
    self.ui_stop_date.select_day_in_current_month(day)

  def save_and_close(self):
    """Saves this object.

    Note that at least the title must be entered and it must be unique.

    Returns:
        lib.page.widget.info.ProgramInfo
    """
    self.button_save_and_close.click()
    self.wait_for_redirect()
    return lib.page.widget.info.ProgramInfo(self._driver)

class NewProgramModal(EditProgramModal):
  """Class representing a new program modal visible after creating a new
  program from LHN"""

  _locators = locator.ModalCreateNewProgram

  def __init__(self, driver):
    super(NewProgramModal, self).__init__(driver)
    self.button_save_and_add_another = base.Button(
        self._driver,
        self._locators.BUTTON_SAVE_AND_ADD_ANOTHER)

  def save_and_add_other(self):
    """Saves this objects and opens a new form"""
    self.button_save_and_add_another.click()
    return NewProgramModal(self._driver)


text:
package org.telegram.api.decryptedmessage;

import org.telegram.tl.TLObject;

/**
 * Abstract class to describes the content of an encrypted message
 * @author Ruben Bermudez
 * @version 2.0
 * @date 02 of May of 2015
 */
public abstract class TLAbsDecryptedMessage extends TLObject {

    /**
     * Random message ID, assigned by the author of message. Must be equal to the ID passed to sending method.
     */
    protected long randomId;

    /**
     * Gets random id.
     *
     * @return the random id
     */
    public long getRandomId() {
        return this.randomId;
    }

    /**
     * Sets random id.
     *
     * @param value the value
     */
    public void setRandomId(long value) {
        this.randomId = value;
    }
}


text:
var _curry3 = require('./internal/_curry3');
var defaultTo = require('./defaultTo');
var path = require('./path');

/**
 * If the given, non-null object has a value at the given path, returns
 * the value at that path. Otherwise returns the provided default value.
 *
 * @func
 * @memberOf R
 * @since v0.18.0
 * @category Object
 * @sig a -> [String] -> Object -> a
 * @param {*} d The default value.
 * @param {Array} p The path to use.
 * @return {*} The data at `path` of the supplied object or the default value.
 * @example
 *
 *      R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2
 *      R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> "N/A"
 */
module.exports = _curry3(function pathOr(d, p, obj) {
  return defaultTo(d, path(p, obj));
});


text:
const EVENT_IGNORE = false;
const EVENT_CONSUME = undefined;
const EVENT_PURGE = true;

const EVT_PATH_PATTERN = /^(\*|[a-z][-\w]*)(\.(\*|[a-z][-\w]*))*$/i;
const EVT_RANGE_PATTERN = /^(\*|-?\d+)(-(\*|-?\d+))?(,(\*|-?\d+)(-(\*|-?\d+))?)*$/;

const RANGE_ITEM_PATTERN = /^(\*|-?\d+)(?:-(\*|-?\d+))?$/;

var util = require('util');

var EventException = require('./exceptions').EventException;
var slice = Array.prototype.slice;
var events = {
  EventEmitter: EventEmitter,
  defaultMaxListeners: 10
};

module.exports = events;

function EventEmitter() {
  var _events = {
    registered: [],
    children: {}
  };

  Object.defineProperties(this, {
    'on': {
      enumerable: true,
      value: function () {
        return function on(event, listener) {
          var counter = Infinity;

          if (arguments.length >= 3) {
            counter = listener;
            listener = arguments[2];
          }

          return addListener(_events, event, listener, counter);
        };
      }()
    },
    'once': {
      enumerable: true,
      value: function () {
        return function once(event, listener) {
          return addListener(_events, event, listener, 1);
        };
      }()
    },
    'off': {
      enumerable: true,
      value: function () {
        return function off(event, listener) {
          return removeListener(_events, event, listener);
        };
      }()
    },
    'clear': {
      enumerable: true,
      value: function () {
        return function clear(event) {
          return removeAllListeners(_events, event);
        };
      }()
    },
    'listeners': {
      enumerable: true,
      value: function () {
        return function listeners(event) {
          return getListeners(_events, event);
        };
      }()
    },
    'emit': {
      enumerable: true,
      value: function () {
        return function emit(event) {
          var eventArgs = slice.call(arguments, 1);

          return emitEvent(_events, event, eventArgs);
        };
      }()
    },
    'emitSync': {
      enumerable: true,
      value: function () {
        return function emit(event) {
          var eventArgs = slice.call(arguments, 1);

          return emitEventSync(_events, event, eventArgs);
        };
      }()
    }
  });

  this.addListener = this.on;
  this.removeListener = this.off;
}
util.inherits(EventEmitter, require('events').EventEmitter);

function addListener(events, event, listener, counter) {
  var eventData;
  var eventPath;
  var eventRange;

  if (!event) {
    throw EventException('Event msut not be empty', { event: event });
  } else if (typeof event !== 'string') {
    throw EventException('Event msut be a string', { event: event });
  } else if (!(listener instanceof Function)) {
    throw EventException('Listener must be a function', { listener: listener, event: event });
  } else if (typeof counter !== 'number' || isNaN(counter) || (counter < 0)) {
    throw EventException('Invalid event listener counter', { counter: counter, event: event });
  } else if (counter === 0) {
    counter = Infinity;
  }

  eventData = event.split(':');
  eventPath = eventData[0];
  eventRange = eventData[1] || '*';

  if (!eventPath.match(EVT_PATH_PATTERN)) {
    throw EventException('Invalid event path `{{path}}`', { path: eventPath, event: event });
  } else if (!eventRange.match(EVT_RANGE_PATTERN)) {
    throw EventException('Invalid event range `{{range}} for path `{{path}}`', { range: eventRange, path:eventPath, event: event });
  }

  _createEventContext(events, eventPath).registered.push({
    rawEvent: event,
    eventPath: eventPath,
    rangeValidate: _createEventRangeValidator(eventRange),
    listener: listener,
    counter: counter
  });
}

function removeListener(events, event, listener) {
  _processEventContext(events, event, function (registeredListener) {
    return registeredListener === listener ? EVENT_PURGE : EVENT_IGNORE;
  });
}

function removeAllListeners(events, event) {
  _processEventContext(events, event, function (registeredListener) {
    return EVENT_PURGE;
  });
}

function getListeners(events, event) {
  var listeners = [];

  _processEventContext(events, event, function (listener) {
    listeners.push(listener);
    return EVENT_IGNORE;
  });

  return listeners;
}

function emitEvent(events, event, eventArgs) {
  _processEventContext(events, event, function (listener) {
    setImmediate(function () {
      listener.apply(null, eventArgs);
    });
    return EVENT_CONSUME;
  });
}

function emitEventSync(events, event, eventArgs) {
  _processEventContext(events, event, function (listener) {
    listener.apply(null, eventArgs);
    return EVENT_CONSUME;
  });
}

function _createEventContext(events, eventPath) {
  var ctx = events;
  var path = eventPath.split('.');
  var i = 0;
  var ilen = path.length;

  for (; i < ilen; ++i) {
    if (ctx.children[path[i]]) {
      ctx = ctx.children[path[i]];
    } else {
      ctx = ctx.children[path[i]] = {
        registered: [],
        children: {}
      };
    }
  }

  return ctx;
}

function _createRangeArray(range) {
  var rangeData = String(range || '').split(',');
  var i = 0;
  var ilen = rangeData.length;
  var rangeItem;
  var rangeArray = [];

  for (; i < ilen; ++i) {
    rangeItem = (rangeData[i] || '*').match(RANGE_ITEM_PATTERN);

    if (!rangeItem) {
      throw EventException('Invalid range `{{range}}`', { range: rangeData[i] });
    }

    if (rangeItem[1] === '*') {
      rangeItem[1] = Number.MIN_VALUE;
    } else {
      rangeItem[1] = Number(rangeItem[1]);
    }
    if (rangeItem[2] === '*') {
      rangeItem[2] = Infinity;
    } else if (rangeItem[2] === undefined) {
      if (rangeItem[1] === Number.MIN_VALUE) {
        rangeItem[2] = Infinity;
      } else {
        rangeItem[2] = rangeItem[1];
      }
    } else {
      rangeItem[2] = Number(rangeItem[2]);
    }

    rangeArray.push({
      min: Math.min(rangeItem[1], rangeItem[2]),
      max: Math.max(rangeItem[1], rangeItem[2])
    });
  }

  rangeArray.sort(function rangeSorter(a, b) {
    return a.min - b.min;
  });

  for (i = 1; i < rangeArray.length; ++i) {
    if (rangeArray[i].min <= rangeArray[i - 1].max) {
      rangeArray[i - 1].max = rangeArray[i].max;
      rangeArray.splice(i--, 1);
    }
  }

  return rangeArray;
}

/**
Create a range validator. The returned value is a function validating if
a given range matches this range
*/
function _createEventRangeValidator(range) {
  var ctxRange = _createRangeArray(range);

  return function rangeValidator(range) {
    var leftIndex = 0;
    var rightIndex = 0;
    var left;
    var right;

    for (; leftIndex < ctxRange.length && rightIndex < range.length; ) {
      left = ctxRange[leftIndex];
      right = range[rightIndex];

      if (left.max < right.min) {
        ++leftIndex;
      } else if ((left.min <= right.min || left.max >= right.max) &&
                 ((left.min > right.min && (right.min !== Number.MIN_VALUE)) ||
                  (left.max < right.max) && (right.max !== Infinity))) {
        return false;
      } else {
        ++rightIndex;
      }
    }

    return (rightIndex >= range.length);
  };
}

function _processEventContext(events, event, callback) {
  var eventData;
  var eventPath;
  var eventRange;

  if (!event) {
    throw EventException('Event msut not be empty', { event: event });
  } else if (typeof event !== 'string') {
    throw EventException('Event msut be a string', { event: event });
  }

  eventData = event.split(':');
  eventPath = eventData[0];
  eventRange = eventData[1] || '*';

  if (!eventPath.match(EVT_PATH_PATTERN)) {
    throw EventException('Invalid event path `{{path}}`', { path: eventPath, event: event });
  } else if (!eventRange.match(EVT_RANGE_PATTERN)) {
    throw EventException('Invalid event range `{{range}}`', { range: eventRange, event: event });
  }

  eventPath = eventPath.split('.');
  eventRange = _createRangeArray(eventData[1]);

  contextIterator(events, eventPath, 0, eventRange, callback);
}

function contextIterator(ctx, path, pathIndex, range, callback) {
  var keys;
  var key;
  var i;
  var ilen;
  var eventAction;
  var prevCounter;

  if (path.length - 1 < pathIndex) {
    for (var i = 0, ilen = ctx.registered.length; i < ilen; ++i) {
      key = ctx.registered[i];

      prevCounter = key.counter;

      if ((key.counter > 0) && key.rangeValidate(range)) {
        --key.counter;

        eventAction = callback(key.listener);

        if (eventAction === EVENT_IGNORE) {
          key.counter = prevCounter;  // restore
        } else if (eventAction === EVENT_PURGE) {
          key.counter = 0;
        }
        if ((key.counter <= 0) && (ctx.registered[i] === key)) {
          ctx.registered.splice(i--, 1); --ilen;
        }

        key.active = false;
      }
    }
  } else if (path[pathIndex] === '*') {
    keys = Object.keys(ctx.children);

    for (i = 0, ilen = keys.length; i < ilen; ++i) {
      key = keys[i];

      if (contextIterator(ctx.children[key], path, pathIndex + 1, range, callback)) {
        delete ctx.children[key];
      }
    }
  } else {
    if (ctx.children[path[pathIndex]]) {
      if (contextIterator(ctx.children[path[pathIndex]], path, pathIndex + 1, range, callback)) {
        delete ctx.children[path[pathIndex]];
      }
    }

    if (ctx.children['*']) {
      if (contextIterator(ctx.children['*'], path, pathIndex + 1, range, callback)) {
        delete ctx.children['*'];
      }
    }
  }

  return !Object.keys(ctx.children).length && !ctx.registered.length;
}


text:
package org.ovirt.engine.ui.userportal;

import org.ovirt.engine.ui.common.CommonApplicationConstants;

public interface ApplicationConstants extends CommonApplicationConstants {

    @DefaultStringValue("oVirt Engine User Portal")
    String applicationTitle();

    @DefaultStringValue("About")
    String aboutPopupCaption();

    @DefaultStringValue("")
    String copyRightNotice();

    // Login section

    @DefaultStringValue("User Name")
    String loginFormUserNameLabel();

    @DefaultStringValue("Password")
    String loginFormPasswordLabel();

    @DefaultStringValue("Domain")
    String loginFormDomainLabel();

    @DefaultStringValue("Login")
    String loginButtonLabel();

    @DefaultStringValue("Connect Automatically")
    String loginFormConnectAutomaticallyLabel();

    // Main section

    @DefaultStringValue("Sign Out")
    String logoutLinkLabel();

    @DefaultStringValue("About")
    String aboutLinkLabel();

    @DefaultStringValue("Guide")
    String guideLinkLabel();

    @DefaultStringValue("Basic")
    String basicMainTabLabel();

    @DefaultStringValue("Extended")
    String extendedMainTabLabel();

    @DefaultStringValue("Virtual Machines")
    String extendedVirtualMachineSideTabLabel();

    @DefaultStringValue("Templates")
    String extendedTemplateSideTabLabel();

    @DefaultStringValue("Resources")
    String extendedResourceSideTabLabel();

    @DefaultStringValue("General")
    String extendedVirtualMachineGeneralSubTabLabel();

    @DefaultStringValue("Network Interfaces")
    String extendedVirtualMachineNetworkInterfaceSubTabLabel();

    @DefaultStringValue("Virtual Disks")
    String extendedVirtualMachineVirtualDiskSubTabLabel();

    @DefaultStringValue("Snapshots")
    String extendedVirtualMachineSnapshotSubTabLabel();

    @DefaultStringValue("Permissions")
    String extendedVirtualMachinePermissionSubTabLabel();

    @DefaultStringValue("Events")
    String extendedVirtualMachineEventSubTabLabel();

    @DefaultStringValue("Applications")
    String extendedVirtualMachineApplicationSubTabLabel();

    @DefaultStringValue("Monitor")
    String extendedVirtualMachineMonitorSubTabLabel();

    @DefaultStringValue("General")
    String extendedTemplateGeneralSubTabLabel();

    @DefaultStringValue("Network Interfaces")
    String extendedTemplateNetworkInterfacesSubTabLabel();

    @DefaultStringValue("Virtual Disks")
    String extendedTemplateVirtualDisksSubTabLabel();

    @DefaultStringValue("Events")
    String extendedTemplateEventsSubTabLabel();

    @DefaultStringValue("Permissions")
    String extendedTemplatePermissionsSubTabLabel();

    // Console popup view

    @DefaultStringValue("Spice")
    String spice();

    @DefaultStringValue("Pass Ctrl-Alt-Del to virtual machine")
    String ctrlAltDel();

    @DefaultStringValue("Enable USB Auto-Share")
    String usbAutoshare();

    @DefaultStringValue("Open in Full Screen")
    String openInFullScreen();

    @DefaultStringValue("Not supported for this client OS")
    String ctrlAltDeletIsNotSupportedOnWindows();

    @DefaultStringValue("Enable WAN Options")
    String enableWanOptions();

    @DefaultStringValue("RDP Options")
    String rdpOptions();

    @DefaultStringValue("Use Local Drives")
    String useLocalDrives();

    @DefaultStringValue("Remote Desktop")
    String remoteDesktop();

    @DefaultStringValue("SPICE Options")
    String spiceOptions();

    // VM Monitor sub tab

    @DefaultStringValue("CPU Usage")
    String vmMonitorCpuUsageLabel();

    @DefaultStringValue("Memory Usage")
    String vmMonitorMemoryUsageLabel();

    @DefaultStringValue("Network Usage")
    String vmMonitorNetworkUsageLabel();

    // Buttons on extended tab main grid
    @DefaultStringValue("Take VM")
    String takeVmLabel();

    @DefaultStringValue("Run")
    String runVmLabel();

    @DefaultStringValue("Return VM")
    String returnVmLabel();

    @DefaultStringValue("Shutdown")
    String shutdownVmLabel();

    @DefaultStringValue("Suspend")
    String suspendVmLabel();

    @DefaultStringValue("Stop")
    String stopVmLabel();

    @DefaultStringValue("Open Console")
    String openConsoleLabel();

    @DefaultStringValue("Edit Console Options")
    String editConsoleLabel();

    @DefaultStringValue("Cancel")
    String cancel();

    @DefaultStringValue("OK")
    String ok();

    @Override
    @DefaultStringValue("")
    String empty();

    // Template
    @DefaultStringValue("Edit")
    String editTemplate();

    @DefaultStringValue("Remove")
    String removeTemplate();

    // Vm
    @DefaultStringValue("New Server")
    String newServerVm();

    @DefaultStringValue("New Desktop")
    String newDesktopVm();

    @DefaultStringValue("Edit")
    String editVm();

    @DefaultStringValue("Remove")
    String removeVm();

    @DefaultStringValue("Run Once")
    String runOnceVm();

    @DefaultStringValue("Change CD")
    String changeCdVm();

    @DefaultStringValue("Make Template")
    String makeTemplateVm();

    @DefaultStringValue("Virtual Machine")
    String virualMachineVm();

    @DefaultStringValue("Disks")
    String disksVm();

    @DefaultStringValue("Virtual Size")
    String virtualSizeVm();

    @DefaultStringValue("Actual Size")
    String actualSizeVm();

    @DefaultStringValue("Snapshots")
    String snapshotsVm();

    @DefaultStringValue("VNC console access is not supported from the user portal.<br/>" +
            "Please ask the administrator to configure this " +
            "virtual machine to use SPICE for console access.")
    String vncNotSupportedMsg();

    @DefaultStringValue("Your browser/platform does not support console opening")
    String browserNotSupportedMsg();

    // Extended resource
    @DefaultStringValue("Virtual Machines")
    String vmsExtResource();

    @DefaultStringValue("Defined VMs")
    String definedVmsExtResource();

    @DefaultStringValue("Running VMs")
    String runningVmsExtResource();

    @DefaultStringValue("Virtual CPUs")
    String vcpusExtResource();

    @DefaultStringValue("Defined vCPUs")
    String definedvCpusExtResource();

    @DefaultStringValue("Used vCPUs")
    String udedvCpusExtResource();

    @DefaultStringValue("Memory")
    String memExtResource();

    @DefaultStringValue("Defined Memory")
    String definedMenExtResource();

    @DefaultStringValue("Memory Usage")
    String memUsageExtResource();

    @DefaultStringValue("Storage")
    String storageExtResource();

    @DefaultStringValue("Total Size")
    String totalSizeExtResource();

    @DefaultStringValue("Number of Snapshots")
    String numOfSnapshotsExtResource();

    @DefaultStringValue("Total Size of Snapshots")
    String totalSizeSnapshotsExtResource();

    // Basic details
    @DefaultStringValue("Operating System")
    String osBasicDetails();

    @DefaultStringValue("Defined Memory")
    String definedMemBasicDetails();

    @DefaultStringValue("Number of Cores")
    String numOfCoresBasicDetails();

    @DefaultStringValue("Drives")
    String drivesBasicDetails();

    @DefaultStringValue("Console")
    String consoleBasicDetails();

    @DefaultStringValue("Edit")
    String editBasicDetails();

    // Header
    @DefaultStringValue("Logged in user")
    String loggedInUser();

    @DefaultStringValue("UserPortal Documentation")
    String userPortalDoc();

    // machine status messages
    @DefaultStringValue("Powering Up")
    String WaitForLaunch();

    @DefaultStringValue("Powering Up")
    String PoweringUp();

    @DefaultStringValue("Powering Up")
    String RebootInProgress();

    @DefaultStringValue("Powering Up")
    String RestoringState();

    @DefaultStringValue("Machine is Ready")
    String MigratingFrom();

    @DefaultStringValue("Machine is Ready")
    String MigratingTo();

    @DefaultStringValue("Machine is Ready")
    String Up();

    @DefaultStringValue("Paused")
    String Paused();

    @DefaultStringValue("Paused")
    String Suspended();

    @DefaultStringValue("Powering Down")
    String PoweringDown();

    @DefaultStringValue("Powering Down")
    String PoweredDown();

    @DefaultStringValue("Not Available")
    String Unknown();

    @DefaultStringValue("Not Available")
    String Unassigned();

    @DefaultStringValue("Not Available")
    String NotResponding();

    @DefaultStringValue("Please Wait..")
    String SavingState();

    @DefaultStringValue("Please Wait..")
    String ImageLocked();

    @DefaultStringValue("Machine is Down")
    String Down();

    // machine messages
    @DefaultStringValue("Shutdown VM")
    String shutdownVm();

    @DefaultStringValue("Suspend VM")
    String suspendVm();

    @DefaultStringValue("Take VM")
    String takeVm();

    @DefaultStringValue("Run VM")
    String runVm();

    @DefaultStringValue("Double Click for Console")
    String doubleClickForConsole();

}


text: sudo grunt serve


text:
package alien4cloud.metaproperty;

import alien4cloud.dao.IESMetaPropertiesSearchContext;
import alien4cloud.dao.IESMetaPropertiesSearchContextBuilder;
import alien4cloud.dao.IGenericSearchDAO;
import alien4cloud.dao.model.FacetedSearchResult;
import alien4cloud.dao.model.GetMultipleDataResult;

import alien4cloud.model.application.Application;
import alien4cloud.model.common.MetaPropConfiguration;
import alien4cloud.model.common.MetaPropertyTarget;
import alien4cloud.model.service.ServiceResource;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;

import lombok.extern.slf4j.Slf4j;
import org.alien4cloud.tosca.model.templates.Topology;
import org.alien4cloud.tosca.model.types.NodeType;
import org.elasticsearch.common.collect.Maps;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.mapping.IFacetBuilderHelper;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;

@Slf4j
@Service
public class MetaPropertySearchContextBuilder implements IESMetaPropertiesSearchContextBuilder,ApplicationListener<MetaPropertyEvent> {

    /**
     * Prefix used for metaproperties
     */
    private static final String PREFIX = "metaProperties";

    /**
     * ES Dao
     */
    @Resource(name = "alien-es-dao")
    private IGenericSearchDAO alienDAO;

    /**
     * Class to Target map
     */
    private Map<Class<?>,String> classToTarget = new HashMap<>();

    /**
     * Metaproperty data
     */
    private Map<String,BiMap<String,String>> map = null;

    /**
     * Lock
     */
    private Lock lock = new ReentrantLock();

    /**
     * Lazily build the map
     *
     * @return the meta properties map
     */
    private Map<String,BiMap<String,String>> getMap() {
        try {
            lock.lock();
            if (map == null) {
                map = buildMap();
            }
            return map;
        } finally {
            lock.unlock();
        }
    }

    /**
     * Build the map.
     *
     * @return the meta properties map
     */
    private Map<String,BiMap<String,String>> buildMap() {
        Map<String,BiMap<String,String>> resultMap = new HashMap<>();

        Map<String, String[]> filters = Maps.newHashMap();
        filters.put("target", classToTarget.values().toArray(new String[0]));
        filters.put("filtered", new String[] { "true" });

        GetMultipleDataResult<MetaPropConfiguration> result = alienDAO.find(MetaPropConfiguration.class, filters,Integer.MAX_VALUE);

        for (MetaPropConfiguration meta : result.getData()) {
            BiMap<String,String> targetMap = resultMap.computeIfAbsent(meta.getTarget(),k -> HashBiMap.create());
            targetMap.put(meta.getId(),meta.getName());
        }

        return resultMap;
    }

    private MetaPropertySearchContextBuilder() {
        classToTarget.put(NodeType.class, MetaPropertyTarget.COMPONENT);
        classToTarget.put(ServiceResource.class, MetaPropertyTarget.SERVICE);
        classToTarget.put(Application.class, MetaPropertyTarget.APPLICATION);
        classToTarget.put(Topology.class, MetaPropertyTarget.TOPOLOGY);
    }

    @Override
    public void onApplicationEvent(MetaPropertyEvent metaPropertyEvent) {
        try {
            lock.lock();
            // The map will be rebuilt on next getMap
            map = null;
        } finally {
            lock.unlock();
        }
    }

    private class Context implements IESMetaPropertiesSearchContext {

        private final BiMap<String,String> map;

        private Context(BiMap<String,String> map) {
            this.map = map;
        }

        @Override
        public List<IFacetBuilderHelper> getFacetBuilderHelpers() {
            if (map != null) {
                return map.keySet().stream().map(f -> new MetaPropertyAggregationBuilderHelper(PREFIX , f)).collect(Collectors.toList());
            } else {
                return new ArrayList<>();
            }
        }

        @Override
        public FilterBuilder[] getFilterBuilders(Map<String, String[]> filters) {
            List<FilterBuilder> result = new ArrayList<>();

            if (filters != null) {
                for (IFacetBuilderHelper helper : getFacetBuilderHelpers()) {
                    String fieldName = helper.getEsFieldName();

                    if (filters.containsKey(fieldName)) {
                        result.add(helper.buildFilter(fieldName,filters.get(fieldName)));
                    }
                }
            }

            return result.toArray(new FilterBuilder[0]);
        }

        @Override
        public void preProcess(Map<String, String[]> filters) {
            if (map != null) {
                MetaPropertySubstitutionHelper.subst(filters, map.inverse(), PREFIX);
            }
        }

        @Override
        public void postProcess(FacetedSearchResult result) {
            if (map != null) {
                MetaPropertySubstitutionHelper.subst(result.getFacets(), map, PREFIX);
            }
        }
    }

    public <T> IESMetaPropertiesSearchContext getContext(Class<T> clazz) {
        return Optional.ofNullable(classToTarget.get(clazz))
                .map(c -> new Context(getMap().get(c)))
                .orElse(new Context(null));
    }
}


text:
layout: markdown_page
title: "Critical Security Release Process"
---

This is intended to be a template and suggested schedule for actions required
for GitLab to respond to critical vulnerabilities. Steps include actions taken
from the moment the vulnerability is discovered/reported up to the final package
deployments and announcements. This assumes that a critical patch will take
roughly one week to deploy, however this will vary depending on the
vulnerability and number of releases to be patched.

Also see the [developer release process](https://gitlab.com/gitlab-org/release-tools/blob/master/doc/security.md)
for more details on what needs to be done to create a security release.

```

### First steps:

- [ ] Create a confidential issue for diagnosing, discussing, and mitigating the vulnerability in the GitLab CE repository.
- [ ] Create a confidential issue for the release (using the rest of this document as a rough template). Include a reference to the vulnerability issue and merge request when it exists. This issue should include information on which releases are vulnerable and which will receive a patch.
- [ ] Branch off of the dev CE master branch for pushing patches
- [ ] Create a Work-In-Progress merge request against dev security branch, assigned to the release manager for the current release.
- [ ] Fix build failures (owner: release managers)
- [ ] Install mitigation for GitLab.com, GitHost.io (if possible) and any other vulnerable infrastructure hosts, create an issue in the infrastructure project describing the mitigation and impact.

### Day one:

- [ ] Merge all patches to dev.gitlab.org security branch (owner: dev team)
- [ ] Write pre-announcement security update (owner: security lead) - Do NOT pre-announce affected versions
- [ ] Contact package maintainers about security announcement (e.g. GitSwarm, Debian, FreeBSD) (owner: security lead)
- [ ] Request pre-assigned CVE (owner: security lead)

### Day two:

- [ ] Cherry-pick all patches to releases -> stable branches (owner: release managers)
- [ ] Validate security fixes for current release (owner: dev team)
- [ ] Write WIP blog post against www-gitlab-com on dev.gitlab.org about security update, mitigation steps (include HAProxy/Apache/nginx workarounds): (owner: security lead)
- [ ] Send pre-announcement e-mail to general security list and contacts (owners: customer relations / marketing)

### Day three:

- [ ] Post blog post security announcement. Branch off of dev www repository and then merge to prod www (owner: security lead)
- [ ] Build packages to private PackageCloud package repository (latest stable and patches) (owner: release manager & build team)
- [ ] Validate security fixes on dedicated test instances for each package (owner: dev team)
- [ ] Deploy to staging (owner: release manager)
- [ ] Deploy to GitLab.com (owners: infrastructure)
- [ ] Remove mitigation from infrastructure hosts and close issue. (owner: infrastructure)

### Day four (before 12:00 UTC):

- [ ] Build packages for all versions to private PackageCloud package repository (owners: build team)
- [ ] Write blog post with CVE number (owner: security lead)
- [ ] Write CVE notice for CVE-ID provider (owner: security lead)

### Day four (before 23:59 UTC):

- [ ] Publish security packages to public (owner: build team)
- [ ] Publish latest security Docker images (owner: build team)
- [ ] Update GitHost.io (owner: githost / infrastructure)
- [ ] Send CVE notice to CVE-ID provider (owner: security lead)
- [ ] Add version.gitlab.com entries (owner: release manager)
- [ ] Publish blog post (owner: marketing)
- [ ] Remove confidentiality from disclosure issues. (owner: security lead)
- [ ] Email, Tweet, etc. (owner: marketing)
- [ ] Publish latest code to GitLab.com (owner: release manager)
- [ ] Update vulnerability acknowledgements (owner: security lead)
- [ ] Follow-up with disclosure reports to inform/thank security researchers (owner: security lead)
- [ ] Approve request(s) for disclosure on HackerOne (owner security lead)

_Note that we should not publish code or the packages to the public until everything is ready._

### Afterwards:

- [ ] "Lessons learned" writeup / blog post. (owner: security lead)
```


text:
package se.kotlinski.imagesort;

import com.google.inject.Guice;
import com.google.inject.Injector;
import se.kotlinski.imagesort.commandline.CommandLineInterface;
import se.kotlinski.imagesort.javafx.GuiClient;
import se.kotlinski.imagesort.module.ImageModule;

/**
 * Entry point of the program, if any kind of arguments, run cmd-version, else application version
 */
final class MainRenamer {

  private MainRenamer() {
  }

  public static void main(String[] args) {
    Injector injector = Guice.createInjector(new ImageModule());

    if (args.length == 0) {
      runGUI(injector);
    }
    else {
      runCLI(args, injector);
    }

  }

  private static void runCLI(final String[] args, final Injector injector) {
    CommandLineInterface commandLineInterface = injector.getInstance(CommandLineInterface.class);
    commandLineInterface.runCommandLine(args);
  }

  private static void runGUI(final Injector injector) {
    GuiClient instance = injector.getInstance(GuiClient.class);
    instance.startApplication();
  }

}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cortinarius guttatus var. ilicina Rob. Henry

### Remarks
null


text:
logrotate_app "chef-log" do
  cookbook "logrotate"
  path [ "/var/log/chef/chef.log" ]
  frequency "daily"
  create "640 root root"
  rotate 7
end


text:
<?php

namespace Oro\Bundle\SearchBundle\Query;

use Doctrine\Common\Collections\Criteria;

/**
 * Allows to pass callbacks instead of the actual values to calculate them separately on demand
 */
class LazyResult extends Result
{
    /** @var \Closure */
    protected $elementsCallback;

    /** @var \Closure */
    protected $recordsCountCallback;

    /** @var \Closure */
    protected $aggregatedDataCallback;

    /**
     * @param Query            $query
     * @param \Closure|array   $elements
     * @param \Closure|integer $recordsCount
     * @param \Closure|array   $aggregatedData
     */
    public function __construct(
        Query $query,
        $elements = [],
        $recordsCount = 0,
        $aggregatedData = []
    ) {
        $this->query = $query;

        if ($elements instanceof \Closure) {
            $this->elementsCallback = $elements;
        } else {
            $this->elements = $elements;
            $this->fillCollectionElements($this->elements);
        }

        if ($recordsCount instanceof \Closure) {
            $this->recordsCountCallback = $recordsCount;
        } else {
            $this->recordsCount = $recordsCount;
        }

        if ($aggregatedData instanceof \Closure) {
            $this->aggregatedDataCallback = $aggregatedData;
        } else {
            $this->aggregatedData = $aggregatedData;
        }

        // parent constructor is not called intentionally to make sure that properties will not be initialized
    }

    /**
     * Fill internal storage of ArrayCollection to maintain compatibility with Collection interface
     *
     * @param array $elements
     */
    protected function fillCollectionElements(array $elements)
    {
        parent::clear();

        foreach ($elements as $key => $value) {
            parent::set($key, $value);
        }
    }

    /**
     * Loads elements using callback
     */
    protected function initializeElements()
    {
        if (null === $this->elements) {
            $this->elements = call_user_func($this->elementsCallback);
            $this->fillCollectionElements($this->elements);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getElements()
    {
        $this->initializeElements();

        return $this->elements;
    }

    /**
     * {@inheritdoc}
     */
    public function getRecordsCount()
    {
        if (null === $this->recordsCount) {
            $this->recordsCount = call_user_func($this->recordsCountCallback);
        }

        return $this->recordsCount;
    }

    /**
     * {@inheritdoc}
     */
    public function getAggregatedData()
    {
        if (null === $this->aggregatedData) {
            $this->aggregatedData = call_user_func($this->aggregatedDataCallback);
        }

        return $this->aggregatedData;
    }

    /**
     * {@inheritdoc}
     */
    public function toArray()
    {
        $this->initializeElements();

        return parent::toArray();
    }

    /**
     * {@inheritDoc}
     */
    public function first()
    {
        $this->initializeElements();

        return parent::first();
    }

    /**
     * {@inheritDoc}
     */
    public function last()
    {
        $this->initializeElements();

        return parent::last();
    }

    /**
     * {@inheritDoc}
     */
    public function key()
    {
        $this->initializeElements();

        return parent::key();
    }

    /**
     * {@inheritDoc}
     */
    public function next()
    {
        $this->initializeElements();

        return parent::next();
    }

    /**
     * {@inheritDoc}
     */
    public function current()
    {
        $this->initializeElements();

        return parent::current();
    }

    /**
     * {@inheritDoc}
     */
    public function remove($key)
    {
        $this->initializeElements();

        return parent::remove($key);
    }

    /**
     * {@inheritDoc}
     */
    public function removeElement($element)
    {
        $this->initializeElements();

        return parent::removeElement($element);
    }

    /**
     * {@inheritDoc}
     */
    public function containsKey($key)
    {
        $this->initializeElements();

        return parent::containsKey($key);
    }

    /**
     * {@inheritDoc}
     */
    public function contains($element)
    {
        $this->initializeElements();

        return parent::contains($element);
    }

    /**
     * {@inheritDoc}
     */
    public function exists(\Closure $p)
    {
        $this->initializeElements();

        return parent::exists($p);
    }

    /**
     * {@inheritDoc}
     */
    public function indexOf($element)
    {
        $this->initializeElements();

        return parent::indexOf($element);
    }

    /**
     * {@inheritDoc}
     */
    public function get($key)
    {
        $this->initializeElements();

        return parent::get($key);
    }

    /**
     * {@inheritDoc}
     */
    public function getKeys()
    {
        $this->initializeElements();

        return parent::getKeys();
    }

    /**
     * {@inheritDoc}
     */
    public function getValues()
    {
        $this->initializeElements();

        return parent::getValues();
    }

    /**
     * {@inheritDoc}
     */
    public function count()
    {
        $this->initializeElements();

        return parent::count();
    }

    /**
     * {@inheritDoc}
     */
    public function set($key, $value)
    {
        $this->initializeElements();

        parent::set($key, $value);
    }

    /**
     * {@inheritDoc}
     */
    public function add($element)
    {
        $this->initializeElements();

        return parent::add($element);
    }

    /**
     * {@inheritDoc}
     */
    public function isEmpty()
    {
        $this->initializeElements();

        return parent::isEmpty();
    }

    /**
     * Required by interface IteratorAggregate.
     *
     * {@inheritDoc}
     */
    public function getIterator()
    {
        $this->initializeElements();

        return parent::getIterator();
    }

    /**
     * {@inheritDoc}
     */
    public function map(\Closure $func)
    {
        $this->initializeElements();

        return parent::map($func);
    }

    /**
     * {@inheritDoc}
     */
    public function filter(\Closure $p)
    {
        $this->initializeElements();

        return parent::filter($p);
    }

    /**
     * {@inheritDoc}
     */
    public function forAll(\Closure $p)
    {
        $this->initializeElements();

        return parent::forAll($p);
    }

    /**
     * {@inheritDoc}
     */
    public function partition(\Closure $p)
    {
        $this->initializeElements();

        return parent::partition($p);
    }

    /**
     * {@inheritDoc}
     */
    public function slice($offset, $length = null)
    {
        $this->initializeElements();

        return parent::slice($offset, $length);
    }

    /**
     * {@inheritDoc}
     */
    public function matching(Criteria $criteria)
    {
        $this->initializeElements();

        return parent::matching($criteria);
    }
}


text:
from __future__ import absolute_import
import unittest
import os

from mciutil.cli.common import get_config_filename

class CliCommonTests(unittest.TestCase):
    def test_get_config_filename(self):
        """
        check that package default config exists, otherwise fail
        this will show up on remote build when package is installed
        rather than pointing to development environment
        """
        filename = get_config_filename('mideu.yml')
        self.assertTrue(os.path.exists(filename))

        print("config filename={0}".format(filename))
        if not os.path.isdir(".git"):
            print("Checking that config from site-packages")
            self.assertNotEqual(filename.find("site-packages"), -1)

if __name__ == '__main__':
    unittest.main()


text:
package com.personlife.adapter;

import java.util.List;

import com.example.personlifep.R;
import com.personlife.bean.Star;
import com.personlife.utils.ImageLoaderUtils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

/**
 *
 * @author liugang
 * @date 2015年8月13日
 */
public class StarRecomAdapter extends BaseAdapter {

	private LayoutInflater inflater;
	private List<Star> liststar;

	public StarRecomAdapter(Context ctx, List<Star> list) {
		super();
		inflater = LayoutInflater.from(ctx);
		this.liststar = list;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		if (null != liststar) {
			return liststar.size();
		} else
			return 0;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return liststar.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder viewHolder;
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.layout_grid_star, null);
			viewHolder = new ViewHolder();
			viewHolder.starpict = (ImageView) convertView
					.findViewById(R.id.iv_grid_staricon);
			viewHolder.starname = (TextView) convertView
					.findViewById(R.id.tv_grid_starname);
			viewHolder.counts = (TextView) convertView
					.findViewById(R.id.tv_grid_counts);
			convertView.setTag(viewHolder);
		} else {
			viewHolder = (ViewHolder) convertView.getTag();
		}
		viewHolder.starname.setText(liststar.get(position).getNickname());
		viewHolder.counts.setText(liststar.get(position).getShared());
		ImageLoaderUtils.displayImageView(liststar.get(position).getThumb(),
				viewHolder.starpict);
		return convertView;
	}

	class ViewHolder {
		public ImageView starpict;
		public TextView starname;
		public TextView counts;
	}
}


text:
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Ensuring that mutation event with text modification on a textarea doesn't crash");

span = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
document.implementation.createDocument("", "", null).adoptNode(span);

textarea = document.createElementNS("http://www.w3.org/1999/xhtml", "textarea");
textarea.textContent = "Value";
textarea.addEventListener("DOMCharacterDataModified", function (evt) { console.log(evt.target); textarea.textContent = ""; }, false);
document.body.appendChild(textarea);

text = document.createTextNode("Hello?");
textarea.appendChild(text);
span.appendChild(text);

testPassed("unless crash.")
</script>
</body>


text:
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RESET=$(tput sgr0)
#END UI COLORS

#Network Interface Config
INTERFACE='en0' #run ifconfig and look for the interface with a status marked 'active'
#End Config

response=`netstat -ib | grep $INTERFACE`
in=$((`echo $response | cut -f7 -d ' '`)) #divided by number of bytes per megabyte
out=$((`echo $response | cut -f10 -d ' '`))
sleep 1
response=`netstat -ib | grep $INTERFACE`
in2=$((`echo $response | cut -f7 -d ' '`)) #divided by number of bytes per megabyte
out2=$((`echo $response | cut -f10 -d ' '`))
inMB=$(($in / 1048576))
outMB=$(($out / 1048576))
echo "TX:$RED$outMB$RESET MBs  RX:$GREEN$inMB$RESET MBs"
diffIn=$((($in2 - $in) / 1024))
diffOut=$((($out2 - $out) / 1024))
echo "TX:$RED$diffOut$RESET KBs/s  RX:$GREEN$diffIn$RESET KBs/s"


text:
package parser.strategy.LR.structure.table.cell;

/**
 * Cell for accepting cell
 */

public class LRAcceptCell extends LRReduceCell {}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Package org.apache.hadoop.hbase.regionserver (HBase 0.94.8 API)
</TITLE>

<META NAME="date" CONTENT="2013-05-22">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
org.apache.hadoop.hbase.regionserver

Packages that use org.apache.hadoop.hbase.regionserver

org.apache.hadoop.hbase

org.apache.hadoop.hbase.backup

org.apache.hadoop.hbase.coprocessor
Table of Contents

org.apache.hadoop.hbase.coprocessor.example

org.apache.hadoop.hbase.io

org.apache.hadoop.hbase.ipc
Tools to help define network clients and servers.

org.apache.hadoop.hbase.master

org.apache.hadoop.hbase.regionserver

org.apache.hadoop.hbase.regionserver.compactions

org.apache.hadoop.hbase.regionserver.handler

org.apache.hadoop.hbase.regionserver.metrics

org.apache.hadoop.hbase.regionserver.snapshot

org.apache.hadoop.hbase.replication.regionserver

org.apache.hadoop.hbase.tmpl.regionserver

org.apache.hadoop.hbase.util

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

StoreFile.BloomType

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.backup

HRegion

          HRegion stores data for a certain region of a table.

StoreFile

          A Store data file.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.coprocessor

HRegion

          HRegion stores data for a certain region of a table.

InternalScanner

          Internal scanners differ from client-side scanners in that they operate on
 HStoreKeys and byte[] instead of RowResults.

KeyValueScanner

          Scanner that returns the next KeyValue.

MiniBatchOperationInProgress

          Wraps together the mutations which are applied as a batch to the region and their operation
 status and WALEdits.

RegionScanner

          RegionScanner describes iterators over rows in an HRegion.

RegionServerServices

          Services provided by HRegionServer

ScanType

          Enum to distinguish general scan types.

Store

          A Store holds a column family in a Region.

StoreFile

          A Store data file.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.coprocessor.example

InternalScanner

          Internal scanners differ from client-side scanners in that they operate on
 HStoreKeys and byte[] instead of RowResults.

KeyValueScanner

          Scanner that returns the next KeyValue.

ScanType

          Enum to distinguish general scan types.

Store

          A Store holds a column family in a Region.

Store.ScanInfo

          Immutable information for scans over a store.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.io

StoreFile.Reader

          Reader for a StoreFile.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.ipc

RegionOpeningState

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.master

RegionOpeningState

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.regionserver

ChangedReadersObserver

          If set of MapFile.Readers in Store change, implementors are notified.

ColumnCount

          Simple wrapper for a byte buffer and a counter.

ColumnTracker

          Implementing classes of this interface will be used for the tracking
 and enforcement of columns and numbers of versions and timeToLive during
 the course of a Get or Scan operation.

CompactionRequestor

CompactSplitThread

          Compact region on request and then run split if appropriate

ConstantSizeRegionSplitPolicy

          A RegionSplitPolicy implementation which splits a region
 as soon as any of its store files exceeds a maximum configurable
 size.

DeleteTracker

          This interface is used for the tracking and enforcement of Deletes
 during the course of a Get or Scan operation.

DeleteTracker.DeleteCompare

          Return codes for comparison of two Deletes.

DeleteTracker.DeleteResult

          Returns codes for delete result.

FlushRequester

          Request a flush.

HRegion

          HRegion stores data for a certain region of a table.

HRegion.BulkLoadListener

          Listener class to enable callers of
 bulkLoadHFile() to perform any necessary
 pre/post processing of a given bulkload call

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

IncreasingToUpperBoundRegionSplitPolicy

          Split size is the number of regions that are on this server that all are
 of the same table, squared, times the region flush size OR the maximum
 region split size, whichever is smaller.

InternalScanner

          Internal scanners differ from client-side scanners in that they operate on
 HStoreKeys and byte[] instead of RowResults.

KeyValueScanner

          Scanner that returns the next KeyValue.

LeaseException

          Reports a problem with a lease

LeaseListener

          LeaseListener is an interface meant to be implemented by users of the Leases
 class.

Leases

          Leases

 There are several server classes in HBase that need to track external
 clients that occasionally send heartbeats.

Leases.LeaseStillHeldException

          Thrown if we are asked create a lease but lease on passed name already
 exists.

LruHashMap.Entry

          Entry to store key/value mappings.

MemStore

          The MemStore holds in-memory modifications to the Store.

MemStoreLAB.Allocation

          The result of a single allocation.

MiniBatchOperationInProgress

          Wraps together the mutations which are applied as a batch to the region and their operation
 status and WALEdits.

MultiVersionConsistencyControl

          Manages the read/write consistency within memstore.

MultiVersionConsistencyControl.WriteEntry

MXBean

          This is the JMX management interface for HBase Region Server information

MXBeanImpl

          Impl for exposing Region Server Information through JMX

NonLazyKeyValueScanner

          A "non-lazy" scanner which always does a real seek operation.

OperationStatus

          This class stores the Operation status code and the exception message
 that occurs in case of failure of operations like put, delete, etc.

RegionAlreadyInTransitionException

          This exception is thrown when a region server is asked to open or close
 a region but it's already processing it

RegionCoprocessorHost

          Implements the coprocessor environment and runtime support for coprocessors
 loaded within a HRegion.

RegionOpeningState

RegionScanner

          RegionScanner describes iterators over rows in an HRegion.

RegionServerAccounting

          RegionServerAccounting keeps record of some basic real time information about
 the Region Server.

RegionServerCoprocessorHost

RegionServerServices

          Services provided by HRegionServer

RegionSplitPolicy

          A split policy determines when a region should be split.

ReplicationService

          Gateway to Cluster Replication.

ScanQueryMatcher

          A query matcher that is specifically designed for the scan case.

ScanQueryMatcher.MatchCode

          ScanQueryMatcher.match(org.apache.hadoop.hbase.KeyValue) return codes.

ScanType

          Enum to distinguish general scan types.

SplitLogWorker.TaskExecutor

          Objects implementing this interface actually do the task that has been
 acquired by a SplitLogWorker.

SplitLogWorker.TaskExecutor.Status

Store

          A Store holds a column family in a Region.

Store.ScanInfo

          Immutable information for scans over a store.

StoreFile

          A Store data file.

StoreFile.BloomType

StoreFile.Reader

          Reader for a StoreFile.

StoreFile.Writer

          A StoreFile writer.

StoreFile.WriterBuilder

StoreFileScanner

          KeyValueScanner adaptor over the Reader.

TimeRangeTracker

          Stores the minimum and maximum timestamp values (both are inclusive).

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.regionserver.compactions

HRegion

          HRegion stores data for a certain region of a table.

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

Store

          A Store holds a column family in a Region.

StoreFile

          A Store data file.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.regionserver.handler

RegionServerServices

          Services provided by HRegionServer

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.regionserver.metrics

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.regionserver.snapshot

HRegion

          HRegion stores data for a certain region of a table.

RegionServerServices

          Services provided by HRegionServer

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.replication.regionserver

ReplicationService

          Gateway to Cluster Replication.

ReplicationSinkService

          A sink for a replication stream has to expose this service.

ReplicationSourceService

          A source for a replication stream has to expose this service.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.tmpl.regionserver

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

Classes in org.apache.hadoop.hbase.regionserver used by org.apache.hadoop.hbase.util

HRegion

          HRegion stores data for a certain region of a table.

HRegionServer

          HRegionServer makes a set of HRegions available to clients.

KeyValueScanner

          Scanner that returns the next KeyValue.

NonLazyKeyValueScanner

          A "non-lazy" scanner which always does a real seek operation.

StoreFile.BloomType

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2013 The Apache Software Foundation. All Rights Reserved.


text:
package main

import (
	"bytes"
	"encoding/json"
	"encoding/xml"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net/http"
	"net/textproto"
	"os"
	"strings"
	"sync"
	"time"

	"golang.org/x/oauth2"
	"golang.org/x/oauth2/google"
	//"net/http/httputil"
	"context"

	"github.com/scritch007/go-simplejson"
)

var oauthCfg = &oauth2.Config{
	//TODO: put your project's Client ID here.  To be got from https://code.google.com/apis/console
	ClientID: "106373453700-1rbn7j3e4ddvs68lmv7346evp3uif6i9.apps.googleusercontent.com",

	//TODO: put your project's Client Secret value here https://code.google.com/apis/console
	ClientSecret: "1xb5Q4FWDTMxoHBovwPXfWzm",

	Endpoint: google.Endpoint,

	//To return your oauth2 code, Google will redirect the browser to this page that you have defined
	//TODO: This exact URL should also be added in your Google API console for this project within "API Access"->"Redirect URIs"
	RedirectURL: "urn:ietf:wg:oauth:2.0:oob",

	//This is the 'scope' of the data that you are asking the user's permission to access. For getting user's info, this is the url that Google has defined.
	Scopes: []string{
		"https://www.googleapis.com/auth/userinfo.profile",
		"https://picasaweb.google.com/data/",
	},
}

const albumFeedURL = "https://picasaweb.google.com/data/feed/api/user/default"

// PicasaSyncPlugin structure
type PicasaSyncPlugin struct {
	initializationDone bool
	resp               *picasaMainResponse
	lock               sync.Mutex
	AuthStruct         oauth2.Token
}

func init() {
	registerPlugin(syncPluginRegistration{
		Name:      "picasa",
		NewMethod: NewPicasaSyncPlugin,
	})
}

// NewPicasaSyncPlugin instantiate pluging
func NewPicasaSyncPlugin(config string) (SyncPlugin, error) {

	if 0 == len(config) {
		//Now ask the user to go to the correct place
		fmt.Print("Please got to the following url ", oauthCfg.AuthCodeURL("state"), "\n")
		fmt.Print("Enter the code displayed on the website:\n")
		var code string
		_, _ = fmt.Scanln(&code)
		fmt.Print("You just entered ", code)
		tok, err := oauthCfg.Exchange(context.Background(), code)

		if err != nil {
			return nil, errors.New("Couldn't get credentials" + err.Error())
		}
		tmp, _ := json.Marshal(PicasaSyncPlugin{AuthStruct: *tok})
		config = string(tmp)
	}

	token, err := simplejson.NewJson([]byte(config))
	if nil != err {
		return nil, err
	}
	p := new(PicasaSyncPlugin)

	fmt.Println(token.Get("AuthStruct").Get("access_token").MustString())
	p.AuthStruct.AccessToken = token.Get("AuthStruct").Get("access_token").MustString()
	p.AuthStruct.RefreshToken = token.Get("AuthStruct").Get("refresh_token").MustString()
	p.AuthStruct.TokenType = token.Get("AuthStruct").Get("token_type").MustString()
	//Force refresh token now
	p.AuthStruct.Expiry = time.Now()
	p.initializationDone = false

	return p, nil
}

// Name ...
func (p *PicasaSyncPlugin) Name() string {
	return "Picasa"
}

// Lock ...
func (p *PicasaSyncPlugin) Lock() {
	DEBUG.Println("Locking")
	p.lock.Lock()
}

// Unlock ...
func (p *PicasaSyncPlugin) Unlock() {
	p.lock.Unlock()
	DEBUG.Println("Unlocked")
}

func (p *PicasaSyncPlugin) browseAlbum(url string) (*picasaMainResponse, error) {
	client := oauthCfg.Client(context.Background(), &p.AuthStruct)
	resp, err := client.Get(url)
	DEBUG.Printf("Accessing this URL %s\n", url)
	if err != nil {
		return nil, err
	}
	buf, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	DEBUG.Printf("Received %s\n", buf)
	return picasaParse(buf)
}

// BrowseFolder ...
func (p *PicasaSyncPlugin) BrowseFolder(f string) ([]SyncResourceInfo, error) {
	var parsedResp *picasaMainResponse
	var url string
	p.Lock()
	if !p.initializationDone {
		var err error
		url = albumFeedURL + "?alt=json&imgmax=d"
		parsedResp, err = p.browseAlbum(url)
		if err != nil {
			return nil, err
		}
		p.resp = parsedResp
	}
	p.Unlock()

	if f == "" {
		return make([]SyncResourceInfo, 0), nil
	}
	//Now we're browsing a folder
	albumName := p.buildFolderName(f)
	album := p.getFolder(albumName)
	if nil == album {
		return make([]SyncResourceInfo, 0), nil
	}

	url = albumFeedURL + "/albumid/" + album.ID.Value + "?alt=json&kind=photo&imgmax=d"
	parsedResp, err := p.browseAlbum(url)
	if err != nil {
		return nil, nil
	}

	resultSize := len(parsedResp.Feed.Entries)
	if "/" == f {
		//Special case we need to return both the images and the albums
		resultSize += len(p.resp.Feed.Entries)
	}

	var result = make([]SyncResourceInfo, resultSize)

	for i, album := range parsedResp.Feed.Entries {
		name := album.Title.Value
		result[i] = SyncResourceInfo{Name: name, Path: album.ID.Value, Parent: f}
		if album.Category[0].Term == "http://schemas.google.com/photos/2007#photo" {
			result[i].IsDir = false
			result[i].ExtraInfo = album.Media.Content[0].URL
			INFO.Printf("YESS!!! %s => %s\n", name, result[i].ExtraInfo)
		} else {
			result[i].IsDir = true
		}
	}
	if "/" == f {
		for i, album := range p.resp.Feed.Entries {
			name := album.Title.Value
			result[i+len(parsedResp.Feed.Entries)] = SyncResourceInfo{Name: name, Path: album.ID.Value, Parent: f, IsDir: true}
		}
	}
	INFO.Printf("%v", result)
	return result, nil

}

// RemoveResource ...
func (p *PicasaSyncPlugin) RemoveResource(r SyncResourceInfo) error {
	return errors.New("Not available")
}

func downloadFromURL(url, path string) error {
	INFO.Println("Downloading", url, "to", path)

	// TODO: check file existence first with io.IsExist
	output, err := os.Create(path)
	if err != nil {
		ERROR.Println("Error while creating", path, "-", err)
		return err
	}
	defer output.Close()

	response, err := http.Get(url)
	if err != nil {
		ERROR.Println("Error while downloading", url, "-", err)
		return err
	}
	defer response.Body.Close()

	n, err := io.Copy(output, response.Body)
	if err != nil {
		ERROR.Println("Error while downloading", url, "-", err)
		return err
	}

	DEBUG.Println(n, "bytes downloaded.")
	return nil
}

// DownloadResource ...
func (p *PicasaSyncPlugin) DownloadResource(r *SyncResourceInfo) error {
	INFO.Printf("Now downloading %s", r)
	return downloadFromURL(r.ExtraInfo, r.Path)
}

type category struct {
	XMLName xml.Name `xml:"category"`
	Scheme  string   `xml:"scheme,attr"`
	Term    string   `xml:"term,attr"`
}

type xmlAlbum struct {
	XMLName     xml.Name `xml:"entry"`
	Xmlns       string   `xml:"xmlns,attr"`
	XmlnsMedia  string   `xml:"xmlns:media,attr"`
	XmlnsGPhoto string   `xml:"xmlns:gphoto,attr"`
	Title       string   `xml:"title"`
	Category    category `xml:"category"`
	Access      string   `xml:"access"`
	Summary     string   `xml:"summary"`
	Comment     string   `xml:",comment"`
}

type xmlPhoto struct {
	XMLName  xml.Name `xml:"entry"`
	Xmlns    string   `xml:"xmlns,attr"`
	Title    string   `xml:"title"`
	Category category `xml:"category"`
	Summary  string   `xml:"summary"`
	Comment  string   `xml:",comment"`
}

func (p *PicasaSyncPlugin) createAlbum(albumName string) error {
	var album xmlAlbum
	album.Xmlns = "http://www.w3.org/2005/Atom"
	album.XmlnsMedia = "http://search.yahoo.com/mrss/"
	album.XmlnsGPhoto = "http://schemas.google.com/photos/2007"
	album.Category.Term = "http://schemas.google.com/photos/2007#album"
	album.Category.Scheme = "http://schemas.google.com/g/2005#kind"
	album.Access = "private"
	album.Title = albumName
	output, _ := xml.MarshalIndent(&album, "  ", "    ")
	//TODO Make the call to the Google API...

	client := oauthCfg.Client(context.Background(), &p.AuthStruct)
	resp, err := client.Post("https://picasaweb.google.com/data/feed/api/user/default?alt=json", "application/atom+xml", bytes.NewReader(output))
	if nil != err {
		ERROR.Println("Failed to create folder with error ", err)
		buf, _ := ioutil.ReadAll(resp.Body)
		ERROR.Println("Got this ", string(buf))
	} else {
		buf, _ := ioutil.ReadAll(resp.Body)
		DEBUG.Println("Got this ", string(buf))
	}
	return nil
}

func (p *PicasaSyncPlugin) uploadPhoto(inAlbum *picasaEntry, r *SyncResourceInfo) error {
	bodyBuf := bytes.NewBufferString("")
	bodyWriter := multipart.NewWriter(bodyBuf)

	boundary := bodyWriter.Boundary()

	/* Create a completely custom Form Part (or in this case, a file) */
	// http://golang.org/src/pkg/mime/multipart/writer.go?s=2274:2352#L86
	mh := make(textproto.MIMEHeader)
	mh.Set("Content-Type", "application/atom+xml")
	partWriter, err := bodyWriter.CreatePart(mh)
	//TODO create the xml content for the file
	if nil != err {
		panic(err.Error())
	}

	var photo xmlPhoto
	photo.Xmlns = "http://www.w3.org/2005/Atom"
	photo.Title = r.Name
	photo.Category.Term = "http://schemas.google.com/photos/2007#photo"
	photo.Category.Scheme = "http://schemas.google.com/g/2005#kind"
	output, _ := xml.MarshalIndent(&photo, "  ", "    ")
	io.Copy(partWriter, bytes.NewBuffer(output))

	mh2 := make(textproto.MIMEHeader)
	mh2.Set("Content-Type", r.MimeType)
	//open the file
	file, err := os.Open(r.Path)
	if err != nil {
		return errors.New("Couldn't read file from the filesystem")
	}
	defer file.Close()

	fileWriter, err := bodyWriter.CreatePart(mh2)
	if nil != err {
		panic(err.Error())
	}

	io.Copy(fileWriter, file)

	/* Close the body and send the request */
	bodyWriter.Close()

	client := oauthCfg.Client(context.Background(), &p.AuthStruct)

	requestBody, err := ioutil.ReadAll(bodyBuf)
	//DO call
	uri := albumFeedURL + "/albumid/" + inAlbum.ID.Value
	request, err := http.NewRequest("POST", uri, bytes.NewBuffer(requestBody))
	contentType := "multipart/related; boundary=\"" + boundary + "\""
	request.Header.Set("Content-Type", contentType)
	//request.Header.Set("Content-Length", len(body_buf))
	if nil != err {
		return errors.New("Failed to create new Request")
	}
	//dump, err := httputil.DumpRequest(request, false)
	//fmt.Println(string(dump))

	//resp, err := t.Client().Post(uri, content_type, body_buf)
	resp, err := client.Do(request)
	if nil != err {
		if nil != resp {
			body, _ := ioutil.ReadAll(resp.Body)
			DEBUG.Println(body)
		}
		panic(err.Error())
	}

	/* Handle the response */
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if nil != err {
		ERROR.Println("Whouch got and error but nothing printed", err, string(body))
		return err
	}
	return nil
}

// AddResource ...
func (p *PicasaSyncPlugin) AddResource(r *SyncResourceInfo) error {
	DEBUG.Printf("Adding new resource %s\n", r.Name)
	if r.IsDir {
		//We need to create the new repository
		var folderName string
		if r.Parent == "/" {
			folderName = "/" + r.Name
		} else {
			folderName = r.Parent + "/" + r.Name
		}
		albumName := p.buildFolderName(folderName)
		album := p.getFolder(albumName)
		if album != nil {
			return errors.New("This album already exist, cannot create it")
		}
		p.createAlbum(albumName)
		//Update our information now, so reset the initializationDone flag...
		p.initializationDone = false
		p.BrowseFolder("")
		return nil
	}
	albumName := p.buildFolderName(r.Parent)
	album := p.getFolder(albumName)
	if album == nil {
		return errors.New("Can't add entry " + r.Name + "the folder " + albumName + " doesn't exist")
	}
	return p.uploadPhoto(album, r)

}

func (p *PicasaSyncPlugin) buildFolderName(folder string) string {
	if folder == "/" {
		return "NOT_SORTED_REPOSITORY"
	}
	splits := strings.Split(folder, "/")
	folderName := splits[1]
	if len(splits) > 2 {
		folderName += " ("
		folderName += strings.Join(splits[2:], ", ")
		folderName += ")"
	}
	//fmt.Printf("Hey you \n############################\n%s=>\n%s\n => %s#######################\n", folder, splits, folder_name)
	return folderName
}

//Check if the album name is in our list
func (p *PicasaSyncPlugin) getFolder(albumName string) *picasaEntry {
	p.Lock()
	defer p.Unlock()
	for _, album := range p.resp.Feed.Entries {
		//fmt.Printf("\n@@@@@@@@@@@@@@@@@@@@@@\n%s vs %s\n@@@@@@@@@@@@@@@@@@@@@@@@@@\n", album.Title.Value, album_name)
		if album.Title.Value == albumName {
			return &album
		}
	}
	return nil
}

// HasFolder ...
func (p *PicasaSyncPlugin) HasFolder(folder string) bool {
	//Since Picasa doesn't handle "Sub Folder" construction, we'll use some rewriting name
	if !p.initializationDone {
		_, err := p.BrowseFolder(folder)
		if nil != err {
			ERROR.Printf("Failed to browse for initialisation with error %s\n", err.Error())
			return false
		}
	}
	folderName := p.buildFolderName(folder)
	return nil != p.getFolder(folderName)
}

// GetResourceInfo ...
func (p *PicasaSyncPlugin) GetResourceInfo(folder string) (SyncResourceInfo, error) {
	return SyncResourceInfo{}, nil
}

func (p *PicasaSyncPlugin) SyncOnlyMedia() bool {
	return true
}


text:
require_relative '../mikrotik_api'
Puppet::Type.type(:mikrotik_interface_ppp_server_binding).provide(:mikrotik_api, :parent => Puppet::Provider::Mikrotik_Api) do
  confine :feature => :mtik
  mk_resource_methods
  def self.instances
    instances = []
    ovpn = Puppet::Provider::Mikrotik_Api::get_all("/interface/ovpn-server")
    ovpn.each { |client|
      instances << pppServerBinding('ovpn', client)
    }
    instances
  end

  def self.pppServerBinding(type,data)
    if data['disabled'] == "true"
      state = :disabled
    else
      state = :enabled
    end

    new(
      :ensure   => :present,
      :state    => state,
      :name     => data['name'],
      :ppp_type => type,
      :user     => data['user'],
      :comment  => data['comment'],
    )
  end

  def flush
    Puppet.debug("Flushing PPP Server Binding #{resource[:name]}")
    params = {}
    if @property_hash[:state] == :disabled
      params["disabled"] = 'yes'
    elsif @property_hash[:state] == :enabled
      params["disabled"] = 'no'
    end

    attributes = [:name, :user, :comment]
    attributes.each do |attrib|
      params[attrib] = resource[attrib] unless resource[attrib].nil?
    end

    interface_type = "#{resource[:ppp_type]}-server"

    lookup = {"name" => resource[:name]}
    Puppet.debug("Params: #{params.inspect} - Lookup: #{lookup.inspect}")
    simple_flush("/interface/#{interface_type}", params, lookup)
  end
end


text:
import {assert} from '../platform/assert-web.js';
import {ArcInfo} from '../runtime/arc-info.js';
import {Arc} from '../runtime/arc.js';
import {Recipe} from '../runtime/recipe/lib-recipe.js';
import {Relevance} from '../runtime/relevance.js';
import {Runtime} from '../runtime/runtime.js';

export class Speculator {
  private speculativeArcs: ArcInfo[] = [];

  constructor(public readonly runtime: Runtime) {}

  async speculate(arcInfo: ArcInfo, plan: Recipe, hash: string, shouldSpeculate: boolean = true): Promise<{speculativeArc: Arc, relevance: Relevance}|null> {
    assert(plan.isResolved(), `Cannot speculate on an unresolved plan: ${plan.toString({showUnresolved: true})}`);
    const speculativeArcInfo = await this.runtime.allocator.cloneArc(arcInfo.id, {isSpeculative: true});
    this.speculativeArcs.push(speculativeArcInfo);
    const relevance = Relevance.create(arcInfo, plan);
    plan = await this.runtime.allocator.assignStorageKeys(speculativeArcInfo.id, plan);

    const {particles, handles} = await speculativeArcInfo.instantiate(plan);
    const speculativeArc = this.runtime.host.getArcById(speculativeArcInfo.id);
    await speculativeArc.instantiate(shouldSpeculate ? particles : [], handles);

    await this.awaitCompletion(relevance, speculativeArc);

    if (shouldSpeculate && !relevance.isRelevant(plan)) {
      return null;
    }

    return {speculativeArc, relevance};
  }

  private async awaitCompletion(relevance: Relevance, speculativeArc: Arc): Promise<Relevance> {
    const messageCount = speculativeArc.peh.messageCount;
    relevance.apply(await speculativeArc.peh.idle);

    // We expect two messages here, one requesting the idle status, and one answering it.
    if (speculativeArc.peh.messageCount !== messageCount + 2) {
      return this.awaitCompletion(relevance, speculativeArc);
    } else {
      this.runtime.allocator.stopArc(speculativeArc.id);
      this.speculativeArcs.splice(this.speculativeArcs.indexOf(speculativeArc.arcInfo, 1));
      return relevance;
    }
  }

  dispose(): void {
    for (const arc of this.speculativeArcs) {
      this.runtime.allocator.stopArc(arc.id);
    }
  }
}


text:
class CQuantMateFactory : public IFactory {
	// Inherited via CFactory
	virtual CScene* GetMainScene(CResourceManager& manager, int width, int height) override;
	virtual CGameController* GetMainController() override;
	virtual IGameResources* GetResources() override;
	virtual CScene* GetScene(int id, CResourceManager& manager, int width, int height) override;
	virtual CGameController* GetController(int id) override;
};


text:
This example uses [javax.websocket-api] (https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api/1.1) with the container or webserver provided implementation.

###How to run

- Execute `mvn clean install`
- Deploy generated **java-websocket-starter.war** file in any servlet container or websever of your choice
- `Start` servlet container/webserver
- Access the websocket using URL **ws://localhost:\<port>/java-websocket-starter/websocket**
- Send requests to the websocket server like for example
    - `{"type":"REGISTRATION_REQUEST"}` This will register client for broadcasts
    - `{"type":"BROADCAST_REQUEST","message":"Hello all!"} ` This will send message to all the registered clients

###Note:
To test the websocket any language or tools can be used like [this] (https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo?utm_source=chrome-ntp-icon) chrome extension