text:
import collections
import json
import os
import re

from jira import JIRA, JIRAError, utils
from jira.resources import Attachment, Customer, Issue, RequestType, ServiceDesk, User
from jira.utils import json_loads
from requests import Request
from rest_framework import status

PADDING = 3
CHARS_LIMIT = 255

def _get_filename(path):
    limit = CHARS_LIMIT - PADDING
    fname = os.path.basename(path)
    filename = fname.split('.')[0]
    filename_extension = fname.split('.')[1:]
    count = (
        len('.'.join(filename_extension).encode('utf-8')) + 1
        if filename_extension
        else 0
    )
    char_limit = 0

    for char in filename:
        count += len(char.encode('utf-8'))
        if count > limit:
            break
        else:
            char_limit += 1

    if not char_limit:
        raise JIRAError('Attachment filename is very long.')

    tmp = [filename[:char_limit]]
    tmp.extend(filename_extension)
    filename = '.'.join(tmp)
    return filename

def _upload_file(manager, issue, upload_file, filename):
    # This method will fix original method jira.JIRA.add_attachment (jira/client.py line 591)
    url = manager._get_url('issue/' + str(issue) + '/attachments')
    files = {
        'file': (filename, upload_file),
    }
    headers = {
        'X-Atlassian-Token': 'nocheck',
    }
    req = Request('POST', url, headers=headers, files=files, auth=manager._session.auth)
    prepped = req.prepare()
    prepped.body = re.sub(
        b'filename=.*', b'filename="%s"\r' % filename.encode('utf-8'), prepped.body
    )
    r = manager._session.send(prepped)

    js = utils.json_loads(r)

    if not js or not isinstance(js, collections.Iterable):
        raise JIRAError("Unable to parse JSON: %s" % js)

    attachment = Attachment(manager._options, manager._session, js[0])

    if attachment.size == 0:
        raise JIRAError(
            "Added empty attachment?!: r: %s\nattachment: %s" % (r, attachment)
        )

    return attachment

def add_attachment(manager, issue, file):
    """
    Replace jira's method 'add_attachment' while don't well fixed this issue
    https://github.com/shazow/urllib3/issues/303
    And we need to set filename limit equaled 252 chars.
    :param manager: [jira.JIRA instance]
    :param issue: [jira.JIRA.resources.Issue instance]
    :param path: [string]
    :return: [jira.JIRA.resources.Attachment instance]
    """
    filename = _get_filename(file.name)
    return _upload_file(manager, issue, file.file.read(), filename)

def service_desk(manager, id_or_key):
    """In Jira v8.7.1 / SD 4.7.1 a Service Desk ID must be an integer.
    We use a hackish workaround to make it work till Atlassian resolves bug
    https://jira.atlassian.com/browse/JSDSERVER-4877.
    """
    try:
        return manager.service_desk(id_or_key)
    except JIRAError as e:
        if 'java.lang.NumberFormatException' in e.text:
            service_desks = [
                sd for sd in manager.service_desks() if sd.projectKey == id_or_key
            ]
            if len(service_desks):
                return service_desks[0]
            else:
                msg = 'The Service Desk with ID {id} does not exist.'.format(
                    id=id_or_key
                )
                raise JIRAError(text=msg, status_code=404)
        else:
            raise e

def request_types(manager, service_desk, project_key=None, strange_setting=None):
    """We need to use this function because in the old Jira version issueTypeId field does not exist."""
    types = manager.request_types(service_desk)

    if len(types) and not hasattr(types[0], 'issueTypeId'):
        if hasattr(service_desk, 'id'):
            service_desk = service_desk.id

        url = manager._options[
            'server'
        ] + '/rest/servicedesk/%s/servicedesk/%s/groups/%s/request-types' % (
            strange_setting,
            project_key.lower(),
            service_desk,
        )
        headers = {'X-ExperimentalApi': 'opt-in'}
        r_json = json_loads(manager._session.get(url, headers=headers))
        types = [
            RequestType(manager._options, manager._session, raw_type_json)
            for raw_type_json in r_json
        ]
        list(map(lambda t: setattr(t, 'issueTypeId', t.issueType), types))

    return types

def search_users(
    self, query, startAt=0, maxResults=50, includeActive=True, includeInactive=False
):
    """Get a list of user Resources that match the specified search string. Use query instead of
    username field for lookups.
    """
    params = {
        'query': query,
        'includeActive': includeActive,
        'includeInactive': includeInactive,
    }
    try:
        return self._fetch_pages(User, None, 'user/search', startAt, maxResults, params)
    except JIRAError as e:
        if e.text == 'The username query parameter was not provided':
            params = {
                'username': query,
                'includeActive': includeActive,
                'includeInactive': includeInactive,
            }
            return self._fetch_pages(
                User, None, 'user/search', startAt, maxResults, params
            )
        raise e

def create_customer_request(
    self, fields=None, prefetch=True, use_old_api=False, **fieldargs
):
    """The code for this function is almost completely copied from
    function create_customer_request of the JIRA library"""
    data = fields

    p = data['serviceDeskId']
    service_desk = None

    if isinstance(p, str) or isinstance(p, int):
        service_desk = self.service_desk(p)
    elif isinstance(p, ServiceDesk):
        service_desk = p

    data['serviceDeskId'] = service_desk.id

    p = data['requestTypeId']
    if isinstance(p, int):
        data['requestTypeId'] = p
    elif isinstance(p, str):
        data['requestTypeId'] = self.request_type_by_name(service_desk, p).id

    requestParticipants = data.pop('requestParticipants', None)

    url = self._options['server'] + '/rest/servicedeskapi/request'
    headers = {'X-ExperimentalApi': 'opt-in'}
    r = self._session.post(url, headers=headers, data=json.dumps(data))

    raw_issue_json = json_loads(r)
    if 'issueKey' not in raw_issue_json:
        raise JIRAError(r.status_code, request=r)

    if requestParticipants:
        url = (
            self._options['server']
            + '/rest/servicedeskapi/request/%s/participant' % raw_issue_json['issueKey']
        )
        headers = {'X-ExperimentalApi': 'opt-in'}

        if use_old_api:
            data = {'usernames': requestParticipants}
        else:
            data = {'accountIds': requestParticipants}

        r = self._session.post(url, headers=headers, json=data)

    if r.status_code != status.HTTP_200_OK:
        raise JIRAError(r.status_code, request=r)

    if prefetch:
        return self.issue(raw_issue_json['issueKey'])
    else:
        return Issue(self._options, self._session, raw=raw_issue_json)

def create_customer(self, email, displayName):
    """Create a new customer and return an issue Resource for it."""
    url = self._options['server'] + '/rest/servicedeskapi/customer'
    headers = {'X-ExperimentalApi': 'opt-in'}
    r = self._session.post(
        url,
        headers=headers,
        data=json.dumps(
            {
                'email': email,
                'fullName': displayName,  # different property for the server one
            }
        ),
    )

    raw_customer_json = json_loads(r)

    if r.status_code != 201:
        raise JIRAError(r.status_code, request=r)
    return Customer(self._options, self._session, raw=raw_customer_json)

JIRA.waldur_add_attachment = add_attachment
JIRA.waldur_service_desk = service_desk
JIRA.waldur_request_types = request_types
JIRA.waldur_search_users = search_users
JIRA.waldur_create_customer_request = create_customer_request
JIRA.waldur_create_customer = create_customer


