text:
require 'spec_helper'

describe BnetApi::WoW do

  before :each do
    BnetApi.configure do |config|
      config.api_key = ENV['BNET_API_KEY']
      config.api_secret = ENV['BNET_API_SECRET']
    end
  end

  it "gets a guild from the API" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution')

    expect(guild['lastModified']).not_to be_nil
    expect(guild['name']).to eq('Banana Revolution')
    expect(guild['realm']).to eq('Thunderhorn')
    expect(guild['battlegroup']).to eq('Misery')
    expect(guild['level']).to eq(25)
    expect(guild['side']).to eq(1)
    expect(guild['achievementPoints']).not_to be_nil
    expect(guild['emblem']).not_to be_nil
  end

  it "gets a guild from the API with members data" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution', :members)

    expect(guild['members']).not_to be_nil
  end

  it "gets a guild from the API with achievements data" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution', :achievements)

    expect(guild['achievements']).not_to be_nil
  end

  it "gets a guild from the API with news data" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution', :news)

    expect(guild['news']).not_to be_nil
  end

  it "gets a guild from the API with challenge data" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution', :challenge)

    expect(guild['challenge']).not_to be_nil
  end

  it "gets a guild from the API with all additional data" do
    guild = BnetApi::WoW.guild('Thunderhorn', 'Banana Revolution', :all)

    expect(guild['members']).not_to be_nil
    expect(guild['achievements']).not_to be_nil
    expect(guild['news']).not_to be_nil
    expect(guild['challenge']).not_to be_nil
  end
end


text:
;(function ($) {
  var chipsHandleEvents = false
  var materialChipsDefaults = {
    data: [],
    placeholder: '',
    secondaryPlaceholder: ''
  }

  $(document).ready(function () {
    // Handle removal of static chips.
    $(document).on('click', '.chip .close', function (e) {
      var $chips = $(this).closest('.chips')
      if ($chips.data('initialized')) {
        return
      }
      $(this).closest('.chip').remove()
    })
  })

  $.fn.material_chip = function (options) {
    var self = this
    this.$el = $(this)
    this.$document = $(document)
    this.SELS = {
      CHIPS: '.chips',
      CHIP: '.chip',
      INPUT: 'input',
      DELETE: '.fa',
      SELECTED_CHIP: '.selected'
    }

    if ('data' === options) {
      return this.$el.data('chips')
    }

    if ('options' === options) {
      return this.$el.data('options')
    }

    this.$el.data('options', $.extend({}, materialChipsDefaults, options))

    // Initialize
    this.init = function () {
      var i = 0
      var chips
      self.$el.each(function () {
        var $chips = $(this)
        if ($chips.data('initialized')) {
          // Prevent double initialization.
          return
        }
        var options = $chips.data('options')
        if (!options.data || !options.data instanceof Array) {
          options.data = []
        }
        $chips.data('chips', options.data)
        $chips.data('index', i)
        $chips.data('initialized', true)

        if (!$chips.hasClass(self.SELS.CHIPS)) {
          $chips.addClass('chips')
        }

        self.chips($chips)
        i++
      })
    }

    this.handleEvents = function () {
      var SELS = self.SELS

      self.$document.on('click', SELS.CHIPS, function (e) {
        $(e.target).find(SELS.INPUT).focus()
      })

      self.$document.on('click', SELS.CHIP, function (e) {
        $(SELS.CHIP).removeClass('selected')
        $(this).toggleClass('selected')
      })

      self.$document.on('keydown', function (e) {
        if ($(e.target).is('input, textarea')) {
          return
        }

        // delete
        var $chip = self.$document.find(SELS.CHIP + SELS.SELECTED_CHIP)
        var $chips = $chip.closest(SELS.CHIPS)
        var length = $chip.siblings(SELS.CHIP).length
        var index

        if (!$chip.length) {
          return
        }

        if (e.which === 8 || e.which === 46) {
          e.preventDefault()
          var chipsIndex = $chips.data('index')

          index = $chip.index()
          self.deleteChip(chipsIndex, index, $chips)

          var selectIndex = null
          if ((index + 1) < length) {
            selectIndex = index
          } else if (index === length || (index + 1) === length) {
            selectIndex = length - 1
          }

          if (selectIndex < 0) selectIndex = null

          if (null !== selectIndex) {
            self.selectChip(chipsIndex, selectIndex, $chips)
          }
          if (!length) $chips.find('input').focus()

        // left
        } else if (e.which === 37) {
          index = $chip.index() - 1
          if (index < 0) {
            return
          }
          $(SELS.CHIP).removeClass('selected')
          self.selectChip($chips.data('index'), index, $chips)

        // right
        } else if (e.which === 39) {
          index = $chip.index() + 1
          $(SELS.CHIP).removeClass('selected')
          if (index > length) {
            $chips.find('input').focus()
            return
          }
          self.selectChip($chips.data('index'), index, $chips)
        }
      })

      self.$document.on('focusin', SELS.CHIPS + ' ' + SELS.INPUT, function (e) {
        $(e.target).closest(SELS.CHIPS).addClass('focus')
        $(SELS.CHIP).removeClass('selected')
      })

      self.$document.on('focusout', SELS.CHIPS + ' ' + SELS.INPUT, function (e) {
        $(e.target).closest(SELS.CHIPS).removeClass('focus')
      })

      self.$document.on('keydown', SELS.CHIPS + ' ' + SELS.INPUT, function (e) {
        var $target = $(e.target)
        var $chips = $target.closest(SELS.CHIPS)
        var chipsIndex = $chips.data('index')
        var chipsLength = $chips.children(SELS.CHIP).length

        // enter
        if (13 === e.which) {
          e.preventDefault()
          self.addChip(chipsIndex, {
            tag: $target.val()
          }, $chips)
          $target.val('')
          return
        }

        // delete or left
        if ((8 === e.keyCode || 37 === e.keyCode) && '' === $target.val() && chipsLength) {
          self.selectChip(chipsIndex, chipsLength - 1, $chips)
          $target.blur()
          return
        }
      })

      self.$document.on('click', SELS.CHIPS + ' ' + SELS.DELETE, function (e) {
        var $target = $(e.target)
        var $chips = $target.closest(SELS.CHIPS)
        var $chip = $target.closest(SELS.CHIP)
        e.stopPropagation()
        self.deleteChip(
          $chips.data('index'),
          $chip.index(),
          $chips
        )
        $chips.find('input').focus()
      })
    }

    this.chips = function ($chips) {
      var html = ''
      var options = $chips.data('options')
      $chips.data('chips').forEach(function (elem) {
        html += self.renderChip(elem)
      })
      html += '<input class="input" placeholder="">'
      $chips.html(html)
      self.setPlaceholder($chips)
    }

    this.renderChip = function (elem) {
      if (!elem.tag) return

      var html = '
' + elem.tag
      if (elem.image) {
        html += '  '
      }
      html += ''
      html += '
'
      return html
    }

    this.setPlaceholder = function ($chips) {
      var options = $chips.data('options')
      if ($chips.data('chips').length && options.placeholder) {
        $chips.find('input').prop('placeholder', options.placeholder)
      } else if (!$chips.data('chips').length && options.secondaryPlaceholder) {
        $chips.find('input').prop('placeholder', options.secondaryPlaceholder)
      }
    }

    this.isValid = function ($chips, elem) {
      var chips = $chips.data('chips')
      var exists = false
      for (var i = 0; i < chips.length; i++) {
        if (chips[i].tag === elem.tag) {
          exists = true
          return
        }
      }
      return '' !== elem.tag && !exists
    }

    this.addChip = function (chipsIndex, elem, $chips) {
      if (!self.isValid($chips, elem)) {
        return
      }
      var options = $chips.data('options')
      var chipHtml = self.renderChip(elem)
      $chips.data('chips').push(elem)
      $(chipHtml).insertBefore($chips.find('input'))
      $chips.trigger('chip.add', elem)
      self.setPlaceholder($chips)
    }

    this.deleteChip = function (chipsIndex, chipIndex, $chips) {
      var chip = $chips.data('chips')[chipIndex]
      $chips.find('.chip').eq(chipIndex).remove()
      $chips.data('chips').splice(chipIndex, 1)
      $chips.trigger('chip.delete', chip)
      self.setPlaceholder($chips)
    }

    this.selectChip = function (chipsIndex, chipIndex, $chips) {
      var $chip = $chips.find('.chip').eq(chipIndex)
      if ($chip && false === $chip.hasClass('selected')) {
        $chip.addClass('selected')
        $chips.trigger('chip.select', $chips.data('chips')[chipIndex])
      }
    }

    this.getChipsElement = function (index, $chips) {
      return $chips.eq(index)
    }

    // init
    this.init()

    if (!chipsHandleEvents) {
      this.handleEvents()
      chipsHandleEvents = true
    }
  }
}(jQuery))

redpajama_set_name: RedPajamaGithub


text:
title: MIT App Inventor Control Blocks
layout: documentation
---

