text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Newtonsoft.Json;
using osu.Framework.Localisation;
using osu.Framework.Testing;
using osu.Game.Database;
using osu.Game.IO.Serialization;
using osu.Game.Rulesets;
using osu.Game.Scoring;

namespace osu.Game.Beatmaps
{
    [ExcludeFromDynamicCompile]
    [Serializable]
    public class BeatmapInfo : IEquatable<BeatmapInfo>, IJsonSerializable, IHasPrimaryKey
    {
        public int ID { get; set; }

        public int BeatmapVersion;

        private int? onlineBeatmapID;

        [JsonProperty("id")]
        public int? OnlineBeatmapID
        {
            get => onlineBeatmapID;
            set => onlineBeatmapID = value > 0 ? value : null;
        }

        [JsonIgnore]
        public int BeatmapSetInfoID { get; set; }

        public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None;

        [Required]
        public BeatmapSetInfo BeatmapSet { get; set; }

        public BeatmapMetadata Metadata { get; set; }

        [JsonIgnore]
        public int BaseDifficultyID { get; set; }

        public BeatmapDifficulty BaseDifficulty { get; set; }

        [NotMapped]
        public BeatmapMetrics Metrics { get; set; }

        [NotMapped]
        public BeatmapOnlineInfo OnlineInfo { get; set; }

        [NotMapped]
        public int? MaxCombo { get; set; }

        /// <summary>
        /// The playable length in milliseconds of this beatmap.
        /// </summary>
        public double Length { get; set; }

        /// <summary>
        /// The most common BPM of this beatmap.
        /// </summary>
        public double BPM { get; set; }

        public string Path { get; set; }

        [JsonProperty("file_sha2")]
        public string Hash { get; set; }

        [JsonIgnore]
        public bool Hidden { get; set; }

        /// <summary>
        /// MD5 is kept for legacy support (matching against replays, osu-web-10 etc.).
        /// </summary>
        [JsonProperty("file_md5")]
        public string MD5Hash { get; set; }

        // General
        public double AudioLeadIn { get; set; }
        public bool Countdown { get; set; } = true;
        public float StackLeniency { get; set; } = 0.7f;
        public bool SpecialStyle { get; set; }

        public int RulesetID { get; set; }

        public RulesetInfo Ruleset { get; set; }

        public bool LetterboxInBreaks { get; set; }
        public bool WidescreenStoryboard { get; set; }
        public bool EpilepsyWarning { get; set; }

        // Editor
        // This bookmarks stuff is necessary because DB doesn't know how to store int[]
        [JsonIgnore]
        public string StoredBookmarks
        {
            get => string.Join(',', Bookmarks);
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    Bookmarks = Array.Empty<int>();
                    return;
                }

                Bookmarks = value.Split(',').Select(v =>
                {
                    bool result = int.TryParse(v, out int val);
                    return new { result, val };
                }).Where(p => p.result).Select(p => p.val).ToArray();
            }
        }

        [NotMapped]
        public int[] Bookmarks { get; set; } = Array.Empty<int>();

        public double DistanceSpacing { get; set; }
        public int BeatDivisor { get; set; }
        public int GridSize { get; set; }
        public double TimelineZoom { get; set; }

        // Metadata
        public string Version { get; set; }

        private string versionString => string.IsNullOrEmpty(Version) ? string.Empty : $"[{Version}]";

        [JsonProperty("difficulty_rating")]
        public double StarDifficulty { get; set; }

        /// <summary>
        /// Currently only populated for beatmap deletion. Use <see cref="ScoreManager"/> to query scores.
        /// </summary>
        public List<ScoreInfo> Scores { get; set; }

        [JsonIgnore]
        public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(StarDifficulty);

        public string[] SearchableTerms => new[]
        {
            Version
        }.Concat(Metadata?.SearchableTerms ?? Enumerable.Empty<string>()).Where(s => !string.IsNullOrEmpty(s)).ToArray();

        public override string ToString() => $"{Metadata ?? BeatmapSet?.Metadata} {versionString}".Trim();

        public RomanisableString ToRomanisableString()
        {
            var metadata = (Metadata ?? BeatmapSet?.Metadata)?.ToRomanisableString() ?? new RomanisableString(null, null);
            return new RomanisableString($"{metadata.GetPreferred(true)} {versionString}".Trim(), $"{metadata.GetPreferred(false)} {versionString}".Trim());
        }

        public bool Equals(BeatmapInfo other)
        {
            if (ID == 0 || other?.ID == 0)
                // one of the two BeatmapInfos we are comparing isn't sourced from a database.
                // fall back to reference equality.
                return ReferenceEquals(this, other);

            return ID == other?.ID;
        }

        public bool AudioEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
                                                      BeatmapSet.Hash == other.BeatmapSet.Hash &&
                                                      (Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile;

        public bool BackgroundEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
                                                           BeatmapSet.Hash == other.BeatmapSet.Hash &&
                                                           (Metadata ?? BeatmapSet.Metadata).BackgroundFile == (other.Metadata ?? other.BeatmapSet.Metadata).BackgroundFile;

        /// <summary>
        /// Returns a shallow-clone of this <see cref="BeatmapInfo"/>.
        /// </summary>
        public BeatmapInfo Clone() => (BeatmapInfo)MemberwiseClone();
    }
}


text:
#if HAVE_TERMIOS_H

#include <termios.h>

#define TERMIO_OR_TERMIOS struct termios

#elif HAVE_TERMIO_H

#include <termio.h>

#define TERMIO_OR_TERMIOS struct termio

#define tcgetattr(fd, save) ioctl(fd, TCGETA, save)
#define tcsetattr(fd, optional_actions, save) ioctl(fd, TCSETAW, save)

#else

struct termio_dummy {};
#define TERMIO_OR_TERMIOS struct termio_dummy

#define tcgetattr(fd, save)
#define tcsetattr(fd, optional_actions, save)

#endif

#ifndef L_cuserid
#define L_cuserid 256
#endif

void saveterm(TERMIO_OR_TERMIOS *save);
void restterm(TERMIO_OR_TERMIOS *save);

#ifdef __linux__
/* On Linux, you must define this yourself. */
union semun {
    int              val;    /* Value for SETVAL */
    struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
    unsigned short  *array;  /* Array for GETALL, SETALL */
    struct seminfo  *__buf;  /* Buffer for IPC_INFO
                                (Linux-specific) */
};
#endif

redpajama_set_name: RedPajamaGithub


text:
package com.jemshit.elitemvpsample;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.jemshit.elitemvpsample.sample_1_basic_presenter.Sample1Activity;
import com.jemshit.elitemvpsample.sample_2_custom_presenter.Sample2Activity;
import com.jemshit.elitemvpsample.sample_3_rx1_subscription.Sample3Activity;
import com.jemshit.elitemvpsample.sample_4_rx2_disposable.Sample4Activity;
import com.jemshit.elitemvpsample.sample_5_nullview_presenter.Sample5Activity;
import com.jemshit.elitemvpsample.sample_6_dagger_injection.Sample6Activity;
import com.jemshit.elitemvpsample.sample_7_nullview_rx1_presenter.Sample7Activity;

public class MainActivity extends AppCompatActivity {

    private Button buttonS1;
    private Button buttonS2;
    private Button buttonS3;
    private Button buttonS4;
    private Button buttonS5;
    private Button buttonS6;
    private Button buttonS7;

    @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setTitle(getString(R.string.app_name));
            getSupportActionBar().setDisplayShowHomeEnabled(true);
            getSupportActionBar().setIcon(R.mipmap.ic_launcher);
        }

        findViewByIds();
        setClickListeners();
    }

    private void findViewByIds() {
        buttonS1 = (Button) findViewById(R.id.button_mainActivity_s1);
        buttonS2 = (Button) findViewById(R.id.button_mainActivity_s2);
        buttonS3 = (Button) findViewById(R.id.button_mainActivity_s3);
        buttonS4 = (Button) findViewById(R.id.button_mainActivity_s4);
        buttonS5 = (Button) findViewById(R.id.button_mainActivity_s5);
        buttonS6 = (Button) findViewById(R.id.button_mainActivity_s6);
        buttonS7 = (Button) findViewById(R.id.button_mainActivity_s7);
    }

    private void setClickListeners() {
        buttonS1.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample1Activity.class));
            }
        });

        buttonS2.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample2Activity.class));
            }
        });

        buttonS3.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample3Activity.class));
            }
        });

        buttonS4.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample4Activity.class));
            }
        });

        buttonS5.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample5Activity.class));
            }
        });

        buttonS6.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample6Activity.class));
            }
        });

        buttonS7.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, Sample7Activity.class));
            }
        });
    }
}


text:
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;

namespace BrewFree.Data.Models
{
    public class ApplicationUser : IdentityUser
    {
    }
}


text:
.compass a {
    color: #5fa134;
}

.compass.container-fluid {
    padding: 0;
}

.compass .sidebar {
    background: #96c773;
    float: left;
    margin: 0;
    list-style: none;
    padding: 2rem 0.5rem;
}

@media only screen and (max-width: 64em) {
    .compass .hide-sm {
        display: none;
    }
}

@media only screen and (min-width: 64em) {
    .compass .hide-sm {
        display: inline-block;
    }
}

.compass .sidebar li {
    font-size: 1rem;
}

.compass .sidebar div {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    position: relative;
}

.compass .sidebar a {
    color: #34302d;
    font-family: Montserrat, sans-serif;
}

.compass .sidebar span {
    padding-right: 1rem;
}

.compass .sidebar i {
    position: absolute;
    right: 0.5rem;
    top: 0.3rem;
    padding: 0.3rem;
    cursor: pointer;
}

.compass .sidebar .child-inactive > div {
    color: #34302d;
    opacity: 0.5;
}

.compass .sidebar .active > div,
.compass .sidebar div:hover {
    color: #34302d;
    font-weight: bold;
    font-size: 0.98rem;
    opacity: 1;
}

.compass .sidebar a:hover {
    text-decoration: none;
}

.compass .sidebar .child-active > div {
    font-weight: bold;
    font-size: 0.98rem;
}

.compass .sidebar .sidebar_children {
    list-style: none;
    border-left: 1px solid black;
    margin: 1rem;
}

.compass .sidebar .sidebar_children a {
    font-size: .9rem;
    padding: 0.4rem 0.5rem;
    margin-right: -1.5rem;
    display: block;
}

.compass .sidebar .sidebar_children .active a,
.compass .sidebar .sidebar_children a:hover {
    font-size: .87rem;
    color: #6bb536;
    background: #fff;
    font-weight: bold;
}

.compass .nav {
    border-bottom: 0;
    background: #fff;
    padding: 1.5rem 0 0 0;
    margin-bottom: 0;
    display: flex;
}

.compass .nav-tabs li {
    margin-bottom: 0;
    float: none;
}

