text:
var module = angular.module('expvar', []);

module.factory('expvar', function($http, $log) {

	var result = {
		pollInterval: null,
		numSamplesToKeep: 60*10,
		metricPaths: {},
		metricValues: {},
		keyLookupPaths: {},
		keyLookupValues: {},

		addMetric: function(name, path) {
			this.metricPaths[name] = path;
		},

		removeMetric: function(name) {
			delete this.metricPaths[name];
		},

		addKeysLookup: function(name, path) {
			this.keyLookupPaths[name] = path;
		},

		getKeys: function(name) {
			return this.keyLookupValues[name];
		},

		getMetricValues: function(name) {
			return this.metricValues[name];
		},

		getMetricCurrentValue: function(name) {
			if (this.metricValues[name] !== undefined) {
				len = this.metricValues[name].length;
				if (len > 0) {
					values = this.metricValues[name];
					return values[len-1];
				}
			}
			return 0;
		},

		getMetricCurrentRate: function(name) {
			if (this.metricValues[name] !== undefined) {
				len = this.metricValues[name].length;
				if (len > 1) {
					values = this.metricValues[name];
					curr = values[len-1];
					prev = values[len-2];
					return curr - prev;
				}
			}
			return 0;
		},

		pollExpvar : function() {
			numSamplesToKeep = this.numSamplesToKeep;
			metricPaths = this.metricPaths;
			metricValues = this.metricValues;
			keyLookupPaths = this.keyLookupPaths;
			keyLookupValues = this.keyLookupValues;
			$http.get("/debug/vars").success(function(data) {
				// lookup key names
				for(var keyLookupName in keyLookupPaths) {
					keyPath = this.keyLookupPaths[keyLookupName];
					keysContainer = jsonpointer.get(data, keyPath);
					keys = [];
					for(var key in keysContainer) {
						keys.push(key);
					}
					keyLookupValues[keyLookupName] = keys;
				}
				// lookup metrics
				for(var metricName in metricPaths) {
					metricPath = this.metricPaths[metricName];
					metricValue = jsonpointer.get(data, metricPath);
					thisMetricValues = metricValues[metricName];
					if (thisMetricValues === undefined) {
						thisMetricValues = [];
					}
					thisMetricValues.push(metricValue);
					while (thisMetricValues.length > numSamplesToKeep) {
						thisMetricValues.shift();
					}
					metricValues[metricName] = thisMetricValues;
				}
			}).error(function(data, status, headers, config) {
				$log.info("error polling expvar");
			});
		},

	};

	return result;
});


text:
    <meta charset="utf-8">
    <title>Wahlque: the new world for education</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="http://wahlque.org/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://wahlque.org/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
    <link href="http://wahlque.org/styles/style.css" rel="stylesheet">
    <link href="/styles/style.css" rel="stylesheet">

    <link rel="shortcut icon" href="http://wahlque.org/favicon.ico">
    <link rel="apple-touch-icon" href="http://wahlque.org/apple-touch-icon.png">

Wahlque

Home

Blog

Wiki

Playground

Code

            <button id="language" class="btn"></button>
            <button class="btn dropdown-toggle" data-toggle="dropdown">

            </button>

 en-us

 zh-cn

 zh-hk

 zh-sg

 zh-tw

Day and night on Wahlque.

Generated terra on Wahlque

A tree generated by L-system

Proof of concept

The orbits of the three star system

A tree

The weather on the planet(warning: it need one minute to intialize and one minute per step for calculating)

CoffeeScript tutorial

Hello World

Using modules

Qwery, Bonzo, Bean

WebWorkers

Mechanics tutorial

Binary stars

Planet in a binary star system

Twilight zone on the planet

Computational graphics tutorial

Terrain generation

Rotated Wahlque

Colorful Wahlque

Atmospheric science tutorial

Temperature on the planet

Notice

redpajama_set_name: RedPajamaGithub


text:
import { LitElement, html, css } from 'lit-element';

class MyElement extends LitElement {
  static get styles() {
    return css`
      ::slotted(*) { font-family: Roboto; }
      ::slotted(p) { color: blue; }
      div ::slotted(*) { color: red; }
    `;
  }
  render() {
    return html`
      <slot></slot>

<slot name="hi"></slot>

    `;
  }
}
customElements.define('my-element', MyElement);


text:
class TournamentResults(object):
    """
    Calculates and wraps results of tournaments
    """
    def __init__(self, botList, interactions, payoffs):
        """
        Calculate the scores of the interactions and the total scores for the
        bots using the specified payoffs.

        ARGS:
        - botList: a list of BotPlayer objects where the index of botX in the
        list is the tournament id used in the argument interactions. basically,
        botList maps tournament id to bot
        - interactions: a dictionary with
            keys => (tournament_id1, tournament_id2)
            values => [meeting1, meeting2, ...]
        where meetingX is a list of tuples (bot1_move, bot2_move).
        For example:
        interactions = {
            (0, 1): [
                [('C', 'D'), ('D', 'D')],
                [('C', 'C'), ('C', 'D'), ('D', 'D')]
            ],
            ...
        }
        - payoffs: defines the scores for each Prisoner's Dilemma situation,
        which TournamentResults needs to correctly score each interaction
        """
        self.botList = botList
        self.interactions = interactions
        self.payoffs = payoffs

        self.numBots = len(self.botList)

        # to allow lookup for bot name and description by tournament id
        self.bot_info_by_id = {}
        for bot in botList:
            self.bot_info_by_id[bot.tournament_id] =\
            {'name': bot.name, 'description': bot.description, 'total': 0}

        self.interaction_lengths = []
        some_pair = self.interactions.keys()[0]
        for interaction in self.interactions[some_pair]:
            self.interaction_lengths.append(len(interaction))

        self.total_interactions = float(
            self.numBots*sum(self.interaction_lengths)
        )

        # to be filled with scores for each bot in each interaction
        self.interaction_scores = {}

        # calculate and store interaction and total scores
        self.calculate_scores()

    def __str__(self):
        # sort the bots for printing output
        def get_score(bot):
            return self.bot_info_by_id[bot.tournament_id]['total']
        sorted_bots = sorted(self.botList, key=get_score, reverse=True)

        headers = [
            "Tournament ID",
            "Bot Name",
            "Total Score",
            "Avg Score Per Turn"
        ]
        num_cols = len(headers)

        # find a good column width to use for formatting the output
        long_header = max([len(h) for h in headers])
        long_name = max([len(bot.name) for bot in self.botList])+1
        col = max([long_header, long_name])
        col_str = str(col)
        format_str = (("{: <"+col_str+"} ")*num_cols)[:-1]
        hr = "-"*(num_cols*col)

        # construct output string
        output = "\n***\n"
        output += "Interaction Lengths: "+str(self.interaction_lengths)
        output += "\n***\n"
        headers_str = format_str.format(*headers)
        output += "\n"+hr+"\n"+headers_str+"\n"+hr+"\n"
        for bot in sorted_bots:
            t_id = bot.tournament_id
            name = self.get_name_by_id(t_id)
            score = self.get_score_by_id(t_id)
            avg = self.get_avg_score_by_id(t_id)
            row = format_str.format(str(t_id), name, str(score), avg)
            output += row+"\n"
        return output

    ## TODO: make pretty printing for interactions

    #####
    # Initialization calculation methods
    #####

    def score_turn(self, actions):
        """
        Get the scores for each bot for a single turn

        ARGS:
        - actions: tuple (bot1_move, bot2_move)

        RETURNS:
        - scores: the score for each bot (bot1_score, bot2_score)
        """
        scores = -1

        if actions[0] == 'C':
            if actions[1] == 'C':
                scores = (self.payoffs['R'], self.payoffs['R'])
            elif actions[1] == 'D':
                scores = (self.payoffs['S'], self.payoffs['T'])
            else:
                print("actions[1] is not a valid move, must be 'C' or 'D'")
                return -1
        elif actions[0] == 'D':
            if actions[1] == 'C':
                scores = (self.payoffs['T'], self.payoffs['S'])
            elif actions[1] == 'D':
                scores = (self.payoffs['P'], self.payoffs['P'])
            else:
                print("actions[1] is not a valid move, must be 'C' or 'D'")
                return -1
        else:
            print("actions[0] is not a valid move, must be 'C' or 'D'")
            return -1

        return scores

    def calculate_scores(self):
        """
        Get the scores for each bot pair meetings list and store in
        self.interaction_scores. Tally up the total score for each bot and store
        in self.bot_info_by_id['total']
        """
        for bot_pair in self.interactions:
            self.interaction_scores[bot_pair] = []
            for meeting in self.interactions[bot_pair]:
                meeting_scores = [0, 0]
                for turn in meeting:
                    turn_scores = self.score_turn(turn)
                    # accumulate scores for meeting
                    meeting_scores[0] += turn_scores[0]
                    meeting_scores[1] += turn_scores[1]
                meeting_scores = tuple(meeting_scores)
                # add scores for meeting to list of meeting scores for this pair
                self.interaction_scores[bot_pair].append(meeting_scores)
                # also add to total for each bot, but only once if this is a bot
                # paired with its clone
                if bot_pair[0] == bot_pair[1]:
                    self.bot_info_by_id[bot_pair[0]]['total']\
                     += meeting_scores[0]
                else:
                    for idx, bot_id in enumerate(bot_pair):
                        self.bot_info_by_id[bot_id]['total']\
                         += meeting_scores[idx]

    #####
    # Getter methods
    #####

    def get_name_by_id(self, t_id):
        return self.bot_info_by_id[t_id]['name']

    def get_description_by_id(self, t_id):
        return self.bot_info_by_id[t_id]['description']

    def get_score_by_id(self, t_id):
        return self.bot_info_by_id[t_id]['total']

    def get_avg_score_by_id(self, t_id):
        return self.get_score_by_id(t_id)/self.total_interactions

    def get_winning_id(self):
        id_list = [bot.tournament_id for bot in self.botList]
        return max(id_list, key=self.get_score_by_id)

    def get_winning_name(self):
        return self.get_name_by_id(self.get_winning_id())

    def get_interaction_score(self, id_1, id_2, meeting):
        return self.interaction_scores[(id_1, id_2)][meeting]

    def get_interaction_scores(self, id_1, id_2):
        return self.interaction_scores[(id_1, id_2)]

    def get_interaction(self, id_1, id_2, meeting):
        return self.interactions[(id_1, id_2)][meeting]

    def get_interactions(self, id_1, id_2):
        return self.interactions[(id_1, id_2)]

    def get_bot_list(self):
        return self.botList

    def get_sorted_bot_list(self):
        def get_score(bot):
            return self.get_score_by_id(bot.tournament_id)
        return sorted(self.botList, key=get_score, reverse=True)

if __name__ == "__main__":
    pass


text:
def combine(list1, list2):
    """
    Write a function that combines two lists by alternatingly taking elements.
    For example: given the two lists [a, b, c] and [1, 2, 3], the function
    should return [a, 1, b, 2, c, 3].
    """
    output = []
    for i in range(max(len(list1), len(list2))):
        output.append(list1[i])
        output.append(list2[i])
    return output


text:
package com.squarespace.less;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;

import org.testng.annotations.Test;

import com.squarespace.less.core.LessHarness;
import com.squarespace.less.core.LessTestBase;
import com.squarespace.less.parse.LessSyntax;

public class CommentTest extends LessTestBase {

