text:
=============

*THIS MODULE IS DEPRECATED AS MONGO-EXPRESS RUNS FROM CLI.* See mongo-express for info.

A simple module to wrap [mongo-express] and enable starting it globally with a single command.
It will start an Express server and provide you with a web-based admin interface for your MongoDB installation.

[![Build Status](https://travis-ci.org/djordjelacmanovic/manage-mongo.svg)](https://travis-ci.org/djordjelacmanovic/manage-mongo)

[![NPM](https://nodei.co/npm/manage-mongo.png)](https://nodei.co/npm/manage-mongo/)

Description
-----

I created this module so mongo-express can be started from the command line easily.
Default configuration of mongo-express should be sufficient for most people so I only added the option to set the port at command line.
If you however wish to configure it further - see below.

Requirements
-----

You need MongoDB installed. (duh!)

Usage
-----

**To install:**

    npm install manage-mongo -g

**To configure:**
Run

    manage-mongo -h

to see advanced configuration instructions

**To run:**
```
Usage: manage-mongo [options]
  General options:
    -h : Displays this message with advanced configuration details
    -p : Sets the port at which to listen to (e.g. manage-mongo -p 1337).
         If unset defaults to the value set in mongo-express config file
         (default is 8081).
```

**To use:**

Visit `http://localhost:8081` or whatever port you entered into your config/CLI.

Contributing
------
This is a fairly simple module and if you find it lacks some functionality you may wish to implement - please do fork and generate a pull request.
If you add any new functionality please write tests and make sure all pass before submitting a pull request.

Credits
------
Big thanks to [andzdroid] for creating the [mongo-express] module which was a basis for this module and a great help to me with dev work with MongoDB.

License
-------
MIT License

Copyright (c) 2015 Djordje Lacmanovic

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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

[andzdroid]: https://github.com/andzdroid
[mongo-express]: https://www.npmjs.com/package/mongo-express


text:
namespace Kombit.Samples.Common.WSTrust13
{
    /// <summary>
    /// Defines contants for WSTrust messages
    /// </summary>
    public static class Constants
    {
        /// <summary>
        /// Key types
        /// </summary>
        public static class KeyTypes
        {
            /// <summary>
            /// Indicates that a request wants to use Asymmetric key
            /// </summary>
            public const string Asymmetric = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey";

            /// <summary>
            /// Indicates that a request wants to use bearer key
            /// </summary>
            public const string Bearer = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer";

            /// <summary>
            /// Indicates that a request wants to use Symmetric key
            /// </summary>
            public const string Symmetric = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey";
        }

        /// <summary>
        /// Token types
        /// </summary>
        public static class TokenTypes
        {
            /// <summary>
            /// Saml 1.1 token
            /// </summary>
            public const string OasisWssSaml11TokenProfile11 = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1";

            /// <summary>
            /// Saml 2.0 token
            /// </summary>
            public const string OasisWssSaml2TokenProfile11 = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0";

            /// <summary>
            /// Saml assertion 1.0
            /// </summary>
            public const string Saml11TokenProfile11 = "urn:oasis:names:tc:SAML:1.0:assertion";

            /// <summary>
            /// Saml assertion 2.0
            /// </summary>
            public const string Saml2TokenProfile11 = "urn:oasis:names:tc:SAML:2.0:assertion";
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.google.gwt.inject.rebind.binding;

import com.google.gwt.inject.rebind.reflect.MethodLiteral;
import com.google.gwt.inject.rebind.reflect.NoSourceNameException;
import com.google.gwt.inject.rebind.util.GuiceUtil;
import com.google.gwt.inject.rebind.util.InjectorMethod;
import com.google.gwt.inject.rebind.util.MethodCallUtil;
import com.google.gwt.inject.rebind.util.NameGenerator;
import com.google.gwt.inject.rebind.util.Preconditions;
import com.google.gwt.inject.rebind.util.SourceSnippet;
import com.google.gwt.inject.rebind.util.SourceSnippetBuilder;

import java.lang.reflect.Constructor;
import java.util.List;

/**
 * A binding that calls a single constructor directly. Values for constructor
 * parameters are retrieved by going back through the injector.
 */
public class CallConstructorBinding extends CreatorBinding {

  private final MethodLiteral<?, Constructor<?>> constructor;
  private final MethodCallUtil methodCallUtil;

  CallConstructorBinding(GuiceUtil guiceUtil, MethodLiteral<?, Constructor<?>> constructor,
      MethodCallUtil methodCallUtil) {
    super(guiceUtil, constructor.getDeclaringType(),
          Context.format("Implicit binding for %s", constructor.getDeclaringType()));
    this.constructor = Preconditions.checkNotNull(constructor);
    this.methodCallUtil = methodCallUtil;
    addParamTypes(constructor);
  }

  @Override protected SourceSnippet getCreationStatement(NameGenerator nameGenerator,
      List<InjectorMethod> methodsOutput) throws NoSourceNameException {
    return new SourceSnippetBuilder()
        .append(getTypeName()).append(" result = ")
        .append(
            methodCallUtil.createConstructorInjection(constructor, nameGenerator, methodsOutput))
        .build();
  }
}


text:
@implementation SGTutorialViewController
@synthesize navController;

#define NUM_PAGES   9

#pragma mark - Selectors

-(void)back {
    [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}

-(void)previousImage {
    if ([[next title] isEqualToString:@"Done!"]) {
        next.title = @"Next";
    }
    _index--;
    if (_index == 0) {
        previous.enabled = NO;
    }
    NSString *imgName = [_imageNames objectAtIndex:_index];
    UIImage *img = [UIImage imageNamed:imgName];
    [_imageController.imageView setImage:img];
}

-(void)nextImage {
    if ([[next title] isEqualToString:@"Done!"]) {
        [self back];
        return;
    }

    previous.enabled = YES;
    _index++;
    if (_index >= NUM_PAGES-1) {
        next.title = @"Done!";
    }

    NSString *imgName = [_imageNames objectAtIndex:_index];
    UIImage *img = [UIImage imageNamed:imgName];
    [_imageController.imageView setImage:img];
}

#pragma mark - View Lifecycle

- (void)viewDidLoad {
    [super viewDidLoad];
    _index = 0;
    _imageNames = [[NSArray alloc] initWithObjects:@"page1.png", @"page2.png", @"page3.png", @"page4.png", @"page5.png", @"page6.png", @"page7.png", @"page8.png", @"page9.png", nil];
    _imageController = [[SGImageViewController alloc] initWithNibName:@"SGImageViewController" bundle:nil];
    self.navController = [[[UINavigationController alloc] initWithRootViewController:_imageController] autorelease];

    self.navController.navigationBarHidden = NO;
    self.navController.view.frame = CGRectMake(0, 0, 320, 460);
    self.navController.navigationBar.frame = CGRectMake(0, 0, 320.0f, 44.0f);
    self.navController.navigationBar.barStyle = UIBarStyleBlack;
    self.navController.navigationBar.tintColor = [UIColor colorWithRed:RGBA_BAR_COLORS[0]
                                                            green:RGBA_BAR_COLORS[1]
                                                             blue:RGBA_BAR_COLORS[2]
                                                            alpha:RGBA_BAR_COLORS[3]];

    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:@"Back"
                                                             style:UIBarButtonItemStylePlain
                                                            target:self
                                                            action:@selector(back)];
    previous = [[UIBarButtonItem alloc] initWithTitle:@"Previous"
                                                style:UIBarButtonItemStylePlain
                                                target:self
                                                action:@selector(previousImage)];

    next = [[UIBarButtonItem alloc] initWithTitle:@"Next"
                                            style:UIBarButtonItemStylePlain
                                            target:self
                                            action:@selector(nextImage)];

    self.navController.navigationBar.topItem.title = @"";
    self.navController.navigationBar.topItem.rightBarButtonItems = [NSArray arrayWithObjects:next, previous, nil];
    self.navController.navigationBar.topItem.leftBarButtonItem = back;

    [back release];

    previous.enabled = NO;

    [self.view addSubview:self.navController.view];
}

#pragma mark - Memory Management

-(void)dealloc {
    [previous release];
    [next release];
    [_imageNames release];
    [_imageController release];
    self.navController = nil;
    [super dealloc];
}

@end


text:
#include "config.h"
#include "EllipsisBox.h"

#include "Document.h"
#include "Font.h"
#include "GraphicsContext.h"
#include "HitTestResult.h"
#include "InlineTextBox.h"
#include "PaintInfo.h"
#include "RenderBlock.h"
#include "RootInlineBox.h"
#include "TextRun.h"

namespace WebCore {

EllipsisBox::EllipsisBox(RenderBlock& renderer, const AtomicString& ellipsisStr, InlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox)
    : InlineBox(renderer, FloatPoint(0, y), width, firstLine, true, false, false, isVertical, 0, 0, parent)
    , m_shouldPaintMarkupBox(markupBox)
    , m_height(height)
    , m_str(ellipsisStr)
    , m_selectionState(RenderObject::SelectionNone)
{
}

void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
{
    GraphicsContext* context = paintInfo.context;
    RenderStyle* style = renderer().style(isFirstLineStyle());
    Color textColor = style->visitedDependentColor(CSSPropertyWebkitTextFillColor);
    if (textColor != context->fillColor())
        context->setFillColor(textColor, style->colorSpace());
    bool setShadow = false;
    if (style->textShadow()) {
        context->setShadow(LayoutSize(style->textShadow()->x(), style->textShadow()->y()),
                           style->textShadow()->radius(), style->textShadow()->color(), style->colorSpace());
        setShadow = true;
    }

    const Font& font = style->font();
    if (selectionState() != RenderObject::SelectionNone) {
        paintSelection(context, paintOffset, style, font);

        // Select the correct color for painting the text.
        Color foreground = paintInfo.forceBlackText() ? Color::black : renderer().selectionForegroundColor();
        if (foreground.isValid() && foreground != textColor)
            context->setFillColor(foreground, style->colorSpace());
    }

    // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
    context->drawText(font, RenderBlock::constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), LayoutPoint(x() + paintOffset.x(), y() + paintOffset.y() + style->fontMetrics().ascent()));

    // Restore the regular fill color.
    if (textColor != context->fillColor())
        context->setFillColor(textColor, style->colorSpace());

    if (setShadow)
        context->clearShadow();

    paintMarkupBox(paintInfo, paintOffset, lineTop, lineBottom, style);
}

InlineBox* EllipsisBox::markupBox() const
{
    if (!m_shouldPaintMarkupBox)
        return 0;

    RootInlineBox* lastLine = renderer().lineAtIndex(renderer().lineCount() - 1);
    if (!lastLine)
        return 0;

    // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
    // It does not actually move the link.
    InlineBox* anchorBox = lastLine->lastChild();
    if (!anchorBox || !anchorBox->renderer().style()->isLink())
        return 0;

    return anchorBox;
}

void EllipsisBox::paintMarkupBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle* style)
{
    InlineBox* markupBox = this->markupBox();
    if (!markupBox)
        return;

    LayoutPoint adjustedPaintOffset = paintOffset;
    adjustedPaintOffset.move(x() + m_logicalWidth - markupBox->x(),
        y() + style->fontMetrics().ascent() - (markupBox->y() + markupBox->renderer().style(isFirstLineStyle())->fontMetrics().ascent()));
    markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
}

IntRect EllipsisBox::selectionRect()
{
    RenderStyle* style = renderer().style(isFirstLineStyle());
    const Font& font = style->font();
    const RootInlineBox& rootBox = root();
    // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
    return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x(), y() + rootBox.selectionTopAdjustedForPrecedingBlock()), rootBox.selectionHeightAdjustedForPrecedingBlock()));
}

void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, RenderStyle* style, const Font& font)
{
    Color textColor = style->visitedDependentColor(CSSPropertyColor);
    Color c = renderer().selectionBackgroundColor();
    if (!c.isValid() || !c.alpha())
        return;

    // If the text color ends up being the same as the selection background, invert the selection
    // background.
    if (textColor == c)
        c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());

    const RootInlineBox& rootBox = root();
    LayoutUnit top = rootBox.selectionTop();
    LayoutUnit h = rootBox.selectionHeight();
    FloatRect clipRect(x() + paintOffset.x(), top + paintOffset.y(), m_logicalWidth, h);
    alignSelectionRectToDevicePixels(clipRect);

    GraphicsContextStateSaver stateSaver(*context);
    context->clip(clipRect);
    // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
    context->drawHighlightForText(font, RenderBlock::constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), roundedIntPoint(LayoutPoint(x() + paintOffset.x(), y() + paintOffset.y() + top)), h, c, style->colorSpace());
}

bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
{
    LayoutPoint adjustedLocation = accumulatedOffset + roundedLayoutPoint(topLeft());

    // Hit test the markup box.
    if (InlineBox* markupBox = this->markupBox()) {
        RenderStyle* style = renderer().style(isFirstLineStyle());
        LayoutUnit mtx = adjustedLocation.x() + m_logicalWidth - markupBox->x();
        LayoutUnit mty = adjustedLocation.y() + style->fontMetrics().ascent() - (markupBox->y() + markupBox->renderer().style(isFirstLineStyle())->fontMetrics().ascent());
        if (markupBox->nodeAtPoint(request, result, locationInContainer, LayoutPoint(mtx, mty), lineTop, lineBottom)) {
            renderer().updateHitTestResult(result, locationInContainer.point() - LayoutSize(mtx, mty));
            return true;
        }
    }

    LayoutRect boundsRect(adjustedLocation, LayoutSize(m_logicalWidth, m_height));
    if (visibleToHitTesting() && boundsRect.intersects(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) {
        renderer().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
        if (!result.addNodeToRectBasedTestResult(renderer().element(), request, locationInContainer, boundsRect))
            return true;
    }

    return false;
}

} // namespace WebCore


text:
package com.ecyshor.cassmig;

import com.datastax.driver.core.KeyspaceMetadata;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.querybuilder.Insert;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.core.querybuilder.Select;
import com.ecyshor.cassmig.mappings.MigrationMapper;
import com.ecyshor.cassmig.model.AppliedMigration;
import com.ecyshor.cassmig.model.MigrationFile;
import com.google.common.collect.Lists;

import java.util.List;

import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;

public class MigrationDAO {

	public static final String MIGRATIONS_TABLE = "migrations";

	private Session session;

	public MigrationDAO(Session session) {
		this.session = session;
	}

	public List<AppliedMigration> getAppliedMigrations(String keyspace, String schema) {
		KeyspaceMetadata keyspaceMetadata = session.getCluster().getMetadata().getKeyspace(keyspace);
		if (keyspaceMetadata != null) {
			if (keyspaceMetadata.getTable(MIGRATIONS_TABLE) != null) {
				Select.Where migrationQuery = QueryBuilder.select().from(keyspace, MIGRATIONS_TABLE).where(eq("migration_schema", schema));
				List<Row> allMigrations = session.execute(migrationQuery).all();
				return MigrationMapper.map(allMigrations);
			}
		}
		return Lists.newArrayList();
	}

	public void applyMigration(MigrationFile migrationFile) {
		List<String> commands = migrationFile.getCommands();
		for (String command : commands) {
			session.execute(command);
		}
	}

	public void saveMigrationAsApplied(AppliedMigration appliedMigration, String keyspace) {
		Insert migrationQuery = QueryBuilder.insertInto(keyspace, MIGRATIONS_TABLE).value("migration_schema", appliedMigration.getSchema())
				.value("migration_order", appliedMigration.getOrder()).value("time_executed", appliedMigration.getTimeExecutedAsJavaDate())
				.value("md5sum", appliedMigration.getMd5Sum());
		session.execute(migrationQuery);
	}

}


text:
//AUTOGENERATED, DO NOTMODIFY.
//Do not edit this file directly.

#pragma warning disable 1591
// ReSharper disable CheckNamespace

using System;
using RethinkDb.Driver.Ast;
using RethinkDb.Driver.Model;
using RethinkDb.Driver.Proto;
using System.Collections.Generic;

namespace RethinkDb.Driver.Ast {

    public class Wednesday : ReqlExpr {

        public Wednesday (object arg) : this(new Arguments(arg), null) {
        }
        public Wednesday (Arguments args) : this(args, null) {
        }
        public Wednesday (Arguments args, OptArgs optargs)
             : this(TermType.WEDNESDAY, args, optargs) {
        }

    protected Wednesday (TermType termType, Arguments args, OptArgs optargs) : base(termType, args, optargs)
    {
    }

    }
}


text:
package com.damjanvantur.blagajna;

import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;

@Provider
@Produces(MediaType.APPLICATION_JSON)
public class JacksonConfig implements ContextResolver<ObjectMapper>{

	private final ObjectMapper mapper = new ObjectMapper();

	@SuppressWarnings("deprecation")
	public JacksonConfig(){
        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
        mapper.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
        mapper.configure(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS , true);
        mapper.configure(SerializationConfig.Feature.WRITE_NULL_PROPERTIES , false);
        mapper.configure(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true);
        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        mapper.setDateFormat(Commons.getDateFormatter());
    }

    @Override
    public ObjectMapper getContext(Class<?> objectType){
        return mapper;
    }

}


text:
//-----------------------------------------------------------------------
// <copyright file="MeasureMapExtensions.cs" company="Emerging Media Group">
// Copyright 2012-2013 Rare Crowds, Inc.
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using ConfigManager;
using DataAccessLayer;
using DeliveryNetworkUtilities;
using Diagnostics;
using DynamicAllocation;
using DynamicAllocationUtilities;
using GoogleDfpActivities.Measures;
using Dfp = Google.Api.Ads.Dfp.v201206;

namespace GoogleDfpActivities
{
    ///
    /// Extensions for getting/setting AppNexus specific properties from DA measures
    ///
    public static class MeasureMapExtensions
    {
        /// Gets the Google DFP AdUnitIds
        /// <param name="this">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <returns>The include AdUnitIds</returns>
        public static string[] GetDfpAdUnitIds(this MeasureMap @this, MeasureSet measureSet)
        {
            return GetDfpMeasures(@this, measureSet, AdUnitMeasureSource.TargetingType)
                .Select(measure =>
                    @this.GetNumericValueForMeasure(measure, DfpMeasureValues.DfpId))
                .Select(adUnitId => adUnitId.ToString(CultureInfo.InvariantCulture))
                .ToArray();
        }

        /// Gets the Google DFP placement ids
        /// <param name="this">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <returns>The placement ids</returns>
        public static long[] GetDfpPlacementIds(this MeasureMap @this, MeasureSet measureSet)
        {
            return GetDfpMeasures(@this, measureSet, PlacementMeasureSource.TargetingType)
                .Select(measure =>
                    @this.GetNumericValueForMeasure(measure, DfpMeasureValues.DfpId))
                .ToArray();
        }

        /// Gets the Google DFP targeted locations
        /// <param name="this">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <returns>The location ids</returns>
        public static long[] GetDfpLocationsIds(this MeasureMap @this, MeasureSet measureSet)
        {
            return GetDfpMeasures(@this, measureSet, LocationMeasureSource.TargetingType)
                .Select(measure =>
                    @this.GetNumericValueForMeasure(measure, DfpMeasureValues.DfpId))
                .ToArray();
        }

        /// Gets the Google DFP technology targeting
        /// <param name="this">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <returns>The TechnologyTargeting</returns>
        public static Dfp.TechnologyTargeting GetDfpTechnologyTargeting(this MeasureMap @this, MeasureSet measureSet)
        {
            // Get technology targets as a sequence of technology targeting subtypes and ids
            var technologyTargets = GetTechnologyTargetsFromMeasures(@this, measureSet);
            var targeting = new Dfp.TechnologyTargeting
            {
                bandwidthGroupTargeting = new Dfp.BandwidthGroupTargeting
                {
                    bandwidthGroups = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.Bandwidth)
                },
                browserTargeting = new Dfp.BrowserTargeting
                {
                    browsers = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.Browser)
                },
                browserLanguageTargeting = new Dfp.BrowserLanguageTargeting
                {
                    browserLanguages = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.BrowserLanguage)
                },
                deviceCapabilityTargeting = new Dfp.DeviceCapabilityTargeting
                {
                    targetedDeviceCapabilities = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.DeviceCapability)
                },
                deviceManufacturerTargeting = new Dfp.DeviceManufacturerTargeting
                {
                    deviceManufacturers = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.DeviceManufacturer)
                },
                mobileCarrierTargeting = new Dfp.MobileCarrierTargeting
                {
                    mobileCarriers = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.MobileCarrier)
                },
                mobileDeviceSubmodelTargeting = new Dfp.MobileDeviceSubmodelTargeting
                {
                    targetedMobileDeviceSubmodels = GetTechnologySubTypeTargets(
                       technologyTargets,
                       TechnologyMeasureSubTypes.DeviceSubModel)
                },
                mobileDeviceTargeting = new Dfp.MobileDeviceTargeting
                {
                    targetedMobileDevices = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.DeviceModel)
                },
                operatingSystemTargeting = new Dfp.OperatingSystemTargeting
                {
                    operatingSystems = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.OperatingSystem)
                },
                operatingSystemVersionTargeting = new Dfp.OperatingSystemVersionTargeting
                {
                    targetedOperatingSystemVersions = GetTechnologySubTypeTargets(
                        technologyTargets,
                        TechnologyMeasureSubTypes.OperatingSystemVersion)
                }
            };

            return targeting;
        }

        ///
        /// Gets the DFP targeting measures of the specified DFP targeting type
        ///
        /// <param name="measureMap">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <param name="dfpMeasureType">DFP measure type</param>
        /// <returns>The DFP measures</returns>
        private static IEnumerable<long> GetDfpMeasures(
            MeasureMap measureMap,
            MeasureSet measureSet,
            string dfpMeasureType)
        {
            return measureSet
                .Where(measure => measureMap.GetMeasureType(measure) == dfpMeasureType);
        }

        ///
        /// Gets a sequence of DFP technology subtype/id tuples from a measure map and measure set
        ///
        /// <param name="measureMap">The MeasureMap</param>
        /// <param name="measureSet">The MeasureSet</param>
        /// <returns>Sequence of DFP technology subtype/id tuples</returns>
        private static IEnumerable<Tuple<string, long>> GetTechnologyTargetsFromMeasures(
            MeasureMap measureMap,
            MeasureSet measureSet)
        {
            return GetDfpMeasures(measureMap, measureSet, TechnologyMeasureSource.TargetingType)
                .Select(measure =>
                    new Tuple<string, long>(
                        measureMap.GetStringValueForMeasure(measure, MeasureValues.SubType),
                        measureMap.GetNumericValueForMeasure(measure, DfpMeasureValues.DfpId)));
        }

        /// Gets an array of DFP Technology targets for the specified subtype
        /// <param name="technologyTargets">Sequence of subtype/id technology target tuples</param>
        /// <param name="technologySubType">The subtype to include</param>
        /// <returns>Array of DFP Technology targets</returns>
        private static Dfp.Technology[] GetTechnologySubTypeTargets(
            IEnumerable<Tuple<string, long>> technologyTargets,
            string technologySubType)
        {
            return technologyTargets
                .Where(techTarget => techTarget.Item1 == technologySubType)
                .Select(techTarget => new Dfp.Technology { id = techTarget.Item2 })
                .ToArray();
        }
    }
}