.compass .nav-tabs a {
    border: 0;
    color: #34302d;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    margin: 0 1rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.compass .nav-tabs a:focus {
    background: #fff;
}

.compass .nav-tabs a:hover,
.compass .nav-tabs > .active > a {
    border: 0;
    border-bottom: 4px solid #6bb536;
    color: #6bb536;
    background: #fff;
    font-weight: bold;
}

.compass .nav > li > a > span {
    padding-right: 0.5rem;
}

.compass .nav > li > a > svg {
    vertical-align: sub;
}

.compass .nav > li > a > svg path {
    fill: #34302d;
}

.compass .nav > .active > a > svg path,
.compass .nav-tabs a:hover svg path {
    fill: #6bb536;
}

.compass .nav > li > a > svg path.fill-white-only,
.compass .nav > .active > a > svg path.fill-white-only,
.compass .nav-tabs a:hover svg path.fill-white-only {
    fill: #fff;
}

.compass .nav > li > a > svg path.stroke-only {
    fill: transparent;
    stroke: #34302d;
}

.compass .nav > .active > a > svg path.stroke-only,
.compass .nav-tabs a:hover svg path.stroke-only {
    fill: transparent;
    stroke: #6bb536;
}

.compass .project--card {
    margin-top: 2rem;
    padding: 0;
}

.compass .project--card > * {
    background-color: #fff;
    box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.27);
    border: solid 1px #dfdfdf;
    display: block;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.compass .project--card > a:focus {
    text-decoration: none;
}

.compass .project--card > *:hover {
    text-decoration: none;
    color: #34302d;
    transition: .2s ease;
}

.compass .project--card > a h3 {
    font-size: 14px;
    font-weight: bold;
    font-family: "Montserrat", sans-serif;
}

.compass .project--card > a div {
    color: #34302d;
}

@media only screen and (min-width: 64em) {
    .compass .project--card:nth-child(even) > * {
        margin-left: 1rem;
    }

    .compass .project--card:nth-child(odd) > * {
        margin-right: 1rem;
    }
}

.compass .compass-section {
    padding: 0 2rem 2rem 2rem;
}

.compass .compass-section h2 {
    font-size: 20px;
    padding-top: 2rem;
    width: 100%;
}

.compass .compass-section + .compass-section > h2 {
    border-top: solid 1px rgb(195, 195, 195);
}

.compass .compass-section .compass-subtitle {
    font-size: 16px;
    margin: 1rem 0 0 0;
}

.compass .tab-content .compass-section > .row {
    margin-top: 2rem;
}

/* Fix layout for Safari */
.compass .row:before, .compass .row:after {
    display: initial;
}

/* Overview */

.compass .spring-boot-config {
    border-radius: 4px;
    background-color: #fff;
    border: solid 2px #e5b451;
    padding: 20px;
}

.compass .spring-boot-config h3 {
    color: #e5b451;
}

.compass .quickstart {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
}

.compass .quickstart--title {
    font-size: 22px;
    display: block;
    margin-bottom: 3px;
}

.compass .quickstart--button {
    background: rgba(109, 179, 63, 0.0);
    color: #6db33f;
    border: 2px solid #6db33f;
    padding: 5px;
    text-align: center;
    display: block;
    border-radius: 3px;
    margin-top: 10px;
    transition: background 0.5s, color 0.5s;
    text-decoration: none;
}

.compass .quickstart--button:hover {
    background: rgba(109, 179, 63, 1);
    color: #fff;
}

.compass .project--header {
    background: #fff;
    padding: 1rem 2rem
}

.compass .project--header h1 {
    display: inline-block;
    margin-right: 2rem;
}

.compass .project--header .link--github,
.compass .project--header .link--stackoverflow {
    margin: 0 0.4rem;
    text-decoration: none;
}

.compass .project--header .link--github img {
    height: 1.5rem;
    vertical-align: baseline;
}

.compass .project--header .link--stackoverflow img {
    height: 2rem;
    vertical-align: sub;
}

.compass .project--header .version {
    font-size: 0.65rem;
    float: right;
    line-height: 30px;
}