text:
<TITLE>Review for Crossworlds (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Crossworlds (1996)

reviewed by
Richard Scheib

CROSSWORLDS

USA. 1996. Director - Krishna Rao, Screenplay - Krishna & Raman Rao,
Producers - Rupert Harvey & Lloyd Segan, Photography - Christopher
Walling, Music - Christophe Beck, Visual Effects Supervisor - Wendy
Grossberg, Visual Effects - Todd-AO Digital Images (Supervisor - Brian
Jennings), Digital Effects - Digital Drama Inc (3D Animation Supervisor
- Mark J. Smith) & Pure Light Images Inc (Supervisor - Mike Fernster),
Digital Visual Effects - Shockwave Entertainment Inc (Supervisor - Jody
Levine), Mechanical Effects Supervisor - Frank Ceglia, Production Design
- Aaron Osborne. Production Company - Trimark Pictures.
Josh Charles (Joe Talbot), Rutger Hauer (A.T.), Andrea Roth (Laura),
Stuart Wilson (Ferris), Perry Anzilotti (Rebo), Jack Black (Steve),
Richard McGregor (Stu), Ellen Geer (Mrs Talbot)

Plot: After meeting a beautiful girl at a party, average business
student Joe Talbot is suddenly dragged into aiding a resistance movement
trying to prevent an invading warlord who is intent on conquering a
multiverse of alternate realities. Joe becomes a key player in the
struggle when it is discovered that a crystal left by his father is
really a valuable artifact capable of opening doorways between worlds.

`Crossworlds' from the face-value look of it seems to be nothing more
than another direct-to-video action film but instead confounds
expectation to become a surprisingly worthwhile effort. Director Krishna
Rao takes a newly familiar theme - parallel world hopping - one that has
been slaughtered in the most unimaginative way possible by tv's
`Sliders' - but conducts it in an original and interesting way. Straight
into the film one's attention is immediately captured by a dizzying
series of spins - hero Charles meets a beautiful girl at a party who
happens to know his name; wakes to find her in his bedroom sitting over
him with a knife and runs only to open his bedroom door and find he is
looking out across a desert plain with an approaching rider; they are
pursued and shot at with still no idea what is meant to be happening;
seek refuge with Rutger Hauer at a seedy motel where an ordinary motel
room mysteriously opens into a building the size of an airplane hangar;
followed by a subtle attempt by villain Stuart Wilson to take over
Roth's mind at a museum. Rao is capable of quite effectively suggesting
the immediately otherworldly by a subtly disquiet shifting of the
everyday - Roth vanishing at the party in the moment Charles turns his
back; the sense of eerieness that is created in a perfectly ordinary
museum garden when Hauer suggests that people are watching them.

Unfortunately it becomes a less effective film once it explains what is
going on and all the building mystery is brought out into the open. Here
the ordinariness that Rao is trying to suggest as being otherworldly
becomes a little too apparent - a corridor between worlds is simply a
desert canyon filmed through a blurred lens, the movement between worlds
is conducted by people simply turning their backs in the desert. Nor,
bar a brief visit to a rebel camp at the end, do we get to see anything
of the other worlds talked about. Here sadly the film's medium budget
has gotten in the way of the clear scope of imagination that the film
promises - it would have been a far better film on an A budget.
Nevertheless despite this there are still a number of highly effective
scenes in the latter half - a last minute salvation from a fall from a
skyscraper by shifting between worlds; an excellent scene where the
protagonists are caught in an illusion where it appears the lift they
are descending in is by pieces disappearing around them until they are
left hanging from one another's shoes. Josh Charles gives a rather good
performance as an ordinary average guy propelled into bewildering
circumstances.

Copyright Richard Scheib 1998

Get Your Private, Free Email at http://www.hotmail.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews

redpajama_set_name: RedPajamaGithub


text:
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
---------------------------------

.. |FIND_XXX| replace:: :command:`find_package`

.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt


text:
i_want_pets = ["I", "want", 3, "pets", "but", "only", "have", 2]
my_family_pets_ages = {"Evi" => 6, "Ditto" => 3, "Hoobie" => 3, "George" => 12, "Bogart" => 4, "Poly" => 4, "Annabelle" => 0}

# Person 1's solution

# def my_array_finding_method(source, thing_to_find)
#   source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# def my_hash_finding_method(source, thing_to_find)
#   source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# Identify and describe the Ruby method(s) you implemented.
#
#
#

# Person 2

# def my_array_modification_method!(source, thing_to_modify)
#   source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# def my_hash_modification_method!(source, thing_to_modify)
#   source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# Identify and describe the Ruby method(s) you implemented.
#
#
#

# Person 3

# def my_array_sorting_method(source)
#   source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# def my_hash_sorting_method(source)
#    source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# Identify and describe the Ruby method(s) you implemented.
#
#
#

# Person 4

# def my_array_deletion_method!(source, thing_to_delete)
#   source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# def my_hash_deletion_method!(source, thing_to_delete)
#   source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
# end

# Identify and describe the Ruby method(s) you implemented.
#
#
#

# Person 5

# Method to split an array into two arrays
# Input: An array that may contain both strings and integers
# Output: Two arrays nested inside another array. One will contain all of the integers from the original array. The other will contain all of the other values.
# Steps to product the correct outcome:
# 1. Pull all of the integers out of the array and store them in a new array
# 2. Pull all of the other values out of the array and store them in a new array
# 3. Store the two new arrays nested inside a new array
# 4. Return the new array

# Method to split a hash into two arrays
# Input: A hash that contains a list of dog names and the dog's age
# Output: Two arrays nested inside another array. One will contain all of the pets that are four years old or younger. The other will contain all of the other pets.
# Steps to product the correct outcome:
# 1. Pull all of the pets out of the hash that are four years old or younger and store them in a new array
# 2. Pull all of the other pets out of the hash and store them in a new array
# 3. Store both of the arrays in a new array
# 4. Return the new array

def my_array_splitting_method(source)
  integer_sorted_array = source.partition { |obj| obj.is_a? Integer }
end

print my_array_splitting_method(i_want_pets)

def my_hash_splitting_method(source, age = 4)
  age_sorted_pet_array = source.partition { |key, value| value <= age }
end

print my_hash_splitting_method(my_family_pets_ages)

# Identify and describe the Ruby method(s) you implemented.
# Partition returns two arrays inside of another array. The first one will contain the values that evaluate to true given the specified by the block. The secon will contain everything else. I played around with grep, but it wasn't as efficient as partition and, while it passed rspec, my method using grep was only splitting out integers and strings rather than integers and everything else.

# Release 1: Identify and describe the Ruby method you implemented. Teach your accountability group how to use the methods.
# As I described above, the partition enumberable splits a collection into two arrays  based on a block of code that evaluates to true or false. Anything in the collection that returns a true value will be split into one array. Everthing else will go in the other array.
# The syntax looks like this:
# collection = [87, 55, 12, 8, 105.5]
# collection.partition { |obj| obj >= 55 }
# => [[87, 55, 105.5], [12, 8]]

# Release 3: Reflect!
# What did you learn about researching and explaining your research to others?
# When we started with Ruby last week, I looked at the docs and my first thought was "a Google search must be easier." But I've found that to be untrue. There are so many pages out there that are kind of close to what you want, but don't work for the problem you're trying to solve. It worked so much better for me to follow the advice from the "Ruby Docs for Newbs" article and check the docs, try them in irb, and then try them in my code.


text:
require('angular');

var ui_bootstrap = require('angular-ui-bootstrap'),
	ui_router = require('angular-ui-router'),
	ui_scrollbar = require('ng-scrollbar'),
	ng_messages = require('angular-messages');

angular.module('aah-guru', [
	// dependencies
	ui_bootstrap,
	ui_router,
	'ngScrollbar',
	ng_messages,

	// routes
	require('./routes/home/home.route').name,
	require('./routes/location/location.route').name

]).config(['$compileProvider', function ($compileProvider) {
	// $compileProvider.debugInfoEnabled(false);
}]).run(['$state', '$rootScope',  function ($state, $rootScope) {
	$rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error) {
		console.log(error);
	});

	$state.go('home');

}]);


