text:
require "helper"

describe Airbrite::Concerns::Fetchable do
  context "#fetch" do
    it "creates a new instance of the class and refreshes it" do
      fetchable = double("fetchable")
      args = {:id => 123}
      Airbrite::Event.should_receive(:new).with(args).and_return(fetchable)
      fetchable.should_receive(:refresh)
      result = Airbrite::Event.fetch args
      result.should == fetchable
    end
  end

  context "#refresh" do
    it "replaces its contents with the data the client gets from the instance_url" do
      event = Airbrite::Event.new
      event._id = 5
      event.name = "click"
      response = double("response")
      response.should_receive(:data).and_return(:_id => 5, :name => "hover")
      Airbrite::Client.instance.should_receive(:get).with(event.instance_url).and_return(response)
      event.refresh
      event.name.should == "hover"
    end
  end
end


text:
<?php

namespace App\Controller;

use App\Entity\Deal;
use App\Entity\User;
use App\Form\DealAdminType;
use App\Form\RegistrationFormType;
use App\Repository\DealRepository;
use App\Services\S3Service;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\String\Slugger\SluggerInterface;
use AsyncAws\SimpleS3\SimpleS3Client;
use AsyncAws\S3\S3Client;

class DealController extends AbstractController
{

    public function __construct(EntityManagerInterface $em, DealRepository $dealRepo)
    {
        $this->dealRepo = $dealRepo;
        $this->em = $em;
        $this->s3service = new S3Service();

    }

    /**
     * @Route("/deal/{id}", name="deal")
     * @param Deal $deal

     */
    public function getDeal(int $id)
    {
        $deal = $this->dealRepo->findOneBy([
            "id" => $id
        ]);
        return $this->render('deal/index.html.twig', [
            'deal' => $deal,
        ]);
    }

    /**
     * @Route("/administration/deals", name="admin.deals")
     */
    public function adminDeals()
    {

        $allDeals = $this->dealRepo->findAll();
        return $this->render('admin/deal/liste.html.twig', [
            'controller_name' => 'DealController',
            'deals' => $allDeals
        ]);
    }

    /**
     * @Route("/administration/deal/create", name="admin.deal.create")
     */
    public function adminCreateDeal(Request $request,SluggerInterface $slugger,LoggerInterface $logger)
    {
        $logger->info("[Create Deal starting] ");
        $deal = new Deal();
        $form = $this->createForm(DealAdminType::class, $deal);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {

            $imgFile = $form->get('img')->getData();

            //manage Image
            if($imgFile){
                $originalFilename = pathinfo($imgFile->getClientOriginalName(), PATHINFO_FILENAME);
                $safeFilename = $slugger->slug($originalFilename);
                $newFilename = $safeFilename.'-'.uniqid().'.'.$imgFile->guessExtension();
                try {
                    $s3 = $this->s3service->uploadImageToS3($imgFile, $newFilename);
                } catch (FileException $e) {
                    // ... handle exception if something happens during file upload
                }
                $deal->setImgName($newFilename);
            }

            $entityManager = $this->getDoctrine()->getManager();
            $deal->setCreationDate(new \DateTime('now'));
            $deal->setPoints(0);
            $deal->setAccepted(false);
            $deal->setCreator($this->getUser());
            $entityManager->persist($deal);
            $entityManager->flush();

            $allDeals = $this->dealRepo->findAll();
            return $this->render('admin/deal/liste.html.twig', [
                'controller_name' => 'DealController',
                'deals' => $allDeals
            ]);
        }

        return $this->render('admin/deal/createNewDeal.html.twig', [
            'createDealForm' => $form->createView(),
        ]);

    }

    /**
     * @Route("/admin/deal/edit/{id}", name="admin.deal.edit")
     * @param Deal $deal
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function adminEditDeal(Deal $deal,Request $request,SluggerInterface $slugger,LoggerInterface $logger)
    {

        $logger->info("[EditDeal starting] ");

        $form = $this->createForm(DealAdminType::class, $deal);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $imgFile = $form->get('img')->getData();

            //manage Image
            if($imgFile){
                $originalFilename = pathinfo($imgFile->getClientOriginalName(), PATHINFO_FILENAME);
                $safeFilename = $slugger->slug($originalFilename);
                $newFilename = $safeFilename.'-'.uniqid().'.'.$imgFile->guessExtension();

                $s3 = $this->s3service->uploadImageToS3($imgFile, $newFilename);

                if($deal->getImgName()){
                    $this->s3service->removeUploadOld($deal, $s3);
                }
                $deal->setImgName($newFilename);
            }

            $entityManager = $this->getDoctrine()->getManager();
            $deal->setCreationDate(new \DateTime('now'));
            $deal->setPoints(0);
            $entityManager->persist($deal);
            $entityManager->flush();

            $allDeals = $this->dealRepo->findAll();
            return $this->render('admin/deal/liste.html.twig', [
                'controller_name' => 'DealController',
                'deals' => $allDeals

            ]);
        }

        return $this->render('admin/deal/createNewDeal.html.twig', [
            'deal' =>$deal,
            'createDealForm' => $form->createView()
        ]);

    }

    public function removeFile($path)
    {
        if (!is_null($path) && $path !== '/') {
            $this->filesystem->remove($path);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
#include "lapacke.h"
#include "lapacke_utils.h"

lapack_int LAPACKE_dgbequ( int matrix_order, lapack_int m, lapack_int n,
                           lapack_int kl, lapack_int ku, const double* ab,
                           lapack_int ldab, double* r, double* c,
                           double* rowcnd, double* colcnd, double* amax )
{
    if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
        LAPACKE_xerbla( "LAPACKE_dgbequ", -1 );
        return -1;
    }
#ifndef LAPACK_DISABLE_NAN_CHECK
    /* Optionally check input matrices for NaNs */
    if( LAPACKE_dgb_nancheck( matrix_order, m, n, kl, ku, ab, ldab ) ) {
        return -6;
    }
#endif
    return LAPACKE_dgbequ_work( matrix_order, m, n, kl, ku, ab, ldab, r, c,
                                rowcnd, colcnd, amax );
}


text:
package org.jetbrains.java.decompiler.modules.decompiler;

import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;

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

public class PrimitiveExprsList {

  private final List<Exprent> lstExprents = new ArrayList<Exprent>();

  private ExprentStack stack = new ExprentStack();

  public PrimitiveExprsList() {
  }

  public PrimitiveExprsList copyStack() {
    PrimitiveExprsList prlst = new PrimitiveExprsList();
    prlst.setStack(stack.clone());
    return prlst;
  }

  public List<Exprent> getLstExprents() {
    return lstExprents;
  }

  public ExprentStack getStack() {
    return stack;
  }

  public void setStack(ExprentStack stack) {
    this.stack = stack;
  }
}


text:
<style>
    .token {
        margin-right: 0.5em;
        cursor: pointer;
    }
</style>

<span [class]="'token '+getClassName()" (click)="selectAnnotation()">{{annotation.token}}</span>


text:
<?php

namespace Geekhub\UserBundle\Model;

use JMS\Serializer\Annotation\Type;

class FacebookUserInfoResponse
{
    /**
     * @Type("integer")
     */
    protected $id;

    /**
     * @Type("string")
     */
    protected $name;

    /**
     * @Type("string")
     */
    protected $first_name;

    /**
     * @Type("string")
     */
    protected $last_name;

    /**
     * @Type("string")
     */
    protected $link;

    /**
     * @Type("string")
     */
    protected $birthday;

    /**
     * @Type("string")
     */
    protected $gender;

    /**
     * @Type("string")
     */
    protected $email;

    /**
     * @Type("string")
     */
    protected $website;

    /**
     * @Type("integer")
     */
    protected $timezone;

    /**
     * @Type("array")
     */
    protected $response;

    /**
     * @Type("string")
     */
    protected $locale;