.compass .project--header .version strong {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.compass .project-overview {
    padding-top: 2rem;
}

/* Learn */

/* Documentation */

.compass .project--documentation a:not(.not-version) {
    font-family: "Montserrat", sans-serif;
    display: flex;
    border-radius: 4px;
    border: solid 1px #6bb536;
    padding: 0.5rem 0.8rem;
    font-size: 14px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.compass .project--documentation a:not(.not-version):hover {
    color: #fff;
    background: #6bb536;
}

.compass .project--documentation a:not(.not-version) .release-status-group {
    justify-content: flex-end;
}

.compass .project--documentation a:not(.not-version) .release-status {
    font-weight: bold;
    font-size: 12px;
    margin-left: 10px;
}

.compass .project--documentation ul {
    margin: 0;
    list-style: none;
}

.compass .project--documentation ul li {
    padding: 0;
    margin-top: 0.7rem;
}

.compass .project--documentation ul li:nth-child(even) {
    padding-left: 0.35rem;
}

.compass .project--documentation ul li:nth-child(odd) {
    padding-right: 0.35rem;
}

.compass .project--documentation--version-button {
    text-align: center;
    margin-top: 1rem;
}

.compass a.not-version {
    color: #34302d;
    text-decoration: none;
}

.compass a.not-version:hover {
    color: #5fa134;
}

.compass a.not-version span {
    margin-right: 0.5rem;
    text-decoration: underline;
}

/* Guides */

.compass ul.project--guides {
    list-style: none;
    margin-top: 0.5rem;
}

.compass .project--guide > a {
    border-left: 4px solid #eac36d;
}

.compass .project--guide > a:hover {
    background-color: #eac36d;
    border-color: #eac36d;
}

/* Samples */

.compass .project--samples ul{
    list-style: none;
}

.compass .project--sample > a {
    border-left: 4px solid #96c773;
}

.compass .project--sample > a:hover {
    background-color: #96c773;
    border-color: #96c773;
}


text: .foo.svelte-xyz{color:red}[class~="bar"].svelte-xyz{background:blue}


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\Inscription;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class AdherentController
 * @package AppBundle\Controller
 * @Route("adherent")
 * @Security("has_role('ROLE_ADMIN')")
 */
class AdherentController extends Controller
{
    const FORM_RECHERCHE_TEXT = 'text';

    /**
     * @Route("/index")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction(Request $request)
    {

        $data = $this->getQueryListeAdherent($request);

        return $this->render('AppBundle:Adherent:index.html.twig', array(
            'liste_adherents' => $data['liste_adherent'],
            'form'            => $data['form']->createView()
        ));
    }

    /**
     * @Route("/edit")
     */
    public function editAction()
    {
        return $this->render('AppBundle:Adherent:edit.html.twig', array(// ...
        ));
    }

    /**
     * Crée le formulaire de recherche
     * @return \Symfony\Component\Form\Form
     */
    protected function createFormRecherche()
    {
        $listeTypeCours = array('-' => null);
        foreach (Inscription::LISTE_TYPE_COURS as $typeCours) {
            $listeTypeCours[ucfirst($typeCours)] = $typeCours;
        }
        $listeTypeAdhesion = array('-' => null);
        foreach (Inscription::LISTE_TYPE_ADHESION as $typeAdhesion) {
            $listeTypeAdhesion[ucfirst($typeAdhesion)] = $typeAdhesion;
        }
        return $this->createFormBuilder()
            ->add('text', TextType::class, array(
                'required' => false,
                'attr'     => array(
                    'placeholder' => 'Recherche sur prénom / nom'
                )
            ))
            ->add('typeCours', ChoiceType::class, array(
                'choices' => $listeTypeCours,
                'label'   => 'Type de cours'
            ))
            ->add('typeAdhesion', ChoiceType::class, array(
                'choices' => $listeTypeAdhesion,
                'label'   => "Type d'adhésion"
            ))
            ->getForm();
    }

    /**
     * @param Request $request
     * @return array
     */
    protected function getQueryListeAdherent(Request $request)
    {
        $formRecherche = $this->createFormRecherche()->handleRequest($request);
        $listeFiltres  = array();
        if ($formRecherche->isSubmitted() && $formRecherche->isValid()) {
            $listeFiltres = $formRecherche->getData();
        }

        $listeAdherents = $this->get('knp_paginator')->paginate(
            $this->getDoctrine()->getRepository('AppBundle:User')->getQueryListeUser($this->getUser()->getSaisonCourante(), $listeFiltres),
            1,
            100,
            array('defaultSortFieldName' => 'u.prenom', 'defaultSortDirection' => 'asc')
        );

        return array(
            'form'           => $formRecherche,
            'liste_adherent' => $listeAdherents,
        );
    }

    /**
     * @Route("/recherche",
     * options={"expose"=true}
     *     )
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function rechercheAction(Request $request)
    {
        $data = $this->getQueryListeAdherent($request);

        return $this->render('@App/Adherent/Block/liste_adherents.html.twig', array(
            'liste_adherents' => $data['liste_adherent'],
        ));
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="10dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Medium Text"
        android:id="@+id/title" />

</LinearLayout>


text:
package cmd

import (
	"fmt"
	"os"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

// RootCmd - The base command for the application.
var RootCmd = &cobra.Command{
	Use:   "box-reporter",
	Short: "Extract Events from Box",
	Long:  `Extract Events from Box`,
}

// Execute - Adds all defined commands
func Execute() {
	if err := RootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(-1)
	}

	viper.Get("PublicKeyID")
	viper.Get("ClientID")
	viper.Get("ClientSecret")
}

func init() {
	cobra.OnInitialize(initConfig)
}

func initConfig() {

	viper.SetConfigName("box-reporter")
	viper.SetConfigType("yaml")
	viper.AddConfigPath(".")

	err := viper.ReadInConfig()

	if err != nil {
		fmt.Println("Please make sure that box-reporter.yaml exists in the working directory.")
		os.Exit(-1)
	}
}


text:
class Mockolo < Formula
  desc "Efficient Mock Generator for Swift"
  homepage "https://github.com/uber/mockolo"
  url "https://github.com/uber/mockolo/archive/1.2.5.tar.gz"
  sha256 "19ce43eab69b67b7b7d3d2f084c311bf2e04a5809965535dba48861e301257b7"
  license "Apache-2.0"

  bottle do
    cellar :any_skip_relocation
    sha256 "bdd3e1e7f25173c2d7c8a3c924a29c6528d804a3a6eaa54a4a50d8de50ce0b86" => :catalina
  end

  depends_on xcode: ["11.4", :build]

  def install
    system "swift", "build", "-c", "release", "--disable-sandbox"
    bin.install ".build/release/mockolo"
  end

  test do
    (testpath/"testfile.swift").write("
    /// @mockable
    public protocol Foo {
        var num: Int { get set }
        func bar(arg: Float) -> String
    }")
    system "#{bin}/mockolo", "-srcs", testpath/"testfile.swift", "-d", testpath/"GeneratedMocks.swift"
    assert_predicate testpath/"GeneratedMocks.swift", :exist?
    assert_equal "
    ///
    /// @Generated by Mockolo
    ///
    public class FooMock: Foo {
      public init() { }
      public init(num: Int = 0) {
          self.num = num
      }

      public var numSetCallCount = 0
      public var num: Int = 0 { didSet { numSetCallCount += 1 } }

      public var barCallCount = 0
      public var barHandler: ((Float) -> (String))?
      public func bar(arg: Float) -> String {
          barCallCount += 1
          if let barHandler = barHandler {
              return barHandler(arg)
          }
          return \"\"
      }
    }".gsub(/\s+/, "").strip, shell_output("cat #{testpath/"GeneratedMocks.swift"}").gsub(/\s+/, "").strip
  end
end


text:
#import <ResearchKit/ORKTaskViewController_Private.h>
#import <ResearchKit/ORKReviewStepViewController.h>
@import HealthKit;

NS_ASSUME_NONNULL_BEGIN

@class ORKLearnMoreInstructionStep;

@interface ORKTaskViewController () <ORKReviewStepViewControllerDelegate, UIViewControllerRestoration>

- (nullable NSSet<HKObjectType *> *)requestedHealthTypesForRead;
- (nullable NSSet<HKObjectType *> *)requestedHealthTypesForWrite;

// Any StepVC contains a vertical scroll view should register here.
// So taskVC can monitor scroll view's content offset and update hairline's alpha.
@property (nonatomic, weak, nullable) UIScrollView *registeredScrollView;

- (void)learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreInstructionStep fromStepViewController:(ORKStepViewController *)stepViewController;

- (void)flipToPageWithIdentifier:(NSString *)identifier forward:(BOOL)forward animated:(BOOL)animated;

- (void)flipToFirstPage;

- (void)flipToLastPage;

@end

NS_ASSUME_NONNULL_END


text:
<?php

namespace MairieVoreppe\DemandeTravauxBundle\Entity;

/**
 * DemandeImpreciseRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class DemandeImpreciseRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
package org.apache.kafka.streams.processor.internals;

import org.apache.kafka.common.Cluster;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.streams.errors.StreamsException;
import org.apache.kafka.streams.processor.TaskId;
import org.apache.kafka.streams.processor.internals.TopologyMetadata.Subtopology;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Groups partitions by the partition id.
 *
 * Join operations requires that topics of the joining entities are copartitioned, i.e., being partitioned by the same key and having the same
 * number of partitions. Copartitioning is ensured by having the same number of partitions on
 * joined topics, and by using the serialization and Producer's default partitioner.
 */
public class PartitionGrouper {

    private static final Logger log = LoggerFactory.getLogger(PartitionGrouper.class);
    /**
     * Generate tasks with the assigned topic partitions.
     *
     * @param topicGroups   group of topics that need to be joined together
     * @param metadata      metadata of the consuming cluster
     * @return The map from generated task ids to the assigned partitions
     */
    public Map<TaskId, Set<TopicPartition>> partitionGroups(final Map<Subtopology, Set<String>> topicGroups, final Cluster metadata) {
        final Map<TaskId, Set<TopicPartition>> groups = new HashMap<>();

        for (final Map.Entry<Subtopology, Set<String>> entry : topicGroups.entrySet()) {
            final Subtopology subtopology = entry.getKey();
            final Set<String> topicGroup = entry.getValue();

            final int maxNumPartitions = maxNumPartitions(metadata, topicGroup);

            for (int partitionId = 0; partitionId < maxNumPartitions; partitionId++) {
                final Set<TopicPartition> group = new HashSet<>(topicGroup.size());

                for (final String topic : topicGroup) {
                    final List<PartitionInfo> partitions = metadata.partitionsForTopic(topic);
                    if (partitionId < partitions.size()) {
                        group.add(new TopicPartition(topic, partitionId));
                    }
                }
                groups.put(new TaskId(subtopology.nodeGroupId, partitionId, subtopology.namedTopology), Collections.unmodifiableSet(group));
            }
        }

        return Collections.unmodifiableMap(groups);
    }

    /**
     * @throws StreamsException if no metadata can be received for a topic
     */
    protected int maxNumPartitions(final Cluster metadata, final Set<String> topics) {
        int maxNumPartitions = 0;
        for (final String topic : topics) {
            final List<PartitionInfo> partitions = metadata.partitionsForTopic(topic);
            if (partitions.isEmpty()) {
                log.error("Empty partitions for topic {}", topic);
                throw new RuntimeException("Empty partitions for topic " + topic);
            }

            final int numPartitions = partitions.size();
            if (numPartitions > maxNumPartitions) {
                maxNumPartitions = numPartitions;
            }
        }
        return maxNumPartitions;
    }

}


text:
<package>
  <description brief="identify_duplos">

     identify_duplos

  </description>
  <author>Josh</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/identify_duplos</url>
  <depend package="ogre"/>
  <depend package="pcl"/>
  <depend package="pcl_ros"/>
  <depend package="roscpp"/>
  <depend package="sensor_msgs"/>
  <depend package="visualization_msgs"/>

</package>


text:
Advance-Turtle-Operating-Environment
====================================

This project is aimed at creating a better turtle.


text:
require 'delayer/deferred/request'
require 'delayer/deferred/response'

module Delayer::Deferred
=begin rdoc
Deferredを実行するためのWorker。Deferredチェインを実行するFiberを
管理する。

== pushに渡すオブジェクトについて
Worker#push に渡す引数は、activateメソッドを実装している必要がある。

=== activate(response)
==== Args
response :: Delayer::Deferred::Response::Base Deferredに渡す値
==== Returns
[Delayer::Deferred::Response::Base]
  これを返すと、値の自動変換が行われないため、意図的に失敗させたり、Deferredを次のブロックに伝搬させることができる。
[Delayer::Deferred::Chainable]
  戻り値のDeferredが終わるまでWorkerの処理を停止する。
  再開された時、結果は戻り値のDeferredの結果に置き換えられる。
[else]
  _Delayer::Deferred::Response::Ok.new_ の引数に渡され、その結果が利用される
=end
  class Worker
    def initialize(delayer:, initial:)
      @delayer, @initial = delayer, initial
    end

    def push(deferred)
      deferred.reserve_activate
      @delayer.new do
        next if deferred.spoiled?
        begin
          fiber.resume(deferred).accept_request(worker: self,
                                                deferred: deferred)
        rescue Delayer::Deferred::SequenceError => e
          e.deferred = deferred
          raise
        end
      end
      nil
    end

    # Awaitから復帰した時に呼ばれる。
    # ==== Args
    # [response] Awaitの結果(Delayer::Deferred::Response::Base)
    # [deferred] 現在実行中のDeferred
    def give_response(response, deferred)
      @delayer.new do
        next if deferred.spoiled?
        deferred.exit_await
        fiber.resume(response).accept_request(worker: self,
                                              deferred: deferred)
      end
      nil
    end

    # Tools#pass から復帰した時に呼ばれる。
    # ==== Args
    # [deferred] 現在実行中のDeferred
    def resume_pass(deferred)
      deferred.exit_pass
      @delayer.new do
        next if deferred.spoiled?
        fiber.resume(nil).accept_request(worker: self,
                                         deferred: deferred)
      end
    end

    private

    def fiber
      @fiber ||= Fiber.new { |response|
        loop do
          response = wait_and_activate(response)
          case response.value
          when Delayer::Deferred::SequenceError
            raise response.value
          end
        end
      }.tap do |f|
        f.resume(@initial)
        @initial = nil
      end
    end

    def wait_and_activate(argument)
      response = catch(:success) do
        failed = catch(:__deferredable_fail) do
          if argument.value.is_a? Deferredable::Awaitable
            throw :success, +argument.value
          else
            defer = Fiber.yield(Request::NEXT_WORKER)
            res = defer.activate(argument)
            if res.is_a? Delayer::Deferred::Deferredable::Awaitable
              defer.add_awaited(res)
            end
          end
          throw :success, res
        rescue Exception => e # rubocop:disable Lint/RescueException
          throw :__deferredable_fail, e
        end
        Response::Ng.new(failed)
      end
      if response.is_a?(Response::Base)
        response
      else
        Response::Ok.new(response)
      end
    end
  end
end


text:
goog.provide('ag.bio.primer.PrimerFactory');

goog.require('goog.asserts');

goog.require('ag.bio.grammar');
goog.require('ag.bio.BioString');
goog.require('ag.bio.RestrictionEnzyme');
goog.require('ag.bio.primer.DimerScoreCalculator');
goog.require('ag.bio.primer.Primer');
goog.require('ag.bio.primer.PrimerSearchParameters');
goog.require('ag.bio.primer.ThermodynamicCalculator');

/**
 * Defaults are also the same as in PrimerSearchParamters.
 *
 * @constructor
 * @param {number=} sodiumConcentration defaults to .2 moles
 * @param {number=} primerDnaConcentration defaults to .000001 moles
 */
ag.bio.primer.PrimerFactory = function(sodiumConcentration, primerDnaConcentration) {
	/**
	 * @type {number}
	 * @private
	 */
	this.sodiumConcentration_ = goog.isNumber(sodiumConcentration) ? sodiumConcentration :
																	 ag.bio.primer.PrimerSearchParameters.Defaults.SODIUM_CONCENTRATION;

	/**
	 * @type {number}
	 * @private
	 */
	this.primerDnaConcentration_ = goog.isNumber(primerDnaConcentration) ? primerDnaConcentration :
																		   ag.bio.primer.PrimerSearchParameters.Defaults.PRIMER_DNA_CONCENTRATION;

	/**
	 * @type {ag.bio.primer.PrimerSearchParameters}
	 * @private
	 */
	this.primerSearchParameters_ = null;

	/**
	 * @type {ag.bio.primer.DimerScoreCalculator}
	 * @private
	 */
	this.dimerScoreCalculator_ = new ag.bio.primer.DimerScoreCalculator();

	goog.asserts.assert(this.sodiumConcentration_ > 0.);
	goog.asserts.assert(this.primerDnaConcentration_ > 0.);
};

/**********************************************************************************************/ goog.scope(function() {
// Aliases
var assert = goog.asserts.assert;

var grammar = ag.bio.grammar;

var BioString = ag.bio.BioString;
var RestrictionEnzyme = ag.bio.RestrictionEnzyme;
var Primer = ag.bio.primer.Primer;
var PrimerFactory = ag.bio.primer.PrimerFactory;
var PrimerSearchParameters = ag.bio.primer.PrimerSearchParameters;
var ThermodynamicCalculator = ag.bio.primer.ThermodynamicCalculator;

/**
 * @param {BioString} dnaString
 * @param {RestrictionEnzyme} restrictionEnzyme
 * @param {number=} tm if !defined or null, automatically calculated using the ThermodynamicCalculator
 * @return {Primer}
 */
PrimerFactory.prototype.makePrimer = function(dnaString, restrictionEnzyme, tm) {
	assert(dnaString.grammar() === grammar.DNA);
	assert(!dnaString.hasGaps());
	assert(dnaString.isEmpty() || dnaString.onlyContainsACGT());

	var fullPrimerSequence = Primer.sequence(dnaString, restrictionEnzyme);
	if (!goog.isDefAndNotNull(tm))
		tm = ThermodynamicCalculator.meltingTemperature(fullPrimerSequence, this.sodiumConcentration_, this.primerDnaConcentration_);

    var homoDimerScore = this.dimerScoreCalculator_.homoDimerScore(fullPrimerSequence);
    return new Primer(null, dnaString, restrictionEnzyme, tm, homoDimerScore, this.primerSearchParameters_);
}

/** @return {number} */
PrimerFactory.prototype.primerDnaConcentration = function() {
	return this.primerDnaConcentration_;
};

/**
 * Resets all variables to their default values.
 */
PrimerFactory.prototype.reset = function() {
	this.sodiumConcentration_ = PrimerSearchParameters.defaults.SODIUM_CONCENTRATION;
	this.primerDnaConcentration_ = PrimerSearchParameters.defaults.PRIMER_DNA_CONCENTRATION;
	this.primerSearchParameters_ = null;
};

/**
 * @param {number} newPrimerDnaConcentration
 */
PrimerFactory.prototype.setPrimerDnaConcentration = function(newPrimerDnaConcentration) {
	assert(goog.isNumber(newPrimerDnaConcentration));
	this.primerDnaConcentration_ = newPrimerDnaConcentration;
};

/**
 * @param {PrimerSearchParameters} primerSearchParameters
 */
PrimerFactory.prototype.setPrimerSearchParameters = function(primerSearchParameters) {
	assert(!primerSearchParameters || primerSearchParameters instanceof PrimerSearchParameters);
	this.primerSearchParameters_ = primerSearchParameters;
};

/**
 * @param {number} newSodiumDnaConcentration
 */
PrimerFactory.prototype.setSodiumConcentration = function(newSodiumDnaConcentration) {
	assert(goog.isNumber(newSodiumDnaConcentration));
	this.sodiumConcentration_ = newSodiumDnaConcentration;
};

/** @return {number} */
PrimerFactory.prototype.sodiumConcentration = function() {
	return this.sodiumConcentration_;
};

/*******************************************************************************************************************/});


text:
<?php

namespace Buku\Controller\Plugin;

use Zend\Mvc\Controller\Plugin\AbstractPlugin;

class MyPlugin extends AbstractPlugin {

	public function toMoney($value) {
		return number_format($value , 0 , "." , ",");
	}

	/*
	public function logout() {

		}*/

}

?>


text:
package au.gov.qld.pub.orders.config;

import au.gov.qld.pub.orders.config.filter.CspInterceptor;
import au.gov.qld.pub.orders.web.ErrorHandlerFilter;
import au.gov.qld.pub.orders.web.ViewPostProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
import org.springframework.web.servlet.config.annotation.*;

import java.util.concurrent.TimeUnit;

@Configuration
public class ConfigMvc implements WebMvcConfigurer {

    @Autowired
    private ViewPostProcessor viewPostProcessor;

    @Autowired
    private CspInterceptor cspInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(viewPostProcessor);
        registry.addInterceptor(cspInterceptor);
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/web-template-release/**").addResourceLocations("classpath:/templates/web-template-release")
            .setCacheControl(CacheControl.maxAge(5, TimeUnit.MINUTES));

        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/error").setViewName("error");
        registry.addViewController("/notfound").setViewName("notfound");
        registry.addViewController("/added").setViewName("added");
        //- TODO: REMOVE FOR RELEASES or make only on profile dev local etc
        registry.addViewController("/test").setViewName("test");
    }

}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/alert.proto

namespace Google\Cloud\Monitoring\V3\AlertPolicy\Condition;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Specifies how many time series must fail a predicate to trigger a
 * condition. If not specified, then a `{count: 1}` trigger is used.
 *
 * Generated from protobuf message google.monitoring.v3.AlertPolicy.Condition.Trigger
 */
class Trigger extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $count
     *           The absolute number of time series that must fail
     *           the predicate for the condition to be triggered.
     *     @type float $percent
     *           The percentage of time series that must fail the
     *           predicate for the condition to be triggered.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Monitoring\V3\Alert::initOnce();
        parent::__construct($data);
    }

    /**
     * The absolute number of time series that must fail
     * the predicate for the condition to be triggered.
     *
     * Generated from protobuf field int32 count = 1;
     * @return int
     */
    public function getCount()
    {
        return $this->readOneof(1);
    }

    /**
     * The absolute number of time series that must fail
     * the predicate for the condition to be triggered.
     *
     * Generated from protobuf field int32 count = 1;
     * @param int $var
     * @return $this
     */
    public function setCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The percentage of time series that must fail the
     * predicate for the condition to be triggered.
     *
     * Generated from protobuf field double percent = 2;
     * @return float
     */
    public function getPercent()
    {
        return $this->readOneof(2);
    }

    /**
     * The percentage of time series that must fail the
     * predicate for the condition to be triggered.
     *
     * Generated from protobuf field double percent = 2;
     * @param float $var
     * @return $this
     */
    public function setPercent($var)
    {
        GPBUtil::checkDouble($var);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return $this->whichOneof("type");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Trigger::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_Trigger::class);


text:
namespace MusicArtists.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public class Artist
    {
        private ICollection<Album> albums;

        public Artist()
        {
            this.albums = new HashSet<Album>();
        }

        public int ArtistId { get; set; }

        [Required]
        [MinLength(1)]
        [MaxLength(25)]
        public string Name { get; set; }

        public DateTime? DateOfBirth { get; set; }

        public int CountryId { get; set; }

        [Required]
        public virtual Country Country { get; set; }

        public virtual ICollection<Album> Albums
        {
            get { return this.albums; }
            set { this.albums = value; }
        }
    }
}


text:
export const commonModuleList: ElectronInternal.ModuleEntry[] = [
  { name: 'clipboard', loader: () => require('./clipboard') },
  { name: 'shell', loader: () => require('./shell') },
  // The internal modules, invisible unless you know their names.
  { name: 'deprecate', loader: () => require('./deprecate'), private: true }
];


text:
namespace Microsoft.Protocols.TestSuites.MS_ONESTORE
{
    using System.Collections.Generic;

    /// <summary>
    /// This class is used to represent a ObjectSpaceObjectPropSet.
    /// </summary>
    public class ObjectSpaceObjectPropSet
    {
        /// <summary>
        /// Gets or sets an ObjectSpaceObjectStreamOfOIDs that specifies the count and list of objects that are referenced by this ObjectSpaceObjectPropSet.
        /// </summary>
        public ObjectSpaceObjectStreamOfOIDs OIDs { get; set; }
        /// <summary>
        /// Gets or sets The value of OSIDs.
        /// </summary>
        public ObjectSpaceObjectStreamOfOSIDs OSIDs { get; set; }
        /// <summary>
        /// Gets or sets the value of ContextIDs field.
        /// </summary>
        public ObjectSpaceObjectStreamOfContextIDs ContextIDs { get; set; }
        /// <summary>
        /// Gets or sets the value of body field.
        /// </summary>
        public PropertySet Body { get; set; }
        /// <summary>
        /// Gets or sets the value of padding field.
        /// </summary>
        public byte[] Padding { get; set; }

        /// <summary>
        /// This method is used to deserialize the ObjectSpaceObjectPropSet from the specified byte array and start index.
        /// </summary>
        /// <param name="byteArray">Specify the byte array.</param>
        /// <param name="startIndex">Specify the start index from the byte array.</param>
        /// <returns>Return the length in byte of the ObjectSpaceObjectPropSet.</returns>
        public int DoDeserializeFromByteArray(byte[] byteArray, int startIndex)
        {
            int index = startIndex;
            this.OIDs = new ObjectSpaceObjectStreamOfOIDs();
            int len = this.OIDs.DoDeserializeFromByteArray(byteArray, index);
            index += len;
            if (this.OIDs.Header.OsidStreamNotPresent == 0)
            {
                this.OSIDs = new ObjectSpaceObjectStreamOfOSIDs();
                len = this.OSIDs.DoDeserializeFromByteArray(byteArray, index);
                index += len;

                if (this.OSIDs.Header.ExtendedStreamsPresent == 1)
                {
                    this.ContextIDs = new ObjectSpaceObjectStreamOfContextIDs();
                    len = this.ContextIDs.DoDeserializeFromByteArray(byteArray, index);
                    index += len;
                }
            }
            this.Body = new PropertySet();
            len = this.Body.DoDeserializeFromByteArray(byteArray, index);
            index += len;

            int paddingLength = 8 - (index - startIndex) % 8;
            if (paddingLength < 8)
            {
                this.Padding = new byte[paddingLength];
                index += paddingLength;
            }
            return index - startIndex;
        }
        /// <summary>
        /// This method is used to convert the element of the ObjectSpaceObjectPropSet into a byte List.
        /// </summary>
        /// <returns>Return the byte list which store the byte information of the ObjectSpaceObjectPropSet.</returns>
        public List<byte> SerializeToByteList()
        {
            List<byte> byteList = new List<byte>();
            byteList.AddRange(this.OIDs.SerializeToByteList());
            byteList.AddRange(this.OSIDs.SerializeToByteList());
            byteList.AddRange(this.ContextIDs.SerializeToByteList());
            byteList.AddRange(this.Body.SerializeToByteList());
            byteList.AddRange(this.Padding);

            return byteList;
        }
    }
}


text:
namespace crashpad {
namespace test {

std::string ErrnoMessage(int err, const std::string& base) {
#if defined(OS_POSIX)
  std::string err_as_string = base::safe_strerror(errno);
  const char* err_string = err_as_string.c_str();
#elif defined(OS_WIN)
  char err_string[256];
  strerror_s(err_string, errno);
#endif
  return base::StringPrintf("%s%s%s (%d)",
                            base.c_str(),
                            base.empty() ? "" : ": ",
                            err_string,
                            err);
}

std::string ErrnoMessage(const std::string& base) {
  return ErrnoMessage(errno, base);
}

#if defined(OS_WIN)
std::string ErrorMessage(const std::string& base) {
  return base::StringPrintf(
      "%s%s%s",
      base.c_str(),
      base.empty() ? "" : ": ",
      logging::SystemErrorCodeToString(GetLastError()).c_str());
}
#endif

}  // namespace test
}  // namespace crashpad


text:
AT.prototype.atPwdFormHelpers = {
    disabled: function() {
        return AccountsTemplates.disabled();
    },
    fields: function() {
        var parentData = Template.parentData();
        var state = (parentData && parentData.state) || AccountsTemplates.getState();
        return _.filter(AccountsTemplates.getFields(), function(s) {
            return _.contains(s.visible, state);
        });
    },
    showForgotPasswordLink: function() {
        var parentData = Template.parentData();
        var state = (parentData && parentData.state) || AccountsTemplates.getState();
        return state === "signIn" && AccountsTemplates.options.showForgotPasswordLink;
    },
};

AT.prototype.atPwdFormEvents = {
    // Form submit
    "submit #at-pwd-form": function(event, t) {
        event.preventDefault();
        $("#at-btn").blur();

        AccountsTemplates.setDisabled(true);

        var parentData = Template.parentData();
        var state = (parentData && parentData.state) || AccountsTemplates.getState();
        var preValidation = (state !== "signIn");

        // Client-side pre-validation
        // Validates fields values
        // NOTE: This is the only place where password validation can be enforced!
        var formData = {};
        var someError = false;
        var errList = [];
        _.each(AccountsTemplates.getFields(), function(field){
            // Considers only visible fields...
            if (!_.contains(field.visible, state))
                return;

            var fieldId = field._id;
            var rawValue = field.getValue(t);
            var value = field.fixValue(rawValue);
            // Possibly updates the input value
            if (value !== rawValue)
                field.setValue(t, value);
            if (value !== undefined && value !== "")
                formData[fieldId] = value;

            // Validates the field value only if current state is not "signIn"
            if (preValidation && field.getStatus() !== false){
                var validationErr = field.validate(value, "strict");
                if (validationErr) {
                    if (field.negativeValidation)
                        field.setError(validationErr);
                    else{
                        var fId = T9n.get(field.getDisplayName(), markIfMissing=false);
                        //errList.push(fId + ": " + err);
                        errList.push({
                            field: field.getDisplayName(),
                            err: validationErr
                        });
                    }
                    someError = true;
                }
                else
                    field.setSuccess();
            }
        });
        // Clears error and result
        AccountsTemplates.clearError();
        AccountsTemplates.clearResult();
        // Possibly sets errors
        if (someError){
            if (errList.length)
                AccountsTemplates.state.form.set("error", errList);
            AccountsTemplates.setDisabled(false);
            return;
        }

        // Extracts username, email, and pwds
        var current_password = formData.current_password;
        var email = formData.email;
        var password = formData.password;
        var password_again = formData.password_again;
        var username = formData.username;
        var username_and_email = formData.username_and_email;
        // Clears profile data removing username, email, and pwd
        delete formData.current_password;
        delete formData.email;
        delete formData.password;
        delete formData.password_again;
        delete formData.username;
        delete formData.username_and_email;

        if (AccountsTemplates.options.confirmPassword){
            // Checks passwords for correct match
            if (password_again && password !== password_again){
                var pwd_again = AccountsTemplates.getField("password_again");
                if (pwd_again.negativeValidation)
                    pwd_again.setError(AccountsTemplates.texts.errors.pwdMismatch);
                else
                    AccountsTemplates.state.form.set("error", [{
                        field: pwd_again.getDisplayName(),
                        err: AccountsTemplates.texts.errors.pwdMismatch
                    }]);
                AccountsTemplates.setDisabled(false);
                return;
            }
        }

        // -------
        // Sign In
        // -------
        if (state === "signIn") {
            var pwdOk = !!password;
            var userOk = true;
            var loginSelector;
            if (email)
                loginSelector = {email: email};
            else if (username)
                loginSelector = {username: username};
            else if (username_and_email)
                loginSelector = username_and_email;
            else
                userOk = false;

            // Possibly exits if not both 'password' and 'username' are non-empty...
            if (!pwdOk || !userOk){
                AccountsTemplates.setDisabled(false);
                return;
            }

            return Meteor.loginWithPassword(loginSelector, password, function(error) {
                AccountsTemplates.submitCallback(error, state);
            });
        }

        // -------
        // Sign Up
        // -------
        if (state === "signUp") {
            var hash = AccountsTemplates.hashPassword(password);
            return Meteor.call("ATCreateUserServer", {
                username: username,
                email: email,
                password: hash,
                profile: formData,
            }, function(error){
                AccountsTemplates.submitCallback(error, undefined, function(){
                    if (AccountsTemplates.options.sendVerificationEmail && AccountsTemplates.options.enforceEmailVerification){
                        AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.singUpVerifyEmail);
                        // Cleans up input fields' content
                        _.each(AccountsTemplates.getFields(), function(field){
                            // Considers only visible fields...
                            if (!_.contains(field.visible, state))
                                return;
                            var fieldId = field._id;
                            t.$("#at-field-" + fieldId).val("");
                        });
                        AccountsTemplates.setDisabled(false);
                        return;
                    }
                    var loginSelector;
                    if (email)
                        loginSelector = {email: email};
                    else if (username)
                        loginSelector = {username: username};
                    else
                        loginSelector = username_and_email;
                    Meteor.loginWithPassword(loginSelector, password, function(error) {
                        AccountsTemplates.submitCallback(error, state, function(){
                            AccountsTemplates.setState("signIn");
                        });
                    });
                });
            });
        }

        //----------------
        // Forgot Password
        //----------------
        if (state === "forgotPwd"){
            return Accounts.forgotPassword({
                email: email
            }, function(error) {
                AccountsTemplates.submitCallback(error, state, function(){
                    AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.emailSent);
                    t.$("#at-field-email").val("");
                });
            });
        }

        //--------------------------------
        // Reset Password / Enroll Account
        //--------------------------------
        if (state === "resetPwd" || state === "enrollAccount") {
            return Accounts.resetPassword(AccountsTemplates.paramToken, password, function(error) {
                AccountsTemplates.submitCallback(error, state, function(){
                    var pwd_field_id;
                    if (state === "resetPwd")
                        AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.pwdReset);
                    else // Enroll Account
                        AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.pwdSet);
                    t.$("#at-field-password").val("");
                    if (AccountsTemplates.options.confirmPassword)
                        t.$("#at-field-password_again").val("");
                });
            });
        }

        //----------------
        // Change Password
        //----------------
        if (state === "changePwd"){
            return Accounts.changePassword(current_password, password, function(error) {
                AccountsTemplates.submitCallback(error, state, function(){
                    AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.pwdChanged);
                    t.$("#at-field-current_password").val("");
                    t.$("#at-field-password").val("");
                    if (AccountsTemplates.options.confirmPassword)
                        t.$("#at-field-password_again").val("");
                });
            });
        }
    },
};