text:
class Person < ActiveRecord::Base
seo_urls
end


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

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Bamboo Preparation</title>
      <categories>
        <cat>Misc</cat>
        <cat>Non-categor</cat></categories>
      <yield>1</yield></head>
    <ingredients/>
    <directions>
      <step>  When bamboo is cultivated for shoots, workers walk the fields barefoot,
  heaping soil around those spots where their toes feel a slight rise in the
  ground.  The bulge heralds an emerging culm, which is kept covered as long
  possible, sometimes with a wooden box, because when exposed it becomes fibr
  in a short time.  The shoot is harvested when about 1 foot tall, by digging
  down and carefully severing it at the point where it joins the rhizome bear
  it.  Shoots are boiled a half hour or more and the outer sheaths removed.
  They are white in color, with the look of a raw paotato, crisp in texture.

  Shoots of almost any bamboo can be eaten.  The principal genera used for
  sprouts include Arundinaria, Bambusa, Dendrocalamus, and Phyllostachys.
  Although the size is one limiting factor, even diminutive Sasa in Japan
  provides some 600 tons of shoots annually.

  In Taiwan P. edulis and D. latiflorus are used.  In Japan P. moso and P edu
  are used.  Soft quality shoots require yearly soil dressing, straw litter a
  farmyard manure..

  A sprout properly dug will have a rooty, woody basal portin, increasing
  sharply in diameter upwad for a short distance from the very slender part
  which  was attached to its rhizome, and then tapering to a point.  With a
  sharp paring knife cut lengthwise through the sheath only, from tip to base
  the sprout.  Beginning with the lowersheaths, remove all except the tender
  ones at the tip.  If there is a grayish layer (owing to age) next to the lo
  nodes, pare this off.  Remove the togh basal part.  Cut the core portion
  diagonally or crosswise into rather this slices.  The lower, firmer portion
  should be cut across the grain, not thicker than 1/8 inch, but the more ten
  middle and upper parts may be sliced thicker or cut into varioyus shapes
  according to the recipe.  Sprouts may be served alone, drained, with butter
  melted over them, after boiling for about twenty minutes.  Salt is added ne
  the end of the boiling period.  If the fresh sprouts are unpleasantly bitte
  to the taste there should be a change of water after the first ten minutes
  cooking.  The more pronounced bitterness of some of the tropical edible
  bamboos (of the genus Bambusa and others) may be removed by a third change
  water if the bamboo is not sliced too thicvk and a good volume of water is
  used.

</step></directions></recipe></recipeml>


text:
static Window *s_window;
static GFont s_res_font_roboto_condensed_bold_reduced_60;
static GFont s_res_roboto_condensed_21;
static TextLayer *s_textlayer_date;
static TextLayer *s_textlayer_day;
static TextLayer *s_textlayer_time;
static TextLayer *s_textlayer_utc;

// private functions
static void update(struct tm *tick_time, TimeUnits units_changed);
static void initialise_ui(void);
static void destroy_ui(Window* window);

static void update(struct tm *tick_time, TimeUnits units_changed) {
  char time_fmt[sizeof("%I:%M")];

  static char localdate[sizeof("9999-99-99")];
  static char localday[sizeof("Wednesday")];
  static char localtime[sizeof("99:99")];
  static char utc[sizeof("99-99 99:99Z")];

  if(clock_is_24h_style() == true) {
    // Use 24 hour format
    strcpy(time_fmt, "%R");
  } else {
    // Use 12 hour format
    strcpy(time_fmt, "%I:%M");
  }

  // only update day/date if needed
  if (units_changed & DAY_UNIT) {
    strftime(localdate, sizeof(localdate), "%Y-%m-%d", tick_time); // %F is broken now?
    strftime(localday, sizeof(localday), "%A", tick_time);

    text_layer_set_text(s_textlayer_date, localdate);
    text_layer_set_text(s_textlayer_day, localday);
  }

  strftime(localtime, sizeof(localtime), time_fmt, tick_time);
  mktime(tick_time); // is this ok to rely on?
  strftime(utc, sizeof(utc), "%m-%d %RZ", tick_time);

  text_layer_set_text(s_textlayer_time, localtime);
  text_layer_set_text(s_textlayer_utc, utc);
}

static void initialise_ui(void) {
  s_window = window_create();
  window_set_background_color(s_window, GColorBlack);
  #ifndef PBL_SDK_3
    window_set_fullscreen(s_window, 1);
  #endif

  s_res_font_roboto_condensed_bold_reduced_60 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_font_roboto_condensed_bold_reduced_60));
  s_res_roboto_condensed_21 = fonts_get_system_font(FONT_KEY_ROBOTO_CONDENSED_21);

  // s_textlayer_date
  s_textlayer_date = text_layer_create(GRect(0, 29, 143, 26));
  text_layer_set_background_color(s_textlayer_date, GColorClear);
  text_layer_set_text_color(s_textlayer_date, GColorWhite);
  text_layer_set_text_alignment(s_textlayer_date, GTextAlignmentCenter);
  text_layer_set_font(s_textlayer_date, s_res_roboto_condensed_21);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_textlayer_date);

  // s_textlayer_day
  s_textlayer_day = text_layer_create(GRect(0, 5, 143, 26));
  text_layer_set_background_color(s_textlayer_day, GColorClear);
  text_layer_set_text_color(s_textlayer_day, GColorWhite);
  text_layer_set_text_alignment(s_textlayer_day, GTextAlignmentCenter);
  text_layer_set_font(s_textlayer_day, s_res_roboto_condensed_21);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_textlayer_day);

  // s_textlayer_time
  s_textlayer_time = text_layer_create(GRect(0, 44, 143, 64));
  text_layer_set_background_color(s_textlayer_time, GColorClear);
  text_layer_set_text_color(s_textlayer_time, GColorWhite);
  text_layer_set_text_alignment(s_textlayer_time, GTextAlignmentCenter);
  text_layer_set_font(s_textlayer_time, s_res_font_roboto_condensed_bold_reduced_60);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_textlayer_time);

  // s_textlayer_utc
  s_textlayer_utc = text_layer_create(GRect(0, 143, 143, 26));
  text_layer_set_background_color(s_textlayer_utc, GColorClear);
  text_layer_set_text_color(s_textlayer_utc, GColorWhite);
  text_layer_set_text_alignment(s_textlayer_utc, GTextAlignmentCenter);
  text_layer_set_font(s_textlayer_utc, s_res_roboto_condensed_21);
  layer_add_child(window_get_root_layer(s_window), (Layer *)s_textlayer_utc);
}

static void destroy_ui(Window* window) {
  window_destroy(s_window);
  text_layer_destroy(s_textlayer_date);
  text_layer_destroy(s_textlayer_day);
  text_layer_destroy(s_textlayer_time);
  text_layer_destroy(s_textlayer_utc);
  fonts_unload_custom_font(s_res_font_roboto_condensed_bold_reduced_60);
}

static void handle_init(void) {
  time_t now = time(NULL);

  initialise_ui();

  // call update to get correct output before showing window
  update(localtime(&now), DAY_UNIT);

  // register window unload funtion
  window_set_window_handlers(s_window, (WindowHandlers) {
    .unload = destroy_ui,
  });

  // show window
  window_stack_push(s_window, true);

  // register update as tick timer handler
  tick_timer_service_subscribe(MINUTE_UNIT, update);
}

static void handle_deinit(void) {
  window_stack_remove(s_window, true);
}

int main(void) {
  handle_init();
  app_event_loop();
  handle_deinit();
}