    /**
     * @Type("Geekhub\UserBundle\Model\FacebookUserInfoLanguageType")
     */
    protected $languages;

    /**
     * @Type("boolean")
     */
    protected $verified;

    /**
     * @Type("string")
     */
    protected $updated_time;

    /**
     * @Type("string")
     */
    protected $username;

    public function getBirthday()
    {
        return $this->birthday;
    }

    /**
     * @param mixed $email
     */
    public function setEmail($email)
    {
        $this->email = $email;
    }

    /**
     * @return mixed
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * @param mixed $first_name
     */
    public function setFirstName($first_name)
    {
        $this->first_name = $first_name;
    }

    /**
     * @return mixed
     */
    public function getFirstName()
    {
        return $this->first_name;
    }

    /**
     * @param mixed $gender
     */
    public function setGender($gender)
    {
        $this->gender = $gender;
    }

    /**
     * @return mixed
     */
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $last_name
     */
    public function setLastName($last_name)
    {
        $this->last_name = $last_name;
    }

    /**
     * @return mixed
     */
    public function getLastName()
    {
        return $this->last_name;
    }

    /**
     * @param mixed $link
     */
    public function setLink($link)
    {
        $this->link = $link;
    }

    /**
     * @return mixed
     */
    public function getLink()
    {
        return $this->link;
    }

    /**
     * @param mixed $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param mixed $response
     */
    public function setResponse($response)
    {
        $this->response = $response;
    }

    /**
     * @return mixed
     */
    public function getResponse()
    {
        return $this->response;
    }

    /**
     * @param mixed $timezone
     */
    public function setTimezone($timezone)
    {
        $this->timezone = $timezone;
    }

    /**
     * @return mixed
     */
    public function getTimezone()
    {
        return $this->timezone;
    }

    /**
     * @param mixed $website
     */
    public function setWebsite($website)
    {
        $this->website = $website;
    }

    /**
     * @return mixed
     */
    public function getWebsite()
    {
        return $this->website;
    }

    /**
     * @param mixed $languages
     */
    public function setLanguages($languages)
    {
        $this->languages = $languages;
    }

    /**
     * @return mixed
     */
    public function getLanguages()
    {
        return $this->languages;
    }

    /**
     * @param mixed $locale
     */
    public function setLocale($locale)
    {
        $this->locale = $locale;
    }

    /**
     * @return mixed
     */
    public function getLocale()
    {
        return $this->locale;
    }

    /**
     * @param mixed $updated_time
     */
    public function setUpdatedTime($updated_time)
    {
        $this->updated_time = $updated_time;
    }

    /**
     * @return mixed
     */
    public function getUpdatedTime()
    {
        return $this->updated_time;
    }

    /**
     * @param mixed $username
     */
    public function setUsername($username)
    {
        $this->username = $username;
    }

    /**
     * @return mixed
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * @param mixed $verified
     */
    public function setVerified($verified)
    {
        $this->verified = $verified;
    }

    /**
     * @return mixed
     */
    public function getVerified()
    {
        return $this->verified;
    }
}


text:
function mibRoiList_cm_Callback(obj, parameter)
% function mibRoiList_cm_Callback(obj, parameter)
% a callback for obj.mibView.handles.mibRoiList context menu
%
% Parameters:
% parameter: a string with selected action
% - @li ''rename'' - rename ROI
% - @li ''edit'' - modify ROI
% - @li ''remove'' - remove ROI
%
% Return values:
%

% Copyright (C) 13.12.2016, Ilya Belevich, University of Helsinki (ilya.belevich @ helsinki.fi)
% part of Microscopy Image Browser, http:\\mib.helsinki.fi
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% Updates
%

global mibPath;

roiString = obj.mibView.handles.mibRoiList.String;
roiValue = obj.mibView.handles.mibRoiList.Value;
currentVal = roiString{roiValue};

if roiValue == 1; return; end;

index = obj.mibModel.I{obj.mibModel.Id}.hROI.findIndexByLabel(currentVal);

switch parameter
    case 'rename'  % set brightness on the screen to be the same as in the image
        answer = mibInputDlg({mibPath}, sprintf('Please add a new name for selected ROI:'), 'Rename ROI', currentVal);
        if isempty(answer); return; end;

        if sum(ismember([obj.mibModel.I{obj.mibModel.Id}.hROI.Data.label], answer))
            errordlg(sprintf('!!! Error !!!\n\nThe names for ROIs should be unique;\nPlease try another name!'));
            return;
        end

        obj.mibModel.I{obj.mibModel.Id}.hROI.Data(index).label = answer;

        % update roiList
        [number, indices] = obj.mibModel.I{obj.mibModel.Id}.hROI.getNumberOfROI();
        str2 = cell([number+1 1]);
        str2(1) = cellstr('All');
        for i=1:number
            %    str2(i+1) = cellstr(num2str(indices(i)));
            str2(i+1) = obj.mibModel.I{obj.mibModel.Id}.hROI.Data(indices(i)).label;
        end
        obj.mibView.handles.mibRoiList.String = str2;
    case 'edit'
        unFocus(obj.mibView.handles.mibRoiList);
        obj.mibModel.I{obj.mibModel.Id}.hROI.addROI(obj, [], index);
    case 'remove'
        obj.mibRoiRemoveBtn_Callback();
        notify(obj.mibModel, 'updateROI');  % notify mibModel about update of ROIs
end
obj.plotImage(0);
end


text:
from django.http import Http404, HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from utils import json_functions as json
import functools

def get_argument_or_404(request, param, method='REQUEST', code='404'):
    try:
        return getattr(request, method)[param]
    except KeyError:
        if code == '404':
            raise Http404
        else:
            return

def render_to(template):
    """
    Decorator for Django views that sends returned dict to render_to_response function
    with given template and RequestContext as context instance.

    If view doesn't return dict then decorator simply returns output.
    Additionally view can return two-tuple, which must contain dict as first
    element and string with template name as second. This string will
    override template name, given as parameter

    Parameters:

     - template: template name to use
    """
    def renderer(func):
        def wrapper(request, *args, **kw):
            output = func(request, *args, **kw)
            if isinstance(output, (list, tuple)):
                return render_to_response(output[1], output[0], RequestContext(request))
            elif isinstance(output, dict):
                return render_to_response(template, output, RequestContext(request))
            return output
        return wrapper
    return renderer

def is_true(value):
    if value == 1:
        return True
    return bool(value) and isinstance(value, basestring) and value.lower() not in ('false', '0')

class required_params(object):
    "Instances of this class can be used as decorators"

    def __init__(self, *args, **kwargs):
        self.params = args
        self.named_params = kwargs
        self.method = kwargs.get('method', 'REQUEST')

    def __call__(self, fn):
        def wrapper(request, *args, **kwargs):
            return self.view_wrapper(request, fn, *args, **kwargs)
        functools.update_wrapper(wrapper, fn)
        return wrapper

    def view_wrapper(self, request, fn, *args, **kwargs):
        if request.method != self.method and self.method != 'REQUEST':
            return self.disallowed(method=True, status_code=405)

        for param in self.params:
            if not getattr(request, self.method).get(param):
                return self.disallowed(param)

        for param, param_type in self.named_params.items():
            if not getattr(request, self.method).get(param):
                return self.disallowed(param)
            try:
                if not param_type(getattr(request, self.method).get(param)):
                    return self.disallowed(param, param_type)
            except (TypeError, ValueError):
                return self.disallowed(param, param_type)

        return fn(request, *args, **kwargs)

    def disallowed(self, param=None, param_type=None, method=False, status_code=400):
        if method:
            message = "Invalid HTTP method. Use %s." % self.method
        elif param_type:
            message = "Invalid paramter: %s - needs to be %s" % (
                param,
                param_type,
            )
        else:
            message = "Missing parameter: %s" % param

        return HttpResponse(json.encode({
            'message': message,
            'code': -1,
        }), mimetype="application/json", status=status_code)


