text:
const config = require('./config')

let providers = []

const init = (app, passport) => {

  // Initialize all providers
  try {
    require('../providers')(providers)
  } catch (err) {
    // Never mind.
    debug.warn(err)
    return
  }

  // Define a Passport strategy for provider
  providers.forEach(({ provider, Strategy, strategyOptions, getUserFromProfile }) => {
    strategyOptions.callbackURL = `http://localhost:${config.port}/auth/${provider}/callback`
    strategyOptions.passReqToCallback = true

    passport.use(new Strategy(strategyOptions, (req, accessToken, refreshToken, profile, done) => {
      try {
        // Normalise the provider specific profile into a User object
        const _profile = getUserFromProfile(profile)

        // See if we have this oAuth account in the database associated with a user
        NAP.User.findOne({
          [[provider] + '.id']: _profile.id
        }, (err, user) => {
          if (err) {
            return done(err)
          }

          // If the current session is signed in
          if (req.user) {

            // If the oAuth account is not linked to another account, link it and exit
            if (!user) {
              return NAP.User.findOneAndUpdate({ _id: req.user.id }, {
                name: (user && user.name) || _profile.name,
                [provider]: new NAP.Provider({
                  id: _profile.id,
                  token: accessToken
                })
              }, { new: true, upsert: true }, (err, user) => {
                if (err) {
                  return done(err)
                }

                return done(null, user)
              })
            }

            // If oAuth account already linked to the current user, just exit
            if (req.user.id === user.id) {
              return done(null, user)
            }

            // If the oAuth account is already linked to different account, exit with error
            if (req.user.id !== user.id) {
              return done(new Error('This account is already associated with another login.'))
            }
          } else {
            // If the current session is not signed in

            // If we have the oAuth account in the db then let them sign in as that user
            if (user) {
              return done(null, user)
            }

            // If we don't have the oAuth account in the db, check to see if an account with the
            // same email address as the one associated with their oAuth acccount exists in the db
            return NAP.User.findOne({ email: _profile.email }, (err, user) => {
              if (err) {
                return done(err)
              }
              // If we already have an account associated with that email address in the databases, the user
              // should sign in with that account instead (to prevent them creating two accounts by mistake)
              // Note: Automatically linking them here could expose a potential security exploit allowing someone
              // to create an account for another users email address in advance then hijack it, so don't do that.
              if (user) {
                return done(new Error('There is already an account associated with the same email address.'))
              }

              // If account does not exist, create one for them and sign the user in
              NAP.User.create({
                name: _profile.name,
                email: _profile.email,
                [provider]: new NAP.Provider({
                  id: _profile.id,
                  token: accessToken
                }),
                role: 'user'
              }, (err, user) => err ? done(err) : done(null, user))
            })
          }
        })
      } catch (err) {
        done(err)
      }
    }))
  })

  // Add routes for provider
  providers.forEach(({ provider, scope }) => {
    app.get(
      `/auth/${provider}`,
      passport.authenticate(provider, { scope })
    )

    app.get(
      `/auth/${provider}/callback`,
      passport.authenticate(provider, { failureRedirect: '/auth/error' }),
      (req, res) => {
        // Redirect to the sign in success, page which will force the client to update it's cache
        res.redirect('/auth/welcome')
      })

    app.get(
      `/auth/${provider}/return`,
      passport.authenticate(provider, { failureRedirect: '/auth/error' }),
      (req, res) => {
        // Successful authentication, redirect home.ß
        res.redirect('/auth/welcome')
      })
  })
}

module.exports = init
module.exports.providers = providers


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>org.bridgedb.file.orthoxml</artifactId>
  <name>BridgeDb OrthoXML</name>
  <parent>
  	<artifactId>bridgedb-bundle</artifactId>
  	<groupId>org.bridgedb</groupId>
  	<version>3.0.17</version>
  </parent>

	<build>
		<directory>target</directory>
		<outputDirectory>target/classes</outputDirectory>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<testOutputDirectory>target/test-classes</testOutputDirectory>
		<sourceDirectory>src</sourceDirectory>
		<scriptSourceDirectory>scripts</scriptSourceDirectory>
		<testSourceDirectory>test</testSourceDirectory>
		<resources>
			<resource>
				<directory>resources</directory>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>test-data</directory>
			</testResource>
		</testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
	</build>

        <dependencies>
                <dependency>
                        <groupId>org.bridgedb</groupId>
                        <artifactId>org.bridgedb</artifactId>
                        <version>${project.parent.version}</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.bridgedb</groupId>
                        <artifactId>org.bridgedb.bio</artifactId>
                        <version>${project.parent.version}</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
			<groupId>org.group.project</groupId>
			<artifactId>orthoxml</artifactId>
			<version>0.1.0</version>
			<scope>system</scope>
			<systemPath>${basedir}/lib/orthoxml-0.1b.jar</systemPath>
		</dependency>
        </dependencies>

</project>

redpajama_set_name: RedPajamaGithub


text:
SER_START_ITEMS(WsManTestResult)
SER_UINT8("result1", 1),
SER_UINT8("result2", 1),
SER_END_ITEMS(WsManTestResult);

SER_START_ITEMS(WsManTest)
SER_STR("Simple", 1),
SER_STRUCT("Result", 1, WsManTestResult),
SER_END_ITEMS(WsManTest);

#if 0
START_TRANSFER_GET_SELECTORS(WsManTest)
FINISH_TRANSFER_GET_SELECTORS(WsManTest);
#endif