  @Test
  public void testEquals() {
    assertEquals(comment("x", true), comment("x", true));
    assertEquals(comment("y", false), comment("y", false));
    assertNotEquals(comment("x", false), comment("y", false));
    assertNotEquals(comment("x", false), comment("x", true));
  }

  @Test
  public void testModelReprSafety() {
    comment("x", false).toString();
  }

  @Test
  public void testComment() throws LessException {
    LessHarness h = new LessHarness(LessSyntax.COMMENT);
    h.parseEquals("/*** a*b/c ***/", comment("** a*b/c **", true));
    h.parseEquals("/* foo */", comment(" foo ", true));
    h.parseEquals("/* \n fooo \n*/", comment(" \n fooo \n", true));
    h.parseEquals("// foo", comment(" foo", false));
    h.parseEquals("// a //", comment(" a //", false));
    h.parseFails("/x", SyntaxErrorType.INCOMPLETE_PARSE);
  }

  @Test
  public void testBangComment() throws LessException {
    LessHarness h = new LessHarness(LessSyntax.STYLESHEET);
    LessOptions opts = new LessOptions(true);

    String actual;
    String source = "/* foo *//*! bar *//* foo */";

    actual = h.execute(source, opts);
    assertEquals(actual, "/*! bar */\n");

    // When comments are being ignored, ensure hang comments are still captured
    opts.ignoreComments(true);
    actual = h.execute(source, opts);
    assertEquals(actual, "/*! bar */\n");
  }
}


text:
<?php

require_once __DIR__ . '/bootstrap.php';

$app->before(function () use ($app)
{
    $app['twig']->addGlobal('layout', $app['twig']->loadTemplate('layout.twig'));
});

$app->match('/monitor/upstream/error', function () use ($app)
{
    $app['monolog']->addDebug('Monitor upstream error.');
    return 'ok';
});

$app->match('/', function () use ($app)
{
    return $app['twig']->render('index.twig');
});


text:
title: Define an External Table with Single Row Error Isolation
---

The following example logs errors internally in Greenplum Database and sets an error threshold of 10 errors.

```
=# CREATE EXTERNAL TABLE ext_expenses ( name text,
   date date,  amount float4, category text, desc1 text )
   LOCATION ('gpfdist://etlhost-1:8081/*',
             'gpfdist://etlhost-2:8082/*')
   FORMAT 'TEXT' (DELIMITER '|')
   LOG ERRORS SEGMENT REJECT LIMIT 10
     ROWS;
```

Use the built-in SQL function `gp_read_error_log('external_table')` to read the error log data. This example command displays the log errors for *ext\_expenses*:

```
SELECT gp_read_error_log('ext_expenses');
```

For information about the format of the error log, see [Viewing Bad Rows in the Error Log](g-viewing-bad-rows-in-the-error-table-or-error-log.html).

The built-in SQL function `gp_truncate_error_log('external_table')` deletes the error data. This example deletes the error log data created from the previous external table example :

```
SELECT gp_truncate_error_log('ext_expenses');
```

**Parent topic:** [Handling Load Errors](../../load/topics/g-handling-load-errors.html)


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace IO{
    public static class IOPlayerPrefs {

        #region PlayerPrefs

        #region Save
        /// <summary>
        /// Sets the bool and saves it (as int) to PlayerPrefs.
        /// </summary>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_value">The boolean value.</param>
        public static void SaveBool(string p_key, bool p_value){
            SaveInt(p_key, p_value ? 1 : 0);
        }

        /// <summary>
        /// Sets the float and saves it to PlayerPrefs.
        /// </summary>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_value">The float value.</param>
        public static void SaveFloat(string p_key, float p_value){
            PlayerPrefs.SetFloat(p_key, p_value);
            PlayerPrefs.Save();
        }

        /// <summary>
        /// Sets the integer and saves it to PlayerPrefs.
        /// </summary>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_value">The integer value.</param>
        public static void SaveInt(string p_key, int p_value){
            PlayerPrefs.SetInt(p_key, p_value);
            PlayerPrefs.Save();
        }

        /// <summary>
        /// Sets the string and saves it to PlayerPrefs.
        /// </summary>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_value">The string value.</param>
        public static void SaveString(string p_key, string p_value){
            PlayerPrefs.SetString(p_key, p_value);
            PlayerPrefs.Save();
        }
        #endregion Save

        #region Load
        /// <summary>
        /// Loads a float, if it exists, from the PlayerPrefs.
        /// </summary>
        /// <returns>The float value.</returns>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_defaultValue">The default float value.</param>
        public static bool LoadBool(string p_key, bool p_defaultValue){
            return PlayerPrefs.GetInt(p_key, 0) == 1 ? true : false;
        }

        /// <summary>
        /// Loads a float, if it exists, from the PlayerPrefs.
        /// </summary>
        /// <returns>The float value.</returns>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_defaultValue">The default float value.</param>
        public static float LoadFloat(string p_key, float p_defaultValue = 0f){
            return PlayerPrefs.GetFloat(p_key, p_defaultValue);
        }

        /// <summary>
        /// Loads an int, if it exists, from the PlayerPrefs.
        /// </summary>
        /// <returns>The int value.</returns>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_defaultValue">The default int value.</param>
        public static int LoadInt(string p_key, int p_defaultValue = 0){
            return PlayerPrefs.GetInt(p_key, p_defaultValue);
        }

        /// <summary>
        /// Loads an int, if it exists, from the PlayerPrefs.
        /// </summary>
        /// <returns>The float value.</returns>
        /// <param name="p_key">The string key.</param>
        /// <param name="p_defaultValue">The default value float.</param>
        public static string LoadString(string p_key, string p_defaultValue = ""){
            return PlayerPrefs.GetString(p_key, p_defaultValue);
        }
        #endregion Load

        #region Delete

        /// <summary>
        /// Deletes all data saved to PlayerPrefs.
        /// </summary>
        public static void DeleteAll(){
            PlayerPrefs.DeleteAll();
        }

        /// <summary>
        /// Deletes the key saved to PlayerPrefs.
        /// </summary>
        /// <param name="p_key">The key to be deleted.</param>
        public static void DeleteKey(string p_key){
            PlayerPrefs.DeleteKey(p_key);
        }

        #endregion Delete

        #endregion PlayerPrefs
    }
}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using Newtonsoft.Json;

namespace Reusable.OneTo1.Converters.Generic
{
    [PublicAPI]
    public abstract class JsonConverter<TValue, TResult> : TypeConverter<TValue, TResult>
    {
        //[NotNull]
        //private ISet<Type> _stringTypes;

        protected JsonConverter(JsonSerializerSettings settings, ISet<Type> stringTypes)
        {
            Settings = settings;
            StringTypes = stringTypes;
        }

        protected JsonConverter(JsonSerializerSettings settings) : this(settings, new HashSet<Type>())
        {
        }

        [NotNull, ItemNotNull]
        protected ISet<Type> StringTypes { get; }
        //{
        //    get => _stringTypes;
        //    set => _stringTypes = value ?? throw new ArgumentNullException(nameof(StringTypes));
        //}

        protected JsonSerializerSettings Settings { get; }

        protected static bool IsQuoted(string text)
        {
            return text.StartsWith("\"") && text.EndsWith("\"");
        }

        protected bool IsStringType(Type type)
        {
            return StringTypes.Contains(type.IsEnum ? typeof(Enum) : type);
        }
    }

    public class JsonToObjectConverter<T> : JsonConverter<String, T>
    {
        public JsonToObjectConverter(JsonSerializerSettings settings, ISet<Type> stringTypes) : base(settings, stringTypes)
        {
            // there's nothing else to do
        }

        public JsonToObjectConverter(JsonSerializerSettings settings) : base(settings)
        {
            // there's nothing else to do
        }

        public JsonToObjectConverter() : this(new JsonSerializerSettings
        {
            Culture = CultureInfo.InvariantCulture,
            TypeNameHandling = TypeNameHandling.Auto
        })
        {
            // there's nothing else to do
        }

        protected override T ConvertCore(IConversionContext<string> context)
        {
            // String-types require quotes for deserialization.
            var requiresQuotes = IsStringType(typeof(T)) && !IsQuoted(context.Value);

            return JsonConvert.DeserializeObject<T>(requiresQuotes ? Quote(context.Value) : context.Value, Settings);
        }

        protected static string Quote(string value)
        {
            return $@"""{value}""";
        }
    }

    public class ObjectToJsonConverter<T> : JsonConverter<T, String>
    {
        public ObjectToJsonConverter(JsonSerializerSettings settings, ISet<Type> stringTypes) : base(settings, stringTypes)
        {
            // there's nothing else to do
        }

        public ObjectToJsonConverter(JsonSerializerSettings settings) : base(settings)
        {
            // there's nothing else to do
        }

        public ObjectToJsonConverter() : this(new JsonSerializerSettings
        {
            Culture = CultureInfo.InvariantCulture,
            Formatting = Formatting.Indented
        })
        {
            // there's nothing else to do
        }

        protected override string ConvertCore(IConversionContext<T> context)
        {
            var result = JsonConvert.SerializeObject(context.Value, Settings);

            // String-types must not contain quotes after serialization.
            return
                IsStringType(typeof(T))
                    ? Unquote(result)
                    : result;
        }

        protected static string Unquote(string value)
        {
            return Regex.Replace(value, @"(^""|""$)", string.Empty);
        }
    }
}


text:
require 'spec_helper'

feature 'Managing workshops' do
  let(:member) { Fabricate(:member) }
  let!(:chapter) { Fabricate(:chapter) }
  let!(:sponsor) { Fabricate(:sponsor) }

  before do
    login_as_admin(member)
    member.add_role(:organiser, Chapter)
  end

  scenario "creating a new workshop" do
    visit new_admin_workshop_path

    select chapter.name
    fill_in "Date", with: Date.today
    fill_in "Time", with: "11:30"

    click_on "Save"

    expect(page).to have_content "Invite"
  end

  scenario "assigning a host to a workshop" do
    workshop = Fabricate(:sessions_no_sponsor)
    visit edit_admin_workshop_path(workshop)

    select sponsor.name, from: "sessions_host"

    click_on "Save"

    within "#host" do
      expect(page).to have_content sponsor.name
    end
  end

  scenario "assigning a sponsor to a workshop" do
    workshop = Fabricate(:sessions_no_sponsor)
    visit edit_admin_workshop_path(workshop)

    select sponsor.name, from: "sessions_sponsor_ids"

    click_on "Save"

    within "#sponsors" do
      expect(page).to have_content sponsor.name
    end
  end
end


text:
"""
Module for parsing patch-*.xml files from the repository metadata.
"""

import logging

log = logging.getLogger('repomd')

__all__ = ('PatchXml', )

from rpath_xmllib import api1 as xmllib

from repomd.xmlcommon import XmlFileParser, SlotNode
from repomd.packagexml import PackageXmlMixIn
from repomd.errors import UnknownElementError

