text:
"""The WaveBlocks Project

Compute the action of the position operator applied to a Hagedorn wavepacket.

@author: R. Bourquin
@copyright: Copyright (C) 2016 R. Bourquin
@license: Modified BSD License
"""

from numpy import zeros, complexfloating, conjugate, squeeze
from scipy import sqrt

from WaveBlocksND.WavepacketPosition import WavepacketPosition

__all__ = ["PositionHAWP"]

class PositionHAWP(WavepacketPosition):
    r"""This class implements the computation of the action of the
    position operator :math:`x` applied to a Hagedorn wavepacket :math:`\Psi`.
    """

    def apply_position_component(self, wavepacket, component):
        r"""Compute the effect of the position operator :math:`x` on the basis functions :math:`\phi(x)`
        of a component :math:`\Phi_i` of the Hagedorn wavepacket :math:`\Psi`.

        :param wavepacket: The wavepacket :math:`\Psi` containing :math:`\Phi_i`.
        :type wavepacket: A :py:class:`HagedornWavepacketBase` subclass instance.
        :param component: The index :math:`i` of the component :math:`\Phi_i`.
        :type component: Integer.
        :return: Extended basis shape :math:`\mathfrak{\dot{K}}` and new coefficients :math:`c^\prime`
                 for component :math:`\Phi_i`. The coefficients are stored column-wise with
                 one column per dimension :math:`d`. The :math:`c^\prime` array is of shape
                 :math:`|\mathfrak{\dot{K}}| \times D`.
        """
        D = wavepacket.get_dimension()
        eps = wavepacket.get_eps()
        q, p, Q, P, _ = wavepacket.get_parameters(component=component)
        Qbar = conjugate(Q)
        coeffs = wavepacket.get_coefficients(component=component)

        # Prepare storage for new coefficients
        K = wavepacket.get_basis_shapes(component=component)
        Ke = K.extend()
        size = Ke.get_basis_size()
        cnew = zeros((size, D), dtype=complexfloating)

        # We implement the more efficient scatter type stencil here
        for k in K.get_node_iterator():
            # Central phi_i coefficient
            cnew[Ke[k], :] += squeeze(coeffs[K[k]] * q)

            # Backward neighbours phi_{i - e_d}
            nbw = Ke.get_neighbours(k, selection="backward")

            for d, nb in nbw:
                cnew[Ke[nb], :] += sqrt(eps**2 / 2.0) * sqrt(k[d]) * coeffs[K[k]] * Qbar[:, d]

            # Forward neighbours phi_{i + e_d}
            nfw = Ke.get_neighbours(k, selection="forward")

            for d, nb in nfw:
                cnew[Ke[nb], :] += sqrt(eps**2 / 2.0) * sqrt(k[d] + 1.0) * coeffs[K[k]] * Q[:, d]

        return (Ke, cnew)


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Composition;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler;

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false), MetadataAttribute]
internal class ExportCSharpVisualBasicStatelessLspServiceAttribute : ExportStatelessLspServiceAttribute
{
    public ExportCSharpVisualBasicStatelessLspServiceAttribute(Type type, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any) : base(type, ProtocolConstants.RoslynLspLanguagesContract, serverKind)
    {
    }
}

redpajama_set_name: RedPajamaGithub


text:
package aggfuncs_test

import (
	"testing"

	"github.com/pingcap/tidb/executor/aggfuncs"
	"github.com/pingcap/tidb/parser/ast"
	"github.com/pingcap/tidb/parser/mysql"
)

func TestMemRank(t *testing.T) {
	t.Parallel()

	tests := []windowMemTest{
		buildWindowMemTester(ast.WindowFuncRank, mysql.TypeLonglong, 0, 1, 1,
			aggfuncs.DefPartialResult4RankSize, rowMemDeltaGens),
		buildWindowMemTester(ast.WindowFuncRank, mysql.TypeLonglong, 0, 3, 0,
			aggfuncs.DefPartialResult4RankSize, rowMemDeltaGens),
		buildWindowMemTester(ast.WindowFuncRank, mysql.TypeLonglong, 0, 4, 1,
			aggfuncs.DefPartialResult4RankSize, rowMemDeltaGens),
	}
	for _, test := range tests {
		testWindowAggMemFunc(t, test)
	}
}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>sym-ildl: by_tolerance< el_type > Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

sym-ildl
    1.1

Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.

Main Page

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

Public Member Functions |
Public Attributes |
List of all members

by_tolerance< el_type > Struct Template Reference

Functor for determining if a variable is below the tolerance given.
 More...

#include <lilc_matrix_ildl_helpers.h>

Public Member Functions

 	by_tolerance (const vector< el_type > &vec, const double &eps)

bool 	operator() (int const &i) const

Public Attributes

const vector< el_type > & 	v

double 	eps

Detailed Description

template<class el_type>

struct by_tolerance< el_type >

Functor for determining if a variable is below the tolerance given.

Parameters

v	the vector that contains the values being checked.

eps	the tolerance given.

The documentation for this struct was generated from the following file:

source/lilc_matrix_ildl_helpers.h

<address class="footer">
Generated on Thu Feb 18 2016 05:32:24 for sym-ildl by

 1.8.9.1
</address>


text:
class HashTable {
    constructor() {
        this.keys = {};
    }

    add(item) {
        let itemKey = this.getKey(item),
            listItem = new ListItem(item);
        console.log('add: ', item, ', to: ', itemKey);
        if (this.keys[itemKey]) {
            let lastItem = this.keys[itemKey];
            while (lastItem.next) {
                lastItem = lastItem.next;
            }
            lastItem.next = listItem;
        } else {
            this.keys[itemKey] = listItem;
        }
        console.log('add: result: ', this.keys[itemKey]);
    }

    get(item) {
        let itemKey = this.getKey(item),
            listItem = this.keys[itemKey];
        console.log('get: ', item, ', to: ', itemKey);
        console.log('get: result: ', listItem);
        while (listItem.item !== item) {
            listItem = listItem.next;
        }
        return listItem.item;
    }

    getKey(item) {
        return (item.name + item.value).length % 100;
    }
}

class ListItem {
    constructor(item) {
        this.item = item;
        this.next = null;
    }
}

class Item {
    constructor(name, value) {
        this.name = name;
        this.value = value;
    }
}

let table = new HashTable(),
    items = [
        new Item('John', 12),
        new Item('Mike', 0),
        new Item('Gregory', 11),
        new Item('Bob', 235)
    ];

items.forEach(item => table.add(item));
console.log('---');
console.log(table);
console.log('---');
console.log(table.get(items[1]));
console.log('---');
console.log(table.get(items[3]));


text:
@interface MHImageViewer : NSObject <UIScrollViewDelegate>

- (instancetype) initWithInterfaceView:(UIView *) view imageData: (NSArray *) data;
- (void)registerImageView:(UIImageView *)imageView pageNumber:(NSInteger) number;

@end


text:
jWellFormed.js (0.1)
---------------

The purpose of the jWellFormed.js project is to unify client-side form-validation and submission control across a website.

The project seeks to alleviate those who can sympathize with the following realities of web development:

  - Client-side form validation is more often than not too bland and dry to avoid the copy-paste train
  - Managing if statements becomes increasing complex as more elements are added to a form, especially when ANDing, ORing, and nesting come into play.
  - Code-reuse is difficult to achieve with form-validation, because often times client-side code is tightly coupled to particular DOM snippets, and it's often easier to simply rewrite code instead of trying to make it DOM-agnostic.

jWellFormed.js hopes to provide end-users with something slightly better than what's out there now. In comparison with the JQuery Validation plugin, jWellFormed.js seeks to offer something that's a little more interesting to work with and that focuses more on the need for user-defined, one-off type of functionality rather than the boiler-plate CC #, date, email, etc. stuff that most browsers give you for free nowadays via HTML5 input types.

Features:
---------

  - Embraces jQuery's implict iteration via css-style selectors. Multiple form elements can be validated against the same user-defined Fn's, where the first element in a set to fail validation can be highlighted.
  - Experimental support for Async validation via HTTP GET and POST.
  - No documentation required, it's super simple! Just see the example page.

What should my Fn look like?
----------------------------
Quite simply really. Your function will receive the form element(s) you pass in the .ensure() method. Based off of the element received--and possibly other indicators--you simply return true if it passes your spec or false otherwise.

See it live:
-----

**[Example Page] for live demo**

Todo:
-----

Maybe come up with a better example page and I may be wrong on the claim that no documention is required.

  [Example Page]: http://raymondnirnberger.com/jWellFormed/Example/


text:
package str

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestUrlCase(t *testing.T) {
	Convey("Test different url formats", t, func() {

	})
}


text:
layout: blogpost
title: PHP-DI 4.3 released
author: Matthieu Napoli
date: August 12th 2014
---

I am happy to announce that PHP-DI version 4.3 has been released. This version contains features that have all been
implemented by contributors other than me, this is very encouraging :) This is also the quickest release,
since 4.2 was released only 14 days ago.

It comes without any BC break, and with a new main feature: `DI\env()` to import **environment variables**.

## DI\env()