START_END_POINTS(WsManTest)
    END_POINT_TRANSFER_GET(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_ENUMERATE(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_DIRECT_PULL(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_PULL(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_RELEASE(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_TRANSFER_PUT(WsManTest, XML_NS_OPENWSMAN"/test"),
#ifdef ENABLE_EVENTING_SUPPORT
    END_POINT_SUBSCRIBE(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_UNSUBSCRIBE(WsManTest, XML_NS_OPENWSMAN"/test"),
    END_POINT_RENEW(WsManTest, XML_NS_OPENWSMAN"/test"),
#endif
FINISH_END_POINTS(WsManTest);

START_NAMESPACES(WsManTest)
    ADD_NAMESPACE( XML_NS_OPENWSMAN, NULL ),
FINISH_NAMESPACES(WsManTest);

static list_t *
set_namespaces(void)
{

  int i;

  list_t *l = list_create(LISTCOUNT_T_MAX);
  for (i = 0; WsManTest_Namespaces[i].ns != NULL; i++)
  {
    WsSupportedNamespaces *ns = (WsSupportedNamespaces *)u_malloc(sizeof(WsSupportedNamespaces));
    ns->class_prefix = WsManTest_Namespaces[i].class_prefix;
    ns->ns = (char*) WsManTest_Namespaces[i].ns;
    lnode_t *node = lnode_create(ns);
    list_append(l, node);
  }

  return l;
}

void get_endpoints(void *self, void **data)
{
    WsDispatchInterfaceInfo *ifc = 	(WsDispatchInterfaceInfo *)data;
    ifc->flags = 0;
    ifc->actionUriBase = NULL;
    ifc->version = PACKAGE_VERSION;
    ifc->vendor = "Openwsman Project";
    ifc->displayName = "Test";
    ifc->notes = "Test Plugin";
    ifc->compliance = XML_NS_WS_MAN;
    ifc->wsmanResourceUri = WS_MAN_TEST_RESOURCE_URI;
    ifc->extraData = NULL;
    ifc->namespaces = set_namespaces();
    ifc->endPoints = WsManTest_EndPoints;
}

int init( void *self, void **data )
{
    return 1;
}

void
cleanup( void  *self, void *data )
{
	return;
}
void set_config( void *self, dictionary *config )
{
    return;
}


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>UIControl(SSToolkitAdditions) Category Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.0.5 (build 789)" />

SSToolkit 1.0.2

				Sam Soffes

UIControl(SSToolkitAdditions) Category Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/removeAllTargets">    - removeAllTargets</option>

	<option value="//api/name/setTarget:action:forControlEvents:">    - setTarget:action:forControlEvents:</option>

</select>

Overview

Tasks

Instance Methods

removeAllTargets

setTarget:action:forControlEvents:

Index

Hierarchy

UIControl(SSToolkitAdditions) Category Reference

	Declared in
	UIControl+SSToolkitAdditions.h

Overview

Provides extensions to UIControl for various common tasks.

Tasks

		– removeAllTargets

Removes all targets and actions for all events from an internal dispatch table.

		– setTarget:action:forControlEvents:

Sets exclusive target for specified event, all previous targets will be removed, usefull for table cells etc

Instance Methods

removeAllTargets

Removes all targets and actions for all events from an internal dispatch table.

- (void)removeAllTargets

Discussion

Removes all targets and actions for all events from an internal dispatch table.

Declared In

		UIControl+SSToolkitAdditions.h

setTarget:action:forControlEvents:

Sets exclusive target for specified event, all previous targets will be removed, usefull for table cells etc

- (void)setTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents

Discussion

Sets exclusive target for specified event, all previous targets will be removed, usefull for table cells etc

Declared In

		UIControl+SSToolkitAdditions.h

Index

Hierarchy

© 2012 Sam Soffes. All rights reserved. (Last updated: 2012-12-02)

						Generated by appledoc 2.0.5 (build 789).


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title> Adding animation</title>

    <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="../css/clean-blog.min.css" rel="stylesheet">
    <link href="css/navbar.css" rel="stylesheet">

    <link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

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

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation
                    Menu
                </button>

                        Home

                        About

        Projects

Lazy Guitar

Kanpai

Adding animation

                        Februrary 16, 2017

So I've been working on an app recently that requires its users to log in.

The composition of buttons and logo doesn't look too bad, but visually, I thought it could look a little more lively. So after some sips of coffee I finally figured out what I needed to do: UI animation!

 UIView animation

UIView animation can make your app look more appealing and it is actually not difficult to understand and implement. Animatable UIView properties are: Frame, bounds, center, transform, alpha, backgroundColor, and contentStretch. In this post, I will show how I added animations to my app's log in screen. I decided to animate the buttons by first adding them to an array:

buttonsToAnimate = [logInButton, signUpButton]

Then in ViewDidLayoutSubviews I go through the array and figure out each button's final y position as well as move it out of the view's frame.

func viewDidLayoutSubviews(){
    for button in buttonsToAnimate {
        let currentFrame = button.frame

        finalYPosition.append(currentFrame.origin.y)

        button.frame = CGRect(x: currentFrame.origin.x,
                                     y: self.view.frame.height + currentFrame.origin.y,
                                     width: currentFrame.width,
                                     height: currentFrame.height)
    }
}

 Now, to animate these buttons, I used the UIView Animate method once the view appears. Inside the animations block, I loop through the buttonsToAnimate array and set the y position of frame of each button to a value from the finalYPosition array.

func viewDidLoad() {
    UIView.animate(withDuration: 1, delay: 0.0, options: .curveEaseInOut,  animations: { () -> Void in
        for button in self.buttonsToAnimate {

            let currentFrame = button.frame

            buttonToAnimate.frame = CGRect(x: currentFrame.origin.x,
                                            y: self.finalYPosition.remove(at: 0),
                                            width:currentFrame.width,
                                            height: currentFrame.height)
        }
    }, completion: nil)
}

 UIKit Dynamics

 I wanted the logo to animate similar to the buttons, but also wanted it to feel more real. There is already a great tool for this kind of tasks provided by UIKit: UIKit Dynamics. The UIDynamicAnimator class provides physics-related capabilities to items that conform to UIDynamicItemProtocol. For the logo label, I wanted it to look as if it had fallen from somewhere high and landed right above the buttons. This was easily done by adding gravity.

func animateLogo(){
    var animator: UIDynamicAnimator!
    var gravity: UIGravityBehavior!

    animator = UIDynamicAnimator(referenceView: view)

    gravity = UIGravityBehavior(items: [logoLabel])

    animator.addBehavior(gravity)
}

 And just like that, boom. now the logo label slowly accelerates downward and drops off the bottom of the screen. So now I have to add a barrier view that will act as a boundary for the label. In the same function:

var collision: UICollisionBehavior!

let barrier = UIView(frame: CGRect(x: 0, y: 300, width: 375, height: 10))

collision = UICollisionBehavior(items: [logoLabel])
collision.addBoundary(withIdentifier: "barrier" as NSCopying, for: UIBezierPath(rect: barrier.frame))

animator.addBehavior(collision)

 Look at that! It even bounces a little when it collides with the invisible barrier!

Last remarks

 UIKit Dynamics is a powerful tool that provides physics behaviors in your iOS apps. Although in this post, I used it to animate items automatically when the app starts, you can also add behaviors when user interacts with the app. With subtle bounce, gravity, snapping, etc behaviors you can bring life to your apps. Check out Apple's API Reference page to see how you can configure behaviors to your need.


text:
*$(6)  Map projection handling routines

*+DPPROJ

       SUBROUTINE DPPROJ (BUFFER, STATUS)
C      ----------------------------------
C
C  Dumps the current map projection to a save buffer.
C
C  Parameters:
C      BUFFER    integer(*)  save buffer
C      STATUS    integer     status value
C
C  Saves the current map projection description in the array BUFFER,
C  which should be at least 30 words (120 bytes) in length.
C
C  The details of the map projection are held in the include file
C  (LIBRARY)MAPLIB-PROJ:INCL.
C
C  The STATUS value should be zero on entry, and is not changed.
C
C  (DJT, 22 October 87)
C
*-
C
       include '/mrao/include/maplib_proj.inc'
C
       INTEGER*4  BUFFER(LENPRJ)
       INTEGER    STATUS, I
C
       IF (STATUS.EQ.0) THEN
         DO I=1,LENPRJ
           BUFFER(I)=IPRALL(I)
         ENDDO
       ENDIF
C
       END


text:
Participants Circle

    <participant-profile class="participant-profile" [userData]="selectedParticipant" *ngIf="selectedParticipant"></participant-profile>
    <user-selector></user-selector>


text:
<?php
namespace MemMemov\UnitRobot\Source\Description;

class Names
{
    public function createInstanceName(

    ): InstanceName
    {
        return new InstanceName();
    }
}


text:
package dom.obrasocial;

import java.util.List;

import org.apache.isis.applib.AbstractFactoryAndRepository;
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.ActionLayout;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.DomainServiceLayout;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Parameter;
import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.query.QueryDefault;

import com.google.common.base.Predicate;

import dom.estado.EstadoEnum;
import dom.paciente.Paciente;

/**
 * Contiene la funcionalidad para Cargar/Listar una Obra Social
 *
 * @author Adamantiums
 * @since 01/08/2015
 * @version 1.0.0
 */
@DomainService(repositoryFor = ObraSocial.class)
@DomainServiceLayout(named = "Obra Social", menuBar = DomainServiceLayout.MenuBar.PRIMARY, menuOrder = "4")
public class ObraSocialServicio extends AbstractFactoryAndRepository {
	/**
	 * Retorna el nombre del icono para el Doctor
	 *
	 * @return String
	 */
	public String iconName() {
		return "obraSocial";
	}

	@MemberOrder(name = "Obra Social", sequence = "4.1")
	@ActionLayout(cssClass = "boton")
	public ObraSocial crearObraSocial(
			@ParameterLayout(named = "Nombre") @Parameter(regexPattern = dom.regex.RegexValidation.ValidaNombres.REFERENCIA) final String nombre,
			@ParameterLayout(named = "Nombre Abreviado") @Parameter(regexPattern = dom.regex.RegexValidation.ValidaCobertura.COBERTURA) final String cobertura) {
		final ObraSocial obraSocial = newTransientInstance(ObraSocial.class);
		obraSocial.setNombre(nombre.substring(0, 1).toUpperCase()
				+ nombre.substring(1));
		obraSocial.setNombreCorto(cobertura.substring(0, 1).toUpperCase()
				+ cobertura.substring(1));
		persist(obraSocial);
		container.flush();
		return obraSocial;
	}

	/**
	 * // * Obtiene una lista de todos las ObrasSociales // * // * @return
	 * listaDeObrasSociales List<ObraSocial> //
	 */
	@MemberOrder(name = "Obra Social", sequence = "4.2")
	public List<ObraSocial> listarObraSocial() {
		final List<ObraSocial> listaObraSocial = allInstances(ObraSocial.class);
		return listaObraSocial;
	}

	/**
	 * // * Obtiene una lista de ObraSocial Activos // * // * @return
	 * List<ObraSocial> //
	 */
	@MemberOrder(name = "Obra Social", sequence = "4.3")
	public List<ObraSocial> listarObraSocialesActivos() {
		return allMatches(ObraSocial.class, new Predicate<ObraSocial>() {

			@Override
			public boolean apply(ObraSocial input) {
				// TODO Auto-generated method stub
				return input.getEstado() == EstadoEnum.Activo ? true : false;
			}
		});
	}

	/**
	 * Obtiene una lista de ObraSocial Inactivos
	 *
	 * @return List<ObraSocial>
	 */
	@MemberOrder(name = "Obra Social", sequence = "4.4")
	public List<ObraSocial> listarObraSocialInactivos() {
		return allMatches(ObraSocial.class, new Predicate<ObraSocial>() {

			@Override
			public boolean apply(ObraSocial input) {
				// TODO Auto-generated method stub
				return input.getEstado() == EstadoEnum.Inactivo ? true : false;
			}
		});

	}

	@ActionLayout(hidden = Where.EVERYWHERE, cssClass = "boton")
	public List<ObraSocial> buscarObraSocial(String obraSocial) {
		return allMatches(QueryDefault.create(ObraSocial.class, "buscarNombre",
				"parametro", obraSocial));
	}

	@javax.inject.Inject
	DomainObjectContainer container;
}


text:
var plivo = require('plivo-node');

var arg = process.argv[2];
console.log('argument: ', arg);
var nconf = require('nconf');
var path = require('path');

nconf.file(path.join(__dirname, 'config.json'));

var api = plivo.RestAPI({
    authId: nconf.get('authId'),
    authToken: nconf.get('plivoToken')
});

var params = {
    from: nconf.get('call_from'),
    to: nconf.get('call_to'),
    ring_url: 'https://mtw-patch-monitor-insanity54.c9.io/response/sip/ringing/',
    answer_url: 'https://mtw-patch-monitor-insanity54.c9.io/response/sip/mobiletalk/'
    //machine_detection_url: 'https://mtw-patch-monitor-insanity54.c9.io/response/sip/machine/',
    //machine_detection: 'true'
};

function makeCall() {
    api.make_call(params, function(status, response) {
        if (status >= 200 && status < 300) {
            console.log('Successfully made call request.');
            console.log('Response:', response);
        }
        else {
            console.log('Oops! Something went wrong.');
            console.log('Status:', status);
            console.log('Response:', response);
        }
    });
}

function listCalls() {
    api.get_live_calls(params, function(status, response) {
                if (status >= 200 && status < 300) {
                    console.log('successfully made live calls request.');
                    console.log('Response: ', response);
                }
                else {
                    console.log('oop! error getting live calls');
                    console.log('response: ', response);
                }
    });
}

if (arg == 'list') {
    listCalls();
}
else {
    makeCall();
}


text:
'use strict';

var LoremLinkinServices = angular.module('LoremLinkinServices', []); // ,['ngResource']);

LoremLinkinServices.factory('Link', ['$log', '$http', 'urls',
  function($log, $http, urls){
    return {
        create: function() {
            return { title: '', description: '' }
        },
        save: function(link) {
            return $http.post(urls.link_save, link).then(function(data) {
                $log.log(data);
                return data.data;
            });
        },

    }

  }]);


text:
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using CSharpBits.Core.MVC.Bootstrap.Extensions;

namespace CSharpBits.Core
{
	public static class HtmlHelperExtensions
    {
        public static HtmlString ValidationBootstrap(this HtmlHelper htmlHelper, string alertType = "danger", string heading = "")
        {
            if (htmlHelper.ViewData.ModelState.IsValid)
                return new HtmlString(string.Empty);

            var sb = new StringBuilder();

            sb.AppendFormat("
", alertType);
            sb.Append("<button class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>");

            if (!string.IsNullOrEmpty(heading))
            {
                sb.AppendFormat("
{0}
", heading);
            }

            sb.Append(htmlHelper.ValidationSummary());
            sb.Append("
");

            return new HtmlString(sb.ToString());
        }

        public static MvcHtmlString Icon(this HtmlHelper helper, FaIcons icon)
        {
            return MvcHtmlString.Create(string.Format("",icon.ToDescription()));
        }

        public static MvcHtmlString Icon(this HtmlHelper helper, FaIcons icon, List<FaAttribute> faAttributes)
        {
            return MvcHtmlString.Create(string.Format("", icon.ToDescription()));
        }

    }
}


text:
class Trabajador: public Thread{
	ArchivoTrain& archivo;
	unsigned long int desde;
	unsigned long int hasta;
	public:
	Trabajador(ArchivoTrain& archivo,unsigned long int desde, unsigned long int hasta):archivo(archivo){
		this->desde = desde;
		this->hasta = hasta;
	}
	virtual void run(){
		archivo.conectarTargetNeighbors(5,desde,hasta);
	};
	virtual void end(){};
};
#endif


text:
namespace YAF.Lucene.Net.Search.Payloads
{

    /// <summary>
    /// Calculate the final score as the average score of all payloads seen.
    /// <para/>
    /// Is thread safe and completely reusable.
    /// </summary>
    public class AveragePayloadFunction : PayloadFunction
    {
        public override float CurrentScore(int docId, string field, int start, int end, int numPayloadsSeen, float currentScore, float currentPayloadScore)
        {
            return currentPayloadScore + currentScore;
        }

        public override float DocScore(int docId, string field, int numPayloadsSeen, float payloadScore)
        {
            return numPayloadsSeen > 0 ? (payloadScore / numPayloadsSeen) : 1;
        }

        public override int GetHashCode()
        {
            const int prime = 31;
            int result = 1;
            result = prime * result + this.GetType().GetHashCode();
            return result;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
            {
                return true;
            }
            if (obj is null)
            {
                return false;
            }
            if (this.GetType() != obj.GetType())
            {
                return false;
            }
            return true;
        }
    }
}


text:
<?php

namespace phpManufaktur\Basic\Control;

use Silex\Application;
use phpManufaktur\Basic\Control\Pattern\Alert;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ScanExtensions extends Alert
{
    protected static $usage = null;

    /**
     * (non-PHPdoc)
     * @see \phpManufaktur\Basic\Control\Pattern\Alert::initialize()
     */
    protected function initialize(Application $app)
    {
        parent::initialize($app);

        self::$usage = $this->app['request']->get('usage', 'framework');
        if (self::$usage != 'framework') {
            // set the locale from the CMS locale
            $app['translator']->setLocale($app['session']->get('CMS_LOCALE', 'en'));
        }
    }

    public function exec(Application $app)
    {
        $this->initialize($app);

        $register = new ExtensionRegister($app);
        $register->scanDirectories(ExtensionRegister::GROUP_PHPMANUFAKTUR);
        $register->scanDirectories(ExtensionRegister::GROUP_THIRDPARTY);

        $this->setAlert('Successfull scanned the kitFramework for installed extensions.',
                array(), self::ALERT_TYPE_SUCCESS);

        $subRequest = Request::create('/admin/welcome/extensions', 'GET', array('usage' => self::$usage));
        return $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
    }
}


text:
/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

@font-face {
    font-family: 'Rosario';
    font-style: normal;
    font-weight: 400;
    src: local('Rosario Regular'), local('Rosario-Regular'), url(../fonts/Rosario-Regular.woff2) format('woff2'), url(../fonts/Rosario-Regular.woff) format('woff');
}
@font-face {
    font-family: 'Rosario';
    font-style: normal;
    font-weight: 700;
    src: local('Rosario Bold'), local('Rosario-Bold'), url(../fonts/Rosario-Bold.woff2) format('woff2'), url(../fonts/Rosario-Bold.woff) format('woff');
}
@font-face {
    font-family: 'Rosario';
    font-style: italic;
    font-weight: 400;
    src: local('Rosario Italic'), local('Rosario-Italic'), url(../fonts/Rosario-Italic.woff2) format('woff2'), url(../fonts/Rosario-Italic.woff) format('woff');
}
@font-face {
    font-family: 'Rosario';
    font-style: italic;
    font-weight: 700;
    src: local('Rosario Bold Italic'), local('Rosario-BoldItalic'), url(../fonts/Rosario-BoldItalic.woff2) format('woff2'), url(../fonts/Rosario-BoldItalic.woff) format('woff');
}

html {
    color: #000000;
    font-family: 'Rosario', sans-serif;
    font-size: 1em;
    line-height: 1.3;
    -webkit-font-smoothing:antialiased;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */
::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}
::selection {
    background: #b3d4fc;
    text-shadow: none;
}
hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}
audio,
canvas,
img,
svg,
video {
    vertical-align: middle;
}
fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}
textarea {
    resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */
a,
a:active,
a:hover,
a:focus{
    outline:none;
}

html, body{
    height:100%;
}
body{
    background-color:#999999;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#hoja{
    background-color:#FFFFFF;
    -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.6);
    -moz-box-shadow: 0 0 5px rgba(0,0,0,0.6);
    box-shadow: 0 0 5px rgba(0,0,0,0.6);
    display:block;
    height:708px;
    margin:0 auto;
    overflow:hidden;
    position:relative;
    width:1000px;
}

.figura{
    bottom:0;
    display:block;
    height:114px;
    line-height:76px;
    pointer-events:none;
    position:absolute;
    right:0;
    text-align:center;
    width:114px;
    z-index: 1;
}

.figura span{
    display:inline-block;
    height:80px;
    pointer-events:none;
    position:relative;
    text-align:center;
    top:17px;
    width:80px;
}

.figura svg{
    display:inline-block;
    fill:#808080;
    -webkit-filter: blur(0.01px);
    -moz-filter: blur(0.01px);
    -ms-filter: blur(0.01px);
    -o-filter: blur(0.01px);
    filter: blur(0.01px);
    shape-rendering:geometricPrecision;
    vertical-align: middle;
}

.SO_Mac .figura svg,
.SO_iOS .figura svg{
    -webkit-filter: none;
    -moz-filter: none;
    -ms-filter: none;
    -o-filter: none;
    filter: none;
}

.figura svg .objeto{
    pointer-events:auto;
    -webkit-transition: fill .2s ease-in-out;
    -moz-transition: fill .2s ease-in-out;
    -ms-transition: fill .2s ease-in-out;
    -o-transition: fill .2s ease-in-out;
    transition: fill .2s ease-in-out;
}
.figura svg .objeto:hover{
    fill:#444444;
}

.figura svg .objeto, .grupo-icono{
    cursor: move;
    cursor: -webkit-grab;
    cursor: -moz-grab;
    cursor: grab;
}
.figura svg .objeto:active, .grupo-icono:active{
    cursor: move;
    cursor: -webkit-grabbing;
    cursor: -moz-grabbing;
    cursor: grabbing;
}

.navegador_IE .figura,
.navegador_IE .figura span{
    pointer-events:auto;
}

/* Grupo -------------------------------------------------------------------- */
.grupo{
    display:block;
    height:100%;
    left:0;
    top:0;
    width:100%;
}
.grupo-icono{
    display:block;
    height:14px;
    left:calc(50% - 7px);
    pointer-events:none;
    position:absolute;
    top:calc(50% - 7px);
    width:14px;
}

/* Menu --------------------------------------------------------------------- */
#menu{
    display:block;
    left:0;
    position:absolute;
    text-align:right;
    top:0;
    width:100%;
}
#menu nav{
    position:absolute;
    right:0;
    z-index:3;
}
#menu ul{
    font-size:0;
    list-style:none;
    margin:0;
    padding:0;
}
#menu ul li{
    border-bottom:1px solid #CCCCCC;
    border-left:1px solid #CCCCCC;
    display:inline-block;
    margin:0;
    padding:0;
}
#menu ul li a, #menu #submenu span{
    background-color:#FFFFFF;
    color:#666666;
    display:block;
    font-size:0.875rem;
    padding:4px 10px;
    text-decoration:none;
    -webkit-transition: background .2s ease-in-out, color .2s ease-in-out;
    -moz-transition: background .2s ease-in-out, color .2s ease-in-out;
    -ms-transition: background .2s ease-in-out, color .2s ease-in-out;
    -o-transition: background .2s ease-in-out, color .2s ease-in-out;
    transition: background .2s ease-in-out, color .2s ease-in-out;
}
#menu ul li a:hover{
    background-color:#EEEEEE;
    color:#333333;
}
#menu ul li#generarpdf a:hover{
    background-color:#99CC33;
    color:#000000;
}
#menu ul li.menu_desactivado a{
    background-color:#FFFFFF;
    color:#CCCCCC;
    pointer-events:none;
}
#menu ul li.menu_activado a{
    pointer-events:auto;
}