text:
'use strict';
require('mocha');
require('co-mocha');
const chai = require('chai');
const assert = require('chai').assert;

const r = require('rethinkdbdash')({
    db: process.env.MCDB || 'materialscommons',
    port: process.env.MCDB_PORT || 30815
});

const backend_base = '../../../..';
const dbModelUsers = require(backend_base + '/servers/mcapi/db/model/users');
const projects = require(backend_base + '/servers/mcapi/db/model/projects');
const directories = require(backend_base + '/servers/mcapi/db/model/directories');

const base_user_id = 'thisIsAUserForTestingONLY!';
const fullname = "Test User";
const base_project_name = "Test project - test 1: ";

let random_name = function () {
    let number = Math.floor(Math.random() * 10000);
    return base_project_name + number;
};

let random_user = function () {
    let number = Math.floor(Math.random() * 10000);
    return base_user_id + number + "@mc.org";
};

let user1Id = random_user();

before(function* () {
    console.log('before templates-spec.js');
    let user = yield dbModelUsers.getUser(user1Id);
    if (!user) {
        let results = yield r.table('users').insert({
            admin: false,
            affiliation: "",
            avatar: "",
            description: "",
            email: user1Id,
            fullname: fullname,
            homepage: "",
            id: user1Id,
            name: fullname,
            preferences: {
                tags: [],
                templates: []
            }
        });
        assert.equal(results.inserted, 1, "The User was correctly inserted");
    } else {
        assert.equal(user.id, user1Id, "Wrong test user, id = " + user.id);
    }
    console.log('done before templates-spec.js');
});

describe('Feature - Templates: ', function () {
    describe('Function level', function () {
        it('individual test level');
    });
});

after(function* () {
    let user = yield dbModelUsers.getUser(user1Id);
    if (user) {
        let results = yield r.table('users').get(user1Id).delete();
        assert.equal(results.deleted, 1, "The User was correctly deleted");
    } else {
        assert.isNull(user, "The user still exists at end");
    }
});


text:
#include "userlist.h"

namespace LSL {

const ConstUserPtr UserList::FindByNick( const std::string& nick ) const
{
    MapType::const_iterator it = find( nick );
    if ( it != end() )
        return it->second;
    return ConstUserPtr();
}

const UserPtr UserList::FindByNick(const std::string &nick)
{
    MapType::const_iterator it = find( nick );
    if ( it != end() )
        return it->second;
    return UserPtr();
}

const ConstCommonUserPtr CommonUserList::FindByNick( const std::string& nick ) const
{
    MapType::const_iterator it = find( nick );
    if ( it != end() )
        return it->second;
    return ConstCommonUserPtr();
}

const CommonUserPtr CommonUserList::FindByNick(const std::string &nick)
{
    MapType::const_iterator it = find( nick );
    if ( it != end() )
        return it->second;
    return CommonUserPtr();
}

}


text:
module Sequel
  module Plugins
    # DefaultsSetter is a simple plugin that sets non-nil/NULL default values upon
    # initialize:
    #
    #   # column a default NULL
    #   # column b default 2
    #   album = Album.new.values # {:b => 2}
    #   album = Album.new(:a=>1, :b=>3).values # {:a => 1, :b => 3}
    #
    # Usage:
    #
    #   # Make all model subclass instances set defaults (called before loading subclasses)
    #   Sequel::Model.plugin :defaults_setter
    #
    #   # Make the Album class set defaults
    #   Album.plugin :defaults_setter
    module DefaultsSetter
      # Set the default values based on the model schema
      def self.configure(model)
        model.send(:set_default_values)
      end

      module ClassMethods
        # The default values to set in initialize for this model.  A hash with column symbol
        # keys and default values.  If the default values respond to +call+, it will be called
        # to get the value, otherwise the value will be used directly.  You can manually modify
        # this hash to set specific default values, by default the ones will be parsed from the database.
        attr_reader :default_values

        # Set the default values when loading the dataset.
        def set_dataset(*)
          x = super
          set_default_values
          x
        end

        private

        # Parse the cached database schema for this model and set the default values appropriately.
        def set_default_values
          h = {}
          @db_schema.each{|k, v| h[k] = convert_default_value(v[:ruby_default]) unless v[:ruby_default].nil?} if @db_schema
          @default_values = h
        end

        # Handle the CURRENT_DATE and CURRENT_TIMESTAMP values specially by returning an appropriate Date or
        # Time/DateTime value.
        def convert_default_value(v)
          case v
          when Sequel::CURRENT_DATE
            lambda{Date.today}
          when Sequel::CURRENT_TIMESTAMP
            lambda{Sequel.datetime_class.now}
          else
            v
          end
        end
      end

      module InstanceMethods
        private

        # Set default values if they are not already set by the hash provided to initialize.
        def initialize_set(h)
          super
          model.default_values.each{|k,v| self[k] = (v.respond_to?(:call) ? v.call : v) unless values.has_key?(k)}
        end
      end
    end
  end
end


text:
package com.myjavacode.jdbc;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;

public class DataOpernation {

	private String jDriver= "com.mysql.jdbc.Driver";
	private String DBinfo= "jdbc:mysql://127.0.0.1:3306/mysqljames";
	private String User= "root";
	private String Passwd= "root";

	private static Connection con = null;
	private ResultSet rs =null;

	public DataOpernation() {  //¹¹Ôì·½·¨Ã»ÓÐÈκεķµ»ØÀàÐÍ

		try {
			Class.forName(jDriver);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.out.println("Init DB failed!");
		}

		try {
			con = (Connection) DriverManager.getConnection(DBinfo, User, Passwd);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.out.println("Connection DB failed, check your user or passwd!");
		}

		System.out.println("DB Connection Succeed");

	}