text:
var fs = require('fs');

process.on('message', function(msg) {
  fs.readFile(__dirname + '/testingBuffers/algorithmBuffer.txt', function(err, alg) {
    if (err !== null) process.stdout.write('err');

    fs.readFile(__dirname + '/testingBuffers/testInputBuffer.txt', 'utf8', function(err, data) {
      if (err !== null) {
        process.stdout.write('err');
      }

      var inputs = JSON.parse(data);
      var results = JSON.stringify(timedTest(alg, inputs));

      process.stdout.write(results);
    })
  })
});

function timedTest(userInput, data) {
  var currentInputSize = 100;
  var maxInputSize = 10100;
  var avgCutoff = 2100;
  var avgIterations = 3;
  var stepFactor = 1000;
  var result = [];
  var runtime;

  while (currentInputSize < maxInputSize) {
    if (currentInputSize <= avgCutoff) {
      runtime = runTimeAverage(userInput, data.slice(0, currentInputSize), avgIterations);
    } else {
      runtime = getRunTime(userInput, data.slice(0, currentInputSize));
    }

    result.push(runtime);
    currentInputSize += stepFactor;
  }

  return result;
}

function memoize(func) {
  var cached = {};

  return function() {
    var args = Array.prototype.slice.call(arguments);
    if (!cached[args]) {
      cached[args] = func.apply(this, arguments);
    }

    return cached[args];
  };
}