class _Patch(SlotNode):
    """
    Python representation of patch-*.xml from the repository metadata.
    """

    # R0902 - Too many instance attributes
    # pylint: disable=R0902

    __slots__ = ('name', 'summary', 'description', 'version',
                 'release', 'requires', 'recommends', 'rebootNeeded',
                 'licenseToConfirm', 'packageManager', 'category',
                 'packages', 'provides', 'supplements', 'conflicts',
                 'obsoletes', 'timestamp')

    def __init__(self, *args, **kwargs):
        SlotNode.__init__(self, *args, **kwargs)
        # Need access to this so it can be modified when syncing a
        # patch's timestamp across architectures.
        self.timestamp = self.getAttribute('timestamp')

    def __repr__(self):
        return self.name + '-' + self.version

    # All attributes are defined in __init__ by iterating over __slots__,
    # this confuses pylint.
    # W0201 - Attribute $foo defined outside __init__
    # pylint: disable=W0201

    def addChild(self, child):
        """
        Parse children of patch element.
        """

        # R0912 - Too many branches
        # pylint: disable=R0912

        n = child.getName()
        if n == 'yum:name':
            self.name = child.finalize()
        elif n == 'summary':
            if child.getAttribute('lang') == 'en':
                self.summary = child.finalize()
        elif n == 'description':
            if child.getAttribute('lang') == 'en':
                self.description = child.finalize()
        elif n == 'yum:version':
            self.version = child.getAttribute('ver')
            self.release = child.getAttribute('rel')
        elif n == 'rpm:requires':
            self.requires = child.getChildren('entry', namespace='rpm')
        elif n == 'rpm:provides':
            self.provides = child.getChildren('entry', namespace='rpm')
        elif n == 'rpm:supplements':
            self.supplements = child.getChildren('entry', namespace='rpm')
        elif n == 'rpm:recommends':
            self.recommends = child.getChildren('entry', namespace='rpm')
        elif n == 'rpm:obsoletes':
            self.obsoletes = child.getChildren('entry', namespace='rpm')
        elif n == 'rpm:conflicts':
            self.conflicts = child.getChildren('entry', namespace='rpm')
        elif n == 'reboot-needed':
            self.rebootNeeded = True
        elif n == 'license-to-confirm':
            self.licenseToConfirm = child.finalize()
        elif n == 'package-manager':
            self.packageManager = True
        elif n == 'category':
            self.category = child.finalize()
        elif n == 'atoms':
            self.packages = child.getChildren('package')
        else:
            raise UnknownElementError(child)

    def __cmp__(self, other):
        vercmp = cmp(self.version, other.version)
        if vercmp != 0:
            return vercmp

        relcmp = cmp(self.release, other.release)
        if relcmp != 0:
            return relcmp

        sumcmp = cmp(self.summary, other.summary)
        if sumcmp != 0:
            return sumcmp

        desccmp = cmp(self.description, other.description)
        if desccmp != 0:
            return desccmp

        if self.timestamp != other.timestamp:
            maxtime = max(self.timestamp, other.timestamp)
            log.info('syncing timestamps (%s %s) ' % (self.timestamp,
                                                      other.timestamp) +
                     'for %s-%s to %s' % (self.name, self.version, maxtime))
            self.timestamp = other.timestamp = maxtime
            # Don't return here--they're now equal.

        for pkg in other.packages:
            if pkg not in self.packages:
                self.packages.append(pkg)

        return 0

    def __hash__(self):
        return hash((self.name, self.version, self.release, self.summary,
                     self.description))

class _Atoms(SlotNode):
    """
    Parser for the atoms element of a path-*.xml file.
    """

    __slots__ = ()

    def addChild(self, child):
        """
        Parse children of atoms element.
        """

        n = child.getName()
        if n == 'package':
            child.type = child.getAttribute('type')
            SlotNode.addChild(self, child)
        elif n == 'message':
            pass
        elif n == 'script':
            pass
        else:
            raise UnknownElementError(child)

class PatchXml(XmlFileParser, PackageXmlMixIn):
    """
    Handle registering all types for parsing patch-*.xml files.
    """

    def _registerTypes(self):
        """
        Setup databinder to parse xml.
        """

        PackageXmlMixIn._registerTypes(self)
        self._databinder.registerType(_Patch, name='patch')
        self._databinder.registerType(xmllib.StringNode, name='name',
                                      namespace='yum')
        self._databinder.registerType(xmllib.StringNode, name='category')
        self._databinder.registerType(_Atoms, name='atoms')
        self._databinder.registerType(xmllib.StringNode,
                                      name='license-to-confirm')


text:
package loon.font;

import loon.LSystem;
import loon.canvas.LColor;
import loon.component.layout.HorizontalAlign;
import loon.geom.PointF;
import loon.opengl.GLEx;
import loon.utils.MathUtils;
import loon.utils.StrBuilder;
import loon.utils.StringUtils;
import loon.utils.TArray;

/**
 * Loon的字体渲染辅助工具,它并非针对某一特定Font的,而是所有实现了IFont接口的类都可以使用此工具
 */
public class FontUtils {

	protected static class WarpChars {

		// they is other char flags
		protected final static char[] TABLE = { '\u3002', '\u3001', '\uff0c', '\uff0e', '\u300d', '\uff3d', '\u3011',
				'\u300f', '\u30fc', '\uff5e', '\uff09', '\u3041', '\u3043', '\u3045', '\u3047', '\u3049', '\u30a1',
				'\u30a3', '\u30a5', '\u30a7', '\u30a9', '\u30c3', '\u30e3', '\u30e5', '\u30e7', '\u30ee', '\u308e',
				'\u3083', '\u3085', '\u3087', '\u3063', '\u2026', '\uff0d', '\uff01', '\uff1f' };
	}

	private final static int FLAGS = 35;

	private static final int UNSPECIFIED = -1;

	public static void drawLeft(GLEx g, String s, int x, int y) {
		drawString(g, g.getFont(), s, HorizontalAlign.LEFT, x, y, 0, LColor.white);
	}

	public static void drawLeft(GLEx g, IFont font, String s, int x, int y) {
		drawString(g, font, s, HorizontalAlign.LEFT, x, y, 0, LColor.white);
	}

	public static void drawCenter(GLEx g, String s, int x, int y, int width) {
		drawString(g, g.getFont(), s, HorizontalAlign.CENTER, x, y, width, LColor.white);
	}

	public static void drawCenter(GLEx g, IFont font, String s, int x, int y, int width) {
		drawString(g, font, s, HorizontalAlign.CENTER, x, y, width, LColor.white);
	}

	public static void drawCenter(GLEx g, String s, int x, int y, int width, LColor color) {
		drawString(g, g.getFont(), s, HorizontalAlign.CENTER, x, y, width, color);
	}

	public static void drawCenter(GLEx g, IFont font, String s, int x, int y, int width, LColor color) {
		drawString(g, font, s, HorizontalAlign.CENTER, x, y, width, color);
	}

	public static void drawRight(GLEx g, String s, int x, int y, int width) {
		drawString(g, g.getFont(), s, HorizontalAlign.RIGHT, x, y, width, LColor.white);
	}

	public static void drawRight(GLEx g, IFont font, String s, int x, int y, int width) {
		drawString(g, font, s, HorizontalAlign.RIGHT, x, y, width, LColor.white);
	}

	public static void drawRight(GLEx g, String s, int x, int y, int width, LColor color) {
		drawString(g, g.getFont(), s, HorizontalAlign.RIGHT, x, y, width, color);
	}

	public static void drawRight(GLEx g, IFont font, String s, int x, int y, int width, LColor color) {
		drawString(g, font, s, HorizontalAlign.RIGHT, x, y, width, color);
	}

	public static final void drawString(GLEx g, IFont font, final String s, final HorizontalAlign align, final int x,
			final int y, final int width, LColor color) {
		if (align == HorizontalAlign.LEFT) {
			font.drawString(g, s, x, y, color);
		} else if (align == HorizontalAlign.CENTER) {
			font.drawString(g, s, x + (width / 2) - (font.stringWidth(s) / 2), y, color);
		} else if (align == HorizontalAlign.RIGHT) {
			font.drawString(g, s, x + width - font.stringWidth(s), y, color);
		}
	}

	public static float measureText(final IFont font, final CharSequence chars) {
		return FontUtils.measureText(font, chars, 0, chars.length());
	}

	public static float measureText(final IFont font, final CharSequence chars, final int start, final int end) {
		if (font == null) {
			return 0f;
		}
		final int textLength = end - start;
		if (textLength <= 0) {
			return 0;
		} else if (textLength == 1) {
			return font.charWidth(chars.charAt(start));
		}
		if (chars instanceof String) {
			return font.stringWidth(((String) chars).substring(start, end).toString());
		} else {
			return font.stringWidth(new StrBuilder(chars).substring(start, end).toString());
		}
	}

	public static PointF getTextWidthAndHeight(IFont font, TArray<String> messages) {
		return getTextWidthAndHeight(font, messages, 1f, 1f);
	}

	public static PointF getTextWidthAndHeight(IFont font, TArray<String> messages, float defWidth, float defHeight) {
		PointF amountSize = new PointF();
		float maxHeight = 0f;
		for (String cs : messages) {
			if (cs != null) {
				PointF newSize = getTextWidthAndHeight(font, cs, defWidth, defHeight);
				amountSize.x = MathUtils.max(newSize.x, amountSize.x);
				amountSize.y = MathUtils.max(newSize.y, amountSize.y);
				maxHeight += amountSize.y;
			}
		}
		amountSize.y = maxHeight;
		return amountSize;
	}

	public static PointF getTextWidthAndHeight(IFont font, String message) {
		return getTextWidthAndHeight(font, message, 1f, 1f);
	}

	public static PointF getTextWidthAndHeight(IFont font, String message, float defWidth, float defHeight) {
		if (font != null && message != null) {
			TArray<CharSequence> result = new TArray<CharSequence>();
			result = splitLines(message, result);
			float maxWidth = 0f;
			float space = font.getSize() / 4f;
			for (int i = 0; i < result.size; i++) {
				maxWidth = MathUtils.max(maxWidth, font.stringWidth(new StrBuilder(result.get(i)).toString()));
			}
			if (defWidth >= 1f && defHeight >= 1f) {
				return new PointF(MathUtils.max(defWidth, maxWidth) + space,
						MathUtils.max(defHeight, (result.size * font.getHeight())) + space);
			} else {
				return new PointF(maxWidth + space, (result.size * font.getHeight()) + space);
			}
		}
		return new PointF(defWidth, defHeight);
	}

	/**
	 * 返回指定字符串,匹配指定字体后,在指定宽度内的每行应显示字符串.
	 *
	 * PS:此项不处理'\n'外的特殊操作符
	 *
	 * @param text
	 * @param font
	 * @param width
	 * @return
	 */
	public static TArray<String> splitLines(String text, IFont font, float width) {

		TArray<String> list = new TArray<String>();
		if (text == null) {
			return list;
		}

		if (width <= 1) {
			if (text.indexOf('\n') == -1) {
				width = (int) measureText(font, text);
			} else {
				width = (int) measureText(font, StringUtils.split(text, '\n')[0]);
			}
		}

		char c1 = '〜';
		char c2 = 65374;
		String str = text.replace(c1, c2);
		String line = LSystem.EMPTY;

		int i = 0;

		while (i <= str.length()) {
			if (i == str.length()) {
				list.add(line);
				break;
			}

			char c = str.charAt(i);

			if ((c == '\n') || (font.stringWidth(line + c) > width)) {
				line = str.substring(0, i);

				for (int j = 0; j < FLAGS; j++) {
					if (c == WarpChars.TABLE[j]) {
						int delta = (int) (font.stringWidth(line + c) - width);
						if (delta < 15) {
							line = str.substring(0, ++i);
							break;
						}
					}
				}
				i += (c == '\n' ? 1 : 0);
				list.add(line);
				line = LSystem.EMPTY;
				str = str.substring(i);
				i = 0;
			} else {
				line = line + c;
				i++;
			}
		}

		return list;
	}