*contributed by [@jmalloc](https://github.com/jmalloc)*

If you use environment variables, you might end up creating several container definitions looking like this:

```php
return [

    'db.url' => DI\factory(
        function (DI\Container $container) {
            return isset($_SERVER['DATABASE_URL'])
                ? $_SERVER['DATABASE_URL']
                : 'postgresql://user:pass@localhost/db';
        }
    )

];
```

This might be a common situation for some developers, especially those deploying their applications to
systems like Heroku, or otherwise following the principles of [12-factor applications](http://12factor.net/config).

Since 4.3, this can be written like this:

```php
return [
    'db.url' => DI\env('DATABASE_URL', 'postgresql://user:pass@localhost/db'),
];
```

The first parameter to `DI\env()` is the name of the environment variable to read,
the second parameter is the default value to use if the environment variable is not defined.

If the environment variable is not defined and no default is provided, a `DefinitionException`
is thrown when attempting to resolve the value.

Finally, default values can reference other definitions using `DI\link()`:

```php
return [
    'default-dsn' => 'postgresql://user:pass@localhost/db',
    'dsn' => DI\env('DATABASE_URL', DI\link('default-dsn')),
];
```

## Container::call() resolves array callable using class name

*contributed by [@thispagecannotbefound](https://github.com/thispagecannotbefound)*

This change will allow you to call an array callable using a class name, like so:

```php
$container->call(['MyClass', 'method']);
```

If the method is not static, `MyClass` will be resolved using the container.

Don't know what `Container::call()` is? [Check out the "Container API" documentation](http://php-di.org/doc/container.html).

## FactoryInterface and InvokerInterface are auto-registered

*contributed by [@drealecs](https://github.com/drealecs)*

Before 4.3, if you wanted to inject `DI\FactoryInterface` or `DI\InvokerInterface`, you needed to bind
them in the configuration to `DI\Container`.

They are now auto-registered (just like `DI\ContainerInterface`) as links to `DI\Container` so that
you can inject them without any configuration.

If you had previously defined them, there is no problem: your definitions always override the internal ones.

Don't know what these interfaces are for? [Check out the "Container API" documentation](http://php-di.org/doc/container.html).

## Change log

You can read the complete [change log](../change-log.md).


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BuilderBuilder.Test
{
    [TestClass]
    public class PlainCsClassParserTest
    {
        private Parser Parser => new PlainCsClassParser();

        [TestMethod]
        public void Parse_Example() {
            BuilderEntity result = Parser.Parse(ExampleInput);

            AssertHelper.AssertBuilderEntity(result, "ExampleEntity", false,
                ("long?", "Id"),
                ("My_class_123", "My_name_123"),
                ("IEnumerable<Stuff>", "Stuffs"));
        }

        private string ExampleInput {
            get => @"
                using ...

                namespace ...
                {
                    public class ExampleEntity
                    {
                        public long? Id;

                        [JsonProperty(""Name_123"")]
                        public My_class_123 My_name_123 { get; set; }

                        public virtual IEnumerable<Stuff> Stuffs { get; set; }

                        public virtual int IgnoreMe()
                        {
                            return 42;
                        }
                    }
                }
            ";
        }
    }
}


text:
class Solution(object):
    def rob(self, root):
        """
        :type root: TreeNode
        :rtype: int
        """
        def robHelper(root):
            if not root:
                return (0, 0)
            left, right = robHelper(root.left), robHelper(root.right)
            return (root.val + left[1] + right[1], max(left) + max(right))

        return max(robHelper(root))


text:
class ChatManager
  require 'json'
  attr_reader :open_urls
  attr_accessor :url_cookies

  def initialize
    @url_cookies = {}
    update_open_urls
    # {url => [ws1, ws2]}
    # url_cookies { url1 => {ws1: cookie1, ws2: cookie2}}
  end

  def url_cookies_to_s
    cookies_str = {}
    @url_cookies.each do |url, sockets|
      ws_representation = {}
      sockets.each do |ws, cookie|
        ws_representation.merge!({"ws #{ws.signature}" => cookie})
      end
      cookies_str.merge!({url => ws_representation})
    end
    cookies_str
  end

  def start(options)
    EM::WebSocket.start(options) do |ws|
      ws.onmessage { |msg| route_message(ws, msg) }
      ws.onclose { remove_client(ws) }
    end
  end

  def update_open_urls
    @open_urls = {}
    @url_cookies.each do |url, sockets|
      @open_urls[url] = sockets.keys
    end
    @open_urls
  end

  def route_message(ws, msg)
    message = JSON.parse(msg)

    if message["version"] != '0.0.8'
      send_version_error(ws)
    elsif message["initial"]
      setup_client(ws, message)
    else
      handle_message(ws, message)
    end
  end

  def send_version_error(ws)
    error = {content: "Your version of Context is super old.  Better upgrade to version 0.0.8", author: "Context", time: Time.now}.to_json;
    ws.send(error)
  end

  def setup_client(ws, message)
    url = message["url"]
    cookie = message["cookie"]

    add_ws_to_url_cookies({ws: ws, url: url, cookie: cookie})

    sockets = @url_cookies[url]
    send_all_user_number(sockets)
  end

  def add_ws_to_url_cookies(args)
    url = args[:url]
    ws = args[:ws]
    cookie = args[:cookie]

    if @url_cookies[url]
      @url_cookies[url].merge!({ws => cookie})
    else
      @url_cookies[url] = {ws => cookie}
    end

    update_open_urls
  end

  def send_all_user_number(sockets)
    clients = sockets.keys
    message = number_of_users(sockets)
    clients.each do |ws|
      ws.send(message)
      # $SERVER_LOG.info "sending #{message}"
    end
  end

  def number_of_users(sockets)
    cookies = sockets.values.uniq
    {num: cookies.length}.to_json
  end

  def remove_client(ws)
    @url_cookies.each do |url, sockets_hash|
      if sockets_hash.has_key?(ws)
        sockets_hash.delete(ws)
        update_open_urls
        send_all_user_number(sockets_hash)
      end
    end

  end

  def message_recording_proc(ws, msg)
    Proc.new {
      user_id = msg["user_id"]
      content = msg["content"]
      lat = msg["coords"][0].to_f
      lon = msg["coords"][1].to_f
      url = Url.rootify_find_create(msg["url"])
      start_time = Time.now
      # $SERVER_LOG.info("Saving message -- #{msg["content"]}")
      message = Message.create(content: content, url: url, user_id: user_id, latitude: lat, longitude: lon)
      # $SERVER_LOG.info ("Message saved (#{msg["content"]}) -- #{Time.now - start_time}")
    }
  end

  def clear_database_connections_proc
    Proc.new {
      ActiveRecord::Base.clear_reloadable_connections!
    }
  end

  def handle_message(ws, msg)
    if msg["cookie"]
      begin
        decoded = Base64.decode64(msg["cookie"].encode('ascii-8bit'))
        decrypted = Encryptor.decrypt(decoded, key: SECRET_KEY)
        user_id = decrypted
        user = User.find_by_id(user_id)
        msg["user_id"] = user_id
      rescue Exception => e
        $SERVER_LOG.error "handle message error = #{e.message}"
        $SERVER_LOG.error "handle message error = #{e.backtrace.inspect}"
        user = nil
      end
    else
      user = nil
    end

    if user
      EM.defer message_recording_proc(ws, msg), clear_database_connections_proc
      ws_array = @open_urls[msg["url"]]
      send_all(ws_array, msg["content"], user.name)
    else
      return_error(ws)
    end
  end

  def send_all(clients, content, name)
    message = {content: content, author: name, time: Time.now}.to_json
    clients.each do |ws|
      ws.send(message)
      # $SERVER_LOG.info "sending #{message}"
    end
  end

  def return_error(ws)
    message = {content: "You are not logged in properly. Please logout and try again.", author: "CONTEXT", time: Time.now}.to_json
    ws.send(message)
  end

  def url_log
    string_urls = {}
    @open_urls.each { |url, clients| string_urls[url] = clients.length }
  end

end


text:
import * as React from 'react';
import { render } from '../../../../__tests__/utils/test-utils';
import { ModuleCornerstone } from '../cornerstone';

describe('ModuleCornerstone', function fnDescribe() {
    const props = {
        className: 'cornerstone',
        content: {
            professionalExperience: 'professionalExperience',
            professionalExperienceList: [
                {
                    headline: 'headline',
                    lead: 'lead',
                    timeStart: '20161212',
                    timeEnd: '20161224',
                    description: ['description1', 'description2']
                }
            ],
            academicEducation: 'academicEducation',
            academicEducationList: [
                {
                    headline: 'headline',
                    lead: 'lead',
                    timeStart: '20161212',
                    timeEnd: '20161224',
                    description: ['description1', 'description2'],
                    place: {}
                }
            ]
        }
    };

    it('should render correctly', function fnIt() {
        const { asFragment } = render(
            <ModuleCornerstone {...props}>
                Module Cornerstone Children
            </ModuleCornerstone>
        );
        expect(asFragment()).toMatchSnapshot();
    });
    it('should return null if no content is empty', function fnIt() {
        const { asFragment } = render(
            <ModuleCornerstone {...props} content={null}>
                Module cornerstone children not rendered
            </ModuleCornerstone>
        );
        expect(asFragment()).toMatchSnapshot();
    });
    it('should render correctly for education only', function fnIt() {
        const { asFragment } = render(
            <ModuleCornerstone
                {...props}
                content={{
                    academicEducation: 'academicEducation',
                    academicEducationList: [
                        {
                            headline: 'headline',
                            lead: 'lead',
                            timeStart: '20161212',
                            timeEnd: '20161224',
                            description: ['description1', 'description2'],
                            place: {}
                        }
                    ]
                }}
            >
                Module cornerstone children
            </ModuleCornerstone>
        );
        expect(asFragment()).toMatchSnapshot();
    });
    it('should render correctly for employee only', function fnIt() {
        const { asFragment } = render(
            <ModuleCornerstone
                {...props}
                content={{
                    professionalExperience: 'professionalExperience',
                    professionalExperienceList: [
                        {
                            headline: 'headline',
                            lead: 'lead',
                            timeStart: '20161212',
                            timeEnd: '20161224',
                            description: ['description1', 'description2']
                        }
                    ]
                }}
            >
                Module cornerstone children
            </ModuleCornerstone>
        );
        expect(asFragment()).toMatchSnapshot();
    });
});


text:
<!DOCTYPE html>

    <title>Quobject 03 Arduino with Electron UI Button Pressing</title>
    <link rel="stylesheet" href="./../../../../node_modules/bootstrap/dist/css/bootstrap.min.css">

    <link rel="stylesheet" href="style.css">

12


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>ISelenium.GetConfirmation Method</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            An NDoc Documented Class Library

ISelenium.GetConfirmation Method

Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
 By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command.

 If an confirmation is generated but you do not consume it with getConfirmation, the next Selenium action will fail.

 NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.

 NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.

string GetConfirmation();

Return Value

the message of the most recent JavaScript confirmation dialog

See Also

ISelenium Interface | Selenium Namespace


text:
import time
import urllib
import json
import ConfigParser as cnfparse
from functools import update_wrapper
from flask import Response, request, g, jsonify

# PARSE CONFIGURATION FILE AS SPECIFED BY --CONFIG
cfg=cnfparse.ConfigParser()
cfg.read('./config.py')

# PARSE STATS CONFIGURATION VARIABLES
REDIS_HOST = cfg.get('redis','host')
REDIS_PORT = cfg.get('redis','port')
QUERY_HOST = cfg.get('slow_queries','hostname')
QUERY_THRESHOLD = cfg.get('slow_queries','threshold')
RLIMIT_TIME = int(cfg.get('rate-limiter','time'))
RLIMIT_LIMIT = int(cfg.get('rate-limiter','limit'))

from redis import Redis
redis = Redis(host='redis')

def cache_key(prefix, delim, suffix=None):
    if suffix:
        return prefix + delim + urllib.urlencode([(k, v) for k in sorted(suffix) for v in sorted(suffix.getlist(k))])
    else:
        return prefix

class RateLimit(object):
    expiration_window = 10

    def __init__(self, key_prefix, limit, per, send_x_headers):
        self.reset = (int(time.time()) // per) * per + per
        self.key = key_prefix + '_' + str(self.reset)
        self.limit = limit
        self.per = per
        self.send_x_headers = send_x_headers
        p = redis.pipeline()
        p.incr(self.key)
        p.expireat(self.key, self.reset + self.expiration_window)
        self.current = min(p.execute()[0], limit)

    remaining = property(lambda x: x.limit - x.current)
    over_limit = property(lambda x: x.current >= x.limit)

def get_view_rate_limit():
    return getattr(g, '_view_rate_limit', None)

def on_over_limit(limit):
    return jsonify({'status': 429, 'message': 'Too Many Requests: You have exceeded global rate limit please wait.'}), 429

def ratelimit(limit=RLIMIT_LIMIT, per=RLIMIT_TIME, send_x_headers=True, over_limit=on_over_limit):
    def decorator(f):
        def rate_limited(*args, **kwargs):
            key = 'RLIMIT:%s' % ( cache_key(request.path, '?', request.args) )
            rlimit = RateLimit(key, limit+1, per, send_x_headers)
            g._view_rate_limit = rlimit
            if over_limit is not None and rlimit.over_limit:
                return over_limit(rlimit)
            return f(*args, **kwargs)
        return update_wrapper(rate_limited, f)
    return decorator

def put_stats(threshold=.1, **kwargs):
    # initiate redis pipe
    pipe = redis.pipeline()
    req = kwargs['request']  # request argument comes from flask
    res = kwargs['response'] # response argument comes from nextbus
    length = int(res.headers.get('Content-Length', 0))

    # increment the hits and bytes COUNT hashes
    pipe.hincrby( 'COUNT:%s' % (req.endpoint), 'hits', 1)
    pipe.hincrby( 'COUNT:%s' % (req.endpoint), 'bytes', length)

    # update the slow queries log
    if res.elapsed.total_seconds() >= QUERY_THRESHOLD:
        kv = {}
        kv['host'] = QUERY_HOST
        kv['status'] = str(res.status_code)
        kv['endpoint'] = req.endpoint
        kv['path'] = req.path
        kv['query_string'] = json.dumps(req.args)
        kv['size'] = int(res.headers.get('Content-Length', 0))
        kv['datetime'] = res.headers.get('Date', '0000-00-00')
        kv['unixtime'] = str(int(time.time()*100))
        kv['latency'] = res.elapsed.total_seconds()
        kv['ip'] = req.remote_addr
        pipe.lpush('SLOW_QUERIES', json.dumps(kv))
    #commit the redis pipe of commands
    pipe.execute()
    return

def get_slow_queries(**kwargs):
    """Simple function to construct and pass the args
    for a redis LRANGE query on the slow_queries log."""
    pipe = redis.pipeline()
    resp = {}
    hash_key='SLOW_QUERIES'
    # minus 1 from the actual integer passed for row limit
    pipe.lrange(hash_key, 0, kwargs['row_limit']-1)
    data=pipe.execute()[0]
    resp['slow_queries'] = [json.loads(d) for d in data]
    return resp

def get_counts(*args):
    """Another simple function to construct the hash_key and args
    for a redis HGETALL query on the COUNT incrementers log."""
    pipe = redis.pipeline()
    resp = {}
    hash_key='COUNT:%s' % (args[0])
    pipe.hgetall(hash_key)
    data=pipe.execute()[0]
    resp['endpoint'] = args[0]
    resp['stats'] = data
    return resp


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.genesisreborn" version="2017.06.27" name="Genesis Reborn" provider-name="Genesis Reborn">
	<requires>
		<import addon="xbmc.python" version="2.19.0" />
		<import addon="repository.jesusboxtv" version="1.0.0" />
		<import addon="script.genesisreborn.artwork" version="1.4.1" />
		<import addon="script.genesisreborn.metadata" version="1.0.0" />
		<import addon="script.module.urlresolver" version="3.0.0" />
		<import addon="script.module.metahandler" version="1.0.0" />
	</requires>
	<extension point="xbmc.python.pluginsource" library="genesisreborn.py">
		<provides>video</provides>
	</extension>
	<extension point="xbmc.addon.metadata">
		<summary lang="en">Genesis Reborn Fork Movies/TV Shows</summary>
		<description lang="en">Created by developer [COLOR yellow]JP Hightek[/COLOR] for Jesus Box Media. Please visit [COLOR red]www.jesusboxmedia.tv[/COLOR] for Genesis Reborn Fork Movies/TV Shows support and assistance! Please remember that genesisreborn is not an official part of the Kodi media player you are running, and therefore is not to be mentioned within official support channels of Kodi, this addon has nothing to do with the media player itself, nor it's intended use, it is simply a third party plugin which has been added to your system.</description>
		<disclaimer lang="en">The author does not host or distribute any of the content displayed by this addon. The author does not have any affiliation with the content provider.</disclaimer>
		<description lang="de">Bitte besuche [COLOR red]www.jesusboxmedia.tv[/COLOR] für Unterstützung und Fragen zu genesisreborn! Beachte dabei, dass genesisreborn nicht offizieller Teil des Media Players ist den du gerade verwendest und daher nicht von dem offiziellen Support-Kanäle abgedeckt wird, dieses Addon hat nichts zu tun mit dem Media-Player selbst, noch ist es dafür beabsichtigt, es handelt sich hierbei lediglich um ein Drittanbieter-Anwendung die dem System hinzugefügt wurde.</description>
		<disclaimer lang="de">Die von diesem Addon dargestellten Inhalte werden von den Erstellern des Addons weder gehostet oder verbreitet, noch stehen die Ersteller in irgendeiner Beziehung zu den Content-Anbietern.</disclaimer>
		<description lang="fr">SVP visitez [COLOR red]www.jesusboxmedia.tv[/COLOR] pour avoir de l'aide sur genesisreborn. Prenez note que genesisreborn n'est pas une partie intégrante de votre outil de visionnement multimedia et SVP ne le mentionnez pas dans les media sociaux officiels, cet addiciel n'a rien a voir avec votre lecteur multimedia lui même, c'est simplement un addiciel qui a été ajouté à votre système.</description>
		<disclaimer lang="fr">L'auteur n'héberge pas ou ne distribue pas le contenu qui vous est affiché avec cet addiciel. L'auteur n'a pas d'alliance avec les distributeurs de contenu.</disclaimer>
		<platform>all</platform>
		<forum>https://www.jesusboxmedia.tv</forum>
		<website>https://www.jesusboxmedia.tv/</website>
		<source>https://jesusboxrepo.xyz/repo</source>
		<assets>
			<icon>icon.png</icon>
			<fanart>fanart.jpg</fanart>
			<screenshot>resources/screenshots/screenshot-01.jpg</screenshot>
			<screenshot>resources/screenshots/screenshot-02.jpg</screenshot>
			<screenshot>resources/screenshots/screenshot-03.jpg</screenshot>
		</assets>
		<news>- Initial release
- Free movies
- Free TV Shows</news>
	</extension>
</addon>


text:
alter table SYS_FTS_QUEUE add INDEXING_HOST varchar(255)^

create index IDX_SYS_FTS_QUEUE_IDXHOST_CRTS on SYS_FTS_QUEUE (INDEXING_HOST, CREATE_TS)^


text:
var fs, _;

_ = Tower._;

fs = require('fs');

Tower.GeneratorResources = {
  generate: function(type) {
    var generator, options;
    options = {
      program: this.program,
      app: this.app,
      user: this.user,
      model: this.model,
      view: this.view,
      controller: this.controller,
      destinationRoot: this.destinationRoot
    };
    generator = this.constructor.buildGenerator(type);
    generator = new generator(options);
    return generator.run();
  },
  nodeModule: function(name, options) {
    if (options == null) {
      options = {};
    }
  },
  locals: function() {
    return {
      model: this.model,
      view: this.view,
      controller: this.controller,
      app: this.app,
      user: this.user,
      _: _,
      printCoffeeOptions: function(options) {
        var key, result, value;
        if (options == null) {
          options = {};
        }
        result = [];
        for (key in options) {
          value = options[key];
          if (typeof value !== 'undefined') {
            value = (function() {
              switch (_.kind(value)) {
                case 'NaN':
                case 'null':
                  return 'null';
                case 'array':
                case 'string':
                case 'integer':
                case 'float':
                case 'number':
                case 'boolean':
                  return JSON.stringify(value);
              }
            })();
            result.push(("" + key + ": " + value).replace(/"/g, "'"));
          }
        }
        return result.join(', ');
      }
    };
  },
  buildAttribute: function(name, type, options) {
    var attribute, defaultValue, fakeKey;
    if (type == null) {
      type = 'string';
    }
    if (options == null) {
      options = {};
    }
    if (!options.hasOwnProperty('default')) {
      defaultValue = (function() {
        switch (type.toLowerCase()) {
          case 'integer':
            return 0;
          case 'array':
            return [];
          default:
            return void 0;
        }
      })();
      if (typeof defaultValue !== 'undefined') {
        options["default"] = defaultValue;
      }
    }
    attribute = {
      name: name,
      options: options,
      type: (function() {
        switch (type.toLowerCase()) {
          case 'text':
            return 'string';
          case 'currency':
            return 'decimal';
          default:
            return type;
        }
      })(),
      humanName: _.humanize(name),
      fieldType: (function() {
        switch (type) {
          case 'float':
          case 'decimal':
          case 'integer':
          case 'number':
          case 'string':
          case 'time':
          case 'date':
          case 'text':
          case 'boolean':
          case 'currency':
          case 'array':
          case 'geo':
            return type;
          default:
            return 'string';
        }
      })(),
      value: (function() {
        switch (type) {
          case 'integer':
            return 0;
          case 'array':
            return [];
          default:
            return "A " + name;
        }
      })()
    };
    switch (type.toLowerCase()) {
      case 'string':
        fakeKey = null;
        if (name.match(/email/i)) {
          fakeKey = 'email';
        } else if (name.match(/username|screenname|login/i)) {
          fakeKey = 'userName';
        } else if (name.match(/domain|url/)) {
          fakeKey = 'domainName';
        } else if (name.match(/^(firstName|lastName)$/)) {
          fakeKey = RegExp.$1;
        } else if (name.match(/^(name|fullName)$/)) {
          fakeKey = 'fullName';
        } else if (name.match('phone')) {
          fakeKey = 'phone';
        } else if (name.match(/text|content|body/)) {
          fakeKey = 'paragraph';
        } else if (name.match(/title/)) {
          fakeKey = 'words';
        }
        if (fakeKey) {
          attribute.fakeKey = fakeKey;
        }
        break;
      case 'boolean':
        attribute.fakeKey = 'boolean';
    }
    return attribute;
  },
  buildRelation: function(type, className, options) {
    var relation;
    relation = {
      name: _.camelize(className, true),
      type: type,
      humanName: _.humanize(className)
    };
    if (_.isPresent(options)) {
      relation.options = options;
    }
    return relation;
  },
  buildModel: function(name, appNamespace, argv) {
    var attributes, className, classNamePlural, humanName, humanNamePlural, isRelation, key, namePlural, namespacedClassName, namespaces, optionKey, optionValue, options, pair, paramName, paramNamePlural, rawOption, rawOptions, relations, type, _i, _j, _len, _len1, _ref, _ref1;
    if (argv == null) {
      argv = [];
    }
    namespaces = name.split('/');
    name = namespaces.pop();
    name = _.camelize(name, true);
    className = _.camelize(name);
    classNamePlural = _.pluralize(className);
    namespacedClassName = "" + appNamespace + "." + className;
    namePlural = _.pluralize(name);
    paramName = _.parameterize(name);
    paramNamePlural = _.parameterize(namePlural);
    humanName = _.humanize(className);
    humanNamePlural = _.pluralize(humanName);
    attributes = [];
    relations = {
      belongsTo: [],
      hasOne: [],
      hasMany: []
    };
    argv.splice(0, 3);
    for (_i = 0, _len = argv.length; _i < _len; _i++) {
      pair = argv[_i];
      rawOptions = null;
      if (pair.match(/\[/)) {
        pair = pair.replace(/([^\[]+)\[(.+)/, function(_, $1, $2) {
          rawOptions = $2;
          return pair = $1;
        });
      } else {
        _ref = pair.split(/\[/), pair = _ref[0], rawOptions = _ref[1];
      }
      pair = pair.split(':');
      key = pair[0];
      isRelation = !!key.match(/(belongsTo|hasMany|hasOne)/);
      if (pair.length > 1) {
        type = pair[1];
      } else {
        type = key.match(/count$/i) ? 'Integer' : key.match(/At$/) ? 'Date' : 'String';
      }
      type = _.camelize(type || 'String', true);
      options = {};
      if (!_.isBlank(rawOptions)) {
        rawOptions = rawOptions.replace(/\]$/, '').split(/,\s*/);
        for (_j = 0, _len1 = rawOptions.length; _j < _len1; _j++) {
          rawOption = rawOptions[_j];
          _ref1 = rawOption = rawOption.split(':'), optionKey = _ref1[0], optionValue = _ref1[1];
          if (rawOption.length === 1) {
            optionValue = optionKey;
            if (isRelation) {
              optionKey = 'type';
            } else {
              optionKey = 'default';
            }
          }
          if (optionKey === 'type') {
            optionValue = _.camelize(optionValue);
          }
          try {
            options[optionKey] = JSON.parse(optionValue);
          } catch (error) {
            options[optionKey] = optionValue;
          }
        }
      }
      rawOptions = null;
      if (isRelation) {
        relations[key].push(this.buildRelation(key, _.camelize(type), options));
      } else {
        attributes.push(this.buildAttribute(key, _.camelize(type), options));
      }
    }
    return {
      name: name,
      namespace: appNamespace,
      className: className,
      classNamePlural: classNamePlural,
      namespacedClassName: namespacedClassName,
      namePlural: namePlural,
      paramName: paramName,
      paramNamePlural: paramNamePlural,
      humanName: humanName,
      humanNamePlural: humanNamePlural,
      attributes: attributes,
      relations: relations,
      namespacedDirectory: namespaces.join('/'),
      viewDirectory: namespaces.join('/') + ("/" + namePlural),
      namespaced: _.map(namespaces, function(n) {
        return _.camelize(n);
      }).join('.')
    };
  },
  buildApp: function(name) {
    var _base;
    if (name == null) {
      name = this.appName;
    }
    (_base = this.program).namespace || (_base.namespace = Tower.namespace());
    return {
      name: name,
      namespace: _.camelize(this.program.namespace),
      paramName: _.parameterize(name),
      paramNamePlural: _.parameterize(_.pluralize(name)),
      session: this.generateRandom('hex'),
      year: (new Date).getFullYear(),
      directory: name,
      isStatic: true
    };
  },
  buildView: function(name) {
    name = _.map(name.split('/'), function(n) {
      return _.camelize(n, true);
    }).join('/');
    return {
      namespace: name,
      directory: _.pluralize(name)
    };
  },
  buildController: function(name) {
    var className, directory, namespace, namespaces;
    namespaces = name.split('/');
    className = _.pluralize(_.camelize(namespaces[namespaces.length - 1])) + 'Controller';
    if (namespaces.length > 1) {
      namespaces = namespaces.slice(0, -1);
      directory = _.map(namespaces, function(n) {
        return _.camelize(n, true);
      }).join('/');
      namespace = this.app.namespace + '.' + _.map(namespaces, function(n) {
        return _.camelize(n);
      }).join('.');
    } else {
      namespace = this.app.namespace;
      directory = '';
    }
    return {
      namespace: namespace,
      className: className,
      directory: directory,
      name: _.camelize(className, true),
      namespaced: directory !== ''
    };
  },
  generateRandom: function(code) {
    var crypto, hash, uuid;
    if (code == null) {
      code = 'hex';
    }
    crypto = require('crypto');
    uuid = require('node-uuid');
    hash = crypto.createHash('sha1');
    hash.update(uuid.v4());
    return hash.digest(code);
  },
  buildUser: function(callback) {
    var gitConfig, gitFile, key, line, lines, user, value, variable, _i, _len;
    gitFile = "" + process.env.HOME + "/.gitconfig";
    gitConfig = {};
    user = {};
    try {
      if (fs.existsSync(gitFile)) {
        lines = fs.readFileSync(gitFile, 'utf-8').split('\n');
        for (_i = 0, _len = lines.length; _i < _len; _i++) {
          line = lines[_i];
          if (line.charAt(0) !== '#' && line.match(/\S/)) {
            if (line.match(/^\[(.*)\]$/)) {
              variable = RegExp.$1;
            } else {
              line = line.split('=');
              key = line[0].trim();
              value = line[1].trim();
              gitConfig[variable] || (gitConfig[variable] = {});
              gitConfig[variable][key] = value;
            }
          }
        }
      }
      user.name = gitConfig.user && gitConfig.user.name ? gitConfig.user.name : 'username';
      user.email = gitConfig.user && gitConfig.user.email ? gitConfig.user.email : 'user@example.com';
      user.username = gitConfig.github && gitConfig.github.user ? gitConfig.github.user : 'User';
    } catch (error) {
      this;

    }
    user.name || (user.name = 'username');
    user.email || (user.email = 'user@example.com');
    user.username || (user.username = 'User');
    user.database = 'mongodb';
    if (callback) {
      callback(user);
    }
    return user;
  }
};

module.exports = Tower.GeneratorResources;


text:
package demo.java.v2c12.Printf2Test;
/**
 * @version 1.10 1997-07-01
 * @author Cay Horstmann
 */
class Printf2
{
   public static native String sprint(String format, double x);

   static
   {
      System.loadLibrary("Printf2");
   }
}


text:
  Langon est
      une ville localisée dans le département de Gironde en Aquitaine. On dénombrait 7 135 habitants en 2008.

La commune offre de nombreux  aménagements, elle dispose, entre autres, de deux bassins de natation, un terrain de tennis, deux centres d'équitation et une boucle de randonnée.

À proximité de Langon sont positionnées géographiquement les villes de
Verdelais située à 3 km, 826 habitants,
Saint-Macaire localisée à 1 km, 1 670 habitants,
Saint-Maixant localisée à 2 km, 1 375 habitants,
Toulenne à 1 km, 2 405 habitants,
Fargues située à 4 km, 1 526 habitants,
Sainte-Croix-du-Mont située à 4 km, 824 habitants,
 entre autres.

La commune est équipée s'agissant de l'éducation des jeunes de trois collèges et un lycée.
Pour les plus petits d'entre nous, la commune est pourvue de une maternelle et deux écoles primaires.
Langon dispose des installations permettant une vie àgréable.
Lors d'un projet de faire l'acquisition d'un bien immobilier à Langon, vous devrez impérativement regarder la notoriété des équipements éducatifs

Langon apparait comme une ville où de nombreux marchants sont installés.
Il y a à Langon un hypermarché, cinq supermarchés et huit supérettes.
Langon apparait comme une commune plutôt attractive pour un investissement immobilier.
A l'occasion d'un achat immobilier la distance à laquelle se trouvent les  boutiques joue sur le prix du bien

Le nombre de logements, à Langon, était réparti en 2011 en 2 048 appartements et 2 328 maisons soit
 un marché plutôt équilibré.

À Langon le salaire moyen mensuel par individu se situe à approximativement 1 876 €  net. Ceci est inférieur à la moyenne du pays.

À Langon, la valorisation moyenne à l'achat d'un appartement se situe à 1 197 € du m² en vente. Le prix moyen d'une maison à l'achat se situe à 1 612 € du m². À la location la valeur moyenne se situe à 8,58 € du m² par mois.


text:
layout: post
title: "Dev Log"
date: 2018-01-01
excerpt: "Dev Log for the game I'm working on"
tags: []
comments: true
draft: true
---

Coming Soon...


text:
'use strict';

const mdash = '\u2014';

module.exports = {
    '@tags': ['title'],

    'stays unchanged in `list` mode': (browser) => {
        browser.url(`${browser.launchUrl}/list-title`);
        browser.assert.title('title');
        browser.end();
    },

    'stays unchanged in `full` mode if slide title is missing': (browser) => {
        browser.url(`${browser.launchUrl}/list-title#2`);
        browser.assert.title('title');
        browser.end();
    },

    'gets prepended with current slide title in `full` mode': (browser) => {
        browser.url(`${browser.launchUrl}/full-title`);
        browser.assert.title(`1 ${mdash} title`);
        browser.end();
    },

    'gets stripped from HTML tags while prepending': (browser) => {
        browser.url(`${browser.launchUrl}/full-title#3`);
        browser.assert.title(`3 ${mdash} title`);
        browser.end();
    },

    'does not update when moving forwards in `list` mode': (browser) => {
        browser.url(`${browser.launchUrl}/list-title#2`);
        browser.assert.title('title');
        browser.sendKeys('.send-keys', browser.Keys.ARROW_RIGHT);
        browser.assert.title('title');
        browser.end();
    },

    'does not update when moving backwards in `list` mode': (browser) => {
        browser.url(`${browser.launchUrl}/list-title#2`);
        browser.assert.title('title');
        browser.sendKeys('.send-keys', browser.Keys.ARROW_LEFT);
        browser.assert.title('title');
        browser.end();
    },

    'updates when moving forwards in `full` mode': (browser) => {
        browser.url(`${browser.launchUrl}/full-title`);
        browser.assert.title(`1 ${mdash} title`);
        browser.sendKeys('.send-keys', browser.Keys.ARROW_RIGHT);
        browser.assert.title('title');
        browser.sendKeys('.send-keys', browser.Keys.ARROW_RIGHT);
        browser.assert.title(`3 ${mdash} title`);
        browser.end();
    },

    'updates when moving backwards in `full` mode': (browser) => {
        browser.url(`${browser.launchUrl}/full-title#3`);
        browser.assert.title(`3 ${mdash} title`);
        browser.sendKeys('.send-keys', browser.Keys.ARROW_LEFT);
        browser.assert.title('title');
        browser.sendKeys('.send-keys', browser.Keys.ARROW_LEFT);
        browser.assert.title(`1 ${mdash} title`);
        browser.end();
    },

    'updates when changing `list` to `full` mode': (browser) => {
        browser.url(`${browser.launchUrl}/list-title`);
        browser.assert.title('title');
        browser.click('[id="1"]');
        browser.assert.title(`1 ${mdash} title`);
        browser.end();
    },

    'updates when changing `full` to `list` mode': (browser) => {
        browser.url(`${browser.launchUrl}/full-title`);
        browser.assert.title(`1 ${mdash} title`);
        browser.sendKeys('.send-keys', browser.Keys.ESCAPE);
        browser.assert.title('title');
        browser.end();
    },
};


text:
describe('Crone of Vaes Dothrak', function() {
    integration(function() {
        beforeEach(function() {
            const deck1 = this.buildDeck('targaryen', [
                'A Noble Cause',
                'Crone of Vaes Dothrak', 'Braided Warrior', 'Black Wind\'s Crew'
            ]);
            const deck2 = this.buildDeck('lannister', [
                'Sneak Attack',
                'Hedge Knight', 'Hedge Knight', 'The Roseroad', 'The Roseroad'
            ]);
            this.player1.selectDeck(deck1);
            this.player2.selectDeck(deck2);
            this.startGame();
            this.keepStartingHands();
            this.player1.clickCard('Crone of Vaes Dothrak', 'hand');
            this.player1.clickCard('Braided Warrior', 'hand');
            this.player1.clickCard('Black Wind\'s Crew', 'hand');
            this.completeSetup();
            this.player1.selectPlot('A Noble Cause');
            this.player2.selectPlot('Sneak Attack');
            this.selectFirstPlayer(this.player1);
        });

        describe('when a card is discarded from the draw deck', function() {
            describe('when a character gets discarded', function() {
                beforeEach(function() {
                    // Move characters back to draw
                    this.player2Object.hand.each(card => {
                        if(card.getType() === 'character') {
                            this.player2Object.moveCard(card, 'draw deck');
                        }
                    });

                    this.completeMarshalPhase();
                    this.unopposedChallenge(this.player1, 'Power', 'Black Wind\'s Crew');
                    this.player1.clickPrompt('Apply Claim');
                });

                it('should move the opponent character into the dead pile', function() {
                    this.player1.clickPrompt('Crone of Vaes Dothrak');
                    this.player1.clickCard('Crone of Vaes Dothrak', 'play area');

                    expect(this.player2Object.discardPile.size()).toBe(0);
                    expect(this.player2Object.deadPile.size()).toBe(1);
                });
            });

            describe('when a non-character gets discarded', function() {
                beforeEach(function() {
                    // Move non-characters back to draw
                    this.player2Object.hand.each(card => {
                        if(card.getType() !== 'character') {
                            this.player2Object.moveCard(card, 'draw deck');
                        }
                    });

                    this.completeMarshalPhase();
                    this.unopposedChallenge(this.player1, 'Power', 'Black Wind\'s Crew');
                    this.player1.clickPrompt('Apply Claim');
                });

                it('should move the opponent character into the discard pile', function() {
                    expect(this.player1).not.toHavePromptButton('Crone of Vaes Dothrak');
                    expect(this.player2Object.discardPile.size()).toBe(1);
                    expect(this.player2Object.deadPile.size()).toBe(0);
                });
            });
        });

        describe('when a card is discarded from hand', function() {
            describe('when a character gets discarded', function() {
                beforeEach(function() {
                    // Move non-characters back to draw
                    this.player2Object.hand.each(card => {
                        if(card.getType() !== 'character') {
                            this.player2Object.moveCard(card, 'draw deck');
                        }
                    });

                    this.completeMarshalPhase();
                    this.unopposedChallenge(this.player1, 'Intrigue', 'Crone of Vaes Dothrak');
                    this.player1.clickPrompt('Apply Claim');
                });

                it('should move the opponent character into the dead pile', function() {
                    this.player1.clickPrompt('Crone of Vaes Dothrak');
                    this.player1.clickCard('Braided Warrior', 'play area');

                    expect(this.player2Object.discardPile.size()).toBe(0);
                    expect(this.player2Object.deadPile.size()).toBe(1);
                });
            });

            describe('when a non-character gets discarded', function() {
                beforeEach(function() {
                    // Move characters back to draw
                    this.player2Object.hand.each(card => {
                        if(card.getType() === 'character') {
                            this.player2Object.moveCard(card, 'draw deck');
                        }
                    });

                    this.completeMarshalPhase();
                    this.unopposedChallenge(this.player1, 'Intrigue', 'Crone of Vaes Dothrak');
                    this.player1.clickPrompt('Apply Claim');
                });

                it('should move the opponent character into the discard pile', function() {
                    expect(this.player1).not.toHavePromptButton('Crone of Vaes Dothrak');
                    expect(this.player2Object.discardPile.size()).toBe(1);
                    expect(this.player2Object.deadPile.size()).toBe(0);
                });
            });
        });
    });
});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_height="match_parent"
	android:layout_width="match_parent"
	android:background="#208FFF">

	<ScrollView
		android:layout_height="350dp"
		android:layout_width="match_parent"
		android:background="#D9D9D9"
		android:alpha="0.7"
		android:id="@+id/ruleScrollView1"
		android:layout_marginTop="80dp">

		<LinearLayout
			android:layout_height="wrap_content"
			android:layout_width="wrap_content"
			android:orientation="vertical">

			<TextView
				android:layout_height="wrap_content"
				android:text="Apache Commons Net&#xD;\n Copyright 2001-2013 The Apache Software Foundation&#xD;\n &#xD;\n Licensed under the Apache License, Version 2.0 (the License);\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an AS IS BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n본 애플리케이션은 아파치 라이센스 2.0에 의해\n보호받습니다."
				android:layout_width="wrap_content"/>

		</LinearLayout>

	</ScrollView>

	<LinearLayout
		android:layout_height="wrap_content"
		android:layout_width="wrap_content"
		android:orientation="horizontal"
		android:layout_below="@id/ruleScrollView1">

		<Button
			android:layout_height="wrap_content"
			android:text="계속하기"
			android:layout_width="wrap_content"
			android:background="#09B2F9"
			android:singleLine="false" />

		<Button
			android:layout_height="wrap_content"
			android:text="취소"
			android:layout_width="wrap_content"
			android:background="#12A9FF"/>

	</LinearLayout>

	<TextView
		android:layout_height="wrap_content"
		android:text="라이센스"
		android:textAppearance="?android:attr/textAppearanceLarge"
		android:layout_width="wrap_content"/>

</RelativeLayout>


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

#include "chrome/browser/performance_manager/policies/page_discarding_helper.h"

#include <memory>

#include "base/strings/string_number_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/performance_manager/policies/policy_features.h"
#include "chrome/browser/performance_manager/test_support/page_discarding_utils.h"
#include "components/performance_manager/public/decorators/page_live_state_decorator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace performance_manager {
namespace policies {

using ::testing::Return;

class PageDiscardingHelperTest
    : public testing::GraphTestHarnessWithMockDiscarder {
 public:
  PageDiscardingHelperTest() = default;
  ~PageDiscardingHelperTest() override = default;
  PageDiscardingHelperTest(const PageDiscardingHelperTest& other) = delete;
  PageDiscardingHelperTest& operator=(const PageDiscardingHelperTest&) = delete;

  void SetUp() override {
    testing::GraphTestHarnessWithMockDiscarder::SetUp();

    histogram_tester_ = std::make_unique<base::HistogramTester>();
  }

  void TearDown() override {
    histogram_tester_.reset();
    testing::GraphTestHarnessWithMockDiscarder::TearDown();
  }

 protected:
  base::HistogramTester* histogram_tester() { return histogram_tester_.get(); }

 private:
  std::unique_ptr<base::HistogramTester> histogram_tester_;
};

TEST_F(PageDiscardingHelperTest, TestCannotDiscardVisiblePage) {
  page_node()->SetIsVisible(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardAudiblePage) {
  page_node()->SetIsAudible(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest,
       TestCannotDiscardPageWithDiscardAttemptMarker) {
  PageDiscardingHelper::GetFromGraph(graph())
      ->AddDiscardAttemptMarkerForTesting(page_node());
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardRecentlyAudiblePage) {
  page_node()->SetIsAudible(true);
  page_node()->SetIsAudible(false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(PageDiscardingHelperTest,
       TestCannotDiscardRecentlyVisiblePageUnlessExplicitlyRequested) {
  page_node()->SetIsVisible(true);
  page_node()->SetIsVisible(false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node(), /* consider_minimum_protection_time */ false));
}
#endif

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPdf) {
  page_node()->OnMainFrameNavigationCommitted(false, base::TimeTicks::Now(), 53,
                                              GURL("https://foo.com/doc.pdf"),
                                              "application/pdf");
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageWithoutMainFrame) {
  ResetFrameNode();
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardExtension) {
  frame_node()->OnNavigationCommitted(GURL("chrome-extention://foo"), false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageWithInvalidURL) {
  frame_node()->OnNavigationCommitted(GURL("foo42"), false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageProtectedByExtension) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsAutoDiscardableForTesting(false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageCapturingVideo) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsCapturingVideoForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageCapturingAudio) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsCapturingAudioForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageBeingMirrored) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsBeingMirroredForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageCapturingWindow) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsCapturingWindowForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageCapturingDisplay) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsCapturingDisplayForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest,
       TestCannotDiscardPageConnectedToBluetoothDevice) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsConnectedToBluetoothDeviceForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardIsConnectedToUSBDevice) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetIsConnectedToUSBDeviceForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageMultipleTimes) {
  PageLiveStateDecorator::Data::GetOrCreateForPageNode(page_node())
      ->SetWasDiscardedForTesting(true);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}
#endif

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageWithFormInteractions) {
  frame_node()->SetHadFormInteraction();
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

TEST_F(PageDiscardingHelperTest, TestCannotDiscardPageOnNoDiscardList) {
  base::test::ScopedFeatureList feature_list;
  feature_list.InitWithFeatures({features::kHighEfficiencyModeAvailable,
                                 features::kBatterySaverModeAvailable},
                                {});
  // static_cast page_node because it's declared as a PageNodeImpl which hides
  // the members it overrides from PageNode.
  PageDiscardingHelper::GetFromGraph(graph())->SetNoDiscardPatternsForProfile(
      static_cast<PageNode*>(page_node())->GetBrowserContextID(),
      {"youtube.com"});
  frame_node()->OnNavigationCommitted(GURL("https://www.youtube.com"), false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));

  frame_node()->OnNavigationCommitted(GURL("https://www.example.com"), false);
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));

  // Changing the no discard list rebuilds the matcher
  PageDiscardingHelper::GetFromGraph(graph())->SetNoDiscardPatternsForProfile(
      static_cast<PageNode*>(page_node())->GetBrowserContextID(),
      {"google.com"});
  frame_node()->OnNavigationCommitted(GURL("https://www.youtube.com"), false);
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
  frame_node()->OnNavigationCommitted(GURL("https://www.google.com"), false);
  EXPECT_FALSE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));

  // Setting the no discard list to empty makes all URLs discardable again.
  PageDiscardingHelper::GetFromGraph(graph())->SetNoDiscardPatternsForProfile(
      static_cast<PageNode*>(page_node())->GetBrowserContextID(), {});
  frame_node()->OnNavigationCommitted(GURL("https://www.google.com"), false);
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
}

// Tests UrgentlyDiscardMultiplePages.

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardMultiplePagesNoCandidate) {
  page_node()->SetIsVisible(true);

  // When discard_protected_tabs is false, protected page can not be discarded.
  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 1024,
      /*discard_protected_tabs*/ false,
      base::BindOnce([](bool success) { EXPECT_FALSE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardMultiplePagesDiscardProtected) {
  page_node()->SetIsVisible(true);

  // When discard_protected_tabs is true, protected page can be discarded.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 1024,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardMultiplePagesTwoCandidates) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node2.get()));

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(1024);

  // 2 candidates should both be discarded.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(true));
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 2048,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest,
       UrgentlyDiscardMultiplePagesTwoCandidatesProtected) {
  // page_node() is audible and should not be discarded.
  page_node()->SetIsAudible(true);

  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node2.get()));

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(1024);

  // When discard_protected_tabs is false, it should not discard protected page
  // even with large reclaim_target_kb.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 1000000,
      /*discard_protected_tabs*/ false,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardMultiplePagesThreeCandidates) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  auto process_node3 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node3 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node3 =
      CreateFrameNodeAutoId(process_node3.get(), page_node3.get());
  main_frame_node3->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node3.get(), task_env());

  page_node2->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node2->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));

  // |page_node3| is the most recently visible page.
  page_node3->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node3->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(1024);
  process_node3->set_resident_set_kb(1024);

  // The 2 candidates with earlier last visible time should be discarded.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(true));
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 1500,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
  histogram_tester()->ExpectBucketCount("Discarding.DiscardCandidatesCount", 3,
                                        1);
}