var memoBuild = memoize(buildFunc);

function runTimeAverage(userInput, testData, iterations) {
  var total = 0;
  var i = 0;
  var averageRun;
  var stats;

  while (i < iterations) {
    stats = getRunTime(userInput, testData);
    total += stats[1];
    i++;
  }

  averageRun = total / iterations;

  return [stats[0], Number(averageRun.toFixed(3))];
}

function getRunTime(userInput, testData) {
  var userAlg = memoBuild(userInput);

  var time = process.hrtime();
  var result = userAlg(testData);
  var diff = process.hrtime(time);
  var runTime = (diff[0] * 1e9 + diff[1]) / 1e6;

  return [testData.length, Number(runTime.toFixed(3))];
}

function buildFunc(userInput) {

  var param = userInput.slice(userInput.indexOf('(') + 1, userInput.indexOf(')'));
  // var algString = userInput.slice(userInput.indexOf('{') + 1, userInput.lastIndexOf('}'));
  var name = getFuncName(userInput);
  var wrappedAlg = recursionFix(userInput, name, param);
  var userAlg = new Function(param, wrappedAlg);

  return userAlg;
}

function recursionFix(string, name, param) {

  var insertBefore = 'var alg=function(' + param + '){';
  var insertAfter = 'return ' + name + '(' + param + ');}; return alg(' + param + ')';

  return insertBefore + string + insertAfter;
}

function getFuncName(string) {
  var userInput = string.slice(0);

  var dStop = string.indexOf('=');
  var eStop = string.indexOf('(');
  var funcName;

  while (string[0] === ' ') {
    userInput = userInput.slice(1);
  }

  if (userInput.slice(0,3) == 'var') {
    if (userInput[--dStop] == ' ') {
      funcName = userInput.slice(4, dStop);
    } else {
      funcName = userInput.slice(4, ++dStop);
    }
  }
  if (userInput.slice(0, 8) == 'function') {
    if (userInput[--eStop] == ' ') {
      funcName = userInput.slice(9, eStop);
    } else {
      funcName = userInput.slice(9, ++eStop);
    }
  }

  return funcName;
}


text:
package com.raulh82vlc.CheckoutShoppingList.domain.datasources.net;

import android.content.Context;

import com.raulh82vlc.CheckoutShoppingList.domain.exceptions.ConnectionException;
import com.raulh82vlc.CheckoutShoppingList.domain.exceptions.HttpException;

import java.util.List;

/**
 * Network Operations API contract
 *
 * @author Raul Hernandez Lopez
 */
public interface NetOperations<C> {

    /**
     * Gets a the list of comics from the Network
     **/
    List<C> getComicsList(Context context) throws ConnectionException, HttpException;

    boolean isSuccess(int code);
}