text:
package com.amazonaws.services.dynamodbv2.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * Represents the output of a DescribeLimits operation.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeLimitsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * The maximum total read capacity units that your account allows you to provision across all of your tables in this
     * Region.
     *

     */
    private Long accountMaxReadCapacityUnits;
    /**
     *

     * The maximum total write capacity units that your account allows you to provision across all of your tables in
     * this Region.
     *

     */
    private Long accountMaxWriteCapacityUnits;
    /**
     *

     * The maximum read capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).
     *

     */
    private Long tableMaxReadCapacityUnits;
    /**
     *

     * The maximum write capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).
     *

     */
    private Long tableMaxWriteCapacityUnits;

    /**
     *

     * The maximum total read capacity units that your account allows you to provision across all of your tables in this
     * Region.
     *

     *
     * @param accountMaxReadCapacityUnits
     *        The maximum total read capacity units that your account allows you to provision across all of your tables
     *        in this Region.
     */

    public void setAccountMaxReadCapacityUnits(Long accountMaxReadCapacityUnits) {
        this.accountMaxReadCapacityUnits = accountMaxReadCapacityUnits;
    }

    /**
     *

     * The maximum total read capacity units that your account allows you to provision across all of your tables in this
     * Region.
     *

     *
     * @return The maximum total read capacity units that your account allows you to provision across all of your tables
     *         in this Region.
     */

    public Long getAccountMaxReadCapacityUnits() {
        return this.accountMaxReadCapacityUnits;
    }

    /**
     *

     * The maximum total read capacity units that your account allows you to provision across all of your tables in this
     * Region.
     *

     *
     * @param accountMaxReadCapacityUnits
     *        The maximum total read capacity units that your account allows you to provision across all of your tables
     *        in this Region.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeLimitsResult withAccountMaxReadCapacityUnits(Long accountMaxReadCapacityUnits) {
        setAccountMaxReadCapacityUnits(accountMaxReadCapacityUnits);
        return this;
    }

    /**
     *

     * The maximum total write capacity units that your account allows you to provision across all of your tables in
     * this Region.
     *

     *
     * @param accountMaxWriteCapacityUnits
     *        The maximum total write capacity units that your account allows you to provision across all of your tables
     *        in this Region.
     */

    public void setAccountMaxWriteCapacityUnits(Long accountMaxWriteCapacityUnits) {
        this.accountMaxWriteCapacityUnits = accountMaxWriteCapacityUnits;
    }

    /**
     *

     * The maximum total write capacity units that your account allows you to provision across all of your tables in
     * this Region.
     *

     *
     * @return The maximum total write capacity units that your account allows you to provision across all of your
     *         tables in this Region.
     */

    public Long getAccountMaxWriteCapacityUnits() {
        return this.accountMaxWriteCapacityUnits;
    }

    /**
     *

     * The maximum total write capacity units that your account allows you to provision across all of your tables in
     * this Region.
     *

     *
     * @param accountMaxWriteCapacityUnits
     *        The maximum total write capacity units that your account allows you to provision across all of your tables
     *        in this Region.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeLimitsResult withAccountMaxWriteCapacityUnits(Long accountMaxWriteCapacityUnits) {
        setAccountMaxWriteCapacityUnits(accountMaxWriteCapacityUnits);
        return this;
    }

    /**
     *

     * The maximum read capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @param tableMaxReadCapacityUnits
     *        The maximum read capacity units that your account allows you to provision for a new table that you are
     *        creating in this Region, including the read capacity units provisioned for its global secondary indexes
     *        (GSIs).
     */

    public void setTableMaxReadCapacityUnits(Long tableMaxReadCapacityUnits) {
        this.tableMaxReadCapacityUnits = tableMaxReadCapacityUnits;
    }

    /**
     *

     * The maximum read capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @return The maximum read capacity units that your account allows you to provision for a new table that you are
     *         creating in this Region, including the read capacity units provisioned for its global secondary indexes
     *         (GSIs).
     */

    public Long getTableMaxReadCapacityUnits() {
        return this.tableMaxReadCapacityUnits;
    }

    /**
     *

     * The maximum read capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @param tableMaxReadCapacityUnits
     *        The maximum read capacity units that your account allows you to provision for a new table that you are
     *        creating in this Region, including the read capacity units provisioned for its global secondary indexes
     *        (GSIs).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeLimitsResult withTableMaxReadCapacityUnits(Long tableMaxReadCapacityUnits) {
        setTableMaxReadCapacityUnits(tableMaxReadCapacityUnits);
        return this;
    }

    /**
     *

     * The maximum write capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @param tableMaxWriteCapacityUnits
     *        The maximum write capacity units that your account allows you to provision for a new table that you are
     *        creating in this Region, including the write capacity units provisioned for its global secondary indexes
     *        (GSIs).
     */

    public void setTableMaxWriteCapacityUnits(Long tableMaxWriteCapacityUnits) {
        this.tableMaxWriteCapacityUnits = tableMaxWriteCapacityUnits;
    }

    /**
     *

     * The maximum write capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @return The maximum write capacity units that your account allows you to provision for a new table that you are
     *         creating in this Region, including the write capacity units provisioned for its global secondary indexes
     *         (GSIs).
     */

    public Long getTableMaxWriteCapacityUnits() {
        return this.tableMaxWriteCapacityUnits;
    }

    /**
     *

     * The maximum write capacity units that your account allows you to provision for a new table that you are creating
     * in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).
     *

     *
     * @param tableMaxWriteCapacityUnits
     *        The maximum write capacity units that your account allows you to provision for a new table that you are
     *        creating in this Region, including the write capacity units provisioned for its global secondary indexes
     *        (GSIs).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeLimitsResult withTableMaxWriteCapacityUnits(Long tableMaxWriteCapacityUnits) {
        setTableMaxWriteCapacityUnits(tableMaxWriteCapacityUnits);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAccountMaxReadCapacityUnits() != null)
            sb.append("AccountMaxReadCapacityUnits: ").append(getAccountMaxReadCapacityUnits()).append(",");
        if (getAccountMaxWriteCapacityUnits() != null)
            sb.append("AccountMaxWriteCapacityUnits: ").append(getAccountMaxWriteCapacityUnits()).append(",");
        if (getTableMaxReadCapacityUnits() != null)
            sb.append("TableMaxReadCapacityUnits: ").append(getTableMaxReadCapacityUnits()).append(",");
        if (getTableMaxWriteCapacityUnits() != null)
            sb.append("TableMaxWriteCapacityUnits: ").append(getTableMaxWriteCapacityUnits());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DescribeLimitsResult == false)
            return false;
        DescribeLimitsResult other = (DescribeLimitsResult) obj;
        if (other.getAccountMaxReadCapacityUnits() == null ^ this.getAccountMaxReadCapacityUnits() == null)
            return false;
        if (other.getAccountMaxReadCapacityUnits() != null && other.getAccountMaxReadCapacityUnits().equals(this.getAccountMaxReadCapacityUnits()) == false)
            return false;
        if (other.getAccountMaxWriteCapacityUnits() == null ^ this.getAccountMaxWriteCapacityUnits() == null)
            return false;
        if (other.getAccountMaxWriteCapacityUnits() != null && other.getAccountMaxWriteCapacityUnits().equals(this.getAccountMaxWriteCapacityUnits()) == false)
            return false;
        if (other.getTableMaxReadCapacityUnits() == null ^ this.getTableMaxReadCapacityUnits() == null)
            return false;
        if (other.getTableMaxReadCapacityUnits() != null && other.getTableMaxReadCapacityUnits().equals(this.getTableMaxReadCapacityUnits()) == false)
            return false;
        if (other.getTableMaxWriteCapacityUnits() == null ^ this.getTableMaxWriteCapacityUnits() == null)
            return false;
        if (other.getTableMaxWriteCapacityUnits() != null && other.getTableMaxWriteCapacityUnits().equals(this.getTableMaxWriteCapacityUnits()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getAccountMaxReadCapacityUnits() == null) ? 0 : getAccountMaxReadCapacityUnits().hashCode());
        hashCode = prime * hashCode + ((getAccountMaxWriteCapacityUnits() == null) ? 0 : getAccountMaxWriteCapacityUnits().hashCode());
        hashCode = prime * hashCode + ((getTableMaxReadCapacityUnits() == null) ? 0 : getTableMaxReadCapacityUnits().hashCode());
        hashCode = prime * hashCode + ((getTableMaxWriteCapacityUnits() == null) ? 0 : getTableMaxWriteCapacityUnits().hashCode());
        return hashCode;
    }

    @Override
    public DescribeLimitsResult clone() {
        try {
            return (DescribeLimitsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>fur taskguide Source: tasks/versionup_task.js</title>

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.journal.css">

			fur taskguide

					Modules

							ci/config

							ci/tasks

Source: tasks/versionup_task.js

/**
 * @file Increment project version.
 * @memberof module:ci/tasks
 * @function versionupTask
 * @param grunt
 * @param {object} config - Task configuration.
 * @param {function} callback - Callback when done.
 *
 */

"use strict";

var fs = require('fs'),
    path = require('path');

module.exports = function (grunt, config, callback) {
    var filename = path.resolve(config.packageJsonPath),
        data = require(filename);
    var versions = data.version.split('.');
    versions.push(Number(versions.pop()) + 1);
    data.version = versions.join('.');

    fs.writeFile(filename, JSON.stringify(data, null, 4), function (err) {
        if (!err) {
            grunt.log.writeln('Version did up to:', data.version);
        }
        callback();
    });
};

		tick-tack Copyright © 2014

		Documentation generated by JSDoc 3.2.2
		on Sun Jun 08 2014 14:49:11 GMT+0900 (JST) using the DocStrap template.