#menu #submenu span{
    cursor:pointer;
    position:relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#menu #submenu ul{
    border-top:1px solid #CCCCCC;
    display:none;
    position:absolute;
    right:0;
    width:auto;
}
#menu #submenu ul li{
    display:block;
    text-align:left;
}
#menu .menu_abierto span, #menu #submenu:hover span{
    background-color:#666666 !important;
    color:#FFFFFF !important;
}
#menu .menu_abierto ul{
    display:block !important;
}

/* Pie ---------------------------------------------------------------------- */
#pie{
    bottom:20px;
    color:#666666;
    cursor:default;
    display:block;
    font-size:0.750em;
    position:absolute;
    right:20px;
    text-align:right;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
#pie a{
    border-bottom:1px solid #CCCCCC;
    color:#666666;
    padding-bottom:1px;
    text-decoration:none;
    -webkit-transition: color .2s ease-in-out;
    -moz-transition: color .2s ease-in-out;
    -ms-transition: color .2s ease-in-out;
    -o-transition: color .2s ease-in-out;
    transition: color .2s ease-in-out;
}
#pie a:hover{
    border-bottom-color:#FFFFFF;
    color:#99CC33;
}

/* Ventanas ----------------------------------------------------------------- */
#cboxContent{
    background-color:#FFFFFF !important;
    margin-top:0;
}
#cboxLoadedContent{
    background-color:#FFFFFF !important;
    border:1px solid #666666;
}
#cboxLoadingOverlay{
    background-color:#FFFFFF !important;
}
#cboxClose{
    right:1px;
    top:1px;
}
#cboxClose:focus{
    outline:none;
}