	public static <T extends TArray<CharSequence>> T splitLines(final CharSequence chars, final T result) {
		return StringUtils.splitArray(chars, '\n', result);
	}

	public static <T extends TArray<CharSequence>> T splitLines(final IFont font, final CharSequence chars,
			final T result, final AutoWrap autoWrap, final float autoWrapWidth) {
		switch (autoWrap) {
		case VERTICAL:
			return FontUtils.splitLinesByLetters(font, chars, result, autoWrapWidth);
		case HORIZONTAL:
			return FontUtils.splitLinesByWords(font, chars, result, autoWrapWidth);
		default:
		case NONE:
		case CJK:
			return FontUtils.splitLinesByCJK(font, chars, result, autoWrapWidth);
		}
	}

	private static <T extends TArray<CharSequence>> T splitLinesByLetters(final IFont font, final CharSequence chars,
			final T result, final float autoWrapWidth) {
		final int textLength = chars.length();

		int lineStart = 0;
		int lineEnd = 0;
		int lastNonWhitespace = 0;
		boolean charsAvailable = false;

		for (int i = 0; i < textLength; i++) {
			final char character = chars.charAt(i);
			if (character != LSystem.SPACE) {
				if (charsAvailable) {
					lastNonWhitespace = i + 1;
				} else {
					charsAvailable = true;
					lineStart = i;
					lastNonWhitespace = lineStart + 1;
					lineEnd = lastNonWhitespace;
				}
			}

			if (charsAvailable) {
				final float lookaheadLineWidth = FontUtils.measureText(font, chars, lineStart, lastNonWhitespace);

				final boolean isEndReached = (i == (textLength - 1));
				if (isEndReached) {
					if (lookaheadLineWidth <= autoWrapWidth) {
						result.add(chars.subSequence(lineStart, lastNonWhitespace));
					} else {
						result.add(chars.subSequence(lineStart, lineEnd));
						if (lineStart != i) {
							result.add(chars.subSequence(i, lastNonWhitespace));
						}
					}
				} else {
					if (lookaheadLineWidth <= autoWrapWidth) {
						lineEnd = lastNonWhitespace;
					} else {
						result.add(chars.subSequence(lineStart, lineEnd));
						i = lineEnd - 1;
						charsAvailable = false;
					}
				}
			}
		}

		return result;
	}

	private static <T extends TArray<CharSequence>> T splitLinesByWords(final IFont font, final CharSequence chars,
			final T result, final float autoWrapWidth) {
		final int textLength = chars.length();

		if (textLength == 0) {
			return result;
		}

		final float spaceWidth = font.charWidth(LSystem.SPACE);

		int lastWordEnd = FontUtils.UNSPECIFIED;
		int lineStart = FontUtils.UNSPECIFIED;
		int lineEnd = FontUtils.UNSPECIFIED;

		float lineWidthRemaining = autoWrapWidth;
		boolean firstWordInLine = true;
		int i = 0;
		while (i < textLength) {
			int spacesSkipped = 0;
			while ((i < textLength) && (chars.charAt(i) == LSystem.SPACE)) {
				i++;
				spacesSkipped++;
			}
			final int wordStart = i;

			if (lineStart == FontUtils.UNSPECIFIED) {
				lineStart = wordStart;
			}

			while ((i < textLength) && (chars.charAt(i) != LSystem.SPACE)) {
				i++;
			}

			final int wordEnd = i;

			if (wordStart == wordEnd) {
				if (!firstWordInLine) {
					result.add(chars.subSequence(lineStart, lineEnd));
				}
				break;
			}

			final float wordWidth = FontUtils.measureText(font, chars, wordStart, wordEnd);

			final float widthNeeded;
			if (firstWordInLine) {
				widthNeeded = wordWidth;
			} else {
				widthNeeded = (spacesSkipped * spaceWidth) + wordWidth;
			}

			if (widthNeeded <= lineWidthRemaining) {
				if (firstWordInLine) {
					firstWordInLine = false;
				} else {
					lineWidthRemaining -= FontUtils.getAdvance(font, chars, lastWordEnd - 1);
				}
				lineWidthRemaining -= widthNeeded;
				lastWordEnd = wordEnd;
				lineEnd = wordEnd;

				if (wordEnd == textLength) {
					result.add(chars.subSequence(lineStart, lineEnd));
					break;
				}
			} else {
				if (firstWordInLine) {
					if (wordWidth >= autoWrapWidth) {
						result.add(chars.subSequence(wordStart, wordEnd));
						lineWidthRemaining = autoWrapWidth;
					} else {
						lineWidthRemaining = autoWrapWidth - wordWidth;
						if (wordEnd == textLength) {
							result.add(chars.subSequence(wordStart, wordEnd));
							break;
						}
					}
					firstWordInLine = true;
					lastWordEnd = FontUtils.UNSPECIFIED;
					lineStart = FontUtils.UNSPECIFIED;
					lineEnd = FontUtils.UNSPECIFIED;
				} else {
					result.add(chars.subSequence(lineStart, lineEnd));
					if (wordEnd == textLength) {
						result.add(chars.subSequence(wordStart, wordEnd));
						break;
					} else {
						lineWidthRemaining = autoWrapWidth - wordWidth;
						firstWordInLine = false;
						lastWordEnd = wordEnd;
						lineStart = wordStart;
						lineEnd = wordEnd;
					}
				}
			}
		}
		return result;
	}

	private static <T extends TArray<CharSequence>> T splitLinesByCJK(final IFont font, final CharSequence chars,
			final T result, final float autoWrapWidth) {
		final int textLength = chars.length();

		int lineStart = 0;
		int lineEnd = 0;

		while ((lineStart < textLength) && (chars.charAt(lineStart) == LSystem.SPACE)) {
			lineStart++;
			lineEnd++;
		}

		int i = lineEnd;
		while (i < textLength) {
			lineStart = lineEnd;

			boolean charsAvailable = true;
			while (i < textLength) {

				int j = lineEnd;
				while (j < textLength) {
					if (chars.charAt(j) == LSystem.SPACE) {
						j++;
					} else {
						break;
					}
				}
				if (j == textLength) {
					if (lineStart == lineEnd) {
						charsAvailable = false;
					}
					i = textLength;
					break;
				}

				lineEnd++;

				final float lineWidth = FontUtils.measureText(font, chars, lineStart, lineEnd);

				if (lineWidth > autoWrapWidth) {
					if (lineStart < lineEnd - 1) {
						lineEnd--;
					}

					result.add(chars.subSequence(lineStart, lineEnd));
					charsAvailable = false;
					i = lineEnd;
					break;
				}
				i = lineEnd;
			}

			if (charsAvailable) {
				result.add(chars.subSequence(lineStart, lineEnd));
			}
		}

		return result;
	}

	private static float getAdvance(final IFont font, final CharSequence chars, final int idx) {
		return -font.charWidth(chars.charAt(idx));
	}

}


text:
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
VERSION=$(awk '/Version/ { gsub("\"", ""); print $NF }' ${ROOT_DIR}/application/constants.go)

BIN_DIR = $(ROOT_DIR)/bin
SHARE_DIR = $(ROOT_DIR)/share
APP_DIR = /go/src/github.com/ulule/geoipfix

branch = $(shell git rev-parse --abbrev-ref HEAD)
commit = $(shell git log --pretty=format:'%h' -n 1)
now = $(shell date "+%Y-%m-%d %T UTC%z")
compiler = $(shell go version)

test: unit

generate:
	protoc --gofast_out=plugins=grpc:. proto/geoipfix.proto

dependencies:
	dep ensure -v

run:
	GEOIPFIX_CONF=`pwd`/config.json ./bin/geoipfix

live:
	@modd

unit:
	@(go list ./... | xargs -n1 go test -v -cover)

all: geoipfix
	@(mkdir -p $(BIN_DIR))

build:
	@(echo "-> Compiling geoipfix binary")
	@(mkdir -p $(BIN_DIR))
	@(go build -ldflags "\
		-X 'github.com/ulule/geoipfix.Branch=$(branch)' \
		-X 'github.com/ulule/geoipfix.Revision=$(commit)' \
		-X 'github.com/ulule/geoipfix.BuildTime=$(now)' \
		-X 'github.com/ulule/geoipfix.Compiler=$(compiler)'" -a -installsuffix cgo -o $(BIN_DIR)/geoipfix ./cmd/main.go)
	@(echo "-> geoipfix binary created")

build-static:
	@(echo "-> Creating statically linked binary...")
	@(mkdir -p $(BIN_DIR))
	@(CGO_ENABLED=0 go build -ldflags "\
		-X 'github.com/ulule/geoipfix.Branch=$(branch)' \
		-X 'github.com/ulule/geoipfix.Revision=$(commit)' \
		-X 'github.com/ulule/geoipfix.BuildTime=$(now)' \
		-X 'github.com/ulule/geoipfix.Compiler=$(compiler)'" -a -installsuffix cgo -o $(BIN_DIR)/geoipfix ./cmd/main.go)

docker-build:
	@(echo "-> Preparing builder...")
	@(docker build -t geoipfix-builder -f Dockerfile.build .)
	@(mkdir -p $(BIN_DIR))
	@(echo "-> Running geoipfix builder...")
	@(docker run --rm -v $(BIN_DIR):$(APP_DIR)/bin geoipfix-builder)

format:
	@(go fmt ./...)
	@(go vet ./...)

.PNONY: all test format


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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using Monitor.Tests.Helpers;
using Microsoft.Azure.Management.Monitor;
using Microsoft.Azure.Management.Monitor.Models;
using Xunit;

namespace Monitor.Tests.BasicTests
{
    public class MetricAlertsTests : TestBase
    {
        [Fact]
        [Trait("Category", "Mock")]
        public void CreateUpdateMetricAlertRuleTest()
        {
            MetricAlertResource expectedParams = GetSampleMetricRuleResourceParams();
            var handler = new RecordedDelegatingHandler();
            var insightClient = GetMonitorManagementClient(handler);
            var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedParams, insightClient.SerializationSettings);

            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(serializedObject)
            };

            handler = new RecordedDelegatingHandler(expectedResponse);
            insightClient = GetMonitorManagementClient(handler);