text:
@extends('layouts.pivot')
@section('content')
<form class="w100 textLeft" method="post" action=
"{{ route('register') }}" onkeypress="return event.keyCode != 13; //prevent form from being submitted on 'Enter' to prevent complicated bugs">
  {{ csrf_field() }}

    @if ($errors->has('email'))

          {{ $errors->first('email') }}

    @endif

has('email') ? ' has-error' : '' }}">
      E-Mail
      Address

        <input id="email" class="w67" type="email" name="email"
        value="{{ $email }}" required="" autofocus=""
        @if ($isConfirmation)
        readonly
        @endif
        >

    <input id="token" type="hidden" name="token"
    value="{{ $token }}">

            Begin Registration

  @if ($isConfirmation)
    @if ($errors->has('name'))

          {{ $errors->first('name') }}

    @endif

has('name') ? ' has-error' : '' }}">
      Name

        <input id="name" type="text" class="w67" name="name"
        value="{{ old('name') }}" required="">

    @if ($errors->has('password'))

          {{ $errors->first('password') }}

    @endif

has('password') ? ' has-error' : '' }}">
      Password

        <input id="password" type="password" class="w67" name=
        "password" required="">

      Confirm Password

        <input id="password-confirm" type="password" class="w67"
        name="password_confirmation" required="">

        <button type="submit" class="centeredRegistrationButton" >Register</button>

    @endif
</form>
@endsection
@section('scripts')

@endsection


text:
ZfrQuadernoModule interfaces with ZfrQuaderno.

## Requirements