TEST_F(PageDiscardingHelperTest,
       UrgentlyDiscardMultiplePagesThreeCandidatesWithPriority) {
  // page_node() is audible and should have lower discard priority.
  page_node()->SetIsAudible(true);

  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  auto process_node3 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node3 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node3 =
      CreateFrameNodeAutoId(process_node3.get(), page_node3.get());
  main_frame_node3->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node3.get(), task_env());

  page_node2->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node2->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));

  // |page_node3| is the most recently visible page.
  page_node3->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node3->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(1024);
  process_node3->set_resident_set_kb(1024);

  // Protected pages should have lower discard priority.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node3.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 1500,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardMultiplePagesNoDiscardable) {
  // UrgentlyDiscardMultiplePages should not retry indefinitely when all nodes
  // are not discardable.

  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(1024);

  // Discarding failed on all nodes.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(false));
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(false));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ 10240,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_FALSE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

// Tests UrgentlyDiscardAPage.

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageNoCandidate) {
  page_node()->SetIsVisible(true);
  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_FALSE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageSingleCandidate) {
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(true));
  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
  histogram_tester()->ExpectBucketCount("Discarding.DiscardCandidatesCount", 1,
                                        1);
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageSingleCandidateFails) {
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(false));
  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_FALSE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
  // There should be 2 discard attempts, during the first one an attempt will be
  // made to discard |page_node()|, on the second attempt no discard candidate
  // should be found.
  histogram_tester()->ExpectBucketCount("Discarding.DiscardCandidatesCount", 1,
                                        1);

  histogram_tester()->ExpectBucketCount("Discarding.DiscardCandidatesCount", 0,
                                        1);
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageTwoCandidates) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  // Pretend that |page_node2| is the most recently visible page.
  page_node2->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node2->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node2.get()));
  EXPECT_GT(page_node()->TimeSinceLastVisibilityChange(),
            page_node2->TimeSinceLastVisibilityChange());

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(2048);

    EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
        .WillOnce(Return(true));

    PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
        base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
    ::testing::Mock::VerifyAndClearExpectations(discarder());

  histogram_tester()->ExpectBucketCount("Discarding.DiscardCandidatesCount", 2,
                                        1);
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageTwoCandidatesFirstFails) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(2048);

  // Pretends that the first discardable page hasn't been discarded
  // successfully, the other one should be discarded in this case.
  ::testing::InSequence in_sequence;
  // The first candidate is the least recently used tab.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(false));
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest,
       UrgentlyDiscardAPageTwoCandidatesMultipleFrames) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());
  // Adds a second frame to |page_node()| and host it in |process_node2|.
  auto page_node1_extra_frame =
      CreateFrameNodeAutoId(process_node2.get(), page_node(), frame_node());

  process_node()->set_resident_set_kb(1024);
  process_node2->set_resident_set_kb(2048);

  // The total RSS of |page_node()| should be 1024 + 2048 / 2 = 2048 and the
  // RSS of |page_node2| should be 2048 / 2 = 1024, so |page_node()| will get
  // discarded despite having spent less time in background than |page_node2|.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