            var result = insightClient.MetricAlerts.CreateOrUpdate(resourceGroupName: "rg1", ruleName: "Rule1", parameters: expectedParams);
            Utilities.AreEqual(expectedParams, result);
        }

        [Fact]
        [Trait("Category", "Mock")]
        public void ListMetricAlertRuleByResourceGroupTest()
        {
            var expectedResponseValue = GetSampleMetricAlertCollection();
            var handler = new RecordedDelegatingHandler();
            var insightClient = GetMonitorManagementClient(handler);
            var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedResponseValue, insightClient.SerializationSettings);

            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(string.Concat("{ \"value\":", serializedObject, "}"))
            };

            handler = new RecordedDelegatingHandler(expectedResponse);
            insightClient = GetMonitorManagementClient(handler);

            var actualResponse = insightClient.MetricAlerts.ListByResourceGroup(resourceGroupName: "rg1");
            Utilities.AreEqual(expectedResponseValue, actualResponse.ToList<MetricAlertResource>());
        }

        [Fact]
        [Trait("Category", "Mock")]
        public void ListMetricAlertsBySubscriptionTest()
        {
            var expectedResponseValue = GetSampleMetricAlertCollection();
            var handler = new RecordedDelegatingHandler();
            var insightClient = GetMonitorManagementClient(handler);
            var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedResponseValue, insightClient.SerializationSettings);

            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(string.Concat("{ \"value\":", serializedObject, "}"))
            };

            handler = new RecordedDelegatingHandler(expectedResponse);
            insightClient = GetMonitorManagementClient(handler);

            var actualResponse = insightClient.MetricAlerts.ListBySubscription();
            Utilities.AreEqual(expectedResponseValue, actualResponse.ToList<MetricAlertResource>());
        }

        [Fact]
        [Trait("Category", "Mock")]
        public void GetMetricAlertStatusTest()
        {
            var expectedResponseValue = GetMetricAlertStatus();
            var handler = new RecordedDelegatingHandler();
            var insightClient = GetMonitorManagementClient(handler);
            var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedResponseValue, insightClient.SerializationSettings);

            var expcetedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(serializedObject)
            };

            handler = new RecordedDelegatingHandler(expcetedResponse);
            insightClient = GetMonitorManagementClient(handler);

            var actualResponse = insightClient.MetricAlertsStatus.List(resourceGroupName: "rg1", ruleName: "Rule1");
            Utilities.AreEqual(expectedResponseValue, actualResponse);
        }

        [Fact]
        [Trait("Category", "Mock")]
        public void GetMetricAlertTest()
        {
            MetricAlertResource expectedParams = GetSampleMetricRuleResourceParams();
            var handler = new RecordedDelegatingHandler();
            var insightClient = GetMonitorManagementClient(handler);
            var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedParams, insightClient.SerializationSettings);

            var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(serializedObject)
            };

            handler = new RecordedDelegatingHandler(expectedResponse);
            insightClient = GetMonitorManagementClient(handler);

            var result = insightClient.MetricAlerts.Get(resourceGroupName: "rg1", ruleName: "Rule1");
            Utilities.AreEqual(expectedParams, result);
        }

        private MetricAlertStatusCollection GetMetricAlertStatus()
        {
            MetricAlertStatusProperties statusProps = new MetricAlertStatusProperties()
            {
                Dimensions = new Dictionary<string, string>(),
                Status = "Healthy",
                Timestamp = new System.DateTime()
            };

            return new MetricAlertStatusCollection()
            {
                Value = new List<MetricAlertStatus>()
                {
                    new MetricAlertStatus(properties: statusProps)
                }
            };
        }

        private List<MetricAlertResource> GetSampleMetricAlertCollection()
        {
            return new List<MetricAlertResource>()
            {
                 new MetricAlertResource(
                    description: "alert description",
                    severity: 3,
                    location: "Location",
                    enabled: true,
                    scopes: new List<string>()
                    {
                        "/subscriptions/80430018-24ee-4b28-a7bd-fb23b5a221d6/resourceGroups/SanjaychResourceGroup/providers/Microsoft.Compute/virtualMachines/SCCMDemo2"
                    },
                    evaluationFrequency: new TimeSpan(hours: 0, minutes: 5, seconds: 0),
                    windowSize: new TimeSpan(hours: 0, minutes: 5, seconds: 0),
                    criteria: GetSampleMetricCriteria(),
                    actions: new List<MetricAlertAction>()
                    {
                        new MetricAlertAction()
                        {
                            ActionGroupId = "/subscriptions/80430018-24ee-4b28-a7bd-fb23b5a221d6/resourcegroups/custommetricdemo/providers/microsoft.insights/actiongroups/scactiongroup"
                        }
                    }
                )
            };
        }

        private MetricAlertResource GetSampleMetricRuleResourceParams()
        {
            MetricAlertSingleResourceMultipleMetricCriteria metricCriteria = GetSampleMetricCriteria();

            return new MetricAlertResource(
                    description: "alert description",
                    severity: 3,
                    location: "Location",
                    enabled: true,
                    scopes: new List<string>()
                    {
                        "/subscriptions/80430018-24ee-4b28-a7bd-fb23b5a221d6/resourceGroups/SanjaychResourceGroup/providers/Microsoft.Compute/virtualMachines/SCCMDemo2"
                    },
                    evaluationFrequency: new TimeSpan(hours: 0, minutes: 5, seconds: 0),
                    windowSize: new TimeSpan(hours: 0, minutes: 5, seconds: 0),
                    criteria: metricCriteria,
                    actions: new List<MetricAlertAction>()
                    {
                        new MetricAlertAction()
                        {
                            ActionGroupId = "/subscriptions/80430018-24ee-4b28-a7bd-fb23b5a221d6/resourcegroups/custommetricdemo/providers/microsoft.insights/actiongroups/scactiongroup"
                        }
                    }
                );
        }

        private static MetricAlertSingleResourceMultipleMetricCriteria GetSampleMetricCriteria()
        {
            MetricDimension metricDimension = new MetricDimension()
            {
                Name = "name1",
                OperatorProperty = "Include",
                Values = new List<string>()
                {
                    "Primary"
                }
            };

            MetricDimension[] metricDimensions = new MetricDimension[1] { metricDimension };

            return new MetricAlertSingleResourceMultipleMetricCriteria(
                allOf: new List<MetricCriteria>()
                {
                    new MetricCriteria()
                    {
                        MetricName = "Metric Name",
                        Name = "metric1",
                        Dimensions = metricDimensions,
                        Threshold = 100,
                        OperatorProperty = "GreaterThan",
                        TimeAggregation = "Avergage"
                    }
                }
            );
        }
    }
}


text:
Copyright 2016 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Summary
=====================================

Circuit diagram and firmware of Google Japanese Input physical flick version.

Files
=====================================

* README.md  -- this file
* arduino/flick/*  -- firmware source code (Arduino sketch)
* circuit.png  -- circuit diagram
* photo/*  -- for reference

Building your device
=====================================

## Electronic parts

* Arduino Nano * 1
* RN-42-I/RM * 1
* SJoys 2-axes joystick module (Sainsmart) * 12
* MCP3208 * 3
* 0.1uF ceramic capacitor * 4
* 470 ohm resistor * 1
* 1k ohm resistor * 1
* Connectors

## RN42 configuration

This step is required for the first time, or when changing the device's name.
See Microchip's documents for detail.

1. Run a terminal emulator and open the serial port for Arduino.
2. Type '!' to enter pass-through mode.
3. Type '$$$'.
4. Configure the module by these commands:

* * * * * *
    SU,115k
    SM,6
    SA,2
    S~,6
    SH,0000
    SN,MY_PHYSICAL_FLICK_KEYBOARD
    R,1
* * * * * *
MY\_PHYSICAL\_FLICK\_KEYBOARD is a device name that will appear when you scan
Bluetooth devices, and can be replaced by your preferred name.

The commands will configure the module as follows:

* 115200bps
* Pairing mode
* SSP "just works" mode
* SPP profile
* HID flag register = 0 (keyboard)

Using flick input
=====================================

## Power supply

When operating the device, supply power by USB cables to Arduino Nano.

## Bluetooth pairing

Using your device (e.g. Android phone), scan Bluetooth devices and you will
find MY\_PHYSICAL\_FLICK\_KEYBOARD (or the name you set up) in the available
device list.

After pairing, find the device in the "physical keyboard" section and choose
"English - U.S." keyboard layout for it.

## How to input

Switch the Japanese IME on the paired device to romaji input mode.
Characters will be input as flick or press a key.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>../src/header.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for:

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

BBox

Buffer

geo

gl

GL

Indexer

LEvent

Mesh

Octree

Shader

Texture

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

File: ../src/header.js

//litegl.js by Javi Agenjo 2014 @tamat (tamats.com)
//forked from lightgl.js by Evan Wallace (madebyevan.com)
"use strict";

(function(global){

/**
* The static module that contains all the features
* @class GL
*/
var GL = global.GL = {};

//polyfill
global.requestAnimationFrame = global.requestAnimationFrame || global.mozRequestAnimationFrame || global.webkitRequestAnimationFrame || function(callback) { setTimeout(callback, 1000 / 60); };

GL.blockable_keys = {"Up":true,"Down":true,"Left":true,"Right":true};

//some consts
GL.LEFT_MOUSE_BUTTON = 1;
GL.RIGHT_MOUSE_BUTTON = 3;
GL.MIDDLE_MOUSE_BUTTON = 2;
GL.last_context_id = 0;

//Define WEBGL ENUMS as statics
//sometimes I need some gl enums before having the gl context, solution: define them globally because the specs says they are constant:

GL.BYTE = 5120;
GL.UNSIGNED_BYTE = 5121;
GL.SHORT = 5122;
GL.UNSIGNED_SHORT = 5123;
GL.INT = 5124;
GL.UNSIGNED_INT = 5125;
GL.FLOAT = 5126;

GL.ZERO = 0;
GL.ONE = 1;
GL.SRC_COLOR = 768;
GL.ONE_MINUS_SRC_COLOR = 769;
GL.SRC_ALPHA = 770;
GL.ONE_MINUS_SRC_ALPHA = 771;
GL.DST_ALPHA = 772;
GL.ONE_MINUS_DST_ALPHA = 773;
GL.DST_COLOR = 774;
GL.ONE_MINUS_DST_COLOR = 775;
GL.SRC_ALPHA_SATURATE = 776;
GL.CONSTANT_COLOR = 32769;
GL.ONE_MINUS_CONSTANT_COLOR = 32770;
GL.CONSTANT_ALPHA = 32771;
GL.ONE_MINUS_CONSTANT_ALPHA = 32772;


