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

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Wie sieht die Währung aus? - Zend Framework Manual</title>

                    Wo ist die Währung?

Zend_Currency

                        Programmer's Reference Guide

Wie viel Währung habe ich?

Wie sieht die Währung aus?

        Wie der Wert einer Währung dargestellt wird hängt hauptsächlich vom verwendeten
        Gebietsschema ab. Es gibt verschiedene Informationen welche vom Gebietsschema gesetzt
        werden. Jede von Ihnen kann manuell überschrieben werden indem die richtige Option
        verwendet wird.

        Zum Beispiel verwenden die meisten Gebietsschemata die lateinische Schreibweise für die
        darstellung von Ziffern. Aber es gibt Sprachen wie "Arabisch" welche andere Ziffern
        verwenden. Und wenn man eine arabische Website hat, will man möglicherweise andere
        Währungen auch durch Verwendung der arabischen Schreibweise darstellen. Siehe das folgende
        Beispiel:

Example #1 Verwendung einer eigenen Schreibweise

            Angenommen wir verwenden wieder unsere Währung "Dollar". Aber jetzt wollen wir unsere
            Währung durch Verwendung der arabischen Schreibweise darstellen.

$currency = new Zend_Currency(

    array(

        'value'  => 1000,

        'script' => 'Arab',

    )

);

print $currency; // Könnte '$ ١٬٠٠٠٫٠٠' zurückgeben

        Weitere Informationen über vorhandenen Schreibweisen können in
        Zend_Locale's Kapitel über
            Zahlensysteme nachgelesen werden.

        Aber auch die Formatierung der Währungszahl (Geldwert) kann verwändert werden. Standardmäßig
        hängt Sie vom verwendeten Gebietsschema ab. Sie enthält einen Separator der zwischen
        Tausendern verwendet wird, ein Zeichen das als Dezimalpunkt verwendet wird, sowie die
        verwendete Genauigkeit.

$currency = new Zend_Currency(

    array(

        'value'    => 1000,

        'currency' => 'USD'

        'format'   => 'de',

    )

);

print $currency; // Könnte '$ 1.000' zurückgeben

        Es gibt zwei Wege um das Format zu definieren das verwendet wird. Man kann entweder ein
        Gebietsschema angeben oder ein Format manuell definieren.

        Wenn man ein Gebietsschema für die Definierung des Formats verwendet wird alles automatisch
        gesetzt. Das Gebietsschema 'de' zum Beispiel,definiert '.' als Separator für die
        Tausender, und ',' als Dezimalpunkt. Im englischen ist es genau umgekehrt.

$currency_1 = new Zend_Currency(

    array(

        'value'    => 1000,

        'currency' => 'USD'

        'format'   => 'de',

    )

);

$currency_2 = new Zend_Currency(

    array(

        'value'    => 1000,

        'currency' => 'USD'

        'format'   => 'en',

    )

);

print $currency_1; // Könnte '$ 1.000' zurückgeben

print $currency_2; // Könnte '$ 1,000' zurückgeben

        Wenn man es manuell definiert muss es dem Format entsprechen welches in diesem Kapitel über Lokalisierung
        beschrieben wird. Siehe das folgende:

$currency = new Zend_Currency(

    array(

        'value'    => 1000,

        'currency' => 'USD'

        'format'   => '#0',

    )

);

print $currency; // Könnte '$ 1000' zurückgeben

        Im obigen Abschnitt haben wir den Separator und auch die Genauigkeit gelöscht.

                    Wo ist die Währung?

Zend_Currency

                        Programmer's Reference Guide

Wie viel Währung habe ich?

Programmer's Reference Guide

Programmer's Reference Guide

Zend Framework Reference

Zend_Currency

Einführung in Zend_Currency

Zend_Currency verwenden

Optionen für Währungen

Was macht eine Währung aus?

Wo ist die Währung?

Wie sieht die Währung aus?

Wie viel Währung habe ich?

Rechnen mit Währungen

Währungen wechseln

Zusätzliche Informationen für Zend_Currency