- [ZfrQuaderno](https://github.com/zf-fr/zfr-quaderno)

## Installation

Installation is only officially supported using Composer:

```sh
php composer.phar require zfr/zfr-quaderno-module:1.*
```

Copy-paste the `zfr_quaderno.global.php.dist` file to your `autoload` folder, and enable the module by adding
`ZfrQuadernoModule` to your `application.config.php` file.


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 3 Responsive Design Tutorial | RevillWeb.com</title>

    <link href="../bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
    <link href="../bower_components/bootstrap/dist/css/bootstrap-theme.css" rel="stylesheet">

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

                BS3 TUTORIAL

            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

            </button>

Home

About

Contact

Twitter Bootstrap 3: Responsive Design Tutorial!

A comprehensive tutorial showing you how to quickly create responsive designs using Twitter Bootstrap 3.

Use Twitter Bootstrap to create responsive designs for desktop, tablet & mobile

Twitter bootstrap allows web developers and designers to quickly create attractive and responsive website templates. This tutorial provided by RevillWeb.com will show you how to use Twitter Bootstrap 3 to create this responsive website template.

Visit the tutorial now to learn more:

                    TO THE TUTORIAL

Resources

Download Twitter Bootstrap

Bootstrap Responsive Themes

UK: HTML & CSS: Design and Build Web Sites

UK: Bootstrap Site Blueprints

US: HTML & CSS: Design and Build Web Sites

US: Bootstrap Site Blueprints

 Footer section 1

Content for the first footer section.

 Footer section 2

Content for the second footer section.

 Footer section 3

Content for the third footer section.


text:
<?php
SeaMist::getInstance()->registerImplementation('Alfresco', 'AlfrescoSeaMistRepository');
SeaMist::getInstance()->registerImplementation('KnowledgeTree', 'KnowledgeTreeSeaMistRepository');

if (!function_exists('lcfirst')) {
	function lcfirst($string)
	{
		if (strlen($string)) {
			$string{0} = strtolower($string{0});
			return $string;
		}
	}
}
?>


text:
//
//
// MIT License
//
// Copyright (c) 2017 Stellacore Corporation.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject
// to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//

/*! \file
\brief  This file contains unit test for dat::SubExtents
*/

#include "libdat/SubExtents.h"

#include "libdat/info.h"
#include "libio/stream.h"

#include <iostream>
#include <sstream>
#include <string>

namespace
{

//! Check for common functions
std::string
dat_SubExtents_test0
	()
{
	std::ostringstream oss;
	/*
	dat::SubExtents const aNull;
	if (aNull.isValid())
	{
		oss << "Failure of null value test" << std::endl;
		oss << "infoString: " << aNull.infoString("aNull") << std::endl;
	}
	*/
	return oss.str();
}

	//! Quantized SubExtents instance
	dat::SubExtents
	gotFor
		( size_t const & ul0
		, size_t const & ul1
		, size_t const & high
		, size_t const & wide
		, size_t const & delta
		)
	{
		dat::RowCol const ul{{  ul0,  ul1 }};
		dat::Extents const size( high, wide  );
		dat::SubExtents const orig(ul, size);
		return dat::SubExtents::quantized(orig, delta);
	}

	//! UnQuantized SubExtents instance
	dat::SubExtents
	expFor
		( size_t const & ul0
		, size_t const & ul1
		, size_t const & high
		, size_t const & wide
		)
	{
		dat::RowCol const ul{{  ul0,  ul1 }};
		dat::Extents const size( high, wide  );
		return dat::SubExtents(ul, size);
	}

	bool
	areSame
		( dat::SubExtents const & got
		, dat::SubExtents const & exp
		)
	{
		bool same{ false };
		bool const bothNull((! exp.isValid()) && (! got.isValid()));
		if (! bothNull)
		{
			same = got.nearlyEquals(exp);
		}
		return same;
	}

	void
	checkSubs
		( std::ostream & oss
		, dat::SubExtents const & got
		, dat::SubExtents const & exp
		)
	{
		if (! areSame(got, exp))
		{
			oss << "Failure of sub extents quantization test" << std::endl;
			oss << dat::infoString(exp, "exp") << std::endl;
			oss << dat::infoString(got, "got") << std::endl;
		}
	}

//! Check basic operations
std::string
dat_SubExtents_test1
	()
{
	std::ostringstream oss;

	dat::Extents const fullSize(104u, 106u);

	// check centering with even sizes
	{
		dat::Extents const cropSize(   4u,   6u   );
		dat::RowCol const expBegUL {{  10u,  10u }};
		dat::RowCol const absCenterRC{{  12u,  13u }};
		dat::RowCol const relCenterRC{{   2u,   3u }};

		dat::SubExtents const expSubSize(expBegUL, cropSize);
		dat::SubExtents const gotSubSize
			(dat::SubExtents::centeredOn(absCenterRC, cropSize));
		if (! gotSubSize.nearlyEquals(expSubSize))
		{
			oss << "Failure of simple even size test" << std::endl;
		}

		// check recovery of location w.r.t.
		dat::RowCol const gotAbsCenterRC
			(gotSubSize.fullRowColFor(relCenterRC));
		dat::RowCol const & expAbsCenterRC = absCenterRC;
		if (! dat::nearlyEquals(gotAbsCenterRC, expAbsCenterRC))
		{
			oss << "Failure of even absolute center recovery" << '\n';
			oss << dat::infoString(expAbsCenterRC, "expAbsCenterRC") << '\n';
			oss << dat::infoString(gotAbsCenterRC, "gotAbsCenterRC") << '\n';
		}

		// check subpixel version
		dat::Spot const expAbsCenterSpot
			{{ double(expAbsCenterRC[0]), double(expAbsCenterRC[1]) }};
		dat::Spot const relCenterSpot
			{{ double(relCenterRC[0]), double(relCenterRC[1]) }};
		dat::Spot const gotAbsCenterSpot
			(gotSubSize.fullSpotFor(relCenterSpot));
		if (! dat::nearlyEquals(gotAbsCenterSpot, expAbsCenterSpot))
		{
			oss << "Failure of even absolute center spot recovery" << '\n';
			oss << dat::infoString(expAbsCenterSpot, "expAbsCenterSpot")
				<< '\n';
			oss << dat::infoString(gotAbsCenterSpot, "gotAbsCenterSpot")
				<< '\n';
		}

		// check evaluate of local location from source
		dat::RowCol const & expRelCenterRC = relCenterRC;
		dat::RowCol const gotRelCenterRC
			(gotSubSize.subRowColFor(absCenterRC));
		if (! dat::nearlyEquals(gotRelCenterRC, expRelCenterRC))
		{
			oss << "Failure of even absolute center recovery" << '\n';
			oss << dat::infoString(expRelCenterRC, "expRelCenterRC") << '\n';
			oss << dat::infoString(gotRelCenterRC, "gotRelCenterRC") << '\n';
		}

	}
	// check centering with odd size
	{
		dat::Extents const cropSize(   3u,   5u   );
		dat::RowCol const expBegUL {{  10u,  10u }};
		dat::RowCol const expCenter{{  11u,  12u }};
		dat::RowCol const relCenter{{   1u,   2u }};

		dat::SubExtents const expSubSize(expBegUL, cropSize);
		dat::SubExtents const gotSubSize
			(dat::SubExtents::centeredOn(expCenter, cropSize));
		if (! gotSubSize.nearlyEquals(expSubSize))
		{
			oss << "Failure of simple even size test" << std::endl;
		}

		// check recovery of location w.r.t.
		dat::RowCol const gotCenter(gotSubSize.fullRowColFor(relCenter));
		if (! dat::nearlyEquals(gotCenter, expCenter))
		{
			oss << "Failure of odd absolute center recovery" << '\n';
			oss << dat::infoString(expCenter, "expCenter") << '\n';
			oss << dat::infoString(gotCenter, "gotCenter") << '\n';
		}
	}

	// check quantization
	{
		dat::SubExtents const got(gotFor( 0u, 0u, 3u, 3u  , 2u));
		dat::SubExtents const exp(expFor( 0u, 0u, 4u, 4u ));
		checkSubs(oss, got, exp);
	}
	{
		dat::SubExtents const got(gotFor( 7u, 8u, 3u, 3u  , 2u));
		dat::SubExtents const exp(expFor( 6u, 8u, 4u, 4u ));
		checkSubs(oss, got, exp);
	}

	return oss.str();
}

//! Check croppedCenter operations
std::string
dat_SubExtents_test2
	()
{
	std::ostringstream oss;

	// completely contained test
	{
		using dat::SubExtents;
		dat::Extents const fullSize(5u, 7u);
		dat::RowCol const subCenter{{ 2u, 3u }};
		dat::Extents const subSize(1u, 2u);
		SubExtents const expSub // for this case, compare to full center
			{ SubExtents::centeredOn(subCenter, subSize) };
		SubExtents const gotSub
			{ SubExtents::croppedCenterSize(subCenter, subSize, fullSize) };
		if (! gotSub.nearlyEquals(expSub))
		{
			oss << "Failure of cropped - interior test" << std::endl;
			oss << dat::infoString(expSub, "expSub") << std::endl;
			oss << dat::infoString(gotSub, "gotSub") << std::endl;
		}
	}

	//! Check cropped case UL corner
	{
		using dat::SubExtents;
		dat::Extents const fullSize(5u, 7u);
		dat::RowCol const subCenter{{ 0u, 0u }};
		dat::Extents const subSize(2u, 3u);
		SubExtents const expSub
			( dat::NdxBegEnd{ 0u, 1u }, dat::NdxBegEnd{ 0u, 2u }
			);
		SubExtents const gotSub
			{ SubExtents::croppedCenterSize(subCenter, subSize, fullSize) };
		if (! gotSub.nearlyEquals(expSub))
		{
			oss << "Failure of cropped - interior UL test" << std::endl;
			oss << dat::infoString(expSub, "expSub") << std::endl;
			oss << dat::infoString(gotSub, "gotSub") << std::endl;
		}
	}

	//! Check cropped case BR corner
	{
		using dat::SubExtents;
		dat::Extents const fullSize(5u, 7u);
		dat::RowCol const subCenter{{ 4u, 6u }};
		dat::Extents const subSize(2u, 3u);
		SubExtents const expSub
			( dat::NdxBegEnd{ 3u, 5u }, dat::NdxBegEnd{ 5u, 7u }
			);
		SubExtents const gotSub
			{ SubExtents::croppedCenterSize(subCenter, subSize, fullSize) };
		if (! gotSub.nearlyEquals(expSub))
		{
			oss << "Failure of cropped - interior BR test" << std::endl;
			oss << dat::infoString(expSub, "expSub") << std::endl;
			oss << dat::infoString(gotSub, "gotSub") << std::endl;
		}
	}

	return oss.str();
}

//! Check inclusion test
std::string
dat_SubExtents_test3
	()
{
	std::ostringstream oss;

	dat::Extents const fullSize(1000u, 2000u);
	dat::Extents const partSize(100u, 200u);
	dat::RowCol const ul{ 101u, 201u };
	dat::SubExtents const sub(ul, partSize);
	dat::RowCol const outUL{ 100u, 200u };
	dat::RowCol const inUL{ 101u, 201u };
	dat::RowCol const inBR{ 200u, 300u };
	dat::RowCol const outBR{ 201u, 301u };
	std::vector<std::pair<dat::RowCol, bool> > const inCases
		{ { outUL, false }
		, { inUL, true }
		, { inBR, true }
		, { outBR, false }
		};
	for (std::pair<dat::RowCol, bool> const & inCase : inCases)
	{
		dat::RowCol const & rowcol = inCase.first;
		bool const & expIn = inCase.second;
		bool const gotIn{ sub.includes(rowcol) };
		if (! (gotIn == expIn))
		{
			oss << "Failure of includes() test" << std::endl;
			oss << dat::infoString(expIn, "expIn") << std::endl;
			oss << dat::infoString(gotIn, "gotIn") << std::endl;
			oss << dat::infoString(rowcol, "rowcol") << std::endl;
			oss << dat::infoString(sub, "sub") << std::endl;
		}
	}

	return oss.str();
}

}

//! Unit test for dat::SubExtents
int
main
	( int const /*argc*/
	, char const * const * /*argv*/
	)
{
	std::ostringstream oss;

	// run tests
	oss << dat_SubExtents_test0();
	oss << dat_SubExtents_test1();
	oss << dat_SubExtents_test2();
	oss << dat_SubExtents_test3();

	// check/report results
	std::string const errMessages(oss.str());
	if (! errMessages.empty())
	{
		io::err() << errMessages << std::endl;
		return 1;
	}
	return 0;
}


text:
export function getData(target) {
    var form_data = {};
    var form = $(target).parent();
    var text_inputs = form.find('input[type="text"], input[type="password"], textarea');
    var radio_inputs = form.find('input[type="radio"]:checked');
    var checkboxes = form.find('input[type="checkbox"]:checked');
    for (var i = 0; i < text_inputs.length; i++) {
        if(text_inputs[i].dataset.req && !text_inputs[i].value) {
            return false;
        }
        form_data[text_inputs[i].name] = text_inputs[i].value;
    }
    for (var i = 0; i < radio_inputs.length; i++) {
        form_data[radio_inputs[i].name] = radio_inputs[i].value;
    }
    for (var i = 0; i < checkboxes.length; i++) {
        form_data[checkboxes[i].name] = true;
    }
    return form_data;
};

//submitting data to server
export function submitting(data, url, type, success, error, complete) {
    var emptyFunction = function(){};
    success = success || emptyFunction;
    error = error || emptyFunction;
    complete = complete || emptyFunction;
    data = data || {};
    if(data) {
        $.ajax({
            url,
            type,
            data,
            error,
            success,
            complete
        });
    }
    else {
        toast("Required fields are empty!");
    }
};


text:
//
//  UIScreen+GBToolbox.h
//  GBToolbox
//
//  Created by Luka Mirosevic on 23/02/16.
//  Copyright © 2016 Luka Mirosevic. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIScreen (GBToolbox)

/**
 Returns the bounds of the display, irrespective of the rotation.
 */
@property (assign, nonatomic, readonly) CGRect fixedBounds;

@end


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.orc;

import com.facebook.presto.orc.metadata.DwrfStripeCacheMode;
import com.google.common.collect.ImmutableList;
import io.airlift.units.DataSize;
import org.testng.annotations.Test;

import java.util.Optional;
import java.util.OptionalInt;

import static com.facebook.presto.orc.metadata.DwrfStripeCacheMode.INDEX_AND_FOOTER;
import static io.airlift.units.DataSize.Unit.BYTE;
import static io.airlift.units.DataSize.Unit.KILOBYTE;
import static io.airlift.units.DataSize.Unit.MEGABYTE;
import static org.testng.Assert.assertEquals;

public class TestOrcWriterOptions
{
    private static final DwrfStripeCacheMode DWRF_STRIPE_CACHE_MODE = INDEX_AND_FOOTER;
    private static final DataSize DWRF_STRIPE_CACHE_MAX_SIZE = new DataSize(27, MEGABYTE);

    @Test
    public void testDwrfWriterOptionsProperties()
    {
        for (boolean value : ImmutableList.of(true, false)) {
            OrcWriterOptions options = OrcWriterOptions.builder()
                    .withDwrfStripeCacheEnabled(value)
                    .withDwrfStripeCacheMode(DWRF_STRIPE_CACHE_MODE)
                    .withDwrfStripeCacheMaxSize(DWRF_STRIPE_CACHE_MAX_SIZE)
                    .build();

            if (value) {
                DwrfStripeCacheOptions dwrfStripeCacheOptions = options.getDwrfStripeCacheOptions().get();
                assertEquals(dwrfStripeCacheOptions.getStripeCacheMode(), DWRF_STRIPE_CACHE_MODE);
                assertEquals(dwrfStripeCacheOptions.getStripeCacheMaxSize(), DWRF_STRIPE_CACHE_MAX_SIZE);
            }
            else {
                assertEquals(Optional.empty(), options.getDwrfStripeCacheOptions());
            }
        }
    }

    @Test
    public void testProperties()
    {
        DataSize stripeMinSize = new DataSize(13, MEGABYTE);
        DataSize stripeMaxSize = new DataSize(27, MEGABYTE);
        int stripeMaxRowCount = 1_100_000;
        int rowGroupMaxRowCount = 15_000;
        DataSize dictionaryMaxMemory = new DataSize(13_000, KILOBYTE);
        DataSize stringMaxStatisticsLimit = new DataSize(128, BYTE);
        DataSize maxCompressionBufferSize = new DataSize(512, KILOBYTE);
        OptionalInt compressionLevel = OptionalInt.of(5);
        StreamLayout streamLayout = new StreamLayout.ByColumnSize();
        boolean integerDictionaryEncodingEnabled = true;
        boolean stringDictionarySortingEnabled = false;

        OrcWriterOptions.Builder builder = OrcWriterOptions.builder()
                .withStripeMinSize(stripeMinSize)
                .withStripeMaxSize(stripeMaxSize)
                .withStripeMaxRowCount(stripeMaxRowCount)
                .withRowGroupMaxRowCount(rowGroupMaxRowCount)
                .withDictionaryMaxMemory(dictionaryMaxMemory)
                .withMaxStringStatisticsLimit(stringMaxStatisticsLimit)
                .withMaxCompressionBufferSize(maxCompressionBufferSize)
                .withCompressionLevel(compressionLevel)
                .withStreamLayout(streamLayout)
                .withIntegerDictionaryEncodingEnabled(integerDictionaryEncodingEnabled)
                .withStringDictionarySortingEnabled(stringDictionarySortingEnabled);

        OrcWriterOptions options = builder.build();

        assertEquals(stripeMinSize, options.getStripeMinSize());
        assertEquals(stripeMaxSize, options.getStripeMaxSize());
        assertEquals(stripeMaxRowCount, options.getStripeMaxRowCount());
        assertEquals(rowGroupMaxRowCount, options.getRowGroupMaxRowCount());
        assertEquals(dictionaryMaxMemory, options.getDictionaryMaxMemory());
        assertEquals(stringMaxStatisticsLimit, options.getMaxStringStatisticsLimit());
        assertEquals(maxCompressionBufferSize, options.getMaxCompressionBufferSize());
        assertEquals(compressionLevel, options.getCompressionLevel());
        assertEquals(streamLayout, options.getStreamLayout());
        assertEquals(integerDictionaryEncodingEnabled, options.isIntegerDictionaryEncodingEnabled());
        assertEquals(stringDictionarySortingEnabled, options.isStringDictionarySortingEnabled());
        assertEquals(Optional.empty(), options.getDwrfStripeCacheOptions());
    }

    @Test
    public void testToString()
    {
        DataSize stripeMinSize = new DataSize(13, MEGABYTE);
        DataSize stripeMaxSize = new DataSize(27, MEGABYTE);
        int stripeMaxRowCount = 1_100_000;
        int rowGroupMaxRowCount = 15_000;
        DataSize dictionaryMaxMemory = new DataSize(13_000, KILOBYTE);
        DataSize stringMaxStatisticsLimit = new DataSize(128, BYTE);
        DataSize maxCompressionBufferSize = new DataSize(512, KILOBYTE);
        DataSize dwrfStripeCacheMaxSize = new DataSize(4, MEGABYTE);
        DwrfStripeCacheMode dwrfStripeCacheMode = DwrfStripeCacheMode.INDEX_AND_FOOTER;
        OptionalInt compressionLevel = OptionalInt.of(5);
        StreamLayout streamLayout = new StreamLayout.ByColumnSize();
        boolean integerDictionaryEncodingEnabled = false;
        boolean stringDictionarySortingEnabled = true;

        OrcWriterOptions writerOptions = OrcWriterOptions.builder()
                .withStripeMinSize(stripeMinSize)
                .withStripeMaxSize(stripeMaxSize)
                .withStripeMaxRowCount(stripeMaxRowCount)
                .withRowGroupMaxRowCount(rowGroupMaxRowCount)
                .withDictionaryMaxMemory(dictionaryMaxMemory)
                .withMaxStringStatisticsLimit(stringMaxStatisticsLimit)
                .withMaxCompressionBufferSize(maxCompressionBufferSize)
                .withCompressionLevel(compressionLevel)
                .withStreamLayout(streamLayout)
                .withIntegerDictionaryEncodingEnabled(integerDictionaryEncodingEnabled)
                .withStringDictionarySortingEnabled(stringDictionarySortingEnabled)
                .withDwrfStripeCacheEnabled(true)
                .withDwrfStripeCacheMaxSize(dwrfStripeCacheMaxSize)
                .withDwrfStripeCacheMode(dwrfStripeCacheMode)
                .build();

        String expectedString = "OrcWriterOptions{stripeMinSize=13MB, stripeMaxSize=27MB, stripeMaxRowCount=1100000, "
                + "rowGroupMaxRowCount=15000, dictionaryMaxMemory=13000kB, maxStringStatisticsLimit=128B, "
                + "maxCompressionBufferSize=512kB, compressionLevel=OptionalInt[5], streamLayout=ByColumnSize{}, "
                + "integerDictionaryEncodingEnabled=false, stringDictionarySortingEnabled=true, "
                + "dwrfWriterOptions=Optional[DwrfStripeCacheOptions{stripeCacheMode=INDEX_AND_FOOTER, stripeCacheMaxSize=4MB}], "
                + "ignoreDictionaryRowGroupSizes=false}";
        assertEquals(expectedString, writerOptions.toString());
    }
}


text:
package registofatura.ws.impl;

import java.io.IOException;

import javax.xml.registry.JAXRException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Endpoint;

import pt.ist.fenixframework.Config;
import pt.ist.fenixframework.FenixFramework;
import registofatura.ws.domain.RegistoFatura;
import registofatura.ws.impl.handler.MessageHandler;
import registofatura.ws.uddi.UDDINaming;

public class RegistoFaturaMain {

    private static String uddiURL;
    private static UDDINaming uddiNaming;
    private static String name;
    private static String url;

    /*
     * Representa a janela maxima, em ms, em que uma réplica fica à espera
     * de Im Alives da replica que se encontra acima. Após expirar, regista-se
     * novamente na fila.
     * */
    public static long MAX_TIMEOUT = 2000;

    /*
     * Intervalo de envio de mensagens de Im Alive.
     */
    public static long MESSAGE_INTERVAL = MAX_TIMEOUT / 4;

    public RegistoFaturaMain() {
        // TODO Auto-generated constructor stub
    }

    public static void main(final String[] args) {
        // Check arguments
        if (args.length < 4) {
            System.err.println("Argument(s) missing!");
            System.err.printf("Usage: java %s url%n", RegistoFaturaMain.class.getName());
            return;
        }

        uddiURL = args[0];
        name = args[1];
        url = args[2];
        final String db = args[3];
        System.out
                .println("uddiURL: " + uddiURL + " name: " + name + " url: " + url + " db: " + db);

        Endpoint endpoint = null;
        try {
            FenixFramework.initialize(new Config() {
                {
                    dbAlias = db;
                    dbUsername = "rest";
                    dbPassword = "r3st";
                    domainModelPath = "src/registofatura/dml/domain.dml";
                    rootClass = RegistoFatura.class;
                }
            });

            endpoint = Endpoint.create(new RegistoFaturaImpl());

            System.out.println("Publishing endpoint.");

            endpoint.publish(url);
            MessageHandler.setMyEndpoint(url);
            MessageHandler.setNextEndpoint(url);

            System.out.println("My and Next are set.");
            uddiNaming = new UDDINaming(uddiURL);
            //uddiNaming.unbind(name);
            registerReplica();

            // wait
            System.out.println("Awaiting connections");
            System.out.println("Press enter to shutdown");
            System.in.read();
            MessageHandler.sender.stop();
            MessageHandler.receiver.stop();

        } catch (Exception e) {
            System.out.printf("Caught exception: %s%n", e);
            //            e.printStackTrace();

        } finally {
            try {
                if (endpoint != null) {
                    // stop endpoint
                    endpoint.stop();
                    System.out.printf("Stopped %s%n", url);
                }
            } catch (Exception e) {
                System.out.printf("Caught exception when stopping: %s%n", e);
            }
            try {
                if (uddiNaming != null) {
                    // delete from UDDI
                    uddiNaming.unbind(name);
                    System.out.printf("Deleted '%s' from UDDI%n", name);
                }
            } catch (Exception e) {
                System.out.printf("Caught exception when deleting: %s%n", e);
            }
        }
    }

    public static void registerReplica() throws JAXRException, SOAPException, IOException {
        System.out.println("Looking up...");
        String possiblePrimary = uddiNaming.lookup(name);
        System.out.println("After Look up");
        System.out.println("Possible primary : " + possiblePrimary);
        if (possiblePrimary == null) {
            System.out.println("IS PRIMARY");
            // publish endpoint
            System.out.printf("Starting %s%n", url);
            // publish to UDDI
            System.out.printf("Publishing '%s' to UDDI at %s%n", name, uddiURL);
            uddiNaming.rebind(name, url);
        } else if (!possiblePrimary.equals(MessageHandler.MY_ENDPOINT)) {
            System.out.println("IS SECUNDARY");
            MessageFactory mf = MessageFactory.newInstance();
            // request adress messages
            SOAPMessage message = mf.createMessage();
            // pede o próximo endpoint e envia logo o seu, caso o endpoint para onde envia
            // nao tenha proximo para que lhe comece a enviar imediatamente "I'm alives"
            message.getSOAPHeader().setAttribute(MessageHandler.GET_NEXT_ADDRESS,
                    MessageHandler.MY_ENDPOINT);

            if (MessageHandler.DEBUG) {
                System.out.println("Calling message to " + possiblePrimary + "...");
            }

            SOAPConnectionFactory cf = SOAPConnectionFactory.newInstance();
            SOAPConnection soapConnection = cf.createConnection();

            try {
                soapConnection.call(message, possiblePrimary);
            } catch (Exception e) {
                System.out.println(e.getMessage()
                        + "\nTentou contactar o primario; primario morreu ---> REBINDA-SE");
                uddiNaming.rebind(name, url);
            }

            if (MessageHandler.DEBUG) {
                System.out.println("Sent message to primary >>");
                message.writeTo(System.out);
            }
        } else {
            //Ele próprio morreu enquanto primário e foi lançado novamente sem que ninguém o tenha substituído; não precisa de fazer rebind
            System.out.println("IS PRIMARY AGAIN");
        }
    }
}


text:
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

namespace Fort.Aggregator
{
    /// <summary>
    /// Represents a reference to a <see cref="Delegate"/> that may contain a
    /// <see cref="WeakReference"/> to the target. This class is used
    /// internally by the Prism Library.
    /// </summary>
    public class DelegateReference : IDelegateReference
    {
        private readonly Delegate _delegate;
        private readonly WeakReference _weakReference;
        private readonly MethodInfo _method;

        /// <summary>
        /// Initializes a new instance of <see cref="DelegateReference"/>.
        /// </summary>
        /// <param name="delegate">The original <see cref="Delegate"/> to create a reference for.</param>
        /// <param name="keepReferenceAlive">If <see langword="false" /> the class will create a weak reference to the delegate, allowing it to be garbage collected. Otherwise it will keep a strong reference to the target.</param>
        /// <exception cref="ArgumentNullException">If the passed <paramref name="delegate"/> is not assignable to <see cref="Delegate"/>.</exception>
        public DelegateReference(Delegate @delegate, bool keepReferenceAlive)
        {
            if (@delegate == null)
                throw new ArgumentNullException("delegate");

            if (keepReferenceAlive)
            {
                this._delegate = @delegate;
            }
            else
            {
                _weakReference = new WeakReference(@delegate.Target);
                _method = @delegate.Method;
            }
        }

        /// <summary>
        /// Gets the <see cref="Delegate" /> (the target) referenced by the current <see cref="DelegateReference"/> object.
        /// </summary>
        /// <value><see langword="null"/> if the object referenced by the current <see cref="DelegateReference"/> object has been garbage collected; otherwise, a reference to the <see cref="Delegate"/> referenced by the current <see cref="DelegateReference"/> object.</value>
        public Delegate Target
        {
            get
            {
                if (_delegate != null)
                {
                    return _delegate;
                }
                else
                {
                    return TryGetDelegate();
                }
            }
        }

        private Delegate TryGetDelegate()
        {

            if (_method.IsStatic)
            {
                return CreateDelegate(_method, null);
            }
            object target = _weakReference.Target;
            if (target != null)
            {
                return CreateDelegate(_method, target);
            }
            return null;
        }
        private static Delegate CreateDelegate( MethodInfo methodInfo, object target)
        {
            Func<Type[], Type> getType;
            var isAction = methodInfo.ReturnType.Equals((typeof(void)));
            var types = methodInfo.GetParameters().Select(p => p.ParameterType);

            if (isAction)
            {
                getType = Expression.GetActionType;
            }
            else
            {
                getType = Expression.GetFuncType;
                types = types.Concat(new[] { methodInfo.ReturnType });
            }

            if (methodInfo.IsStatic)
            {
                return Delegate.CreateDelegate(getType(types.ToArray()), methodInfo);
            }

            return Delegate.CreateDelegate(getType(types.ToArray()), target, methodInfo.Name);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace AndroidCodes
{
    public static class XmlHelpers
    {

        public static void TraversalXmlForImports(XmlNode xmlNode, List<string> imports)
        {
            string import = CodeHelper.MakeImport(xmlNode);
            if (import != null && imports.Contains(import) == false)
            {
                imports.Add(import);
            }
            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                TraversalXmlForImports(childNode, imports);
            }
        }

        public static void TraversalXmlForValues(XmlNode xmlNode, List<string> values, CodeType codeType)
        {
            string value = CodeHelper.MakeValue(xmlNode, codeType);
            if (value != null && values.Contains(value) == false)
            {
                values.Add(value);
            }
            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                TraversalXmlForValues(childNode, values, codeType);
            }
        }

        public static void TraversalXmlForFindViews(XmlNode xmlNode, List<string> findViews, CodeType codeType)
        {
            string findView = CodeHelper.MakeFindView(xmlNode, codeType);
            if (findView != null && findViews.Contains(findView) == false)
            {
                findViews.Add(findView);
            }
            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                TraversalXmlForFindViews(childNode, findViews, codeType);
            }
        }

        public static void TraversalXmlForSetViews(XmlNode xmlNode, List<string> setViews, CodeType codeType)
        {
            List<string> setView = CodeHelper.MakeSetView(xmlNode, codeType);
            if (setView != null)
            {
                setViews.AddRange(setView);
            }
            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                TraversalXmlForSetViews(childNode, setViews, codeType);
            }
        }
    }
}