TEST_F(PageDiscardingHelperTest, UrgentlyDiscardAPageTwoCandidatesNoRSSData) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  // Pretend that |page_node()| is the most recently visible page.
  page_node()->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node()->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
  EXPECT_GT(page_node2->TimeSinceLastVisibilityChange(),
            page_node()->TimeSinceLastVisibilityChange());

  // |page_node2| should be discarded as there's no RSS data for any of the
  // pages and it's the least recently visible page.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardAPage(
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

// Tests UrgentlyDiscardMultiplePages with reclaim_target_kb == nullopt.

TEST_F(PageDiscardingHelperTest,
       UrgentlyDiscardMultiplePagesTwoCandidatesNoRSSData) {
  auto process_node2 = CreateNode<performance_manager::ProcessNodeImpl>();
  auto page_node2 = CreateNode<performance_manager::PageNodeImpl>();
  auto main_frame_node2 =
      CreateFrameNodeAutoId(process_node2.get(), page_node2.get());
  main_frame_node2->SetIsCurrent(true);
  testing::MakePageNodeDiscardable(page_node2.get(), task_env());

  // Pretend that |page_node()| is the most recently visible page.
  page_node()->SetIsVisible(true);
  AdvanceClock(base::Minutes(30));
  page_node()->SetIsVisible(false);
  AdvanceClock(base::Minutes(30));
  EXPECT_TRUE(
      PageDiscardingHelper::GetFromGraph(graph())->CanUrgentlyDiscardForTesting(
          page_node()));
  EXPECT_GT(page_node2->TimeSinceLastVisibilityChange(),
            page_node()->TimeSinceLastVisibilityChange());

  // |page_node2| should be discarded as there's no RSS data for any of the
  // pages and it's the least recently visible page.
  EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node2.get()))
      .WillOnce(Return(true));

  PageDiscardingHelper::GetFromGraph(graph())->UrgentlyDiscardMultiplePages(
      /*reclaim_target_kb*/ absl::nullopt,
      /*discard_protected_tabs*/ true,
      base::BindOnce([](bool success) { EXPECT_TRUE(success); }));
  ::testing::Mock::VerifyAndClearExpectations(discarder());
}

}  // namespace policies
}  // namespace performance_manager