text: The entire `style` folder follows the [SMACSS](https://smacss.com/) approach.

redpajama_set_name: RedPajamaGithub


text:
/**
 * 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.
 */

package org.brixcms.markup.variable;

import java.util.Collection;

public interface VariableKeyProvider {
    public Collection<String> getVariableKeys();
}


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title itemprop="name" property="og:title" content="Why Do We Fall?">Why Do We Fall?</title>
  <meta itemprop="description" name="description" property="og:description" content="So we might learn to pick ourselves up.">
	<meta property="og:type" content="blog">
	<meta property="og:url" content="http://why.dowefall.com">

  <meta property="og:image" content="http://why.dowefall.com/graph.png">
  <meta property="og:site_name" content="Why Do We Fall?">
  <meta name="viewport" content="width=device-width">
  <link href="http://why.dowefall.com/atom.xml" rel="alternate" title="Why Do We Fall?" type="application/atom+xml">
  <link rel="stylesheet" href="/asset/style/master.css">

Why Do We Fall?

Vertical Rhythm Boilerplate with Stylus

						<time class="date-pub pubdate small" title="2012-12-09T11:18:23+09:00">
							Published:
							Dec
							09
							2012
						</time>

Yuya Saito

tl;dr

Demo

This is FAR FROM perfect and it's just a starting point.

// Settings
// Override this settings via something like site-settings.styl

$rembase = 16 // Most browser's default size
$ratio = 1.625 // Almost golden ratio
$line-height-base = $rembase * $ratio // You don't need to change this
$devmode = false // Set this true to show vertical grid

// mixins

// It calculates line-height when flag is true
// font-size must be declared with px
font-size(n, flag = true)
  if unit(n) is 'px'
    font-size: n
    font-size: (remove-unit(n) / $rembase) rem
    if flag
      line-height: -getlineheight()
  else
    error('Use px as unit')

// margin-bottom using rem with fallback
line($n)
  margin: 0 0 ($n * ($line-height-base px)) 0
  margin: 0 0 ($n * ($line-height-base / $rembase) rem) 0

// This is a function and by convention, starts with hyphen
-getlineheight()
  return remove-unit(@font-size) * ($line-height-base / (remove-unit(@font-size) * $rembase))

// Vertical guide using gradient
guide()
  unless $devmode is false
    background: -moz-linear-gradient(top, #BA9B9A 1px, transparent 1px );
    background-image: -webkit-linear-gradient(#BA9B9A 1px, transparent 1px);
    background-size: 100% ($line-height-base px);

//
html {
  font-size: 16px; // Assuming 16px...
  guide()

p,
ul,
ol,
dl,
blockquote,
pre,
td,
th,
label,
textarea,
caption {
  line: 1
}
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  margin-top: 0;
  margin-bottom: 0;
}
h1,
.h1 {
  font-size: 64px;
  line: 1;
}
h2,
.h2 {
  font-size: 48px;
  line: 1;
}
h3,
.h3 {
  font-size: 32px;
  line: 1;
}
h4,
.h4 {
  font-size: 28px;
  line: 1.25;
}
h5,
.h5 {
  font-size: 24px;
  line: 0.5;
}
h6,
.h6 {
  font-size: 16px;
  line: 1;
}

Explanation

My math sucks.

Therefore most of the calcurations were based on Web Typography Using The Golden Ratio and REM's.
It is straightforward to see what's going on.

In last article, I demonstrated "transparent" design of Stylus.

I took that idea further by introducing line property. As you can see from
above snippet, line mixin can be used like CSS property.

In my opinion, this mixin should be used as mixin.(ex: line(n))

This "transparent" design of Stylus can be helpful when expanding CSS
properties. However, it is not ideal to use when drastically change CSS syntax.

For example, font-size can use rem unit, but due to browsers which doesn't
happened to support this unit, you almost always like to have fallback with px unit.

By using font-size mixin, this problem can be solved without thinking about
it.

When it's safe to say what you trying to archive should be default behaviour of
CSS, then it's ok to use this transparent way to declare mixins.

When you're trying to re-using css properties, then use "mixins" way to declare it.

Failure(s)

The hardest part of this attempt was clearly a math.

The second hardest part was find out how to concatenate unit to variables where multiple values can be used.

margin: 0 0 ($n * ($line-height-base px)) 0

Since Stylus seems like it can't use + to concatenate unit to value, you need to wrap with parentheses.

Above example is somewhat complex looking but

margin: 0 0 $line-height-base px 0

this doesn't work.

Say $line-height-base was 26, when you compile this to CSS, you will get

margin: 0 0 26 px 0

Yes, the space is not a typo.

Then I tried:

margin: 0 0 ($line-height-base)px 0

it does work when value is single, but this doesn't work.

So I end up with this:

margin: 0 0 ($line-height-base px) 0

It seems parentheses have two purpose in Stylus:

As you expected, change math operation order

Protect variables from other values

Oh, and guide() mixin is very handy I think.

I came up with this because Basehold.it was down when I was trying to use it.

Sometimes, you need to re-invent stuff, because it simply not available when you need it.

Appendix

Tools

Vertical Rhythm CSS rules for Web Design

Pearsonified's Golden Ratio Typography Calculator

Gridlover

Codes

jonschlinkert/vertical-rhythm · GitHub

A Sass/SCSS vertical rhythm mixin · CodePen

Articles

24 ways: Composing the New Canon: Music, Harmony, Proportion

A List Apart: Articles: More Meaningful Typography

How to Tune Typography Based on Characters Per Line

R(a|ela)tional Design

Web Typography Using The Golden Ratio and REM's

Back Number

font-size using rem with fallback in Stylus

Fail First to Learn

Questions?

				 Ask Me on Github

About

				My name is Yuya Saito and I work at CyberAgent in Tokyo, Japan. I love to build things to solve problems.

				This site is for me to learn new things by failing.

				I hate to fail, but also I believe that's the only way to learn.

Elsewhere

cssradar@twitter

CSS Radar

Seven

en.ja

Public Draft

en.ja OSS

github

Pinboard

500px

	Build Proudly in Tokyo.


text:
import java.awt.Color;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.ApplicationFrame;

public class LineChartClouds extends ApplicationFrame {

	/**
	 *
	 */
	private static final long serialVersionUID = 8838788408219850741L;
	public XYSeries cloud_forecast = new XYSeries("Cloud Coverage Forecast");
	public XYSeriesCollection dataset;

	public LineChartClouds(String title) {
		super(title);
		dataset = new XYSeriesCollection();
		dataset.addSeries(cloud_forecast);

		JFreeChart chart = createChart(dataset);
		ChartPanel panel = new ChartPanel(chart);

		panel.setPreferredSize(new java.awt.Dimension(500, 270));
        setContentPane(panel);
	}

	private JFreeChart createChart(XYSeriesCollection dataset2) {
		JFreeChart chart = ChartFactory.createXYLineChart(
	            "Line Chart Demo 6",      // chart title
	            "Hours",                      // x axis label
	            "Cloud Coverage",                      // y axis label
	            dataset,                  // data
	            PlotOrientation.VERTICAL,
	            true,                     // include legend
	            true,                     // tooltips
	            false                     // urls
	        );

	        // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
	        chart.setBackgroundPaint(Color.white);

//	        final StandardLegend legend = (StandardLegend) chart.getLegend();
	  //      legend.setDisplaySeriesShapes(true);

	        // get a reference to the plot for further customisation...
	        final XYPlot plot = chart.getXYPlot();
	        plot.setBackgroundPaint(Color.lightGray);
	    //    plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
	        plot.setDomainGridlinePaint(Color.white);
	        plot.setRangeGridlinePaint(Color.white);

	        final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	        renderer.setSeriesLinesVisible(0, false);
	        renderer.setSeriesShapesVisible(1, false);
	        plot.setRenderer(renderer);

	        // change the auto tick unit selection to integer units only...
	        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
	        // OPTIONAL CUSTOMISATION COMPLETED.

	        return chart;
	}

}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" type="text/css" href="style.css">
		<title>Carnival</title>

		<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic' rel='stylesheet' type='text/css'>

								Promociones

								5255 - 5555

					¿Por qué cruceros Carnival?
					Destinos
					Actividades
					Antes de Viajar
					Barcos
					Preguntas frecuentes

Caribe

We don't have proof, but evidence suggests that the Caribbean was made for cruising. And with more than 5,000 islands and cays, there's a lot of paradise to see! So how do you choose where to go on your next cruise? See for yourself — best of all, the mild climate means it doesn't even matter what time of year you go. A Carnival cruise takes you to some of the greatest hotspots stretching across the world's designated hotspot.

Excursiones

Mayan Ruins of Tulum & playa Del Carmen Experience

Coral &Stingray Sandbar

						<button type="submit" class="[ btn btn-primary btn-small ]">VER MÁS</button>

Puertos

Nassau

Freeport

						<button type="submit" class="[ btn btn-primary btn-small ]">VER MÁS</button>

 Premios

 Síguenos

								Twitter

								Facebook

 Links

							Registro de agencias
							Folletos
							Directorio
							Políticas
							Contacto

 Visas

							Canada
							Estados Unidos

Todos los derechos reservados 2006 - 2016.
Carnival Corporation.

¿Por qué cruceros Carnival?

Destinos

Actividades

Antes de Viajar

Barcos

Preguntas frecuentes


text:
package pt.babyHelp.cloudEndpoints;

/**
 *
Contains the client IDs and scopes for allowed clients consuming the babyHelp API.

 *
Used in {@link com.google.api.server.spi.config.Api}

 *
To get the client ids you must:

 *

 *

 * navigate to
 * Google Developers Console url
 *

 *
choose de project

 *
in left bar, select APIs & auth option

 *
Credentials

 *
In the red button in the main area of the page click in CREATE NEW CLIENT ID

 *

 *

 *
 *
 */
public interface Constants {

    public static final String WEB_CLIENT_ID = "942158003504-3c2sv8q1ukhneffl2sfl1mm9g8ac281u.apps.googleusercontent.com";
    public static final String ANDROID_CLIENT_ID = WEB_CLIENT_ID;
    public static final String IOS_CLIENT_ID = WEB_CLIENT_ID;
    public static final String ANDROID_AUDIENCE = WEB_CLIENT_ID;
    public static final String EMAIL = "https://www.googleapis.com/auth/userinfo.email";
    public static final String API_EXPLORER_CLIENT_ID
            = com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID;

}


text:
MediaWiki OAuth Library
=======================

``mwoauth`` is an open licensed (MIT) library designed to provide a simple means to performing an OAuth handshake with a MediaWiki installation with the `OAuth Extension <https://www.mediawiki.org/wiki/Extension:OAuth>`_ installed.

**Compatible with python 2.7 and 3.x**

**Install with pip:** ``pip install mwoauth``

**Documentation:** http://pythonhosted.org/mwoauth

Usage
=====

.. code-block:: python

	from mwoauth import ConsumerToken, Handshaker
	from six.moves import input # For compatibility between python 2 and 3

	# Construct a "consumer" from the key/secret provided by MediaWiki
	import config
	consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret)

	# Construct handshaker with wiki URI and consumer
	handshaker = Handshaker("https://en.wikipedia.org/w/index.php",
	                        consumer_token)

	# Step 1: Initialize -- ask MediaWiki for a temporary key/secret for user
	redirect, request_token = handshaker.initiate()

	# Step 2: Authorize -- send user to MediaWiki to confirm authorization
	print("Point your browser to: %s" % redirect) #
	response_qs = input("Response query string: ")

	# Step 3: Complete -- obtain authorized key/secret for "resource owner"
	access_token = handshaker.complete(request_token, response_qs)
	print(str(access_token))

	# Step 4: Identify -- (optional) get identifying information about the user
	identity = handshaker.identify(access_token)
	print("Identified as {username}.".format(**identity))


text:
import sys
import traceback
from Utils import Logger
from SketchFramework.Point import Point
from SketchFramework.Annotation import Annotation, AnnotatableObject
from xml.etree import ElementTree as ET

logger = Logger.getLogger('Stroke', Logger.WARN )

#FIXME: this module is in dire need of some documentation

class Stroke(AnnotatableObject):
    "Stroke defined as a List of Points: Points"

    # counter shared with all strokes, incremented on each new stroke
    Number = 0
    DefaultStrokeColor = "#000000"

    def __repr__(self):
        return "<Stroke %s>" % (str(self.ident))

    def __len__(self):
        """Returns the length of this stroke in number of points"""
        return len(self.Points)

    def __init__(self, points=None, id = None, board=None):#, smoothing=False): DEPRECATED
        # call parent constructor
        AnnotatableObject.__init__(self)
        # give each stroke a unique ident
        if id != None:
            self.ident = id
            Stroke.Number = max(Stroke.Number, id) + 1
        else:
            self.ident = Stroke.Number
            Stroke.Number += 1

        self.Points = []
        self.BoundTopLeft = Point( 0, 0 )
        self.BoundBottomRight = Point( 0, 0 )
        #Centerpoint of this stroke
        self.X = None
        self.Y = None
        self.Center = None
        self.Color = Stroke.DefaultStrokeColor
        self._featureVectors = {} #Rubine Feature vector for this stroke. Set by calling setFeatureVector(...)

        self._length = None
        self._resample = {}
        self.setBoard(board)# self._board = board

        if points and len(points)>0:
            # if passed a sequence of tuples, covert them all to points
            if all(type(i)==tuple for i in points):
                points = [ Point(x,y) for (x,y) in points ]
            # turning smoothing off is very handy for testing
            self.Points = points
            xlist = [p.X for p in points]
            ylist = [p.Y for p in points]
            ( left , right ) = min(xlist), max(xlist)
            ( bottom, top ) = min(ylist), max(ylist)
            self.BoundTopLeft = Point(left, top)
            self.BoundBottomRight = Point(right, bottom)

            self.X = (left + right) / 2
            self.Y = (top + bottom) / 2
            self.Center = Point(self.X, self.Y)

    def xml(self):
        root = ET.Element("Stroke")

        root.attrib['id'] = str(self.ident)
        root.attrib['length'] = str(self.length())

        pts_el = ET.SubElement(root, "Points")
        for i, pt in enumerate(self.Points):
            pts_el.append(pt.xml())

        topleft = self.BoundTopLeft.xml()
        topleft.tag = "topleft"
        root.append(topleft)

        bottomright = self.BoundBottomRight.xml()
        bottomright.tag = "bottomright"
        root.append(bottomright)

        center = self.Center.xml()
        center.tag = "center"
        root.append(center)
        return root

    def getFeatureVector(self, featureSet):
        """Get the feature vector for this stroke given featureSet, a FeatureSet() instance."""
        if type(featureSet) in self._featureVectors:
            logger.debug("Reusing feature vector for stroke %s" % (self.ident))
        else:
            logger.debug("GENERATING feature vector for stroke %s" % (self.ident))
        retVect = self._featureVectors.setdefault(type(featureSet), featureSet.generateVector([self]))
        return retVect

    def drawMyself(self, color = None):

        board = self.getBoard()
        if board is not None and board.getGUI() is not None and len(self.Points) > 0:
            if color is not None:
                board.getGUI().drawStroke(self, color = color, erasable = True)
            else:
                board.getGUI().drawStroke(self, erasable = True)

    def length (self, force = False):
        """Calculate the pixel-length of the stroke as the sum of distances
        between points."""
        if self._length is None or force:
            if len(self.Points) > 0:
                self._length = 0
                prev = self.Points[0]
                for next in self.Points:
                    #Sum up the pairwise distance between points
                    self._length += prev.distance(next)
                    prev = next
            else:
                self._length = 0
        return self._length

    def get_id(self):
	return self.ident

    def setBoard(self, board):
        """Set the logical board object that this stroke belongs to."""
        self._board = board
    def getBoard(self):
        """Get the board object that holds this stroke"""
        return self._board

    #Removed: Overloading doesn't work in python
    #def addPoint(self, x, y, t):
        #self.addPoint( Point( x, y, t ) )

    def addPoint(self, point):
        logger.warn("DEPRECATED: addPoint. Use Stroke constructor instead")
        traceback.print_stack()
        if type(point) == tuple:
            point = Point(point[0], point[1])
        self.Points.append( point )
        if self.X == None or self.Y == None:
           self.BoundTopLeft.X = self.BoundBottomRight.X = point.X
           self.BoundTopLeft.Y = self.BoundBottomRight.Y = point.Y

        if (point.X < self.BoundTopLeft.X):
            self.BoundTopLeft.X = point.X
        elif (point.X > self.BoundBottomRight.X):
            self.BoundBottomRight.X = point.X

        if (point.Y > self.BoundTopLeft.Y):
            self.BoundTopLeft.Y = point.Y
        elif (point.Y < self.BoundBottomRight.Y):
            self.BoundBottomRight.Y = point.Y

        self.X = (self.BoundTopLeft.X + self.BoundBottomRight.X) / 2
        self.Y = (self.BoundTopLeft.Y + self.BoundBottomRight.Y) / 2
        self.Center = Point(self.X, self.Y)

    def translate(self, xDist, yDist, overWrite = False):
        "Input: Stroke, and the distance in points to translate in X- and Y-directions. Returns a new translated stroke"
        logger.warn("Deprecated: 'Stroke.translate'. Use GeomUtils.translate instead")
        if overWrite:
            for p in self.Points:
                p.X += xDist
                p.Y += yDist

            self.BoundTopLeft.X += xDist
            self.BoundTopLeft.Y += yDist
            self.BoundBottomRight.X += xDist
            self.BoundBottomRight.Y += yDist

            self.X = (self.BoundTopLeft.X + self.BoundBottomRight.X) / 2
            self.Y = (self.BoundTopLeft.Y + self.BoundBottomRight.Y) / 2
            self.Center = Point(self.X, self.Y)
            return self
        else:
            pointList = []
            for p in self.Points:
                newPoint = Point(p.X + xDist, p.Y + yDist)
                pointList.append(newPoint)
            retStroke = Stroke(pointList)
            return retStroke


text:
"""
GenomeDB implementation for a generic genome data set.
"""

from __future__ import print_function
import os
import re
import subprocess
import sys
import genhub

class GenericDB(genhub.genomedb.GenomeDB):

    def __init__(self, label, conf, workdir='.'):
        super(GenericDB, self).__init__(label, conf, workdir)
        assert 'gdna' in self.config
        assert 'gff3' in self.config
        assert 'prot' in self.config
        assert self.config['source'] == 'local'

    @property
    def gdnapath(self):
        return self.config['gdna']

    @property
    def gff3path(self):
        return self.config['gff3']

    @property
    def protpath(self):
        return self.config['prot']

    def download(self, logstream=sys.stderr):
        subprocess.call(['mkdir', '-p', self.dbdir])
        if logstream is not None:  # pragma: no cover
            msg = '[GenHub: %s] checking input files' % self.config['species']
            print(msg, file=logstream)
        assert os.path.isfile(self.gdnapath), \
            'gDNA file {} does not exist'.format(self.gdnapath)
        assert os.path.isfile(self.gff3path), \
            'GFF3 file {} does not exist'.format(self.gff3apath)
        assert os.path.isfile(self.protpath), \
            'proetin file {} does not exist'.format(self.protpath)

    def format_gdna(self, instream, outstream, logstream=sys.stderr):
        subprocess.call(['mkdir', '-p', self.dbdir])
        for line in instream:
            if line.strip() == '':
                continue
            print(line, end='', file=outstream)

    def format_prot(self, instream, outstream, logstream=sys.stderr):
        for line in instream:
            if line.strip() == '':
                continue
            print(line, end='', file=outstream)

    def format_gff3(self, logstream=sys.stderr, debug=False):
        cmds = list()
        if self.gff3path.endswith('.gz'):  # pragma: no cover
            cmds.append('gunzip -c %s' % self.gff3path)
        else:
            cmds.append('cat %s' % self.gff3path)
        cmds.append('seq-reg.py - %s' % self.gdnafile)
        cmds.append('genhub-format-gff3.py --source local -')
        cmds.append('gt gff3 -sort -tidy -o %s -force' % self.gff3file)

        commands = ' | '.join(cmds)
        if debug:  # pragma: no cover
            print('DEBUG: running command: %s' % commands, file=logstream)
        proc = subprocess.Popen(commands, shell=True, universal_newlines=True,
                                stderr=subprocess.PIPE)
        stdout, stderr = proc.communicate()
        for line in stderr.split('\n'):  # pragma: no cover
            if 'has not been previously introduced' not in line and \
               'does not begin with "##gff-version"' not in line and \
               'illegal uppercase attribute "Shift"' not in line and \
               'has the wrong phase' not in line and \
               line != '':
                print(line, file=logstream)
        assert proc.returncode == 0, \
            'annot cleanup command failed: %s' % commands

    def gff3_protids(self, instream):
        for line in instream:
            if '\tmRNA\t' not in line:
                continue
            namematch = re.search('protein_id=([^;\n]+)', line)
            if not namematch:  # pragma: no cover
                namematch = re.search('Name=([^;\n]+)', line)
            assert namematch, 'cannot parse protein ID/name/accession: ' + line
            yield namematch.group(1)

    def protein_mapping(self, instream):
        locusid2name = dict()
        gene2loci = dict()
        for line in instream:
            fields = line.split('\t')
            if len(fields) != 9:
                continue
            feattype = fields[2]
            attrs = fields[8]

            if feattype == 'locus':
                idmatch = re.search('ID=([^;\n]+);.*Name=([^;\n]+)', attrs)
                if idmatch:
                    locusid = idmatch.group(1)
                    locusname = idmatch.group(2)
                    locusid2name[locusid] = locusname
            elif feattype == 'gene':
                idmatch = re.search('ID=([^;\n]+);Parent=([^;\n]+)', attrs)
                assert idmatch, \
                    'Unable to parse gene and iLocus IDs: %s' % attrs
                geneid = idmatch.group(1)
                ilocusid = idmatch.group(2)
                gene2loci[geneid] = ilocusid
            elif feattype == 'mRNA':
                idmatch = re.search('Parent=([^;\n]+)', attrs)
                protmatch = re.search('protein_id=([^;\n]+)', attrs)
                if not protmatch:  # pragma: no cover
                    protmatch = re.search('Name=([^;\n]+)', attrs)
                assert idmatch and protmatch, \
                    'Unable to parse protein and gene IDs: %s' % attrs
                protid = protmatch.group(1)
                geneid = idmatch.group(1)
                locusid = gene2loci[geneid]
                locusname = locusid2name[locusid]
                yield protid, locusname

# -----------------------------------------------------------------------------
# Unit tests
# -----------------------------------------------------------------------------

def test_all():
    """GenericDB: the whole enchilada"""
    config = {
        'gdna': 'testdata/fasta/generic.gdna.fa.gz',
        'gff3': 'testdata/gff3/generic.gff3',
        'prot': 'testdata/fasta/generic.prot.fa',
        'source': 'local',
        'species': 'Gnrc',
    }
    db = GenericDB('Gnrc', config, workdir='testdata/demo-workdir')
    db.download(logstream=None)
    db.prep(logstream=None)
    genhub.iloci.prepare(db, ilcformat='{}ILC-%05lu', logstream=None)
    genhub.proteins.prepare(db, logstream=None)
    genhub.mrnas.prepare(db, logstream=None)
    genhub.exons.prepare(db, logstream=None)
    genhub.stats.compute(db, logstream=None)

    sha1 = 'f3629aedbd683dd4dcf158ac12d3549e5c9081a0'
    testsha1 = db.file_sha1('testdata/demo-workdir/Gnrc/Gnrc.iloci.tsv')
    assert testsha1 == sha1, ('generic iLocus stats checksum failed')


text:
using System;
using System.Data;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Security.Cryptography; //Authentication;
using System.Text;
using System.Web.Http;
using System.Web.Http.Description;
using UIBuildIt.Common;
using UIBuildIt.Common.Authentication;
using UIBuildIt.Models;

namespace UIBuildIt.WebService.Controllers.API.Authentication
{
    /// <summary>
    /// Used to log in
    /// </summary>
    public class LoginControllerBase : ApiController
    {
        protected UIBuildItContext db = new UIBuildItContext();

        protected TokenData CreateToken(User user)
        {
            var token = new TokenData()
            {
                UserId = user.Id,
                Text = GetMD5HashCode(MD5.Create(), user),
                Creation = DateTime.UtcNow,
                Expiration = DateTime.UtcNow + TimeSpan.FromHours(1.0),
                UserEmail = user.Email,
                UserName = user.Name,
                Organization = user.Organization
            };
            // Add the token to the database
            return token;
        }

        private string GetMD5HashCode(MD5 md5Hash, User user)
        {
            byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(user.Email + DateTime.UtcNow.ToString() + user.Password));
            StringBuilder sBuilder = new StringBuilder();
            for (int i = 0; i < data.Length; i++)
            {
                sBuilder.Append(data[i].ToString("x2"));
            }
            return sBuilder.ToString();
        }

        protected bool UserExists(int id)
        {
            return db.Users.Count(e => e.Id == id) > 0;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }

    public class TokenData
    {

        public string Organization { get; set; }

        public string UserName { get; set; }

        public string UserEmail { get; set; }

        public DateTime Creation { get; set; }

        public DateTime Expiration { get; set; }

        public string Text { get; set; }

        public int UserId { get; set; }

        public Token GetToken()
        {
            return new Token()
            {
                Creation = Creation,
                Expiration = Expiration,
                UserId = UserId,
                Text = Text
            };
        }

        public int Id { get; set; }
    }
}


text:
package org.keycloak.models.map.storage.jpa.updater;

import org.keycloak.provider.Provider;

import java.io.File;
import java.sql.Connection;

public interface MapJpaUpdaterProvider extends Provider {

    /**
     * Status of database up-to-dateness
     */
    enum Status {
        /**
         * Database is valid and up to date
         */
        VALID,
        /**
         * No database exists.
         */
        EMPTY,
        /**
         * Database needs to be updated
         */
        OUTDATED
    }

    /**
     * Updates the Keycloak database for the given model type
     * @param modelType Model type
     * @param connection DB connection
     * @param defaultSchema DB connection
     */
    void update(Class modelType, Connection connection, String defaultSchema);

    /**
     * Checks whether Keycloak database for the given model type is up to date with the most recent changesets
     * @param modelType Model type
     * @param connection DB connection
     * @param defaultSchema DB schema to use
     * @return
     */
    Status validate(Class modelType, Connection connection, String defaultSchema);

    /**
     * Exports the SQL update script for the given model type into the given File.
     * @param modelType Model type
     * @param connection DB connection
     * @param defaultSchema DB schema to use
     * @param file File to write to
     */
    void export(Class modelType, Connection connection, String defaultSchema, File file);

}


text:
#include "args.hh"
#include "command.hh"
#include "dispatch_table.hh"

namespace
{

bool
do_fail(const DispatchTable &dt, Args &args)
{
    uint64_t ns_delay, code;
    if (!args.pop(code) || !args.pop(ns_delay, 0))
        return false;

    (*dt.m5_fail)(ns_delay, code);

    return true;
}

Command fail_cmd = {
    "fail", 1, 2, do_fail, "<code> [delay]\n"
        "        Exit with failure code code after delay, or immediately" };

} // anonymous namespace


text:
package org.apache.geronimo.st.v21.core;

import org.apache.geronimo.st.v21.core.internal.Trace;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle
 *
 * @version $Rev$ $Date$
 */
public class Activator extends Plugin {

    // The plug-in ID
    public static final String PLUGIN_ID = "org.apache.geronimo.st.v21.core";

    // The shared instance
    private static Activator plugin;
    /* trace and log switchers */
    public static boolean console;
    public static boolean logCore;
    public static boolean logInternal;
    public static boolean logOperations;
    public static boolean logPlugin;

    public static boolean traceCore;
    public static boolean traceInternal;
    public static boolean traceOperations;
    public static boolean tracePlugin;
    /* end here */
    static {
        try {
            console = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/console"));
            logCore = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/log/core"));
            logInternal = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/log/internal"));
            logOperations = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/log/operations"));
            logPlugin = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/log/plugin"));

            traceCore = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/trace/core"));
            traceInternal = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/trace/internal"));
            traceOperations = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/trace/operations"));
            tracePlugin = Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/trace/plugin"));
        } catch (NumberFormatException e) {
            Trace.trace(Trace.ERROR, e.getMessage(), true);
        } catch (NullPointerException e) {
            Trace.trace(Trace.ERROR, e.getMessage(), true);
        }

    }

	/**
	 * The constructor
	 */
	public Activator() {
		plugin = this;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static Activator getDefault() {
		return plugin;
	}

}


text:
// Copyright 2022 Google LLC
//
// 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
//
//     https://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.
'use strict';

const bulkMutateRows = require('./bulk-mutate-rows.js');
const checkAndMutateRow = require('./check-and-mutate-row.js');
const ClientMap = require('./utils/client-map.js');
const closeClient = require('./close-client.js');
const createClient = require('./create-client.js');
const mutateRow = require('./mutate-row.js');
const readModifyWriteRow = require('./read-modify-write-row.js');
const readRow = require('./read-row.js');
const readRows = require('./read-rows.js');
const removeClient = require('./remove-client.js');
const sampleRowKeys = require('./sample-row-keys.js');

/*
 * Starts the client pool map and retrieves the object that
 * lists all methods to be passed to grpc.Server.addService.
 *
 * ref: https://grpc.github.io/grpc/node/grpc.Server.html#addService__anchor
 */
function getServicesImplementation() {
  const clientMap = new ClientMap();

  return {
    bulkMutateRows: bulkMutateRows({clientMap}),
    checkAndMutateRow: checkAndMutateRow({clientMap}),
    createClient: createClient({clientMap}),
    closeClient: closeClient({clientMap}),
    mutateRow: mutateRow({clientMap}),
    readModifyWriteRow: readModifyWriteRow({clientMap}),
    readRow: readRow({clientMap}),
    readRows: readRows({clientMap}),
    removeClient: removeClient({clientMap}),
    sampleRowKeys: sampleRowKeys({clientMap}),
  };
}

module.exports = {
  getServicesImplementation,
};


text:
/*
 * This file is auto-generated.  DO NOT MODIFY.
 * Original file: /Users/alan/Desktop/hiposAndroid/test2/node_modules/react-native-double-screen/android/src/main/aidl/com/sunmi/aidl/SendService.aidl
 */
package com.sunmi.aidl;
public interface SendService extends android.os.IInterface
{
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements com.sunmi.aidl.SendService
{
private static final java.lang.String DESCRIPTOR = "com.sunmi.aidl.SendService";
/** Construct the stub at attach it to the interface. */
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
/**
 * Cast an IBinder object into an com.sunmi.aidl.SendService interface,
 * generating a proxy if needed.
 */
public static com.sunmi.aidl.SendService asInterface(android.os.IBinder obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)&&(iin instanceof com.sunmi.aidl.SendService))) {
return ((com.sunmi.aidl.SendService)iin);
}
return new com.sunmi.aidl.SendService.Stub.Proxy(obj);
}
@Override public android.os.IBinder asBinder()
{
return this;
}
@Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
{
switch (code)
{
case INTERFACE_TRANSACTION:
{
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_sendFileToFile:
{
data.enforceInterface(DESCRIPTOR);
java.lang.String _arg0;
_arg0 = data.readString();
java.lang.String _arg1;
_arg1 = data.readString();
boolean _arg2;
_arg2 = (0!=data.readInt());
long _arg3;
_arg3 = data.readLong();
com.sunmi.aidl.SendServiceCallback _arg4;
_arg4 = com.sunmi.aidl.SendServiceCallback.Stub.asInterface(data.readStrongBinder());
int _result = this.sendFileToFile(_arg0, _arg1, _arg2, _arg3, _arg4);
reply.writeNoException();
reply.writeInt(_result);
return true;
}
case TRANSACTION_sendByteToMemory:
{
data.enforceInterface(DESCRIPTOR);
java.lang.String _arg0;
_arg0 = data.readString();
byte[] _arg1;
_arg1 = data.createByteArray();
com.sunmi.aidl.SendServiceCallback _arg2;
_arg2 = com.sunmi.aidl.SendServiceCallback.Stub.asInterface(data.readStrongBinder());
int _result = this.sendByteToMemory(_arg0, _arg1, _arg2);
reply.writeNoException();
reply.writeInt(_result);
return true;
}
}
return super.onTransact(code, data, reply, flags);
}
private static class Proxy implements com.sunmi.aidl.SendService
{
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote)
{
mRemote = remote;
}
@Override public android.os.IBinder asBinder()
{
return mRemote;
}
public java.lang.String getInterfaceDescriptor()
{
return DESCRIPTOR;
}
@Override public int sendFileToFile(java.lang.String recvPackageName, java.lang.String path, boolean isReport, long userFlag, com.sunmi.aidl.SendServiceCallback callback) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(recvPackageName);
_data.writeString(path);
_data.writeInt(((isReport)?(1):(0)));
_data.writeLong(userFlag);
_data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null)));
mRemote.transact(Stub.TRANSACTION_sendFileToFile, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
@Override public int sendByteToMemory(java.lang.String recvPackageName, byte[] data, com.sunmi.aidl.SendServiceCallback callback) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(recvPackageName);
_data.writeByteArray(data);
_data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null)));
mRemote.transact(Stub.TRANSACTION_sendByteToMemory, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
}
static final int TRANSACTION_sendFileToFile = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
static final int TRANSACTION_sendByteToMemory = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
}
public int sendFileToFile(java.lang.String recvPackageName, java.lang.String path, boolean isReport, long userFlag, com.sunmi.aidl.SendServiceCallback callback) throws android.os.RemoteException;
public int sendByteToMemory(java.lang.String recvPackageName, byte[] data, com.sunmi.aidl.SendServiceCallback callback) throws android.os.RemoteException;
}