* [if & else if](#if)
* [for each number from to](#forrange)
* [for each item in list](#foreach)
* [while](#while)
* [if then else](#choose)
* [do with result](#doreturn)
* [evaluate but ignore result](#evaluate)
* [open another screen](#openscreen)
* [open another screen with start value](#openscreenwithvalue)
* [get plain start text](#getplainstarttext)
* [get start value](#getstartvalue)
* [close screen](#closescreen)
* [close screen with plain text](#closescreenwithplaintext)
* [close screen with value](#closescreenwithvalue)
* [close application](#closeapp)
* [break](#break)

### if & else if   {#if}

{:.clearfix}
![](images/control/if.png){:style="float:left;clear:left;border:0"} Tests a given condition. If the condition is true, performs the actions in a given sequence of blocks; otherwise, the blocks are ignored.

{:.clearfix}
![](images/control/ifelse.png){:style="float:left;clear:left;border:0"} Tests a given condition. If the condition is true, performs the actions in the -then sequence of blocks; otherwise, performs the actions in the -else equence of blocks.

{:.clearfix}
![](images/control/ifelseif.png){:style="float:left;clear:left;border:0"} Tests a given condition. If the result is true, performs the actions in the -then sequence of blocks; otherwise tests the statement in the -else if section. If the result is true, performs the actions in the -then sequence of blocks; otherwise, performs the actions in the -else sequence of blocks.

The animation below shows how to use the if else mutator block.

![](images/control/if.gif)

### for each number from to   {#forrange}

![](images/control/forrange.png)

Runs the blocks in the do section for each numeric value in the range starting from *from* and ending at *to*, incrementing `number`{:.variable.block} by the value of *by* each time. Use the given variable name, `number`{:.variable.block}, to refer to the current value. You can change the name `number`{:.variable.block} to something else if you wish.

### for each item in list   {#foreach}

![](images/control/foreach.png)

Runs the blocks in the do section for each item in the list. Use the given variable name, `item`{:.variable.block}, to refer to the current list item. You can change the name `item`{:.variable.block} to something else if you wish.

### while   {#while}

![](images/control/while.png)

Tests the -test condition. If true, performs the action given in -do , then tests again. When test is false, the block ends and the action given in -do is no longer performed.

### if then else   {#choose}

Tests a given condition. If the statement is true, performs the actions in the then-return sequence of blocks and returns the then-return value; otherwise, performs the actions in the else-return sequence of blocks and returns the else-return value. This block is similar to the ternary operator (?:) found in some languages.

### do with result   {#doreturn}

![](images/control/doreturn.png)

Sometimes in a procedure or another block of code, you may need to do something and return something, but for various reasons you may choose to use this block instead of creating a new procedure.

### evaluate but ignore result   {#evaluate}

![](images/control/evaluate.png)

Provides a "dummy socket" for fitting a block that has a plug on its left into a place where there is no socket, such as one of the sequence of blocks in the do part of a procedure or an if block. The block you fit in will be run, but its returned result will be ignored. This can be useful if you define a procedure that returns a result, but want to call it in a context that does not accept a result.

### open another screen   {#openscreen}

![](images/control/openscreen.png)

Opens the screen with the provided name.

The screenName must be one of the Screens created using the Designer. The screenName should be entered into a Text component and typed exactly as named in the Designer. (Case is important, if the designed screen name is myNewScreen, what you use in the puzzle piece cannot be mynewscreen or MyNewScreen for example.)

If you do open another screen, you should close it when returning to your main screen to free system memory. Failure to close a screen upon leaving it will eventually lead to memory problems.

App developers should never close Screen1 or use this block to return to Screen1. Use the `close screen`{:.control.block} block instead.

### open another screen with start value   {#openscreenwithvalue}

![](images/control/openscreenwithvalue.png)

Opens another screen and passes a value to it.

### get plain start text   {#getplainstarttext}

![](images/control/getplainstarttext.png)

Returns the plain text that was passed to this screen when it was started by another app. If no value was passed, it returns the empty text. For multiple screen apps, use `get start value`{:.control.block} rather than `get plain start text`{:.control.block}.

### get start value   {#getstartvalue}

![](images/control/getstartvalue.png)

Returns the start value given to the current screen.

This value is given from using `open another screen with start value`{:.control.block} or `close screen with value`{:.control.block}.

### close screen   {#closescreen}

![](images/control/closescreen.png)

Closes the current screen.

### close screen with plain text   {#closescreenwithplaintext}

![](images/control/closescreenwithplaintext.png)

Closes the current screen and passes text to the app that opened this one. This command is for returning text to non-App Inventor activities, not to App Inventor screens. For App Inventor Screens, as in multiple screen apps, use `close screen with value`{:.control.block}, not `close screen with plain text`{:.control.block}.

### close screen with value   {#closescreenwithvalue}

![](images/control/closescreenwithvalue.png)

Closes the current screen and returns a value to the screen that opened this one.

### close application   {#closeapp}

![](images/control/closeapp.png)

Closes the application.

### break   {#break}

![](images/control/break.png)

When looping using the [for range](#forrange), [for each](#foreach), or [while](#while) blocks it is sometimes useful to be able to exit the loop early. The `break`{:.control.block} allows you to escape the loop. When executed, this will exit the loop and continue the app with the statements that occur after the loop in the blocks.


text:
<?php namespace Xuma\Amaran;
use Exception;
use Illuminate\Session\Store;
class AmaranHandler{

    /**
     * Default values of AmaranJS array
     * @var array
     */
    protected $amaran=['theme'=>'default','sticky'=>false];

    /**
     * jQuery event creator
     * @var array
     */
    public $click=[];

    /**
     * Content must be filled with AmaranJS theme values.
     * Check documentation for AmaranJS themes.
     * @var array
     */
    public $content=[];

    /**
     * @var ViewBinder
     */
    protected $viewBinder;

    protected $session;

    protected $flash = false;
    /**
     * @param ViewBinder $viewBinder
     */
    public function __construct(ViewBinder $viewBinder,Store $session)
    {
        $this->viewBinder = $viewBinder;

        $this->session = $session;
    }

    /**
     * Bind AmaranJS to view.
     */
    public function create()
    {
        $script = "<script>\n\t$(function(){ \n\t\t";

        if($this->click)
        {
            $script.="\t$('".$this->click[0]."').on('".$this->click[1]."',function(){ \n\t\t\t\t $.amaran(". json_encode($this->amaran).") \n\t\t\t}); \n\t\t});\n\t</script>\n";
        }
        else
        {
            $script.="$.amaran(".json_encode($this->amaran)."); \n\t });\n</script>\n";
        }

        if($this->flash)
        {
            $this->session->flash('amaranjs.content',$script);
        }
        else
        {
           $this->viewBinder->bind($script);
        }

    }

    /**
     * @param string $theme
     * @return $this
     */
    public function theme($theme='default')
    {
        $this->amaran['theme']=$theme;
        return $this;
    }

    /**
     * AmaranJS notification position
     * @param string $position
     * @return $this
     */
    public function position($position='bottom right')
    {
        $this->amaran['position']=$position;
        return $this;
    }

    /**
     * AmaranJS content for notification
     * @param string $content
     * @return $this
     */
    public function content($content)
    {
        $this->amaran['content']=$content;
        return $this;
    }

    /**
     * AmaranJS appear effect
     * @param string $ineffect
     * @return $this
     */
    public function inEffect($ineffect)
    {
        $this->amaran['inEffect'] = $ineffect;
        return $this;
    }

    /**
     * AmaranJS make notification sticky
     * @return $this
     */
    public function sticky()
    {
        $this->amaran['sticky'] = true;
        return $this;
    }

    /**
     * AmaranJS dissapper effect
     * @param $outEffect
     * @return $this
     */
    public function outEffect($outEffect)
    {
        $this->amaran['outEffect'] = $outEffect;
        return $this;
    }

    public function flash()
    {
        $this->flash = true;
        return $this;
    }

    /**
     * @param bool $element
     * @param string $on
     * @return $this
     * @throws Exception
     */
    public function bind($element=false,$on='click')
    {
        if(!$element) throw new Exception("AmaranJS throwed this exception with \"Please set onClick element.( eq ->bind('#example'))\"", 1);
        $this->click = [$element,$on];
        return $this;
    }
}


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>
	<parent>
		<groupId>fr.sii.ogham</groupId>
		<artifactId>ogham-parent</artifactId>
		<version>3.1.0-SNAPSHOT</version>
	</parent>

	<artifactId>ogham-email-sendgrid-v4</artifactId>
	<name>Ogham SendGrid v4 implementation</name>
	<description>
		SendGrid v4 implementation for Ogham
	</description>

	<properties>
		<sendgrid-java.version>${sendgrid-java-v4.version}</sendgrid-java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>fr.sii.ogham</groupId>
			<artifactId>ogham-email-sendgrid-common</artifactId>
		</dependency>

		<!-- Tests -->
		<dependency>
			<groupId>fr.sii.ogham</groupId>
			<artifactId>ogham-test-utils</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>fr.sii.ogham</groupId>
			<artifactId>ogham-template-freemarker</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>fr.sii.ogham</groupId>
			<artifactId>ogham-template-thymeleaf</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- FIXME: remove this when JUnit 5 is fully supported by PIT and Spock -->
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>eu.stamp-project</groupId>
					<artifactId>pitmp-maven-plugin</artifactId>
					<dependencies>
						<dependency>
							<groupId>org.pitest</groupId>
							<artifactId>pitest-junit5-plugin</artifactId>
							<version>${pitest-junit5-plugin.version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.pitest</groupId>
					<artifactId>pitest-maven</artifactId>
					<dependencies>
						<dependency>
							<groupId>org.pitest</groupId>
							<artifactId>pitest-junit5-plugin</artifactId>
							<version>${pitest-junit5-plugin.version}</version>
						</dependency>
					</dependencies>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>


text:
url=$1
tarfile=$2
retries=5
if [[ "$url" == "" || "$tarfile" == "" ]] ; then
	echo need URL and tarfile
	exit 1
fi

if [[ -f "$tarfile" ]] ; then
	echo $tarfile exists, skipping download
	exit 0
fi

i=0
while [ $i -lt $retries ]; do
	i=$((i+1))
	rm -f $outfile
	# TODO: workaround curl segfault in getaddrinfo() handling redirect under qemu
	finalurl=$(curl -Ls -w %{url_effective} -o /dev/null $url)
	echo final URL: $finalurl
	# TODO: snort binary serving does not work with TLS 1.3
	curl -v "$finalurl" --tlsv1.2 --tls-max 1.2 --output $tarfile --trace -
	tar ztvf $tarfile
	tarstatus=$?
	if [[ -f "$tarfile" && $tarstatus -eq 0 ]] ; then
		echo downloaded $url to $tarfile to $tarfile.
		exit 0
		break
	fi
	echo retrying....
	sleep 60
done

echo failed to download $tarfile.
exit 1


text:
var util = require("../../util");
var kvn = require("../../kvn");
var logger = require("../../logger");

var formatEventData = function (eventData) {
  eventData = JSON.parse(JSON.stringify(eventData));
  delete eventData.validation_errors;
  return {
    category: kvn({ target: eventData.target }),
    action: kvn(eventData),
    label: kvn({ name: eventData.name }),
    value: eventData.value
  };
};

// http://piwik.org/docs/event-tracking/
module.exports = function (eventData) {
  var name     = "_paq";
  var logLabel = "Bighorn.track piwik _paq";
  var tracker  = self[name];

  try {
    var data = formatEventData(eventData);

    if (!util.isObject(tracker)) {
      logger.log("SKIP", logLabel, "tracker not found", eventData);
      return false;
    }
    if (!util.isFunction(tracker.push)) {
      logger.log("SKIP", logLabel, "push method not found", eventData);
      return false;
    }
    if (!util.isValidString(data.category)) {
      logger.log("SKIP", logLabel, "category not valid", eventData);
      return false;
    }
    if (!util.isValidString(data.action)) {
      logger.log("SKIP", logLabel, "action not valid", eventData);
      return false;
    }

    tracker.push(["trackEvent", data.category, data.action, data.label, data.value]);
    logger.log("SUCCESS", logLabel, eventData);
    return true;
  } catch (e) {
    logger.log("ERROR", logLabel, e.message, eventData);
    return false;
  }
};


text:
"""
Created on Sun Nov 26 22:13:56 2017

@author: Friend
"""
"""
Как реализовать сосуществование конфликтующих опциональных аргументов,
которые выполняют противоположные действия
"""
import argparse

parser = argparse.ArgumentParser(description="calculate X to the power of Y")
#Создаём группу опциональных аргументов с помощью ещё одного метода
#класса ArgumentParser. В ней возможно хранить опциональные аргументы,
#выполняющие противоположные действия
group = parser.add_mutually_exclusive_group()
#action="store_true" означает, что при указании данного опционального аргумента
#при вызове ему будет присвоено значение True.
#Если его не указать, то будет по умолчанию значение None
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="the base")
parser.add_argument("y", type=int, help="the exponent")
args = parser.parse_args()
answer = args.x**args.y

if args.quiet:
    print(answer)
elif args.verbose:
    print("{} to the power of {} equals {}".format(args.x, args.y, answer))
else:
    print("{}^{} = {}".format(args.x, args.y, answer))

"""
Для демонстрации - запустить
python Powconfl.py 5 7
python Powconfl.py 5 7 -q
python Powconfl.py 5 7 -v
python Powconfl.py 5 7-qv
python Powconfl.py 5 7 -h
"""


text:
package org.springframework.security.core.context;

import java.util.function.Supplier;

import org.springframework.context.ApplicationEvent;

/**
 * An event that represents a change in {@link SecurityContext}
 *
 * @author Josh Cummings
 * @since 5.6
 */
public class SecurityContextChangedEvent extends ApplicationEvent {

	public static final Supplier<SecurityContext> NO_CONTEXT = () -> null;

	private final Supplier<SecurityContext> oldContext;

	private final Supplier<SecurityContext> newContext;

	/**
	 * Construct an event
	 * @param oldContext the old security context
	 * @param newContext the new security context, use
	 * {@link SecurityContextChangedEvent#NO_CONTEXT} for if the context is cleared
	 * @since 5.8
	 */
	public SecurityContextChangedEvent(Supplier<SecurityContext> oldContext, Supplier<SecurityContext> newContext) {
		super(SecurityContextHolder.class);
		this.oldContext = oldContext;
		this.newContext = newContext;
	}

	/**
	 * Construct an event
	 * @param oldContext the old security context
	 * @param newContext the new security context
	 */
	public SecurityContextChangedEvent(SecurityContext oldContext, SecurityContext newContext) {
		this(() -> oldContext, (newContext != null) ? () -> newContext : NO_CONTEXT);
	}

	/**
	 * Get the {@link SecurityContext} set on the {@link SecurityContextHolder}
	 * immediately previous to this event
	 * @return the previous {@link SecurityContext}
	 */
	public SecurityContext getOldContext() {
		return this.oldContext.get();
	}

	/**
	 * Get the {@link SecurityContext} set on the {@link SecurityContextHolder} as of this
	 * event
	 * @return the current {@link SecurityContext}
	 */
	public SecurityContext getNewContext() {
		return this.newContext.get();
	}

	/**
	 * Say whether the event is a context-clearing event.
	 *
	 * <p>
	 * This method is handy for avoiding looking up the new context to confirm it is a
	 * cleared event.
	 * @return {@code true} if the new context is
	 * {@link SecurityContextChangedEvent#NO_CONTEXT}
	 * @since 5.8
	 */
	public boolean isCleared() {
		return this.newContext == NO_CONTEXT;
	}

}


text:
typedef struct evp_pkey_st EVP_PKEY;
#else
// Forward declaration.
typedef struct CERTSubjectPublicKeyInfoStr CERTSubjectPublicKeyInfo;
typedef struct PK11SlotInfoStr PK11SlotInfo;
typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey;
typedef struct SECKEYPublicKeyStr SECKEYPublicKey;
#endif

namespace crypto {

// Encapsulates an elliptic curve (EC) private key. Can be used to generate new
// keys, export keys to other formats, or to extract a public key.
// TODO(mattm): make this and RSAPrivateKey implement some PrivateKey interface.
// (The difference in types of key() and public_key() make this a little
// tricky.)
class CRYPTO_EXPORT ECPrivateKey {
 public:
  ~ECPrivateKey();

  // Creates a new random instance. Can return NULL if initialization fails.
  // The created key will use the NIST P-256 curve.
  // TODO(mattm): Add a curve parameter.
  static ECPrivateKey* Create();

  // Creates a new instance by importing an existing key pair.
  // The key pair is given as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
  // block and an X.509 SubjectPublicKeyInfo block.
  // Returns NULL if initialization fails.
  static ECPrivateKey* CreateFromEncryptedPrivateKeyInfo(
      const std::string& password,
      const std::vector<uint8_t>& encrypted_private_key_info,
      const std::vector<uint8_t>& subject_public_key_info);

#if !defined(USE_OPENSSL)
  // Imports the key pair into |slot| and returns in |public_key| and |key|.
  // Shortcut for code that needs to keep a reference directly to NSS types
  // without having to create a ECPrivateKey object and make a copy of them.
  // TODO(mattm): move this function to some NSS util file.
  static bool ImportFromEncryptedPrivateKeyInfo(
      PK11SlotInfo* slot,
      const std::string& password,
      const uint8_t* encrypted_private_key_info,
      size_t encrypted_private_key_info_len,
      CERTSubjectPublicKeyInfo* decoded_spki,
      bool permanent,
      bool sensitive,
      SECKEYPrivateKey** key,
      SECKEYPublicKey** public_key);
#endif

  // Returns a copy of the object.
  ECPrivateKey* Copy() const;

#if defined(USE_OPENSSL)
  EVP_PKEY* key() { return key_; }
#else
  SECKEYPrivateKey* key() { return key_; }
  SECKEYPublicKey* public_key() { return public_key_; }
#endif

  // Exports the private key as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
  // block and the public key as an X.509 SubjectPublicKeyInfo block.
  // The |password| and |iterations| are used as inputs to the key derivation
  // function for generating the encryption key.  PKCS #5 recommends a minimum
  // of 1000 iterations, on modern systems a larger value may be preferrable.
  bool ExportEncryptedPrivateKey(const std::string& password,
                                 int iterations,
                                 std::vector<uint8_t>* output);

  // Exports the public key to an X.509 SubjectPublicKeyInfo block.
  bool ExportPublicKey(std::vector<uint8_t>* output);

  // Exports the public key as an EC point in the uncompressed point format.
  bool ExportRawPublicKey(std::string* output);

  // Exports private key data for testing. The format of data stored into output
  // doesn't matter other than that it is consistent for the same key.
  bool ExportValueForTesting(std::vector<uint8_t>* output);

 private:
  // Constructor is private. Use one of the Create*() methods above instead.
  ECPrivateKey();

#if defined(USE_OPENSSL)
  EVP_PKEY* key_;
#else
  SECKEYPrivateKey* key_;
  SECKEYPublicKey* public_key_;
#endif

  DISALLOW_COPY_AND_ASSIGN(ECPrivateKey);
};

}  // namespace crypto

#endif  // CRYPTO_EC_PRIVATE_KEY_H_


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>pysimm.forcefield.gaff module — pysimm 0.2 documentation</title>

    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />

    <link rel="top" title="pysimm 0.2 documentation" href="index.html"/>
        <link rel="up" title="pysimm.forcefield package" href="pysimm.forcefield.html"/>
        <link rel="next" title="pysimm.forcefield.gaff2 module" href="pysimm.forcefield.gaff2.html"/>
        <link rel="prev" title="pysimm.forcefield.forcefield module" href="pysimm.forcefield.forcefield.html"/>

             pysimm

                0.2

  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

pysimm package

Subpackages

pysimm.apps package

pysimm.forcefield package

Submodules

Module contents

pysimm.models package

Submodules

Module contents

        pysimm

Docs »

pysimm package »

pysimm.forcefield package »

pysimm.forcefield.gaff module

             View page source

pysimm.forcefield.gaff module¶

class pysimm.forcefield.gaff.Gaff(db_file=None)[source]¶

Bases: pysimm.forcefield.forcefield.Forcefield

Forcefield object with typing rules for Gaff model.
By default reads data file in forcefields subdirectory.

ff_name¶

gaff

pair_style¶

lj

ff_class¶

1

assign_atypes(s)[source]¶

Gaff specific boanglend typing rules.
Requires System object Particle objects have bonds, type and type.name defined.
* use after assign_ptypes *

<col class="field-name" />
<col class="field-body" />

Parameters:	s – System

Returns:	None

assign_btypes(s)[source]¶

Gaff specific bond typing rules.
Requires System object Particle objects have bonds, type and type.name defined.
* use after assign_ptypes *

<col class="field-name" />
<col class="field-body" />

Parameters:	s – System

Returns:	None

assign_charges(s, charges='gasteiger')[source]¶

Charge assignment. Gasteiger is default for now.

<col class="field-name" />
<col class="field-body" />

Parameters:

s – System

charges – gasteiger

Returns:
None

assign_dtypes(s)[source]¶

Gaff specific dihedral typing rules.
Requires System object Particle objects have bonds, type and type.name defined.
* use after assign_ptypes *

<col class="field-name" />
<col class="field-body" />

Parameters:	s – System

Returns:	None

assign_itypes(s)[source]¶

Gaff specific improper typing rules.
There are none.

<col class="field-name" />
<col class="field-body" />

Parameters:	s – System

Returns:	None

assign_ptypes(s)[source]¶

Gaff specific particle typing rules.
Requires System object Particle objects have bonds defined.
* use System.add_particle_bonding() to ensure this *

* Not entirely inclusive - some atom types not used *

<col class="field-name" />
<col class="field-body" />

Parameters:	s – System

Returns:	None

        Next

         Previous

        © Copyright 2017, https://pysimm.org.

  Built with Sphinx using a theme provided by Read the Docs.


text:
import datetime

import GithubObject
import PaginatedList

import NamedUser
import Label

class Milestone( GithubObject.GithubObject ):
    @property
    def closed_issues( self ):
        self._completeIfNotSet( self._closed_issues )
        return self._NoneIfNotSet( self._closed_issues )

    @property
    def created_at( self ):
        self._completeIfNotSet( self._created_at )
        return self._NoneIfNotSet( self._created_at )

    @property
    def creator( self ):
        self._completeIfNotSet( self._creator )
        return self._NoneIfNotSet( self._creator )

    @property
    def description( self ):
        self._completeIfNotSet( self._description )
        return self._NoneIfNotSet( self._description )

    @property
    def due_on( self ):
        self._completeIfNotSet( self._due_on )
        return self._NoneIfNotSet( self._due_on )

    @property
    def id( self ):
        self._completeIfNotSet( self._id )
        return self._NoneIfNotSet( self._id )

    @property
    def number( self ):
        self._completeIfNotSet( self._number )
        return self._NoneIfNotSet( self._number )

    @property
    def open_issues( self ):
        self._completeIfNotSet( self._open_issues )
        return self._NoneIfNotSet( self._open_issues )

    @property
    def state( self ):
        self._completeIfNotSet( self._state )
        return self._NoneIfNotSet( self._state )

    @property
    def title( self ):
        self._completeIfNotSet( self._title )
        return self._NoneIfNotSet( self._title )

    @property
    def url( self ):
        self._completeIfNotSet( self._url )
        return self._NoneIfNotSet( self._url )

    def delete( self ):
        headers, data = self._requester.requestAndCheck(
            "DELETE",
            self.url,
            None,
            None
        )

    def edit( self, title, state = GithubObject.NotSet, description = GithubObject.NotSet, due_on = GithubObject.NotSet ):
        assert isinstance( title, ( str, unicode ) ), title
        assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state
        assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description
        assert due_on is GithubObject.NotSet or isinstance( due_on, datetime.date ), due_on
        post_parameters = {
            "title": title,
        }
        if state is not GithubObject.NotSet:
            post_parameters[ "state" ] = state
        if description is not GithubObject.NotSet:
            post_parameters[ "description" ] = description
        if due_on is not GithubObject.NotSet:
            post_parameters[ "due_on" ] = due_on.strftime( "%Y-%m-%d" )
        headers, data = self._requester.requestAndCheck(
            "PATCH",
            self.url,
            None,
            post_parameters
        )
        self._useAttributes( data )

    def get_labels( self ):
        return PaginatedList.PaginatedList(
            Label.Label,
            self._requester,
            self.url + "/labels",
            None
        )

    @property
    def _identity( self ):
        return self.number

    def _initAttributes( self ):
        self._closed_issues = GithubObject.NotSet
        self._created_at = GithubObject.NotSet
        self._creator = GithubObject.NotSet
        self._description = GithubObject.NotSet
        self._due_on = GithubObject.NotSet
        self._id = GithubObject.NotSet
        self._number = GithubObject.NotSet
        self._open_issues = GithubObject.NotSet
        self._state = GithubObject.NotSet
        self._title = GithubObject.NotSet
        self._url = GithubObject.NotSet

    def _useAttributes( self, attributes ):
        if "closed_issues" in attributes: # pragma no branch
            assert attributes[ "closed_issues" ] is None or isinstance( attributes[ "closed_issues" ], int ), attributes[ "closed_issues" ]
            self._closed_issues = attributes[ "closed_issues" ]
        if "created_at" in attributes: # pragma no branch
            assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ]
            self._created_at = self._parseDatetime( attributes[ "created_at" ] )
        if "creator" in attributes: # pragma no branch
            assert attributes[ "creator" ] is None or isinstance( attributes[ "creator" ], dict ), attributes[ "creator" ]
            self._creator = None if attributes[ "creator" ] is None else NamedUser.NamedUser( self._requester, attributes[ "creator" ], completed = False )
        if "description" in attributes: # pragma no branch
            assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ]
            self._description = attributes[ "description" ]
        if "due_on" in attributes: # pragma no branch
            assert attributes[ "due_on" ] is None or isinstance( attributes[ "due_on" ], ( str, unicode ) ), attributes[ "due_on" ]
            self._due_on = self._parseDatetime( attributes[ "due_on" ] )
        if "id" in attributes: # pragma no branch
            assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ]
            self._id = attributes[ "id" ]
        if "number" in attributes: # pragma no branch
            assert attributes[ "number" ] is None or isinstance( attributes[ "number" ], int ), attributes[ "number" ]
            self._number = attributes[ "number" ]
        if "open_issues" in attributes: # pragma no branch
            assert attributes[ "open_issues" ] is None or isinstance( attributes[ "open_issues" ], int ), attributes[ "open_issues" ]
            self._open_issues = attributes[ "open_issues" ]
        if "state" in attributes: # pragma no branch
            assert attributes[ "state" ] is None or isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ]
            self._state = attributes[ "state" ]
        if "title" in attributes: # pragma no branch
            assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ]
            self._title = attributes[ "title" ]
        if "url" in attributes: # pragma no branch
            assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ]
            self._url = attributes[ "url" ]


text:
package com.karuslabs.commons.command;

import java.util.stream.Stream;

import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
import static org.junit.jupiter.params.provider.Arguments.of;

@TestInstance(PER_CLASS)
public class PatternsTest {

    @ParameterizedTest
    @MethodSource("preserveQuotes_parameters")
    public void preserveQuotes(String[] arguments, String[] expected) {
        assertThat(Patterns.preserveQuotes(arguments), equalTo(expected));
    }

    static Stream<org.junit.jupiter.params.provider.Arguments> preserveQuotes_parameters() {
        String[] arguments = new String[] {"1", "2", "3"};
        return Stream.of(of(arguments, arguments), of(new String[] {"\"1", "2\"", "3"}, new String[] {"1 2", "3"}));
    }

}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../futures/stream/struct.FuturesOrdered.html">

Redirecting to ../../../futures/stream/struct.FuturesOrdered.html...


text:
id: community-showcase
title: Community Showcase
---

This is a selection of community contributions to Litho and projects.

- [litho-lint-rules](https://github.com/pavlospt/litho-lint-rules) - Android
  Lint rules for Litho by [@pavlospt](https://github.com/pavlospt).
- [litho-glide](https://github.com/pavlospt/litho-glide) - A component for image
  loading with Glide by [@pavlospt](https://github.com/pavlospt).
- [litho-picasso](https://github.com/charbgr/litho-picasso) - A component for
  image loading with Picasso by [@charbgr](https://github.com/charbgr).
- [litho-kotlin](https://github.com/ubuntudroid/litho-kotlin) - A simple project
  exploring the use of Litho with Kotlin by
  [@ubuntudroid](https://github.com/ubuntudroid).
- [LithoGifSearch](https://github.com/jayrambhia/LithoGifSearch) - A basic GIF
  searching sample app built with Litho by
  [@jayrambhia](https://github.com/jayrambhia/LithoGifSearch).
- [Hunt](https://github.com/dbof10/hunt-android) - A products surfing app built with Litho by
  [@dbof10](https://github.com/dbof10/hunt-android).
- [Slither](https://github.com/mishrabhilash/slither) - A component to show shimmer on Litho components
  [@mishrabhilash](https://github.com/mishrabhilash).
- [Flexml](https://github.com/sanyuankexie/Flexml) - A Litho-based Android dynamic business container that extends the boundaries of Litho capabilities. [@LukeXeon](https://github.com/LukeXeon)


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

.. toctree::
   :maxdepth: 2

.. doxygenclass:: joedb::Readable
   :members:
   :undoc-members:

.. doxygenclass:: joedb::Writable
   :members:
   :undoc-members:


text:
using namespace std;

HTMLWriter::HTMLWriter()
{
	mFileName = "NoName.html";

	mFontName = "±¼¸²";
	mFontSize = 3;
	mFontColor = "black";
}

HTMLWriter::~HTMLWriter()
{

}

void HTMLWriter::Write()
{
	ofstream fout(mFileName.c_str());
	fout << "
Content
";
	fout << "<Font name ='" << mFontName << " ' size = '" << mFontSize << " ' color = " << mFontColor << " '>";
	fout << mContent;
	fout << "";

	fout << "";
	fout.close();
}

void HTMLWriter::SetFont(const string& fontName, int fontSize, const string& fontColor)
{
	mFontName = fontName;
	mFontSize = fontSize;
	mFontColor = fontColor;
}


text:
from __future__ import unicode_literals
import frappe, os

from frappe.model.document import Document

class ModuleDef(Document):
	def on_update(self):
		"""If in `developer_mode`, create folder for module and
			add in `modules.txt` of app if missing."""
		frappe.clear_cache()
		if frappe.conf.get("developer_mode"):
			self.create_modules_folder()
			self.add_to_modules_txt()

	def create_modules_folder(self):
		"""Creates a folder `[app]/[module]` and adds `__init__.py`"""
		module_path = frappe.get_app_path(self.app_name, self.name)
		if not os.path.exists(module_path):
			os.mkdir(module_path)
			with open(os.path.join(module_path, "__init__.py"), "w") as f:
				f.write("")

	def add_to_modules_txt(self):
		"""Adds to `[app]/modules.txt`"""
		modules = None
		if not frappe.local.module_app.get(frappe.scrub(self.name)):
			with open(frappe.get_app_path(self.app_name, "modules.txt"), "r") as f:
				content = f.read()
				if not self.name in content.splitlines():
					modules = list(filter(None, content.splitlines()))
					modules.append(self.name)

			if modules:
				with open(frappe.get_app_path(self.app_name, "modules.txt"), "w") as f:
					f.write("\n".join(modules))

				frappe.clear_cache()
				frappe.setup_module_map()

	def on_trash(self):
		"""Delete module name from modules.txt"""
		modules = None
		if frappe.local.module_app.get(frappe.scrub(self.name)):
			with open(frappe.get_app_path(self.app_name, "modules.txt"), "r") as f:
				content = f.read()
				if self.name in content.splitlines():
					modules = list(filter(None, content.splitlines()))
					modules.remove(self.name)

			if modules:
				with open(frappe.get_app_path(self.app_name, "modules.txt"), "w") as f:
					f.write("\n".join(modules))

				frappe.clear_cache()
				frappe.setup_module_map()


text:
#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_pass.h"

#include "mlir/IR/BuiltinOps.h"  // from @llvm-project
#include "mlir/IR/MLIRContext.h"  // from @llvm-project
#include "mlir/IR/Verifier.h"  // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/translate/export_graphdef.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/import_model.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h"
#include "tensorflow/compiler/mlir/tensorflow/utils/error_util.h"
#include "tensorflow/compiler/xla/status_macros.h"
#include "tensorflow/core/common_runtime/graph_constructor.h"
#include "tensorflow/core/common_runtime/metrics.h"
#include "tensorflow/core/protobuf/graph_debug_info.pb.h"
#include "tensorflow/stream_executor/lib/statusor.h"

namespace tensorflow {

using mlir::MLIRContext;

static stream_executor::port::StatusOr<mlir::OwningModuleRef> Import(
    const GraphOptimizationPassOptions& options, const Graph& graph,
    MLIRContext* context) {
  // TODO(fengliuai): get debug info at runtime.
  GraphDebugInfo debug_info;
  GraphImportConfig specs;
  TF_ASSIGN_OR_RETURN(
      auto module,
      ConvertGraphToMlir(graph, debug_info, *options.flib_def, specs, context));
  mlir::StatusScopedDiagnosticHandler status_handler(context);
  if (failed(mlir::verify(*module))) {
    if (VLOG_IS_ON(1)) module->dump();
    return status_handler.ConsumeStatus();
  }
  return module;
}

static Status Export(mlir::OwningModuleRef module,
                     const GraphOptimizationPassOptions& options,
                     std::unique_ptr<Graph>* graph) {
  GraphExportConfig confs;
  return ConvertMlirToGraph(*module, confs, graph, options.flib_def);
}

static Status Roundtrip(const GraphOptimizationPassOptions& options,
                        std::unique_ptr<Graph>* graph, MLIRContext* context) {
  TF_ASSIGN_OR_RETURN(auto module, Import(options, **graph, context));
  return Export(std::move(module), options, graph);
}

Status MlirRoundtripPass::Run(const GraphOptimizationPassOptions& options) {
  MLIRContext context;
  if (options.graph) return Roundtrip(options, options.graph, &context);

  // If the graph is partitioned, then try and round trip them individually.
  for (auto& it : *options.partition_graphs) {
    VLOG(1) << "Roundtripping: " << it.first;
    // TODO(jpienaar): Roundtrip results in different failures, investigate.
    TF_RETURN_IF_ERROR(Import(options, *it.second, &context).status());
  }
  return Status::OK();
}

Status MlirImportPass::Run(const GraphOptimizationPassOptions& options) {
  MLIRContext context;
  if (options.graph) {
    if (!Import(options, **options.graph, &context).ok()) {
      metrics::IncrementMLIRImportFailureCount();
    }
  }
  return Status::OK();
}

}  // namespace tensorflow


text:
This is the first simple attempt at a game engine.

A Game engine is not part of SDL, but a game engine is valuable in showing how the SDL parts come together in a game.

### References

* Writing Killer games in java


text:
package net.gumbix.bioinf.string.seq.test

import net.gumbix.util.Logger
import net.gumbix.bioinf.string.seq.DoubleDigest
import org.junit.{Ignore, Test}

/**
  * Two examples for the double digest method.
  * @author Markus Gumbel (m.gumbel@hs-mannheim.de)
  */
class DoubleDigestDemo extends Logger {
  logLevel = true

  @Test
  @Ignore
  def testDoubleDigestDemo01() {
    val d = new DoubleDigest(List(1, 2, 3), List(2, 4), List(1, 1, 2, 2))
    d.printSolutions
  }

  @Test
  @Ignore
  def testDoubleDigestGumbel02() {
    val d = new DoubleDigest(List(1, 4, 3, 2),
      List(2, 2, 3, 3),
      List(1, 1, 2, 1, 2, 1, 2))
    d.printSolutions
  }
}


text:
<?php

if (!class_exists('Cache')) {
	require LIBS . 'cache.php';
}

/**
 * XcacheEngineTest class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.libs.cache
 */
class XcacheEngineTest extends UnitTestCase {

/**
 * skip method
 *
 * @access public
 * @return void
 */
	function skip() {
		$skip = true;
		if (function_exists('xcache_set')) {
			$skip = false;
		}
		$this->skipIf($skip, '%s Xcache is not installed or configured properly');
	}

/**
 * setUp method
 *
 * @access public
 * @return void
 */
	function setUp() {
		$this->_cacheDisable = Configure::read('Cache.disable');
		Configure::write('Cache.disable', false);
		Cache::config('xcache', array('engine' => 'Xcache', 'prefix' => 'cake_'));
	}

/**
 * tearDown method
 *
 * @access public
 * @return void
 */
	function tearDown() {
		Configure::write('Cache.disable', $this->_cacheDisable);
		Cache::config('default');
	}

/**
 * testSettings method
 *
 * @access public
 * @return void
 */
	function testSettings() {
		$settings = Cache::settings();
		$expecting = array(
			'prefix' => 'cake_',
			'duration'=> 3600,
			'probability' => 100,
			'engine' => 'Xcache',
		);
		$this->assertTrue(isset($settings['PHP_AUTH_USER']));
		$this->assertTrue(isset($settings['PHP_AUTH_PW']));

		unset($settings['PHP_AUTH_USER'], $settings['PHP_AUTH_PW']);
		$this->assertEqual($settings, $expecting);
	}

/**
 * testReadAndWriteCache method
 *
 * @access public
 * @return void
 */
	function testReadAndWriteCache() {
		Cache::set(array('duration' => 1));

		$result = Cache::read('test');
		$expecting = '';
		$this->assertEqual($result, $expecting);

		$data = 'this is a test of the emergency broadcasting system';
		$result = Cache::write('test', $data);
		$this->assertTrue($result);

		$result = Cache::read('test');
		$expecting = $data;
		$this->assertEqual($result, $expecting);

		Cache::delete('test');
	}

/**
 * testExpiry method
 *
 * @access public
 * @return void
 */
	function testExpiry() {
		Cache::set(array('duration' => 1));
		$result = Cache::read('test');
		$this->assertFalse($result);

		$data = 'this is a test of the emergency broadcasting system';
		$result = Cache::write('other_test', $data);
		$this->assertTrue($result);

		sleep(2);
		$result = Cache::read('other_test');
		$this->assertFalse($result);

		Cache::set(array('duration' =>  "+1 second"));

		$data = 'this is a test of the emergency broadcasting system';
		$result = Cache::write('other_test', $data);
		$this->assertTrue($result);

		sleep(2);
		$result = Cache::read('other_test');
		$this->assertFalse($result);
	}

/**
 * testDeleteCache method
 *
 * @access public
 * @return void
 */
	function testDeleteCache() {
		$data = 'this is a test of the emergency broadcasting system';
		$result = Cache::write('delete_test', $data);
		$this->assertTrue($result);

		$result = Cache::delete('delete_test');
		$this->assertTrue($result);
	}

/**
 * testClearCache method
 *
 * @access public
 * @return void
 */
	function testClearCache() {
		$data = 'this is a test of the emergency broadcasting system';
		$result = Cache::write('clear_test_1', $data);
		$this->assertTrue($result);

		$result = Cache::write('clear_test_2', $data);
		$this->assertTrue($result);

		$result = Cache::clear();
		$this->assertTrue($result);
	}

/**
 * testDecrement method
 *
 * @access public
 * @return void
 */
	function testDecrement() {
		$result = Cache::write('test_decrement', 5);
		$this->assertTrue($result);

		$result = Cache::decrement('test_decrement');
		$this->assertEqual(4, $result);

		$result = Cache::read('test_decrement');
		$this->assertEqual(4, $result);

		$result = Cache::decrement('test_decrement', 2);
		$this->assertEqual(2, $result);

		$result = Cache::read('test_decrement');
		$this->assertEqual(2, $result);
	}

/**
 * testIncrement method
 *
 * @access public
 * @return void
 */
	function testIncrement() {
		$result = Cache::write('test_increment', 5);
		$this->assertTrue($result);

		$result = Cache::increment('test_increment');
		$this->assertEqual(6, $result);

		$result = Cache::read('test_increment');
		$this->assertEqual(6, $result);

		$result = Cache::increment('test_increment', 2);
		$this->assertEqual(8, $result);

		$result = Cache::read('test_increment');
		$this->assertEqual(8, $result);
	}
}


text:
package io.rong.models.response;

import io.rong.models.Result;
import io.rong.util.GsonUtil;

/**
 * push 返回结果
 */
public class PushResult extends Result {

    /**
     * 推送唯一标识。
     */
    private String id;

    private String reqBody;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getReqBody() {
        return reqBody;
    }

    public void setReqBody(String reqBody) {
        this.reqBody = reqBody;
    }

    public PushResult(Integer code, String id) {
        super(code, id);
        this.code = code;
        this.id = id;
    }

    @Override
    public String toString() {
        return GsonUtil.toJson(this, PushResult.class);
    }

}


text:
package com.outcomehub.bridgecmd;

import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;

import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.web.RoutingContext;
import io.vertx.rxjava.core.eventbus.EventBus;
import io.vertx.rxjava.ext.web.handler.BodyHandler;

public class EventHandler extends BodyHandler {

    public EventHandler(io.vertx.ext.web.handler.BodyHandler delegate) {
		super(delegate);

	}

	private static final Logger logger = LoggerFactory.getLogger(EventHandler.class);

	EventBus eventBus;

	Gson gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, new JsonDeserializer<LocalDateTime>() {
		@Override
		public LocalDateTime deserialize(JsonElement json, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
		    return ZonedDateTime.parse(json.getAsJsonPrimitive().getAsString()).toLocalDateTime();
		}

		 public JsonElement serialize(LocalDateTime date, Type typeOfSrc, JsonSerializationContext context) {
       return new JsonPrimitive(date.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); // "yyyy-mm-dd"
   }
		}).create();

//    public void handleGetAuction(RoutingContext context) {
//        String auctionId = context.request().getParam("id");
//        Optional<Auction> auction = this.repository.getById(auctionId);
//
//        if (auction.isPresent()) {
//            context.response()
//                .putHeader("content-type", "application/json")
//                .setStatusCode(200)
//                .end(Json.encodePrettily(auction.get()));
//        } else {
//            context.response()
//                .putHeader("content-type", "application/json")
//                .setStatusCode(404)
//                .end();
//        }
//    }

    public void handlePostEvent(RoutingContext context) {
    	// Only event messages should go here
       String token = context.request().getParam("token");

      //      context.vertx().eventBus().publish("auction." + auctionId, context.getBodyAsString());
    	String data = context.getBodyAsString();
    JsonObject json = new JsonObject(data);
    json.put("token", token);
 //   	JsonObject rawMessage = json.getJsonObject("data");
//		rawMessage.put("token", tokenAccessed.principal().toString());
    	logger.info("Sending Event:"+json);
        eventBus.publish("events", json);

            context.response()
                .setStatusCode(200)
                .end();

    }

	public EventBus getEventBus() {
		return eventBus;
	}

	public void setEventBus(EventBus eventBus) {
		this.eventBus = eventBus;
	}

}


text:
//
//  Copyright 2014 Gustavo J Knuppe (https://github.com/knuppe)
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//   - May you do good and not evil.                                         -
//   - May you find forgiveness for yourself and forgive others.             -
//   - May you share freely, never taking more than you give.                -
//   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//

namespace SharpNL.ML.MaxEntropy {
    /// <summary>
    /// Generate contexts for maximum entropy decisions.
    /// </summary>
    public interface IContextGenerator {

        /// <summary>
        /// Builds up the list of contextual predicates given an Object.
        /// </summary>
        /// <param name="obj">The object.</param>
        /// <returns>A string array with the contextual predicates.</returns>
        string[] GetContext(object obj);

    }
}


text:
@interface JMSQRScannerView() <ZBarReaderViewDelegate,WECodeScannerViewDelegate>

@property (nonatomic, strong) WECodeScannerView *codeScannerView;
@property (nonatomic, strong) ZBarReaderView *codeScannerViewLegacy;

@end

@implementation JMSQRScannerView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
		if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
			[self initScannerReader];
		}
		else {
			[self initScannerReaderLegacy];
		}
    }
    return self;
}

- (void)initScannerReader {
	self.codeScannerView = [WECodeScannerView new];
	self.codeScannerView.frame = self.bounds;
	self.codeScannerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
	self.codeScannerView.delegate = self;
	[self addSubview:self.codeScannerView];
}

- (void)initScannerReaderLegacy {
    self.codeScannerViewLegacy = [ZBarReaderView new];
    ZBarImageScanner * scanner = [ZBarImageScanner new];
    [scanner setSymbology:ZBAR_PARTIAL config:0 to:0];
    self.codeScannerViewLegacy = [self.codeScannerViewLegacy initWithImageScanner:scanner];
    self.codeScannerViewLegacy.readerDelegate = self;

    self.codeScannerViewLegacy.frame = self.bounds;
    self.codeScannerViewLegacy.backgroundColor = [UIColor redColor];
    [self.codeScannerViewLegacy start];

    [self addSubview:self.codeScannerViewLegacy];
}

- (void) start {
	[self.codeScannerView start];
	[self.codeScannerViewLegacy start];
}

- (void) stop {
	[self.codeScannerView stop];
	[self.codeScannerViewLegacy stop];
}

#pragma mark WECodeScannerViewDelegate

- (void)scannerView:(WECodeScannerView *)scannerView didReadCode:(NSString *)code {
	if (self.codeScannedBlock) self.codeScannedBlock(self,code);
}
- (void)scannerViewDidStartScanning:(WECodeScannerView *)scannerView {
	if (self.scanStartedBlock) self.scanStartedBlock(self,nil);
}

- (void)scannerViewDidStopScanning:(WECodeScannerView *)scannerView {
	if (self.scanStoppedBlock) self.scanStoppedBlock(self,nil);
}

#pragma mark ZBarReaderViewDelegate

- (void) readerView: (ZBarReaderView*) readerView
     didReadSymbols: (ZBarSymbolSet*) symbols
          fromImage: (UIImage*) image {

	if (!self.codeScannedBlock) return;

	ZBarSymbol * s = nil;
	for (s in symbols) {
		self.codeScannedBlock(self,s.data);
	}
}

- (void) readerViewDidStart: (ZBarReaderView*) readerView {
	if (self.scanStartedBlock) self.scanStartedBlock(self,nil);
}

- (void) readerView: (ZBarReaderView*) readerView didStopWithError: (NSError*) error {
	if (self.scanStoppedBlock) self.scanStoppedBlock(self,error);
}

@end


text:
package com.example.bundledemoapkplugservice;
import org.apkplug.Bundle.BundleInstance;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

import android.content.Intent;

public class BundleContextFactory implements BundleInstance{
private static BundleContextFactory _instance=null;
   private BundleContext mcontext = null;
//单例静态工厂方法,同步防止多线程环境同时执行
   synchronized public static BundleContextFactory getInstance(){
    if(_instance==null){
    _instance=new BundleContextFactory();
    }
    return _instance;
    }
    //私有的默认构造函数,防止使用构造函数进行实例化
	private BundleContextFactory(){

	}

	public BundleContext getBundleContext() {
		// TODO Auto-generated method stub
		return this.mcontext;
	}
	public void setBundleContext(BundleContext arg0) {
		// TODO Auto-generated method stub
		this.mcontext = arg0;
	}

}


text:
package sun.jvm.hotspot.memory;

import java.io.*;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;

public class ConcurrentMarkSweepGeneration extends CardGeneration {
  private static AddressField cmsSpaceField;

  public ConcurrentMarkSweepGeneration(Address addr) {
    super(addr);
  }

  static {
    VM.registerVMInitializedObserver(new Observer() {
        public void update(Observable o, Object data) {
          initialize(VM.getVM().getTypeDataBase());
        }
      });
  }

  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("ConcurrentMarkSweepGeneration");
    cmsSpaceField = type.getAddressField("_cmsSpace");
  }

  // Accessing space
  public CompactibleFreeListSpace cmsSpace() {
    return (CompactibleFreeListSpace) VMObjectFactory.newObject(
                                 CompactibleFreeListSpace.class,
                                 cmsSpaceField.getValue(addr));
  }

  public long capacity()                { return cmsSpace().capacity(); }
  public long used()                    { return cmsSpace().used(); }
  public long free()                    { return cmsSpace().free(); }
  public long contiguousAvailable()     { throw new RuntimeException("not yet implemented"); }
  public boolean contains(Address p)    { return cmsSpace().contains(p); }
  public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
     blk.doSpace(cmsSpace());
  }

  public Generation.Name kind() {
    return Generation.Name.CONCURRENT_MARK_SWEEP;
  }

  public String name() {
    return "concurrent mark-sweep generation";
  }

  public void printOn(PrintStream tty) {
    tty.println(name());
    cmsSpace().printOn(tty);
  }
}


text:
package com.cali.ast;

import java.util.ArrayList;

import com.cali.Environment;
import com.cali.types.CaliList;
import com.cali.types.CaliNull;
import com.cali.types.CaliObject;
import com.cali.types.CaliType;

public class astNewInst extends astNode implements astNodeInt {
	private astFunctDefArgsList args = new astFunctDefArgsList();

	public astNewInst() {
		this.setType(astNodeType.NEWINST);
	}

	public astNewInst(String Name) {
		this.setType(astNodeType.NEWINST);
		this.setName(Name);
	}

	public void addArg(astNode Arg) { this.args.getArgs().add(Arg); }

	@Override
	public String toString() {
		return this.toString(0);
	}

	@Override
	public String toString(int Level) {
		String rstr = "";
		rstr += getTabs(Level) + "{\n";
		rstr += this.getNodeStr(Level + 1) + ",\n";
		rstr += getTabs(Level + 1) + "\"constructor\": \"" + this.getName() + "\"\n";
		if(this.args != null) {
			rstr += getTabs(Level + 1) + "\"argumentList\":\n";
			rstr += this.args.toString(Level + 1) + ",\n";
		}
		if(this.getChild() != null) {
			rstr += getTabs(Level + 1) + "\"child\":\n";
			rstr += ((astNodeInt)this.getChild()).toString(Level + 1) + ",\n";
		}
		rstr += getTabs(Level) + "}";
		return rstr;
	}

	@Override
	public CaliType evalImpl(Environment env, boolean getref) throws caliException {
		CaliType ret = new CaliNull();

		if(env.getEngine().containsClass(this.getName())) {
			CaliList cargs = (CaliList) this.args.eval(env, getref);
			CaliObject cobj = (CaliObject) env.getEngine().getClassByName(this.getName()).instantiate(env, getref, cargs);

			if(cobj != null) {
				ret = cobj;
			} else {
				throw new caliException(this, "Cannot instantiate object of type '" + this.getName() + "', class definition not found.", env.stackTraceToString());
			}
		} else {
			throw new caliException(this, "Cannot instantiate class '" + this.getName() + "'.", env.stackTraceToString());
		}

		if (this.getChild() != null) {
			Environment tenv = env.clone(ret);
			return this.getChild().eval(tenv, getref);
		}

		return ret;
	}

	public astFunctDefArgsList getArgs() {
		return args;
	}

	public void setArgs(astFunctDefArgsList args) {
		this.args = args;
	}

	public ArrayList<CaliType> getEvaledArgs(Environment env) throws caliException {
		ArrayList<CaliType> eargs = new ArrayList<CaliType>();
		for(astNode tn : this.args.getArgs()) {
			CaliType res = tn.eval(env);
			eargs.add(res);
		}
		return eargs;
	}
}


text:
using Microsoft.CSharp.RuntimeBinder;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Wyam.Core;
using Wyam.Core.Documents;

namespace Wyam.Core.Tests.Documents
{
    [TestFixture]
    public class MetadataFixture
    {
        [Test]
        public void CanCloneWithNewValues()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            Metadata metadata = new Metadata(engine);

            // When
            metadata = metadata.Clone(new [] { new KeyValuePair<string, object>("A", "a") });

            // Then
            Assert.AreEqual("a", metadata["A"]);
        }

        [Test]
        public void IndexerMissingKeyThrowsKeyNotFoundException()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            Metadata metadata = new Metadata(engine);

            // When
            TestDelegate test = () =>
            {
                object value = metadata["A"];
            };

            // Then
            Assert.Throws<KeyNotFoundException>(test);
        }

        [Test]
        public void IndexerNullKeyThrowsKeyNotFoundException()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            Metadata metadata = new Metadata(engine);

            // When
            TestDelegate test = () =>
            {
                object value = metadata[null];
            };

            // Then
            Assert.Throws<ArgumentNullException>(test);
        }

        [Test]
        public void ContainsKeyReturnsTrueForValidValue()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            bool contains = metadata.ContainsKey("A");

            // Then
            Assert.IsTrue(contains);
        }

        [Test]
        public void ContainsReturnsFalseForInvalidValue()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            bool contains = metadata.ContainsKey("B");

            // Then
            Assert.IsFalse(contains);
        }

        [Test]
        public void TryGetValueReturnsTrueForValidValue()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            object value;
            bool contains = metadata.TryGetValue("A", out value);

            // Then
            Assert.IsTrue(contains);
            Assert.AreEqual("a", value);
        }

        [Test]
        public void TryGetValueReturnsFalseForInvalidValue()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            object value;
            bool contains = metadata.TryGetValue("B", out value);

            // Then
            Assert.IsFalse(contains);
            Assert.AreEqual(null, value);
        }

        [Test]
        public void CloneContainsPreviousValues()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            Metadata clone = metadata.Clone(new Dictionary<string, object> { { "B", "b" } });

            // Then
            Assert.AreEqual("a", clone["A"]);
        }

        [Test]
        public void ClonedMetadataDoesNotContainNewValues()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            Metadata clone = metadata.Clone(new Dictionary<string, object> { { "B", "b" } });

            // Then
            Assert.IsFalse(metadata.ContainsKey("B"));
        }

        [Test]
        public void CloneContainsNewValues()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            Metadata clone = metadata.Clone(new Dictionary<string, object> { { "B", "b" } });

            // Then
            Assert.AreEqual("b", clone["B"]);
        }

        [Test]
        public void CloneReplacesValue()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = "a";
            Metadata metadata = new Metadata(engine);

            // When
            Metadata clone = metadata.Clone(new Dictionary<string, object> { { "A", "b" } });

            // Then
            Assert.AreEqual("a", metadata["A"]);
            Assert.AreEqual("b", clone["A"]);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <plurals name="albums_quantity">
        <item quantity="other">%d album</item>
    </plurals>
    <plurals name="mediafiles_quantity">
        <item quantity="other">%d fail media</item>
    </plurals>
    <plurals name="search_found_results_quantity">
        <item quantity="other">%d keputusan ditemui</item>
    </plurals>
    <plurals name="songs_quantity">
        <item quantity="other">%d lagu</item>
    </plurals>
    <plurals name="subfolders_quantity">
        <item quantity="other">%d subfolder</item>
    </plurals>
    <plurals name="track_channels_info_quantity">
        <item quantity="other">%1$d saluran\n</item>
    </plurals>
    <plurals name="videos_quantity">
        <item quantity="other">%d video</item>
    </plurals>
    <string name="about">Perihal</string>
    <string name="about_text">VLC untuk Android™ adalah port pemain media VLC, pemain media sumber terbuka yang popular. Versi Android™ boleh membaca kebanyakan fail dan strim rangkaian.</string>
    <string name="add_custom_path">Tambah laluan suai</string>
    <string name="add_custom_path_description">Masukkan direktori suai tambahan untuk diimbas</string>
    <string name="advanced">pilihan lanjutan</string>
    <string name="advanced_prefs_category">Lanjutan</string>
    <string name="album">Album</string>
    <string name="albums">Album</string>
    <string name="all_albums">Semua album</string>
    <string name="aout">Output audio</string>
    <string name="aout_summary">Ubah kaedah yang VLC gunakan untuk audio output</string>
    <string name="app_name_full">VLC untuk Android™</string>
    <string name="append">Tambah</string>
    <string name="append_all">Tambah semua</string>
    <string name="artist">Artis</string>
    <string name="artists">Artis</string>
    <string name="audio">Audio</string>
    <string name="audio_delay">Lengahan audio</string>
    <string name="audio_player_tips">Petua pemain audio</string>
    <string name="audio_sub">Trek dan sarikata audio</string>
    <string name="audio_title_alignment">Jajaran tajuk audio</string>
    <string name="audio_title_alignment_centre">Tengah</string>
    <string name="audio_title_alignment_default">Lalai</string>
    <string name="audio_title_alignment_left">Kiri</string>
    <string name="audio_title_alignment_marquee">Marquee</string>
    <string name="audio_title_alignment_right">Kanan</string>
    <string name="auto_rescan">Auto imbas semula</string>
    <string name="auto_rescan_summary">Imbas peranti secara automatik untuk media baharu atau dipadam ketika permulaan aplikasi</string>
    <string name="automatic">Automatik</string>
    <string name="back_quit_lock">Tekan undur sekali lagi untuk tutup video</string>
    <string name="bookmarks">Tanda Buku</string>
    <string name="brightness">Kecerahan</string>
    <string name="cancel">Batal</string>
    <string name="chapter">Bab</string>
    <string name="chroma_format">Paksa kroma video</string>
    <string name="chroma_format_summary">RGB 32-bit: kroma lalai\nRGB 16-bit: prestasi lebih baik tetapi kualiti lebih rendah\nYUV: prestasi terbaik tetapi tidak berfungsi pada semua peranti. Android 2.3 dan terkini sahaja.</string>
    <string name="clear_history">Kosongkan sejarah gelintar</string>
    <string name="clear_log">Kosongkan log</string>
    <string name="clear_media_db">Kosongkan pangkalan data media</string>
    <string name="compiled_by">Versi VLC ini dikompil oleh:</string>
    <string name="confirm_delete">Padam fail \'%1$s\' ?</string>
    <string name="confirm_delete_folder">Padam folder \'%1$s\' dan semua kandungannya?</string>
    <string name="confirm_delete_playlist">Padam senarai main \'%1$s\'?</string>
    <string name="confirm_resume">Sambung dari kedudukan terakhir?</string>
    <string name="confirm_resume_summary">jika diaktifkan anda akan ditanya untuk sahkan sama ada video boleh disambung semula dari kedudukan terakhirnya</string>
    <string name="confirm_resume_title">Tanya pengesahan untuk sambung semula</string>
    <string name="copied_to_clipboard">Log disalin ke papan keratan.</string>
    <string name="copy_to_clipboard">Salin ke papan keratan</string>
    <string name="cover_art">Seni muka depan</string>
    <string name="deblocking">Tetapan penapis menyahsekat</string>
    <string name="deblocking_all">Tiada menyahsekat (terpantas)</string>
    <string name="deblocking_always">Menyahsekat penuh (paling perlahan)</string>
    <string name="deblocking_nonkey">Menyahsekat rendah</string>
    <string name="deblocking_nonref">Menyahsekat sederhana</string>
    <string name="deblocking_summary">Tukar tetapan penapis menyahsekat. Boleh meningkatkan kualiti video. Pengguna lanjutan sahaja.</string>
    <string name="debug_logs">Nyahpijat log</string>
    <string name="delete">Padam</string>
    <string name="dev_hardware_decoder">Dekoder perkakasan lanjutan</string>
    <string name="dev_hardware_decoder_mediacodec">mediacodec</string>
    <string name="dev_hardware_decoder_mediacodec_dr">mediacodec-dr</string>
    <string name="dev_hardware_decoder_omx">iomx</string>
    <string name="dev_hardware_decoder_omx_dr">iomx-dr</string>
    <string name="dev_hardware_decoder_summary">Paksa dekoder perkakasan, untuk pengguna mahir sahaja</string>
    <string name="developer_prefs_category">Pembangun</string>
    <string name="directories">Direktori</string>
    <string name="directories_summary">Pilih direktori untuk dimasukkan ke dalam pustaka media</string>
    <string name="directory">Direktori</string>
    <string name="directory_empty">Direktori kosong</string>
    <string name="directory_hide_medialib">Sembunyi dari MediaLib</string>
    <string name="directory_show_medialib">Tunjuk dalam MediaLib</string>
    <string name="directorynotfound">Laluan direktori \'%1$s\' tidak ditemui.</string>
    <string name="drawer_close">Tutup laci navigasi</string>
    <string name="drawer_open">Buka laci navigasi</string>
    <string name="dump_logcat">Longgok log logcat</string>
    <string name="dump_logcat_failure">Gagal longgokkan logcat.</string>
    <string name="dump_logcat_success">Logcat berjaya dilonggok ke %1$s!</string>
    <string name="enable_black_theme">Benarkan tema hitam</string>
    <string name="enable_black_theme_summary">Ubah warna antaramuka untuk kelihatan lebih baik dalam persekitaran kurang cahaya.</string>
    <string name="enable_brightness_gesture">Benarkan gerak isyarat kecerahan</string>
    <string name="enable_brightness_gesture_summary">Kawal kecerahan menggunakan gerak isyarat semasa mainbalik video</string>
    <string name="enable_clone_mode">Utamakan klon</string>
    <string name="enable_clone_mode_summary">Klonkan skrin peranti tanpa kawalan jauh.</string>
    <string name="enable_frame_skip">Benarkan langkau bingkai</string>
    <string name="enable_frame_skip_summary">Percepatkan menyahkod tetapi menyebabkan kualiti video rendah.</string>
    <string name="enable_headset_detection">Kesan set kepala</string>
    <string name="enable_headset_detection_summary">Jeda ketika set kepala dibuang; sambung bila menyisip set kepala</string>
    <string name="enable_jump_buttons">Benarkan butang lompat</string>
    <string name="enable_jump_buttons_summary">Tunjuk butang undur dan maju pada antaramuka video</string>
    <string name="enable_steal_remote_control">Kawalan jauh set kepala ekslusif</string>
    <string name="enable_steal_remote_control_summary">Jauhkan konflik dengan mencuri kawalan jauh daripada apl lain. Ini mengelakkan mendail apabila dwi-klik pada fon HTC.</string>
    <string name="enable_time_stretching_audio">Audio diregang-masa</string>
    <string name="enable_time_stretching_audio_summary">Lajukan dan perlahankan audio tanpa mengubah pic (memerlukan peranti pantas).</string>
    <string name="enable_verbose_mode">Berjela</string>
    <string name="enable_verbose_mode_summary">TIngkatkan kejelaan (logcat)</string>
    <string name="encountered_error_message">VLC menghadapi ralat dengan media ini.\nSila segar semula pustaka media.</string>
    <string name="encountered_error_title">Ralat mainbalik</string>
    <string name="equalizer">Penyama</string>
    <string name="error_message_is">Ralat mesej ialah (sila jelaskan perkara ini bila menyahpepijat):\n</string>
    <string name="error_not_compatible">Maaf, peranti anda belum lagi menyokong versi VLC untuk Android™ ini. </string>
    <string name="error_problem">Maaf, VLC untuk Android mengalami masalah memuatkan dan perlu ditutup.</string>
    <string name="extra_prefs_category">Tetapan tambahan</string>
    <string name="file_deleted">Fail dipadam</string>
    <string name="file_other">Tutup laci navigasi</string>
    <string name="file_size">Saiz fail:</string>
    <string name="force_list_portrait">Tiada grid dalam mod potret</string>
    <string name="force_list_portrait_summary">Tunjuk video di dalam senarai bukannya grid dalam mod potret</string>
    <string name="general_prefs_category">Am</string>
    <string name="genres">Genre</string>
    <string name="go_to_chapter">Pergi ke bab...</string>
    <string name="hardware_acceleration">Pemecutan Perkakasan</string>
    <string name="hardware_acceleration_decoding">Menyahkod pemecutan</string>
    <string name="hardware_acceleration_disabled">Dilumpuhkan</string>
    <string name="hardware_acceleration_error_message">Pemecutan HW menghadapi ralat. Anda mahu lumpuhkannya dan cuba lagi?</string>
    <string name="hardware_acceleration_error_title">Ralat pemecutan HW</string>
    <string name="hardware_acceleration_full">Pemecutan penuh</string>
    <string name="hardware_acceleration_summary">Dilumpuhkan: kestabilan lebih baik.\nPenyahkodan: mungkin meningkatkan prestasi.\nPenuh: mungkin meningkatkan lagi prestasi.</string>
    <string name="help_us_send_log">Bantu kami mempertingkatkan VLC dengan menghantar log kerosakan berikut:</string>
    <string name="history">Sejarah</string>
    <string name="hold_to_seek">Tahan untuk jangkau</string>
    <string name="hold_to_stop">Tahan untuk henti</string>
    <string name="info">Maklumat</string>
    <string name="info_title">VLC</string>
    <string name="interface_other_category">Antaramuka - Lain</string>
    <string name="interface_prefs_screen">Antaramuka</string>
    <string name="interface_secondary_display_category">Antaramuka - Paparan Kedua</string>
    <string name="interface_secondary_display_category_summary">Tetapkan bila paparan kedua bersambung (HDMI/Miracast).</string>
    <string name="internal_memory">Ingatan dalaman</string>
    <string name="invalid_location">Lokasi %1$s tidak dapat dimainkan.</string>
    <string name="jump_to_time">Lompat ke Masa</string>
    <string name="last_playlist">Senarai main terakhir</string>
    <string name="licence">Lesen</string>
    <string name="loading">Memuatkan...</string>
    <string name="lock">Kunci</string>
    <string name="locked">Dikunci</string>
    <string name="log_service_text">Buka konsol log</string>
    <string name="log_service_title">Log VLC merakam</string>
    <string name="media_db_cleared">Pangkalan data media dikosongkan!</string>
    <string name="mediafiles">Fail media</string>
    <string name="more_actions">Lagi Tindakan</string>
    <string name="move">Alih</string>
    <string name="music_now_playing">Kini Dimainkan</string>
    <string name="navmenu">menu navigasi</string>
    <string name="network_browsing">Rangkaian Lokal</string>
    <string name="network_caching">Nilai caching rangkaian</string>
    <string name="network_caching_summary">Amaun masa untuk menimbal media rangkaian (dalam ms). Tidak berfungsi dengan menyahkog perkakasan. Tinggalkan kosong untuk tetap semula.</string>
    <string name="network_connection_needed">Tiada sambungan untuk rangkaian lokal.</string>
    <string name="network_empty">Direktori ini kosong.</string>
    <string name="network_shares_discovery">Mencari rangkaian kongsi...</string>
    <string name="next">Berikut</string>
    <string name="no_file_picker_found">Tiada pengutip fail ditemui pada sistem.</string>
    <string name="no_subs_found">Tiada sarikata dalam direktori ini</string>
    <string name="nohistory">Anda belum memiliki sejarah mainbalik. </string>
    <string name="nomedia">Tiada media ditemui, sila pindah beberapa fail ke peranti anda atau laraskan keutamaan anda.</string>
    <string name="noplaylist">Tiada senarai main ditemui.</string>
    <string name="nosubdirectory">Tiada subdirektori.</string>
    <string name="not_show_again">Jangan tunjuk mesej ini lagi.</string>
    <string name="notavailable">tidak tersedia</string>
    <string name="ok">OK</string>
    <string name="ok_got_it">Dapat, singkir ia</string>
    <string name="open">Buka</string>
    <string name="open_mrl">Buka MRL</string>
    <string name="open_mrl_dialog_msg">Masukkan MRL rangkaian: cth. http://, mms:// atau rtsp://</string>
    <string name="open_mrl_dialog_title">Buka strim rangkaian</string>
    <string name="options">Pilihan</string>
    <string name="other">Lain-lain</string>
    <string name="parent_folder">Naik ke folder induk</string>
    <string name="pause">Jeda</string>
    <string name="performance_prefs_category">Prestasi</string>
    <string name="play">Main</string>
    <string name="play_all">Main semua</string>
    <string name="play_as_audio">Mainkan sebagai audio</string>
    <string name="play_as_audio_background">Main video disebalik tabir</string>
    <string name="play_as_audio_background_summary">Teruskan main balik video disebalik tabir bila mematikan skrin peranti atau mengklik butang RUMAH.</string>
    <string name="play_as_video">Mainkan sebagai video</string>
    <string name="play_from_start">Main dari mula</string>
    <string name="playback_speed">Kelajuan mainbalik</string>
    <string name="playlist_deleted">Senarai main dipadam</string>
    <string name="playlist_name_hint">nama senarai main</string>
    <string name="playlist_save">Simpan Senarai Main</string>
    <string name="playlist_tips">Petua senarai main</string>
    <string name="playlists">Senarai Main</string>
    <string name="please_wait">Sila tunggu...</string>
    <string name="preferences">Keutamaan</string>
    <string name="previous">Terdahulu</string>
    <string name="previous_next_song">Lagu Terdahulu/Berikutnya</string>
    <string name="quit">Keluar dan mula semula aplikasi</string>
    <string name="rearrange_order">Susun semula tertib</string>
    <string name="refresh">Segar semula</string>
    <string name="remove">Buang</string>
    <string name="remove_custom_path">Buang laluan suai</string>
    <string name="remove_song">Buang lagu</string>
    <string name="repeat">Jangan ulang</string>
    <string name="repeat_all">Ulang semua</string>
    <string name="repeat_single">Ulang sekali</string>
    <string name="resize">Saiz Semula</string>
    <string name="restart_vlc">Mula semula VLC</string>
    <string name="resume_from_position">Sambung dari kedudukan terakhir</string>
    <string name="revision">Revisi</string>
    <string name="ringtone_error">Ralat berlaku ketika menetapkan nada dering.</string>
    <string name="ringtone_set">Fail \'%1$s\' telah ditetapkan sebagai nada dering.</string>
    <string name="screen_orientation">Orientasi skrin video</string>
    <string name="screen_orientation_landscape">Landskap</string>
    <string name="screen_orientation_portrait">Potret</string>
    <string name="screen_orientation_reverse_landscape">Landskap balikan</string>
    <string name="screen_orientation_reverse_portrait">Potret balikan</string>
    <string name="screen_orientation_sensor">Automatik (penderia)</string>
    <string name="screen_orientation_start_lock">Dikunci ketika mula</string>
    <string name="search">Gelintar</string>
    <string name="search_hint">Carian media</string>
    <string name="search_history">Gelintar sejarah</string>
    <string name="searchable_hint">Gelintar...</string>
    <string name="seek">Jangkau</string>
    <string name="send_log">Hantar log</string>
    <string name="sending_log">Menghantar log...</string>
    <string name="serious_crash">Malangnya, satu ralat yang serius telah berlaku dan VLC perlu ditutup.</string>
    <string name="set_locale">Tetapkan lokaliti</string>
    <string name="set_locale_detail">Tinggalkan kosong untuk tetap semula</string>
    <string name="set_locale_popup">Keluar dan mula semula VLC suoaya perubahan berkesan.</string>
    <string name="set_song">Tetapkan sebagai nada dering</string>
    <string name="show_playlist">Tunjuk Senarai Main</string>
    <string name="shuffle">Kocok Mati</string>
    <string name="shuffle_on">Kocok Hidup</string>
    <string name="sleep_cancel">Batal pemasa tidur</string>
    <string name="sleep_in">Tidur dalam tempoh</string>
    <string name="sleep_time_not_set">tidak ditetapkan</string>
    <string name="sleep_title">Pemasa tidur</string>
    <string name="songs">Lagu</string>
    <string name="sortby">Isih dengan...</string>
    <string name="sortby_date">Tarikh</string>
    <string name="sortby_date_desc">Tarikh (ktrgn)</string>
    <string name="sortby_length">Tempoh</string>
    <string name="sortby_length_desc">Panjang (ktrgn)</string>
    <string name="sortby_name">Nama</string>
    <string name="sortby_name_desc">Nama (ktrgn)</string>
    <string name="sound_off">Bunyi Mati</string>
    <string name="sound_on">Bunyi Hidup</string>
    <string name="spu_delay">Lengahan sarikata</string>
    <string name="start_logging">Mula mengelog</string>
    <string name="stop">Henti</string>
    <string name="stop_logging">Henti mengelog</string>
    <string name="subtitle_label">Tambah fail sarikata</string>
    <string name="subtitle_select">Pilih fail sarikata</string>
    <string name="subtitle_text_encoding">Pengekodan teks sarikata</string>
    <string name="subtitles">Sarikata</string>
    <string name="surface_best_fit">Suai muat</string>
    <string name="surface_fill">Penuhkan</string>
    <string name="surface_fit_horizontal">Suai mendatar</string>
    <string name="surface_fit_vertical">Suai menegak</string>
    <string name="surface_original">Tengah</string>
    <string name="thumbnail">Lakaran Kenit</string>
    <string name="title">Tajuk</string>
    <string name="tools">Alatan</string>
    <string name="track_audio">Trek audio</string>
    <string name="track_codec_info">Kodeks: %1$s\n</string>
    <string name="track_framerate_info">Kadar bingkai: %1$.3f\n</string>
    <string name="track_language_info">Bahasa: %1$s\n</string>
    <string name="track_resolution_info">Resolusi: %1$dx%2$d\n</string>
    <string name="track_samplerate_info">Kadar sampel: %1$d Hz\n</string>
    <string name="track_text">Trek sarikata</string>
    <string name="track_unknown">Trek tidak diketahui</string>
    <string name="track_video">Trek video</string>
    <string name="unknown_album">Album Tidak Diketahui</string>
    <string name="unknown_artist">Artis Tidak Diketahui</string>
    <string name="unknown_genre">Genre Tidak Diketahui</string>
    <string name="unlocked">Tidak dikunci</string>
    <string name="unseekable_stream">Strim tidak boleh dijangkau</string>
    <string name="validation">Anda pasti?</string>
    <string name="video">Video</string>
    <string name="video_player_tips">Petua pemain video:</string>
    <string name="vlc_authors">Pengarang VLC.</string>
    <string name="volume">Volum</string>
    <string name="vout">Output video</string>
    <string name="vout_android_surface">Permukaan Android</string>
    <string name="vout_summary">Ubah kaedah yang VLC gunakan untuk video outout.</string>
    <string name="widget_name_b">Widjet Gelap VLC</string>
    <string name="widget_name_w">Widjet Putih VLC</string>
</resources>


text:
package com.gemstone.gemfire.disttx;

import java.util.Properties;

import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache30.TXOrderDUnitTest;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;

/**
 * Same tests as that of {@link TXOrderDUnitTest} after setting
 * "distributed-transactions" property to true
 */
public class DistTXOrderDUnitTest extends TXOrderDUnitTest {

  public DistTXOrderDUnitTest(String name) {
    super(name);
  }

  @Override
  public Properties getDistributedSystemProperties() {
    Properties props = super.getDistributedSystemProperties();
    props.setProperty(DistributionConfig.DISTRIBUTED_TRANSACTIONS_NAME, "true");
//    props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
    return props;
  }

  @Override
  public void testFarSideOrder() throws CacheException {
    // [DISTTX] TODO test overridden intentionally and left blank as it fails
    // fix this
  }

  @Override
  public void testInternalRegionNotExposed() {
    // [DISTTX] TODO test overridden intentionally and left blank as it fails
    // fix this
  }
}


text:
// object that creates and contains a spawn position

#ifndef __SPAWNPOSITION_H__
#define __SPAWNPOSITION_H__

#include "common.h"

/* local interface headers */
#include "SpawnPolicy.h"

/** SpawnPosition represents a single spawn position and encapsulates
 *  the logic for selecting that new position based on the map, world
 *  configuration settings, and current game activity.
 */
class SpawnPosition {

public:
  SpawnPosition(int playerId, bool onGroundOnly, bool notNearEdges);
  ~SpawnPosition();

  /** used to override the default spawn policy.  call this before
   *  creating SpawnPosition objects.
   */
  static void setSpawnPolicy(SpawnPolicy* policy);

  float getX() const;
  float getY() const;
  float getZ() const;
  float getAzimuth() const;

private:
  float	      azimuth;
  float       pos[3];

  /* class data - determines how the pos and azimuth are determined */
  static SpawnPolicy *policy;
};

inline float SpawnPosition::getX() const
{
  return pos[0];
}

inline float SpawnPosition::getY() const
{
  return pos[1];
}

inline float SpawnPosition::getZ() const
{
  return pos[2];
}

/** returns the rotational orientation of this spawn position, from
 *  facing 'North' in radians.
 */
inline float SpawnPosition::getAzimuth() const
{
  return azimuth;
}

#else
class SpawnPosition;
#endif  /* __SPAWNPOSITION_H__ */

// Local Variables: ***
// mode:C++ ***
// tab-width: 8 ***
// c-basic-offset: 2 ***
// indent-tabs-mode: t ***
// End: ***
// ex: shiftwidth=2 tabstop=8


text:
"use strict";
Object.defineProperties(module.exports, {
  __esModule: {value: true},
  MAX_SAFE_INTEGER: {
    enumerable: true,
    get: function() {
      return MAX_SAFE_INTEGER;
    }
  },
  MIN_SAFE_INTEGER: {
    enumerable: true,
    get: function() {
      return MIN_SAFE_INTEGER;
    }
  },
  EPSILON: {
    enumerable: true,
    get: function() {
      return EPSILON;
    }
  },
  isFinite: {
    enumerable: true,
    get: function() {
      return NumberIsFinite;
    }
  },
  isInteger: {
    enumerable: true,
    get: function() {
      return isInteger;
    }
  },
  isNaN: {
    enumerable: true,
    get: function() {
      return NumberIsNaN;
    }
  },
  isSafeInteger: {
    enumerable: true,
    get: function() {
      return isSafeInteger;
    }
  },
  polyfillNumber: {
    enumerable: true,
    get: function() {
      return polyfillNumber;
    }
  }
});
var $__1 = require("./utils.js"),
    isNumber = $__1.isNumber,
    maybeAddConsts = $__1.maybeAddConsts,
    maybeAddFunctions = $__1.maybeAddFunctions,
    registerPolyfill = $__1.registerPolyfill,
    toInteger = $__1.toInteger;
var $abs = Math.abs;
var $isFinite = isFinite;
var $isNaN = isNaN;
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
var MIN_SAFE_INTEGER = -Math.pow(2, 53) + 1;
var EPSILON = Math.pow(2, -52);
function NumberIsFinite(number) {
  return isNumber(number) && $isFinite(number);
}
function isInteger(number) {
  return NumberIsFinite(number) && toInteger(number) === number;
}
function NumberIsNaN(number) {
  return isNumber(number) && $isNaN(number);
}
function isSafeInteger(number) {
  if (NumberIsFinite(number)) {
    var integral = toInteger(number);
    if (integral === number)
      return $abs(integral) <= MAX_SAFE_INTEGER;
  }
  return false;
}
function polyfillNumber(global) {
  var Number = global.Number;
  maybeAddConsts(Number, ['MAX_SAFE_INTEGER', MAX_SAFE_INTEGER, 'MIN_SAFE_INTEGER', MIN_SAFE_INTEGER, 'EPSILON', EPSILON]);
  maybeAddFunctions(Number, ['isFinite', NumberIsFinite, 'isInteger', isInteger, 'isNaN', NumberIsNaN, 'isSafeInteger', isSafeInteger]);
}
registerPolyfill(polyfillNumber);


text: add_library(alias ALIAS foo)


text:
<?php
/* @var $this BlogController */
/* @var $data Blog */
?>

	<?php echo CHtml::encode($data->getAttributeLabel('blog_id')); ?>:
	<?php echo CHtml::link(CHtml::encode($data->blog_id), array('view', 'id'=>$data->blog_id)); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:
	<?php echo CHtml::encode($data->title); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('user_id')); ?>:
	<?php echo CHtml::encode($data->user_id); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('content')); ?>:
	<?php echo CHtml::encode($data->content); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('date')); ?>:
	<?php echo CHtml::encode($data->date); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('time')); ?>:
	<?php echo CHtml::encode($data->time); ?>

        <?php
        $imghtml= CHtml::image("assets/blog/".$data->image);
        echo CHtml::link($imghtml, array('view', 'id'=>$data->blog_id));
        ?>

	<?php /*
	<?php echo CHtml::encode($data->getAttributeLabel('no_of_views')); ?>:
	<?php echo CHtml::encode($data->no_of_views); ?>

	*/ ?>