text:
/*
 * AnimatedMeshSceneNode.cpp
 *
 *  Created on: 2016年5月29日
 *      Author: lijing
 */

#include "pola/utils/Math.h"
#include "pola/scene/node/AnimatedMeshSceneNode.h"

namespace pola {
namespace scene {

AnimatedMeshSceneNode::AnimatedMeshSceneNode(AnimatedMesh* mesh) : AbsMeshSceneNode(mesh),
	mStartFrameLoop(0), mEndFrameLoop(mesh->getFrameCount()), mFramesPerSecond(mesh->getFramesPerSecond()), mCurrentFrame(0), mLastTimeMs(0) {
}

AnimatedMeshSceneNode::~AnimatedMeshSceneNode() {
}

void AnimatedMeshSceneNode::setFrameLoop(int32_t startFrame, int32_t endFrame) {
	mStartFrameLoop = startFrame;
	mEndFrameLoop = endFrame;
	if (mFramesPerSecond < 0) {
		setCurrentFrame((float) mEndFrameLoop);
	} else {
		setCurrentFrame((float) mStartFrameLoop);
	}
}

float AnimatedMeshSceneNode::getCurrentFrame() const {
	return mCurrentFrame;
}

int32_t AnimatedMeshSceneNode::getStartFrameLoop() const {
	return mStartFrameLoop;
}

int32_t AnimatedMeshSceneNode::getEndFrameLoop() const {
	return mEndFrameLoop;
}

void AnimatedMeshSceneNode::setFramesPerSecond(float fps) {
	mFramesPerSecond = fps;
}

void AnimatedMeshSceneNode::setCurrentFrame(float frame) {
	mCurrentFrame = utils::fclamp<float>(frame, (float) mStartFrameLoop, (float) mEndFrameLoop);
}

void AnimatedMeshSceneNode::update(p_nsecs_t timeMs) {
	buildCurrentFrame(timeMs);
	((AnimatedMesh*) mMesh)->updateMeshBuffer(getCurrentFrame(), getStartFrameLoop(), getEndFrameLoop());
}

void AnimatedMeshSceneNode::buildCurrentFrame(p_nsecs_t timeMs) {
	if (mLastTimeMs == 0) {
		mLastTimeMs = timeMs;
	}

	p_nsecs_t interval = timeMs - mLastTimeMs;
	mLastTimeMs = timeMs;

	if (mStartFrameLoop == mEndFrameLoop) {
		mCurrentFrame = mStartFrameLoop;
	} else {
		// play animation looped
		mCurrentFrame += interval * mFramesPerSecond / 1000.f;

		// We have no interpolation between EndFrame and StartFrame,
		// the last frame must be identical to first one with our current solution.
		if (mFramesPerSecond > 0.f) //forwards...
		{
			if (mCurrentFrame > mEndFrameLoop)
				mCurrentFrame = mStartFrameLoop + fmod(mCurrentFrame - mStartFrameLoop, (float) (mEndFrameLoop - mStartFrameLoop));
		}
		else //backwards...
		{
			if (mCurrentFrame < mStartFrameLoop)
				mCurrentFrame = mEndFrameLoop - fmod(mEndFrameLoop - mCurrentFrame, (float) (mEndFrameLoop - mStartFrameLoop));
		}
	}
}

} /* namespace scene */
} /* namespace pola */