text:
import { Store } from '../../stores';
import { pickRegion } from '../region/pick_region';
import { RegionCode } from '../../validation/region/types';

export const selectHelpTopicForRegion = (appStore: Store): string => {
    const region = pickRegion(appStore);
    if (!region || region === RegionCode.BC) {
        return 'contact-workers-at-your-local-settlement-agency_bc';
    }
    if (region === RegionCode.MB) {
        return 'contact-workers-at-your-local-settlement-agency_mb';
    }
    throw new Error('Invalid region');
};


text:
#ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED

#include "catch_assertionhandler.h"
#include "catch_message.h"
#include "catch_interfaces_capture.h"

#if !defined(CATCH_CONFIG_DISABLE)

#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
  #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
#else
  #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
#endif

#if defined(CATCH_CONFIG_FAST_COMPILE)

///////////////////////////////////////////////////////////////////////////////
// Another way to speed-up compilation is to omit local try-catch for REQUIRE*
// macros.
#define INTERNAL_CATCH_TRY
#define INTERNAL_CATCH_CATCH( capturer )

#else // CATCH_CONFIG_FAST_COMPILE

#define INTERNAL_CATCH_TRY try
#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }

#endif

#define INTERNAL_CATCH_REACT( handler ) handler.complete();

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
        INTERNAL_CATCH_TRY { \
            CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
            catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
            CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
        } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( (void)0, false && static_cast<bool>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look
    // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&.

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
    INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
    if( Catch::getResultCapture().lastAssertionPassed() )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
    INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
    if( !Catch::getResultCapture().lastAssertionPassed() )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
        try { \
            static_cast<void>(__VA_ARGS__); \
            catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
        } \
        catch( ... ) { \
            catchAssertionHandler.handleUnexpectedInflightException(); \
        } \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( false )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
        if( catchAssertionHandler.allowThrows() ) \
            try { \
                static_cast<void>(__VA_ARGS__); \
                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
            } \
            catch( ... ) { \
                catchAssertionHandler.handleExceptionThrownAsExpected(); \
            } \
        else \
            catchAssertionHandler.handleThrowingCallSkipped(); \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( false )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
        if( catchAssertionHandler.allowThrows() ) \
            try { \
                static_cast<void>(expr); \
                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
            } \
            catch( exceptionType const& ) { \
                catchAssertionHandler.handleExceptionThrownAsExpected(); \
            } \
            catch( ... ) { \
                catchAssertionHandler.handleUnexpectedInflightException(); \
            } \
        else \
            catchAssertionHandler.handleThrowingCallSkipped(); \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( false )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
        catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( false )

///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_INFO( macroName, log ) \
    Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );

///////////////////////////////////////////////////////////////////////////////
// Although this is matcher-based, it can be used with just a string
#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
    do { \
        Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
        if( catchAssertionHandler.allowThrows() ) \
            try { \
                static_cast<void>(__VA_ARGS__); \
                catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
            } \
            catch( ... ) { \
                Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher ); \
            } \
        else \
            catchAssertionHandler.handleThrowingCallSkipped(); \
        INTERNAL_CATCH_REACT( catchAssertionHandler ) \
    } while( false )

#endif // CATCH_CONFIG_DISABLE

#endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED


text:
@implementation GraphicsTests

- (void)setUp
{
    [super setUp];

    // Set-up code here.
}

- (void)tearDown
{
    // Tear-down code here.

    [super tearDown];
}

- (void)testExample
{
    STFail(@"Unit tests are not implemented yet in GraphicsTests");
}

@end


text:
'use strict';

/**
 * Decription of the ldm-groups-control directive here
 * @param
 * @constructor
 * @alias module:directive/ldm-groups-control
 */
var someDirectiveDirective = function () {
  return {
    // 'E' - only matches element name
    restrict: 'E',
    // To access the scope outside
    transclude: true,
    scope: {
      attribute: '@',
    },
    templateUrl: '$server2$/some-directive.directive.html',
    controllerAs: 'vm',
    controller: function (someService) {
      var vm = this;
      vm.object = someService.getObject();
      vm.increment = someService.increment;
    },
  };
};