	public void closeConnection() {
		try {
			if(rs !=null)
			rs.close();
			if(con !=null)
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		System.out.println("DB Connection has been closed!");
	}

	public int insertData(BeanCustomers Data ) {

		int result = 0;
		String sql= "insert into customers values(?,?,?,?,?)"; //·½·¨Öв»ÄÜÓÐprivate\public µÈ·â×°
		try {
			PreparedStatement ps = (PreparedStatement) con.prepareStatement(sql);
			ps.setInt(1, Data.getID());
			ps.setString(2, Data.getName());
			ps.setInt(3, Data.getAge());
			ps.setDate(4, Data.getDOB());
			ps.setString(5, Data.getSex());

			result = ps.executeUpdate();

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		if(result <=0) {
			return -1;
		}

		return 0;
	}

	public BeanCustomers queryData( BeanCustomers Data) {

		String sql = "Select * from customers";

		//ArrayList al = new ArrayList<BeanCustomers>();

		if(Data.getID() >=0 ) sql = sql + " Where id="+  Data.getID() ;
		else if(Data.getName() != null) sql = sql + " Where Name='" + Data.getName()+"'";
		else if(Data.getAge() > 0) sql = sql + " Where Age=" + Data.getAge();
		else if(Data.getDOB() != null) sql = sql + " Where DOB='" + Data.getDOB().toString()+"'";
		else if(Data.getSex() != null) sql = sql + " Where Sex='" + Data.getSex()+"'";
		else {
			return ( new BeanCustomers(0, null, 0, null, null) );
		}

		try {
			PreparedStatement ps = (PreparedStatement) con.prepareStatement(sql);
			rs = ps.executeQuery();
			while(rs.next()) {
				return (new BeanCustomers(
						rs.getInt("ID"), rs.getString("Name"), rs.getInt("Age"),
						rs.getDate("DOB"), rs.getString("Sex")));
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return (new BeanCustomers(0, null, 0, null, null));

	}

}


text:
AsyncTestCase
=============

Extends :code:`unittest.TestCase` to support asynchronous tests. Currently the most common solution is to explicitly run :code:`asyncio.run_until_complete` with test case. Aiounittest :code:`AsyncTestCase` wraps it, to keep the test as clean and simple as possible.

.. autoclass:: aiounittest.AsyncTestCase
   :members: get_event_loop


text:
if [ ! -e /destination ]; then
	echo Map /destination as a volume
	exit 1
fi

echo Copying binaries ...

cp -f /dist/gluon /destination/
chmod a+x /destination/gluon

mkdir -p /destination/overlay
mkdir -p /destination/overlay-work

cp -f /dist/consul* /destination/overlay/
chmod a+x /destination/overlay/consul*

cp -f /dist/certdump /destination/overlay/
chmod a+x /destination/overlay/certdump

cp -f /dist/etcd* /destination/overlay/
chmod a+x /destination/overlay/etcd*

cp -f /dist/rkt/rkt /destination/overlay/
cp -f /dist/rkt/stage1*.aci /destination/overlay/
mkdir -p /destination/overlay/rkt-scripts
cp -f /dist/rkt/setup-data-dir.sh /destination/overlay/rkt-scripts/
chmod a+x /destination/overlay/rkt

cp -f /dist/weave* /destination/overlay/
chmod a+x /destination/overlay/weave*

cp -f /dist/kube* /destination/overlay/
chmod a+x /destination/overlay/kube*

mkdir -p /destination/overlay/cni/bin
cp -f /dist/cni/bin/* /destination/overlay/cni/bin/
chmod a+x /destination/overlay/cni/bin/*


text:
use std::str::FromStr;

use clap::{crate_name, App, AppSettings, Arg, SubCommand};

pub static SUPPORTED_RECORD_TYPES: &[&str] = &[
    "A", "AAAA", "ANAME", "ANY", "CNAME", "MX", "NULL", "NS", "PTR", "SOA", "SRV", "TXT",
];

pub static SUPPORTED_OUTPUT_FORMATS: &[&str] = &["json", "summary"];

pub fn create_parser() -> App<'static, 'static> {
    App::new(crate_name!())
        .version(env!("CARGO_PKG_VERSION"))
        .author(env!("CARGO_PKG_AUTHORS"))
        .about(env!("CARGO_PKG_DESCRIPTION"))
        .global_setting(AppSettings::DeriveDisplayOrder)
        .global_setting(AppSettings::DisableHelpSubcommand)
        .global_setting(AppSettings::GlobalVersion)
        .global_setting(AppSettings::InferSubcommands)
        .global_setting(AppSettings::UnifiedHelpMessage)
        .arg(
            Arg::with_name("use-system-resolv-opt")
                .long("use-system-resolv-opt")
                .help("Uses options set in /etc/resolv.conf")
                .long_help("Uses options set in /etc/resolv.conf and overrides all corresponding CLI options")
    )
        .arg(
            Arg::with_name("no-system-nameservers")
                .long("no-system-nameservers")
                .requires("system nameservers")
                .help("Ignores nameservers from /etc/resolv.conf"),
        )
        .arg(
            Arg::with_name("no-system-lookups")
                .short("S")
                .long("no-system-lookups")
                .help("Ignores system nameservers for lookups"),
        )
        .arg(
            Arg::with_name("resolv-conf")
                .long("resolv-conf")
                .value_name("FILE")
                .takes_value(true)
                .help("Uses alternative resolv.conf file"),
        )
        .arg(
            Arg::with_name("ndots")
                .long("ndots")
                .value_name("NUMBER")
                .default_value("1")
                .validator(|str| u8::from_str(&str).map(|_| ()).map_err(|_| "invalid number".to_string()))
                .help("Sets number of dots to qualify domain name as FQDN"),
        )
        .arg(
            Arg::with_name("search-domain")
                .long("search-domain")
                .value_name("DOMAIN")
                .help("Sets the search domain to append if HOSTNAME has less than ndots dots"),
        )
        .arg(
            Arg::with_name("system nameservers")
                .long("system-nameserver")
                .value_name("IP ADDR")
                .takes_value(true)
                .multiple(true)
                .number_of_values(1)
                .help("Adds system nameserver for system lookups; only IP addresses allowed"),
        )
        .arg(
            Arg::with_name("nameservers")
                .short("s")
                .long("nameserver")
                .value_name("HOSTNAME | IP ADDR")
                .takes_value(true)
                .multiple(true)
                .number_of_values(1)
                .help("Adds nameserver for lookups")
                .long_help(
                    r#"Adds nameserver for lookups. A nameserver may be specified by protocol, hostname or IP address, and port number, delimited by coloons, e.g., udp:dns.google:53. Supported protocols are udp,tcp,tls,https.
Additionally, further parameters like 'tls_auth_name' or 'name' may be added separated by commas. 'tls_auth_name' must be set for protocols 'tls' and 'https' if an IP address is given. If protocol or port number are omitted, the defaults udp and 53 are used, respectively.
Examples:
* 127.0.0.1 is udp:127.0.0.1:53
* ::1 is udp:[::1]:53,name=localhost
* tcp:127.0.0.1 is tcp:127.0.0.1:53
* tls:8.8.8.8:853,tls_auth_name=dns.google,name="Google 1"
* https:[2001:4860:4860::8888]:443,tls_auth_name=dns.google,name="Google 1"

"#),
        )
        .arg(
            Arg::with_name("predefined")
                .short("p")
                .long("predefined")
                .help("Adds predefined nameservers for lookups"),
        )
        .arg(
            Arg::with_name("predefined-filter")
                .long("predefined-filter")
                .value_name("PROTOCOL")
                .multiple(true)
                .use_delimiter(true)
                .require_delimiter(true)
                .default_value("udp")
                .possible_values(&["udp", "tcp", "https", "tls"])
                .default_value_if("predefined", None, "udp")
                .help("Filters predefined nameservers by protocol"),
        )
        .arg(
            Arg::with_name("list-predefined")
                .long("list-predefined")
                .help("Lists all predefined nameservers"),
        )
        .arg(
            Arg::with_name("nameservers-from-file")
                .short("f")
                .long("nameservers-from-file")
                .value_name("FILE")
                .takes_value(true)
                .help("Adds nameservers from file"),
        )
        .arg(
            Arg::with_name("limit")
                .long("limit")
                .value_name("NUMBER")
                .default_value("100")
                .validator(|str| {
                    usize::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets max. number of nameservers to query"),
        )
        .arg(
            Arg::with_name("max-concurrent-servers")
                .long("max-concurrent-servers")
                .value_name("NUMBER")
                .default_value("10")
                .validator(|str| {
                    usize::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets max. concurrent nameservers"),
        )
        .arg(
            Arg::with_name("max-concurrent-requests")
                .long("max-concurrent-requests")
                .value_name("NUMBER")
                .default_value("5")
                .validator(|str| {
                    usize::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets max. concurrent requests per nameserver"),
        )
        .arg(
            Arg::with_name("retries")
                .long("retries")
                .value_name("NUMBER")
                .default_value("0")
                .validator(|str| {
                    usize::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets number of retries if first lookup to nameserver fails"),
        )
        .arg(
            Arg::with_name("timeout")
                .long("timeout")
                .value_name("TIMEOUT")
                .default_value("5")
                .validator(|str| {
                    u64::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets timeout in seconds for responses"),
        )
        .arg(
            Arg::with_name("resolvers-mode")
                .short("m")
                .long("resolvers-mode")
                .value_name("MODE")
                .default_value("multi")
                .possible_values(&["multi", "uni"])
                .help("Sets resolvers lookup mode")
                .long_help(r#"Sets resolvers mode
* multi: Each query is sent to all available name servers
* uni: Each query is send to exactly on name server
"#
    )
        )
        .arg(
            Arg::with_name("wait-multiple-responses")
                .long("wait-multiple-responses")
                .help("Waits until timeout for additional responses from nameservers"),
        )
        .arg(
            Arg::with_name("no-abort-on-error")
                .long("no-abort-on-error")
                .help("Sets do-not-ignore errors from nameservers"),
        )
        .arg(
            Arg::with_name("no-abort-on-timeout")
                .long("no-abort-on-timeout")
                .help("Sets do-not-ignore timeouts from nameservers"),
        )
        .arg(
            Arg::with_name("no-aborts")
                .long("no-aborts")
                .help("Sets do-not-ignore errors and timeouts from nameservers"),
        )
        .arg(
            Arg::with_name("output")
                .short("o")
                .long("output")
                .value_name("FORMAT")
                .takes_value(true)
                .default_value("summary")
                .possible_values(SUPPORTED_OUTPUT_FORMATS)
                .help("Sets the output format for result presentation"),
        )
        .arg(
            Arg::with_name("output-options")
                .long("output-options")
                .value_name("OPTIONS")
                .multiple(true)
                .use_delimiter(true)
                .require_delimiter(true)
                .default_value_if("output", Some("json"), "pretty")
                .default_value_if("output", Some("summary"), "human")
                .help("Sets output options")
                .long_help(
                    r#"* Json:
  * 'pretty': Prettifies output
* Summary:
  * 'condensed': Simplifies output,
  * 'human': Uses human readable formatting
  * 'show-domain-names': Shows queried domain names

"#,
                ),
        )
        .arg(
            Arg::with_name("show-errors")
                .long("show-errors")
                .conflicts_with("quiet")
                .help("Shows error counts"),
        )
        .arg(
            Arg::with_name("quiet")
                .short("q")
                .long("quiet")
                .help("Does not print anything but results"),
        )
        // This is a special option that is not reflected in GlobalConfig, but is checked during
        // setup in `mhost.rs`.
        .arg(
            Arg::with_name("no-color")
                .long("no-color")
                .help("Disables colorful output"),
        )
        // This is a special option that is not reflected in GlobalConfig, but is checked during
        // setup in `mhost.rs` and set the global AtomicBool `mhost::output::styles::ASCII_MODE`.
        .arg(
            Arg::with_name("ascii")
                .long("ascii")
                .help("Uses only ASCII compatible characters for output"),
        )
        // This is a special option that is not reflected in GlobalConfig, but is checked during
        // setup in `mhost.rs`.
        .arg(
            Arg::with_name("v")
                .short("v")
                .multiple(true)
                .help("Sets the level of verbosity"),
        )
        // This is a special option that is not reflected in GlobalConfig, but is checked during
        // setup in `mhost.rs`.
        .arg(
            Arg::with_name("debug")
                .long("debug")
                .help("Uses debug formatting for logging -- much more verbose"),
        )
        // This is a hidden parameter for debugging and experimentation only
        .arg(
            Arg::with_name("max-worker-threads")
                .long("max-worker-threads")
                .value_name("NUMBER")
                .validator(|str| {
                    usize::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .hidden(true)
                .help("Set the max. number of worker threads overriding derived value")
        )
        .subcommands(subcommands())
}

fn subcommands() -> Vec<App<'static, 'static>> {
    vec![
        check_subcommand(),
        discover_subcommand(),
        lookup_subcommand(),
        server_lists_subcommand(),
    ]
    .into_iter()
    .map(|x| x.version(env!("CARGO_PKG_VERSION")).author(env!("CARGO_PKG_AUTHORS")))
    .collect()
}

fn check_subcommand() -> App<'static, 'static> {
    SubCommand::with_name("check")
        .about("Checks all available records for known misconfigurations or mistakes")
        .arg(
            Arg::with_name("domain name")
                .index(1)
                .required(true)
                .value_name("DOMAIN NAME")
                .next_line_help(false)
                .help("domain name to check")
                .long_help("* DOMAIN NAME may be any valid DNS name, e.g., lukas.pustina.de"),
        )
        .arg(
            Arg::with_name("partial-results")
                .short("p")
                .long("show-partial-results")
                .help("Shows results after each check step"),
        )
        .arg(
            Arg::with_name("show-intermediate-lookups")
                .short("i")
                .long("show-intermediate-lookups")
                .requires("partial-results")
                .help("Shows all lookups made during by all checks"),
        )
        .arg(
            Arg::with_name("no-cnames")
                .long("no-cnames")
                .help("Does not run cname lints"),
        )
        .arg(Arg::with_name("no-soa").long("no-soa").help("Does not run SOA check"))
        .arg(Arg::with_name("no-spf").long("no-spf").help("Does not run SPF check"))
}

fn discover_subcommand() -> App<'static, 'static> {
    SubCommand::with_name("discover")
        .about("Discovers records of a domain using multiple heuristics")
        .arg(
            Arg::with_name("domain name")
                .required(true)
                .index(1)
                .value_name("DOMAIN NAME")
                .next_line_help(false)
                .help("domain name to discover")
                .long_help("* DOMAIN NAME may be any valid DNS name, e.g., lukas.pustina.de"),
        )
        .arg(
            Arg::with_name("partial-results")
                .short("p")
                .long("show-partial-results")
                .help("Shows results after each lookup step"),
        )
        .arg(
            Arg::with_name("wordlist-from-file")
                .short("w")
                .long("wordlist-from-file")
                .value_name("FILE")
                .takes_value(true)
                .help("Uses wordlist from file"),
        )
        .arg(
            Arg::with_name("rnd-names-number")
                .long("rnd-names-number")
                .value_name("NUMBER")
                .default_value("3")
                .validator(|str| {
                    u64::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets number of random domain names to generate for wildcard resolution check"),
        )
        .arg(
            Arg::with_name("rnd-names-len")
                .long("rnd-names-len")
                .value_name("LEN")
                .default_value("32")
                .validator(|str| {
                    u64::from_str(&str)
                        .map(|_| ())
                        .map_err(|_| "invalid number".to_string())
                })
                .help("Sets length of random domain names to generate for wildcard resolution check"),
        )
        .arg(
            Arg::with_name("subdomains-only")
                .short("s")
                .long("subdomains-only")
                .help("Shows subdomains only omitting all other discovered names"),
        )
}

fn lookup_subcommand() -> App<'static, 'static> {
    SubCommand::with_name("lookup")
        .about("Looks up a name, IP address or CIDR block")
        .arg(
            Arg::with_name("domain name")
                .required_unless("list-predefined")
                .index(1)
                .value_name("DOMAIN NAME | IP ADDR | CIDR BLOCK [| SERVICE SPEC]")
                .next_line_help(false)
                .help("domain name, IP address, or CIDR block to lookup")
                .long_help(
                    r#"domain name, IP address, CIDR block, or, if -s, SERVICE SPEC, to lookup"
* DOMAIN NAME may be any valid DNS name, e.g., lukas.pustina.de
* IP ADDR may be any valid IPv4 or IPv4 address, e.g., 192.168.0.1
* CIDR BLOCK may be any valid IPv4 or IPv6 subnet in CIDR notation, e.g., 192.168.0.1/24
  all valid IP addresses of a CIDR block will be queried for a reverse lookup
* SERVICE SPEC may be specified by name, protocol, and domain name, delimited by colons. If protocol is omitted, tcp is assumed, e.g.,
  * dns:udp:example.com is _dns._udp.example.com
  * smtp:tcp:example.com is _smtp._tcp.example.com
  * smtp::example.com is _smtp._tcp.example.com
"#,
                ),
        )
        .arg(
            Arg::with_name("record-types")
                .short("t")
                .long("record-type")
                .value_name("RECORD TYPE")
                .takes_value(true)
                .multiple(true)
                .use_delimiter(true)
                .require_delimiter(true)
                .default_value("A,AAAA,CNAME,MX")
                .default_value_if("parse-as-service", None, "SRV")
                .possible_values(SUPPORTED_RECORD_TYPES)
                .help("Sets record type to lookup, will be ignored in case of IP address lookup"),
        )
        .arg(
            Arg::with_name("all-record-types")
                .long("all")
                .alias("xmas")
                .help("Enables lookups for all record types"),
        )
        .arg(
            Arg::with_name("parse-as-service")
                .short("s")
                .long("service")
                .conflicts_with("all-record-types")
                .overrides_with("record-types")
                .help("Parses ARG as service spec and set record type to SRV"),
        )
        .arg(
            Arg::with_name("whois")
                .short("w")
                .long("whois")
                .help("Retrieves Whois information about A, AAAA, and PTR records"),
        )
}

fn server_lists_subcommand() -> App<'static, 'static> {
    SubCommand::with_name("server-lists")
        .about("Downloads known lists of name servers")
        .arg(
            Arg::with_name("server_list_spec")
                .index(1)
                .value_name("SERVER LIST SPEC")
                .multiple(true)
                .required(true)
                .next_line_help(false)
                .help("server list specification")
                .long_help(
                    r#"SERVER LIST SPEC as <SOURCE>[:OPTIONS,...]
* 'public-dns' with options - cf. https://public-dns.info
  '<top level country domain>': options select servers from that country
   Example: public-dns:de
* 'opennic' with options; uses GeoIP to select servers - cf. https://www.opennic.org
   'anon' - only return servers with anonymized logs only; default is false
   'number=<1..>' - return up to 'number' servers; default is 10
   'reliability=<1..100> - only return server with reliability of 'reliability'% or more; default 95
   'ipv=<4|6|all> - return IPv4, IPv6, or both servers; default all
    Example: opennic:anon,number=10,ipv=4

"#,
                ),
        )
        .arg(
            Arg::with_name("output-file")
                .short("o")
                .long("output-file")
                .required(true)
                .value_name("FILE")
                .takes_value(true)
                .help("Sets path to output file"),
        )
}

pub fn show_help() {
    let _ = create_parser().print_help();
    // Force line break; otherwise the shell prompt starts at last line of help.
    println!();
}


text:
package org.usfirst.frc.team5806.robot;

public abstract class Subsystem {
	public abstract void stop();
	public abstract void updateSubsystem();
	public abstract void updateDashboard();
}


text:
REPOS=`find $PWD -type d -name ".git" -maxdepth 2`

for repo in $REPOS; do
  path=${repo%%/.git}
  name=${path##*[/\\]}
  pushd $path > /dev/null

  git remote set-url origin git@github.com:polymer-elements/$name.git

  popd > /dev/null
done


text:
<?php

defined('C5_EXECUTE') or die('Access Denied.');

Loader::model ('fsen_localization');
FSENLocalization::setupInterfaceLocalization4AjaxRequest ();

$page_id = $_REQUEST['cID'];
if (!Loader::helper('validation/numbers')->integer($page_id)) {
	die(t('Access Denied'));
}

require_once ('helpers/check_login.php');
require_once ('helpers/fsen/ProjectInfo.php');

$project_id = $_REQUEST['projectID'];
$domain_handle = $_REQUEST['domainHandle'];
$volume_handle = $_REQUEST['volumeHandle'];
$part_handle = $_REQUEST['partHandle'];
$chapter_handle = $_REQUEST['chapterHandle'];
$thread_action = $_REQUEST['threadAction'];

$doc_lang = substr ($project_id, -2);

$title = t('Thread Action');
if ($domain_handle == 'community') {
	switch ($thread_action) {
	case 'top':
		$glyphicon_name = 'circle-question-mark';
		$glyphicon_color = 'primary';
		$title = t('Top Thread');
		$prompt = t('Do you really want to mark this thread as the top thread?');
		$form_action = "/fse_settings/projects/toggle_thread_top";
		$btn_class = 'warning';
		break;
	case 'untop':
		$glyphicon_name = 'circle-question-mark';
		$glyphicon_color = 'primary';
		$title = t('Untop Thread');
		$prompt = t('Do you really want to remove the top mark of this thread?');
		$form_action = "/fse_settings/projects/toggle_thread_top";
		$btn_class = 'warning';
		break;
	case 'delete':
		$glyphicon_name = 'circle-exclamation-mark';
		$glyphicon_color = 'danger';
		$title = t('Remove Thread');
		$prompt = t('Do you really want to remove this thread (and its all replies and comments)?');
		$form_action = "/fse_settings/projects/delete_thread";
		$btn_class = 'danger';
		break;
	default:
		$error_info = t('Bad action!');
		break;
	}
}
else {
	$error_info = t('Bad domain!');
}

if (!isset ($error_info)) {
	if (!fse_try_to_login ()) {
		$error_info = t('You are not signed in.');
	}
	else {
		$project_info = ProjectInfo::getBasicInfo ($project_id);
		if ($project_info == false) {
			$error_info = t('Bad project');
		}
		else if (substr (ProjectInfo::getUserRights ($project_id, $_SESSION['FSEInfo']['fse_id']), 2, 1) != 't') {
			$error_info = t('You have no right to manage forum of this project!');
		}
		else {
			$chapter_name = ProjectInfo::getChapterName ($project_id,
					$domain_handle, $volume_handle, $part_handle, $chapter_handle);
			if ($chapter_name == false) {
				$error_info = t('Not existed thread!');
			}
		}
	}
}
?>

	<button type="button" class="close" data-dismiss="modal">
		×
		<?php echo t ('Close') ?>
	</button>

<?php echo $title ?>

<?php echo isset ($error_info)?$error_info:$prompt ?>

	<button type="button" class="btn btn-default" data-dismiss="modal">
		<?php echo t ('Cancel') ?>
	</button>
<?php
if (!isset ($error_info)) {
?>
	<button id="btnThreadAction" type="button" class="btn btn-<?php echo $btn_class ?>"
			data-doing-text="<?php echo t ('Submitting...') ?>"
			data-done-text="<?php echo t ('Done') ?>">
		<?php echo t ('Ok') ?>
	</button>
<?php
}
?>

<form id="formThreadAction" method="post" action="<?php echo $form_action ?>">
	<input type="hidden" name="fsenDocLang" value="<?php echo $doc_lang ?>" />
	<input type="hidden" name="cID" value="<?php echo $page_id ?>" />
	<input type="hidden" name="projectID" value="<?php echo $project_id ?>" />
	<input type="hidden" name="domainHandle" value="<?php echo $domain_handle ?>" />
	<input type="hidden" name="volumeHandle" value="<?php echo $volume_handle ?>" />
	<input type="hidden" name="partHandle" value="<?php echo $part_handle ?>" />
	<input type="hidden" name="chapterHandle" value="<?php echo $chapter_handle ?>" />

	<input type="submit" name="inputHiddenSubmit" value="submit" style="display:none" />

</form>


text:
<?php

namespace PhpGuard\Listen\Resource;

/**
 * ResourceInterface is the interface that must be implemented by all Resource classes.
 *
 * @author Anthonius Munthi <me@itstoni.com>
 */
interface ResourceInterface
{
    /**
     * Returns unique resource ID.
     *
     * @return string
     */
    public function getID();

    /**
     * Returns the resource tied to this Resource.
     *
     * @return  string|null The resource
     */
    public function getResource();

    /**
     * Returns true if the resource exists in the filesystem.
     *
     * @return Boolean
     */
    public function isExists();

    /**
     * Get checksum for current resource
     * @return string
     */
    public function getChecksum();

    /**
     * Returns a string representation of the Resource.
     *
     * @return string A string representation of the Resource
     */
    public function __toString();
}


text:
package com.codacy.client.stash

import play.api.libs.functional.syntax._
import play.api.libs.json._

final case class SshKey(id: Long, key: String, label: String)

object SshKey {
  implicit val reader: Reads[SshKey] = (
    (__ \ "key" \ "id").read[Long] and
      (__ \ "key" \ "text").read[String] and
      (__ \ "key" \ "label").read[String]
  )(SshKey.apply _)
}

final case class SshKeySimple(key: String)

object SshKeySimple {
  implicit val reader: Reads[SshKeySimple] = Reads { jsValue =>
    (jsValue \ "key" \ "text")
      .asOpt[String]
      .map(t => JsSuccess(SshKeySimple(t)))
      .getOrElse(JsError("could not retrive ssh key"))
  }
}

final case class UserSshKey(id: Long, text: String, label: String)

object UserSshKey {
  implicit val fmt: Format[UserSshKey] = Json.format[UserSshKey]
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Netuno</logradouro><bairro>Novo Tempo</bairro><cidade>Timóteo</cidade><uf>MG</uf><cep>35183114</cep></feed>


text:
set -ex

# Use the default MySQL port. There is no need to override it because the
# docker-compose config has only one MySQL instance, and ${MYSQL_HOST} uniquely
# identifies it.
MYSQL_PORT=3306
export MYSQL_HOST="${HOSTNAME}_db_1"

# See: https://docs.docker.com/compose/extends/#multiple-compose-files.
COMPOSE_CONFIG="-p ${HOSTNAME} -f ./integration/cloudbuild/docker-compose.mysql.yml -f ./integration/cloudbuild/docker-compose.network.yml"
docker-compose $COMPOSE_CONFIG up -d
trap "docker-compose $COMPOSE_CONFIG down" EXIT

# Wait for MySQL instance to be ready.
while ! mysql --protocol=TCP --host=${MYSQL_HOST} --port=${MYSQL_PORT} --user=root -pbananas \
  -e 'SHOW VARIABLES LIKE "%version%";' ;
do
 sleep 5
done

# Presumbits need a user with CREATE DATABASE grants since they create temporary
# databases. For the same reason, this is a URI prefix - tests will add DB names
# to the end.
export TEST_MYSQL_URI="root:bananas@tcp(${MYSQL_HOST}:${MYSQL_PORT})/"

./scripts/presubmit.sh $*

# TODO(pavelkalinnikov): Make the check more robust.
if [ $1 = "--coverage" ]; then
  bash <(curl -s https://codecov.io/bash)
fi


text:
#MiniShip {
  font-size: 14px;
}
#MiniShip .btn-group {
  display: flex;
  width: 100%;
  padding-left: 5px;
  padding-right: 5px;
}
#MiniShip .btn-group .btn {
  flex: 1;
}
#MiniShip .hidden {
  display: none;
}
#MiniShip .show {
  display: block;
}
#MiniShip .deck-status {
  padding-left: 0px;
  padding-right: 0px;
  text-align: center;
}
#MiniShip .progress {
  margin-bottom: 5px;
}
#MiniShip .ship-details {
  margin-bottom: 1px;
}
#MiniShip .ship-details .ship-tile {
  margin: 5px 5px 5px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#MiniShip .ship-details .ship-item {
  flex: 1;
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-end;
  overflow: hidden;
  white-space: nowrap;
  /*margin-right: 15px;*/
}
#MiniShip .ship-details .ship-item .ship-info {
  flex: 3;
  font-size: 14px;
  display: flex;
  flex-flow: column nowrap;
  justify-content: space-between;
}
#MiniShip .ship-details .ship-item .ship-info .ship-type {
  margin-left: 5px;
}
#MiniShip .ship-details .ship-item .ship-info .ship-name {
  flex: 1.5;
  padding-right: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#MiniShip .ship-details .ship-item .ship-info .ship-lv-text {
  flex: 2;
  font-size: 70%;
  margin-right: 4px;
  line-height: 1;
  overflow: hidden;
}
#MiniShip .ship-details .ship-item .ship-stat {
  flex: 3;
  font-size: 14px;
  display: flex;
  flex-flow: column nowrap;
  width: 100%;
  min-width: 125px;
  justify-content: space-between;
}
#MiniShip .ship-details .ship-item .ship-stat .ship-hp {
  flex: 1;
  align-self: flex-start;
}
.ship-pop .status-label,
#MiniShip .ship-details .ship-item .ship-stat .status-label {
  display: inline-block;
  z-index: 100;
  position: relative;
  margin-left: 5px;
  margin-top: -1px;
  text-align: center;
  vertical-align: middle;
  width: 20px;
}
#MiniShip .ship-details .ship-item .ship-stat .status-label .label {
  width: 20px;
  padding: 3px 3px;
  display: inline-block;
}
#MiniShip .ship-details .ship-item .ship-stat .ship-cond {
  width: 40px;
  align-self: flex-end;
  margin-left: auto;
  display: table;
  text-align: right;
}
#MiniShip .ship-details .ship-item .ship-stat .ship-cond .cond-indicator {
  display: inline-block;
  height: 30px;
  width: 4px;
  vertical-align: middle;
  margin-left: 4px;
}
#MiniShip .ship-details .ship-item .ship-stat .hp-progress {
  flex: 1;
}
#MiniShip .ship-details .ship-item .ship-stat .hp-progress .progress {
  height: 7px;
  flex: auto;
}
#MiniShip .ship-details .ship-item .ship-slot {
  width: 105px;
  flex: none;
  margin-left: 4px;
  margin-right: 4px;
  margin-bottom: 3px;
}
#MiniShip .alert {
  background-color: transparent;
  border-color: transparent;
  margin-top: 9px;
  text-align: center;
}
#MiniShip .fleet-name {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
}
#MiniShip .flex {
  flex: 1;
}
#MiniShip .top-space {
  margin-top: 5px;
}
.ship-pop .slotitem-container {
  display :flex;
  flex-flow: row;
  margin-top: 4px;
}
.ship-pop .slotitem-container .slotitem-name {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
}
.ship-pop .slotitem-container .slotitem-onslot {
  font-size: 90%;
  padding: 3px 6px 3px 5px;
  margin-left: 2px;
}
.ship-pop .slotitem-container span.show {
  display: inline !important;
}
.ship-pop .slotitem-container img {
  width: 32px;
  height: 32px;
  margin-top: -8px;
  margin-bottom: -8px;
}
#MiniShip .div-col,
.ship-pop .div-col {
  display: flex;
  flex-flow: column;
}
#MiniShip .div-row,
.ship-pop .div-row {
  display: flex;
  flex-flow: row;
}
.ship-pop .flex {
  flex: 1;
}
.ship-pop .item-name {
  margin-bottom: 5px;
  width: 220px
}
.ship-pop .progress {
  margin-top: 5px;
  height: 9px;
}
.ship-pop .material-icon {
  margin-right: auto;
}