text:
require "rails_helper"

=begin
 * Created by PSU Beeminder Capstone Team on 3/12/2017.
 * Copyright (c) 2017 PSU Beeminder Capstone Team
 * This code is available under the "MIT License".
 * Please see the file LICENSE in this distribution for license terms.
=end

describe "Days backlog" do
  let(:subject) { PROVIDERS[:trello].find_metric(:idle_days_linear) }
  let(:list_ids) { %w(list1 list2) }
  let(:options) { { list_ids: list_ids } }

  context "when there are 5 cards from the last 5 days" do
    let(:start_ts) { Time.zone.parse("2015-01-01") }

    it "calculates 15" do
      Timecop.freeze(start_ts) do
        cards = (1..5).map do |i|
          double last_activity_date: i.days.ago
        end
        expect(adapter = double).to receive(:cards)
          .with(list_ids).and_return(cards)

        expect(subject.call(adapter, options)).to eq(
          Datapoint.new(timestamp: nil, value: 15)
        )
      end
    end

    it "calculates 50 a week later" do
      Timecop.freeze(start_ts) do
        cards = (1..5).map do |i|
          double last_activity_date: (7 + i).days.ago
        end
        expect(adapter = double).to receive(:cards)
          .with(list_ids).and_return(cards)

        expect(subject.call(adapter, options)).to eq(
          Datapoint.new(timestamp: nil, value: 50)
        )
      end
    end

    it "rounds down to avoid fractions" do
      Timecop.freeze(start_ts) do
        cards = [double(last_activity_date: 47.hours.ago)]
        expect(adapter = double).to receive(:cards)
          .with(list_ids).and_return(cards)
        expect(subject.call(adapter, options)).to eq(
          Datapoint.new(timestamp: nil, value: 1)
        )
      end
    end
  end
end


text:
/*global QUnit */
sap.ui.define([
	"sap/base/Log",
	"sap/ui/qunit/utils/createAndAppendDiv",
	"sap/m/StandardTile",
	"sap/ui/core/IconPool",
	"sap/m/TileContainer",
	"sap/ui/core/Core"
], function(
	Log,
	createAndAppendDiv,
	StandardTile,
	IconPool,
	TileContainer,
	oCore
) {
	"use strict";

	// prepare DOM
	createAndAppendDiv("tiles");

	var IMAGE_PATH = "test-resources/sap/m/images/";

	var tileBasic, tileNoIcon, tileNoNumber, tileIconFont;

	var tileBasicId = "tileBasic",
		tileNoIconId = "tileNoIcon",
		tileNoNumberId = "tileNoNumber",
		tileIconFontId = "tileIconFont",
		core = sap.ui.getCore(),
		pressedTileId;

	function handlePress(oEvent) {
		pressedTileId = oEvent.oSource.getId();
	}

	tileBasic = new StandardTile(tileBasicId, {
		icon : IMAGE_PATH + "action.png",
		number : 37,
		numberUnit : "EUR",
		title : "Lorem ipsum dolor",
		info : "1 day ago",
		press : handlePress
	});

	tileNoIcon = new StandardTile(tileNoIconId, {
		number : 12,
		numberUnit : "EUR",
		title : "Lorem ipsum dolor",
		info : "1 day ago"
	});

	tileNoNumber = new StandardTile(tileNoNumberId, {
		icon : IMAGE_PATH + "action.png",
		title : "Lorem ipsum dolor",
		info : "1 day ago"
	});

	tileIconFont = new StandardTile(tileIconFontId, {
		icon : IconPool.getIconURI("inbox"),
		number : 37,
		numberUnit : "EUR",
		title : "Using icon font"
	});

	var tilesList = [];
	tilesList.push(tileBasic);
	tilesList.push(tileNoIcon);
	tilesList.push(tileNoNumber);
	tilesList.push(tileIconFont);

	var tc = new TileContainer("tc",{
		tiles : tilesList
	});

	tc.placeAt("tiles");

	QUnit.module("Rendering All Fields");

	QUnit.test("ControlRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId), null, "tileBasic should be rendered.");
	});

	QUnit.test("IconRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId + "-img"), null, "tileBasic icon should be rendered.");
	});

	QUnit.test("IconFontRendered", function(assert) {
		assert.equal(document.getElementById(tileIconFont + "-img"), null, "tileIconFont icon should be rendered.");
	});

	QUnit.test("NumberRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId + "-number"), null, "tileBasic number should be rendered.");
	});

	QUnit.test("NumberUnitRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId + "-numberUnit"), null, "tileBasic number unit should be rendered.");
	});

	QUnit.test("TitleRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId + "-title"), null, "tileBasic title should be rendered.");
	});

	QUnit.test("DescriptionRendered", function(assert) {
		assert.notEqual(document.getElementById(tileBasicId + "-info"), null, "tileBasic info should be rendered.");
	});

	QUnit.test("ShouldRenderAddIconIfTypeIsCreate", function(assert) {
		//SUT
		var result,
			sut = new StandardTile({type: "Create"});

		//Act
		result = sut.getIcon();

		//Assert
		assert.ok(result,"result should not be undefined");
		assert.ok(result.indexOf("add") !== -1, result,"result should contain add");

		sut.destroy();
	});

	QUnit.test("ShouldStyleLongNumbersDifferently", function(assert) {
		//SUT
		var sut = new StandardTile({type: "Monitor", number:"4000", icon : IMAGE_PATH + "action.png"}),
				result;
		sut.placeAt("qunit-fixture");
		core.applyChanges();

		//Act
		result = sut.$().find(".sapMStdTileNumS .sapMStdTileNumM");
		//Assert
		assert.equal(result.length, 0);

		//Act
		sut.setNumber("7000000");
		core.applyChanges();
		result = sut.$().find(".sapMStdTileNumM");
		//Assert
		assert.equal(result.length, 1);

		//Act
		sut.setNumber("80000000");
		core.applyChanges();
		result = sut.$().find(".sapMStdTileNumS");
		//Assert
		assert.equal(result.length, 1);

		sut.destroy();
	});

	QUnit.module("Not Rendering Optional Fields");

	QUnit.test("IconNotRendered", function(assert) {
		assert.equal(document.getElementById(tileNoIconId + "-img"), null, "tileNoIcon icon should not be rendered.");
	});

	QUnit.test("NumberNotRendered", function(assert) {
		assert.equal(document.getElementById(tileNoNumberId + "-number"), null, "tileNoNumber number and number units should not be rendered.");
	});

	QUnit.module("Events", {
		beforeEach : function() {
			tileBasic = oCore.byId(tileBasicId);
		},
		afterEach : function() {
			tileBasic = null;
		}
	});

	QUnit.test("PressOk", function(assert) {
		tileBasic.firePress();
		Log.info("Pressed tile id=" + pressedTileId);
		assert.equal(pressedTileId, tileBasicId, "tileBasic was pressed");
	});

	QUnit.test("ShouldDestroyTheImageIfTileGetsDestroyed", function(assert) {
		//SUT
		var sut = new StandardTile({type: "Create"});
		sut.placeAt("qunit-fixture");
		core.applyChanges();

		assert.ok(sut._oImageControl, "make sure the Tile has an image");

		//Act
		sut.destroy();

		//Assert
		assert.equal(sut._oImageControl,null);
	});
});


text:
use crate::gl;
use crate::context;
use crate::ToGlEnum;

/// Describes the parameters that must be used for the stencil operations when drawing.
#[derive(Copy, Clone, Debug)]
pub struct Stencil {
    /// A comparison against the existing value in the stencil buffer.
    ///
    /// Only relevant for faces that are clockwise on the target surface. Other faces, points and
    /// lines use `stencil_test_counter_clockwise` instead.
    ///
    /// The default value is `AlwaysPass`.
    pub test_clockwise: StencilTest,

    /// Reference value that is used by `stencil_test_clockwise`, `stencil_fail_operation_clockwise`,
    /// `stencil_pass_depth_fail_operation_clockwise` and `stencil_depth_pass_operation_clockwise`.
    pub reference_value_clockwise: i32,