console.log('register directive someDirective');
angular.module('testApp').directive('someDirective', someDirectiveDirective);


text:
@interface OEXMyVideosViewController : OEXRevealContentViewController <UITableViewDataSource, UITableViewDelegate, UICollectionViewDataSource, UICollectionViewDelegate >

- (void)removeAllObserver;
@end


text:
using System;
using NUnit.Framework;

namespace Algorithms.Tests
{
    [TestFixture]
    public class CryptoRandomTests
    {
        [Test]
        public void Next()
        {
            var random = new CryptoRandom();
            int next = -1;
            Assert.DoesNotThrow(() => next = random.Next());
            Assert.That(next, Is.GreaterThanOrEqualTo(0));
        }

        [Test]
        public void Next_maxvalue()
        {
            var random = new CryptoRandom();
            int next = -1;
            Assert.DoesNotThrow(() => next = random.Next(1000));
            Assert.That(next, Is.GreaterThanOrEqualTo(0));
            Assert.That(next, Is.LessThan(1000));

            next = -1;
            Assert.DoesNotThrow(() => next = random.Next(500));
            Assert.That(next, Is.GreaterThanOrEqualTo(0));
            Assert.That(next, Is.LessThan(500));
        }

        [Test]
        public void Next_minvalue_maxvalue()
        {
            var random = new CryptoRandom();
            int next = 0;
            Assert.DoesNotThrow(() => next = random.Next(20, 100));
            Assert.That(next, Is.GreaterThanOrEqualTo(20));
            Assert.That(next, Is.LessThan(100));

            next = 0;
            Assert.DoesNotThrow(() => next = random.Next(-40, -20));
            Assert.That(next, Is.GreaterThanOrEqualTo(-40));
            Assert.That(next, Is.LessThan(-20));
        }

        [Test]
        public void NextBytes()
        {
            var random = new CryptoRandom();
            var buffer = new byte[10];
            Assert.DoesNotThrow(() => random.NextBytes(buffer));
        }

        [Test]
        public void NextDouble()
        {
            var random = new CryptoRandom();
            double next = -1.0;
            Assert.DoesNotThrow(() => next = random.NextDouble());
            Assert.That(next, Is.GreaterThanOrEqualTo(0.0));
            Assert.That(next, Is.LessThanOrEqualTo(1.0));

            next = -1.0;
            Assert.DoesNotThrow(() => next = random.NextDouble());
            Assert.That(next, Is.GreaterThanOrEqualTo(0.0));
            Assert.That(next, Is.LessThanOrEqualTo(1.0));
        }

        [Test]
        public void Sample()
        {
            var random = new CryptoRandom();
            double next = -1.0;
            Assert.DoesNotThrow(() => next = random.NextDouble());
            Assert.That(next, Is.GreaterThanOrEqualTo(0.0));
            Assert.That(next, Is.LessThanOrEqualTo(1.0));

            next = -1.0;
            Assert.DoesNotThrow(() => next = random.NextDouble());
            Assert.That(next, Is.GreaterThanOrEqualTo(0.0));
            Assert.That(next, Is.LessThanOrEqualTo(1.0));
        }
    }
}


text:
/*
 * Created by IntelliJ IDEA.
 * User: amrk
 * Date: Jul 2, 2005
 * Time: 12:16:02 AM
 */
package com.theoryinpractice.testng.configuration;

import com.intellij.diagnostic.logging.LogConfigurationPanel;
import com.intellij.execution.*;
import com.intellij.execution.actions.RunConfigurationProducer;
import com.intellij.execution.configuration.EnvironmentVariablesComponent;
import com.intellij.execution.configurations.*;
import com.intellij.execution.junit.RefactoringListeners;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.testframework.TestSearchScope;
import com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties;
import com.intellij.execution.util.JavaParametersUtil;
import com.intellij.execution.util.ProgramParametersUtil;
import com.intellij.openapi.components.PathMacroManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.options.SettingsEditorGroup;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.refactoring.listeners.RefactoringElementAdapter;
import com.intellij.refactoring.listeners.RefactoringElementListener;
import com.intellij.refactoring.listeners.UndoRefactoringElementListener;
import com.theoryinpractice.testng.model.TestData;
import com.theoryinpractice.testng.model.TestNGConsoleProperties;
import com.theoryinpractice.testng.model.TestNGTestObject;
import com.theoryinpractice.testng.model.TestType;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;

public class TestNGConfiguration extends JavaTestConfigurationBase {
  @NonNls private static final String PATTERNS_EL_NAME = "patterns";
  @NonNls private static final String PATTERN_EL_NAME = "pattern";
  @NonNls private static final String TEST_CLASS_ATT_NAME = "testClass";

  //private TestNGResultsContainer resultsContainer;
  protected TestData data;
  protected transient Project project;
  public boolean ALTERNATIVE_JRE_PATH_ENABLED;
  public String ALTERNATIVE_JRE_PATH;