text:
from __future__ import division
from numpy import *
import sys, csv, optparse

def normalize(xs):
	"""Normalize a numpy array"""
	return xs/sum(xs)

class SNPrank:
	"""Provides functions for running SNPrank algorithm on a GAIN matrix"""
	def __init__(self, infilename):
		"""Initialize SNPrank object with GAIN file object"""

		reader = csv.reader(infilename, delimiter="\t")

		# The first row is the SNP labels
		self.SNPs = reader.next()

		self.GAIN = array([row for row in reader], dtype=float64)

	def calculate_snprank(self, gamma, usegpu):
		"""Runs the SNPrank algorithm on the input data, using gamma as the damping factor.
		   usegpu enables GPU computing (using the CUDAMat library) for the matrix multiplication.
		   Returns the SNPrank scores and diagonal (main effect) of original GAIN matrix."""

		# A GAIN matrix is an NxN matrix
		m,n = self.GAIN.shape
		if m != n:
			raise ValueError("Input is not an NxN matrix")

		# Vector of column sums
		colsum = self.GAIN.sum(axis=0)

		# Get indices of c vector that are not zero
		colsum_nzidx = colsum.nonzero()[0]

		D = zeros((n,n))
		T_nz = ones(n)

		# Where a column doesn't sum to 0, the diagonal in D
		# ought to be the reciprocal of the column sum.
		# Likewize T_nz ought to be 1-gamma rather than 1.
		for i in colsum_nzidx:
			D[i][i] = 1/colsum[i]
			T_nz[i] = 1 - gamma

		T = zeros((n,n))
		if usegpu:
			import cudamat as cm
			# initialize CUDAMat
			cm.init()

			# Copy GAIN and D matrices to GPU
			G_gpu = cm.CUDAMatrix(self.GAIN)
			D_gpu = cm.CUDAMatrix(D)

			# Do matrix multiplication on the GPU
			GD_prod = cm.dot(G_gpu,D_gpu)

			# Transition matrix
			T = (gamma * GD_prod.asarray() ) + (self.GAIN.diagonal().reshape(n,1) * T_nz) / self.GAIN.trace()
		else:
			# Transition matrix
			T = (gamma * dot(self.GAIN,D) ) + (self.GAIN.diagonal().reshape(n,1) * T_nz) / self.GAIN.trace()

		# r is an arbitrary vector, which we initialize to 1/n
		r = (ones(n)).reshape(n,1)/n;

		# Cutoff for matrix convergence
		threshold = 10**(-4)

		# Multiply r by T until r converges to within the threshold
		while True:
			r_old, r = r, normalize(dot(T,r))
			if all( abs(r-r_old) < threshold ):
				break

		return r.reshape(1,n)[0], self.GAIN.diagonal()

	def print_to_file(self, SNPs, snp_rank, ig, output):
        	"""Output table of SNP names, SNPranks, information gain, and degree to a file."""
		writer = csv.writer(output,delimiter='\t')

		sort_temp = sorted(zip(SNPs, snp_rank, ig), key=lambda item:item[1], reverse =True)

		writer.writerow(['SNP','SNPrank','IG'])
		map(output.write,("%s\t%.6f\t%.6f\n" % tuple(vals) for vals in sort_temp))