text:
<?php declare(strict_types=1);
/**
 * PHP version 7.4
 *
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */

use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Rector\SOLID\Rector\Class_\ChangeReadOnlyVariableWithDefaultValueToConstantRector;
use Rector\SOLID\Rector\ClassMethod\UseInterfaceOverImplementationInConstructorRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\SOLID\Rector\Class_\RepeatedLiteralToClassConstantRector;
use Rector\SOLID\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

    $parameters->set(Option::PATHS, [
        __DIR__ . '/src',
        __DIR__ . '/tests/src/Alice',
        __DIR__ . '/tests/src/Behat',
        __DIR__ . '/tests/src/DataBuilders',
        __DIR__ . '/tests/src/Doctrine',
        __DIR__ . '/tests/src/Fakes',
        __DIR__ . '/tests/src/PhpSpec',
        __DIR__ . '/tests/src/PHPUnit',
        __DIR__ . '/tests/src/RabbitMq',
        __DIR__ . '/tests/src/Setup',
    ]);
    $parameters->set(Option::PHP_VERSION_FEATURES, '7.4');
    $parameters->set(Option::AUTO_IMPORT_NAMES, true);

    // here we can define, what sets of rules will be applied
    $parameters->set(Option::SETS, [
        SetList::CODE_QUALITY,
        SetList::PHP_74,
        SetList::SOLID,
    ]);

    $parameters->set(Option::EXCLUDE_RECTORS, [
        UseInterfaceOverImplementationInConstructorRector::class,
        ExplicitBoolCompareRector::class,
        RepeatedLiteralToClassConstantRector::class,
        ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class,
        ChangeReadOnlyVariableWithDefaultValueToConstantRector::class,
    ]);
};


text:
@interface TCPPlayerPositionAndLookServer : TCPServerPacket

@property (nonatomic) double X;
@property (nonatomic) double Y;
@property (nonatomic) double Z;

@property (nonatomic) float Yaw;
@property (nonatomic) float Pitch;

@property (nonatomic) bool OnGround;

- (instancetype)initWithPlayer:(Player *)player;

@end


text:
<!DOCTYPE html>

		<title>live - demos</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

<template live id="Person">

${firstName} ${lastName} (${username})

${telephone}

${address}

${country}

${email}

</template>
<template live id="Place">

${name}

		${address}

${telephone}

${smokingAllowed}

${description}

</template>
<template id="Col3" live>

${$0}

${$1}

${$2}

</template>

<my-app live>

		${menu.map( link=>
			live`<button>${link}</button>`
		)}