text:
namespace Google.Cloud.ContactCenterInsights.V1.Snippets
{
    // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_sync_flattened]
    using Google.Cloud.ContactCenterInsights.V1;

    public sealed partial class GeneratedContactCenterInsightsClientSnippets
    {
        /// <summary>Snippet for GetPhraseMatcher</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void GetPhraseMatcher()
        {
            // Create client
            ContactCenterInsightsClient contactCenterInsightsClient = ContactCenterInsightsClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/phraseMatchers/[PHRASE_MATCHER]";
            // Make the request
            PhraseMatcher response = contactCenterInsightsClient.GetPhraseMatcher(name);
        }
    }
    // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_sync_flattened]
}


text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2007-2009 Strasbourg University
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: David Gross <gdavid.devel@gmail.com>
 */

#include "ns3/log.h"
#include "ns3/assert.h"
#include "ns3/uinteger.h"
#include "ipv6-option.h"
#include "ipv6-option-header.h"

namespace ns3
{

NS_LOG_COMPONENT_DEFINE ("Ipv6Option");

NS_OBJECT_ENSURE_REGISTERED (Ipv6Option);

TypeId Ipv6Option::GetTypeId ()
{
  static TypeId tid = TypeId ("ns3::Ipv6Option")
    .SetParent<Object> ()
    .SetGroupName ("Internet")
    .AddAttribute ("OptionNumber", "The IPv6 option number.",
                   UintegerValue (0),
                   MakeUintegerAccessor (&Ipv6Option::GetOptionNumber),
                   MakeUintegerChecker<uint8_t> ())
  ;
  return tid;
}

Ipv6Option::~Ipv6Option ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

void Ipv6Option::SetNode (Ptr<Node> node)
{
  NS_LOG_FUNCTION (this << node);
  m_node = node;
}

NS_OBJECT_ENSURE_REGISTERED (Ipv6OptionPad1);

TypeId Ipv6OptionPad1::GetTypeId ()
{
  static TypeId tid = TypeId ("ns3::Ipv6OptionPad1")
    .SetParent<Ipv6Option> ()
    .SetGroupName ("Internet")
    .AddConstructor<Ipv6OptionPad1> ()
  ;
  return tid;
}

Ipv6OptionPad1::Ipv6OptionPad1 ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

Ipv6OptionPad1::~Ipv6OptionPad1 ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

uint8_t Ipv6OptionPad1::GetOptionNumber () const
{
  NS_LOG_FUNCTION_NOARGS ();

  return OPT_NUMBER;
}

uint8_t Ipv6OptionPad1::Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped)
{
  NS_LOG_FUNCTION (this << packet << offset << ipv6Header << isDropped);

  Ptr<Packet> p = packet->Copy ();
  p->RemoveAtStart (offset);

  Ipv6OptionPad1Header pad1Header;
  p->RemoveHeader (pad1Header);

  isDropped = false;

  return pad1Header.GetSerializedSize ();
}