.ventana{
    padding:40px;
    text-align:center;
    -webkit-touch-callout: none;
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
.ventana h2{
    border-bottom:1px solid #CCCCCC;
    display:block;
    font-size:1.500em;
    font-weight:400;
    margin:0 0 30px 0;
    padding:0 0 10px 0;
}
.ventana h3{
    font-size:1em;
    font-weight:700;
    margin-top:30px;
    text-align:left;
}
.ventana p{
    font-size:1.125em;
    margin:10px 0 0 0;
}
.ventana .botonera{
    margin-top:40px;
    text-align:center;
}
.ventana .botonera .boton:first-child{
    margin-right:10px;
}
.ventana .boton{
    background-color:#EEEEEE;
    border:1px solid #999999;
    cursor:pointer;
    display:inline-block;
    padding:2px 8px;
    -webkit-transition: all .2s ease-in-out;
    -moz-transition: all .2s ease-in-out;
    -ms-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}
.ventana .boton:hover{
    background-color:#999999;
    color:#FFFFFF;
}
.ventana .boton_rojo:hover{
    background-color:#ff0000;
}
.ventana p a{
    border-bottom:1px solid #CCCCCC;
    color:#000000;
    padding-bottom:0;
    text-decoration:none;
    white-space:nowrap;
    -webkit-transition: all .2s ease-in-out;
    -moz-transition: all .2s ease-in-out;
    -ms-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}
.ventana p a:hover{
    border-bottom-color:#FFFFFF;
    color:#99CC33;
    text-decoration:none;
}

#info_ventana h3{
    margin-top:40px;
}
#info_ventana p, #trabajopractico_ventana p{
    font-size:1em;
    text-align:left;
}

#info_ventana .info-licencia h3{
    margin-bottom:12px;
}
#info_ventana .info-licencia p{
    line-height:1.6;
    margin-top:0;
}
#info_ventana .info-licencia a{
    white-space:normal !important;
}
#info_ventana .info-licencia span.sincorte{
    white-space:nowrap !important;
}

#info_ventana .info-recursos p.enlaces{
    line-height:1.6;
}

@media print {
    .figura svg{
        -webkit-filter: none;
        -moz-filter: none;
        -ms-filter: none;
        -o-filter: none;
        filter: none;
    }
    .figura:after{
        display:none;
        visibility:hidden;
    }
}


text:
import unittest

import IECore

class DisplayDriverServerTest( unittest.TestCase ) :

	def testPortNumber( self ) :

		s1 = IECore.DisplayDriverServer( 1559 )
		self.assertEqual( s1.portNumber(), 1559 )

		self.assertRaises( RuntimeError, IECore.DisplayDriverServer, 1559 )

		s2 = IECore.DisplayDriverServer( 0 )
		self.assertNotEqual( s2.portNumber(), 0 )
		self.assertNotEqual( s2.portNumber(), s1.portNumber() )

		s3 = IECore.DisplayDriverServer( 0 )
		self.assertNotEqual( s3.portNumber(), 0 )
		self.assertNotEqual( s3.portNumber(), s2.portNumber() )

		s4 = IECore.DisplayDriverServer()
		self.assertNotEqual( s4.portNumber(), 0 )
		self.assertNotEqual( s4.portNumber(), s3.portNumber() )

if __name__ == "__main__":
	unittest.main()


text:
<?php

/**
 * BuddyPress - Users Friends
 *
 * @package BuddyPress
 * @subpackage bp-default
 */

?>

		<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>

		<?php if ( !bp_is_current_action( 'requests' ) ) : ?>

				<?php _e( 'Order By:', 'buddypress' ); ?>
				<select id="members-friends">
					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
					<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>

					<?php do_action( 'bp_member_friends_order_options' ); ?>

				</select>

		<?php endif; ?>

<?php

if ( bp_is_current_action( 'requests' ) ) :
	 locate_template( array( 'members/single/friends/requests.php' ), true );

else :
	do_action( 'bp_before_member_friends_content' ); ?>

		<?php locate_template( array( 'members/members-loop.php' ), true ); ?>

	<?php do_action( 'bp_after_member_friends_content' ); ?>

<?php endif; ?>


text:
package models;

import com.datastax.driver.core.utils.UUIDs;

import java.util.Date;
import java.util.UUID;

public class ActiveQuestion implements ListableQuestion {

    private Integer year;
    private Integer month;
    private UUID lastUpdated;

    private UUID id;
    private String authorLogin;
    private String title;
    private String text;
    private User author;
    private int voteCount = 0;
    private int answerCount = 0;
    private int viewCount = 0;
    private boolean answered;
    private boolean follow;

    public ActiveQuestion() {
    }