    /// Allows specifying a mask when writing data on the stencil buffer.
    ///
    /// Only relevant for faces that are clockwise on the target surface. Other faces, points and
    /// lines use `stencil_write_mask_counter_clockwise` instead.
    ///
    /// The default value is `0xffffffff`.
    pub write_mask_clockwise: u32,

    /// Specifies the operation to do when a fragment fails the stencil test.
    ///
    /// The stencil test is the test specified by `stencil_test_clockwise`.
    ///
    /// Only relevant for faces that are clockwise on the target surface. Other faces, points and
    /// lines use `stencil_fail_operation_counter_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub fail_operation_clockwise: StencilOperation,

    /// Specifies the operation to do when a fragment passes the stencil test but fails
    /// the depth test.
    ///
    /// The stencil test is the test specified by `stencil_test_clockwise`.
    ///
    /// Only relevant for faces that are clockwise on the target surface. Other faces, points and
    /// lines use `stencil_pass_depth_fail_operation_counter_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub pass_depth_fail_operation_clockwise: StencilOperation,

    /// Specifies the operation to do when a fragment passes both the stencil and depth tests.
    ///
    /// The stencil test is the test specified by `stencil_test_clockwise`.
    ///
    /// Only relevant for faces that are clockwise on the target surface. Other faces, points and
    /// lines use `stencil_depth_pass_operation_counter_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub depth_pass_operation_clockwise: StencilOperation,

    /// A comparaison against the existing value in the stencil buffer.
    ///
    /// Only relevant for points, lines and faces that are counter-clockwise on the target surface.
    /// Other faces use `stencil_test_counter_clockwise` instead.
    ///
    /// The default value is `AlwaysPass`.
    pub test_counter_clockwise: StencilTest,

    /// Reference value that is used by `stencil_test_counter_clockwise`,
    /// `stencil_fail_operation_counter_clockwise`,
    /// `stencil_pass_depth_fail_operation_counter_clockwise` and
    /// `stencil_depth_pass_operation_counter_clockwise`.
    pub reference_value_counter_clockwise: i32,

    /// Allows specifying a mask when writing data on the stencil buffer.
    ///
    /// Only relevant for points, lines and faces that are counter-clockwise on the target surface.
    /// Other faces use `stencil_write_mask_clockwise` instead.
    ///
    /// The default value is `0xffffffff`.
    pub write_mask_counter_clockwise: u32,

    /// Specifies the operation to do when a fragment fails the stencil test.
    ///
    /// The stencil test is the test specified by `stencil_test_counter_clockwise`.
    ///
    /// Only relevant for faces that are counter-clockwise on the target surface. Other faces
    /// use `stencil_fail_operation_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub fail_operation_counter_clockwise: StencilOperation,

    /// Specifies the operation to do when a fragment passes the stencil test but fails
    /// the depth test.
    ///
    /// The stencil test is the test specified by `stencil_test_counter_clockwise`.
    ///
    /// Only relevant for faces that are counter-clockwise on the target surface. Other faces
    /// use `stencil_pass_depth_fail_operation_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub pass_depth_fail_operation_counter_clockwise: StencilOperation,

    /// Specifies the operation to do when a fragment passes both the stencil and depth tests.
    ///
    /// The stencil test is the test specified by `stencil_test_counter_clockwise`.
    ///
    /// Only relevant for faces that are counter-clockwise on the target surface. Other faces
    /// use `stencil_depth_pass_operation_clockwise` instead.
    ///
    /// The default value is `Keep`.
    pub depth_pass_operation_counter_clockwise: StencilOperation,
}

impl Default for Stencil {
    #[inline]
    fn default() -> Stencil {
        Stencil {
            test_clockwise: StencilTest::AlwaysPass,
            reference_value_clockwise: 0,
            write_mask_clockwise: 0xffffffff,
            fail_operation_clockwise: StencilOperation::Keep,
            pass_depth_fail_operation_clockwise: StencilOperation::Keep,
            depth_pass_operation_clockwise: StencilOperation::Keep,
            test_counter_clockwise: StencilTest::AlwaysPass,
            reference_value_counter_clockwise: 0,
            write_mask_counter_clockwise: 0xffffffff,
            fail_operation_counter_clockwise: StencilOperation::Keep,
            pass_depth_fail_operation_counter_clockwise: StencilOperation::Keep,
            depth_pass_operation_counter_clockwise: StencilOperation::Keep,
        }
    }
}

/// Specifies which comparison the GPU will do to determine whether a sample passes the stencil
/// test. The general equation is `(ref & mask) CMP (stencil & mask)`, where `ref` is the reference
/// value (`stencil_reference_value_clockwise` or `stencil_reference_value_counter_clockwise`),
/// `CMP` is the comparison chosen, and `stencil` is the current value in the stencil buffer.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum StencilTest {
    /// The stencil test always passes.
    AlwaysPass,

    /// The stencil test always fails.
    AlwaysFail,

    /// `(ref & mask) < (stencil & mask)`
    IfLess {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32
    },

    /// `(ref & mask) <= (stencil & mask)`
    IfLessOrEqual {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32,
    },

    /// `(ref & mask) > (stencil & mask)`
    IfMore {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32,
    },

    /// `(ref & mask) >= (stencil & mask)`
    IfMoreOrEqual {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32,
    },

    /// `(ref & mask) == (stencil & mask)`
    IfEqual {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32,
    },

    /// `(ref & mask) != (stencil & mask)`
    IfNotEqual {
        /// The mask that is and'ed with the reference value and stencil buffer.
        mask: u32,
    },
}

/// Specificies which operation the GPU will do depending on the result of the stencil test.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u32)]    // GLenum
pub enum StencilOperation {
    /// Keeps the value currently in the stencil buffer.
    Keep = gl::KEEP,

    /// Writes zero in the stencil buffer.
    Zero = gl::ZERO,

    /// Writes the reference value (`stencil_reference_value_clockwise` or
    /// `stencil_reference_value_counter_clockwise`) in the stencil buffer.
    Replace = gl::REPLACE,

    /// Increments the value currently in the stencil buffer. If the value is the
    /// maximum, don't do anything.
    Increment = gl::INCR,

    /// Increments the value currently in the stencil buffer. If the value is the
    /// maximum, wrap to `0`.
    IncrementWrap = gl::INCR_WRAP,

    /// Decrements the value currently in the stencil buffer. If the value is `0`,
    /// don't do anything.
    Decrement = gl::DECR,

    /// Decrements the value currently in the stencil buffer. If the value is `0`,
    /// wrap to `-1`.
    DecrementWrap = gl::DECR_WRAP,

    /// Inverts each bit of the value.
    Invert = gl::INVERT,
}

impl ToGlEnum for StencilOperation {
    #[inline]
    fn to_glenum(&self) -> gl::types::GLenum {
        *self as gl::types::GLenum
    }
}