NS_OBJECT_ENSURE_REGISTERED (Ipv6OptionPadn);

TypeId Ipv6OptionPadn::GetTypeId ()
{
  static TypeId tid = TypeId ("ns3::Ipv6OptionPadn")
    .SetParent<Ipv6Option> ()
    .SetGroupName ("Internet")
    .AddConstructor<Ipv6OptionPadn> ()
  ;
  return tid;
}

Ipv6OptionPadn::Ipv6OptionPadn ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

Ipv6OptionPadn::~Ipv6OptionPadn ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

uint8_t Ipv6OptionPadn::GetOptionNumber () const
{
  NS_LOG_FUNCTION_NOARGS ();

  return OPT_NUMBER;
}

uint8_t Ipv6OptionPadn::Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped)
{
  NS_LOG_FUNCTION (this << packet << offset << ipv6Header << isDropped);

  Ptr<Packet> p = packet->Copy ();
  p->RemoveAtStart (offset);

  Ipv6OptionPadnHeader padnHeader;
  p->RemoveHeader (padnHeader);

  isDropped = false;

  return padnHeader.GetSerializedSize ();
}

NS_OBJECT_ENSURE_REGISTERED (Ipv6OptionJumbogram);

TypeId Ipv6OptionJumbogram::GetTypeId ()
{
  static TypeId tid = TypeId ("ns3::Ipv6OptionJumbogram")
    .SetParent<Ipv6Option> ()
    .SetGroupName ("Internet")
    .AddConstructor<Ipv6OptionJumbogram> ()
  ;
  return tid;
}

Ipv6OptionJumbogram::Ipv6OptionJumbogram ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

Ipv6OptionJumbogram::~Ipv6OptionJumbogram ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

uint8_t Ipv6OptionJumbogram::GetOptionNumber () const
{
  NS_LOG_FUNCTION_NOARGS ();

  return OPT_NUMBER;
}

uint8_t Ipv6OptionJumbogram::Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped)
{
  NS_LOG_FUNCTION (this << packet << offset << ipv6Header << isDropped);

  Ptr<Packet> p = packet->Copy ();
  p->RemoveAtStart (offset);

  Ipv6OptionJumbogramHeader jumbogramHeader;
  p->RemoveHeader (jumbogramHeader);

  isDropped = false;

  return jumbogramHeader.GetSerializedSize ();
}

NS_OBJECT_ENSURE_REGISTERED (Ipv6OptionRouterAlert);

TypeId Ipv6OptionRouterAlert::GetTypeId ()
{
  static TypeId tid = TypeId ("ns3::Ipv6OptionRouterAlert")
    .SetParent<Ipv6Option> ()
    .SetGroupName ("Internet")
    .AddConstructor<Ipv6OptionRouterAlert> ()
  ;
  return tid;
}

Ipv6OptionRouterAlert::Ipv6OptionRouterAlert ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

Ipv6OptionRouterAlert::~Ipv6OptionRouterAlert ()
{
  NS_LOG_FUNCTION_NOARGS ();
}

uint8_t Ipv6OptionRouterAlert::GetOptionNumber () const
{
  NS_LOG_FUNCTION_NOARGS ();

  return OPT_NUMBER;
}