    public ActiveQuestion(Integer yer, Integer month, UUID lastUpdated, UUID id, String authorLogin, String title, String text) {
        this.year = year;
        this.month = month;
        this.lastUpdated = lastUpdated;
        this.id = id;
        this.authorLogin = authorLogin;
        this.title = title;
        this.text = text;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public UUID getLastUpdated() {
        return lastUpdated;
    }

    public void setLastUpdated(UUID lastUpdated) {
        this.lastUpdated = lastUpdated;
    }

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public String getAuthorLogin() {
        if (author != null) {
            return author.getLogin();
        }
        return authorLogin;
    }

    public void setAuthorLogin(String authorLogin) {
        this.authorLogin = authorLogin;
    }

    @Override
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public User getAuthor() {
        return author;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

    @Override
    public String getAuthorDisplayName() {
        return getAuthor().getDisplayName();
    }

    @Override
    public Date getDate() {
        if (getId() != null) {
            return new Date(UUIDs.unixTimestamp(id));
        }
        return null;
    }

    @Override
    public int getVoteCount() {
        return voteCount;
    }

    public void setVoteCount(int voteCount) {
        this.voteCount = voteCount;
    }

    @Override
    public int getAnswerCount() {
        return answerCount;
    }

    public void setAnswerCount(int answerCount) {
        this.answerCount = answerCount;
    }

    @Override
    public int getViewCount() {
        return viewCount;
    }

    public void setViewCount(int viewCount) {
        this.viewCount = viewCount;
    }

    public boolean isAnswered() {
        return answered;
    }

    public void setAnswered(boolean answered) {
        this.answered = answered;
    }

    public boolean isFollow() {
        return follow;
    }

    public void setFollow(boolean follow) {
        this.follow = follow;
    }
}


text:
Todo is a simple Django app for a basic todo list created in Django and AngularJS.

It provides basic task list features like adding a new task, checking it off, and removing/deleting the task.

# Contents

1. [Introduction][intro]
2. [Usage][usage]
3. [Installation][inst]
  1. [Requirements][req]
  2. [Installation][install]
  3. [Configuration][conf]
4. [Technologies used][tech]
5. [Contributing][contr]
6. [Contact][cont]
7. [License][lic]

# Usage

The web app provides a simple easy to use interface for a todo list. New items can be added using the input textbox at the top, and the completed items can be checked off using the checkbox to the left of each item in the list.
To delete an item from the list, just hover over the item, and click on the (x) to the right of the item.

# Installation

## Requirements

As this is a Django app, you will need a few things pre-installed and pre-configured on your system.

1. Python (Version: 3.5.x)
2. Django (Version: 1.10+)
3. Postgres or MySQL or any other database server (if you wish to use those, or else you are good to go with the Django default SQLite)
4. Working internet connection (only needed for the AngularJS and Bootstrap frameworks)

## Installation

#### Step 1.

Before you install this app, you need to make sure that you have Python installed on your system, particularly Python 3.5+.

To install Python, go to the [Official Python Website][python] to download the latest version of Python.

#### Step 2.

After you are set up with Python, you need to make sure you have pip installed.

Open your command window, and enter `pip -V`

It should display the version of pip that is installed on your system. If it shows an error, then that means that pip is not installed on your system.

To install pip checkout the documentation at [Python Packaging User Guide Documentation][PPUGD].

#### Step 3.

Now you need to install Django Framework. This is what provides the backend for the todo app.

To install Django, open your command window, and enter `pip install django==1.10.4` to install the version used for this app.
But you can also install the latest version by just `pip install django`. Although, I cannot guarantee whether the latest version will support the web app.

## Configuration

#### Step 1.

After installing Django, you just have to create a new project, using `django-admin startproject projectname`

This will create a new directory called 'projectname' in the current working directory.

#### Step 2.

Now copy the 'todo' directory from the git project and paste it inside the 'projectname' directory.

#### Step 3.

Now let's create a route so that the app can be visited through a web browser.

Add the following line inside the URL_PATTERNS list in 'projectname/urls.py' file

```python
urlpatterns = [
    url(r'^todo/', include('todo.urls')),
    # other routes...
]
```

This ensures that the web app can be visited via 'baseurl/todo/'.

#### Step 4.

Now to register the app with the Django project, open the 'settings.py' file from the 'projectname' directory, and add 'todo' inside the INSTALLED_APPS list as such:

```python
# Application definition

INSTALLED_APPS = [
    'todo.apps.TodoConfig',
    # ...
    'django.contrib.admin',
    # other apps
]
```

#### Step 5.

After we have registered Django project, we need to migrate the database. This will create the necessary tables in the database.

```shell
$ django-admin makemigrations
$ django-admin migrate
```

#### Step 6.

The app is finally ready to roll!!

Just enter the following command in the command line to start the server.

```shell
$ django-admin runserver
```

You can view the todo via the link `http://127.0.0.1:8000/todo/`

# Technologies Used

- **Backend**: Python Django Framework 1.10.4
- **Frontend**: AngularJS 1.6
- **Database**: PostgreSQL or SQLite (Other Database engines, like MySQL, MongoDB, etc. can also be used)

# Contributing

This project is not, by any means, complete. This app was meant as a basic follow up tutorial for AngularJS and Django. I just wanted to see how it works out. One can find possibly many flaws in it. Or even missing features.
If you like this project and would like to contribute to it, you can do so by following a few basic steps:

1. Fork this repository
2. Clone it locally to your system
3. Create a new branch for your patch or feature
4. Add your code/patch
5. Commit your work, and write good/unambiguous commit messages
6. Push it to your origin repository
7. Create a Pull Request for your patch/feature
8. Respond to any code review/comments feedback

I promise I will consider all the valid Pull Requests.

# Contact

For any queries or , you can contact me via:

- Facebook: [fb/MayurDeshmukh204][fb]
- Twitter: [@deshmukhmayur24][t]
- G+: [+MayurDeshmukh204][g+]
- LinkedIn: [in/DeshmukhMayur204][in]

# License

This project is licensed under the terms of the [MIT][lic] license.

[intro]: #introduction
[usage]: #usage
[inst]: #installation
[req]: #requirements
[install]: #installation-1
[conf]: #configuration
[tech]: #technologies-used
[contr]: #contributing
[cont]: #contact
[lic]: #license
[python]: https://www.python.org/downloads/
[PPUGD]: https://packaging.python.org/installing/#install-pip-setuptools-and-wheel
[fb]: https://facebook.com/MayurDeshmukh204
[t]: https://twitter.com/deshmukhmayur24
[g+]: https://plus.google.com/+MayurDeshmukh204
[in]: https://in.linkedin.com/in/deshmukhmayur204
[license]: https://github.com/deshmukhmayur/django-todo/blob/master/LICENSE


text:
package com.streamsets.datacollector.client.model;

import com.streamsets.datacollector.client.StringUtil;

import io.swagger.annotations.*;
import com.fasterxml.jackson.annotation.JsonProperty;

@ApiModel(description = "")
public class MeterJson   {

  private Long count = null;
  private Long m1Rate = null;
  private Long m5Rate = null;
  private Long m15Rate = null;
  private Long m30Rate = null;
  private Long h1Rate = null;
  private Long h6Rate = null;
  private Long h12Rate = null;
  private Long h24Rate = null;
  private Long meanRate = null;
  private String units = null;

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("count")
  public Long getCount() {
    return count;
  }
  public void setCount(Long count) {
    this.count = count;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("m1_rate")
  public Long getM1Rate() {
    return m1Rate;
  }
  public void setM1Rate(Long m1Rate) {
    this.m1Rate = m1Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("m5_rate")
  public Long getM5Rate() {
    return m5Rate;
  }
  public void setM5Rate(Long m5Rate) {
    this.m5Rate = m5Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("m15_rate")
  public Long getM15Rate() {
    return m15Rate;
  }
  public void setM15Rate(Long m15Rate) {
    this.m15Rate = m15Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("m30_rate")
  public Long getM30Rate() {
    return m30Rate;
  }
  public void setM30Rate(Long m30Rate) {
    this.m30Rate = m30Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("h1_rate")
  public Long getH1Rate() {
    return h1Rate;
  }
  public void setH1Rate(Long h1Rate) {
    this.h1Rate = h1Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("h6_rate")
  public Long getH6Rate() {
    return h6Rate;
  }
  public void setH6Rate(Long h6Rate) {
    this.h6Rate = h6Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("h12_rate")
  public Long getH12Rate() {
    return h12Rate;
  }
  public void setH12Rate(Long h12Rate) {
    this.h12Rate = h12Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("h24_rate")
  public Long getH24Rate() {
    return h24Rate;
  }
  public void setH24Rate(Long h24Rate) {
    this.h24Rate = h24Rate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("mean_rate")
  public Long getMeanRate() {
    return meanRate;
  }
  public void setMeanRate(Long meanRate) {
    this.meanRate = meanRate;
  }

  /**
   **/
  @ApiModelProperty(value = "")
  @JsonProperty("units")
  public String getUnits() {
    return units;
  }
  public void setUnits(String units) {
    this.units = units;
  }

  @Override
  public String toString()  {
    StringBuilder sb = new StringBuilder();
    sb.append("class MeterJson {\n");

    sb.append("    count: ").append(StringUtil.toIndentedString(count)).append("\n");
    sb.append("    m1Rate: ").append(StringUtil.toIndentedString(m1Rate)).append("\n");
    sb.append("    m5Rate: ").append(StringUtil.toIndentedString(m5Rate)).append("\n");
    sb.append("    m15Rate: ").append(StringUtil.toIndentedString(m15Rate)).append("\n");
    sb.append("    m30Rate: ").append(StringUtil.toIndentedString(m30Rate)).append("\n");
    sb.append("    h1Rate: ").append(StringUtil.toIndentedString(h1Rate)).append("\n");
    sb.append("    h6Rate: ").append(StringUtil.toIndentedString(h6Rate)).append("\n");
    sb.append("    h12Rate: ").append(StringUtil.toIndentedString(h12Rate)).append("\n");
    sb.append("    h24Rate: ").append(StringUtil.toIndentedString(h24Rate)).append("\n");
    sb.append("    meanRate: ").append(StringUtil.toIndentedString(meanRate)).append("\n");
    sb.append("    units: ").append(StringUtil.toIndentedString(units)).append("\n");
    sb.append("}");
    return sb.toString();
  }
}


text:
package io.mycat.route;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.junit.Test;

import io.mycat.MycatServer;
import io.mycat.SimpleCachePool;
import io.mycat.cache.CacheService;
import io.mycat.cache.LayerCachePool;
import io.mycat.config.loader.SchemaLoader;
import io.mycat.config.loader.xml.XMLSchemaLoader;
import io.mycat.config.model.SchemaConfig;
import io.mycat.config.model.SystemConfig;
import io.mycat.config.model.TableConfig;
import io.mycat.route.RouteResultset;
import io.mycat.route.RouteService;
import io.mycat.route.RouteStrategy;
import io.mycat.route.factory.RouteStrategyFactory;
import io.mycat.route.util.RouterUtil;
import io.mycat.server.parser.ServerParse;
import junit.framework.Assert;

public class DDLRouteTest {
	protected Map<String, SchemaConfig> schemaMap;
	protected LayerCachePool cachePool = new SimpleCachePool();
	protected RouteStrategy routeStrategy ;

	public DDLRouteTest() {
		String schemaFile = "/route/schema.xml";
		String ruleFile = "/route/rule.xml";
		SchemaLoader schemaLoader = new XMLSchemaLoader(schemaFile, ruleFile);
		schemaMap = schemaLoader.getSchemas();
		MycatServer.getInstance().getConfig().getSchemas().putAll(schemaMap);
		MycatServer.getInstance().getConfig().getSystem().setUseGlobleTableCheck(0); //DDL Route Test  不开启全局表一致性检查
        RouteStrategyFactory.init();
        routeStrategy = RouteStrategyFactory.getRouteStrategy("druidparser");
	}

	 @Test
	 public void testSpecialCharDDL() throws Exception {
		 SchemaConfig schema = schemaMap.get("TESTDB");
			CacheService cacheService = new CacheService();
	        RouteService routerService = new RouteService(cacheService);

	        // alter table test
	        String  sql = " ALTER TABLE COMPANY\r\nADD COLUMN TEST  VARCHAR(255) NULL AFTER CREATE_DATE,\r\n CHARACTER SET = UTF8";
	        sql = RouterUtil.getFixedSql(sql);
	        List<String> dataNodes = new ArrayList<>();
	        String  tablename =  RouterUtil.getTableName(sql, RouterUtil.getAlterTablePos(sql, 0));
	        Map<String, TableConfig>  tables = schema.getTables();
	        TableConfig tc;
	        if (tables != null && (tc = tables.get(tablename)) != null) {
	            dataNodes = tc.getDataNodes();
	        }
	        int nodeSize  = dataNodes.size();

	        int rs = ServerParse.parse(sql);
	        int sqlType = rs & 0xff;
	        RouteResultset rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
	        Assert.assertTrue("COMPANY".equals(tablename));
	        Assert.assertTrue(rrs.getNodes().length == nodeSize);
	 }

	/**
     * ddl deal test
     *
     * @throws Exception
     */
    @Test
    public void testDDL() throws Exception {
        SchemaConfig schema = schemaMap.get("TESTDB");
		CacheService cacheService = new CacheService();
        RouteService routerService = new RouteService(cacheService);

        // create table/view/function/..
        String sql = " create table company(idd int)";
        sql = RouterUtil.getFixedSql(sql);
        String upsql = sql.toUpperCase();

        //TODO : modify by zhuam
        // 小写表名,需要额外转为 大写 做比较
        String tablename =  RouterUtil.getTableName(sql, RouterUtil.getCreateTablePos(upsql, 0));
        tablename = tablename.toUpperCase();

        List<String> dataNodes = new ArrayList<>();
        Map<String, TableConfig> tables = schema.getTables();
        TableConfig tc;
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        int nodeSize = dataNodes.size();

        int rs = ServerParse.parse(sql);
		int sqlType = rs & 0xff;
        RouteResultset rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        // drop table test
        sql = " drop table COMPANY";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();

        tablename =  RouterUtil.getTableName(sql, RouterUtil.getDropTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();

        rs = ServerParse.parse(sql);
		sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        //alter table
        sql = "   alter table COMPANY add COLUMN name int ;";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getAlterTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();
        rs = ServerParse.parse(sql);
		sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        //truncate table;
        sql = " truncate table COMPANY";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getTruncateTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();
        rs = ServerParse.parse(sql);
		sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

    }

    @Test
    public void testDDLDefaultNode() throws Exception {
        SchemaConfig schema = schemaMap.get("solo1");
        CacheService cacheService = new CacheService();
        RouteService routerService = new RouteService(cacheService);

        // create table/view/function/..
        String sql = " create table company(idd int)";
        sql = RouterUtil.getFixedSql(sql);
        String upsql = sql.toUpperCase();

        //TODO:modify by zhuam 小写表名,转为大写比较
        String tablename =  RouterUtil.getTableName(sql, RouterUtil.getCreateTablePos(upsql, 0));
        tablename = tablename.toUpperCase();

        List<String> dataNodes = new ArrayList<>();
        Map<String, TableConfig> tables = schema.getTables();
        TableConfig tc;
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        int nodeSize = dataNodes.size();
        if (nodeSize==0&& schema.getDataNode()!=null){
            nodeSize = 1;
        }

        int rs = ServerParse.parse(sql);
        int sqlType = rs & 0xff;
        RouteResultset rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        // drop table test
        sql = " drop table COMPANY";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getDropTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();
        if (nodeSize==0&& schema.getDataNode()!=null){
            nodeSize = 1;
        }
        rs = ServerParse.parse(sql);
        sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        // drop table test
        sql = " drop table if exists COMPANY";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getDropTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();
        if (nodeSize==0&& schema.getDataNode()!=null){
            nodeSize = 1;
        }
        rs = ServerParse.parse(sql);
        sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        //alter table
        sql = "   alter table COMPANY add COLUMN name int ;";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getAlterTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();

        if (nodeSize==0&& schema.getDataNode()!=null){
            nodeSize = 1;
        }
        rs = ServerParse.parse(sql);
        sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

        //truncate table;
        sql = " truncate table COMPANY";
        sql = RouterUtil.getFixedSql(sql);
        upsql = sql.toUpperCase();
        tablename =  RouterUtil.getTableName(sql, RouterUtil.getTruncateTablePos(upsql, 0));
        tables = schema.getTables();
        if (tables != null && (tc = tables.get(tablename)) != null) {
            dataNodes = tc.getDataNodes();
        }
        nodeSize = dataNodes.size();

        if (nodeSize==0&& schema.getDataNode()!=null){
            nodeSize = 1;
        }

        rs = ServerParse.parse(sql);
        sqlType = rs & 0xff;
        rrs = routerService.route(new SystemConfig(), schema, sqlType, sql, "UTF-8", null);
        Assert.assertTrue("COMPANY".equals(tablename));
        Assert.assertTrue(rrs.getNodes().length == nodeSize);

    }

    @Test
    public void testTableMetaRead() throws Exception {
        final SchemaConfig schema = schemaMap.get("cndb");

        String sql = "desc offer";
        RouteResultset rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.DESCRIBE, sql, null, null,
                cachePool);
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("desc offer", rrs.getNodes()[0].getStatement());

        sql = " desc cndb.offer";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.DESCRIBE, sql, null, null, cachePool);
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("desc offer", rrs.getNodes()[0].getStatement());

        sql = " desc cndb.offer col1";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.DESCRIBE, sql, null, null, cachePool);
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("desc offer col1", rrs.getNodes()[0].getStatement());

        sql = "SHOW FULL COLUMNS FROM  offer  IN db_name WHERE true";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.SHOW, sql, null, null,
                cachePool);
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("SHOW FULL COLUMNS FROM offer WHERE true",
                rrs.getNodes()[0].getStatement());

        sql = "SHOW FULL COLUMNS FROM  db.offer  IN db_name WHERE true";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.SHOW, sql, null, null,
                cachePool);
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("SHOW FULL COLUMNS FROM offer WHERE true",
                rrs.getNodes()[0].getStatement());

        sql = "SHOW FULL TABLES FROM `TESTDB` WHERE Table_type != 'VIEW'";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.SHOW, sql, null, null,
                cachePool);
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals("SHOW FULL TABLES WHERE Table_type != 'VIEW'", rrs.getNodes()[0].getStatement());

        sql = "SHOW INDEX  IN offer FROM  db_name";
        rrs = routeStrategy.route(new SystemConfig(), schema, ServerParse.SHOW, sql, null, null,
                cachePool);
        Assert.assertEquals(false, rrs.isCacheAble());
        Assert.assertEquals(-1L, rrs.getLimitSize());
        Assert.assertEquals(1, rrs.getNodes().length);
        // random return one node
        // Assert.assertEquals("offer_dn[0]", rrs.getNodes()[0].getName());
        Assert.assertEquals("SHOW INDEX  FROM offer",
                rrs.getNodes()[0].getStatement());
    }

}


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _element_element = require('./element/_element');

var _element_element2 = _interopRequireDefault(_element_element);

var _event_event = require('./event/_event');

var _event_event2 = _interopRequireDefault(_event_event);

var _fix_fix = require('./fix/_fix');

var _fix_fix2 = _interopRequireDefault(_fix_fix);

var _get_get = require('./get/_get');

var _get_get2 = _interopRequireDefault(_get_get);

var _is_is = require('./is/_is');

var _is_is2 = _interopRequireDefault(_is_is);

var _maintain_maintain = require('./maintain/_maintain');

var _maintain_maintain2 = _interopRequireDefault(_maintain_maintain);

var _map_map = require('./map/_map');

var _map_map2 = _interopRequireDefault(_map_map);

var _observe_observe = require('./observe/_observe');

var _observe_observe2 = _interopRequireDefault(_observe_observe);

var _query_query = require('./query/_query');

var _query_query2 = _interopRequireDefault(_query_query);

var _style_style = require('./style/_style');

var _style_style2 = _interopRequireDefault(_style_style);

var _when_when = require('./when/_when');

var _when_when2 = _interopRequireDefault(_when_when);

var _version = require('./version');

var _version2 = _interopRequireDefault(_version);

// save current window.ally for noConflict()
var conflicted = typeof window !== 'undefined' && window.ally;

exports['default'] = {
  element: _element_element2['default'],
  event: _event_event2['default'],
  fix: _fix_fix2['default'],
  get: _get_get2['default'],
  is: _is_is2['default'],
  maintain: _maintain_maintain2['default'],
  map: _map_map2['default'],
  observe: _observe_observe2['default'],
  query: _query_query2['default'],
  style: _style_style2['default'],
  when: _when_when2['default'],
  version: _version2['default'],
  noConflict: function noConflict() {
    if (typeof window !== 'undefined' && window.ally === this) {
      window.ally = conflicted;
    }

    return this;
  }
};
module.exports = exports['default'];
//# sourceMappingURL=ally.js.map


text:
package code.comet

import net.liftweb._
import http._
import util._
import Helpers._
import actor._
import common.{Box, Full, Empty, Failure}
import java.util.Date
import mapper._

import code.model._

object PokeMaster extends LiftActor with ListenerManager  {
  def createUpdate = ()

  override def lowPriority = {
    case p : PokeSig => updateListeners(p)
  }

  def createPoke(from: User, to: User) = {
    val existingPokes: List[Poke] =
      Poke.findAll(By(Poke.fromUser, from), By(Poke.toUser, to))

    if (existingPokes.length == 0) {
      var poke = Poke.create
      poke.fromUser(from)
      poke.toUser(to)
      poke.time(new Date())
      poke.save
      S.notice("You have successfully poked " + to.firstName)
      val pokes = to.getIncomingPokes()

      println("\n\n\nBitno: onaj drugi ima spremljenih " + pokes.length +
	      " novih pokeova\n\n\n")

      updateListeners(new PokeSig(poke))
    } else
      S.notice("Your last poke is still pending")
  }

  def deletePoke(poke: Poke) {
    poke.delete_!
    S.notice("You have removed the poke")
    updateListeners(new PokeSig(poke))
  }

  def pokeBack(poke: Poke) {
    var us = (poke.fromUser.obj, poke.toUser.obj)

    us match {
      case (Full(a), Full(b)) => {
	poke.delete_!
	PokeMaster.createPoke(b, a)
      }
      case _ =>
	S.notice("The poke currently cannot be processed")
    }
  }
}

case class PokeSig(poke : Poke)


text:
TESTS_DIR = ../../..

INFER_OPTIONS = --pulse-only --erlang-with-otp-specs --debug-exceptions --project-root $(TESTS_DIR) --print-types
INFERPRINT_OPTIONS = --issues-tests

SOURCES = $(wildcard *.erl)

include $(TESTS_DIR)/erlc.make

infer-out/report.json: $(MAKEFILE_LIST)


text:
package com.netflix.metacat.common.type;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import lombok.Getter;

import java.util.List;

/**
 * Array type class.
 *
 * @author zhenl
 */
@Getter
public class ArrayType extends AbstractType implements ParametricType {
    /**
     * default.
     */
    static final ArrayType ARRAY = new ArrayType(BaseType.UNKNOWN);
    private final Type elementType;

    /**
     * Constructor.
     *
     * @param elementType elementtype
     */
    public ArrayType(final Type elementType) {
        super(TypeUtils.parameterizedTypeSignature(TypeEnum.ARRAY, elementType.getTypeSignature()));
        this.elementType = Preconditions.checkNotNull(elementType, "elementType is null");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TypeEnum getBaseType() {
        return TypeEnum.ARRAY;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Type createType(final List<Type> types, final List<Object> literals) {
        Preconditions.checkArgument(types.size() == 1, "Expected only one type, got %s", types);
        Preconditions.checkArgument(literals.isEmpty(), "Unexpected literals: %s", literals);
        return new ArrayType(types.get(0));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Type> getParameters() {
        return ImmutableList.of(getElementType());
    }
}


text:
"""
Tests for L{twisted.python.dist3}.
"""

from __future__ import absolute_import, division

import os
import twisted

from twisted.trial.unittest import TestCase
from twisted.python.dist3 import modulesToInstall
from twisted.python.dist3 import testDataFiles, _processDataFileList

class ModulesToInstallTests(TestCase):
    """
    Tests for L{modulesToInstall}.
    """
    def test_sanityCheck(self):
        """
        L{modulesToInstall} includes some obvious module names.
        """
        self.assertIn("twisted.internet.reactor", modulesToInstall)
        self.assertIn("twisted.python.test.test_dist3", modulesToInstall)

    def test_exist(self):
        """
        All modules listed in L{modulesToInstall} exist.
        """
        root = os.path.dirname(os.path.dirname(twisted.__file__))
        for module in modulesToInstall:
            segments = module.split(".")
            segments[-1] += ".py"
            path = os.path.join(root, *segments)
            alternateSegments = module.split(".") + ["__init__.py"]
            packagePath = os.path.join(root, *alternateSegments)
            self.assertTrue(os.path.exists(path) or
                            os.path.exists(packagePath),
                            "Module {0} does not exist".format(module))

    def test_dataFileExist(self):
        """
        All data files in L{testDataFiles} exist.
        """
        root = os.path.dirname(os.path.dirname(twisted.__file__))
        for file in testDataFiles:
            self.assertTrue(os.path.exists(
                os.path.join(root, os.path.sep.join(file.split(".")) + ".py")))

    def test_processDataFileList(self):
        """
        L{_processDataFileList} translates a list of files into a distutils
        friendly format.
        """
        result = _processDataFileList(["foo.bar", "foo.baz.bar",
                                       "foo.z", "baz.spam"])
        self.assertIn(("foo", [os.path.sep.join(["foo", "bar.py"]),
                               os.path.sep.join(["foo", "z.py"])]),
                      result)
        self.assertIn((os.path.sep.join(["foo", "baz"]),
                       [os.path.sep.join(["foo", "baz", "bar.py"])]),
                      result)
        self.assertIn(("baz", [os.path.sep.join(["baz", "spam.py"])]),
                      result)


text:
package dials.execution;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

public class ExecutionContext {

    private SimpleDateFormat sdf;

    private String featureName;
    private List<String> executionSteps;

    private boolean abandoned;
    private boolean executed;
    private boolean complete;

    public ExecutionContext(String featureName) {
        sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        executionSteps = Collections.synchronizedList(new ArrayList<String>());
        this.featureName = featureName;
    }

    public String getFeatureName() {
        return featureName;
    }

    public boolean getExecuted() {
        return executed;
    }

    public void setExecuted(boolean executed) {
        this.executed = executed;
        complete = true;
    }

    public boolean isAbandoned() {
        return abandoned;
    }

    public void setAbandoned(boolean abandoned) {
        this.abandoned = abandoned;
    }

    public List<String> getExecutionSteps() {
        return executionSteps;
    }

    public ExecutionContext addExecutionStep(String step) {
        if (!complete) {
            executionSteps.add(sdf.format(new Date()) + " - " + step);
        }
        return this;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(sdf.format(new Date()));
        sb.append(" - Feature Name: ");
        sb.append(featureName);
        sb.append("\n");
        sb.append(sdf.format(new Date()));
        sb.append(" - Executed: ");
        sb.append(executed ? "Yes" : "No");
        sb.append("\n");

        for (String step : executionSteps) {
            sb.append(step);
            sb.append("\n");
        }

        return sb.toString();
    }
}


text:
#import <Foundation/Foundation.h>

#import "ABI10_0_0RNSVGPath.h"

@interface ABI10_0_0RNSVGLine : ABI10_0_0RNSVGPath
@property (nonatomic, strong) NSString* x1;
@property (nonatomic, strong) NSString* y1;
@property (nonatomic, strong) NSString* x2;
@property (nonatomic, strong) NSString* y2;
@end


text:
/*
 * File automatically generated by
 * gengen 1.2 by Lorenzo Bettini
 * https://www.gnu.org/software/gengen
 */

#include "update_given.h"

void
update_given_gen_class::generate_update_given(ostream &stream, unsigned int indent)
{
  string indent_str (indent, ' ');
  indent = 0;

  stream << "args_info->";
  generate_string (option_var_name, stream, indent + indent_str.length ());
  stream << "_given += local_args_info.";
  generate_string (option_var_name, stream, indent + indent_str.length ());
  stream << "_given;";
  stream << "\n";
  stream << indent_str;
  stream << "local_args_info.";
  generate_string (option_var_name, stream, indent + indent_str.length ());
  stream << "_given = 0;";
  stream << "\n";
  stream << indent_str;
}


text:
Cordova Printer-Plugin
======================

A print plugin to print a file from android/ios cordova app using third party apps. It can print both in online/offline mode.

Modified from this plugin https://github.com/katzer/cordova-plugin-printer

## Supported Platforms
- **iOS** *(Print from iOS devices to AirPrint compatible printers or other printers using third party apps via wifi)*<br>
See [Drawing and Printing Guide for iOS](http://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/Printing/Printing.html) for detailed informations and screenshots.

- **Android** *(Print through 3rd party printing apps)*

## Adding the Plugin to your project
Through the [Command-line Interface](http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface):

```bash

cordova plugin add https://github.com/pankajnirwan103/cordova-plugin-printer.git
cordova build

## Removing the Plugin from your project
Through the [Command-line Interface](http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface):

cordova plugin rm nirwan.cordova.plugin.printer
```

## Release Notes

#### Version 0.1.0 (02.09.2014)
- *Based on the Print plugin made by* ***KAtzer***

## Using the plugin
The plugin creates the object ```window.plugin.printer```

## Android

### Get all available printing apps on Android
The callback function will be called with a second argument which is an array, indicating which printer apps are available for printing.
```javascript
window.plugin.printer.isServiceAvailable(
    function (isAvailable, installedAppIds) {
        alert('The following print apps are installed on your device: ' + installedAppIds.join(', '));
    }
);
```

### Printing
You need to download/save html using fileTransfer plugin https://github.com/apache/cordova-plugin-file-transfer. Make sure you use it after deviceReady event is called.

** Below example uses print share app for printing files.
```javascript

	var pdfHTML = document.getElementById('ELEMENT_TO_PRINT').innerHTML;
	var headstr = "<html><head><title></title></head><body>";
	var footstr = "</body>";

	var name = "downloaded_file.html";

	var filename = "cdvfile://localhost/persistent/" + name;

	var fileTransfer = new FileTransfer();

	fileTransfer.download(
		encodeURI('data:text/html;charset=utf-8,' + headstr+pdfHTML+footstr),
		filename,
		function(theFile){

			window.plugin.printer.isServiceAvailable(
				function (isAvailable, installedAppIds) {

					var isPrintShareInstalled = false;

					installedAppIds.forEach(function(entry) {

						if(entry == 'com.dynamixsoftware.printershare') {
							isPrintShareInstalled = true;
						}
					});

					if(isPrintShareInstalled) { //Going to send file for printing

						var page = "<HTML>hi</HTML>";
						window.plugin.printer.print(page, { 'appId': 'com.dynamixsoftware.printershare','filename': name ,'mimeType': 'text/html'});
						return;
					} else {
							alert(null, "Please install PrinterShare app <br> from Google PlayStore for printing.");
						}
					}
			);
		},
		function(error) {
			alert("download error source " + error.source);
			alert("download error target " + error.target);
			alert("upload error code: " + error.code);
		},
		true
	);
```

## License

This software is released under the [Apache 2.0 License](http://opensource.org/licenses/Apache-2.0).


text:
GROUP='0;33'    # gold
SUCCESS='0;32'  # green
FAIL='0;31'     # red

function logmsg {
    # USAGE: logmsg [-n] LEVELNAME [MESSAGE ...]
    #
    # Write a log message to STDOUT.
    # LEVELNAME  log level name (for colorization). Resulting message will be
    #            colorized (if STDOUT is a TTY) for common level names.
    #        -n  Do not write a trailing newline (must be *very first* argument)
    local echo_args=( -e )
    if [ "x${1}" == "x-n" ]; then
        shift
        echo_args+=( -n )
    fi
    local script=$(basename "$0")
    local levelname="$1"
    shift
    local msg="$*"
    local ccode=''
    local reset=''
    if [ -t 1 ]; then
        # only define color codes when STDOUT is a tty
        local color='0' # default no color
        case "$levelname" in
            DEBUG)
                color='1;35' # magenta
                ;;
            INFO)
                color='1;32' # green
                ;;
            WARNING)
                color='0;33' # gold
                ;;
            ERROR)
                color='1;31' # red
                ;;
        esac
        ccode="\\033[${color}m"
        reset='\033[0m'
    fi
    echo "${echo_args[@]}" "[${script}] ${ccode}${levelname}${reset}: $msg"
}

function func_text {
    # USAGE: func_text FUNC_NAME [FUNC_NAME ...]
    #
    # Write the full definition of function(s) FUNC_NAME to stdout.
    local func_name
    for func_name in "$@"; do
        if ! type "$func_name" 2>&1 | grep -E " is a function$" >/dev/null; then
            logmsg ERROR "$func_name is not a function"
            return 1
        fi
        type "$func_name" | tail -n +2
        echo ''
    done
}

function truthy {
    # USAGE: truthy [false|true|no|yes|off|on|0|1]
    #
    # Return with a success or failure based on whether or not the provided
    # argument is "truthy".
    function _usage {
        logmsg ERROR "USAGE: truthy [false|true|no|yes|off|on|0|1]"
        logmsg ERROR "$*"
    }
    if [ $# -gt 1 ]; then
        _usage "too many arguments: $*"
        exit 1
    fi
    local value="$1"
    if [ -n "$value" ]; then
        if echo "$value" | grep -Ei '^(t(rue)?|y(es)?|on|1)$' >/dev/null; then
            return 0
        elif echo "$value" | grep -Ei '^(f(alse)?|n(o)?|off|0)$' >/dev/null; then
            return 1
        else
            _usage "invalid boolean string: '$value'"
            exit 1
        fi
    else
        # absent == false
        return 1
    fi
}

function log_group_begin {
    # Public function for starting a CI group.  Scripts may safely use this
    # without concern for "which CI tool" is used under the hood.
    local group_info="$*"
    _gh_workflow_group_begin "$group_info"
    _log_force_color "$GROUP" INFO "$group_info"
}

function log_group_end {
    # Public function for ending a CI group.  Scripts may safely use this
    # without concern for "which CI tool" is used under the hood.
    _gh_workflow_group_end
}

function log_success {
    _log_force_color "$SUCCESS" INFO "$@"
}

function log_fail {
    _log_force_color "$FAIL" ERROR "$@"
}

function _log_force_color {
    local ccode="$1"
    local levelname="$2"
    shift 2
    local prefix=$(logmsg "$levelname")
    local msg="$*"
    echo -e "${prefix}\\033[${ccode}m${msg}\\033[0m"
}

function _gh_workflow_group_begin {
    # use GitHub workflow grouping log lines
    # see: https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#grouping-log-lines
    local group_info="$*"
    if truthy "$GITHUB_ACTIONS"; then
        echo "::group::${group_info}"
    fi
}

function _gh_workflow_group_end {
    if truthy "$GITHUB_ACTIONS"; then
        echo "::endgroup::"
    fi
}


text:
"""
Core simulation package -- Functionality for scientific models and simulations

Author: Joe Monaco, jmonaco@jhu.edu

Copyright (c) 2009-2011 Johns Hopkins University. All rights reserved.

This software is provided AS IS under the terms of the Open Source MIT License.
See http://www.opensource.org/licenses/mit-license.php.
"""

import os as _os
import sys as _sys

# Time formatting

TS_FMT = "%A %b %d %Y [%I:%M:%S%p]"

# Determine and create (if necessary) analysis output directorgrid_modely

ANA_SUBDIR = 'grid_model'
RC_FILE = '.grid_model'

if _sys.platform == 'win32':
    HOME_DIR = _os.path.join(_os.getenv('SystemDrive'), _os.getenv('HOMEPATH'))
else:
    HOME_DIR = _os.getenv('HOME')

ANA_DIR = HOME_DIR
found = False
rc_path = _os.path.join(HOME_DIR, RC_FILE)
if _os.path.exists(rc_path):
    try:
        fd = file(rc_path, 'r')
        ANA_DIR = _os.path.abspath(fd.readline().strip())
    except IOError:
        pass
    else:
        if _os.path.isdir(ANA_DIR):
            found = True
        elif (raw_input('Output directory not found: %s\nRecreate? (y/n) '%ANA_DIR).lower()=='y'):
                _os.makedirs(ANA_DIR)
                found = True
    finally:
        fd.close()
if not found:
    ANA_DIR = _os.path.join(HOME_DIR, ANA_SUBDIR)
    if not _os.path.isdir(ANA_DIR):
        if (raw_input('Create default output directory? (%s)\n(y/n) '%ANA_DIR).lower()=='y'):
            _os.makedirs(ANA_DIR)
        else:
            _tempdir = raw_input('Specify output directory [then hit Enter]:\n')
            ANA_DIR = _os.path.abspath(_os.path.realpath(_tempdir))
            if not _os.path.isdir(ANA_DIR):
                _os.makedirs(ANA_DIR)
    fd = file(rc_path, 'w')
    fd.write(ANA_DIR + '\n')
    fd.close()
    _sys.stdout.write('Analysis output directory:\n\tSettings file: %s\n\tDirectory: %s\n'%(rc_path, ANA_DIR))

# Message strings used in Model class

MODEL_MESSAGES = {
	'TRIALSTOP': ('Enter \'stop\' to end the program. Anything else will cancel and rerun the current trial.',
		'Trial Stopped', 'info'),
	'UNHEXC': ('Trial %d at t=%.2f seconds\n\n%s: %s', 'Unhandled exception', 'error'),
	'TRIALRST': ('Resetting to trial %d due to missing trial data!', 'Missing data', 'monitor'),
	'SAVEFAIL': ('KeyError: %s\n\nRerunning trial...', 'Save failure', 'error'),
	'DPATH': ('Failed to create data directory: %s', '', 'error'),
	'DPFILE': ('Regular file exists and is not a directory: %s', 'Path error', 'error'),
	'DPFAIL': ('Failed to create data directory: %s', 'Path error', 'error'),
	'DPCREATE': ('Data directory created: %s', 'Data path', 'info')
}


text:
module PaczkomatReader
  # Configurator for overriding default confg values
  # @example Override only cache_ttl only rubocop
  # Config.configure do |conf|
  #   conf.cache_ttl = 120
  # end
  class Config
    class << self
      attr_accessor :config

      # @return [PaczkomatReader::Config] config for dev tools
      # @note We check if it initialized, because if user wants to use it
      #   with any changes, he won't create a paczkomat_reader.rb initializer file so we need
      #   to configure it with defaults
      def config
        @config || setup {}
      end
    end

    # Define atrr accessors for all config options
    attr_accessor :api_path
    attr_accessor :cache_ttl

    # Initializes configuration and turn on by default
    # all the commands
    def initialize
      self.cache_ttl = 60
      self.api_path = 'https://api-pl.easypack24.net/v4/'
    end

    # Configurating method
    def self.setup(&block)
      self.config = new

      block.call(config)
      config.freeze
    end
  end
end


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto

namespace Google\Cloud\AssuredWorkloads\V1beta1;

if (false) {
    /**
     * This class is deprecated. Use Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings instead.
     * @deprecated
     */
    class Workload_CJISSettings {}
}
class_exists(Workload\CJISSettings::class);
@trigger_error('Google\Cloud\AssuredWorkloads\V1beta1\Workload_CJISSettings is deprecated and will be removed in a future release. Use Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings instead', E_USER_DEPRECATED);


text:
package com.ryougi.model;

public class Books {
	private String ISBN, bookName, author, translator, publisher, bookIndex, pressYear, state, number, source;
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	private double price;
	public String getISBN() {
		return ISBN;
	}
	public void setISBN(String iSBN) {
		ISBN = iSBN;
	}
	public String getBookName() {
		return bookName;
	}
	public void setBookName(String bookName) {
		this.bookName = bookName;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getTranslator() {
		return translator;
	}
	public void setTranslator(String translator) {
		this.translator = translator;
	}
	public String getPublisher() {
		return publisher;
	}
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
	public String getBookIndex() {
		return bookIndex;
	}
	public void setBookIndex(String bookIndex) {
		this.bookIndex = bookIndex;
	}
	public String getPressYear() {
		return pressYear;
	}
	public void setPressYear(String pressYear) {
		this.pressYear = pressYear;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
}


text:
/*
    Invert a binary tree.

   * Example:
        Input:

                         4
                       /   \
                      2     7
                     / \   / \
                    1   3 6   9
        Output:

                         4
                       /   \
                      7     2
                     / \   / \
                    9   6 3   1

    Trivia:
        This problem was inspired by this original tweet by Max Howell:
        Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so f*** off.
*/
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {TreeNode}
 */
var invertTree = function(root) {
    if(!root)
        return null;
    let left = invertTree(root.left);
    let right = invertTree(root.right);
    root.left = right;
    root.right = left;
    return root;
};