text:
namespace hazel {
struct mime_value_t {
  types::hazel_types_t t;
  const wchar_t *mime;
};
// https://mediatemple.net/community/products/dv/204403964/mime-types
const wchar_t *LookupMIME(types::hazel_types_t t) {
  constexpr mime_value_t mimes[] = {
      {types::ascii, L"text/plain"},
      {types::utf7, L"text/plain;charset=UTF-7"},
      {types::utf8, L"text/plain;charset=UTF-8"},
      {types::utf8bom, L"text/plain;charset=UTF-8"},
      {types::utf16le, L"text/plain;charset=UTF-16LE"},
      {types::utf16be, L"text/plain;charset=UTF-16BE"},
      {types::utf32le, L"text/plain;charset=UTF-32LE"},
      {types::utf32be, L"text/plain;charset=UTF-32BE"},
      // text index end
      // binary
      {types::bitcode, L"application/octet-stream"},           ///< Bitcode file
      {types::archive, L"application/x-unix-archive"},         ///< ar style archive file
      {types::elf, L"application/x-elf"},                      ///< ELF Unknown type
      {types::elf_relocatable, L"application/x-relocatable"},  ///< ELF Relocatable object file
      {types::elf_executable, L"application/x-executable"},    ///< ELF Executable image
      {types::elf_shared_object, L"application/x-sharedlib"},  ///< ELF dynamically linked shared lib
      {types::elf_core, L"application/x-coredump"},            ///< ELF core image
      {types::macho_object, L"application/x-mach-binary"},     ///< Mach-O Object file
      {types::macho_executable, L"application/x-mach-binary"}, ///< Mach-O Executable
      {types::macho_fixed_virtual_memory_shared_lib, L"application/x-mach-binary"},    ///< Mach-O Shared Lib, FVM
      {types::macho_core, L"application/x-mach-binary"},                               ///< Mach-O Core File
      {types::macho_preload_executable, L"application/x-mach-binary"},                 ///< Mach-O Preloaded Executable
      {types::macho_dynamically_linked_shared_lib, L"application/x-mach-binary"},      ///< Mach-O dynlinked shared lib
      {types::macho_dynamic_linker, L"application/x-mach-binary"},                     ///< The Mach-O dynamic linker
      {types::macho_bundle, L"application/x-mach-binary"},                             ///< Mach-O Bundle file
      {types::macho_dynamically_linked_shared_lib_stub, L"application/x-mach-binary"}, ///< Mach-O Shared lib stub
      {types::macho_dsym_companion, L"application/x-mach-binary"},                     ///< Mach-O dSYM companion file
      {types::macho_kext_bundle, L"application/x-mach-binary"},                        ///< Mach-O kext bundle file
      {types::macho_universal_binary, L"application/x-mach-binary"},                   ///< Mach-O universal binary
      {types::coff_cl_gl_object, L"application/vnd.microsoft.coff"},   ///< Microsoft cl.exe's intermediate code file
      {types::coff_object, L"application/vnd.microsoft.coff"},         ///< COFF object file
      {types::coff_import_library, L"application/vnd.microsoft.coff"}, ///< COFF import library
      {types::pecoff_executable, L"application/vnd.microsoft.portable-executable"}, ///< PECOFF executable file
      {types::windows_resource, L"application/vnd.microsoft.resource"}, ///< Windows compiled resource file (.res)
      {types::wasm_object, L"application/wasm"},                        ///< WebAssembly Object file
      {types::pdb, L"application/octet-stream"},                        ///< Windows PDB debug info file
      /// archive
      {types::epub, L"application/epub"},
      {types::zip, L"application/zip"},
      {types::tar, L"application/x-tar"},
      {types::rar, L"application/vnd.rar"},
      {types::gz, L"application/gzip"},
      {types::bz2, L"application/x-bzip2"},
      {types::zstd, L"application/x-zstd"},
      {types::p7z, L"application/x-7z-compressed"},
      {types::xz, L"application/x-xz"},
      {types::pdf, L"application/pdf"},
      {types::swf, L"application/x-shockwave-flash"},
      {types::rtf, L"application/rtf"},
      {types::eot, L"application/octet-stream"},
      {types::ps, L"application/postscript"},
      {types::sqlite, L"application/vnd.sqlite3"},
      {types::nes, L"application/x-nes-rom"},
      {types::crx, L"application/x-google-chrome-extension"},
      {types::deb, L"application/vnd.debian.binary-package"},
      {types::lz, L"application/x-lzip"},
      {types::rpm, L"application/x-rpm"},
      {types::cab, L"application/vnd.ms-cab-compressed"},
      {types::msi, L"application/x-msi"},
      {types::dmg, L"application/x-apple-diskimage"},
      {types::xar, L"application/x-xar"},
      {types::wim, L"application/x-ms-wim"},
      {types::z, L"application/x-compress"},
      {types::nsis, L"application/x-nsis"},
      // image
      {types::jpg, L"image/jpeg"},
      {types::jp2, L"image/jp2"},
      {types::png, L"image/png"},
      {types::gif, L"image/gif"},
      {types::webp, L"image/webp"},
      {types::cr2, L"image/x-canon-cr2"},
      {types::tif, L"image/tiff"},
      {types::bmp, L"image/bmp"},
      {types::jxr, L"image/vnd.ms-photo"},
      {types::psd, L"image/vnd.adobe.photoshop"},
      {types::ico, L"image/vnd.microsoft.icon"}, // image/x-icon
      {types::qoi, L"image/qoi"},
      // docs
      {types::doc, L"application/msword"},
      {types::docx, L"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
      {types::xls, L"application/vnd.ms-excel"},
      {types::xlsx, L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
      {types::ppt, L"application/vnd.ms-powerpoint"},
      {types::pptx, L"application/vnd.openxmlformats-officedocument.presentationml.presentation"},
      //
      {types::ofd, L"application/ofd"}, // Open Fixed layout Document
      // font
      {types::woff, L"application/font-woff"},
      {types::woff2, L"application/font-woff"},
      {types::ttf, L"application/font-sfnt"},
      {types::otf, L"application/font-sfnt"},
      // Media
      {types::midi, L"audio/x-midi"},
      {types::mp3, L"audio/mpeg"},
      {types::m4a, L"audio/m4a"},
      {types::ogg, L"audio/ogg"},
      {types::flac, L"audio/flac"},
      {types::wav, L"audio/wave"},
      {types::amr, L"audio/3gpp"},
      {types::aac, L"application/vnd.americandynamics.acc"},
      {types::mp4, L"video/mp4"},
      {types::m4v, L"video/x-m4v"},
      {types::mkv, L"video/x-matroska"},
      {types::webm, L"video/webm"},
      {types::mov, L"video/quicktime"},
      {types::avi, L"video/x-msvideo"},
      {types::wmv, L"video/x-ms-wmv"},
      {types::mpeg, L"video/mpeg"},
      {types::flv, L"video/x-flv"},
      // support git
      {types::gitpack, L"application/x-git-pack"},
      {types::gitpkindex, L"application/x-git-pack-index"},
      {types::gitmidx, L"application/x-git-pack-multi-index"},
      {types::lnk, L"application/x-ms-shortcut"}, // .lnk application/x-ms-shortcut
      {types::iso, L"application/x-iso9660-image"},
      {types::ifc, L"application/vnd.microsoft.ifc"},
      {types::goff_object, L"application/x-goff-object"}};
  //
  for (const auto &m : mimes) {
    if (m.t == t) {
      return m.mime;
    }
  }
  return L"application/octet-stream";
}

} // namespace hazel


text:
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">
    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
        android:layout_height="match_parent" android:id="@+id/map" tools:context=".MapsActivity"
        android:name="com.google.android.gms.maps.SupportMapFragment" />

    <Button
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="..."
        android:id="@+id/button"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:background="#ff0000" />

</RelativeLayout>

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace DartVadius\YmlGenerator;

use DartVadius\YmlGenerator\offer\FunctionsYmlOffer;

/**
 * ymlGenerator
 *
 * @author DartVadius
 */
class GeneratorYmlOffer {

    private $writer;

    public function __construct() {
        $this->writer = new XMLWriter();
    }

    public function getWriter() {
        return $this->writer->outputMemory();
    }

    public function setWriter() {
        $this->writer = new XMLWriter();
    }

    /**
     * create full xml document
     *
     * @param array $head
     * @param array $offers
     * @return string
     */
    public function generate($head, $offers) {
        $this->addHeader($head);
        $this->addOffers($offers);
        return $this->addFooter();
    }

    /**
     * add header to xml
     *
     * @param array $head
     */
    public function generateHead($head) {
        $this->addHeader($head);
    }

    /**
     * add single offer to xml
     *
     * @param array $offer
     */
    public function generateOffer($offer) {
        $this->addOffer($offer);
    }

    /**
     * add footer to xml
     *
     * @return string
     */
    public function generateFooter() {
        return $this->addFooter();
    }

    /**
     * generate header for xml
     *
     * @param array $head
     */
    private function addHeader($head) {
        $this->writer->openMemory();
        $headRequared = $head['requared'];
        $headOptional = $head['optional'];
        $this->writer->startDocument('1.0', $headRequared['encode']);
        $this->writer->startElement('yml_catalog');
        $this->writer->writeAttribute('date', date('Y-m-d H:i'));
        $this->writer->startElement('shop');
        $this->writer->startElement('name');
        $headRequared['name'] = FunctionsYmlOffer::prepareField($headRequared['name']);
        $this->writer->text($headRequared['name']);
        $this->writer->endElement();
        $this->writer->startElement('company');
        $headRequared['company'] = FunctionsYmlOffer::prepareField($headRequared['company']);
        $this->writer->text($headRequared['company']);
        $this->writer->endElement();
        $this->writer->startElement('url');
        $this->writer->text($headRequared['url']);
        $this->writer->endElement();
        if (!empty($headOptional['platform'])) {
            $this->writer->startElement('platform');
            $headOptional['platform'] = FunctionsYmlOffer::prepareField($headOptional['platform']);
            $this->writer->text($headOptional['platform']);
            $this->writer->endElement();
        }
        if (!empty($headOptional['version'])) {
            $this->writer->startElement('version');
            $headOptional['version'] = FunctionsYmlOffer::prepareField($headOptional['version']);
            $this->writer->text($headOptional['version']);
            $this->writer->endElement();
        }
        if (!empty($headOptional['agency'])) {
            $this->writer->startElement('agency');
            $headOptional['agency'] = FunctionsYmlOffer::prepareField($headOptional['agency']);
            $this->writer->text($headOptional['agency']);
            $this->writer->endElement();
        }
        if (!empty($headOptional['email'])) {
            $this->writer->startElement('email');
            $this->writer->text($headOptional['email']);
            $this->writer->endElement();
        }

// set currencies
        $this->writer->startElement('currencies');
        foreach ($headRequared['currencies'] as $key => $value) {
            $this->writer->startElement('currency');
            $this->writer->writeAttribute('id', $key);
            $this->writer->writeAttribute('rate', $value);
            $this->writer->endElement();
        }
        $this->writer->fullEndElement();

// set categories
        $this->writer->startElement('categories');
        foreach ($headRequared['categories'] as $key => $value) {
            $this->writer->startElement('category');
            $this->writer->writeAttribute('id', $value['id']);
            if (!empty($value['parentId'])) {
                $this->writer->writeAttribute('parentId', $value['parentId']);
            }
            $newKey = FunctionsYmlOffer::prepareField($key);
            $this->writer->text($newKey);
            $this->writer->endElement();
        }
        $this->writer->fullEndElement();

// set delivery options
        if (!empty($headOptional['delivery-options'])) {
            $this->writer->startElement('delivery-options');
            foreach ($headOptional['delivery-options'] as $value) {
                $this->writer->startElement('option');
                $this->writer->writeAttribute('cost', $value['cost']);
                $this->writer->writeAttribute('days', $value['days']);
                if (isset($value['before'])) {
                    $this->writer->writeAttribute('order-before', $value['before']);
                }
                $this->writer->endElement();
            }
            $this->writer->fullEndElement();
        }

//set cpa
        if (isset($headOptional['cpa'])) {
            $this->writer->startElement('cpa');
            $this->writer->text($headOptional['cpa']);
            $this->writer->endElement();
        }

// set adult
        if (!empty($headOptional['adult'])) {
            $this->writer->startElement('adult');
            $this->writer->text($headOptional['adult']);
            $this->writer->endElement();
        }

        $this->writer->startElement('offers');
    }

    /**
     * generate footer for xml
     */
    private function addFooter() {
        $this->writer->fullEndElement();
        $this->writer->fullEndElement();
        $this->writer->fullEndElement();
        $this->writer->endDocument();
        return $this->writer->outputMemory();
    }

    /**
     * generate offers for xml
     *
     * @param array $offers
     */
    private function addOffers($offers) {
        foreach ($offers as $offer) {
            $this->addOffer($offer);
        }
    }

    /**
     * generate one offer for xml
     *
     * @param array $offer
     */
    private function addOffer($offer) {
        $this->writer->startElement('offer');
        $this->writer->writeAttribute('id', $offer['requared']['id']);
        unset($offer['requared']['id']);
        if (isset($offer['requared']['type'])) {
            $this->writer->writeAttribute('type', $offer['requared']['type']);
            unset($offer['requared']['type']);
        }
        if (!empty($offer['optional']['bid'])) {
            $this->writer->writeAttribute('bid', $offer['optional']['bid']);
            unset($offer['optional']['bid']);
        }
        if (!empty($offer['optional']['cbid'])) {
            $this->writer->writeAttribute('cbid', $offer['optional']['cbid']);
            unset($offer['optional']['cbid']);
        }
        if (!empty($offer['optional']['fee'])) {
            $this->writer->writeAttribute('fee', $offer['optional']['fee']);
            unset($offer['optional']['fee']);
        }
        if (!empty($offer['optional']['available'])) {
            $this->writer->writeAttribute('available', $offer['optional']['available']);
            unset($offer['optional']['available']);
        }

        foreach ($offer['requared'] as $tag => $value) {
            if ($tag != 'picture') {
                $this->writer->startElement($tag);
                $this->writer->text($value);
                $this->writer->endElement();
            } else {
                foreach ($value as $url) {
                    $this->writer->startElement('picture');
                    $this->writer->text($url);
                    $this->writer->endElement();
                }
            }
        }
        foreach ($offer['optional'] as $tag => $value) {
            if (!is_array($value) && $value != '') {
                $this->writer->startElement($tag);
                $text = FunctionsYmlOffer::prepareField($value);
                $this->writer->text($text);
                $this->writer->fullEndElement();
                if ($tag == 'delivery' && $value != 'false') {
                    $this->writer->startElement('delivery-options');
                    foreach ($offer['optional']['delivery-options'] as $option) {
                        $this->writer->startElement('option');
                        $this->writer->writeAttribute('cost', $option['cost']);
                        $this->writer->writeAttribute('days', $option['days']);
                        if (!empty($option['before'])) {
                            $this->writer->writeAttribute('before', $option['before']);
                        }
                        $this->writer->endElement();
                    }
                    $this->writer->fullEndElement();
                    unset($offer['optional']['delivery-options']);
                }
            }
        }

        if (!empty($offer['optional']['outlets'])) {
            $this->writer->startElement('outlets');
            foreach ($offer['optional']['outlets'] as $outlet) {
                $this->writer->startElement('outlet');
                $this->writer->writeAttribute('id', $outlet['id']);
                if (!empty($outlet['instock'])) {
                    $this->writer->writeAttribute('instock', $outlet['instock']);
                }
                if (!empty($outlet['booking'])) {
                    $this->writer->writeAttribute('booking', $outlet['booking']);
                }
                $this->writer->endElement();
            }
            $this->writer->fullEndElement();
        }

        if (!empty($offer['optional']['barcode'])) {
            foreach ($offer['optional']['barcode'] as $code) {
                $this->writer->startElement('barcode');
                $this->writer->text($code);
                $this->writer->endElement();
            }
        }

        if (!empty($offer['optional']['param'])) {
            foreach ($offer['optional']['param'] as $param) {
                $this->writer->startElement('param');
                $this->writer->writeAttribute('name', $param['name']);
                if (!empty($param['unit'])) {
                    $this->writer->writeAttribute('unit', $param['unit']);
                }
                $this->writer->text($param['title']);
                $this->writer->endElement();
            }
        }

        $this->writer->fullEndElement();
    }

}


text:
package com.intellij.lang.jsgraphql.types.execution;

import com.intellij.lang.jsgraphql.types.*;
import com.intellij.lang.jsgraphql.types.language.SourceLocation;

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

import static com.intellij.lang.jsgraphql.types.Assert.assertNotNull;
import static java.util.Collections.emptyList;

/**
 * This Exception indicates that the current execution should be aborted.
 */
@PublicApi
public class AbortExecutionException extends GraphQLException implements GraphQLError {

    private final List<GraphQLError> underlyingErrors;

    public AbortExecutionException() {
        this.underlyingErrors = emptyList();
    }

    public AbortExecutionException(Collection<GraphQLError> underlyingErrors) {
        this.underlyingErrors = new ArrayList<>(assertNotNull(underlyingErrors));
    }

    public AbortExecutionException(String message) {
        super(message);
        this.underlyingErrors = emptyList();
    }

    public AbortExecutionException(String message, Throwable cause) {
        super(message, cause);
        this.underlyingErrors = emptyList();
    }

    public AbortExecutionException(Throwable cause) {
        super(cause);
        this.underlyingErrors = emptyList();
    }

    @Override
    public List<SourceLocation> getLocations() {
        return null;
    }

    @Override
    public ErrorType getErrorType() {
        return ErrorType.ExecutionAborted;
    }

    /**
     * @return a list of underlying errors, which may be empty
     */
    public List<GraphQLError> getUnderlyingErrors() {
        return underlyingErrors;
    }

    /**
     * This is useful for turning this abort signal into an execution result which
     * is an error state with the underlying errors in it.
     *
     * @return an execution result with the errors from this exception
     */
    public ExecutionResult toExecutionResult() {
        if (!this.getUnderlyingErrors().isEmpty()) {
            return new ExecutionResultImpl(this.getUnderlyingErrors());
        }

        return new ExecutionResultImpl(this);
    }
}


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIASN1Tree.idl
 */

#ifndef __gen_nsIASN1Tree_h__
#define __gen_nsIASN1Tree_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nsITreeView_h__
#include "nsITreeView.h"
#endif

#ifndef __gen_nsIX509Cert_h__
#include "nsIX509Cert.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    nsIASN1Tree */
#define NS_IASN1TREE_IID_STR "de142307-7b88-4e0a-b232-250f310e25d8"

#define NS_IASN1TREE_IID \
  {0xde142307, 0x7b88, 0x4e0a, \
    { 0xb2, 0x32, 0x25, 0x0f, 0x31, 0x0e, 0x25, 0xd8 }}

class NS_NO_VTABLE nsIASN1Tree : public nsITreeView {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IASN1TREE_IID)

  /* void loadASN1Structure (in nsIASN1Object asn1Object); */
  NS_IMETHOD LoadASN1Structure(nsIASN1Object *asn1Object) = 0;

  /* AString getDisplayData (in unsigned long index); */
  NS_IMETHOD GetDisplayData(uint32_t index, nsAString & _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIASN1Tree, NS_IASN1TREE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIASN1TREE \
  NS_IMETHOD LoadASN1Structure(nsIASN1Object *asn1Object) override; \
  NS_IMETHOD GetDisplayData(uint32_t index, nsAString & _retval) override;

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIASN1TREE(_to) \
  NS_IMETHOD LoadASN1Structure(nsIASN1Object *asn1Object) override { return _to LoadASN1Structure(asn1Object); } \
  NS_IMETHOD GetDisplayData(uint32_t index, nsAString & _retval) override { return _to GetDisplayData(index, _retval); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIASN1TREE(_to) \
  NS_IMETHOD LoadASN1Structure(nsIASN1Object *asn1Object) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LoadASN1Structure(asn1Object); } \
  NS_IMETHOD GetDisplayData(uint32_t index, nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDisplayData(index, _retval); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsASN1Tree : public nsIASN1Tree
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIASN1TREE

  nsASN1Tree();

private:
  ~nsASN1Tree();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsASN1Tree, nsIASN1Tree)

nsASN1Tree::nsASN1Tree()
{
  /* member initializers and constructor code */
}

nsASN1Tree::~nsASN1Tree()
{
  /* destructor code */
}

/* void loadASN1Structure (in nsIASN1Object asn1Object); */
NS_IMETHODIMP nsASN1Tree::LoadASN1Structure(nsIASN1Object *asn1Object)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getDisplayData (in unsigned long index); */
NS_IMETHODIMP nsASN1Tree::GetDisplayData(uint32_t index, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#define NS_ASN1TREE_CONTRACTID "@mozilla.org/security/nsASN1Tree;1"

#endif /* __gen_nsIASN1Tree_h__ */


text:
import WalletInterface from '@/modules/access-wallet/common/WalletInterface';

class HybridWalletInterface extends WalletInterface {
  constructor(
    pubkey,
    isHardware,
    identifier,
    txSigner,
    msgSigner,
    connection,
    errorHandler,
    meta
  ) {
    super(pubkey, true, identifier);
    this.errorHandler = errorHandler;
    this.txSigner = txSigner;
    this.msgSigner = msgSigner;
    this.isHardware = isHardware;
    this.connection = connection;
    this.meta = meta;
  }
  getConnection() {
    return this.connection;
  }
  signTransaction(txParams) {
    return super.signTransaction(txParams, this.txSigner);
  }
  signMessage(msg) {
    return super.signMessage(msg, this.msgSigner);
  }
}
export default HybridWalletInterface;


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace NavigationBundle\NavElements;

use app\view\TemplatePart;

/**
 * Description of CommandElement
 *
 * @author Draeius
 */
class CommandElement extends NavElement {

    private $params;

    public function __construct($title, $target, $params, $order = 100) {
        parent::__construct($title, $target, $order);
        $this->params = $params;
    }

    public function printElement() {
        $view = new TemplatePart('navbar/nav');
        $view->assign('title', $this->getTitle());
        $view->assign('target', $this->getTarget());
        $view->assign('params', $this->params);
        return $view->loadTemplate();
    }

}


text:
describe("DateSelector", function() {
  var dateSelector;

  beforeEach(function() {
    dateSelector = new DateSelector("01/01/2013", "28/02/2013")
  });

  it("defaults to showing the whole range", function() {
    expect(dateSelector.currentRange()).toEqual("all");
  });

  it("allows changing ranges", function() {
    expect(dateSelector.inRange("all")).toEqual(true);
    expect(dateSelector.inRange("week")).toEqual(false);
    expect(dateSelector.currentRange()).toEqual("all");

    dateSelector.setRange("week");

    expect(dateSelector.inRange("all")).toEqual(false);
    expect(dateSelector.inRange("week")).toEqual(true);
    expect(dateSelector.currentRange()).toEqual("week");
  });
});


text:
using CppSharp;
using CppSharp.AST;
using CppSharp.Generators;

namespace Embeddinator.Generators
{
    public class ObjCSources : CSources
    {
        public ObjCSources(BindingContext context, TranslationUnit unit)
            : base(context, unit)
        {
        }

        public override string FileExtension => "mm";

        public override void Process()
        {
            base.Process();
        }

        public override void GenerateMethodSpecifier(Method method, Class @class)
        {
            this.GenerateObjCMethodSignature(method);
        }

        public override string GenerateClassObjectAlloc(Declaration decl)
        {
            return $"[[{decl.Visit(CTypePrinter)} alloc]init]";
        }

        public override bool VisitClassDecl(Class @class)
        {
            PushBlock();

            GenerateClassLookup(@class);

            WriteLine($"@implementation {@class.QualifiedName}");
            NewLine();

            VisitDeclContext(@class);

            NewLine();
            WriteLine("@end");

            PopBlock(NewLineKind.BeforeNextBlock);

            return true;
        }

        public override bool VisitFieldDecl(Field field)
        {
            return this.GenerateObjCField(field);
        }
    }
}


text:
package gov.hhs.onc.sdcct.web.form.receiver.testcases.ihe.ws.impl;

import gov.hhs.onc.sdcct.testcases.ihe.IheFormReceiverTestcase;
import gov.hhs.onc.sdcct.testcases.ihe.results.IheFormReceiverTestcaseResult;
import gov.hhs.onc.sdcct.testcases.ihe.results.IheTestcaseResultHandler;
import gov.hhs.onc.sdcct.testcases.ihe.submissions.IheFormReceiverTestcaseSubmission;
import gov.hhs.onc.sdcct.web.testcases.ihe.ws.impl.AbstractServerIheTestcaseOutCallback;
import org.apache.cxf.message.Message;

public class ServerIheFormReceiverTestcaseOutCallback
    extends AbstractServerIheTestcaseOutCallback<IheFormReceiverTestcase, IheFormReceiverTestcaseSubmission, IheFormReceiverTestcaseResult> {
    protected ServerIheFormReceiverTestcaseOutCallback(IheTestcaseResultHandler resultHandler, Message msg, Class<IheFormReceiverTestcaseResult> resultClass,
        String resultPropName) {
        super(resultHandler, msg, resultClass, resultPropName);
    }
}


text:
package com.adamkowalewski.opw.webservice.dto;

import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Adam Kowalewski
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class KomisjaDto implements Serializable {

    private String pkwId;
    private String name;
    private String address;
    private OkregowaDto okregowa;
    private List<KandydatDto> kandydatList;
    private List<WynikDto> wynikList;

    public KomisjaDto() {
    }

    public KomisjaDto(String pkwId, String name, String address, OkregowaDto okregowa, List<KandydatDto> kandydatList) {
        this.pkwId = pkwId;
        this.name = name;
        this.address = address;
        this.okregowa = okregowa;
        this.kandydatList = kandydatList;
    }

    public String getPkwId() {
        return pkwId;
    }

    public void setPkwId(String pkwId) {
        this.pkwId = pkwId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public OkregowaDto getOkregowa() {
        return okregowa;
    }

    public void setOkregowa(OkregowaDto okregowa) {
        this.okregowa = okregowa;
    }

    public List<KandydatDto> getKandydatList() {
        return kandydatList;
    }

    public void setKandydatList(List<KandydatDto> kandydatList) {
        this.kandydatList = kandydatList;
    }

    public List<WynikDto> getWynikList() {
        return wynikList;
    }

    public void setWynikList(List<WynikDto> wynikList) {
        this.wynikList = wynikList;
    }

}


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler

try:
    from ansible.modules.network.fortios import fortios_web_proxy_url_match
except ImportError:
    pytest.skip("Could not load required modules for testing", allow_module_level=True)

@pytest.fixture(autouse=True)
def connection_mock(mocker):
    connection_class_mock = mocker.patch('ansible.modules.network.fortios.fortios_web_proxy_url_match.Connection')
    return connection_class_mock

fos_instance = FortiOSHandler(connection_mock)

def test_web_proxy_url_match_creation(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'web_proxy_url_match': {
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    expected_data = {
        'cache-exemption': 'enable',
        'comment': 'Comment.',
        'forward-server': 'test_value_5',
        'name': 'default_name_6',
                'status': 'enable',
                'url-pattern': 'test_value_8'
    }

    set_method_mock.assert_called_with('web-proxy', 'url-match', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert changed
    assert response['status'] == 'success'
    assert response['http_status'] == 200

def test_web_proxy_url_match_creation_fails(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'web_proxy_url_match': {
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    expected_data = {
        'cache-exemption': 'enable',
        'comment': 'Comment.',
        'forward-server': 'test_value_5',
        'name': 'default_name_6',
                'status': 'enable',
                'url-pattern': 'test_value_8'
    }

    set_method_mock.assert_called_with('web-proxy', 'url-match', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert is_error
    assert not changed
    assert response['status'] == 'error'
    assert response['http_status'] == 500

def test_web_proxy_url_match_removal(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    delete_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
    delete_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.delete', return_value=delete_method_result)

    input_data = {
        'username': 'admin',
        'state': 'absent',
        'web_proxy_url_match': {
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    delete_method_mock.assert_called_with('web-proxy', 'url-match', mkey=ANY, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert changed
    assert response['status'] == 'success'
    assert response['http_status'] == 200

def test_web_proxy_url_match_deletion_fails(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    delete_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
    delete_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.delete', return_value=delete_method_result)

    input_data = {
        'username': 'admin',
        'state': 'absent',
        'web_proxy_url_match': {
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    delete_method_mock.assert_called_with('web-proxy', 'url-match', mkey=ANY, vdom='root')
    schema_method_mock.assert_not_called()
    assert is_error
    assert not changed
    assert response['status'] == 'error'
    assert response['http_status'] == 500

def test_web_proxy_url_match_idempotent(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'web_proxy_url_match': {
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    expected_data = {
        'cache-exemption': 'enable',
        'comment': 'Comment.',
        'forward-server': 'test_value_5',
        'name': 'default_name_6',
                'status': 'enable',
                'url-pattern': 'test_value_8'
    }

    set_method_mock.assert_called_with('web-proxy', 'url-match', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert not changed
    assert response['status'] == 'error'
    assert response['http_status'] == 404

def test_web_proxy_url_match_filter_foreign_attributes(mocker):
    schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')

    set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
    set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)

    input_data = {
        'username': 'admin',
        'state': 'present',
        'web_proxy_url_match': {
            'random_attribute_not_valid': 'tag',
            'cache_exemption': 'enable',
            'comment': 'Comment.',
            'forward_server': 'test_value_5',
            'name': 'default_name_6',
            'status': 'enable',
            'url_pattern': 'test_value_8'
        },
        'vdom': 'root'}

    is_error, changed, response = fortios_web_proxy_url_match.fortios_web_proxy(input_data, fos_instance)

    expected_data = {
        'cache-exemption': 'enable',
        'comment': 'Comment.',
        'forward-server': 'test_value_5',
        'name': 'default_name_6',
                'status': 'enable',
                'url-pattern': 'test_value_8'
    }

    set_method_mock.assert_called_with('web-proxy', 'url-match', data=expected_data, vdom='root')
    schema_method_mock.assert_not_called()
    assert not is_error
    assert changed
    assert response['status'] == 'success'
    assert response['http_status'] == 200


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.mir.tests;

import cz.muni.fi.mir.db.domain.Annotation;
import cz.muni.fi.mir.db.domain.ApplicationRun;
import cz.muni.fi.mir.db.domain.Configuration;
import cz.muni.fi.mir.db.domain.Formula;
import cz.muni.fi.mir.db.domain.Program;
import cz.muni.fi.mir.db.domain.Revision;
import cz.muni.fi.mir.db.domain.SourceDocument;
import cz.muni.fi.mir.db.domain.User;
import cz.muni.fi.mir.db.domain.UserRole;
import cz.muni.fi.mir.tools.EntityFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.joda.time.DateTime;

/**
 *
 * @author Empt
 */
public class DataTestTools
{

    /**
     * Method provides List of UserRoles with following values and order:
     *

     *
ROLE_ANONYMOUS

     *
ROLE_USER

     *
ROLE_ADMINISTRATOR

     *

     *
     * @return List of UserRoles
     */
    public static List<UserRole> provideUserRolesList()
    {
        List<UserRole> result = new ArrayList<>();
        result.add(EntityFactory.createUserRole("ROLE_ANONYMOUS"));
        result.add(EntityFactory.createUserRole("ROLE_USER"));
        result.add(EntityFactory.createUserRole("ROLE_ADMINISTRATOR"));

        return result;
    }

    /**
     * Method provides List of Users with following values and order
     *

     *

     * username
     * password
     * real name
     * email
     * roles
     *

     *

     * username1
     * password1
     * druhe viac aslovne cislo1
     * example@example.com
     * values from input parameter
     *

     *

     * username2
     * password2
     * druhe viac aslovne cislo2
     * example@example.com
     * values from input parameter
     *

     *

     * username3
     * password3
     * druhe viac aslovne cislo3
     * example@example.com
     * values from input parameter
     *

     *

     *
     * @param roles which will be set for all users
     * @return List of users
     */
    public static List<User> provideUserRoleListGeneral(List<UserRole> roles)
    {
        List<User> result = new ArrayList<>();
        result.add(EntityFactory.createUser("username1", "password1", "druhe viac aslovne cislo1", "example1@example.com", roles));
        result.add(EntityFactory.createUser("username2", "password2", "druhe viac aslovne cislo2", "example2@example.com", roles));
        result.add(EntityFactory.createUser("username3", "password3", "druhe viac aslovne cislo3", "example3@example.com", roles));

        return result;
    }

    /**
     * Method is same as {@link #provideUserRoleListGeneral(java.util.List) }
     * with following difference. Roles are set in this way:
     *

     *
real name	roles

     *
druhe viac aslovne cislo1	roles

     *
tretie aslovne cislo2	roles.subList(0, 2)

     *
druhe viac aslovne cislo3	roles.get(0)

     *

     *
     * @param roles to be set for users in specific way
     * @return List of users
     */
    public static List<User> provideUserRoleListSpecific(List<UserRole> roles)
    {
        List<User> result = new ArrayList<>();
        result.add(EntityFactory.createUser("username1", "password1", "druhe viac aslovne cislo1", "example1@example.com", roles));
        result.add(EntityFactory.createUser("username2", "password2", "tretie aslovne cislo2", "example2@example.com", roles.subList(0, 2)));
        result.add(EntityFactory.createUser("username3", "password3", "druhe viac aslovne cislo3", "example3@example.com", roles.get(0)));

        return result;
    }

    /**
     * Method provides List of annotation with following values and order:
     *

     *

     * note
     * user
     * flag
     *

     *

     * poznamka
     * user at index 0
     * flag at index 0
     *

     *

     * poznamkaaa
     * user at index 0
     * flag at index 1
     *

     *

     * poznamka12313
     * user at index 0
     * flag at index 1
     *

     *

     * aha2313
     * user at index 1
     * flag at index 1
     *

     *

     * pozyuyiua12313
     * user at index 1
     * flag at index 1
     *

     *

     *
     * @param users from which values will be selected
     * @param aFlags from which values will be selected
     * @return List of Annotations
     */
    public static List<Annotation> provideAnnotationList(List<User> users)
    {
        List<Annotation> result = new ArrayList<>();

        result.add(EntityFactory.createAnnotation("poznamka", users.get(0)));
        result.add(EntityFactory.createAnnotation("poznamkaaa", users.get(0)));
        result.add(EntityFactory.createAnnotation("poznamka12313", users.get(0)));
        result.add(EntityFactory.createAnnotation("aha2313", users.get(1)));
        result.add(EntityFactory.createAnnotation("pozyuyiua12313", users.get(1)));

        return result;
    }

    /**
     * Method provides List of Configurations where config triplet is how
     * {@link TestTools#getConfig(boolean, boolean, boolean) }is called.
     *

     *

     * config
     * name
     * note
     *

     *

     * (true, true, true)
     * vsetko true
     * vsetky hodnoty su true lebo kacka
     *

     *

     * (true, true, false)
     * priemerny config 2:1
     * vsetky hodnoty su true lebo medved
     *

     *

     * (false, false, false)
     * vsetko false
     * vsetky podnoty su true lebo holub
     *

     *

     *
     * @return List of Configurations with values specified by table above
     */
    public static List<Configuration> provideConfigurationList()
    {
        List<Configuration> result = new ArrayList<>();

        result.add(EntityFactory.createConfiguration(getConfig(true, true, true), "vsetko true", "vsetky hodnoty su true lebo kacka"));
        result.add(EntityFactory.createConfiguration(getConfig(true, true, false), "priemerny config 2:1", "vsetky hodnoty su true lebo medved"));
        result.add(EntityFactory.createConfiguration(getConfig(false, false, false), "vsetko false", "vsetky podnoty su true lebo holub"));

        return result;
    }

    /**
     * Method provides List of SourceDocuments with given values and order:
     *

     *
note	path

     *
poznamka testovacia cislo
     * 1	/home/empt/input/test1.xhtml

     *
poznamka testovacia cislo
     * 2	/home/empt/input/data/test2.xhtml

     *
poznamka testovacia cislo
     * 3	/home/empt/input/fata/test3.xhtml

     *
poznamka testovacia cislo
     * 4	/home/empt/input/data/test4.xhtml

     *

     *
     * @return List of source documents with values specified by table above
     */
    public static List<SourceDocument> provideSourceDocuments()
    {
        List<SourceDocument> result = new ArrayList<>();

        result.add(EntityFactory.createSourceDocument("poznamka testovacia cislo 1"));
        result.add(EntityFactory.createSourceDocument("poznamka testovacia cislo 2"));
        result.add(EntityFactory.createSourceDocument("poznamka testovacia cislo 3"));
        result.add(EntityFactory.createSourceDocument("poznamka testovacia cislo 4"));

        return result;
    }

    /**
     * Method provides List of formulas with following order and values:
     *
     * @param users
     * @param sourceDocuments
     * @return
     */
    public static List<Formula> provideFormulas(List<User> users, List<SourceDocument> sourceDocuments)
    {
        List<Formula> result = new ArrayList<>();

        result.add(EntityFactory.createFormula(getFirstXML(), DateTime.now(), users.get(0), sourceDocuments.get(0)));
        result.add(EntityFactory.createFormula(getFirstXML(), DateTime.now(), users.get(1), sourceDocuments.get(1)));
        result.add(EntityFactory.createFormula(getSecondXML(), DateTime.now(), users.get(0), sourceDocuments.get(0)));
        result.add(EntityFactory.createFormula(getSecondXML(), DateTime.now(), users.get(1), sourceDocuments.get(1)));

        return result;
    }

    /**
     * Method provides List of Revision with following order and values:
     *

     *
hash	note

     *
f383d4a196c27992bf9bcb903919cf354024554a	nahodna poznamka
     * aby sa nieco naslo

     *
f383d4a196c27992bf9bcb903919cf354024554b	nahodna poznamka
     * aby sa nieco naslo

     *
f383d4a196c27992bf9bcb903919cf354024554c	nahodna poznamka
     * aby sa nieco naslo

     *
f383d4a196c27992bf9bcb903919cf354024554d	toto sa
     * nenajde

     *

     *
     * @return List of revision with values specified by table above.
     */
    public static List<Revision> provideRevisions()
    {
        List<Revision> result = new ArrayList<>();

        result.add(EntityFactory.createRevision("f383d4a196c27992bf9bcb903919cf354024554a", "nahodna poznamka aby sa nieco naslo"));
        result.add(EntityFactory.createRevision("f383d4a196c27992bf9bcb903919cf354024554b", "nahodna poznamka aby si nieco naslo"));
        result.add(EntityFactory.createRevision("f383d4a196c27992bf9bcb903919cf354024554c", "nahodna poznamka aby so nieco naslo"));
        result.add(EntityFactory.createRevision("f383d4a196c27992bf9bcb903919cf354024554d", "toto sa nenajde"));

        return result;
    }

    /**
     * Method create List of programs with given values and order:
     *
     *

     *
name	linux verzia	-d -s
     * -p	version

     *
texlive	linux verzia	-d
     * -s	2013.2

     *
texlive	linux verzia	-d
     * -p	2013.2

     *
texlive	linux verzia	-a
     * -q	2013.3

     *
miktex	windows verzia	-a
     * -q	2011.4

     *
miktex	linux verzia	-a
     * -q	2014.1beta.0.0.3

     *

     *
     * @return
     */
    public static List<Program> providePrograms()
    {
        List<Program> result = new ArrayList<>();

        result.add(EntityFactory.createProgram("texlive", "linux verzia", "-d -s -p", "2013.2"));
        result.add(EntityFactory.createProgram("texlive", "linux verzia", "-d -s", "2013.2"));
        result.add(EntityFactory.createProgram("texlive", "linux verzia", "-d -p", "2013.3"));
        result.add(EntityFactory.createProgram("miktex", "windows verzia", "-a -q", "2011.4"));
        result.add(EntityFactory.createProgram("miktex", "linux verzia", "-a -q", "2014.1beta.0.0.3"));

        return result;
    }

    /**
     * TODO DOCU
     *
     * @param users
     * @param revs
     * @param configs
     * @return
     */
    public static List<ApplicationRun> provideApplicationRuns(List<User> users, List<Revision> revs, List<Configuration> configs)
    {
        List<ApplicationRun> result = new ArrayList<>();

        result.add(EntityFactory.createApplicationRun("poznamka 1", new DateTime(2013, 02, 02, 12, 13), new DateTime(2013, 02, 02, 12, 14), users.get(0), revs.get(0), configs.get(0)));
        result.add(EntityFactory.createApplicationRun("poznamka 2", new DateTime(2013, 02, 02, 13, 13), new DateTime(2013, 02, 02, 14, 14), users.get(0), revs.get(0), configs.get(0)));
        result.add(EntityFactory.createApplicationRun("poznamka 3", new DateTime(2013, 02, 02, 14, 13), new DateTime(2013, 02, 02, 14, 14), users.get(1), revs.get(1), configs.get(0)));
        result.add(EntityFactory.createApplicationRun("poznamka 4", new DateTime(2013, 02, 02, 15, 13), new DateTime(2013, 02, 02, 15, 14), users.get(1), revs.get(2), configs.get(1)));
        result.add(EntityFactory.createApplicationRun("poznamka 5", new DateTime(2013, 02, 02, 16, 13), new DateTime(2013, 02, 02, 16, 14), users.get(0), revs.get(1), configs.get(2)));

        return result;
    }

    /**
     * Method generates random date.
     *
     * @return random date
     */
    public static DateTime getRandomDate()
    {
        Random r = new Random(1355226236);

        long seed = r.nextLong();

        if(seed<0)
        {
            seed *= -1;
        }

        return new DateTime(seed);
    }

    public static String getFirstXML()
    {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                + "<math>\n"
                + "  <mfrac linethickness=\"1\">\n"
                + "    \n"
                + "    <mrow>\n"
                + "      <mi> x </mi>\n"
                + "      <mo> + </mo>\n"
                + "      <mi> y </mi>\n"
                + "      <mo> + </mo>\n"
                + "      <mi> z </mi>\n"
                + "    </mrow>\n"
                + "    \n"
                + "    <mrow>\n"
                + "      <mi> x </mi>\n"
                + "      \n"
                + "      <mo> + </mo>\n"
                + "      <mi> z </mi>\n"
                + "    </mrow>\n"
                + "  </mfrac>\n"
                + "  <mfenced>\n"
                + "  </mfenced>\n"
                + "</math>";
    }

    public static String getSecondXML()
    {
        return "<math mathvariant='italic'>\n"
                + "    <mrow>\n"
                + "        <mmultiscripts>\n"
                + "            <mtext>R</mtext>\n"
                + "            <mtext>i</mtext>\n"
                + "            <none></none>\n"
                + "            <none></none>\n"
                + "            <mtext>j</mtext>\n"
                + "            <mtext>kl</mtext>\n"
                + "            <none></none>\n"
                + "        </mmultiscripts>\n"
                + "        <mo>=</mo>\n"
                + "        <msup>\n"
                + "            <mtext>g</mtext>\n"
                + "            <mtext>jm</mtext>\n"
                + "        </msup>\n"
                + "        <msub>\n"
                + "            <mtext>R</mtext>\n"
                + "            <mtext>imkl</mtext>\n"
                + "        </msub>\n"
                + "        <mo>+</mo>\n"
                + "        <msqrt>\n"
                + "            <mn>1</mn>\n"
                + "            <mo>-</mo>\n"
                + "            <msup>\n"
                + "                <mtext>g</mtext>\n"
                + "                <mtext>jm</mtext>\n"
                + "            </msup>\n"
                + "            <msub>\n"
                + "                <mtext>R</mtext>\n"
                + "                <mtext>mikl</mtext>\n"
                + "            </msub>\n"
                + "        </msqrt>\n"
                + "    </mrow>\n"
                + "</math>";
    }

    public static String getConfig(boolean omit, boolean allow, boolean indent)
    {
        StringBuilder sb = new StringBuilder("<toor>");

        sb.append("\t<omit>").append(omit).append("</omit>");
        sb.append("\t<allow>").append(allow).append("</allow>");
        sb.append("\t<indent>").append(indent).append("</indent>");

        sb.append("</toor>");

        return sb.toString();
    }
}


text:
This has definitions to allow outputing the `Configuration` and `Pipeline` graphs
as an object (instead of serializing them to text)

##### Pipeline Graph

This configures the emitter that will emit the pipeline graph itself.
Used by the autorest-interactive tool to show what the pipeline graph looks like.

``` yaml
pipeline:
  pipeline-emitter: # emits the pipeline graph
    scope: scope-pipeline-emitter

scope-pipeline-emitter:
  input-artifact: pipeline
  is-object: true
  output-uri-expr: |
    "pipeline"
```

##### Configuration Graph

This configures the emitter that will emit the configuration graph itself.
It allows the configuration graph itself to be retrieved.

``` yaml
pipeline:
  configuration-emitter: # emits the configuration graph
    scope: scope-configuration-emitter

scope-configuration-emitter:
  input-artifact: configuration
  is-object: true
  output-uri-expr: |
    "configuration"
```


text:
<?php

namespace UniHalle\RentBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class ConfigurationType extends AbstractType
{
    private $translator;
    private $inputType;

    public function __construct($translator, $inputType = null)
    {
        $this->translator = $translator;
        $this->inputType = $inputType;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'name',
            null,
            array(
                'label'     => $this->translator->trans('Name'),
                'read_only' => true
            )
        );

        $builder->add(
            'value',
            $this->inputType,
            array(
                'label' => $this->translator->trans('Wert'),
                'attr'  => array(
                    'class' => 'input-xlarge',
                    'rows'  => '10'
                )
            )
        );
    }

    public function getName()
    {
        return 'configuration';
    }
}


text:
"""General data import tasks.
"""
import csv
import os
from glob import glob

from bs4 import BeautifulSoup

from astrocats.catalog.utils import pbar, pbar_strings
from decimal import Decimal

from ..supernova import SUPERNOVA

def do_cccp(catalog):
    task_str = catalog.get_current_task_str()
    cccpbands = ['B', 'V', 'R', 'I']
    file_names = list(
        glob(os.path.join(catalog.get_current_task_repo(),
                          'CCCP/apj407397*.txt')))
    for datafile in pbar_strings(file_names, task_str + ': apj407397...'):
        with open(datafile, 'r') as ff:
            tsvin = csv.reader(ff, delimiter='\t', skipinitialspace=True)
            for rr, row in enumerate(tsvin):
                if rr == 0:
                    continue
                elif rr == 1:
                    name = 'SN' + row[0].split('SN ')[-1]
                    name = catalog.add_entry(name)
                    source = catalog.entries[name].add_source(
                        bibcode='2012ApJ...744...10K')
                    catalog.entries[name].add_quantity(
                        SUPERNOVA.ALIAS, name, source)
                elif rr >= 5:
                    mjd = str(Decimal(row[0]) + 53000)
                    for bb, band in enumerate(cccpbands):
                        if row[2 * bb + 1]:
                            mag = row[2 * bb + 1].strip('>')
                            upl = (not row[2 * bb + 2])
                            (catalog.entries[name]
                             .add_photometry(time=mjd, u_time='MJD', band=band,
                                             magnitude=mag,
                                             e_magnitude=row[2 * bb + 2],
                                             upperlimit=upl, source=source))

    html = catalog.load_url(
        'https://webhome.weizmann.ac.il/home/iair/sc_cccp.html',
        os.path.join(catalog.get_current_task_repo(),
                     'CCCP/sc_cccp.html'))

    soup = BeautifulSoup(html, 'html5lib')
    links = soup.body.findAll("a")
    for link in pbar(links, task_str + ': links'):
        if 'sc_sn' in link['href']:
            name = catalog.add_entry(link.text.replace(' ', ''))
            source = (catalog.entries[name]
                      .add_source(name='CCCP',
                                  url=('https://webhome.weizmann.ac.il'
                                       '/home/iair/sc_cccp.html')))
            catalog.entries[name].add_quantity(SUPERNOVA.ALIAS, name, source)

            html2 = catalog.load_url(
                'https://webhome.weizmann.ac.il/home/iair/' + link['href'],
                os.path.join(catalog.get_current_task_repo(),
                             'CCCP/') + link['href'].split('/')[-1])

            soup2 = BeautifulSoup(html2, 'html5lib')
            links2 = soup2.body.findAll("a")
            for link2 in links2:
                if '.txt' in link2['href'] and '_' in link2['href']:
                    band = link2['href'].split('_')[1].split('.')[0].upper()

                    # Many 404s in photometry, set cache_only = True unless
                    # attempting complete rebuild.
                    html3 = catalog.load_url(
                        'https://webhome.weizmann.ac.il/home/iair/cccp/' +
                        link2['href'],
                        os.path.join(catalog.get_current_task_repo(),
                                     'CCCP/') + link2['href'].split('/')[-1],
                        cache_only=True)

                    if html3 is None:
                        continue

                    table = [[str(Decimal(yy.strip())).rstrip('0') for yy in
                              xx.split(',')]
                             for xx in list(filter(None, html3.split('\n')))]
                    for row in table:
                        catalog.entries[name].add_photometry(
                            time=str(Decimal(row[0]) + 53000),
                            u_time='MJD', band=band, magnitude=row[1],
                            e_magnitude=row[2], source=source)

    catalog.journal_entries()
    return


text:
"""
    flask.ext.security.script
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Flask-Security script module

    :copyright: (c) 2012 by Matt Wright.
    :license: MIT, see LICENSE for more details.
"""
try:
    import simplejson as json
except ImportError:
    import json

import re

from flask import current_app
from flask.ext.script import Command, Option
from werkzeug.local import LocalProxy

from .utils import encrypt_password

_datastore = LocalProxy(lambda: current_app.extensions['security'].datastore)

def pprint(obj):
    print json.dumps(obj, sort_keys=True, indent=4)

def commit(fn):
    def wrapper(*args, **kwargs):
        fn(*args, **kwargs)
        _datastore.commit()
    return wrapper

class CreateUserCommand(Command):
    """Create a user"""

    option_list = (
        Option('-e', '--email',    dest='email',    default=None),
        Option('-p', '--password', dest='password', default=None),
        Option('-a', '--active',   dest='active',   default=''),
    )

    @commit
    def run(self, **kwargs):
        # sanitize active input
        ai = re.sub(r'\s', '', str(kwargs['active']))
        kwargs['active'] = ai.lower() in ['', 'y', 'yes', '1', 'active']

        from flask_security.forms import ConfirmRegisterForm
        from werkzeug.datastructures import MultiDict

        form = ConfirmRegisterForm(MultiDict(kwargs), csrf_enabled=False)

        if form.validate():
            kwargs['password'] = encrypt_password(kwargs['password'])
            _datastore.create_user(**kwargs)
            print 'User created successfully.'
            kwargs['password'] = '****'
            pprint(kwargs)
        else:
            print 'Error creating user'
            pprint(form.errors)

class CreateRoleCommand(Command):
    """Create a role"""

    option_list = (
        Option('-n', '--name', dest='name', default=None),
        Option('-d', '--desc', dest='description', default=None),
    )

    @commit
    def run(self, **kwargs):
        _datastore.create_role(**kwargs)
        print 'Role "%(name)s" created successfully.' % kwargs

class _RoleCommand(Command):
    option_list = (
        Option('-u', '--user', dest='user_identifier'),
        Option('-r', '--role', dest='role_name'),
    )

class AddRoleCommand(_RoleCommand):
    """Add a role to a user"""

    @commit
    def run(self, user_identifier, role_name):
        _datastore.add_role_to_user(user_identifier, role_name)
        print "Role '%s' added to user '%s' successfully" % (role_name, user_identifier)

class RemoveRoleCommand(_RoleCommand):
    """Add a role to a user"""

    @commit
    def run(self, user_identifier, role_name):
        _datastore.remove_role_from_user(user_identifier, role_name)
        print "Role '%s' removed from user '%s' successfully" % (role_name, user_identifier)

class _ToggleActiveCommand(Command):
    option_list = (
        Option('-u', '--user', dest='user_identifier'),
    )

class DeactivateUserCommand(_ToggleActiveCommand):
    """Deactive a user"""

    @commit
    def run(self, user_identifier):
        _datastore.deactivate_user(user_identifier)
        print "User '%s' has been deactivated" % user_identifier

class ActivateUserCommand(_ToggleActiveCommand):
    """Deactive a user"""

    @commit
    def run(self, user_identifier):
        _datastore.activate_user(user_identifier)
        print "User '%s' has been activated" % user_identifier


text:
<?php echo $row->name;?>

    <?php if(!empty($row->facilitator)):?>
        <select>
            <?php foreach ($row->facilitator as $value): ?>
                <option><?php echo $value->fullname; ?></option>
            <?php endforeach; ?>
        </select>
    <?php else: ?>

    <?php endif; ?>

    <?php if(!empty($row->groups)): ?>
        <select>
            <?php foreach ($row->groups as $value): ?>
                <option><?php echo $value->name; ?></option>
            <?php endforeach; ?>
        </select>
    <?php else: ?>

    <?php endif; ?>

<?php echo isset($row->commence) ? gmdate("Y-m-d H:i", $row->commence): '';?>
<?php echo isset($row->expire) ? gmdate("Y-m-d H:i", $row->expire): '';?>

    <button class="edit-row-btn edit_btn" data-url="<?php echo "admin/snapshots/sessions/{$snapshot->id}/edit/{$row->id}"; ?>">Edit</button>
    <?php echo form_open("admin/snapshots/sessions/delete/{$row->id}/{$snapshot->id}", array('class' => 'delete-row-form', 'data-confirm' => "Are you sure you would like to remove this client application? All data relative to this client application will be deleted permanently.\n", 'data-re-confirm' => "Are you absolutely sure you would like to remove this client application?\n")); ?>
    <button class="delete-row-btn delete_btn" type="submit" name="delete" value="TRUE">Delete</button>
    <?php echo form_close(); ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>project</artifactId>
        <groupId>se.hrmsoftware.guess</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>model</artifactId>
    <name>Casino Domain Model</name>
    <packaging>bundle</packaging>
</project>


text:
package com.dtolabs.rundeck.plugin.stub;

import com.dtolabs.rundeck.core.plugins.Plugin;
import com.dtolabs.rundeck.core.plugins.configuration.*;
import com.dtolabs.rundeck.core.resources.ResourceModelSource;
import com.dtolabs.rundeck.core.resources.ResourceModelSourceFactory;
import com.dtolabs.rundeck.plugins.ServiceNameConstants;
import com.dtolabs.rundeck.plugins.util.DescriptionBuilder;
import com.dtolabs.rundeck.plugins.util.PropertyBuilder;

import java.util.Properties;

/**
 * StubResourceModelSourceFactory is ...
 *
 * @author Greg Schueler greg@simplifyops.com
 * @since 2014-09-03
 */
@Plugin(name = StubResourceModelSourceFactory.SERVICE_PROVIDER_NAME, service = ServiceNameConstants.ResourceModelSource)
public class StubResourceModelSourceFactory implements ResourceModelSourceFactory, Describable{
    @Override
    public ResourceModelSource createResourceModelSource(Properties configuration) throws ConfigurationException {
        return new StubResourceModelSource(configuration);
    }

    static final Description DESC;

    public static final String SERVICE_PROVIDER_NAME = "stub";

    static {
        DescriptionBuilder builder = DescriptionBuilder.builder();
        builder.name(SERVICE_PROVIDER_NAME)
                .title("Stub")
                .description("Generates stub nodes with stub node executors, useful for testing")
        ;

        builder.property(PropertyUtil.string("prefix", "Prefix",
                "Name prefix for all nodes",
                true, "node"));
        builder.property(PropertyUtil.string("suffix", "Suffix",
                "Name suffix for all nodes",
                false, null));
        builder.property(PropertyUtil.integer("count", "Count",
                "Number of nodes",
                true, "1"));
        builder.property(PropertyUtil.string("tags", "Tags",
                "Comma separated tags to add to all nodes",
                false, "stub"));
        builder.property(PropertyUtil.string("attrs", "Attributes",
                "Comma separated key=val to add to all nodes",
                false, null));
        builder.property(PropertyUtil.string("delay", "Delay",
                "Seconds of delay to introduce, or range.\n\nCan be, e.g. `0-10` (random between 0 and 10 seconds)",
                false, "0"));

        builder.mapping("prefix", "plugin.ResourceModelSource.stub.prefix");
        builder.mapping("suffix", "plugin.ResourceModelSource.stub.suffix");
        builder.mapping("count", "plugin.ResourceModelSource.stub.count");
        builder.mapping("tags", "plugin.ResourceModelSource.stub.tags");
        builder.mapping("attrs", "plugin.ResourceModelSource.stub.attrs");
        builder.mapping("delay", "plugin.ResourceModelSource.stub.delay");

        DESC = builder.build();
    }

    public Description getDescription() {
        return DESC;
    }
}


text:
{% extends "/docs.md" %}
{% block content %}
# GET StopPoint/Search/{query}
Returns all train and bus stops matching the search query. The results are provided by [fuzzy](https://www.npmjs.com/package/fuzzy) returning matches based on the stop's name.

## Parameters
| Parameter         | Example value                   | Description |
| ----------------- | ------------------------------- | ----------- |
| **query** | `Schoenach` | Search query `string` to look for train and/or bus stops |

## Resource URL
    https://api.tfl.lu/v1/StopPoint/Search/{query}

## Format
The response will be formatted as a [GeoJSON](https://en.wikipedia.org/wiki/GeoJSON) [Feature Collection](http://geojson.org/geojson-spec.html#feature-collection-objects).

## Object properties
| Key          | Type      | Possible values | Description |
| ------------ | --------- | --------------- | ----------- |
| **id**       | `integer` | `{id}`          | id of bus and/or train stop |
| **name**     | `string`  | `{name}`        | name of bus and/or train stop (used for search) |

## Sample request & response
**GET** https://api.tfl.lu/v1/StopPoint/search/Schoenach
```json
{
	"type": "FeatureCollection",
	"features": [{
		"type": "Feature",
		"geometry": {
			"type": "Point",
			"coordinates": [6.057903, 49.622199]
		},
		"properties": {
			"id": 200901011,
			"name": "Strassen, Schoenacht"
		}
	}]
}
```

## License
Please refer to [StopPoint](/RESTAPIs/StopPoint.md#license) for information about the train and bus stop data licensing.
{% endblock %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2016 Chris Bellis
  ~ This software is subject to the MIT License, see LICENSE.txt in the root of the repository.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>docvis2</artifactId>
        <groupId>xyz.citegraph</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
    </dependencies>
    <artifactId>docvis-utils</artifactId>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>rice-kew</artifactId>
		<groupId>org.kuali.rice</groupId>
		<version>2.0.0-m9-SNAPSHOT</version>
	</parent>
	<artifactId>rice-kew-api</artifactId>
	<version>2.0.0-m9-SNAPSHOT</version>
	<name>Rice KEW API</name>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>rice-core-api</artifactId>
			<version>${project.version}</version>
		</dependency>
    <dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>rice-ksb-api</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
		</dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>rice-core-api</artifactId>
      <type>test-jar</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-java2ws-plugin</artifactId>
				<executions>
					<execution>
						<id>workflowDocumentActionsService-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.action.WorkflowDocumentActionsService</className>
							<outputFile>${project.build.outputDirectory}/wsdl/WorkflowDocumentActionsService.wsdl</outputFile>
							<serviceName>WorkflowDocumentActionsService</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
            <id>workflowDocumentService-wsdl</id>
            <phase>${rice.java2ws.phase}</phase>
            <configuration>
              <className>org.kuali.rice.kew.api.document.WorkflowDocumentService</className>
              <outputFile>${project.build.outputDirectory}/wsdl/WorkflowDocumentService.wsdl</outputFile>
              <serviceName>WorkflowDocumentService</serviceName>
            </configuration>
            <goals>
              <goal>java2ws</goal>
            </goals>
          </execution>
					<execution>
						<id>documentTypeService-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.doctype.DocumentTypeService</className>
							<outputFile>${project.build.outputDirectory}/wsdl/DocumentTypeService.wsdl</outputFile>
							<serviceName>DocumentTypeService</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
					<execution>
						<id>noteService-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.note.NoteService</className>
							<outputFile>${project.build.outputDirectory}/wsdl/NoteService.wsdl</outputFile>
							<serviceName>NoteService</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
            <id>ruleService-wsdl</id>
            <phase>${rice.java2ws.phase}</phase>
            <configuration>
              <className>org.kuali.rice.kew.api.rule.RuleService</className>
              <outputFile>${project.build.outputDirectory}/wsdl/RuleService.wsdl</outputFile>
              <serviceName>RuleService</serviceName>
            </configuration>
            <goals>
              <goal>java2ws</goal>
            </goals>
          </execution>
          <execution>
            <id>kewTypeRepositoryService-wsdl</id>
            <phase>${rice.java2ws.phase}</phase>
            <configuration>
              <className>org.kuali.rice.kew.api.repository.type.KewTypeRepositoryService</className>
              <outputFile>${project.build.outputDirectory}/wsdl/KewTypeRepositoryService.wsdl</outputFile>
              <serviceName>KewTypeRepositoryService</serviceName>
            </configuration>
            <goals>
              <goal>java2ws</goal>
            </goals>
          </execution>
          <execution>
						<id>responsibilityChangeProcessor-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.Responsibility.ResponsibilityChangeProcessor</className>
							<outputFile>${project.build.outputDirectory}/wsdl/ResponsibilityChangeProcessor.wsdl</outputFile>
							<serviceName>ResponsibilityChangeProcessor</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
						<id>documentAttributeIndexingQueue-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue</className>
							<outputFile>${project.build.outputDirectory}/wsdl/DocumentAttributeIndexingQueue.wsdl</outputFile>
							<serviceName>DocumentAttributeIndexingQueue</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
						<id>documentProcessingQueue-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.document.DocumentProcessingQueue</className>
							<outputFile>${project.build.outputDirectory}/wsdl/DocumentProcessingQueue.wsdl</outputFile>
							<serviceName>DocumentProcessingQueue</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
						<id>groupMembershipChangeQueue-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.group.GroupMembershipChangeQueue</className>
							<outputFile>${project.build.outputDirectory}/wsdl/GroupMembershipChangeQueue.wsdl</outputFile>
							<serviceName>GroupMembershipChangeQueue</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
          <execution>
						<id>pepleFlowService-wsdl</id>
						<phase>${rice.java2ws.phase}</phase>
						<configuration>
							<className>org.kuali.rice.kew.api.peopleflow.PeopleFlowService</className>
							<outputFile>${project.build.outputDirectory}/wsdl/PeopleFlowService.wsdl</outputFile>
							<serviceName>PeopleFlowService</serviceName>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>


text:
package edu.uchicago.cs.encsel.ptnmining.rule

import edu.uchicago.cs.encsel.ptnmining._
import edu.uchicago.cs.encsel.ptnmining.parser.{TDouble, TInt, TWord}

/**
  * If the union size is too large, e.g., 90% of total size
  * Use Any to replace big Union
  */
object UseAnyRule {
  val threshold = 0.3
}

class UseAnyRule extends DataRewriteRule {

  override def condition(ptn: Pattern): Boolean =
    ptn.isInstanceOf[PUnion] && ptn.asInstanceOf[PUnion].content.length >= UseAnyRule.threshold * originData.length

  override protected def update(ptn: Pattern): Pattern = {
    val union = ptn.asInstanceOf[PUnion]
    toAny(union)
  }

  protected def toAny(ptn: Pattern): Pattern = {
    ptn match {
      case union: PUnion => PUnion.make(union.content.map(toAny))
      case seq: PSeq => PSeq.make(seq.content.map(toAny))
      case token: PToken => {
        token.token match {
          case word: TWord => new PWordAny
          case int: TInt => new PIntAny
          case double: TDouble => new PDoubleAny
          case _ => token
        }
      }
      case _ => ptn
    }
  }

  def fuzzyCompare(a: Pattern, b: Pattern): Boolean = {
    (a, b) match {
      case (at: PToken, bt: PToken) => {
        at.token.isData match {
          case true => at.token.getClass == bt.token.getClass
          case false => at.token.equals(bt.token)
        }
      }
      case (_, _) => {
        a.equals(b)
      }
    }
  }
}


text:
layout: page
title: Patton Family Reunion
date: 2016-05-24
author: Vincent Walter
tags: weekly links, java
status: published
summary: In gravida ex ut tortor.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 07/20/2018
  endDate: 07/21/2018
  ctyhocn: ATOOHHX
  groupCode: PFR
published: true
---
Quisque id iaculis ex, id interdum velit. Mauris consectetur ut nulla ut rhoncus. Praesent nec ligula sit amet purus convallis eleifend nec eu felis. Morbi arcu augue, malesuada vitae quam at, ornare interdum diam. Suspendisse elementum nisi non mollis luctus. Suspendisse fringilla mi iaculis nisi consequat iaculis. In fringilla enim nibh, ac eleifend felis feugiat vel. Fusce ut neque quis lectus rutrum semper id in augue. Fusce varius euismod condimentum. Aliquam porta sodales eros at ornare. Curabitur ultricies risus ligula, convallis lacinia turpis eleifend ut. Donec rhoncus id est quis imperdiet. Donec consequat a mauris et ultrices.

* Sed malesuada neque dignissim volutpat condimentum
* Quisque vitae risus sed libero cursus auctor
* In a diam quis mi sagittis scelerisque
* Ut finibus erat nec ultricies venenatis
* Quisque tempor ex ut ex bibendum, at ullamcorper nisl pretium.

Aliquam accumsan diam in lacinia tincidunt. Phasellus eleifend ligula justo, at tempor sem tincidunt sit amet. Curabitur mattis bibendum nulla, vitae interdum mi aliquet sit amet. Quisque ut placerat mauris. Maecenas nec blandit metus, vel ullamcorper arcu. Vestibulum vel tellus lacus. Maecenas ac consequat velit, at lacinia ipsum. Sed ultricies feugiat massa sed lacinia. In eu metus eu lacus aliquet mollis in eleifend nisl. Nullam eget tristique tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum facilisis tellus in iaculis viverra. Sed pellentesque neque eget lacinia convallis. Pellentesque in sapien et nisi pretium condimentum non hendrerit nunc. Maecenas ac enim at nulla luctus volutpat. Suspendisse fringilla sem est, sed vulputate tortor blandit non.


text:
(function () {
    var $timers = $('.timer');

    $timers.each(function () {
        var $timer = $(this),
            timeLimit = $timer.attr('data-time-limit'),
            $goButton = $timer.siblings('.go'),
            flipClock;

        flipClock = $timer.FlipClock({
            autoStart: false,
            countdown: true
        });

        flipClock.setTime(timeLimit);

        $goButton.on('click', function () {
            flipClock.setTime(timeLimit);
            flipClock.start();
        });
    });
}())


text:
Changes the GitHub Notification icon from blue to red when you have unread participating notifications.

## Usage

As a GitHub user I pay very close attention to the Participating notification, i.e. the notifications you get from participating on a thread or being directly mentioned by others (by handle or team). Unfortunately just by looking at the notification bell, there's no way to distinguish if the notifications are participating or generally unread. Since I don't follow generic Unread notifications as closely as I do the Participating ones, I decided to augment the UI to distinguish the two:

## Installation and configuration

1. [Visit the GitHub Red Alert Chrome Web Store listing](https://chrome.google.com/webstore/detail/github-red-alert/kmiekjkmkbhbnlempjkaombjjcfhdnfe) and click "Add".
2. When the extensions is installed visit the Extensions page at chrome://extensions
3. You'll be asked to visit GitHub (link in the popup) and generate a personal access token
4. With the token at hand, paste it into the popup box and click save

If you now visit GitHub your Notification bell should be red if you have unread Participating notifications.

## Developing locally

Building the project

1. run `npm install`
2. run `bower install`
3. run `grunt` (this might you to install ruby and sass:

Adding the dependency:

1. Clone down the repository
2. Open Tools -> Extensions
3. Check the "Developer Mode" option (if not already)
4. Select "Load unpacked extension"
5. Navigate to the project main folder and click select

## Special thank you

I've developed most of this extension by editing a very popular extension project called [github-mention-highlighter](https://github.com/benbalter/github-mention-highlighter) by GitHub user [benbalter](https://github.com/benbalter). Most of the code was re-used, including this very same README :smile:


text:
<?php

namespace WdgCafepress\Hydrator;

use \WdgCafepress\Mapper\Store as Mapper,
    \WdgCafepress\Element\Store as StoreElement;

class Store {

    public function hydrate(StoreElement $store, Mapper $mapper)
    {
        $store
            ->setId($mapper->getId())
            ->setStoreNo($mapper->getStoreNo())
            ->setMemberNo($mapper->getMemberNo())
            ->setName($mapper->getName())
            ->setIsPremiumStore($mapper->getIsPremiumStore())
            ->setIsSelfBuy($mapper->getIsSelfBuy())
            ->setHomePage($mapper->getHomePage())
            ->setDefaultProductImageId($mapper->getDefaultProductImageId())
            ->setDefaultProductMarkup($mapper->getDefaultProductMarkup())
            ->setLogoType($mapper->getLogoType())
            ->setLogoLink($mapper->getLogoLink())
            ->setLogoWrapText($mapper->getLogoWrapText())
            ->setDescription($mapper->getDescription())
            ->setTitle($mapper->getTitle())
            ->setKeywords($mapper->getKeywords())
            ->setMetaDescription($mapper->getMetaDescription())
            ->setIsPrivate($mapper->getIsPrivate())
            ->setDisplayBio($mapper->getDisplayBio())
            ->setLastUpdated($mapper->getLastUpdated())
            ->setHasOptedOutOfMarketplace($mapper->getHasOptedOutOfMarketplace())
            ->setDisabled($mapper->getDisabled())
            ->setPaidTill($mapper->getPaidTill())
            ->setUpgradeDate($mapper->getUpgradeDate())
            ->setHeadTag($mapper->getHeadTag())
            ->setBodyTag($mapper->getBodyTag())
            ->setHeader($mapper->getHeader())
            ->setFooter($mapper->getFooter())
            ->setShowFrontPageListing($mapper->getShowFrontPageListing())
            ->setShowSubscribeForm($mapper->getShowSubscribeForm())
            ->setExtraSideBarContent($mapper->getExtraSideBarContent())
            ->setShowSideBar($mapper->getShowSideBar())
            ->setShowNestedSections($mapper->getShowNestedSections())
            ->setFontFace($mapper->getFontFace())
            ->setTextColor($mapper->getTextColor())
            ->setLinkColor($mapper->getLinkColor())
            ->setActiveLinkColor($mapper->getActiveLinkColor())
            ->setVisitedLinkColor($mapper->getVisitedLinkColor())
            ->setBackgroundColor($mapper->getBackgroundColor())
            ->setCheckoutBgColor($mapper->getCheckoutBgColor())
            ->setAlertMessageColor($mapper->getAlertMessageColor())
            ->setHeadlineColor($mapper->getHeadlineColor())
            ->setThBgColor($mapper->getThBgColor())
            ->setThFgColor($mapper->getThFgColor())
            ->setTableFgColor($mapper->getTableFgColor())
            ->setTableBgColor($mapper->getTableBgColor())
            ->setTableFg2Color($mapper->getTableFg2Color())
            ->setTableBg2Color($mapper->getTableBg2Color())
            ->setImageBorderColor($mapper->getImageBorderColor())
            ->setImageBorderWidth($mapper->getImageBorderWidth())
            ->setSidebarTextColor($mapper->getSidebarTextColor())
            ->setSidebarBgColor($mapper->getSidebarBgColor())
            ->setProdImageColor($mapper->getProdImageColor())
            ->setDefaultSectionNo($mapper->getDefaultSectionNo())
            ->setBillingOption($mapper->getBillingOption())
            ->setStoreTypeNo($mapper->getStoreTypeNo())
            ->setFixedPricingCommissionPercentage($mapper->getFixedPricingCommissionPercentage());

        return $this;
    }

}


text:
<!doctype html>

		<meta charset="utf-8">

		<title>reveal.js - The HTML Presentation Framework</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/moon.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Concepts of Functional programming

                        Yannick Chartois / @ychartois

Bodil Stokke

                        What Every Hipster Should Know About Functional Programming

                        Vimeo / Parleys

My first question

						Now that we have lambdas in Java 8, can we use FP concepts?

Extended question

                        Is there an advantage to use these concepts in other language with First Class Function as Javascript

1. First Class Function

                        Definition

                        “A programming language is said to have first-class functions if it treats functions as first-class citizens”

1. First Class Function

Code:

Function< String, String > hello = (String s) -> "hello " + s;

Result:

hello ;
// BaseConcepts$$Lambda$1@a09ee92
// != BaseConcepts@30f39991

hello.apply("Erouan") ;
// hello Erouan

2. High order function

                        Definition

                        “It's a function that takes one or more function as parameters or that returns a function”

2. High order function

Code:

Function< String, String > twice( Function< String, String > f ) {
    return (String s) -> f.apply( f.apply(s) );
}

Resultat:

twice(hello).apply("Erouan");
// hello hello Erouan

2. High order function

Code:

hello = (s) -> return "Hello " + s

twice = (func, s) ->
    return func func s

Resultat:

twice(hello,"Erouan")
// hello hello Erouan

3. Currying

                        Definition

                        “Currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument”

3. Currying

Previous code:

twice = (func, s) ->
    return func func s

Currying code:

twice = ( func ) -> ( s ) ->
    return func func s

Result:

twice(hello)("Erouan")
// hello hello Erouan

4. Functor

                        Definition

                        “A functor is a collection of X that can apply a function f : X → Y over itself to create a collection of Y.”

4. Functor - Map

Code:

List< String > map( Function< String, String > f
                        , List< String > values ) {
    List< String > toReturn = new ArrayList< >();
    for( String current : values ) {
        toReturn.add( f.apply(current) );
    }
    return toReturn;
}

Result:

List< String > confs =
                 Arrays.asList( new String[]{"Corkdev", "devoxx", "javaone"} );

map( s -> s.toUpperCase(), confs );

// [CORKDEV, DEVOXX, JAVAONE]

With Java 8:

confs.stream().map( s -> s.toUpperCase() ).collect( Collectors.toList() )

With Coffescript:

["Corkdev", "devoxx", "javaone"].map (el) -> el.toUpperCase()

4. Functor - Filter

Code:

List< String > filter( Function< String, Boolean > f,
                                List< String > values ) {
    List< String > toReturn = new ArrayList< >();
    for( String current : values ) {
        if ( f.apply(current) )
            toReturn.add( current );
    }
    return toReturn;
}

Result:

List< String > confs =
              Arrays.asList( new String[]{"jug", "devoxx", "javaone"} );

filter(s -> s.contains("j"), confs) ;

// [jug, javaone]

With Java 8:

confs.stream().filter( s -> s.contains("j") ).collect(Collectors.toList())

With Coffescript:

["Corkdev", "devoxx", "javaone"].filter (el) -> el.indexOf('k') != -1

5. Reduce / fold

                        Definition

                        “Fold is a family of higher order functions that process a data structure in some order and build a return value”

5. Reduce / fold

Code:

String reduce( BinaryOperator< String > op , List< String > values ) {
    String toReturn = "";
    for( String current : values ) {
        toReturn = toReturn.isEmpty() ? current : op.apply(toReturn, current)
    }
return toReturn; }

Result:

List< String > confs = Arrays.asList( "Corkdev", "devoxx", "javaone" );
reduce( (s1, s2) -> s1 + ", " + S2, confs );
// Corkdev, devoxx, javaone

With Java 8:

confs.stream().reduce((s1, s2) -> s1 + ", " + s2 ).get() )

With Coffescript:

["Corkdev", "devoxx", "javaone"].reduce (e1, e2) -> e1 + ", " + e2

6. Combinator

                        Definition

                        “One definition of a combinator is a function with no free variables.”

6. Combinator - Null Combinator

Constat:

List< String > confs2 = Arrays.asList( new String[]
                        {"jug", "devoxx", "javaone", null} );

map( s -> s.toUpperCase(), confs2);
// Exception in thread "main" java.lang.NullPointerException

Code:

Function< String, String > nullCheck( Function< String, String > f ) {
    return (String s) -> s == null ? "null" : f.apply(s);
}

Result:

map( nullCheck(s -> s.toUpperCase()), confs2)
// [JUG, DEVOXX, JAVAONE, null]

7. Composition

                        Definition

                        “Combine several functions to create a new function”

7. Composition

Code:

Function< String, String > compose ( Function< String, String > f1,
                                        Function< String, String > f2  ) {
    return (String s) -> f1.apply( f2.apply(s) );
}

Result:

Function< String, String > up = (String s) -> s.toUpperCase();
Function< String, String > hello = (String s) -> "hello " + s;

up.apply( hello.apply("Erouan") );

compose( up, hello).apply("Erouan") ;
// HELLO EROUAN

With Java 8:

hello.andThen(up).apply("Erouan")
up.compose(hello).apply("Erouan")

7. Composition - Javascript

Code Coffee:

compose = (fs...) -> fs.reduce (f, g) -> (as...) -> f g as...

Code JS:

compose = function() {
    var fs;
    fs = 1 <= arguments.length ? slice.call(arguments, 0) : [];
    return fs.reduce(function(f, g) {
        return function() {
            var as;
            as = 1 <= arguments.length ? slice.call(arguments, 0) : [];
            return f(g.apply(null, as));
        };
    });
};

Result:

up = (s) -> s.toUpperCase()
hello = (s) -> "Hello " + s

compose(up, hello) "Pierre"
// HELLO PIERRE

Why??

names = ["Pierre", "John", "Colm", "Petra", "Lenka"]
up = (s) -> s.toUpperCase()
hello = (s) -> "Hello " + s

Because for me that:

names.filter( (el) -> el.indexOf('k') == -1 )
    .map( (el) -> compose(up, hello)(el) )
    .reduce( (e1, e2) -> e1 + ", " + e2 )

Is more readable than:

acc = ""
for name in names
    if name.indexOf('k') == -1
        if acc != ""
            acc += ", " + up hello name
        else
            acc += up hello name

END !

Sources: ProgFoncJava8

Twitter: @ychartois


text:
class DeviseCreateAdminUsers < ActiveRecord::Migration

end