  public static final String DEFAULT_PACKAGE_NAME = ExecutionBundle.message("default.package.presentable.name");
  public static final String DEFAULT_PACKAGE_CONFIGURATION_NAME = ExecutionBundle.message("default.package.configuration.name");
  private final RefactoringListeners.Accessor<PsiPackage> myPackage = new RefactoringListeners.Accessor<PsiPackage>() {
    public void setName(final String qualifiedName) {
      final boolean generatedName = isGeneratedName();
      data.PACKAGE_NAME = qualifiedName;
      if (generatedName) setGeneratedName();
    }

    @Nullable
    public PsiPackage getPsiElement() {
      final String qualifiedName = data.getPackageName();
      return qualifiedName != null ? JavaPsiFacade.getInstance(getProject()).findPackage(qualifiedName) : null;
    }

    public void setPsiElement(final PsiPackage psiPackage) {
      setName(psiPackage.getQualifiedName());
    }
  };

  private final RefactoringListeners.Accessor<PsiClass> myClass = new RefactoringListeners.Accessor<PsiClass>() {
    public void setName(final String qualifiedName) {
      final boolean generatedName = isGeneratedName();
      data.MAIN_CLASS_NAME = qualifiedName;
      if (generatedName) setGeneratedName();
    }

    @Nullable
    public PsiClass getPsiElement() {
      final String qualifiedName = data.getMainClassName();
      return qualifiedName != null
             ? JavaPsiFacade.getInstance(getProject()).findClass(qualifiedName, GlobalSearchScope.allScope(project))
             : null;
    }

    public void setPsiElement(final PsiClass psiClass) {
      setName(psiClass.getQualifiedName());
    }
  };

  public TestNGConfiguration(String s, Project project, ConfigurationFactory factory) {
    this(s, project, new TestData(), factory);
  }

  protected TestNGConfiguration(String s, Project project, TestData data, ConfigurationFactory factory) {
    super(s, new JavaRunConfigurationModule(project, false), factory);
    this.data = data;
    this.project = project;
  }

  public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
    return new TestNGRunnableState(env, this);
  }

  public TestData getPersistantData() {
    return data;
  }

  @Override
  protected ModuleBasedConfiguration createInstance() {
    return new TestNGConfiguration(getName(), getProject(), data.clone(),
                                   TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
  }

  @Override
  public Collection<Module> getValidModules() {
    //TODO add handling for package
    return JavaRunConfigurationModule.getModulesForClass(getProject(), data.getMainClassName());
  }

  @Override
  public String suggestedName() {
    final TestNGTestObject testObject = TestNGTestObject.fromConfig(this);
    return testObject != null ? testObject.getGeneratedName() : null;
  }

  @Override
  public String getActionName() {
    final TestNGTestObject testObject = TestNGTestObject.fromConfig(this);
    return testObject != null ? testObject.getActionName() : null;
  }

  public void setVMParameters(String value) {
    data.setVMParameters(value);
  }

  public String getVMParameters() {
    return data.getVMParameters();
  }

  public void setProgramParameters(String value) {
    data.setProgramParameters(value);
  }

  public String getProgramParameters() {
    return data.getProgramParameters();
  }

  public void setWorkingDirectory(String value) {
    data.setWorkingDirectory(value);
  }

  public String getWorkingDirectory() {
    return data.getWorkingDirectory(project);
  }

  public void setEnvs(@NotNull Map<String, String> envs) {
    data.setEnvs(envs);
  }

  @NotNull
  public Map<String, String> getEnvs() {
    return data.getEnvs();
  }

  public void setPassParentEnvs(boolean passParentEnvs) {
    data.PASS_PARENT_ENVS = passParentEnvs;
  }

  public boolean isPassParentEnvs() {
    return data.PASS_PARENT_ENVS;
  }

  public boolean isAlternativeJrePathEnabled() {
     return ALTERNATIVE_JRE_PATH_ENABLED;
   }

   public void setAlternativeJrePathEnabled(boolean enabled) {
     this.ALTERNATIVE_JRE_PATH_ENABLED = enabled;
   }

   @Nullable
   public String getAlternativeJrePath() {
     return ALTERNATIVE_JRE_PATH;
   }

   public void setAlternativeJrePath(String path) {
     this.ALTERNATIVE_JRE_PATH = path;
   }

  public String getRunClass() {
    return !data.TEST_OBJECT.equals(TestType.CLASS.getType()) && !data.TEST_OBJECT.equals(TestType.METHOD.getType()) ? null : data.getMainClassName();
  }

  public String getPackage() {
    return !data.TEST_OBJECT.equals(TestType.PACKAGE.getType()) ? null : data.getPackageName();
  }

  public void setClassConfiguration(PsiClass psiclass) {
    setModule(data.setMainClass(psiclass));
    data.TEST_OBJECT = TestType.CLASS.getType();
    setGeneratedName();
  }

  public void setPackageConfiguration(Module module, PsiPackage pkg) {
    data.setPackage(pkg);
    setModule(module);
    data.TEST_OBJECT = TestType.PACKAGE.getType();
    setGeneratedName();
  }

  public void setMethodConfiguration(Location<PsiMethod> location) {
    setModule(data.setTestMethod(location));
    setGeneratedName();
  }

  public void bePatternConfiguration(List<PsiClass> classes, PsiMethod method) {
    data.TEST_OBJECT = TestType.PATTERN.getType();
    final String suffix;
    if (method != null) {
      data.METHOD_NAME = method.getName();
      suffix = "," + data.METHOD_NAME;
    } else {
      suffix = "";
    }
    LinkedHashSet<String> patterns = new LinkedHashSet<String>();
    for (PsiClass pattern : classes) {
      patterns.add(JavaExecutionUtil.getRuntimeQualifiedName(pattern) + suffix);
    }
    data.setPatterns(patterns);
    final Module module = RunConfigurationProducer.getInstance(AbstractTestNGPatternConfigurationProducer.class)
      .findModule(this, getConfigurationModule().getModule(), patterns);
    if (module == null) {
      data.setScope(TestSearchScope.WHOLE_PROJECT);
      setModule(null);
    }
    else {
      setModule(module);
    }
    setGeneratedName();
  }

  @NotNull
  public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
    SettingsEditorGroup<TestNGConfiguration> group = new SettingsEditorGroup<TestNGConfiguration>();
    group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new TestNGConfigurationEditor(getProject()));
    JavaRunConfigurationExtensionManager.getInstance().appendEditors(this, group);
    group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<TestNGConfiguration>());
    return group;
  }

  @Override
  public void checkConfiguration() throws RuntimeConfigurationException {
    final TestNGTestObject testObject = TestNGTestObject.fromConfig(this);
    if (testObject != null) {
      testObject.checkConfiguration();
    }
    JavaRunConfigurationExtensionManager.checkConfigurationIsValid(this);
    ProgramParametersUtil.checkWorkingDirectoryExist(this, getProject(), getConfigurationModule().getModule());
    JavaParametersUtil.checkAlternativeJRE(this);
    //TODO add various checks here
  }

  @Override
  public void readExternal(Element element) throws InvalidDataException {
    PathMacroManager.getInstance(getProject()).expandPaths(element);
    super.readExternal(element);
    JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element);
    readModule(element);
    DefaultJDOMExternalizer.readExternal(this, element);
    DefaultJDOMExternalizer.readExternal(getPersistantData(), element);
    EnvironmentVariablesComponent.readExternal(element, getPersistantData().getEnvs());

    Map<String, String> properties = getPersistantData().TEST_PROPERTIES;
    properties.clear();
    Element propertiesElement = element.getChild("properties");
    if (propertiesElement != null) {
      List<Element> children = propertiesElement.getChildren("property");
      for (Element property : children) {
        properties.put(property.getAttributeValue("name"), property.getAttributeValue("value"));
      }
    }

    List<String> listeners = getPersistantData().TEST_LISTENERS;
    listeners.clear();
    Element listenersElement = element.getChild("listeners");
    if (listenersElement != null) {
      List<Element> children = listenersElement.getChildren("listener");
      for (Element listenerClassName : children) {
        listeners.add(listenerClassName.getAttributeValue("class"));
      }
    }
    final Element patternsElement = element.getChild(PATTERNS_EL_NAME);
    if (patternsElement != null) {
      final LinkedHashSet<String> tests = new LinkedHashSet<String>();
      for (Object o : patternsElement.getChildren(PATTERN_EL_NAME)) {
        Element patternElement = (Element)o;
        tests.add(patternElement.getAttributeValue(TEST_CLASS_ATT_NAME));
      }
      getPersistantData().setPatterns(tests);
    }
  }

  @Override
  public void writeExternal(Element element) throws WriteExternalException {
    super.writeExternal(element);
    JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
    writeModule(element);
    DefaultJDOMExternalizer.writeExternal(this, element);
    DefaultJDOMExternalizer.writeExternal(getPersistantData(), element);
    EnvironmentVariablesComponent.writeExternal(element, getPersistantData().getEnvs());

    Element propertiesElement = element.getChild("properties");

    if (propertiesElement == null) {
      propertiesElement = new Element("properties");
      element.addContent(propertiesElement);
    }

    Map<String, String> properties = getPersistantData().TEST_PROPERTIES;
    for (Map.Entry<String, String> entry : properties.entrySet()) {
      Element property = new Element("property");
      property.setAttribute("name", entry.getKey());
      property.setAttribute("value", entry.getValue());
      propertiesElement.addContent(property);
    }

    Element listenersElement = element.getChild("listeners");
    if (listenersElement == null) {
      listenersElement = new Element("listeners");
      element.addContent(listenersElement);
    }

    List<String> listeners = getPersistantData().TEST_LISTENERS;
    for (String listener : listeners) {
      Element listenerElement = new Element("listener");
      listenerElement.setAttribute("class", listener);
      listenersElement.addContent(listenerElement);
    }
    final Set<String> patterns = getPersistantData().getPatterns();
    if (!patterns.isEmpty()) {
      final Element patternsElement = new Element(PATTERNS_EL_NAME);
      for (String o : patterns) {
        final Element patternElement = new Element(PATTERN_EL_NAME);
        patternElement.setAttribute(TEST_CLASS_ATT_NAME, o);
        patternsElement.addContent(patternElement);
      }
      element.addContent(patternsElement);
    }
  }

  @Nullable
  public RefactoringElementListener getRefactoringElementListener(final PsiElement element) {
    if (data.TEST_OBJECT.equals(TestType.PACKAGE.getType())) {
      if (!(element instanceof PsiPackage)) return null;
      final RefactoringElementListener listener = RefactoringListeners.getListener((PsiPackage)element, myPackage);
      return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener);
    }
    else if (data.TEST_OBJECT.equals(TestType.CLASS.getType())) {
      if (!(element instanceof PsiClass) && !(element instanceof PsiPackage)) return null;
      final RefactoringElementListener listener = RefactoringListeners.getClassOrPackageListener(element, myClass);
      return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener);
    }
    else if (data.TEST_OBJECT.equals(TestType.METHOD.getType())) {
      if (!(element instanceof PsiMethod)) {
        final RefactoringElementListener listener = RefactoringListeners.getClassOrPackageListener(element, myClass);
        return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener);
      }
      final PsiMethod method = (PsiMethod)element;
      if (!method.getName().equals(data.getMethodName())) return null;
      if (!method.getContainingClass().equals(myClass.getPsiElement())) return null;
      class Listener extends RefactoringElementAdapter implements UndoRefactoringElementListener {
        public void elementRenamedOrMoved(@NotNull final PsiElement newElement) {
          data.setTestMethod(PsiLocation.fromPsiElement((PsiMethod)newElement));
        }

        @Override
        public void undoElementMovedOrRenamed(@NotNull PsiElement newElement, @NotNull String oldQualifiedName) {
          final int methodIdx = oldQualifiedName.indexOf("#") + 1;
          if (methodIdx <= 0 || methodIdx >= oldQualifiedName.length()) return;
          data.METHOD_NAME = oldQualifiedName.substring(methodIdx);
        }
      }
      return RunConfigurationExtension.wrapRefactoringElementListener(element, this, new Listener());
    }
    return null;
  }

  @Override
  public boolean collectOutputFromProcessHandler() {
    return false;
  }

  @Override
  public SMTRunnerConsoleProperties createTestConsoleProperties(Executor executor) {
    return new TestNGConsoleProperties(this, executor);
  }

  @NotNull
  @Override
  public String getFrameworkPrefix() {
    return "g";
  }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Web;