With live template strings you can make you UI updates when the data changes.

		To acheive this, you need use the live function as a template string tag,
		with the new es6 backtick strings <samp>\`</samp>, this will transform the markup string provided into real DOM objects:

			var myDiv = live\`<div>Hello</div>\`
			console.log( myDiv.tagName ) // "div"

		OK, this is boring!! But what are the advantages?

		First, you gain advantages from new es6 template string like the
		ability to have multiline, to avoid the quote escaping nightmare,
		and then, the most exciting feature is the placeholders with <samp>\${var}</samp>:

			var who = "Doctor"
			var myDiv = live\`

				Hello
				\${who} !

\`

		Outputs :
		<xml-tree>

				Hello
				${who} !

		</xml-tree>

	First you have to make your data bindable:

		var myData = BindableProxy({
			your: "plain",
			data: "object"
		})

	This makes the properties of your object emitting changes event:

		myData.your.on( e=> console.info('myData.your cahnged from %s to %s', e.old, e.new ) )
		// then
		myData.your = 'world' // {type: "propertyChange", old: "plain", new: "world"}

	You can create a standalone bindable property with Property:

		var title = Property({value: "Hello world"})

	Once

		<demo>
			var personData = BindableProxy({
		"@context": "http://schema.org/",
		"@type": "Person",
		profile: "https://placekitten.com/g/128/170",
		firstName: "Jeanne",
		lastName: "Dupond",
		username: "Jeannette",
		email: "42@Utopia.coop",
		address: "42 av. Utopia",
		country: "France",
		telephone: "06 69 69 69 69"
	})
			var Person = data => live\`

\${data.firstName} \${data.lastName} (\${data.username})

\${data.telephone}

\${data.address}

\${data.country}

\${data.email}

\`
document.body.appendChild( Person(personData) );

			<xml-tree>

\${personData.firstName} \${personData.lastName} (\${personData.username})

\${personData.telephone}

\${personData.address}

\${personData.country}

\${personData.email}

			</xml-tree>

			${person = Person( personData )}

		</demo>
		${editor1 = new Editor(personData),editor1.pre}

		<demo>
			${place = Place(placeData)}
		</demo>
		${editor2 = new Editor(placeData),editor2.pre}

		<demo>
		</demo>
		${editor4 = new Editor(theme),editor4.pre}

		<demo>
			var data = Bindable({
		state: "urgent",
		foo: "bar",
		tag: "div",
		name: "Jean",
		rest: "içi"
	})

				document.body.appendChild( live\`<span class="\${data.state}">\${data.foo}</span>\` )

				${data.foo}

				${n6 = live`<span id="n6" class="${data.state}">${data.foo}</span>`}

				document.body.appendChild( live\`<span id="n7" class="\${data.state} \${data.name}">\${data.foo}</span>\` )

				${data.foo}

				${n7 = live`<span id="n7" class="${data.state} ${data.name}">${data.foo}</span>`}

				document.body.appendChild( live\`<span id="n8" class="before \${data.state} \${data.name} after">\${data.foo}</span>\` )

				${data.foo}

				${n8 = live`<span id="n8" class="before ${data.state} ${data.name} after">${data.foo}</span>`}

				document.body.appendChild( live\`<span id="n9" class="before \${data.state} \${data.name} after" title="\${data.name}">\${data.foo}</span>\` )

				${data.foo}

				${n9 = live`<span id="n9" class="before ${data.state} ${data.name} after" title="${data.name}">${data.foo}</span>`}

		</demo>
		${editor3 = new Editor(data),editor3.pre}

</my-app>


text:
{-# LANGUAGE GADTSyntax #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE NoImplicitPrelude #-}

{-
  Copyright 2020 The CodeWorld Authors. All rights reserved.

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

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

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-}
module Internal.Prelude
  ( ifThenElse, -- For RebindableSyntax
    fail, -- for RebindableSyntax
    -- Comparison
    (==),
    (/=),
    -- Truth
    Truth,
    Bool (..),
    (&&),
    (||),
    not,
    otherwise,
    -- Currying and uncurrying
    toOperator,
    fromOperator,
    -- Tuples
    firstOfPair,
    secondOfPair,
    -- Failures
    error, -- Text version
    undefined,
    -- List functions
    (P.++),
    empty,
    contains,
    length,
    at,
    (#),
    any,
    all,
    none,
    repeated,
    repeating,
    first,
    last,
    rest,
    groups,
    while,
    until,
    after,
    concatenation,
    L.subsequences,
    L.permutations,
    sorted,
    reversed,
    unique,
    transposed,
    -- Random numbers
    randomsFrom,
    randomNumbers,
    shuffled,
  )
where

import Data.Bits (xor)
import Data.Function (on)
import qualified Data.List as L
import GHC.Stack (HasCallStack, withFrozenCallStack)
import Internal.Num
import Internal.Text
import Internal.Truth
import System.Random hiding (split)
import System.Random.Shuffle (shuffle')
import qualified "base" Prelude as P
import "base" Prelude (($), (.), Bool)

-- | Converts a function to an operator.
--
-- Example use:
--
-- >  f(x,y) = 2*x + y
-- >  (%) = toOperator(f)
-- >
-- >  eight = 3 % 2
--
-- This has the same effect as defining % as:
--
-- >  x % y = 2*x + y
-- >  eight = 3 % 2
toOperator :: ((a, b) -> c) -> (a -> b -> c)
toOperator = P.curry

-- | Converts an operator into a normal function.
--
-- Example use:
--
-- >  divide = fromOperator(/)
-- >  four = divide(16, 4)
fromOperator :: (a -> b -> c) -> ((a, b) -> c)
fromOperator = P.uncurry

-- | Returns the first element of an ordered pair.
firstOfPair :: (a, b) -> a
firstOfPair (a, b) = a

-- | Returns the second element of an ordered pair.
secondOfPair :: (a, b) -> b
secondOfPair (a, b) = b

-- | Fails with an error message.
error :: HasCallStack => Text -> a
error msg = withFrozenCallStack (P.error (toString msg))

-- | Represents an undefined value.  This lets you compile programs with unfinished
-- values.  If the value is needed, the program will crash.
undefined :: HasCallStack => a
undefined = withFrozenCallStack (P.error "Value is not defined.")

-- | Fails with an error message.  This is required (though apparently unused)
-- by the desugaring for pattern binds in list comprehensions.
fail :: HasCallStack => P.String -> a
fail msg = withFrozenCallStack (P.error msg)

-- | Determines whether a list is empty or not.
empty :: [a] -> Truth
empty [] = P.True
empty _ = P.False

-- | Determines whether a value is a member of a list or not.
contains :: ([a], a) -> Truth
contains (xs, x) = P.any (== x) xs

-- | Gives the length of a list.
length :: [a] -> Number
length = fromInt . P.length

-- | Gives a list with a replaced element at an index.
-- Indices start at 1.
at :: HasCallStack => ([a], a, Number) -> [a]
at (list, val, idx)
  | not (isInteger (idx)) = withFrozenCallStack $ idxErrorNonInt idx
  | idx <= 0 = withFrozenCallStack $ idxErrorNonPos idx
  | otherwise = withFrozenCallStack $ go idx list
  where
    go _ [] = idxErrorTooLarge idx
    go 1 (x : xs) = val : xs
    go n (x : xs) = x : go (n - 1) xs

-- | Gives the member of a list at a given index.
-- Indices start at 1.
(#) :: HasCallStack => [a] -> Number -> a
list # idx
  | not (isInteger (idx)) = withFrozenCallStack $ idxErrorNonInt idx
  | idx <= 0 = withFrozenCallStack $ idxErrorNonPos idx
  | otherwise = withFrozenCallStack $ go idx list
  where
    go _ [] = idxErrorTooLarge idx
    go 1 (x : xs) = x
    go n (x : xs) = go (n - 1) xs

infixl 9 #

idxErrorNonInt :: HasCallStack => Number -> a
idxErrorNonInt idx = P.error "Non-integer list index is not allowed."

idxErrorNonPos :: HasCallStack => Number -> a
idxErrorNonPos idx =
  P.error "List index must be positive. Numbering starts at 1."

idxErrorTooLarge :: HasCallStack => Number -> a
idxErrorTooLarge idx = P.error "List index is too large."

-- | Determines if any proposition in a list is true.
--
-- For example, @any([even(n) | n <- [1,2,3]])@ is 'True', because 2 is even.
any :: [Truth] -> Truth
any = P.or

-- | Determines if all propositions in a list are true.
--
-- For example, @all([even(n) | n <- [2,3,4]])@ is 'False', because 3 is not even.
all :: [Truth] -> Truth
all = P.and

-- | Determines if all propositions in a list are false.
--
-- For example, @none([odd(n) | n <- [2,3,4]])@ is 'False', because 3 is odd.
none :: [Truth] -> Truth
none = P.not . any

-- | Forms a list by repeating a source list some number of times.
repeated :: ([a], Number) -> [a]
repeated (xs, 0) = []
repeated (xs, n) = xs P.++ repeated (xs, n - 1)

-- | Forms a list by repeating a source list forever.
repeating :: [a] -> [a]
repeating = P.cycle

-- | Gives the first members of a list, up to the given number.
first :: HasCallStack => ([a], Number) -> [a]
first (xs, n) = withFrozenCallStack (P.take (toInt n) xs)

-- | Gives the last members of a list, up to the given number.
last :: HasCallStack => ([a], Number) -> [a]
last (xs, n) = withFrozenCallStack (P.drop (P.length xs P.- toInt n) xs)

-- | Gives all members of a list after the given number.
--
-- In general, @xs = first(xs, n) ++ rest(xs, n)@.
rest :: HasCallStack => ([a], Number) -> [a]
rest (xs, n) = withFrozenCallStack (P.drop (toInt n) xs)

-- | Converts a list of elements into a list of smaller lists, each of the
-- given length.
--
-- For example, @[ (x, y) | [x, y] <- groups(randomNumbers(42), 2) ]@.
groups :: ([a], Number) -> [[a]]
groups ([], n) = []
groups (xs, n) =
  withFrozenCallStack $
    P.take (toInt n) xs : groups (P.drop (toInt n) xs, n)

-- | Gives the longest prefix of a list for which a condition is true.
--
-- For example, @while([2,4,5,6], even) = [2,4]@.
while :: ([a], a -> Truth) -> [a]
while (xs, p) = P.takeWhile p xs

-- | Gives the longest prefix of a list for which a condition is false.
--
-- For example, @until([2,4,5,6], odd) = [2,4]@.
until :: ([a], a -> Truth) -> [a]
until (xs, p) = P.takeWhile (P.not . p) xs

-- | Gives the remaining portion of a list after the longest prefix
-- for which a condition is true.
--
-- In general, @xs = while(xs, cond) ++ after(xs, cond)@.
after :: ([a], a -> Truth) -> [a]
after (xs, p) = P.dropWhile p xs

-- | Gives the concatenation of all of the lists in its input.
concatenation :: [[a]] -> [a]
concatenation = P.concat

-- | Gives a list of numbers reordered into increasing order.
sorted :: [Number] -> [Number]
sorted = L.sort

-- | Gives a list in the opposite order of the original.
reversed :: [a] -> [a]
reversed = P.reverse

-- | Gives a list with all duplicate members removed.
unique :: [a] -> [a]
unique = L.nubBy deepEq

transposed :: [[a]] -> [[a]]
transposed = L.transpose

-- For some reason, randoms numbers seem to give conspicuously similar
-- results early in the sequence, so we throw away a few to get better
-- mixing.
numToStdGen :: Number -> StdGen
numToStdGen r = mkStdGen (a `xor` P.fromIntegral b `xor` P.fromIntegral c)
  where
    (sig, a) = P.decodeFloat (P.realToFrac r)
    (b, c) = sig `P.divMod` (2 P.^ 31)

randomsFrom :: StdGen -> [Number]
randomsFrom g = fromDouble a : randomsFrom g2
  where
    (a, g2) = random g

shuffled :: ([a], Number) -> [a]
shuffled ([], r) = []
shuffled (xs, r) = shuffle' xs (P.length xs) (numToStdGen r)

randomNumbers :: Number -> [Number]
randomNumbers = randomsFrom . numToStdGen


text:
package com.github.nyrkovalex.get.me.param;

import org.junit.Before;
import org.junit.Test;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class ParamsTest {

	private String gitdepUrl;
	private String guavaUrl;

	@Before
	public void setUp() throws Exception {
		gitdepUrl = "git@github.com:nyrkovalex/gitdep.git";
		guavaUrl = "https://github.com/google/guava.git";
	}

	@Test
	public void testShouldSetRepositoryUrl() throws Exception {
		Params params = Params.from(gitdepUrl);
		assertTrue(params.getUrls().contains(RepoUrl.parse(gitdepUrl)));
	}

	@Test
	public void testShouldSetMultipleRepositoryUrls() throws Exception {
		Params params = Params.from(gitdepUrl, guavaUrl);
		List<RepoUrl> target = Arrays.asList(RepoUrl.parse(gitdepUrl), RepoUrl.parse(guavaUrl));
		assertTrue(params.getUrls().containsAll(target));
	}

	@Test
	public void testShouldEnableDebugMode() throws Exception {
		Params parameters = Params.from(gitdepUrl, "-debug");
		assertTrue(parameters.isDebug());
	}

	@Test(expected = WrongUsageException.class)
	public void testShouldThrowWhenNoArgumentsArePassed() throws Exception {
		Params.from();
	}

	@Test
	public void testShouldParseDebugAndOneUrl() throws Exception {
		String url = "https://github.com/my/repo";
		Params params = Params.from("-debug", url);
		Set<RepoUrl> urls = new HashSet<>(1);
		urls.add(RepoUrl.parse(url));
		assertThat(params.getUrls(), is(urls));
		assertThat(params.isDebug(), is(true));
	}

	@Test
	public void testShouldParseTwoUrls() throws Exception {
		String url1 = "https://github.com/my/repo";
		String url2 = "https://github.com/my/repo::branch-1";
		Params params = Params.from(url1, url2);
		Set<RepoUrl> urls = new HashSet<>(2);
		urls.add(RepoUrl.parse(url1));
		urls.add(RepoUrl.parse(url2));
		assertThat(params.getUrls(), is(urls));
		assertThat(params.isDebug(), is(false));
	}
}


text:
namespace CGAL {

template<class Nef3, typename forward_iterator>
class Shell_constructor : public Modifier_base<typename Nef3::SNC_structure> {

  typedef Nef3                                   Nef_polyhedron;
  typedef typename Nef_polyhedron::SNC_structure   SNC_structure;
  typedef typename SNC_structure::SM_decorator     SM_decorator;
  typedef typename SNC_structure::Vertex_handle    Vertex_handle;
  typedef typename SNC_structure::SVertex_handle   SVertex_handle;
  typedef typename SNC_structure::SHalfedge_handle SHalfedge_handle;
  typedef typename SNC_structure::SFace_handle     SFace_handle;
  typedef typename SNC_structure::Sphere_point     Sphere_point;
  typedef typename SNC_structure::Sphere_circle    Sphere_circle;
  typedef typename SNC_structure::Kernel           Kernel;
  typedef typename Kernel::Line_3                  Line_3;

  std::vector<Vertex_iterator>   Vertex_of;

  std::istream in;

  bool SNC_io_parser<EW>::check_sep(const char* sep) const {
    char c;
    do in.get(c); while (isspace(c));
    while (*sep != '\0') {
      if (*sep != c) {
	in.putback(c);
	return false;
      }
      ++sep; in.get(c);
    }
    in.putback(c);
    return true;
  }

  void add_sedge(SNC_structure& snc, int prev, int cur, int next) {
    Vertex_handle v = Vertex_of[cur];
    Sphere_point sp1(Vertex_of[prev]->point());
    Sphere_point sp2(Vertex_of[next]->point());
    sp1 = normalized(sp1);
    sp2 = normalized(sp2);

    SVertex_iterator sv;
    SVertex_handle sv1, sv2;
    for(sv = v->svertices_begin(); sv != v->svertices_end(); ++sv)
      if(sv->point() == sp1)
	sv1 = sv;
      else if(sv->point() == sp2)
	sv2 = sv;

    SM_decorator(&*v);
    if(sv1 == SVertex_handle())
      sv1 = SM.new_svertex(sp1);
    if(sv2 == SVertex_handle())
      sv2 = SM.new_svertex(sp2);
    SHalfedge_handle se = SM.new_shalfedge_pair(sv1, sv2);
    se->mark() = se->twin()->mark() = true;
  }

  Vertex_handle read_vertex(SNC_structure& snc) {
    RT hx, hy, hz;
    in >> hx >> hy >> hz;;
    return v(snc.new_vertex(Point_3(hx,hy,hz,1),true));
  }

  void read_facet(SNC_structure& snc) {
    int n, prev, cur, next, first, second;
    in >> n;
    CGAL_assertion(n > 2);
    in >> first;
    in >> second;
    prev = first;
    cur = second;
    n-=2;
    for(;n>0;--n) {
      in >> next;
      add_sedge(snc, prev, cur, next);
      prev = cur;
      cur = next;
    }
    add_sedge(snc, cur, next, first);
    add_sedge(snc, next, first, second);
  }

 public:
  Shell_constructor(std::istream& instr) :
    in(instr) {}

    void operator()(SNC_structure& snc) {
      if (!check_sep("OFF"))
	CGAL_error_msg("OFF header is missing!");
      int nv, nf, x;
      in >> nv;
      in >> nf;
      in >> x;
      Vertex_of.reserve(vn);
      for(x=0; x<nv; ++nv)
	Vertex_of[nv] = read_vertex(snc);
      for(x=0; x<vf; ++nf)
	read_facet(snc);
    }
};

} //namespace CGAL
#endif // CGAL_NEF_SHELL_CONSTRUCTOR_H


text:
package com.glaf.base.modules.sys.mapper;

import java.util.*;
import org.springframework.stereotype.Component;
import com.glaf.base.modules.sys.model.*;
import com.glaf.base.modules.sys.query.*;

@Component
public interface SysApplicationMapper {

	void deleteSysApplications(SysApplicationQuery query);

	void deleteSysApplicationById(Long id);

	SysApplication getSysApplicationById(Long id);

	int getSysApplicationCount(SysApplicationQuery query);

	List<RealmInfo> getRealmInfos(Map<String,Object> params);

	List<SysApplication> getSysApplications(SysApplicationQuery query);

	List<SysApplication> getSysApplicationByRoleId(long deptRoleId);

	List<SysApplication> getSysApplicationByUserId(long userId);

	void insertSysApplication(SysApplication model);

	void updateSysApplication(SysApplication model);

}


text:
from setuptools import setup, find_packages

setup(
    name='tw2.wysihtml5',
    version='0.3.1',
    description='WYSIHTML5 widget for ToscaWidgets2',
    author='Moritz Schlarb',
    author_email='moschlar@metalabs.de',
    url='https://github.com/toscawidgets/tw2.wysihtml5',
    license='BSD 2-clause',
    install_requires=[
        "tw2.core",
        "tw2.forms",
        "Mako",
        ## Add other requirements here
        # "Genshi",
        ],
    extras_require={'bootstrap': 'tw2.bootstrap.forms'},
    packages=find_packages(exclude=['ez_setup', 'tests']),
    namespace_packages=['tw2', 'tw2.bootstrap'],
    zip_safe=False,
    include_package_data=True,
    test_suite='nose.collector',
    entry_points="""
        [tw2.widgets]
        # Register your widgets so they can be listed in the WidgetBrowser
        widgets_plain = tw2.wysihtml5
        widgets_bootstrap = tw2.bootstrap.wysihtml5
    """,
    keywords=[
        'toscawidgets.widgets',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Environment :: Web Environment :: ToscaWidgets',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Software Development :: Widget Sets',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'License :: OSI Approved :: BSD License',
    ],
)


text:
'use strict';

module.exports = require('./is-implemented')()
	? RegExp.prototype.split
	: require('./shim');


text:
package net.runelite.runeloader.inject;

import org.objectweb.asm.tree.AbstractInsnNode;

public class ReplaceNodeInstruction {
   public final String owner;
   public final String method;
   public final String desc;
   public final int index;
   public final AbstractInsnNode replaceWith;

   public ReplaceNodeInstruction(String var1, String var2, String var3, int var4, AbstractInsnNode var5) {
      this.owner = var1;
      this.method = var2;
      this.desc = var3;
      this.index = var4;
      this.replaceWith = var5;
   }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.data = undefined;

var _utilities = require('../utilities');

var data = exports.data = {
  settings: {
    'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/
  },
  messages: {
    'isRequired': 'er påkrævet',
    'onValidateCallback': 'ikke gyldig værdi',
    'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) {
      return 'kan kun indeholde alfanumeriske tegn eller mellemrum';
    },
    'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) {
      return 'kan kun indeholde alfanumeriske tegn';
    },
    'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) {
      return 'kan kun indeholde bogstaver';
    },
    'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) {
      return 'kan kun indeholde bogstaver og mellemrum';
    },
    'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) {
      return 'skal være imellem ' + _utilities.Utilities.getValue(threshold.minimumLength) + ' og ' + _utilities.Utilities.getValue(threshold.maximumLength) + ' tegn lang';
    },
    'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) {
      return 'skal være imellem ' + _utilities.Utilities.getValue(threshold.minimumValue) + ' og ' + _utilities.Utilities.getValue(threshold.maximumValue);
    },
    'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) {
      return 'ikke en gyldig værdi';
    },
    'DigitValidationRule': function DigitValidationRule(newValue, threshold) {
      return 'kan kun indeholde tal';
    },
    'EmailValidationRule': function EmailValidationRule(newValue, threshold) {
      return 'ikke gyldig e-mailadresse';
    },
    'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) {
      return 'burde være ' + _utilities.Utilities.getValue(threshold.otherValue);
    },
    'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) {
      return 'kan ikke være ' + _utilities.Utilities.getValue(threshold.otherValue);
    },
    'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) {
      return 'er ikke ens ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
    },
    'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) {
      return 'kan ikke være ens ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
    },
    'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) {
      return 'ikke en gyldig værdi';
    },
    'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) {
      return 'skal være ' + _utilities.Utilities.getValue(threshold) + ' eller højere';
    },
    'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) {
      return 'skal være mindst ' + _utilities.Utilities.getValue(threshold) + ' tegn lang';
    },
    'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) {
      return 'skal være større end ' + _utilities.Utilities.getValue(threshold);
    },
    'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) {
      return 'skal være ' + _utilities.Utilities.getValue(threshold) + ' eller mindre';
    },
    'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) {
      return 'kan ikke være længere end ' + _utilities.Utilities.getValue(threshold) + ' tegn';
    },
    'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) {
      return 'skal være mindre end ' + _utilities.Utilities.getValue(threshold);
    },
    'NumericValidationRule': function NumericValidationRule(newValue, threshold) {
      return 'skal være en talværdi';
    },
    'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) {
      return 'må ikke indeholde mellemrum';
    },
    'RegexValidationRule': function RegexValidationRule(newValue, threshold) {
      return 'ikke en gyldig værdi';
    },
    'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) {
      return 'ikke en gyldig værdi';
    },
    'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) {
      return 'skal være en kombination af små bogstaver, store bogstaver, tal og specialtegn';
    },
    'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) {
      return 'skal indeholde mindst ' + _utilities.Utilities.getValue(threshold) + ' af de følgende grupper: små bogstaver, store bogstaver, tal og specialtegn';
    },
    'URLValidationRule': function URLValidationRule(newValue, threshold) {
      return 'ikke en gyldig URL';
    }
  }
};


text:
class Molecule
{
public:
    Molecule();
    Molecule(int CSID,std::string MolecularFormula,std::string SMILES,std::string InChI,std::string InChIKey,double AverageMass,double MolecularWeight,double MonoisotopicMass,double NominalMass,double ALogP,double XLogP,std::string CommonName);
    Molecule(std::vector<std::pair<std::string,std::string> >);
    std::vector<std::pair<std::string,std::string> > getInfo();

private:
    std::vector<Atom*> atoms;
    std::vector<std::pair<std::string,std::string> > info;
};

#endif // MOLECULE_H


text:
using content::BrowserPpapiHost;
using content::BrowserThread;
using content::RenderProcessHost;

namespace chrome {

PepperBrokerMessageFilter::PepperBrokerMessageFilter(PP_Instance instance,
                                                     BrowserPpapiHost* host)
    : document_url_(host->GetDocumentURLForInstance(instance)) {
  int unused;
  host->GetRenderFrameIDsForInstance(instance, &render_process_id_, &unused);
}

PepperBrokerMessageFilter::~PepperBrokerMessageFilter() {}

scoped_refptr<base::TaskRunner>
PepperBrokerMessageFilter::OverrideTaskRunnerForMessage(
    const IPC::Message& message) {
  return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI);
}

int32_t PepperBrokerMessageFilter::OnResourceMessageReceived(
    const IPC::Message& msg,
    ppapi::host::HostMessageContext* context) {
  PPAPI_BEGIN_MESSAGE_MAP(PepperBrokerMessageFilter, msg)
    PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Broker_IsAllowed,
                                        OnIsAllowed)
  PPAPI_END_MESSAGE_MAP()
  return PP_ERROR_FAILED;
}

int32_t PepperBrokerMessageFilter::OnIsAllowed(
    ppapi::host::HostMessageContext* context) {
  return PP_OK;
}

}  // namespace chrome


text:
<!DOCTYPE html>

    <title>Strategy Report: Generated 278</title>

Strategy Report

Generated 278

Long and Short

Total net profit	-16.34	Gross profit	12.87	Gross loss	-29.21

Profit factor	0.44	Expected payoff	-0.19

Absolute drawdown	-16.34	Maximal drawdown (%)	19.76 (577.78%)

Total trades	85	Profit trades (% of total)	13 (15.29%)	Loss trades (% of total)	72 (84.71%)

	Long positions (won %)	51 (11.76%)	Short positions (won %)	34 (20.59%)

Largest	profit trade	3.01	loss trade	-10.51

Average	profit trade	0.99	loss trade	-0.41

Minimum	profit trade	0.02	loss trade	-0.02

Maximum	take profit in pips	236.4	stop loss in pips	-384.5

Average	take profit in pips	234.2	stop loss in pips	-364.4

Minimum	take profit in pips	214.1	stop loss in pips	-362.2

Maximum	Reward-Risk	0.7	Duration in minutes	8686

Average	Reward-Risk	0.6	Duration in minutes	509.8

Minimum	Reward-Risk	0.6	Duration in minutes	0

Maximum	consecutive wins (profit in money)	3.0 (4.2)	consecutive losses (loss in money)	27.0 (-8.81)

Average	consecutive wins	1.0	consecutive losses	5.0

Long

Total net profit	-15.5	Gross profit	7.5	Gross loss	-23.0

Profit factor	0.33	Expected payoff	-0.3

Absolute drawdown	-15.5	Maximal drawdown (%)	16.17 (2413.43%)

Total trades	51	Profit trades (% of total)	6 (11.76%)	Loss trades (% of total)	45 (88.24%)

Largest	profit trade	3.01	loss trade	-10.51

Average	profit trade	1.25	loss trade	-0.51

Minimum	profit trade	0.02	loss trade	-0.04

Maximum	take profit in pips	236.4	stop loss in pips	-369.0

Average	take profit in pips	234.5	stop loss in pips	-364.1

Minimum	take profit in pips	229.6	stop loss in pips	-362.2

Maximum	Reward-Risk	0.7	Duration in minutes	8686.0

Average	Reward-Risk	0.6	Duration in minutes	527.4

Minimum	Reward-Risk	0.6	Duration in minutes	1.0

Maximum	consecutive wins (profit in money)	1.0 (2.09)	consecutive losses (loss in money)	17.0 (-6.56)

Average	consecutive wins	1.0	consecutive losses	4.0

Short

Total net profit	-0.84	Gross profit	5.37	Gross loss	-6.21

Profit factor	0.86	Expected payoff	-0.02

Absolute drawdown	-0.84	Maximal drawdown (%)	4.88 (120.79%)

Total trades	34	Profit trades (% of total)	7 (20.59%)	Loss trades (% of total)	27 (79.41%)

Largest	profit trade	2.27	loss trade	-0.75

Average	profit trade	0.77	loss trade	-0.23

Minimum	profit trade	0.03	loss trade	-0.02

Maximum	take profit in pips	235.2	stop loss in pips	-384.5

Average	take profit in pips	233.7	stop loss in pips	-364.9

Minimum	take profit in pips	214.1	stop loss in pips	-363.4

Maximum	Reward-Risk	0.7	Duration in minutes	5751.0

Average	Reward-Risk	0.6	Duration in minutes	483.5

Minimum	Reward-Risk		Duration in minutes	0.0

Maximum	consecutive wins (profit in money)	2.0 (0.93)	consecutive losses (loss in money)	14.0 (-3.32)

Average	consecutive wins	1.0	consecutive losses	3.0

Home


text:
import time, re, sys
from SeleniumUtils import SeleniumUtils, SetupByLocation

class testMO(SeleniumUtils, SetupByLocation):

    def setUp(self):
        super(testMO,self).setUp()
        self.url='http://'+self.IP+'/examples/MenusBottom_test.html'

    def test02_js(self):
        """
           click javascript menu item and test if MO show javascript was run message
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item ({ 'menu': 'menu_plain',
                          'xpath': '//td[text()="javascript"]',
                          'sleep': 3,
                          'js_result': 'fake_alert',
                          'expected': 'I just ran javscript from plain menu'})

    def test03_google(self):
        """
           click google menu (plain) item and test if MO navigates there
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item({ 'menu': 'menu_plain',
                          'xpath': '//td[text()="Google"]',
                          'sleep': 2 })
        self.find_tab('Google')

    def test04_js(self):
        """
           click javascript menu (with imgs) item and test if MO show javascript was run message
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item({ 'menu': 'menu_w_imgs',
                          'xpath': '//td[text()="javascript"]',
                          'js_result': 'fake_alert',
                          'expected': 'I just ran javscript from menu with images',
                          'sleep': 1 })

    def test05_google(self):
        """
           click google menu (with imgs) item and test if MO navigates there
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item({ 'menu': 'menu_w_imgs',
                          'xpath': '//td[text()="Google"]',
                          'sleep': 1 })
        self.find_tab('Google')

    def test07_google(self):
        """
           click google menu (with dividers & filters) item and test if MO navigates there
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item({ 'menu': 'menu_divs_filts',
                          'xpath': '//td[text()="Google"]',
                          'fltr' : 'hdr_fltrAll',
                          'sleep': 3 })
        self.find_tab('Google')

    def test08_mousefiltering(self):
        """
           verify that mouseover Search shows GoogleYahoo
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.hover_over({ 'menu': 'menu_divs_filts'})
        self.hover_over({ 'menu': 'hdr_fltrSearch',
             'filt_rslts': '//span/following::table[@class="CrEaTeDtAbLeStYlE"]',
             'expected': 'GoogleYahoo' })

    def test09_mousefiltering(self):
        """
           verify that mouseover Biz shows CNBCMarketWatch
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.hover_over({ 'menu': 'menu_divs_filts'})
        self.hover_over({ 'menu': 'hdr_fltrBiz',
             'filt_rslts': '//span/following::table[@class="CrEaTeDtAbLeStYlE"]',
             'expected': 'CNBCMarketWatch' })
        self.click_menu_item({ 'menu': 'menu_divs_filts',
                          'xpath': '//span[text()="CNBC"]',
                          'sleep': 1,
                          'fltr' : 'hdr_fltrBiz' })

    def test10_mousefiltering(self):
        """
           verify that mouseover (all) shows SearchGoogleYahooBusinessCNBCMarketWatch
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'})
        self.hover_over({ 'menu': 'menu_divs_filts'})
        self.hover_over({ 'menu': 'hdr_fltrAll',
             'filt_rslts': '//span/following::table[@class="CrEaTeDtAbLeStYlE"]',
             'expected': 'SearchGoogleYahooBusinessCNBCMarketWatch' })

    def test11_dividers(self):
        """
           click divider menu item and make sure no window opens
        """
        self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} )
        self.click_menu_item({ 'menu': 'menu_divs_filts',
            'xpath': '//td[@class="divider" and contains(.,"Search")]',
            'fltr' : 'hdr_fltrAll',
            'sleep': 3 })
        assert len(self.driver.window_handles) == 1

    #--- def test12_replace_window(self): ---#
        """
           click menu item and make sure current window is replaced
        """
        #--- self.open_n_tst_title({'url': self.url, 'title': 'MenuOptions'} ) ---#
        #--- self.click_menu_item({ 'menu': 'menu_divs_filts', ---#
                          #--- 'xpath': '//span[text()="CNBC"]', ---#
                          #--- 'sleep': 1, ---#
                          #--- 'fltr' : 'hdr_fltrAll' }) ---#
        #--- assert len(self.driver.window_handles) == 1 ---#

    def tearDown(self):
        super(testMO,self).tearDown()
        self.driver.quit()


text:
/**
 * @license Angulartics v0.17.2
 * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics
 * Google Tag Manager Plugin Contributed by http://github.com/danrowe49
 * License: MIT
 */
!function(a){"use strict";a.module("angulartics.google.tagmanager",["angulartics"]).config(["$analyticsProvider",function(a){a.registerPageTrack(function(a){var b=window.dataLayer=window.dataLayer||[];b.push({event:"content-view","content-name":a})}),a.registerEventTrack(function(a,b){var c=window.dataLayer=window.dataLayer||[];c.push({event:"interaction",target:b.category,action:a,"target-properties":b.label,value:b.value,"interaction-type":b.noninteraction})})}])}(angular);


text:
class TreeBuilderChargebackRates < TreeBuilder
  private

  def tree_init_options(_tree_name)
    {:open_all => true, :full_ids => true, :leaf => "MiqReportResult"}
  end

  def set_locals_for_render
    locals = super
    temp = {
      :id_prefix      => "cbr_",
    }
    locals.merge!(temp)
  end

  def root_options
    [t = _("Rates"), t]
  end

  # Get root nodes count/array for explorer tree
  def x_get_tree_roots(count_only, options)
    # TODO: Common code in CharbackRate & ChargebackAssignments, need to move into module
    case options[:type]
    when :cb_assignments, :cb_rates
      rate_types = ChargebackRate::VALID_CB_RATE_TYPES

      if count_only
        rate_types.length
      else
        objects = []
        rate_types.sort.each do |rtype|
          img = rtype.downcase == "compute" ? "hardware-processor" : "hardware-disk"
          objects.push(
            :id    => rtype,
            :text  => rtype,
            :image => img,
            :tip   => rtype
          )
        end
        objects
      end
    end
  end

  # Handle custom tree nodes (object is a Hash)
  def x_get_tree_custom_kids(object, count_only, _options)
    objects = ChargebackRate.where(:rate_type => object[:id]).to_a
    count_only_or_objects(count_only, objects, "description")
  end
end


text:
/*
 * rdx.c	RDOFF Object File loader program
 */

/* note: most of the actual work of this program is done by the modules
   "rdfload.c", which loads and relocates the object file, and by "rdoff.c",
   which contains general purpose routines to manipulate RDOFF object
   files. You can use these files in your own program to load RDOFF objects
   and execute the code in them in a similar way to what is shown here. */

#include "../compiler.h"

#include <stdio.h>
#include <stdlib.h>

#include "rdfload.h"
#include "symtab.h"

typedef int (*main_fn) (int, char **);  /* Main function prototype */

int main(int argc, char **argv)
{
    rdfmodule *m;
    main_fn code;
    symtabEnt *s;

    if (argc < 2) {
        puts("usage: rdx <rdoff-executable> [params]\n");
        exit(255);
    }

    m = rdfload(argv[1]);

    if (!m) {
        rdfperror("rdx", argv[1]);
        exit(255);
    }

    rdf_relocate(m);            /* in this instance, the default relocation
                                   values will work fine, but they may need changing
                                   in other cases... */

    s = symtabFind(m->symtab, "_main");
    if (!s) {
        fprintf(stderr, "rdx: could not find symbol '_main' in '%s'\n",
                argv[1]);
        exit(255);
    }

    code = (main_fn)(size_t) s->offset;

    argv++, argc--;             /* remove 'rdx' from command line */

    return code(argc, argv);    /* execute */
}


text:
/* eslint-disable */
import moment from 'moment';
import { isEmpty, isArray, reduce } from 'underscore';

import {language} from '../i18n'
import registerEditVisualizationDialog from './edit-visualization-dialog';
import counterVisualization from './counter';
import multicounterVisualization from './multicounter';
import tableVisualization from './table';
import chartVisualization from './chart';
import sunburstVisualization from './sunburst';
import sankeyVisualization from './sankey';
import wordCloudVisualization from './word-cloud';
import boxPlotVisualization from './box-plot';
import cohortVisualization from './cohort';
import mapVisualization from './map';
import pivotVisualization from './pivot';

function VisualizationProvider() {
  this.visualizations = {};
  this.visualizationTypes = {};
  const defaultConfig = {
    defaultOptions: {},
    skipTypes: false,
    editorTemplate: null,
  };

  this.registerVisualization = (config) => {
    const visualization = Object.assign({}, defaultConfig, config);

    // TODO: this is prone to errors; better refactor.
    if (isEmpty(this.visualizations)) {
      this.defaultVisualization = visualization;
    }

    this.visualizations[config.type] = visualization;

    if (!config.skipTypes) {
      this.visualizationTypes[config.name] = config.type;
    }
  };

  this.getSwitchTemplate = (property) => {
    const pattern = /(<[a-zA-Z0-9-]*?)( |>)/;

    let mergedTemplates = reduce(this.visualizations, (templates, visualization) => {
      if (visualization[property]) {
        const ngSwitch = `$1 ng-switch-when="${visualization.type}" $2`;
        const template = visualization[property].replace(pattern, ngSwitch);

        return `${templates}\n${template}`;
      }

      return templates;
    }, '');

    mergedTemplates = `<div ng-switch on="visualization.type">${mergedTemplates}</div>`;

    return mergedTemplates;
  };

  this.$get = ($resource) => {
    const Visualization = $resource('api/visualizations/:id', { id: '@id' });
    Visualization.visualizations = this.visualizations;
    Visualization.visualizationTypes = this.visualizationTypes;
    Visualization.renderVisualizationsTemplate = this.getSwitchTemplate('renderTemplate');
    Visualization.editorTemplate = this.getSwitchTemplate('editorTemplate');
    Visualization.defaultVisualization = this.defaultVisualization;

    return Visualization;
  };
}

function VisualizationName(Visualization) {
  return {
    restrict: 'E',
    scope: {
      visualization: '=',
    },
    template: '{{name}}',
    replace: false,
    link(scope) {
      if (Visualization.visualizations[scope.visualization.type]) {
        scope.name = language.getCurrentLanguage() === "Fr" ? scope.visualization.fr_name: scope.visualization.name;
      }
    },
  };
}

function VisualizationRenderer(Visualization) {
  return {
    restrict: 'E',
    scope: {
      visualization: '=',
      queryResult: '=',
    },
    // TODO: using switch here (and in the options editor) might introduce errors and bad
    // performance wise. It's better to eventually show the correct template based on the
    // visualization type and not make the browser render all of them.
    template: `${Visualization.renderVisualizationsTemplate}`,
    replace: false,
    link(scope) {
      scope.$watch('queryResult && queryResult.getFilters()', (filters) => {
        if (filters) {
          scope.filters = filters;
        }
      });
    },
  };
}

function VisualizationOptionsEditor(Visualization) {
  return {
    restrict: 'E',
    template: Visualization.editorTemplate,
    replace: false,
    scope: {
      visualization: '=',
      query: '=',
      queryResult: '=',
    },
  };
}

function FilterValueFilter(clientConfig) {
  return (value, filter) => {
    let firstValue = value;
    if (isArray(value)) {
      firstValue = value[0];
    }

    // TODO: deduplicate code with table.js:
    if (filter.column.type === 'date') {
      if (firstValue && moment.isMoment(firstValue)) {
        return firstValue.format(clientConfig.dateFormat);
      }
    } else if (filter.column.type === 'datetime') {
      if (firstValue && moment.isMoment(firstValue)) {
        return firstValue.format(clientConfig.dateTimeFormat);
      }
    }

    return firstValue;
  };
}

export default function (ngModule) {
  ngModule.provider('Visualization', VisualizationProvider);
  ngModule.directive('visualizationRenderer', VisualizationRenderer);
  ngModule.directive('visualizationOptionsEditor', VisualizationOptionsEditor);
  ngModule.directive('visualizationName', VisualizationName);
  ngModule.filter('filterValue', FilterValueFilter);
  registerEditVisualizationDialog(ngModule);
  chartVisualization(ngModule);
  counterVisualization(ngModule);
  multicounterVisualization(ngModule);
  sunburstVisualization(ngModule);
  sankeyVisualization(ngModule);
  wordCloudVisualization(ngModule);
  boxPlotVisualization(ngModule);
  cohortVisualization(ngModule);
  mapVisualization(ngModule);
  pivotVisualization(ngModule);
  tableVisualization(ngModule);
}


text:
<?php defined('G_IN_ADMIN')or exit('No permission resources.'); ?>
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="<?php echo G_GLOBAL_STYLE; ?>/global/css/global.css" type="text/css">
<link rel="stylesheet" href="<?php echo G_GLOBAL_STYLE; ?>/global/css/style.css" type="text/css">

	<?php echo $this->headerment(); ?>

<form name="myform" action="" method="post" enctype="multipart/form-data">

			不允许注册昵称:
			<textarea name="nickname" class="input-text" style="width:400px; height:80px"><?php echo $nickname; ?></textarea>
              用户不可以使用的昵称,多个用,号分割

			注册类型:

            	        <input name="reg_email" type="checkbox" value="1" <?php echo (($regtype['reg_email']) ? 'checked' : ''); ?> /> 邮箱注册

                        <input name="reg_mobile" type="checkbox" value="1" <?php echo (($regtype['reg_mobile']) ? 'checked' : ''); ?> /> 手机注册

			单IP每日注册:

            	  <input name="reg_num" type="text" class="input-text" value="<?php echo $regtype['reg_num']; ?>" /> 个

            <input type="submit" class="button" name="submit" value="提交" >

</form>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>{% block title %}{% endblock%}</title>
    <link href="/t/img/favicon.ico" rel="shortcut icon">
    <link href="/t/style.css" rel="stylesheet" type="text/css" />
    <link href="/t/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css" />

</head>

<body>
    <div class="wrapper">

        {% include "include/header.html" %} {% include "include/nav.html" %} {% block content %}{% endblock %} {% include "include/footer.html" %}

    </div>
</body>

</html>


text:
title: Support
menu: Support
external_url: https://destek.hugin.com.tr/
new_window: false
---


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="vertical">
    <View
        android:id="@+id/drawer_list_divider_view"
        android:layout_width="match_parent"
        android:background="#1f000000"
        android:layout_height="1dp"
        android:layout_marginBottom="8dp"
        android:layout_marginTop="8dp"/>

    <TextView
        android:id="@+id/drawer_section_item_title"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:textColor="#54000000"
        android:textSize="14sp"
        android:gravity="center_vertical" />
</LinearLayout>


text:
Get all history of private groups from slack by your own token.

You can clone the repo and run locally with node

or you can use [this link](https://rawgit.com/keremtiryaki/Slack-Api-Helpers/master/public/index.html) to get your private group history.