pub fn sync_stencil(ctxt: &mut context::CommandContext<'_>, params: &Stencil) {
    // checks if stencil operations can be disabled
    if params.test_clockwise == StencilTest::AlwaysPass &&
       params.test_counter_clockwise == StencilTest::AlwaysPass &&
       params.fail_operation_clockwise == StencilOperation::Keep &&
       params.pass_depth_fail_operation_clockwise == StencilOperation::Keep &&
       params.depth_pass_operation_clockwise == StencilOperation::Keep &&
       params.fail_operation_counter_clockwise == StencilOperation::Keep &&
       params.pass_depth_fail_operation_counter_clockwise == StencilOperation::Keep &&
       params.depth_pass_operation_counter_clockwise == StencilOperation::Keep
    {
        if ctxt.state.enabled_stencil_test {
            unsafe { ctxt.gl.Disable(gl::STENCIL_TEST) };
            ctxt.state.enabled_stencil_test = false;
        }

        return;
    }

    // we are now in "stencil enabled land"

    // enabling if necessary
    if !ctxt.state.enabled_stencil_test {
        unsafe { ctxt.gl.Enable(gl::STENCIL_TEST) };
        ctxt.state.enabled_stencil_test = true;
    }

    // synchronizing the test and read masks
    let (test_cw, read_mask_cw) = match params.test_clockwise {
        StencilTest::AlwaysPass => (gl::ALWAYS, 0),
        StencilTest::AlwaysFail => (gl::NEVER, 0),
        StencilTest::IfLess { mask } => (gl::LESS, mask),
        StencilTest::IfLessOrEqual { mask } => (gl::LEQUAL, mask),
        StencilTest::IfMore { mask } => (gl::GREATER, mask),
        StencilTest::IfMoreOrEqual { mask } => (gl::GEQUAL, mask),
        StencilTest::IfEqual { mask } => (gl::EQUAL, mask),
        StencilTest::IfNotEqual { mask } => (gl::NOTEQUAL, mask),
    };

    let (test_ccw, read_mask_ccw) = match params.test_counter_clockwise {
        StencilTest::AlwaysPass => (gl::ALWAYS, 0),
        StencilTest::AlwaysFail => (gl::NEVER, 0),
        StencilTest::IfLess { mask } => (gl::LESS, mask),
        StencilTest::IfLessOrEqual { mask } => (gl::LEQUAL, mask),
        StencilTest::IfMore { mask } => (gl::GREATER, mask),
        StencilTest::IfMoreOrEqual { mask } => (gl::GEQUAL, mask),
        StencilTest::IfEqual { mask } => (gl::EQUAL, mask),
        StencilTest::IfNotEqual { mask } => (gl::NOTEQUAL, mask),
    };

    let ref_cw = params.reference_value_clockwise;
    let ref_ccw = params.reference_value_counter_clockwise;

    if (test_cw, ref_cw, read_mask_cw) == (test_ccw, ref_ccw, read_mask_ccw) {
        if ctxt.state.stencil_func_back != (test_cw, ref_cw, read_mask_cw) ||
           ctxt.state.stencil_func_front != (test_ccw, ref_ccw, read_mask_ccw)
        {
            unsafe { ctxt.gl.StencilFunc(test_cw, ref_cw, read_mask_cw) };
            ctxt.state.stencil_func_back = (test_cw, ref_cw, read_mask_cw);
            ctxt.state.stencil_func_front = (test_ccw, ref_ccw, read_mask_ccw);
        }

    } else {
        if ctxt.state.stencil_func_back != (test_cw, ref_cw, read_mask_cw) {
            unsafe { ctxt.gl.StencilFuncSeparate(gl::BACK, test_cw, ref_cw, read_mask_cw) };
            ctxt.state.stencil_func_back = (test_cw, ref_cw, read_mask_cw);
        }

        if ctxt.state.stencil_func_front != (test_ccw, ref_ccw, read_mask_ccw) {
            unsafe { ctxt.gl.StencilFuncSeparate(gl::FRONT, test_ccw, ref_ccw, read_mask_ccw) };
            ctxt.state.stencil_func_front = (test_ccw, ref_ccw, read_mask_ccw);
        }
    }

    // synchronizing the write mask
    if params.write_mask_clockwise == params.write_mask_counter_clockwise {
        if ctxt.state.stencil_mask_back != params.write_mask_clockwise ||
           ctxt.state.stencil_mask_front != params.write_mask_clockwise
        {
            unsafe { ctxt.gl.StencilMask(params.write_mask_clockwise) };
            ctxt.state.stencil_mask_back = params.write_mask_clockwise;
            ctxt.state.stencil_mask_front = params.write_mask_clockwise;
        }

    } else {
        if ctxt.state.stencil_mask_back != params.write_mask_clockwise {
            unsafe { ctxt.gl.StencilMaskSeparate(gl::BACK, params.write_mask_clockwise) };
            ctxt.state.stencil_mask_back = params.write_mask_clockwise;
        }

        if ctxt.state.stencil_mask_front != params.write_mask_clockwise {
            unsafe { ctxt.gl.StencilMaskSeparate(gl::FRONT, params.write_mask_clockwise) };
            ctxt.state.stencil_mask_front = params.write_mask_clockwise;
        }
    }

    // synchronizing the operation
    let op_back = (params.fail_operation_clockwise.to_glenum(),
                   params.pass_depth_fail_operation_clockwise.to_glenum(),
                   params.depth_pass_operation_clockwise.to_glenum());

    let op_front = (params.fail_operation_counter_clockwise.to_glenum(),
                    params.pass_depth_fail_operation_counter_clockwise.to_glenum(),
                    params.depth_pass_operation_counter_clockwise.to_glenum());

    if op_back == op_front {
        if ctxt.state.stencil_op_back != op_back || ctxt.state.stencil_op_front != op_front {
            unsafe { ctxt.gl.StencilOp(op_back.0, op_back.1, op_back.2) };
            ctxt.state.stencil_op_back = op_back;
            ctxt.state.stencil_op_front = op_front;
        }

    } else {
        if ctxt.state.stencil_op_back != op_back {
            unsafe { ctxt.gl.StencilOpSeparate(gl::BACK, op_back.0, op_back.1, op_back.2) };
            ctxt.state.stencil_op_back = op_back;
        }

        if ctxt.state.stencil_op_front != op_front {
            unsafe { ctxt.gl.StencilOpSeparate(gl::FRONT, op_front.0, op_front.1, op_front.2) };
            ctxt.state.stencil_op_front = op_front;
        }
    }
}


text:
from django.contrib.auth import (
        authenticate,
        get_user_model,
        login,
        logout
    )
from django.shortcuts import render, get_object_or_404, Http404, redirect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from .forms import UserLoginForm, UserRegisterForm

User = get_user_model()

def login_view(request):
    title = "Login"
    form = UserLoginForm(request.POST or None)
    if request.user.is_authenticated():
        return HttpResponseRedirect("/account/")

    if form.is_valid():
        username =  form.cleaned_data["username"]
        password =  form.cleaned_data["password"]
        user = authenticate(username=username, password=password)
        login(request, user)
        return HttpResponseRedirect('/account/')
    return render(request, 'login.html',  {"form":form, "title":title})

@login_required(login_url='/login/')
def account_view(request):
    return render(request, 'account.html',  {})

@login_required
def logout_view(request):
    title = "Login again?"
    logout(request)
    return HttpResponseRedirect("/login/")

def register_view(request):
    title = 'Sign Up'
    form = UserRegisterForm(request.POST or None)
    context = {
        "form": form,
        "title": title
    }
    if form.is_valid():
        user = form.save(commit=False)
        password = form.cleaned_data['password']
        user.set_password(password)
        user.save()
        new_user = authenticate(username=user.username, password=password)
        login(request, new_user)

        return HttpResponseRedirect('/account/')

    if request.LANGUAGE_CODE == 'de':
        return render(request, 'account_de.html', context)
    else:
        return render(request, 'account.html', context)


text:
import urllib
import traceback
import StringIO
import smtplib
from mod_python import apache

from pottymouth import PottyMouth
pm = PottyMouth(url_check_domains=('devsuki.com', 'www.devsuki.com'),
                allow_media=True)

page_template = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <body>
  %s
  </body>