namespace BookLibrary.Utilities
{
    /// <summary>
    /// Provides utility methods.
    /// </summary>
    public static class Utility
    {
        public static MailMessage BuildMail(string to, string subject, string body)
        {
            var notifier = GlobalConfigReader.ReadFromLibraryServiceConfig("NotifierEmail", "value");
            var message = new MailMessage();
            message.To.Add(new MailAddress(to));
            message.From = new MailAddress(notifier);
            message.Subject = subject;
            message.Body = body;
            return message;
        }

        public static string BuildAlert(string format, params object[] args)
        {
            var sb = new StringBuilder();
            sb.Append("alert('");
            sb.AppendFormat(format, args);
            sb.Append("');");
            return sb.ToString();
        }

        public static string BuildConfirm(string format, params object[] args)
        {
            var sb = new StringBuilder();
            sb.Append(" return confirm('");
            sb.AppendFormat(format, args);
            sb.Append("'); ");
            return sb.ToString();
        }
    }
}


text:
namespace SolutionsAI.DataInterface.Requests.Implementations.UserRequests
{
    public class CheckIfUserExistsRequest: RequestWithCredentials
    {

    }
}


text:
<!DOCTYPE HTML>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>PageIndicator Tests</title>
<title>PageIndicator Tests</title>

View 1

View 2

View 3

View 4

View 5


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:id="@+id/menui_devs_disconnect" android:title="@string/mnu_devs_disconnect"></item>
    <item android:id="@+id/menui_devs_edit" android:title="@string/mnu_devs_edit"></item>
    <item android:id="@+id/menui_devs_del" android:title="@string/mnu_devs_del"></item>

</menu>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Kooboo.Domain
{
    public interface IEntityCommand
    {
        void Execute();
    }
}


text:
package de.uni_koblenz.schemex.util.maps;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class MultiHashMap<K, V> implements MultiMap<K, V> {

	private Map<K, Set<V>> map;

	public MultiHashMap() {
		map = new HashMap<K, Set<V>>();
	}

	@Override
	public void clear() {
		map.clear();

	}

	@Override
	public boolean containsKey(Object key) {

		return map.containsKey(key);
	}

	@Override
	public Set<Entry<K, Set<V>>> entrySet() {

		return map.entrySet();
	}

	@Override
	public boolean isEmpty() {
		return map.isEmpty();
	}

	@Override
	public Set<K> keySet() {
		return map.keySet();
	}

	@Override
	public void putAll(Map<? extends K,? extends Collection<? extends V>> map) {

		for (Entry<? extends K,? extends  Collection<? extends V>> e : map.entrySet()) {
			K key = e.getKey();
			Collection<? extends V> value = e.getValue();

			Set<V> set = this.map.get(key);
			if (set != null) {
				set.addAll(value);
			} else {
				set = new HashSet<V>();
				set.addAll(value);
				this.map.put(key, set);
			}
		}

	}

	@Override
	public boolean containsValue(Object value) {

		for (Entry<K, Set<V>> e : map.entrySet()) {
			if (e.getValue().contains(value))
				return true;
		}
		return false;
	}

	@Override
	public Collection<V> get(Object key) {

		return map.get(key);
	}

	@Override
	public V put(K key, V value) {

		Set<V> set = map.get(key);

		if (set != null) {
			if (set.add(value))
				return value;
			else
				return null;
		} else {
			set = new HashSet<V>();

			map.put(key, set);
			if (set.add(value))
				return value;
			else
				return null;
		}

	}

	@Override
	public Collection<V> remove(K key) {

		return map.remove(key);
	}

	@Override
	public V remove(K key, V value) {

		Set<V> set = map.get(key);

		if (set != null && set.remove(value))
			return value;
		else
			return null;
	}

	@Override
	public int size() {
		return map.size();
	}

	@Override
	public Collection<V> values() {

		Set<V> set = new HashSet<V>();
		for(Entry<K,Set<V>> e:map.entrySet() )
		{
			set.addAll(e.getValue());
		}
		return set;
	}

}


text:
layout: page
title: Dragon Llc. Party
date: 2016-05-24
author: John Edwards
tags: weekly links, java
status: published
summary: Nullam rutrum purus diam, nec scelerisque libero facilisis ac.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 12/12/2019
  endDate: 12/13/2019
  ctyhocn: RDUCHHX
  groupCode: DLP
published: true
---
In ultrices laoreet purus, in varius erat bibendum in. In ligula felis, ultrices vel ante a, consectetur malesuada ex. Pellentesque sed imperdiet dolor, accumsan venenatis nibh. Sed volutpat pharetra purus, at gravida risus. Suspendisse potenti. Integer ut ante quis leo dignissim pulvinar. Quisque metus eros, lobortis et ultricies vel, bibendum in enim. Sed quam felis, sodales sed vehicula et, congue non sapien. Quisque quam mauris, ultricies eget maximus id, porttitor vel dolor. Vestibulum sem diam, vehicula gravida tellus id, pellentesque sollicitudin nisi. Sed quis consectetur felis, et porttitor elit. Suspendisse mollis augue at nulla lobortis consequat. Donec ultricies gravida viverra.

* Ut non quam ut nisl lacinia volutpat eget a augue
* In ut est luctus, mattis neque at, tempus nulla
* Pellentesque et ipsum maximus, feugiat est at, condimentum mauris
* Donec non mi ornare, congue dui vitae, porttitor magna
* Fusce eu lacus ac lacus suscipit porta tincidunt in massa.

Phasellus euismod facilisis libero id venenatis. Integer posuere tortor non nisl convallis varius. Pellentesque quis nulla sed leo finibus dapibus. Nam eget dui ut orci varius dictum id quis eros. Ut nisl lacus, vulputate aliquam sapien at, commodo tincidunt elit. Fusce vel convallis erat, a consequat augue. Nam eget neque sollicitudin purus lobortis semper at viverra elit. Duis non nunc ac urna convallis pharetra in sed enim.
Fusce mattis elementum felis congue consectetur. Vivamus placerat egestas neque vitae tempus. Vestibulum turpis lacus, commodo ut lorem euismod, vestibulum tempor ex. Etiam a quam vitae augue mattis consectetur. Sed scelerisque dapibus nibh, et convallis sapien suscipit ut. Mauris fermentum facilisis ex et iaculis. Suspendisse sollicitudin libero tortor, eget egestas urna commodo vitae. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce vel sem dui.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boln Soc. argent. Bot. 4(3): 173 (1952)

#### Original name
Puccinia ruelliicola J.C. Lindq.

### Remarks
null