def main():
	# Create option parser
	parser = optparse.OptionParser(usage="%prog [OPTIONS]", version="%prog 0.1")
	# Add options to parser; use defaults if none specified
	parser.add_option("-i", "--input", dest="infile", help="read data from INFILE")
	parser.add_option("-o", "--output", dest="outfile", help="output to OUTFILE")
	parser.add_option("-g", "--gamma", dest="gamma", help="gamma value (default: .85)", default=.85)
	parser.add_option("-n", "--gpu", action="store_true", dest="usegpu", help="enable GPU", default=False)

	(options, args) = parser.parse_args()

	# Check to see if filenames are mentioned, open to r/w if not
	try:
		infile  = open(options.infile,  'r') if options.infile  else sys.stdin
	except IOError as err:
		if err.errno != 2:
			raise err
		print "Error: Input file could not be opened."
		parser.print_help()
		return 1

	try:
		outfile = open(options.outfile, 'w') if options.outfile else sys.stdout
	except IOError as err:
		if err.errno != 2:
			raise err
		print "Error: Output file could not be opened."
		parser.print_help()
		return 1

	# Create data object from class
	full_data = SNPrank(infile)

	infile.close()

	# Get SNPrank and information gain from calculate_snprank
	snprank, IG = full_data.calculate_snprank(float(options.gamma), options.usegpu)

	# Print to file
	full_data.print_to_file(full_data.SNPs,snprank, IG, outfile)

	outfile.close()
	return 0

if __name__ == "__main__":
	sys.exit(main())


text:
using MumbleProto;
using MumbleSharp.Audio;
using MumbleSharp.Audio.Codecs;
using MumbleSharp.Packets;
using ProtoBuf;
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;

namespace MumbleSharp
{
    internal class UdpSocket
    {
        readonly UdpClient _client;
        readonly IPEndPoint _host;
        readonly IMumbleProtocol _protocol;
        readonly MumbleConnection _connection;

        public bool IsConnected { get; private set; }

        public UdpSocket(IPEndPoint host, IMumbleProtocol protocol, MumbleConnection connection)
        {
            _host = host;
            _protocol = protocol;
            _connection = connection;
            _client = new UdpClient();
        }

        public void Connect()
        {
            _client.Connect(_host);
            IsConnected = true;
        }

        public void Close()
        {
            IsConnected = false;
            _client.Close();
        }

        public void SendPing()
        {
            long timestamp = DateTime.UtcNow.Ticks;

            byte[] buffer = new byte[9];
            buffer[0] = 1 << 5;
            buffer[1] = (byte)((timestamp >> 56) & 0xFF);
            buffer[2] = (byte)((timestamp >> 48) & 0xFF);
            buffer[3] = (byte)((timestamp >> 40) & 0xFF);
            buffer[4] = (byte)((timestamp >> 32) & 0xFF);
            buffer[5] = (byte)((timestamp >> 24) & 0xFF);
            buffer[6] = (byte)((timestamp >> 16) & 0xFF);
            buffer[7] = (byte)((timestamp >> 8) & 0xFF);
            buffer[8] = (byte)((timestamp) & 0xFF);

            _client.Send(buffer, buffer.Length);
        }

        public bool Process()
        {
            if (_client.Client == null
                || _client.Available == 0)
                return false;

            IPEndPoint sender = _host;
            byte[] data = _client.Receive(ref sender);

            _connection.ReceivedEncryptedUdp(data);

            return true;
        }
    }
}