text:
from __future__ import unicode_literals
"""This file is part of the django ERP project.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""

__author__ = 'Emanuele Bertoldi <emanuele.bertoldi@gmail.com>'
__copyright__ = 'Copyright (c) 2013-2015, django ERP Team'
__version__ = '0.0.1'

MENU_DEFAULT_TEMPLATE = "menus/partials/menu.html"
BOOKMARKS_DEFAULT_TEMPLATE = "menus/partials/menu_bookmarks.html"


text:
CREATE TABLE `gallery_pictures` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `path` varchar(255) NOT NULL,
  `size` bigint(20) NOT NULL,
  `album_id` int(11) NOT NULL,
  `main_id` int(11) DEFAULT NULL,
  `caption` varchar(255) DEFAULT NULL,
  `style` varchar(255) NOT NULL DEFAULT 'full',
  `order` int(11) NOT NULL DEFAULT 9999999,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `folder_id` (`album_id`),
  KEY `main_id` (`main_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE `gallery_albums` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `default_name` varchar(255) NOT NULL,
  `path` varchar(255) NOT NULL,
  `model` varchar(255) DEFAULT NULL,
  `model_id` int(11) DEFAULT NULL,
  `tags` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


text:
package equipo.once.elizabeth.richard.wilson.usecases.interfaces;

public interface InquilinoUseCase extends UseCase {
}


text:
/* Includes ------------------------------------------------------------------*/
#include "usb_core.h"

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief Set the CNTR register value
  * @param   wRegValue: new register value
  * @retval None
  */
void SetCNTR(uint16_t wRegValue)
{
  _SetCNTR(wRegValue);
}

/**
  * @brief returns the CNTR register value
  * @param   None
  * @retval CNTR register Value
  */
uint16_t GetCNTR(void)
{
  return(_GetCNTR());
}

/**
  * @brief Set the ISTR register value
  * @param   wRegValue: new register value
  * @retval None
  */
void SetISTR(uint16_t wRegValue)
{
  _SetISTR(wRegValue);
}

/**
  * @brief Returns the ISTR register value
  * @param   None
  * @retval ISTR register Value
  */
uint16_t GetISTR(void)
{
  return(_GetISTR());
}

/**
  * @brief Returns the FNR register value
  * @param   None
  * @retval FNR register Value
  */
uint16_t GetFNR(void)
{
  return(_GetFNR());
}

/**
  * @brief Set the DADDR register value
  * @param   wRegValue: new register value
  * @retval None
  */
void SetDADDR(uint16_t wRegValue)
{
  _SetDADDR(wRegValue);
}

/**
  * @brief Set the LPMCSR register value
  * @param   wRegValue: new register value
  * @retval None
  */
void SetLPMCSR(uint16_t wRegValue)
{
  _SetLPMCSR(wRegValue);
}

/**
  * @brief Returns the LPMCSR register value
  * @param   None
  * @retval LPMCSR register Value
  */
uint16_t GetLPMCSR(void)
{
  return(_GetLPMCSR());
}

/**
  * @brief Returns the DADDR register value
  * @param   None
  * @retval DADDR register Value
  */
uint16_t GetDADDR(void)
{
  return(_GetDADDR());
}

/**
  * @brief Set the BTABLE.
  * @param   wRegValue: New register value
  * @retval None
  */
void SetBTABLE(uint16_t wRegValue)
{
  _SetBTABLE(wRegValue);
}

/**
  * @brief Returns the BTABLE register value.
  * @param   None
  * @retval BTABLE address
  */
uint16_t GetBTABLE(void)
{
  return(_GetBTABLE());
}

/**
  * @brief Set the Endpoint register value.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void SetENDPOINT(uint8_t bEpNum, uint16_t wRegValue)
{
  _SetENDPOINT(bEpNum, wRegValue);
}

/**
  * @brief Return the Endpoint register value.
  * @param   bEpNum: Endpoint Number
  * @retval Endpoint register value.
  */
uint16_t GetENDPOINT(uint8_t bEpNum)
{
  return(_GetENDPOINT(bEpNum));
}

/**
  * @brief sets the type in the endpoint register.
  * @param   bEpNum: Endpoint Number
  * @param   wType: type definition
  * @retval None.
  */
void SetEPType(uint8_t bEpNum, uint16_t wType)
{
  _SetEPType(bEpNum, wType);
}

/**
  * @brief Returns the endpoint type.
  * @param   bEpNum: Endpoint Number
  * @retval Endpoint Type.
  */
uint16_t GetEPType(uint8_t bEpNum)
{
  return(_GetEPType(bEpNum));
}

/**
  * @brief Set the status of Tx endpoint.
  * @param   bEpNum: Endpoint Number
  * @param   wState: new state.
  * @retval None
  */
void SetEPTxStatus(uint8_t bEpNum, uint16_t wState)
{
  _SetEPTxStatus(bEpNum, wState);
}

/**
  * @brief Set the status of Rx endpoint.
  * @param   bEpNum: Endpoint Number
  * @param   wState: new state.
  * @retval None
  */
void SetEPRxStatus(uint8_t bEpNum, uint16_t wState)
{
  _SetEPRxStatus(bEpNum, wState);
}

/**
  * @brief sets the status for Double Buffer Endpoint to STALL
  * @param   bEpNum: Endpoint Number
  * @param   bDir: Endpoint direction
  * @retval None
  */
void SetDouBleBuffEPStall(uint8_t bEpNum, uint8_t bDir)
{
  uint16_t Endpoint_DTOG_Status;
  Endpoint_DTOG_Status = GetENDPOINT(bEpNum);
  if (bDir == EP_DBUF_OUT)
  { /* OUT double buffered endpoint */
    _SetENDPOINT(bEpNum, Endpoint_DTOG_Status & ~EPRX_DTOG1);
  }
  else if (bDir == EP_DBUF_IN)
  { /* IN double buffered endpoint */
    _SetENDPOINT(bEpNum, Endpoint_DTOG_Status & ~EPTX_DTOG1);
  }
}

/**
  * @brief Returns the endpoint Tx status
  * @param   bEpNum: Endpoint Number
  * @retval Endpoint TX Status
  */
uint16_t GetEPTxStatus(uint8_t bEpNum)
{
  return(_GetEPTxStatus(bEpNum));
}

/**
  * @brief Returns the endpoint Rx status
  * @param   bEpNum: Endpoint Number
  * @retval Endpoint Endpoint RX Status
  */
uint16_t GetEPRxStatus(uint8_t bEpNum)
{
  return(_GetEPRxStatus(bEpNum));
}

/**
  * @brief Valid the endpoint Tx Status.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void SetEPTxValid(uint8_t bEpNum)
{
  _SetEPTxStatus(bEpNum, EP_TX_VALID);
}

/**
  * @brief Valid the endpoint Rx Status.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void SetEPRxValid(uint8_t bEpNum)
{
  _SetEPRxStatus(bEpNum, EP_RX_VALID);
}

/**
  * @brief set the  EP_KIND bit.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void SetEP_KIND(uint8_t bEpNum)
{
  _SetEP_KIND(bEpNum);
}

/**
  * @brief ClearEP_KIND
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearEP_KIND(uint8_t bEpNum)
{
  _ClearEP_KIND(bEpNum);
}

/**
  * @brief Clear the Status Out of the related Endpoint
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void Clear_Status_Out(uint8_t bEpNum)
{
  _ClearEP_KIND(bEpNum);
}

/**
  * @brief Set the Status Out of the related Endpoint
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void Set_Status_Out(uint8_t bEpNum)
{
  _SetEP_KIND(bEpNum);
}

/**
  * @brief Enable the double buffer feature for the endpoint.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void SetEPDoubleBuff(uint8_t bEpNum)
{
  _SetEP_KIND(bEpNum);
}

/**
  * @brief Disable the double buffer feature for the endpoint
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearEPDoubleBuff(uint8_t bEpNum)
{
  _ClearEP_KIND(bEpNum);
}

/**
  * @brief Returns the Stall status of the Tx endpoint
  * @param   bEpNum: Endpoint Number
  * @retval Tx Stall status
  */
uint16_t GetTxStallStatus(uint8_t bEpNum)
{
  return(_GetTxStallStatus(bEpNum));
}

/**
  * @brief Returns the Stall status of the Rx endpoint
  * @param   bEpNum: Endpoint Number
  * @retval Rx Stall status.
  */
uint16_t GetRxStallStatus(uint8_t bEpNum)
{
  return(_GetRxStallStatus(bEpNum));
}

/**
  * @brief Returns the Stall status of the Rx endpoint
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearEP_CTR_RX(uint8_t bEpNum)
{
  _ClearEP_CTR_RX(bEpNum);
}

/**
  * @brief Clear the CTR_TX bit
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearEP_CTR_TX(uint8_t bEpNum)
{
  _ClearEP_CTR_TX(bEpNum);
}

/**
  * @brief Toggle the DTOG_RX bit.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ToggleDTOG_RX(uint8_t bEpNum)
{
  _ToggleDTOG_RX(bEpNum);
}

/**
  * @brief Toggle the DTOG_TX bit.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ToggleDTOG_TX(uint8_t bEpNum)
{
  _ToggleDTOG_TX(bEpNum);
}

/**
  * @brief Clear the DTOG_RX bit.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearDTOG_RX(uint8_t bEpNum)
{
  _ClearDTOG_RX(bEpNum);
}

/**
  * @brief Clear the DTOG_TX bit.
  * @param   bEpNum: Endpoint Number
  * @retval None
  */
void ClearDTOG_TX(uint8_t bEpNum)
{
  _ClearDTOG_TX(bEpNum);
}

/**
  * @brief Set the endpoint address.
  * @param   bEpNum: Endpoint Number
  * @param   bAddr: New endpoint address.
  * @retval None
  */
void SetEPAddress(uint8_t bEpNum, uint8_t bAddr)
{
  _SetEPAddress(bEpNum, bAddr);
}

/**
  * @brief Get the endpoint address.
  * @param   bEpNum: Endpoint Number
  * @retval Endpoint address.
  */
uint8_t GetEPAddress(uint8_t bEpNum)
{
  return(_GetEPAddress(bEpNum));
}

/**
  * @brief Set the endpoint Tx buffer address.
  * @param   bEpNum: Endpoint Number
  * @param   wAddr: new address.
  * @retval Endpoint address.
  */
void SetEPTxAddr(uint8_t bEpNum, uint16_t wAddr)
{
  _SetEPTxAddr(bEpNum, wAddr);
}

/**
  * @brief Set the endpoint Rx buffer address.
  * @param   bEpNum: Endpoint Number
  * @param   wAddr: new address.
  * @retval Endpoint address.
  */
void SetEPRxAddr(uint8_t bEpNum, uint16_t wAddr)
{
  _SetEPRxAddr(bEpNum, wAddr);
}

/**
  * @brief Returns the endpoint Tx buffer address.
  * @param   bEpNum: Endpoint Number
  * @retval Tx buffer address.
  */
uint16_t GetEPTxAddr(uint8_t bEpNum)
{
  return(_GetEPTxAddr(bEpNum));
}

/**
  * @brief Returns the endpoint Rx buffer address.
  * @param   bEpNum: Endpoint Number
  * @retval Rx buffer address.
  */
uint16_t GetEPRxAddr(uint8_t bEpNum)
{
  return(_GetEPRxAddr(bEpNum));
}

/**
  * @brief Set the Tx count.
  * @param   bEpNum: Endpoint Number
  * @param   wCount: new count value.
  * @retval Rx buffer address.
  */
void SetEPTxCount(uint8_t bEpNum, uint16_t wCount)
{
  _SetEPTxCount(bEpNum, wCount);
}

/**
  * @brief Set the Count Rx Register value.
  * @param   *pdwReg: point to the register.
  * @param   wCount: the new register value.
  * @retval None
  */
void SetEPCountRxReg(uint16_t *pdwReg, uint16_t wCount)
{
  _SetEPCountRxReg(pdwReg, wCount);
}

/**
  * @brief Set the Rx count.
  * @param   bEpNum: Endpoint Number.
  * @param   wCount: the new register value.
  * @retval None
  */
void SetEPRxCount(uint8_t bEpNum, uint16_t wCount)
{
  _SetEPRxCount(bEpNum, wCount);
}

/**
  * @brief Get the Tx count.
  * @param   bEpNum: Endpoint Number.
  * @retval Tx count value.
  */
uint16_t GetEPTxCount(uint8_t bEpNum)
{
  return(_GetEPTxCount(bEpNum));
}

/**
  * @brief Get the Rx count.
  * @param   bEpNum: Endpoint Number.
  * @retval Rx count value.
  */
uint16_t GetEPRxCount(uint8_t bEpNum)
{
  return(_GetEPRxCount(bEpNum));
}

/**
  * @brief Set the addresses of the buffer 0 and 1.
  * @param   bEpNum: Endpoint Number.
  * @param   wBuf0Addr: new address of buffer 0.
  * @param   wBuf1Addr: new address of buffer 1.
  * @retval None
  */
void SetEPDblBuffAddr(uint8_t bEpNum, uint16_t wBuf0Addr, uint16_t wBuf1Addr)
{
  _SetEPDblBuffAddr(bEpNum, wBuf0Addr, wBuf1Addr);
}

/**
  * @brief Set the Buffer 1 address.
  * @param   bEpNum: Endpoint Number.
  * @param   wBuf0Addr: new address.
  * @retval None
  */
void SetEPDblBuf0Addr(uint8_t bEpNum, uint16_t wBuf0Addr)
{
  _SetEPDblBuf0Addr(bEpNum, wBuf0Addr);
}

/**
  * @brief Set the Buffer 1 address.
  * @param   bEpNum: Endpoint Number.
  * @param   wBuf1Addr: new address.
  * @retval None
  */
void SetEPDblBuf1Addr(uint8_t bEpNum, uint16_t wBuf1Addr)
{
  _SetEPDblBuf1Addr(bEpNum, wBuf1Addr);
}

/**
  * @brief Returns the address of the Buffer 0.
  * @param   bEpNum: Endpoint Number.
  * @retval None
  */
uint16_t GetEPDblBuf0Addr(uint8_t bEpNum)
{
  return(_GetEPDblBuf0Addr(bEpNum));
}

/**
  * @brief Returns the address of the Buffer 1.
  * @param   bEpNum: Endpoint Number.
  * @retval Address of the Buffer 1.
  */
uint16_t GetEPDblBuf1Addr(uint8_t bEpNum)
{
  return(_GetEPDblBuf1Addr(bEpNum));
}

/**
  * @brief Set the number of bytes for a double Buffer
  * @param   bEpNum,bDir, wCount
  * @retval Address of the Buffer 1.
  */
void SetEPDblBuffCount(uint8_t bEpNum, uint8_t bDir, uint16_t wCount)
{
  _SetEPDblBuffCount(bEpNum, bDir, wCount);
}

/**
  * @brief Set the number of bytes in the buffer 0 of a double Buffer endpoint.
  * @param   bEpNum,bDir, wCount
  * @retval None
  */
void SetEPDblBuf0Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount)
{
  _SetEPDblBuf0Count(bEpNum, bDir, wCount);
}

/**
  * @brief Set the number of bytes in the buffer 0 of a double Buffer
  * @param   bEpNum,bDir, wCount
  * @retval None
  */
void SetEPDblBuf1Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount)
{
  _SetEPDblBuf1Count(bEpNum, bDir, wCount);
}

/**
  * @brief Returns the number of byte received in the buffer 0 of a double
  *         Buffer endpoint.
  * @param   bEpNum: Endpoint Number.
  * @retval Endpoint Buffer 0 count
  */
uint16_t GetEPDblBuf0Count(uint8_t bEpNum)
{
  return(_GetEPDblBuf0Count(bEpNum));
}

/**
  * @brief Returns the number of data received in the buffer 1 of a double
  * @param   bEpNum: Endpoint Number.
  * @retval Endpoint Buffer 1 count
  */
uint16_t GetEPDblBuf1Count(uint8_t bEpNum)
{
  return(_GetEPDblBuf1Count(bEpNum));
}

/**
  * @brief gets direction of the double buffered endpoint
  * @param   bEpNum: Endpoint Number.
  * @retval EP_DBUF_OUT, EP_DBUF_IN,
  *         EP_DBUF_ERR if the endpoint counter not yet programmed.
  */
EP_DBUF_DIR GetEPDblBufDir(uint8_t bEpNum)
{
  if ((uint16_t)(*_pEPRxCount(bEpNum) & 0xFC00) != 0)
    return(EP_DBUF_OUT);
  else if (((uint16_t)(*_pEPTxCount(bEpNum)) & 0x03FF) != 0)
    return(EP_DBUF_IN);
  else
    return(EP_DBUF_ERR);
}

/**
  * @brief free buffer used from the application realizing it to the line
          toggles bit SW_BUF in the double buffered endpoint register
  * @param   bEpNum, bDir
  * @retval None
  */
void FreeUserBuffer(uint8_t bEpNum, uint8_t bDir)
{
  if (bDir == EP_DBUF_OUT)
  { /* OUT double buffered endpoint */
    _ToggleDTOG_TX(bEpNum);
  }
  else if (bDir == EP_DBUF_IN)
  { /* IN double buffered endpoint */
    _ToggleDTOG_RX(bEpNum);
  }
}

/**
  * @brief Copy a buffer from user memory area to packet memory area (PMA)
  * @param   pbUsrBuf: pointer to user memory area.
  * @param   wPMABufAddr: address into PMA.
  * @param   wNBytes: no. of bytes to be copied.
  * @retval None
  */
void UserToPMABufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
{
  uint32_t n = (wNBytes + 1) >> 1;
  uint32_t i;
  uint16_t temp1, temp2;
  uint16_t *pdwVal;
  pdwVal = (uint16_t *)(wPMABufAddr + PMAAddr);

  for (i = n; i != 0; i--)
  {
    temp1 = (uint16_t) * pbUsrBuf;
    pbUsrBuf++;
    temp2 = temp1 | (uint16_t) * pbUsrBuf << 8;
    *pdwVal++ = temp2;
    pbUsrBuf++;
  }
}

/**
  * @brief Copy a buffer from user memory area to packet memory area (PMA)
  * @param   pbUsrBuf    = pointer to user memory area.
  * @param   wPMABufAddr: address into PMA.
  * @param   wNBytes: no. of bytes to be copied.
  * @retval None
  */
void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
{
  uint32_t n = (wNBytes + 1) >> 1;
  uint32_t i;
  uint16_t *pdwVal;
  pdwVal = (uint16_t *)(wPMABufAddr + PMAAddr);
  for (i = n; i != 0; i--)
  {
    *(uint16_t*)pbUsrBuf++ = *pdwVal++;
    pbUsrBuf++;
  }
}

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
title: Overview of USDOS outputs
keywords:
last_updated: March 8, 2018
tags:
summary:
sidebar: usdos_sidebar
permalink: outputs.html
folder: usdos
---


text:
package reflectwalk

import (
	"fmt"
	"reflect"
	"testing"
)

type TestEnterExitWalker struct {
	Locs []Location
}

func (t *TestEnterExitWalker) Enter(l Location) error {
	if t.Locs == nil {
		t.Locs = make([]Location, 0, 5)
	}

	t.Locs = append(t.Locs, l)
	return nil
}

func (t *TestEnterExitWalker) Exit(l Location) error {
	t.Locs = append(t.Locs, l)
	return nil
}

type TestPointerWalker struct {
	pointers []bool
	count    int
	enters   int
	exits    int
}

func (t *TestPointerWalker) PointerEnter(v bool) error {
	t.pointers = append(t.pointers, v)
	t.enters++
	if v {
		t.count++
	}
	return nil
}

func (t *TestPointerWalker) PointerExit(v bool) error {
	t.exits++
	if t.pointers[len(t.pointers)-1] != v {
		return fmt.Errorf("bad pointer exit '%t' at exit %d", v, t.exits)
	}
	t.pointers = t.pointers[:len(t.pointers)-1]
	return nil
}

type TestPrimitiveWalker struct {
	Value reflect.Value
}

func (t *TestPrimitiveWalker) Primitive(v reflect.Value) error {
	t.Value = v
	return nil
}

type TestPrimitiveCountWalker struct {
	Count int
}

func (t *TestPrimitiveCountWalker) Primitive(v reflect.Value) error {
	t.Count += 1
	return nil
}

type TestPrimitiveReplaceWalker struct {
	Value reflect.Value
}

func (t *TestPrimitiveReplaceWalker) Primitive(v reflect.Value) error {
	v.Set(reflect.ValueOf("bar"))
	return nil
}

type TestMapWalker struct {
	MapVal reflect.Value
	Keys   map[string]bool
	Values map[string]bool
}

func (t *TestMapWalker) Map(m reflect.Value) error {
	t.MapVal = m
	return nil
}

func (t *TestMapWalker) MapElem(m, k, v reflect.Value) error {
	if t.Keys == nil {
		t.Keys = make(map[string]bool)
		t.Values = make(map[string]bool)
	}

	t.Keys[k.Interface().(string)] = true
	t.Values[v.Interface().(string)] = true
	return nil
}

type TestSliceWalker struct {
	Count    int
	SliceVal reflect.Value
}

func (t *TestSliceWalker) Slice(v reflect.Value) error {
	t.SliceVal = v
	return nil
}

func (t *TestSliceWalker) SliceElem(int, reflect.Value) error {
	t.Count++
	return nil
}

type TestStructWalker struct {
	Fields []string
}

func (t *TestStructWalker) Struct(v reflect.Value) error {
	return nil
}

func (t *TestStructWalker) StructField(sf reflect.StructField, v reflect.Value) error {
	if t.Fields == nil {
		t.Fields = make([]string, 0, 1)
	}

	t.Fields = append(t.Fields, sf.Name)
	return nil
}

func TestTestStructs(t *testing.T) {
	var raw interface{}
	raw = new(TestEnterExitWalker)
	if _, ok := raw.(EnterExitWalker); !ok {
		t.Fatal("EnterExitWalker is bad")
	}

	raw = new(TestPrimitiveWalker)
	if _, ok := raw.(PrimitiveWalker); !ok {
		t.Fatal("PrimitiveWalker is bad")
	}

	raw = new(TestMapWalker)
	if _, ok := raw.(MapWalker); !ok {
		t.Fatal("MapWalker is bad")
	}

	raw = new(TestSliceWalker)
	if _, ok := raw.(SliceWalker); !ok {
		t.Fatal("SliceWalker is bad")
	}

	raw = new(TestStructWalker)
	if _, ok := raw.(StructWalker); !ok {
		t.Fatal("StructWalker is bad")
	}
}

func TestWalk_Basic(t *testing.T) {
	w := new(TestPrimitiveWalker)

	type S struct {
		Foo string
	}

	data := &S{
		Foo: "foo",
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if w.Value.Kind() != reflect.String {
		t.Fatalf("bad: %#v", w.Value)
	}
}

func TestWalk_Basic_Replace(t *testing.T) {
	w := new(TestPrimitiveReplaceWalker)

	type S struct {
		Foo string
		Bar []interface{}
	}

	data := &S{
		Foo: "foo",
		Bar: []interface{}{[]string{"what"}},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if data.Foo != "bar" {
		t.Fatalf("bad: %#v", data.Foo)
	}
	if data.Bar[0].([]string)[0] != "bar" {
		t.Fatalf("bad: %#v", data.Bar)
	}
}

func TestWalk_Basic_ReplaceInterface(t *testing.T) {
	w := new(TestPrimitiveReplaceWalker)

	type S struct {
		Foo []interface{}
	}

	data := &S{
		Foo: []interface{}{"foo"},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}
}

func TestWalk_EnterExit(t *testing.T) {
	w := new(TestEnterExitWalker)

	type S struct {
		A string
		M map[string]string
	}

	data := &S{
		A: "foo",
		M: map[string]string{
			"a": "b",
		},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	expected := []Location{
		WalkLoc,
		Struct,
		StructField,
		StructField,
		StructField,
		Map,
		MapKey,
		MapKey,
		MapValue,
		MapValue,
		Map,
		StructField,
		Struct,
		WalkLoc,
	}
	if !reflect.DeepEqual(w.Locs, expected) {
		t.Fatalf("Bad: %#v", w.Locs)
	}
}

func TestWalk_Interface(t *testing.T) {
	w := new(TestPrimitiveCountWalker)

	type S struct {
		Foo string
		Bar []interface{}
	}

	var data interface{} = &S{
		Foo: "foo",
		Bar: []interface{}{[]string{"bar", "what"}, "baz"},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if w.Count != 4 {
		t.Fatalf("bad: %#v", w.Count)
	}
}

func TestWalk_Interface_nil(t *testing.T) {
	w := new(TestPrimitiveCountWalker)

	type S struct {
		Bar interface{}
	}

	var data interface{} = &S{}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}
}

func TestWalk_Map(t *testing.T) {
	w := new(TestMapWalker)

	type S struct {
		Foo map[string]string
	}

	data := &S{
		Foo: map[string]string{
			"foo": "foov",
			"bar": "barv",
		},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if !reflect.DeepEqual(w.MapVal.Interface(), data.Foo) {
		t.Fatalf("Bad: %#v", w.MapVal.Interface())
	}

	expectedK := map[string]bool{"foo": true, "bar": true}
	if !reflect.DeepEqual(w.Keys, expectedK) {
		t.Fatalf("Bad keys: %#v", w.Keys)
	}

	expectedV := map[string]bool{"foov": true, "barv": true}
	if !reflect.DeepEqual(w.Values, expectedV) {
		t.Fatalf("Bad values: %#v", w.Values)
	}
}

func TestWalk_Pointer(t *testing.T) {
	w := new(TestPointerWalker)

	type S struct {
		Foo string
		Bar *string
		Baz **string
	}

	s := ""
	sp := &s

	data := &S{
		Baz: &sp,
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if w.enters != 5 {
		t.Fatal("expected 4 values, saw", w.enters)
	}

	if w.count != 4 {
		t.Fatal("exptec 3 pointers, saw", w.count)
	}

	if w.exits != w.enters {
		t.Fatalf("number of enters (%d) and exits (%d) don't match", w.enters, w.exits)
	}
}

func TestWalk_PointerPointer(t *testing.T) {
	w := new(TestPointerWalker)

	s := ""
	sp := &s
	pp := &sp

	err := Walk(pp, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if w.enters != 2 {
		t.Fatal("expected 2 values, saw", w.enters)
	}

	if w.count != 2 {
		t.Fatal("expected 2 pointers, saw", w.count)
	}

	if w.exits != w.enters {
		t.Fatalf("number of enters (%d) and exits (%d) don't match", w.enters, w.exits)
	}
}

func TestWalk_Slice(t *testing.T) {
	w := new(TestSliceWalker)

	type S struct {
		Foo []string
	}

	data := &S{
		Foo: []string{"a", "b", "c"},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if !reflect.DeepEqual(w.SliceVal.Interface(), data.Foo) {
		t.Fatalf("bad: %#v", w.SliceVal.Interface())
	}

	if w.Count != 3 {
		t.Fatalf("Bad count: %d", w.Count)
	}
}

func TestWalk_SliceWithPtr(t *testing.T) {
	w := new(TestSliceWalker)

	// This is key, the panic only happened when the slice field was
	// an interface!
	type I interface{}

	type S struct {
		Foo []I
	}

	type Empty struct{}

	data := &S{
		Foo: []I{&Empty{}},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if !reflect.DeepEqual(w.SliceVal.Interface(), data.Foo) {
		t.Fatalf("bad: %#v", w.SliceVal.Interface())
	}

	if w.Count != 1 {
		t.Fatalf("Bad count: %d", w.Count)
	}
}

type testErr struct{}

func (t *testErr) Error() string {
	return "test error"
}

func TestWalk_Struct(t *testing.T) {
	w := new(TestStructWalker)

	// This makes sure we can also walk over pointer-to-pointers, and the ever
	// so rare pointer-to-interface
	type S struct {
		Foo string
		Bar *string
		Baz **string
		Err *error
	}

	bar := "ptr"
	baz := &bar
	e := error(&testErr{})

	data := &S{
		Foo: "foo",
		Bar: &bar,
		Baz: &baz,
		Err: &e,
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	expected := []string{"Foo", "Bar", "Baz", "Err"}
	if !reflect.DeepEqual(w.Fields, expected) {
		t.Fatalf("bad: %#v", w.Fields)
	}
}

// Very similar to above test but used to fail for #2, copied here for
// regression testing
func TestWalk_StructWithPtr(t *testing.T) {
	w := new(TestStructWalker)

	type S struct {
		Foo string
		Bar string
		Baz *int
	}

	data := &S{
		Foo: "foo",
		Bar: "bar",
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	expected := []string{"Foo", "Bar", "Baz"}
	if !reflect.DeepEqual(w.Fields, expected) {
		t.Fatalf("bad: %#v", w.Fields)
	}
}

type TestInterfaceMapWalker struct {
	MapVal reflect.Value
	Keys   map[string]bool
	Values map[interface{}]bool
}

func (t *TestInterfaceMapWalker) Map(m reflect.Value) error {
	t.MapVal = m
	return nil
}

func (t *TestInterfaceMapWalker) MapElem(m, k, v reflect.Value) error {
	if t.Keys == nil {
		t.Keys = make(map[string]bool)
		t.Values = make(map[interface{}]bool)
	}

	t.Keys[k.Interface().(string)] = true
	t.Values[v.Interface()] = true
	return nil
}

func TestWalk_MapWithPointers(t *testing.T) {
	w := new(TestInterfaceMapWalker)

	type S struct {
		Foo map[string]interface{}
	}

	a := "a"
	b := "b"

	data := &S{
		Foo: map[string]interface{}{
			"foo": &a,
			"bar": &b,
			"baz": 11,
			"zab": (*int)(nil),
		},
	}

	err := Walk(data, w)
	if err != nil {
		t.Fatalf("err: %s", err)
	}

	if !reflect.DeepEqual(w.MapVal.Interface(), data.Foo) {
		t.Fatalf("Bad: %#v", w.MapVal.Interface())
	}

	expectedK := map[string]bool{"foo": true, "bar": true, "baz": true, "zab": true}
	if !reflect.DeepEqual(w.Keys, expectedK) {
		t.Fatalf("Bad keys: %#v", w.Keys)
	}

	expectedV := map[interface{}]bool{&a: true, &b: true, 11: true, (*int)(nil): true}
	if !reflect.DeepEqual(w.Values, expectedV) {
		t.Fatalf("Bad values: %#v", w.Values)
	}
}

type TestStructWalker_fieldSkip struct {
	Skip   bool
	Fields int
}

func (t *TestStructWalker_fieldSkip) Enter(l Location) error {
	if l == StructField {
		t.Fields++
	}

	return nil
}

func (t *TestStructWalker_fieldSkip) Exit(Location) error {
	return nil
}

func (t *TestStructWalker_fieldSkip) Struct(v reflect.Value) error {
	return nil
}

func (t *TestStructWalker_fieldSkip) StructField(sf reflect.StructField, v reflect.Value) error {
	if t.Skip && sf.Name[0] == '_' {
		return SkipEntry
	}

	return nil
}

func TestWalk_StructWithSkipEntry(t *testing.T) {
	data := &struct {
		Foo, _Bar int
	}{
		Foo:  1,
		_Bar: 2,
	}

	{
		var s TestStructWalker_fieldSkip
		if err := Walk(data, &s); err != nil {
			t.Fatalf("err: %s", err)
		}

		if s.Fields != 2 {
			t.Fatalf("bad: %d", s.Fields)
		}
	}

	{
		var s TestStructWalker_fieldSkip
		s.Skip = true
		if err := Walk(data, &s); err != nil {
			t.Fatalf("err: %s", err)
		}

		if s.Fields != 1 {
			t.Fatalf("bad: %d", s.Fields)
		}
	}
}


text:
package com.planet_ink.coffee_mud.Locales;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class LargeStoneRoom extends StoneRoom
{
	@Override public String ID(){return "LargeStoneRoom";}
	public LargeStoneRoom()
	{
		super();
		basePhyStats.setWeight(3);
		recoverPhyStats();
	}
	@Override public int maxRange(){return 5;}
}


text:
//
//  AMAZONAmazonMobileAdsImplStub.h
//

#import <Foundation/Foundation.h>
#import "AMAZONAmazonMobileAds.h"

typedef enum AMAZONAmazonMobileAdsErrorCodes : NSUInteger {
    setApplicationKeyError = 0,
    registerApplicationError = 1,
    enableLoggingError = 2,
    enableTestingError = 3,
    enableGeoLocationError = 4,
    createFloatingBannerAdError = 5,
    createInterstitialAdError = 6,
    loadAndShowFloatingBannerAdError = 7,
    loadInterstitialAdError = 8,
    showInterstitialAdError = 9,
    closeFloatingBannerAdError = 10,
    isInterstitialAdReadyError = 11,
    areAdsEqualError = 12,
} AMAZONAmazonMobileAdsErrorCodes;

@interface AMAZONAmazonMobileAdsImplStub : NSObject <AMAZONAmazonMobileAds>

@end


text:
module Fluent
  class PartialJSONParser < Output
    Plugin.register_output('partial_json_parser', self)

    config_param :keys, :defaults => [] do |val|
      val.split(',')
    end
    config_param :tag, :string, :default => nil
    config_param :remove_tag_prefix, :string, :default => nil
    config_param :add_tag_prefix, :string, :default => nil

    include SetTagKeyMixin
    config_set_default :include_tag_key, false

    include SetTimeKeyMixin
    config_set_default :include_time_key, false

    unless method_defined?(:log)
      define_method(:log) { $log }
    end

    def initialize
      super
    end

    def configure(conf)
      super
      if @tag.nil? and @remove_tag_prefix.nil? and @add_tag_prefix.nil?
        raise ConfigError, "partial_json_parser: any of `tag`, `remove_tag_prefix` and `add_tag_prefix` is required"
      end
      if @tag and (@remove_tag_prefix or @add_tag_prefix)
        raise ConfigError, "both of `tag` and `remove_tag_prefix/add_tag_prefix` must not be specified"
      end
      if @remove_tag_prefix
        @removed_prefix = @remove_tag_prefix.chomp('.') + '.'
        @removed_length = @removed_prefix.length
      end
      @added_prefix = @add_tag_prefix.chomp('.') + '.' if @add_tag_prefix
    end

    def emit(tag, es, chain)
      if @tag
        tag = @tag
      else
        tag = tag[@removed_length..-1] if @remove_tag_prefix and tag.start_with?(@removed_prefix)
        tag = @added_prefix + tag if @add_tag_prefix
      end
      es.each do |time, record|
        record = parse(record)
        filter_record(tag, time, record)  # Fluent mixin processing
        Engine.emit(tag, time, record)
      end
      chain.next
    rescue => e
      # JSON parse error, etc.
      log.warn "partial_json_parser: #{e.class} #{e.message} #{e.backtrace.first}"
    end

    def parse(record)
      @keys.each do |key|
        value = record[key]
        if value
          parsed_value = Yajl::Parser.parse(value)
          record[key] = parsed_value
        end
      end
      record
    end
  end
end


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for D:\xampp\htdocs\Zf2Unitest/module/Album</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

D:\xampp\htdocs\Zf2Unitest /

module /

Album

(Dashboard)

Code Coverage

Lines

Functions and Methods

Classes and Traits

      Total

0.00%

0 / 20

0.00%

0 / 4

0.00%

0 / 1

       Module.php

0.00%

0 / 20

0.00%

0 / 4

0.00%

0 / 1

Legend

     Low: 0% to 35%
     Medium: 35% to 70%
     High: 70% to 100%

     Generated by PHP_CodeCoverage 1.2.11 using PHP 5.5.24 and PHPUnit 3.7.21 at Wed Nov 11 4:49:31 CET 2015.


text:
require 'spec_helper'

describe Evostream::Commands::ListStreams do
  let(:command) { Evostream::Commands::ListStreams }

  context 'disable_internal_streams' do
    let(:cmd) { { disable_internal_streams: Faker::Boolean.boolean.to_s } }

    include_examples 'command'
  end
end