text:
package com.zheng.cms.dao.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class CmsMenuExample implements Serializable {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    private static final long serialVersionUID = 1L;

    public CmsMenuExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria implements Serializable {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andMenuIdIsNull() {
            addCriterion("menu_id is null");
            return (Criteria) this;
        }

        public Criteria andMenuIdIsNotNull() {
            addCriterion("menu_id is not null");
            return (Criteria) this;
        }

        public Criteria andMenuIdEqualTo(Integer value) {
            addCriterion("menu_id =", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdNotEqualTo(Integer value) {
            addCriterion("menu_id <>", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdGreaterThan(Integer value) {
            addCriterion("menu_id >", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("menu_id >=", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdLessThan(Integer value) {
            addCriterion("menu_id <", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdLessThanOrEqualTo(Integer value) {
            addCriterion("menu_id <=", value, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdIn(List<Integer> values) {
            addCriterion("menu_id in", values, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdNotIn(List<Integer> values) {
            addCriterion("menu_id not in", values, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdBetween(Integer value1, Integer value2) {
            addCriterion("menu_id between", value1, value2, "menuId");
            return (Criteria) this;
        }

        public Criteria andMenuIdNotBetween(Integer value1, Integer value2) {
            addCriterion("menu_id not between", value1, value2, "menuId");
            return (Criteria) this;
        }

        public Criteria andPidIsNull() {
            addCriterion("pid is null");
            return (Criteria) this;
        }

        public Criteria andPidIsNotNull() {
            addCriterion("pid is not null");
            return (Criteria) this;
        }

        public Criteria andPidEqualTo(Integer value) {
            addCriterion("pid =", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidNotEqualTo(Integer value) {
            addCriterion("pid <>", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidGreaterThan(Integer value) {
            addCriterion("pid >", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidGreaterThanOrEqualTo(Integer value) {
            addCriterion("pid >=", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidLessThan(Integer value) {
            addCriterion("pid <", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidLessThanOrEqualTo(Integer value) {
            addCriterion("pid <=", value, "pid");
            return (Criteria) this;
        }

        public Criteria andPidIn(List<Integer> values) {
            addCriterion("pid in", values, "pid");
            return (Criteria) this;
        }

        public Criteria andPidNotIn(List<Integer> values) {
            addCriterion("pid not in", values, "pid");
            return (Criteria) this;
        }

        public Criteria andPidBetween(Integer value1, Integer value2) {
            addCriterion("pid between", value1, value2, "pid");
            return (Criteria) this;
        }

        public Criteria andPidNotBetween(Integer value1, Integer value2) {
            addCriterion("pid not between", value1, value2, "pid");
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("name is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("name is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(String value) {
            addCriterion("name =", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(String value) {
            addCriterion("name <>", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(String value) {
            addCriterion("name >", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(String value) {
            addCriterion("name >=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThan(String value) {
            addCriterion("name <", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(String value) {
            addCriterion("name <=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLike(String value) {
            addCriterion("name like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotLike(String value) {
            addCriterion("name not like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameIn(List<String> values) {
            addCriterion("name in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<String> values) {
            addCriterion("name not in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameBetween(String value1, String value2) {
            addCriterion("name between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(String value1, String value2) {
            addCriterion("name not between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andUrlIsNull() {
            addCriterion("url is null");
            return (Criteria) this;
        }

        public Criteria andUrlIsNotNull() {
            addCriterion("url is not null");
            return (Criteria) this;
        }

        public Criteria andUrlEqualTo(String value) {
            addCriterion("url =", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlNotEqualTo(String value) {
            addCriterion("url <>", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlGreaterThan(String value) {
            addCriterion("url >", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlGreaterThanOrEqualTo(String value) {
            addCriterion("url >=", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlLessThan(String value) {
            addCriterion("url <", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlLessThanOrEqualTo(String value) {
            addCriterion("url <=", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlLike(String value) {
            addCriterion("url like", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlNotLike(String value) {
            addCriterion("url not like", value, "url");
            return (Criteria) this;
        }

        public Criteria andUrlIn(List<String> values) {
            addCriterion("url in", values, "url");
            return (Criteria) this;
        }

        public Criteria andUrlNotIn(List<String> values) {
            addCriterion("url not in", values, "url");
            return (Criteria) this;
        }

        public Criteria andUrlBetween(String value1, String value2) {
            addCriterion("url between", value1, value2, "url");
            return (Criteria) this;
        }

        public Criteria andUrlNotBetween(String value1, String value2) {
            addCriterion("url not between", value1, value2, "url");
            return (Criteria) this;
        }

        public Criteria andTargetIsNull() {
            addCriterion("target is null");
            return (Criteria) this;
        }

        public Criteria andTargetIsNotNull() {
            addCriterion("target is not null");
            return (Criteria) this;
        }

        public Criteria andTargetEqualTo(String value) {
            addCriterion("target =", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetNotEqualTo(String value) {
            addCriterion("target <>", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetGreaterThan(String value) {
            addCriterion("target >", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetGreaterThanOrEqualTo(String value) {
            addCriterion("target >=", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetLessThan(String value) {
            addCriterion("target <", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetLessThanOrEqualTo(String value) {
            addCriterion("target <=", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetLike(String value) {
            addCriterion("target like", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetNotLike(String value) {
            addCriterion("target not like", value, "target");
            return (Criteria) this;
        }

        public Criteria andTargetIn(List<String> values) {
            addCriterion("target in", values, "target");
            return (Criteria) this;
        }

        public Criteria andTargetNotIn(List<String> values) {
            addCriterion("target not in", values, "target");
            return (Criteria) this;
        }

        public Criteria andTargetBetween(String value1, String value2) {
            addCriterion("target between", value1, value2, "target");
            return (Criteria) this;
        }

        public Criteria andTargetNotBetween(String value1, String value2) {
            addCriterion("target not between", value1, value2, "target");
            return (Criteria) this;
        }

        public Criteria andOrdersIsNull() {
            addCriterion("orders is null");
            return (Criteria) this;
        }

        public Criteria andOrdersIsNotNull() {
            addCriterion("orders is not null");
            return (Criteria) this;
        }

        public Criteria andOrdersEqualTo(Long value) {
            addCriterion("orders =", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersNotEqualTo(Long value) {
            addCriterion("orders <>", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersGreaterThan(Long value) {
            addCriterion("orders >", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersGreaterThanOrEqualTo(Long value) {
            addCriterion("orders >=", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersLessThan(Long value) {
            addCriterion("orders <", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersLessThanOrEqualTo(Long value) {
            addCriterion("orders <=", value, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersIn(List<Long> values) {
            addCriterion("orders in", values, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersNotIn(List<Long> values) {
            addCriterion("orders not in", values, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersBetween(Long value1, Long value2) {
            addCriterion("orders between", value1, value2, "orders");
            return (Criteria) this;
        }

        public Criteria andOrdersNotBetween(Long value1, Long value2) {
            addCriterion("orders not between", value1, value2, "orders");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria implements Serializable {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion implements Serializable {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text:
/* eslint complexity: 0*/
'use strict';
const render = require('../render');
const getFocused = require('../getFocused');
const cmdStart = require('../cmdStart');
const cmdStop = require('../cmdStop');
const cmdClear = require('../cmdClear');
const cmdFocus = require('../cmdFocus');
const cmdHelp = require('../cmdHelp');
const cmdExit = require('../cmdExit');
const cmdNative = require('../cmdNative');
const cmdInvalid = require('../cmdInvalid');
const isValidPackageName = require('../isValidPackageName');

const COMMANDS = {
	CLEAR: 'clear',
	FOCUS: 'focus',
	EXIT: 'exit',
	HELP: 'help',
	START: 'start',
	STOP: 'stop',
};

const isValidCmd = cmd => {
	return Boolean(Object.keys(COMMANDS).indexOf(cmd.toUpperCase()) >= 0);
};

/**
 * @param {string} cmd - the user entered command
 * @returns {boolean} returns true if packageName is a part of packagePath
 **/
function executeCmd(cmd) {
	if (typeof cmd !== 'string' || cmd === '') {
		return;
	}

	const cmdSpl = cmd
		.trim()
		.replace(/\n|\t/g, '')
		.split(' ');

	const focusedPackageName = getFocused();
	const _isValidCmd = isValidCmd(cmdSpl[0]);

	// focus shortcut
	if (!_isValidCmd && cmdSpl.length === 1 && isValidPackageName(cmdSpl[0])) {
		cmdFocus(cmdSpl[0], render);
		return;
	}

	const COMMAND_EXCECUTE_MAP = {
		CLEAR: cmdClear,
		FOCUS: cmdFocus,
		EXIT: cmdExit,
		HELP: cmdHelp,
		START: cmdStart,
		STOP: cmdStop,
	};

	if (focusedPackageName) {
		// run native cmd on child_process for example 'npm run test' in case of a child_process is focused
		if (!_isValidCmd) {
			cmdNative(cmd, focusedPackageName, render);
			return;
		}

		// run cmd on child_process in case of a child_process is focused
		// lerna-terminal/utils~$ start
		COMMAND_EXCECUTE_MAP[cmdSpl[0].toUpperCase()](focusedPackageName, render);
		return;
	}

	if (_isValidCmd) {
		// run cmd on all child_processes in case of not focused and without packageName in cmd
		// lerna-terminal~$ start
		if (cmdSpl.length === 1) {
			COMMAND_EXCECUTE_MAP[cmdSpl[0].toUpperCase()](undefined, render);
			return;
		}

		// run cmd on given child_process (described with second argument)
		// lerna-terminal~$ start utils
		COMMAND_EXCECUTE_MAP[cmdSpl[0].toUpperCase()](cmdSpl[1], render);
		return;
	}

	// invalid command will be ignored
	cmdInvalid(render, cmd);
}

module.exports = executeCmd;
module.exports.COMMANDS = COMMANDS;