text:
"""Modoboa stats signals."""

import django.dispatch

get_graph_sets = django.dispatch.Signal(providing_args=["user"])


text:
IF OBJECT_ID(N'dbo.sp_t','P') IS NOT NULL
   DROP PROCEDURE dbo.sp_t
GO

/*-------------------------------------------------------------------------------------------------
        NAME: sp_t.sql
  UPDATED BY: Sal Young
       EMAIL: saleyoun@yahoo.com
 DESCRIPTION: Displays information about all tables in database
-------------------------------------------------------------------------------------------------
-- TR/PROJ#   DATE        MODIFIED      DESCRIPTION
-------------------------------------------------------------------------------------------------
-- F000000    08.21.2018  SYoung        Re-format T-SQL code
--            10.07.2018  SYoung        Added create_date column
-------------------------------------------------------------------------------------------------
  DISCLAIMER: The AUTHOR  ASSUMES NO RESPONSIBILITY  FOR ANYTHING, including  the destruction of
              personal property, creating singularities, making deep fried chicken, causing your
              toilet to  explode, making  your animals spin  around like mad, causing hair loss,
              killing your buzz or ANYTHING else that can be thought up.
-------------------------------------------------------------------------------------------------*/
CREATE PROCEDURE [dbo].[sp_t] (
       @database_name VARCHAR(40) = NULL,
       @order CHAR(1) = 's' -- (d = data_size, i = index_size, r = row_count, s = total_size, t = table_name)
       )

AS

SET NOCOUNT ON

IF @database_name IS NULL SET @database_name = DB_NAME()

DECLARE	@object_id	INT
      , @type CHAR(1)
      , @schema_name VARCHAR(40)
      , @table_name VARCHAR(200)
      , @create_date smalldatetime
      , @row_count BIGINT
      , @data_size INT
      , @index_size INT
      , @page_size INT
      , @sql_string NVARCHAR(1000)

SELECT @page_size = low/1024
  FROM [master].dbo.spt_values
 WHERE number = 1
   AND [type] = 'E'

CREATE TABLE #table_list (
       [object_id] INT
     , [type] CHAR(1)
     , [schema_name] VARCHAR(40)
     , table_name VARCHAR(200)
     , create_date smalldatetime)

CREATE TABLE #table_statistics (
       instance_name VARCHAR(40)
     , [database_name] VARCHAR(40)
     , [type] CHAR(1)
     , [schema_name] VARCHAR(40)
     , table_name VARCHAR(200)
     , create_date smalldatetime
     , row_count BIGINT
     , data_size INT
     , index_size INT
     , total_size INT)

SELECT @sql_string = 'INSERT #table_list SELECT DISTINCT o.object_id, o.type, s.name, o.name, o.create_date FROM [' + @database_name + '].sys.objects o WITH (NOLOCK) JOIN [' + @database_name + '].sys.schemas s WITH (NOLOCK) ON o.schema_id = s.schema_id JOIN [' + @database_name + '].sys.indexes i WITH (NOLOCK) ON o.object_id = i.object_id WHERE o.type IN (''U'',''V'')'

EXECUTE sp_executesql @sql_string

DECLARE table_cursor CURSOR
    FOR SELECT object_id
      , [type]
      , [schema_name]
      , table_name
      , create_date
   FROM #table_list

   OPEN table_cursor
  FETCH NEXT FROM table_cursor INTO @object_id, @type, @schema_name, @table_name, @create_date

WHILE @@FETCH_STATUS = 0
      BEGIN
      SELECT @sql_string = N'SELECT
	@d = SUM(
		CASE WHEN (index_id < 2)
		THEN (in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count)
		ELSE lob_used_page_count + row_overflow_used_page_count
		END
		),
	@i = SUM(used_page_count) - SUM(
		CASE WHEN (index_id < 2)
		THEN (in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count)
		ELSE lob_used_page_count + row_overflow_used_page_count
		END
		),
	@r = SUM(CASE WHEN (index_id < 2) THEN row_count ELSE 0 END)
	FROM [' + @database_name + '].sys.dm_db_partition_stats WITH (NOLOCK)
	WHERE object_id = ' + CONVERT(VARCHAR,@object_id)

	EXECUTE sp_executesql @sql_string
        ,	N'@d INT OUTPUT, @i INT OUTPUT, @r BIGINT OUTPUT'
        ,	@d = @data_size OUTPUT
        ,	@i = @index_size OUTPUT
        ,	@r = @row_count OUTPUT

	INSERT #table_statistics
  SELECT @@SERVERNAME
       , @database_name
       , @type
       , @schema_name
       , @table_name
       , @create_date
       , @row_count
       , @data_size * @page_size
       , @index_size * @page_size
       , (@data_size + @index_size) * @page_size

	FETCH NEXT FROM table_cursor INTO @object_id, @type, @schema_name, @table_name, @create_date
END
CLOSE table_cursor
DEALLOCATE table_cursor

SET NOCOUNT OFF

IF @order = 'd'
	SELECT instance_name
         , [database_name]
         , [type]
         , [schema_name]
         , LEFT(table_name,60) table_name
         , create_date
         , row_count
         , data_size
         , index_size
         , total_size
      FROM #table_statistics
     ORDER BY data_size DESC
ELSE
IF @order = 'i'
	SELECT instance_name
         , [database_name]
         , [type]
         , [schema_name]
         , LEFT(table_name,60) table_name
         , create_date
         , row_count
         , data_size
         , index_size
         , total_size
      FROM #table_statistics
     ORDER BY index_size DESC
ELSE
IF @order = 'r'
	SELECT instance_name
         , [database_name]
         , [type]
         , [schema_name]
         , LEFT(table_name,60) table_name
         , create_date
         , row_count
         , data_size
         , index_size
         , total_size
      FROM #table_statistics
     ORDER BY row_count DESC
ELSE
IF @order = 's'
	SELECT instance_name
         , [database_name]
         , [type]
         , [schema_name]
         , LEFT(table_name,60) table_name
         , create_date
         , row_count
         , data_size
         , index_size
         , total_size
      FROM #table_statistics
     ORDER BY total_size DESC
ELSE
	SELECT instance_name
         , [database_name]
         , [type]
         , [schema_name]
         , LEFT(table_name,60) table_name
         , create_date
         , row_count
         , data_size
         , index_size
         , total_size
      FROM #table_statistics
     ORDER BY [schema_name] ASC, table_name ASC
GO


text:
gdb -q -args gem5.opt -r --stdout-file=sha.out ../configs/example/se.py -c sha/sha.elf -i sha/input_small.asc --cpu-type=atomic --checkpoint-dir=m5out/sha_small_out
#gdb -q -x test.gdb -args gem5.opt -r --stdout-file=sha.out --debug-flags=SimpleCPU,Fetch,Decode ../configs/example/se.py -c sha/sha.elf -i sha/input_small.asc --cpu-type=atomic --checkpoint-dir=/home/rexjia/gem5-stable/benchmark/m5out/sha_small_out
#gem5.opt -d sha/small ../configs/example/se.py -c sha/sha.elf -i sha/input_small.asc --cpu-type=atomic
#gem5.opt -d sha/large ../configs/example/se.py -c sha/sha.elf -i sha/input_large.asc --cpu-type=atomic

# adpcm encode
#gem5.opt -d adpcm/encode_small ../configs/example/se.py -c adpcm/bin/rawcaudio -i adpcm/data/small.pcm --output=adpcm/output_small.adpcm
#gem5.opt -d adpcm/encode_large ../configs/example/se.py -c adpcm/bin/rawcaudio -i adpcm/data/large.pcm --output=adpcm/output_large.adpcm

# adpcm decode
#gem5.opt -d adpcm/decode_small ../configs/example/se.py -c adpcm/bin/rawdaudio -i adpcm/data/small.adpcm --output=adpcm/output_small.pcm
#gem5.opt -d adpcm/decode_large ../configs/example/se.py -c adpcm/bin/rawdaudio -i adpcm/data/large.adpcm --output=adpcm/output_large.pcm

# crc
#gem5.opt -d CRC32/small ../configs/example/se.py -c CRC32/crc -o adpcm/data/small.pcm --output=CRC32/output_small.pcm
#gem5.opt -d CRC32/large ../configs/example/se.py -c CRC32/crc -o adpcm/data/large.pcm --output=CRC32/output_large.pcm

# other type of processors
#gdb -args gem5.opt ../configs/example/se.py --cpu-type=minor --caches -c queens.elf -o 6
#gdb -args gem5.opt ../configs/example/se.py --cpu-type=minor --caches -c adpcm/bin/rawdaudio -i adpcm/data/small.adpcm --output=adpcm/output_small.adpcm


text:
package net.arbium.simplex.db;

/**
 * Information about a database table to construct a model from.
 *
 * @author Robin Morris <robin.b.morris@gmail.com>
 */
public class TableInfo {
	String tableName;
	ColumnInfo idColumn;
	ColumnInfo[] columns;

	/**
	 * Constructor. Table has no ID column and no fields.
	 *
	 * @param tableName name of table
	 */
	public TableInfo(String tableName) {
		this(tableName, null, new String[] { });
	}

	/**
	 * Constructor. Table has no fields.
	 *
	 * @param tableName name of table
	 * @param idName name of ID column
	 */
	public TableInfo(String tableName, String idName) {
		this(tableName, idName, new String[] { });
	}

	/**
	 * Constructor. Table has no ID column.
	 *
	 * @param tableName name of table
	 * @param fieldNames names of fields
	 */
	public TableInfo(String tableName, String[] fieldNames) {
		this(tableName, null, fieldNames);
	}

	/**
	 * Constructor.
	 *
	 * @param tableName name of table
	 * @param idName name of ID column
	 * @param fieldNames names of fields
	 */
	public TableInfo(String tableName, String idName, String[] fieldNames) {
		setTableName(tableName);
		if(idName != null) setIdColumn(new ColumnInfo(tableName, idName));
		setColumns(new ColumnInfo[fieldNames.length]);
		for(int index = 0; index < fieldNames.length; ++index) {
			getColumns()[index] = new ColumnInfo(tableName, fieldNames[index]);
		}
	}

	/**
	 * @return the tableName
	 */
	public String getTableName() {
		return tableName;
	}

	/**
	 * @param tableName the tableName to set
	 */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	/**
	 * @return the idColumn
	 */
	public ColumnInfo getIdColumn() {
		return idColumn;
	}

	/**
	 * @param idColumn the idColumn to set
	 */
	public void setIdColumn(ColumnInfo idColumn) {
		this.idColumn = idColumn;
	}

	/**
	 * @return the columns
	 */
	public ColumnInfo[] getColumns() {
		return columns;
	}

	/**
	 * @param columns the columns to set
	 */
	public void setColumns(ColumnInfo[] columns) {
		this.columns = columns;
	}
}


text:
package com.mgaetan89.showsrage.fragment;