uint8_t Ipv6OptionRouterAlert::Process (Ptr<Packet> packet, uint8_t offset, Ipv6Header const& ipv6Header, bool& isDropped)
{
  NS_LOG_FUNCTION (this << packet << offset << ipv6Header << isDropped);

  Ptr<Packet> p = packet->Copy ();
  p->RemoveAtStart (offset);

  Ipv6OptionRouterAlertHeader routerAlertHeader;
  p->RemoveHeader (routerAlertHeader);

  isDropped = false;

  return routerAlertHeader.GetSerializedSize ();
}

} /* namespace ns3 */


text:
module.exports = (sequelize, DataTypes) => {
  const Message = sequelize.define('Message', {
    message: {
      type: DataTypes.TEXT,
      allowNull: false
    },
    priority: {
      type: DataTypes.STRING,
      defaultValue: 'Normal'
    },
    archived: {
      type: DataTypes.BOOLEAN,
      defaultValue: false
    }
  }, {
    classMethods: {
      associate: (models) => {
        Message.belongsTo(models.Group, {
          foreignKey: 'GroupId',
          onDelete: 'CASCADE'
        });
        Message.belongsTo(models.User, {
          foreignKey: 'UserId',
          onDelete: 'CASCADE'
        });
        Message.belongsToMany(models.User, {
          through: 'MessageUser',
          foreignKey: 'MessageId',
          onDelete: 'CASCADE'
        });
      }
    }
  });
  return Message;
};


text:
Inner-shadow UIView/CALayer for iOS.

<img src="https://raw.github.com/inamiy/YIInnerShadowView/master/Screenshots/screenshot.jpg" alt="ScreenShot1" width="225px" style="width:225px;" />

## How to use

```
YIInnerShadowView* innerShadowView = [[YIInnerShadowView alloc] initWithFrame:frame];
innerShadowView.shadowRadius = 5;
innerShadowView.shadowMask = YIInnerShadowMaskVertical;
[self.view addSubview:innerShadowView];
```

### YIInnerShadowMask

```
typedef enum {
    YIInnerShadowMaskNone       = 0,
    YIInnerShadowMaskTop        = 1 << 1,
    YIInnerShadowMaskBottom     = 1 << 2,
    YIInnerShadowMaskLeft       = 1 << 3,
    YIInnerShadowMaskRight      = 1 << 4,
    YIInnerShadowMaskVertical   = YIInnerShadowMaskTop | YIInnerShadowMaskBottom,
    YIInnerShadowMaskHorizontal = YIInnerShadowMaskLeft | YIInnerShadowMaskRight,
    YIInnerShadowMaskAll        = YIInnerShadowMaskVertical | YIInnerShadowMaskHorizontal
} YIInnerShadowMask;

```

## Acknowledgement

Main idea is from Matt Wilding:

<http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer>

## License

`YIInnerShadowView` is available under the [Beerware](http://en.wikipedia.org/wiki/Beerware) license.

If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.


text:
require 'nokogiri'
require 'open-uri'

class Song < ActiveRecord::Base
  has_many :artist_songs
  has_many :artists, :through => :artist_songs
  has_many :song_words
  has_many :words, :through => :song_words
  after_create :url_scraper, :lyric_scraper, :build_lyrics, :sort_lyrics

private
    def url_scraper
      song = RapGenius::Song.find(self.rg_id)
      @url = song.document["response"]["song"]["url"]
      self.update(url:@url)
    end

    def lyric_scraper
      doc = Nokogiri::HTML(open("#{@url}"))
      @lyrics = doc.css("div.lyrics").to_s.gsub(/<(.|\n)*?>/,"")
    end

    def build_lyrics
      ## one/many songs are returning nil here, fuck!
      string_song = @lyrics
      string_song.gsub!(/\n/, " ").gsub!(/,/, " ")
      string_song.gsub!(/\[(.*?)\]/, " ") if string_song.include?("[")
      string_song_collection = string_song.split(" ").each do |word|
        word.downcase!
        word.gsub!(/[^0-9A-Za-z]/, '')
      end
      @lyrics = string_song_collection
    end

    def sort_lyrics
      words = @lyrics.uniq
      histogram = words.map{|word| [word.gsub(/\"/,""), @lyrics.count(word)]}.to_h
      create_words(histogram)
    end

    def create_words(histogram)
      histogram.each do |key,value|
        value.times{self.words.create(name:key)}
      end
    end

    def hook_counter
      ###THIS METHOD IS FOR STRETCH
      # .scan(/\[(.*?)\]/)  ## Returns any text within square brackets
      # .flatten
      # ["Verse 1: Drake", "Hook: Quavo", "Verse 2: Quavo", "Hook: Quavo", "Verse 3: Takeoff", "Hook: Quavo", "Verse 4: Offset", "Hook: Quavo"]
      # c.include?(["#{d[0]}"])
      # a = above
      # b = a.uniq
      ##
      ## Problem with the hook, some songs have hooks, some have hooks by other
      ## people, will have to figure out what to do.

      #num_hooks = (string_song.scan(/\[Hook]/).length)-1
      # hook = string_song[/(?<=\[Hook\])(.*)(?=\[Verse 1\])/]
      # string_song << hook*num_hooks
      # string_song.gsub!(/\[(.*?)\]/, " ")

    end

end


text:
<?php

return [
    'added_to_cart' => 'Produktet er tilføjet til kurven.',
    'add_to_cart' => 'Læg i kurv',
    'book_days_before' => 'Book senest :deadline dage inden',
    'how_many' => 'Hvor mange?',
    'in_stock' => 'stk',
    'login_to_order' => 'Login for at købe',
    'message_producer' => 'Besked til producent',
    'message_producer_placeholder' => 'Tilføj extra information til din ordre',
    'nav_to_node' => 'For at bestille dette produkt, skal du gå til et af de udvekslingsteder det leveres til',
    'no_bookable_dates' => 'Der findes ingen tilgængelige datoer',
    'not_available' => 'Ikke tilgængelig',
    'message_producer' => 'Besked til producenten',
    'message_producer_placeholder' => 'Extra information til din bestilling',
    'order' => 'Køb',
    'product_info' => 'Produktinformation',
    'producer' => 'Producent',
    'select' => 'Vælg variant',
    'select_deliveries' => 'Vælg leveringsdato',
    'share' => 'Del',
    'sold_out' => 'Udsolgt',

    // Errors
    'no_product' => 'Du har ikke valgt et produkt.',
    'no_variant' => 'Du har ikke valgt en variant.',
    'no_delivery_dates' => 'Du har ikke valgt nogen leveringsdato.',
    'no_quantity' => 'Du har ikke valgt antal.',
    'required_fields_missing' => 'Obligatoriske felter mangler.',
    'quantity_changed' => 'Antal før :date overskred det tilgængelige antal og er blevet ændret.',
    'quantity_changed_no_date' => 'Antallet overskred det tilgængelige antal og er blevet ændret.',
];


text:
<?php
/**
 * Created by PhpStorm.
 * User: arttit
 * Date: 17/4/2560
 * Time: 17:09 น.
 */

namespace AppBundle\GVal;

class GDateTime
{
    private $nowDateFormat;
    function __construct()
    {
        $nowDate=new \DateTime();
        $nowDateFormat=$nowDate->format('Y-m-d H:i:s');
        $this->nowDateFormat= $nowDateFormat;
    }
    public function getDateTime()
    {
        return $this->nowDateFormat;

    }
    public function getYear()
    {
        $nowDate=new \DateTime();
        $nowDateFormat=$nowDate->format('Y');
        return $nowDateFormat;

    }
    public function getMonth()
    {
        $nowDate=new \DateTime();
        $nowDateFormat=$nowDate->format('m');
        return $nowDateFormat;

    }
    public function getDate()
    {
        $nowDate=new \DateTime();
        $nowDateFormat=$nowDate->format('d');
        return $nowDateFormat;

    }

}


text:
namespace dropkick.Tasks.Security.Msmq
{
    using System;
    using System.Messaging;
    using Configuration.Dsl.Msmq;
    using DeploymentModel;

    public class LocalMsmqGrantReadTask :
        BaseSecurityTask
    {
        string _group;
        QueueAddress _address;

        public LocalMsmqGrantReadTask(QueueAddress address, string group)
        {
            _group = group;
            _address = address;
        }

        public LocalMsmqGrantReadTask(PhysicalServer server, string queueName, string group)
        {
            _group = group;
            var ub = new UriBuilder("msmq", server.Name) { Path = queueName };
            _address = new QueueAddress(ub.Uri);
        }

        public override string Name
        {
            get { return "Grant read to '{0}' for queue '{1}'".FormatWith(_group, _address.ActualUri); }
        }

        public override DeploymentResult VerifyCanRun()
        {
            var result = new DeploymentResult();

            VerifyInAdministratorRole(result);

            return result;
        }

        public override DeploymentResult Execute()
        {
            var result = new DeploymentResult();

            Logging.Coarse("[msmq] Setting permissions for '{0}' on local queue '{1}'", _group, _address.ActualUri);

            var q = new MessageQueue(_address.FormatName);
            q.SetPermissions(_group, MessageQueueAccessRights.GetQueueProperties, AccessControlEntryType.Allow);
            q.SetPermissions(_group, MessageQueueAccessRights.GetQueuePermissions, AccessControlEntryType.Allow);

            result.AddGood("Successfully granted Read permissions to '{0}' for queue '{1}'".FormatWith(_group, _address.ActualUri));

            return result;
        }
    }
}


text:
/*----------  Module exports  ----------*/
module.exports = require('./builder/querybuilder');


text:
pwrs
====

A pwgen'esque utility that generates passphrases instead of passwords.

    Usage: pwrs [options]

    Options:
        -h --help           Print this help
        -m --min MIN        Minimum number of characters in words
        -M --max MAX        Maximum number of characters in words
        -c --count COUNT    Count of passphrases to print
        -n --number NUMBER  Number of words to include in passphrases

Optionally, you can export `PWRS_WORDLIST`, by default it will use `/usr/share/dict/words`.

## Installing

    cargo build --release
    cp target/release/pwrs /usr/local/bin


text:
ACCEPTED

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

#### Published in
Fungi italica 17-28: tab. 894 (1881)

#### Original name
null

### Remarks
null