</html>
"""

def make_page(request):
    output_string = ""
    args = request.args
    if args is not None:
        args = urllib.unquote(args)
        args = args.decode('utf8')
        args = args[:1000]
        p_nodes = pm.parse(args)
        for p in p_nodes:
            output_string += str(p)
    page = page_template % output_string
    return page

def handler(request):
    request.send_http_header()

    try:
        page = make_page(request)
        request.content_type = 'text/html'
        request.write(page)
    except:
        fake_file = StringIO.StringIO()
        traceback.print_exc(file=fake_file)
        error_str = fake_file.getvalue()
        fake_file.close()

        try:
            smtp = smtplib.SMTP('localhost')
            addr = 'matt-pottymouth@theory.org'
            smtp.sendmail(addr, addr, error_str)
            smtp.quit()
        except smtplib.SMTPException:
            pass

        request.content_type = 'text/plain'
        request.write(error_str)

    return apache.OK


text:
import {Injectable} from '@angular/core';
import {Http, Headers} from '@angular/http';
import {Observable, Subject, BehaviorSubject} from 'rxjs/Rx';
import {BackEndService} from './backend.service';
import {ShareService} from './share.service';
import 'rxjs/add/observable/of'; //proper way to import the 'of' operator
import 'rxjs/add/operator/share';
import 'rxjs/add/operator/map';

@Injectable()
export class DownloadService {

    public downloadQue : any[];
    public alreadyDownloaded : any[];
    public updateDownloadList : Subject<any> = new BehaviorSubject<any>(null);
    public updateAlreadyDownloadedList : Subject<any> = new BehaviorSubject<any>(null);

    constructor(private backendService: BackEndService, private shareService:ShareService){
        this.downloadQue = [];
        this.alreadyDownloaded = [];
        this.backendService.websocketMessages.subscribe((message) => {
            if(message.type == "download_update"){
                if(message.status.indexOf("FAILED") == -1 && message.filename.indexOf("NO DOWNLOAD") == -1){
                    let obj = this.downloadQue.find(x => x.id == message.id);
                    let index = this.downloadQue.indexOf(obj);
                    if(index != -1){
                        this.downloadQue[index] = message;
                        this.updateDownloadList.next(this.downloadQue);
                        this.shareService.updateAmountOfDownloads(this.downloadQue.length);
                    } else {

                        this.downloadQue.push( message );
                        this.updateDownloadList.next(this.downloadQue);
                        this.shareService.updateAmountOfDownloads(this.downloadQue.length);
                    }

                }

                if(message.status == "COMPLETED"){
                    let obj = this.downloadQue.find(x => x.filename == message.filename);
                    let index = this.downloadQue.indexOf(obj);
                    this.downloadQue.splice(index, 1);
                    this.updateDownloadList.next(this.downloadQue);
                    this.getAlreadyDownloaded();
                    this.shareService.updateAmountOfDownloads(this.downloadQue.length);
                }

                if(message.status == "ABORTED"){
                    let obj = this.downloadQue.find(x => x.filename == message.filename);
                    let index = this.downloadQue.indexOf(obj);
                    this.downloadQue.splice(index, 1);
                    this.updateDownloadList.next(this.downloadQue);
                    this.getAlreadyDownloaded();
                    this.shareService.updateAmountOfDownloads(this.downloadQue.length);
                }

            }

            if(message.type == "already_downloaded"){
                console.log(message);
                this.alreadyDownloaded = [];
                for(let file of message.alreadyDownloaded){
                    this.alreadyDownloaded.push(file);
                    console.log(file);
                }
                console.log(this.alreadyDownloaded);
                this.updateAlreadyDownloadedList.next(this.alreadyDownloaded);
            }
        });
    }

    addDownload(download: any){
        this.downloadQue.push(download);
        this.backendService.sendMessage({"action": "add_download", "extra" : download});
        this.shareService.updateAmountOfDownloads(this.downloadQue.length);

    }

    removeDownload(download: any){
        this.backendService.sendMessage({"action" : "delete_download", "extra" : download});
        let obj = this.downloadQue.find(x => x.id == download.id);
        let index = this.downloadQue.indexOf(obj);
        this.downloadQue.splice(index, 1);
        this.shareService.updateAmountOfDownloads(this.downloadQue.length);
        this.updateDownloadList.next(this.downloadQue);
        this.getAlreadyDownloaded();
    }

    getAlreadyDownloaded(){
       this.backendService.sendMessage({"action" : "get_downloads"});
    }

    getDownloadList(){
       this.updateDownloadList.next(this.downloadQue);
    }

}


text:
sudo add-apt-repository ppa:beineri/opt-qt57-trusty -y;
sudo apt-get update -qq


text:
<?php

namespace Oro\Bundle\DataGridBundle\Datagrid;

use Oro\Bundle\DataGridBundle\Exception\InvalidArgumentException;
use Oro\Bundle\DataGridBundle\Provider\ConfigurationProviderInterface;

/**
 * Class Manager
 *
 * @package Oro\Bundle\DataGridBundle\Datagrid
 *
 * Responsibility of this class is to store raw config data, prepare configs for datagrid builder.
 * Public interface returns datagrid object prepared by builder using config
 */
class Manager implements ManagerInterface
{
    /**
     * This flag may be used by callers of this class and extensions to decide are they required for current request
     */
    const REQUIRE_ALL_EXTENSIONS = 'require_all_extensions';

    /** @var Builder */
    protected $datagridBuilder;

    /** @var ConfigurationProviderInterface */
    protected $configurationProvider;

    /** @var RequestParameterBagFactory */
    protected $parametersFactory;

    /** @var NameStrategyInterface */
    protected $nameStrategy;

    /**
     * Constructor
     *
     * @param ConfigurationProviderInterface $configurationProvider
     * @param Builder                        $builder
     * @param RequestParameterBagFactory     $parametersFactory
     * @param NameStrategyInterface          $nameStrategy
     */
    public function __construct(
        ConfigurationProviderInterface $configurationProvider,
        Builder $builder,
        RequestParameterBagFactory $parametersFactory,
        NameStrategyInterface $nameStrategy
    ) {
        $this->configurationProvider = $configurationProvider;
        $this->datagridBuilder       = $builder;
        $this->parametersFactory     = $parametersFactory;
        $this->nameStrategy          = $nameStrategy;
    }

    /**
     * {@inheritDoc}
     */
    public function getDatagrid($name, $parameters = null)
    {
        if (null === $parameters) {
            $parameters = new ParameterBag();
        } elseif (is_array($parameters)) {
            $parameters = new ParameterBag($parameters);
        } elseif (!$parameters instanceof ParameterBag) {
            throw new InvalidArgumentException('$parameters must be an array or instance of ParameterBag.');
        }

        $configuration = $this->getConfigurationForGrid($name);

        $datagrid = $this->datagridBuilder->build($configuration, $parameters);

        return $datagrid;
    }

    /**
     * Used to generate unique id for grid on page
     *
     * @param string $name
     *
     * @return string
     */
    public function getDatagridUniqueName($name)
    {
        return $this->nameStrategy->getGridUniqueName($name);
    }

    /**
     * {@inheritDoc}
     */
    public function getDatagridByRequestParams($name, array $additionalParameters = [])
    {
        $gridScope = $this->nameStrategy->parseGridScope($name);
        if (!$gridScope) {
            // In case if grid has scope in config we should use it to get grid parameters properly
            $configuration = $this->getConfigurationForGrid($name);
            $scope = $configuration->offsetGetOr('scope');
            if ($scope) {
                $name = $this->nameStrategy->buildGridFullName($name, $scope);
            }
        }

        $uniqueName = $this->getDatagridUniqueName($name);
        $parameters = $this->parametersFactory->createParameters($uniqueName);

        /**
         * In case of custom relation - $gridScope will be present.
         * So we need to check for additional parameters (pager, sorter, etc.) by gridName (without scope).
         * E.g. 'uniqueName' can be like 'entity-relation-grid:OroAcme_Bundle_AcmeBundle_Entity_AcmeEntit-relOneToMany'
         *  so parameters by 'uniqueName' will contain 'class_name', 'field_name', 'id'
         *  and parameters by 'gridName' (entity-relation-grid) will contain '_pager', '_sort_by', etc.
         * In such cases we'll merge them together, otherwise pagination and sorters will not work.
         */
        if ($gridScope) {
            $gridName   = $this->nameStrategy->parseGridName($name);
            $additional = $this->parametersFactory->createParameters($gridName)->all();
            if ($additional) {
                $additionalParameters = array_merge($additionalParameters, $additional);
            }
        }

        $parameters->add($additionalParameters);

        return $this->getDatagrid($name, $parameters);
    }

    /**
     * {@inheritDoc}
     */
    public function getConfigurationForGrid($name)
    {
        $gridName = $this->nameStrategy->parseGridName($name);
        $result = $this->configurationProvider->getConfiguration($gridName);

        $gridScope = $this->nameStrategy->parseGridScope($name);
        if ($gridScope) {
            $result->offsetSet('scope', $gridScope);
        }

        return $result;
    }
}


text:
from .factory import AlarmFactory
from .endpoint.factory import AlarmEndpointFactory
from .trigger.factory import TriggerFactory


text:
package io.cattle.platform.core.constants;

public class InstanceLinkConstants {

    public static final String FIELD_INSTANCE_ID = "instanceId";
    public static final String FIELD_PORTS = "ports";
    public static final String FIELD_INSTANCE_NAMES = "instanceNames";

    public static final String DATA_LINK_WAIT_TIME = "linkWaitTime";

}