import android.app.Application;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.MediaRouteActionProvider;
import android.support.v7.app.MediaRouteDiscoveryFragment;
import android.support.v7.media.MediaControlIntent;
import android.support.v7.media.MediaRouteSelector;
import android.support.v7.media.MediaRouter;
import android.support.v7.widget.CardView;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.mgaetan89.showsrage.Constants;
import com.mgaetan89.showsrage.R;
import com.mgaetan89.showsrage.ShowsRageApplication;
import com.mgaetan89.showsrage.helper.DateTimeHelper;
import com.mgaetan89.showsrage.helper.GenericCallback;
import com.mgaetan89.showsrage.model.Episode;
import com.mgaetan89.showsrage.model.GenericResponse;
import com.mgaetan89.showsrage.model.PlayingVideoData;
import com.mgaetan89.showsrage.model.Show;
import com.mgaetan89.showsrage.model.SingleEpisode;
import com.mgaetan89.showsrage.network.SickRageApi;

import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class EpisodeDetailFragment extends MediaRouteDiscoveryFragment implements Callback<SingleEpisode>, View.OnClickListener {
	@Nullable
	private TextView airs = null;

	@Nullable
	private MenuItem castMenu = null;

	@Nullable
	private Episode episode = null;

	private int episodeNumber = 0;

	@Nullable
	private TextView fileSize = null;

	@Nullable
	private TextView location = null;

	@Nullable
	private CardView moreInformationLayout = null;

	@Nullable
	private TextView name = null;

	@Nullable
	private MenuItem playVideoMenu = null;

	@Nullable
	private TextView plot = null;

	@Nullable
	private CardView plotLayout = null;

	@Nullable
	private TextView quality = null;

	private int seasonNumber = 0;

	@Nullable
	private Show show = null;

	@Nullable
	private TextView status = null;

	public EpisodeDetailFragment() {
		this.setHasOptionsMenu(true);

		this.setRouteSelector(new MediaRouteSelector.Builder()
				.addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
				.build());
	}

	@Override
	public void failure(RetrofitError error) {
		error.printStackTrace();
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		ActionBar actionBar = ((AppCompatActivity) this.getActivity()).getSupportActionBar();
		Bundle arguments = this.getArguments();
		Episode episode = (Episode) arguments.getSerializable(Constants.Bundle.EPISODE_MODEL);
		this.episodeNumber = arguments.getInt(Constants.Bundle.EPISODE_NUMBER, 0);
		this.seasonNumber = arguments.getInt(Constants.Bundle.SEASON_NUMBER, 0);

		if (actionBar != null) {
			if (this.seasonNumber <= 0) {
				actionBar.setTitle(R.string.specials);
			} else {
				actionBar.setTitle(this.getString(R.string.season_number, this.seasonNumber));
			}
		}

		this.show = (Show) arguments.getSerializable(Constants.Bundle.SHOW_MODEL);

		this.displayEpisode(episode);

		if (this.show != null) {
			SickRageApi.getInstance().getServices().getEpisode(this.show.getIndexerId(), this.seasonNumber, this.episodeNumber, this);
		}
	}

	@Override
	public void onClick(View view) {
		if (this.show == null) {
			return;
		}

		Toast.makeText(this.getActivity(), this.getString(R.string.episode_search, this.episodeNumber, this.seasonNumber), Toast.LENGTH_SHORT).show();

		SickRageApi.getInstance().getServices().searchEpisode(this.show.getIndexerId(), this.seasonNumber, this.episodeNumber, new GenericCallback(this.getActivity()));
	}

	@Override
	public MediaRouter.Callback onCreateCallback() {
		return new MediaRouterCallback(this);
	}

	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		inflater.inflate(R.menu.episode, menu);

		this.castMenu = menu.findItem(R.id.menu_cast);
		MediaRouteActionProvider mediaRouteActionProvider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(this.castMenu);
		mediaRouteActionProvider.setRouteSelector(this.getRouteSelector());

		this.playVideoMenu = menu.findItem(R.id.menu_play_video);

		this.displayStreamingMenus(this.episode);
	}

	@Nullable
	@Override
	public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_episode_detail, container, false);

		if (view != null) {
			this.airs = (TextView) view.findViewById(R.id.episode_airs);
			this.fileSize = (TextView) view.findViewById(R.id.episode_file_size);
			this.location = (TextView) view.findViewById(R.id.episode_location);
			this.moreInformationLayout = (CardView) view.findViewById(R.id.episode_more_information_layout);
			this.name = (TextView) view.findViewById(R.id.episode_name);
			this.plot = (TextView) view.findViewById(R.id.episode_plot);
			this.plotLayout = (CardView) view.findViewById(R.id.episode_plot_layout);
			this.quality = (TextView) view.findViewById(R.id.episode_quality);
			this.status = (TextView) view.findViewById(R.id.episode_status);

			FloatingActionButton searchEpisode = (FloatingActionButton) view.findViewById(R.id.search_episode);

			if (searchEpisode != null) {
				searchEpisode.setOnClickListener(this);
			}
		}

		return view;
	}

	@Override
	public void onDestroyView() {
		this.airs = null;
		this.fileSize = null;
		this.location = null;
		this.moreInformationLayout = null;
		this.name = null;
		this.plot = null;
		this.plotLayout = null;
		this.quality = null;
		this.status = null;

		super.onDestroyView();
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case R.id.menu_episode_set_status_archived:
			case R.id.menu_episode_set_status_failed:
			case R.id.menu_episode_set_status_ignored:
			case R.id.menu_episode_set_status_skipped:
			case R.id.menu_episode_set_status_wanted:
				this.setEpisodeStatus(this.seasonNumber, this.episodeNumber, Episode.getStatusForMenuId(item.getItemId()));

				break;

			case R.id.menu_play_video:
				this.clickPlayVideo();

				return true;
		}

		return super.onOptionsItemSelected(item);
	}

	@Override
	public void success(SingleEpisode singleEpisode, Response response) {
		this.displayEpisode(singleEpisode.getData());
		this.displayStreamingMenus(singleEpisode.getData());
	}

	private boolean areStreamingMenusVisible(@Nullable Episode episode) {
		FragmentActivity activity = this.getActivity();

		if (activity == null || episode == null) {
			return false;
		}

		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
		boolean episodeDownloaded = "Downloaded".equalsIgnoreCase(episode.getStatus());
		boolean viewInVlc = preferences.getBoolean("view_in_vlc", false);

		return episodeDownloaded && viewInVlc;
	}

	private void clickPlayVideo() {
		Intent intent = new Intent(Intent.ACTION_VIEW, this.getEpisodeVideoUrl());
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.setClassName("org.videolan.vlc", "org.videolan.vlc.gui.video.VideoPlayerActivity");

		this.startActivity(intent);
	}

	private void displayEpisode(@Nullable Episode episode) {
		if (episode == null) {
			return;
		}

		this.episode = episode;

		if (this.airs != null) {
			this.airs.setText(this.getString(R.string.airs, DateTimeHelper.getRelativeDate(episode.getAirDate(), "yyyy-MM-dd", DateUtils.DAY_IN_MILLIS)));
			this.airs.setVisibility(View.VISIBLE);
		}

		if (episode.getFileSize() == 0L) {
			if (this.moreInformationLayout != null) {
				this.moreInformationLayout.setVisibility(View.GONE);
			}
		} else {
			if (this.fileSize != null) {
				this.fileSize.setText(this.getString(R.string.file_size, episode.getFileSizeHuman()));
			}

			if (this.location != null) {
				this.location.setText(this.getString(R.string.location, episode.getLocation()));
			}

			if (this.moreInformationLayout != null) {
				this.moreInformationLayout.setVisibility(View.VISIBLE);
			}
		}

		if (this.name != null) {
			this.name.setText(episode.getName());
			this.name.setVisibility(View.VISIBLE);
		}

		if (this.plot != null) {
			String description = episode.getDescription();

			if (TextUtils.isEmpty(description)) {
				if (this.plotLayout != null) {
					this.plotLayout.setVisibility(View.GONE);
				}
			} else {
				this.plot.setText(description);

				if (this.plotLayout != null) {
					this.plotLayout.setVisibility(View.VISIBLE);
				}
			}
		}

		if (this.quality != null) {
			String quality = episode.getQuality();

			if ("N/A".equalsIgnoreCase(quality)) {
				this.quality.setVisibility(View.GONE);
			} else {
				this.quality.setText(this.getString(R.string.quality, quality));
				this.quality.setVisibility(View.VISIBLE);
			}
		}

		if (this.status != null) {
			int status = episode.getStatusTranslationResource();
			String statusString = episode.getStatus();

			if (status != 0) {
				statusString = this.getString(status);
			}

			this.status.setText(this.getString(R.string.status_value, statusString));
			this.status.setVisibility(View.VISIBLE);
		}
	}

	private void displayStreamingMenus(Episode episode) {
		boolean displayStreamingMenu = this.areStreamingMenusVisible(episode);

		if (this.castMenu != null) {
			this.castMenu.setVisible(displayStreamingMenu);
		}

		if (this.playVideoMenu != null) {
			this.playVideoMenu.setVisible(displayStreamingMenu);
		}
	}

	@NonNull
	private Uri getEpisodeVideoUrl() {
		String episodeUrl = SickRageApi.getInstance().getVideosUrl();

		if (this.show != null) {
			episodeUrl += this.show.getShowName() + "/";
		}

		if (this.episode != null) {
			episodeUrl += this.episode.getLocation();
		}

		try {
			URL url = new URL(episodeUrl);
			URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef());

			return Uri.parse(uri.toString());
		} catch (MalformedURLException | URISyntaxException exception) {
			exception.printStackTrace();
		}

		return Uri.parse(episodeUrl);
	}

	private void setEpisodeStatus(final int seasonNumber, final int episodeNumber, final String status) {
		if (this.show == null) {
			return;
		}

		final Callback<GenericResponse> callback = new GenericCallback(this.getActivity());
		final int indexerId = this.show.getIndexerId();

		new AlertDialog.Builder(this.getActivity())
				.setMessage(R.string.replace_existing_episode)
				.setPositiveButton(R.string.replace, new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						SickRageApi.getInstance().getServices().setEpisodeStatus(indexerId, seasonNumber, episodeNumber, 1, status, callback);
					}
				})
				.setNegativeButton(R.string.keep, new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						SickRageApi.getInstance().getServices().setEpisodeStatus(indexerId, seasonNumber, episodeNumber, 0, status, callback);
					}
				})
				.show();
	}

	private static final class MediaRouterCallback extends MediaRouter.Callback {
		@NonNull
		private WeakReference<EpisodeDetailFragment> fragmentReference = new WeakReference<>(null);

		private MediaRouterCallback(EpisodeDetailFragment fragment) {
			this.fragmentReference = new WeakReference<>(fragment);
		}

		@Override
		public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo route) {
			this.updateRemotePlayer(route);
		}

		@Override
		public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route) {
			this.updateRemotePlayer(route);
		}

		private void updateRemotePlayer(MediaRouter.RouteInfo route) {
			EpisodeDetailFragment fragment = this.fragmentReference.get();

			if (fragment == null) {
				return;
			}

			Application application = fragment.getActivity().getApplication();

			if (application instanceof ShowsRageApplication) {
				PlayingVideoData playingVideo = new PlayingVideoData();
				playingVideo.setEpisode(fragment.episode);
				playingVideo.setRoute(route);
				playingVideo.setShow(fragment.show);
				playingVideo.setVideoUri(fragment.getEpisodeVideoUrl());

				((ShowsRageApplication) application).setPlayingVideo(playingVideo);
			}
		}
	}
}