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 dastamessageCreator;

import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import mzcr.cz.ns.dasta.ds4.ds_cistype.*;
import mzcr.cz.ns.dasta.ds4.ds_dasta.*;
import mzcr.cz.ns.dasta.ds4.ds_ip.*;
import mzcr.cz.ns.dasta.ds4.ds_ip.DgzType.Diag;
import mzcr.cz.ns.dasta.ds4.ds_type.*;

import javax.xml.bind.*;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
 *
 * @author User
 */
public class DastaMessageJava {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws JAXBException {

        /*
         * Vytvoreni fantory pro jednotlive balicky
         */
        mzcr.cz.ns.dasta.ds4.ds_dasta.ObjectFactory factoryDasta = new mzcr.cz.ns.dasta.ds4.ds_dasta.ObjectFactory();
        mzcr.cz.ns.dasta.ds4.ds_type.ObjectFactory factoryDsType = new mzcr.cz.ns.dasta.ds4.ds_type.ObjectFactory();
        mzcr.cz.ns.dasta.ds4.ds_ip.ObjectFactory factoryDsIp = new mzcr.cz.ns.dasta.ds4.ds_ip.ObjectFactory();

        /*Nacteni xml*/
        /*C:\\Documents and Settings\\Milan\\Dokumenty\\škola\\FBMI\\3rocnik\\17bieth\\Programs\\DastaMessageCreator\\message2.xml*/
        File fXmlFile;
        JAXBContext context = JAXBContext.newInstance(Dasta.class);
        Unmarshaller un = context.createUnmarshaller();
        Dasta dastaInput = factoryDasta.createDasta();
        JAXBElement<Dasta> message2 = null;
        try {
            fXmlFile = new File(".\\zprava2.xml");
            message2 = un.unmarshal(new StreamSource(fXmlFile), Dasta.class);
        } catch (Exception e) {
            e.printStackTrace();
        }

        /**
         * Zakladni hlavicka
         */
        Dasta dasta = factoryDasta.createDasta();
        String verzeDs = message2.getValue().getVerzeDs();
        //System.out.println("verzeDs-> " + verzeDs);
        dasta.setVerzeDs(verzeDs);

        String idSoubor = message2.getValue().getIdSoubor();
        //System.out.println("idSouboru-> " + idSoubor);
        dasta.setIdSoubor(idSoubor);

        String binPriloha = message2.getValue().getBinPriloha();
        //System.out.println("binPriloha-> " + binPriloha);
        dasta.setBinPriloha(binPriloha);

        String ur = message2.getValue().getUr();
        //System.out.println("ur-> " + ur);
        dasta.setUr(ur);

        String typOdesm = message2.getValue().getTypOdesm();
        //System.out.println("TypOdesm-> " + typOdesm);
        dasta.setTypOdesm(typOdesm);

        /**
         * Informace o programu, ktery generoval zpravu
         */
        ZdrojIsType zdrojIsType = factoryDasta.createZdrojIsType();

        String kodFirmy = message2.getValue().getZdrojIs().getKodFirmy();
        //System.out.println("kodFirmy-> " + kodFirmy);
        zdrojIsType.setKodFirmy(kodFirmy);

        String kodProg = message2.getValue().getZdrojIs().getKodProg();
        //System.out.println("kodProg-> " + kodProg);
        zdrojIsType.setKodProg(kodProg);

        String verzeProg = message2.getValue().getZdrojIs().getVerzeProg();
        //System.out.println("verzeProg-> " + verzeProg);
        zdrojIsType.setVerzeProg(verzeProg);

        /**
         * Poskytovatel dat
         */
        PmType pm = factoryDasta.createPmType();
        AsType as1 = factoryDasta.createAsType();

        String asTyp = message2.getValue().getPm().getAs().getTyp();
        //System.out.println("as1Typ-> " + asTyp);
        as1.setTyp(asTyp);

        String asVnitrni = message2.getValue().getPm().getAs().getVnitrni();
        //System.out.println("as1Vnitrni-> " + asVnitrni);
        as1.setVnitrni(asVnitrni);

        pm.setAs(as1);

        /**
         * Informace o garantovi dat
         */
        GarantDatType garantDat = factoryDsType.createGarantDatType();

        String gID = message2.getValue().getGarantDat().getIdGarant();
        //System.out.println("Garanta Id-> " + gID);
        garantDat.setIdGarant(gID);

        String gOdbor = message2.getValue().getGarantDat().getOdbornost();
        //System.out.println("Garant Odbornost-> " + gOdbor);
        garantDat.setOdbornost(gOdbor);

        String gValue = message2.getValue().getGarantDat().getValue();
        //System.out.println("Garant Value-> " + gValue);
        garantDat.setValue(gValue);

        /**
         * Informace o zdravotnickem zarizeni
         */
        IsType is = factoryDasta.createIsType();
        int vemPrvni = 0;//message2.getValue().getIs().size();

        IsType isGET = message2.getValue().getIs().get(vemPrvni);

        String IsTypIco = isGET.getIco();
        //System.out.println("IsTypIco-> " + IsTypIco);
        is.setIco(IsTypIco);

        String IsTypIcz = isGET.getIcz();
        //System.out.println("IsTypIcz-> " + IsTypIcz);
        is.setIcz(IsTypIcz);

        String IsTypIcp = isGET.getIcp();
        //System.out.println("IsTypIcp-> " + IsTypIcp);
        is.setIcp(IsTypIcp);

        AsType as2 = factoryDasta.createAsType();

        String IsTypAsVnitrni = isGET.getAs().getVnitrni();
        //System.out.println("IsTypAsVnitrni-> " + IsTypAsVnitrni);
        as2.setVnitrni(IsTypAsVnitrni);
        is.setAs(as2);

        /**
         * Pacientska cast
         */
        Ip ip = factoryDsIp.createIp();

        Ip ipIsGET = (Ip)isGET.getAny();

        String IpIDPac = ipIsGET.getIdPac();
        //System.out.println("IsIpIdPac-> " + IpIDPac);
        ip.setIdPac(IpIDPac);

        String IpRodCis = ipIsGET.getRodcis();
        //System.out.println("IsIpRodneCislo-> " + IpRodCis);
        ip.setRodcis(IpRodCis);

        String IpJmeno = ipIsGET.getIdPac();
        //System.out.println("IsIpJmeno-> " + IpJmeno);
        ip.setJmeno(IpJmeno);

        String IpPrijmeni = ipIsGET.getPrijmeni();
        //System.out.println("IsIpPrijmeni-> " + IpPrijmeni);
        ip.setPrijmeni(IpPrijmeni);

        DatXxType datDn = new DatXxType();

        String IpDnFormat = ipIsGET.getDatDn().getFormat();
        //System.out.println("IpIsDnFormat-> " + IpDnFormat);
        datDn.setFormat(IpDnFormat);

        String IpDnValue = ipIsGET.getDatDn().getValue();
        //System.out.println("IpIsDnValue-> " + IpDnValue);
        datDn.setValue(IpDnValue);
        ip.setDatDn(datDn);

        String IpSex = ipIsGET.getSex().value();
        //System.out.println("IpSex-> " + IpSex);
        ip.setSex(SexType.M);

        KuZType kuZType = factoryDsIp.createKuZType();

        KuZType kuZIpIsGET = ipIsGET.getKu().getKuZ().get(vemPrvni);

        String kuZTypku = kuZIpIsGET.getTypku();
        //System.out.println("kuZTypku-> " + kuZTypku);
        kuZType.setTypku(kuZTypku);

        String kuZFazespec = kuZIpIsGET.getFazespec();
        //System.out.println("kuZFazespec-> " + kuZFazespec);
        kuZType.setFazespec(kuZFazespec);

        String kuZIdku = kuZIpIsGET.getIdku();
        //System.out.println("kuZIdku-> " + kuZIdku);
        kuZType.setIdku(kuZIdku);

        DatXxType datProv = new DatXxType();
        DatXxType datVydani = new DatXxType();

        String kuZDatProv = kuZIpIsGET.getDatProv().getValue();
        //System.out.println("kuZDatProv-> " + kuZDatProv);
        datProv.setValue(kuZDatProv);

        String kuZDatVydani = kuZIpIsGET.getDatVydani().getValue();
        //System.out.println("kuDatVydani-> " + kuZDatVydani);
        datVydani.setValue(kuZDatVydani);

        kuZType.setDatProv(datProv);
        kuZType.setDatVydani(datVydani);
        /*
         * Definice pracoviste, kde probehlo osetreni
         */
        PracovisteType pPracoviste = factoryDsIp.createPracovisteType();

        PracovisteType pPracKuZIpIsGET = kuZIpIsGET.getPPracoviste();

        String pPracIcz = pPracKuZIpIsGET.getIcz();
        //System.out.println("pPracIcz-> " + pPracIcz);
        pPracoviste.setIcz(pPracIcz);

        String pPracIcp = pPracKuZIpIsGET.getIcp();
        //System.out.println("pPracIcp-> " + pPracIcp);
        pPracoviste.setIcp(pPracIcp);

        String pPracOdb = pPracKuZIpIsGET.getOdb();
        //System.out.println("pPracOdb-> " + pPracOdb);
        pPracoviste.setOdb(pPracOdb);

        String pPracNazev = pPracKuZIpIsGET.getNazev();
        //System.out.println("pPracNazev-> " + pPracNazev);
        pPracoviste.setNazev(pPracNazev);

        kuZType.setPPracoviste(pPracoviste);

        TextType textType = factoryDsIp.createTextType();
        Ptext pText = factoryDsIp.createPtext();
        Ptext pTextKuZIpIsGET = kuZIpIsGET.getText().getPtext();

        String pTextSpace = pTextKuZIpIsGET.getSpace();
        //System.out.println("pTextSpace-> " + pTextSpace);
        pText.setSpace(pTextSpace);

        String pTextValue = pTextKuZIpIsGET.getValue();
        //System.out.println("pTextValue-> " + pTextValue);
        pText.setValue(pTextValue);

        textType.setPtext(pText);

        kuZType.setText(textType);

        //Definice diagnozy
        DgzType dgzType = factoryDsIp.createDgzType();
        DgzType dgzTypeKuZIpIsGET = kuZIpIsGET.getDgVys().get(vemPrvni);

        Diag diag = new Diag();
        Diag diagDgzTypeKuZIpIsGET = dgzTypeKuZIpIsGET.getDiag();

        String diagValue = diagDgzTypeKuZIpIsGET.getValue();
        //System.out.println("diagValue-> " + diagValue);
        diag.setValue(diagValue);

        int diagPoradi = diagDgzTypeKuZIpIsGET.getPoradi();
        //System.out.println("diagPoradi-> " + diagPoradi);
        diag.setPoradi(diagPoradi);
        dgzType.setDiag(diag);

        String typDg = dgzTypeKuZIpIsGET.getTypDg();
        //System.out.println("typDg-> " + typDg);
        dgzType.setTypDg(typDg);

        String indOpravSd = dgzTypeKuZIpIsGET.getIndOpravSd();
        //System.out.println("IndOpravSd-> " + indOpravSd);
        dgzType.setIndOpravSd(indOpravSd);

        List<DgzType> dgzTypes = kuZType.getDgVys();

        dgzTypes.add(dgzType);

        AuzkuType auzkuType = factoryDsIp.createAuzkuType();
        AuzkuType auzkuTypeKuZIpIsGET = kuZIpIsGET.getAuzku().get(vemPrvni);

        String indikace = auzkuTypeKuZIpIsGET.getIndikace();
        //System.out.println("Indikace-> " + indikace);
        auzkuType.setIndikace(indikace);

        String typpolVz = auzkuTypeKuZIpIsGET.getTyppolVz();
        //System.out.println("TyppolVz-> " + typpolVz);
        auzkuType.setTyppolVz(typpolVz);

        String diagAuzku = auzkuTypeKuZIpIsGET.getDiag();
        //System.out.println("diagAuzku-> " + diagAuzku);
        auzkuType.setDiag(diagAuzku);

        DatDuType datDu = factoryDsType.createDatDuType();

        String valueDatDuAuzku = auzkuTypeKuZIpIsGET.getDatDu().getValue();
        //System.out.println("Value datDuAuzku-> " + valueDatDuAuzku);
        datDu.setValue(valueDatDuAuzku);

        LVTZDCUN typDatDuAuzku = auzkuTypeKuZIpIsGET.getDatDu().getTyp();
        //System.out.println("Typ datDuAuzku-> " + typDatDuAuzku.toString());
        datDu.setTyp(typDatDuAuzku);

        auzkuType.setDatDu(datDu);
        List<AuzkuType> auzkuTypes = kuZType.getAuzku();

        auzkuTypes.add(auzkuType);

        /**
         * Nyni je potreba navazat jednotlive bloky na hlavni tag dasta
         */
        dasta.setZdrojIs(zdrojIsType); // pridani zdroje

        dasta.setPm(pm); // pridani prijmoveho mista

        dasta.setGarantDat(garantDat);  // pridani garanta

        /**
         * Blok ku muze obsahovat vetsi pocet klinickych udalosti
         * (reprezentovnych kuZType), proto je potreba tento blok definovat v
         * poli (rep. ArrayListu)
         */
        ArrayList<IsType> isTypes = new ArrayList<IsType>();
        Ip.Ku ipKu = factoryDsIp.createIpKu(); // trida Ku je soucasti tridy Ip
        List<KuZType> kuZTypes = ipKu.getKuZ(); // Je vyvoren seznam klinickych udalosti, ktery je soucasti Ip.Ku

        kuZTypes.add(kuZType); // prida se vytvorena klinicka udalost

        ip.setKu(ipKu); // klinicke udalosti se pridaji jako blok k bloku pacienta

        is.setIp(ip);  //  krok pridani bloku pacienta do bloku odesilatele

        isTypes.add(is);  // Pro pripad, ze by zprava obsahovale vice udalosti je halvni blok is zarazen do seznamu

        dasta.setIs(isTypes); // prirazeni cele zpravy do obalu bloku datsa

          /**
         * Vytvori xml z hlavniho objektu dasta
         */
        JAXBContext context1 = JAXBContext.newInstance(Dasta.class);
        JAXBElement<Dasta> element = factoryDasta.createExpenseReport(dasta);
        Marshaller marshaller = context1.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        /**
         * Namapuje elementy jednotlivych namespace na nami pozadovane nazvy
         */
        marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new NamespacePrefixMapper() {

            @Override
            public String[] getPreDeclaredNamespaceUris() {
                return null; //new String[]{WellKnownNamespace.XML_SCHEMA_INSTANCE};
            }

            @Override
            public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
                if (namespaceUri.equals("urn:cz-mzcr:ns:dasta:ds4:ds_dasta")) {
                    return "ds";
                }
                if (namespaceUri.equals("urn:cz-mzcr:ns:dasta:ds4:ds_ip")) {
                    return "dsip";
                }
                return suggestion;

            }
        });

        /**
         * Vypis xml zpavy
         */
        marshaller.marshal(element, System.out);
    }

}


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

namespace Reporter.Model
{
    public class Role
    {
        public Guid Id { get; set; }

        public string Name { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Новое в DevTools – front-end.su</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Используйте новое контекстное меню в панели DOM для эффективного редактирования узлов. Осуществляйте отладку services workers при помощи панели ресурсов. Выбирайте один из оттенков в стиле Material Design в компоненте colorpicker. Работайте с Blackbox JS проще.">
    <meta name="author" content="Oleg Nayanov">

    <meta name="keywords" content=""/>

    <link rel="canonical" href="http://front-end.su/2015/11/05/new-in-devtools/">
    <link rel="alternate" type="application/rss+xml" title="RSS Feed for front-end.su" href="/feed.xml" />

    <link rel="stylesheet" href="/css/pixyll.css?201708161926" type="text/css">

    <meta name='yandex-verification' content='7f003fb272100188' />

    <meta property="og:locale" content="en_US">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Новое в DevTools">
    <meta property="og:description" content="front-end разработка в деталях">
    <meta property="og:url" content="http://front-end.su/2015/11/05/new-in-devtools/">
    <meta property="og:site_name" content="front-end.su">

    <meta name="twitter:card" content="summary" />

    <meta name="twitter:title" content="Новое в DevTools" />
    <meta name="twitter:description" content="Используйте новое контекстное меню в панели DOM для эффективного редактирования узлов. Осуществляйте отладку services workers при помощи панели ресурсов. Выбирайте один из оттенков в стиле Material Design в компоненте colorpicker. Работайте с Blackbox JS проще." />
    <meta name="twitter:url" content="http://front-end.su/2015/11/05/new-in-devtools/" />

    <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
    <link rel="manifest" href="/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">

      front-end.su

        Конференция FrontHub
Контакты

Новое в DevTools

  Nov 5, 2015

    2 minute read

Данный материал является вольным переводом статьи:
Paul Bakaus DevTools Digest: Efficient element edits, Service Worker debugging, and Material Design shades

Используйте новое контекстное меню в панели DOM для эффективного редактирования узлов. Осуществляйте отладку services workers при помощи панели ресурсов. Выбирайте один из оттенков в стиле Material Design в компоненте colorpicker. Работайте с Blackbox JS проще.

Улучшенное контекстное меню панели DOM.

Мы проанализировали наиболее часто совершаемые действия в панели DOM и пришли к выводу, что контекстное меню не должно быть загроможденным и должно быть реорганизовано. Теперь намного проще выполнять такие операции как: скрыть или удалить элемент, сделать его состояние :active или :hover или начать редактирование HTML. И если при работе с трекпадом вы не хотите заморачиваться с "правой кнопкой мыши" нажмите на три маленькие точки рядом с выбранным элементом.

Отладка Service Workers в панели ресурсов

Service Workers это просто фантастика, особенно после того, как вы получили возможность их настроить. Но они могут каверзно вскружить вам голову, особенно поначалу. Еще хуже был тот факт, что их отладка требовала открытия новой вкладки с адресом chrome://serviceworker-internals/

Хватит это терпеть! Теперь можно отлаживать Service Workers для текущего домена непосредственно в панели ресурсов. Работа над данной возможностью еще продолжается, но она претерпела значительные улучшения по сравнению с предыдущей версией.

Все цвета: Оттенки Material Design в colorpicker

Несколько недель назад мы добавили палитру Material Design в colorpicker, чтобы дать вам возможность использовать основные цвета "из коробки". На деле для создания полной страницы вам неизбежно понадобится доступ ко всем оттенкам Material Design, поэтому мы добавили их.

<video src="https://developers.google.com/web/updates/videos/2015/10/devtools-md-shades.mp4" controls="" loop="" autoplay=""></video>

Для доступа к оттенкам сделайте "долгий клик" на один из первичных цветов и выберите оттенок вместо него.

Легкая настройка Blackbox JavaScript библиотек

JavaScript Blackboxing был совсем рядом, но его не очень-то легко было обнаружить. Эта функция позволяет исполнять blackbox сценарий на странице, чтобы вы могли сосредоточиться только на авторском коде (и скрыть код оболочек).

Сейчас мы переместили ее в настройки.

Лучшее из Rest

Отсутствует доступ к переключению рендеринга? Рендеринг настройки были перенесены в главное меню в DevTools ( в раздел "More Tools"). В дополнение к обычным инспекторам (наподобие FPS-метра) мы отправили туда же режим "Эмуляция печатного издания".

Надоело вводить chrome://inspect в Omnibox? Inspect Devices вы можете теперь найти в новом главном меню в разделе "More Tools".

Случайно закрыли одну из вкладок вроде рендеринга или поиска? Теперь вы можете открыть их снова при помощи нового левого меню.

UPD: Большое спасибо Вадиму Макееву за замечание о переводе абзаца про Blackbox и объяснение ошибки.

Все фото и видео материалы взяты с сайта developers.google.com

front-end.su © 2015

               Автор шаблона John Otander (@4lpine).

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/default.min.css">


text:
package de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.reader;

import de.tudarmstadt.ukp.dkpro.core.api.resources.CompressionUtils;
import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader;
import de.tudarmstadt.ukp.dkpro.tc.api.type.TextClassificationOutcome;
import org.apache.commons.io.IOUtils;
import org.apache.uima.UIMAException;
import org.apache.uima.UimaContext;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.apache.uima.fit.component.NoOpAnnotator;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.CollectionReaderFactory;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.xml.sax.SAXException;

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

/**
 * Reads all XMI files where each XMI file contains only a single
 * {@linkplain TextClassificationOutcome} annotation with "Claim" or "None" (covering a single
 * sentence), produced by {@linkplain SentenceClaimOutcomeMultiplier}.
 * Randomly shuffles claims and non-claims documents and "reads" a balanced list.
 *
 * @author Ivan Habernal
 */
public class RandomBalancedCorpusSampler
        extends XmiReader
{
    public static final String PARAM_RANDOM_SEED = "randomSeed";
    @ConfigurationParameter(name = PARAM_RANDOM_SEED)
    protected int randomSeed;

    /**
     * Random number generator
     */
    protected Random random;

    @Override
    public void initialize(UimaContext aContext)
            throws ResourceInitializationException
    {
        random = new Random(randomSeed);

        super.initialize(aContext);
    }

    @Override
    protected Collection<Resource> scan(String aBase,
            Collection<String> aIncludes, Collection<String> aExcludes)
            throws IOException
    {
        try {
            Collection<Resource> resourceCollection = super.scan(aBase, aIncludes, aExcludes);
            Map<String, List<Resource>> claimDocs = new HashMap<String, List<Resource>>();
            Map<String, List<Resource>> nonClaimDocs = new HashMap<String, List<Resource>>();
            JCas jCas = JCasFactory.createJCas();

            for (Resource res : resourceCollection) {
            	String dataset = res.getResource().getFile().getParentFile().getName();
            	jCas.reset();

                CAS aCAS = jCas.getCas();
                initCas(aCAS, res);

                InputStream is = null;

                try {
                	is = CompressionUtils
                        .getInputStream(res.getLocation(), res.getInputStream());
                	XmiCasDeserializer.deserialize(is, aCAS, false);
                }
                catch (SAXException e) {
                	throw new IOException(e);
                }
                finally {
                	IOUtils.closeQuietly(is);
                }

                // find TextOutcome - there must be only one (for a single sentence)
                TextClassificationOutcome outcome = JCasUtil
                        .selectSingle(jCas, TextClassificationOutcome.class);

                if ("Claim".equals(outcome.getOutcome())) {
                	List<Resource> resList = claimDocs.containsKey(dataset) ? claimDocs.get(dataset) : new ArrayList<Resource>();
                	resList.add(res);
                    claimDocs.put(dataset, resList);
                }
                else if ("None".equals(outcome.getOutcome())) {
                	List<Resource> resList = nonClaimDocs.containsKey(dataset) ? nonClaimDocs.get(dataset) : new ArrayList<Resource>();
                	resList.add(res);
                    nonClaimDocs.put(dataset, resList);
                }
                else {
                    throw new IllegalArgumentException(outcome.getOutcome());
                }
            }

            List<Resource> allDocs = new ArrayList<>();
            // now shuffle, trim, and throw into final list of resources
            for (String dataset : claimDocs.keySet()) {
            	Collections.shuffle(claimDocs.get(dataset), random);
            	Collections.shuffle(nonClaimDocs.get(dataset), random);
            	int maxLength = Math.min(claimDocs.get(dataset).size(), nonClaimDocs.get(dataset).size());
            	List<Resource> c = claimDocs.get(dataset).subList(0, maxLength);
            	List<Resource> nc = nonClaimDocs.get(dataset).subList(0, maxLength);
            	allDocs.addAll(c);
            	allDocs.addAll(nc);
			}

            // add some extra randomization
            Collections.shuffle(allDocs, random);
            return allDocs;
        }
        catch (UIMAException e) {
            throw new IOException(e);
        }
    }

    public static void main(String[] args)
            throws Exception
    {
        SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
                RandomBalancedCorpusSampler.class,
                RandomBalancedCorpusSampler.PARAM_SOURCE_LOCATION, "/tmp/out",
                RandomBalancedCorpusSampler.PARAM_PATTERNS,
                RandomBalancedCorpusSampler.INCLUDE_PREFIX + "*.xmi",
                RandomBalancedCorpusSampler.PARAM_RANDOM_SEED, 1),
                AnalysisEngineFactory.createEngineDescription(
                        NoOpAnnotator.class
                )
        );
    }
}


text:
<?php

function smarty_modifier_video_thumb($val, $size = 'default') {
	return video::get_thumb($val, $size);
}


text:
USE [ANTERO]
GO

/****** Object:  Table [sa].[sa_eter_students]    Script Date: 27.4.2022 10:50:00 ******/
DROP TABLE [sa].[sa_eter_students]
GO

/****** Object:  Table [sa].[sa_eter_students]    Script Date: 27.4.2022 10:50:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [sa].[sa_eter_students](
	[ETER_ID] [varchar](255) NULL,
	[Lowest degree delivered] [varchar](255) NULL,
	[Flag Students ISCED 5 - gender] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - men] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - resident] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - gender unclassified] [varchar](255) NULL,
	[Highest degree delivered] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Education] [varchar](255) NULL,
	[Flag Students ISCED 5 - citizenship] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - foreigner] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Information and Communication Technologies] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - national] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Generic programmes and qualifications] [varchar](255) NULL,
	[Students enrolled at ISCED 5-mobility unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-ISCED-FoE unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Natural sciences, mathematics and statistics] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - mobile] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Social sciences, journalism and information] [varchar](255) NULL,
	[Flag Students ISCED 5 - part-time, full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Services] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Arts and Humanities] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Agriculture, forestry, fisheries and veterinary] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - over 29 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Engineering, manufacturing and construction] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - part-, full-time unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - between 25 and 29 years old] [varchar](255) NULL,
	[Flag Students ISCED 5 - ISCED-FoE] [varchar](255) NULL,
	[Notes on students enrolled at ISCED 5] [varchar](266) NULL,
	[Students enrolled at ISCED 5 - part-time] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - under 20 years old] [varchar](255) NULL,
	[Flag Total students ISCED 5] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - national] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - mobile] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Age goup unclassified] [varchar](255) NULL,
	[Flag Students ISCED 5 - Age group] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Arts and Humanities] [varchar](255) NULL,
	[Flag Students ISCED 6 - gender] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - resident] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - men] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - women] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Engineering, manufacturing and construction] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Education] [varchar](255) NULL,
	[Students at ISCED 6-citizenship unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - foreigner] [varchar](255) NULL,
	[Flag Students ISCED 6 - ISCED-FoE] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Information and Communication Technologies] [varchar](255) NULL,
	[Students at ISCED 6 - mobility unclassified] [varchar](255) NULL,
	[Flag Students ISCED 6 - mobility] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - under 20 years old] [varchar](255) NULL,
	[Students at ISCED 6 - ISCED-FoE unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Social sciences, journalism and information] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Age goup unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Business, administration and law] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - men] [varchar](255) NULL,
	[Flag Students ISCED 6 - part-time, full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Health and welfare] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Agriculture, forestry, fisheries and veterinary] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - over 29 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - foreigner] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - women] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - part-time] [varchar](255) NULL,
	[Notes on students enrolled at ISCED 6] [varchar](394) NULL,
	[Students enrolled at ISCED 6 - between 22 and 24 years old] [varchar](255) NULL,
	[Students at ISCED 7 - mobility unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - national] [varchar](255) NULL,
	[Total students enrolled at ISCED 6] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Social sciences, journalism and information] [varchar](255) NULL,
	[Students at ISCED 5-citizenship unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - gender unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - mobile] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Agriculture, forestry, fisheries and veterinary] [varchar](255) NULL,
	[Flag Students ISCED 5 - mobility] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Arts and Humanities] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - part-time] [varchar](255) NULL,
	[Flag Students ISCED 6 - Age group] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Business, administration and law] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Engineering, manufacturing and construction] [varchar](255) NULL,
	[Flag Students ISCED 7 - citizenship] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Generic programmes and qualifications] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - women] [varchar](255) NULL,
	[Flag Students ISCED 7 - ISCED-FoE] [varchar](255) NULL,
	[Flag Students ISCED 7 - Age group] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - Health and welfare] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Natural sciences, mathematics and statistics] [varchar](255) NULL,
	[Students at ISCED 7-citizenship unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - under 20 years old] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - women] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - full-time] [varchar](255) NULL,
	[Flag Students ISCED 7 - mobility] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Services] [varchar](255) NULL,
	[Students ISCED7 long degree-citiz. unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Age goup unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Business, administration and law] [varchar](255) NULL,
	[Students enrolled at ISCED 5 - between 22 and 24 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - part-, full-time unclassified] [varchar](255) NULL,
	[Total students enrolled at ISCED 5] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Health and welfare] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - men] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - between 25 and 29 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - gender unclassified] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - mobility] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - full-time] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - foreigner] [varchar](255) NULL,
	[Flag Total students ISCED 7] [varchar](255) NULL,
	[Students ISCED 7 long degree-mobility unclassified] [varchar](255) NULL,
	[Flag Students ISCED 6 - citizenship] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Business, administration and law] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - between 22 and 24 years old] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - gender] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Social sciences, journalism and information] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Generic programmes and qualifications] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Health and welfare] [varchar](255) NULL,
	[Total students enrolled at ISCED 7] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - resident] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Natural sciences, mathematics and statistics] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - full-time] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Agriculture, forestry, fisheries and veterinary] [varchar](255) NULL,
	[Students ISCED 7 long degree - gender unclassified] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Education] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - Services] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - part-time] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - between 22 and 24 years old] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - citizenship] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Information and Communication Technologies] [varchar](255) NULL,
	[Total students enrolled ISCED 7 long degree] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - part-, full-time unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 6 - between 25 and 29 years old] [varchar](255) NULL,
	[Students ISCED7 long degree - ISCED-FoE unclassified] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - Age group] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - gender unclassified] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Generic programmes and qualifications] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - part-time, full-time] [varchar](255) NULL,
	[Flag Total students ISCED 6] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - women] [varchar](255) NULL,
	[Flag students enrolled at ISCED 5-7 - citizenship] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Natural sciences, mathematics and statistics] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - over 29 years old] [varchar](255) NULL,
	[Flag Students ISCED 7 - gender] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Generic programmes and qualifications] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - citizenship unclassified] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Services] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - resident] [varchar](255) NULL,
	[Notes on students enrolled at ISCED 7 long degree] [varchar](297) NULL,
	[Flag students enrolled at ISCED 5-7 - mobility] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Natural sciences, mathematics and statistics] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - part-, full-time unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Education] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Services] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - national] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Business, administration and law] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - between 25 and 29 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Health and welfare] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - part-, full-time unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - Information and Communication Technologies] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - between 22 and 24 years old] [varchar](255) NULL,
	[Flag Total students ISCED 7 long degree] [varchar](255) NULL,
	[Total students enrolled ISCED 5-7] [varchar](255) NULL,
	[Students at ISCED 7 - ISCED-FoE unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - between 25 and 29 years old] [varchar](255) NULL,
	[Flag students enrolled at ISCED 5-7 - gender] [varchar](255) NULL,
	[Flag Students ISCED 7 - part-time, full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - mobile] [varchar](255) NULL,
	[Flag Total students ISCED 5-7] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - resident] [varchar](255) NULL,
	[Students enrolled at ISCED 7 - over 29 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Arts and Humanities] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Education] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Engineering, manufacturing and construction] [varchar](255) NULL,
	[Notes on students enrolled at ISCED 7] [varchar](614) NULL,
	[Students enrolled ISCED 7 long degree - national] [varchar](255) NULL,
	[Flag students enrolled at ISCED 5-7 - ISCED-FoE] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Information and Communication Technologies] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - mobile] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - ISCED-FoE unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - under 20 years old] [varchar](255) NULL,
	[Flag Students ISCED 5-7 - part-time, full-time] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Age goup unclassified] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Arts and Humanities] [varchar](255) NULL,
	[Distance education institution] [varchar](255) NULL,
	[Students enrolled ISCED 7 long degree - Engineering, manufacturing and construction] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - over 29 years old] [varchar](255) NULL,
	[Flag Students ISCED 7 long degree - ISCED-FoE] [varchar](255) NULL,
	[Notes on total students enrolled ISCED 5-7] [varchar](770) NULL,
	[Students enrolled at ISCED 7 long degree - under 20 years old] [varchar](255) NULL,
	[Students enrolled at ISCED 7 long degree - Age goup unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - men] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - foreigner] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - mobility unclassified] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Social sciences, journalism and information] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - Agriculture, forestry, fisheries and veterinary] [varchar](255) NULL,
	[Students enrolled at ISCED 5-7 - part-time] [varchar](255) NULL,
	[Flag Students ISCED 5-7 - Age group] [varchar](255) NULL,
	[Notes on educational activities (Students)] [varchar](255) NULL,
	[username] [varchar](100) NULL,
	[source] [varchar](100) NULL,
	[loadtime] [datetime] NULL
) ON [PRIMARY]

GO

USE [ANTERO]


text:
#include <linux/device.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>

#include <sound/control.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/info.h>
#include <sound/rawmidi.h>
#include <sound/firewire.h>
#include <sound/hwdep.h>

#include "../lib.h"
#include "../fcp.h"
#include "../packets-buffer.h"
#include "../iso-resources.h"
#include "../amdtp-am824.h"
#include "../cmp.h"

struct device_info {
	const char *driver_name;
	const char *vendor_name;
	const char *model_name;
	unsigned int mixer_channels;
	u8 mute_fb_id;
	u8 volume_fb_id;
};

/* This is an arbitrary number for convinience. */
#define	SND_OXFW_STREAM_FORMAT_ENTRIES	10
struct snd_oxfw {
	struct snd_card *card;
	struct fw_unit *unit;
	const struct device_info *device_info;
	struct mutex mutex;
	spinlock_t lock;

	bool wrong_dbs;
	bool has_output;
	u8 *tx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES];
	u8 *rx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES];
	bool assumed;
	struct cmp_connection out_conn;
	struct cmp_connection in_conn;
	struct amdtp_stream tx_stream;
	struct amdtp_stream rx_stream;
	unsigned int capture_substreams;
	unsigned int playback_substreams;

	unsigned int midi_input_ports;
	unsigned int midi_output_ports;

	bool mute;
	s16 volume[6];
	s16 volume_min;
	s16 volume_max;

	int dev_lock_count;
	bool dev_lock_changed;
	wait_queue_head_t hwdep_wait;
};

/*
 * AV/C Stream Format Information Specification 1.1 Working Draft
 * (Apr 2005, 1394TA)
 */
int avc_stream_set_format(struct fw_unit *unit, enum avc_general_plug_dir dir,
			  unsigned int pid, u8 *format, unsigned int len);
int avc_stream_get_format(struct fw_unit *unit,
			  enum avc_general_plug_dir dir, unsigned int pid,
			  u8 *buf, unsigned int *len, unsigned int eid);
static inline int
avc_stream_get_format_single(struct fw_unit *unit,
			     enum avc_general_plug_dir dir, unsigned int pid,
			     u8 *buf, unsigned int *len)
{
	return avc_stream_get_format(unit, dir, pid, buf, len, 0xff);
}
static inline int
avc_stream_get_format_list(struct fw_unit *unit,
			   enum avc_general_plug_dir dir, unsigned int pid,
			   u8 *buf, unsigned int *len,
			   unsigned int eid)
{
	return avc_stream_get_format(unit, dir, pid, buf, len, eid);
}

/*
 * AV/C Digital Interface Command Set General Specification 4.2
 * (Sep 2004, 1394TA)
 */
int avc_general_inquiry_sig_fmt(struct fw_unit *unit, unsigned int rate,
				enum avc_general_plug_dir dir,
				unsigned short pid);

int snd_oxfw_stream_init_simplex(struct snd_oxfw *oxfw,
				 struct amdtp_stream *stream);
int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw,
				  struct amdtp_stream *stream,
				  unsigned int rate, unsigned int pcm_channels);
void snd_oxfw_stream_stop_simplex(struct snd_oxfw *oxfw,
				  struct amdtp_stream *stream);
void snd_oxfw_stream_destroy_simplex(struct snd_oxfw *oxfw,
				     struct amdtp_stream *stream);
void snd_oxfw_stream_update_simplex(struct snd_oxfw *oxfw,
				    struct amdtp_stream *stream);

struct snd_oxfw_stream_formation {
	unsigned int rate;
	unsigned int pcm;
	unsigned int midi;
};
int snd_oxfw_stream_parse_format(u8 *format,
				 struct snd_oxfw_stream_formation *formation);
int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw,
				enum avc_general_plug_dir dir,
				struct snd_oxfw_stream_formation *formation);

int snd_oxfw_stream_discover(struct snd_oxfw *oxfw);

void snd_oxfw_stream_lock_changed(struct snd_oxfw *oxfw);
int snd_oxfw_stream_lock_try(struct snd_oxfw *oxfw);
void snd_oxfw_stream_lock_release(struct snd_oxfw *oxfw);

int snd_oxfw_create_pcm(struct snd_oxfw *oxfw);

int snd_oxfw_create_mixer(struct snd_oxfw *oxfw);

void snd_oxfw_proc_init(struct snd_oxfw *oxfw);

int snd_oxfw_create_midi(struct snd_oxfw *oxfw);

int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw);


text:
function confirm_delete(id,control){
	var a = confirm("Anda yakin ingin menghapus record ini ?");
	if(a==true){
		window.location.href = control+id;
	}
}

function confirm_delete_detail(id,control){
	var a = confirm("Anda yakin ingin menghapus record ini ?");
	if(a==true){
		window.location.href = control+id;
		//alert(control+id);
	}
}

function delete_optional(id,new_id,detail_id,control){
	var a = confirm("Anda yakin ingin menghapus record ini ?");
	if(a==true){
		window.location.href = control+id+"/"+new_id+"/"+detail_id;
		//alert(control+id);
	}
}

function delete_detail(id,new_id,control){
	var a = confirm("Anda yakin ingin menghapus record ini ?");
	if(a==true){
		window.location.href = control+id+"/"+new_id;
		//alert(control+id);
	}
}

function kamar_penuh(id){
	var a = confirm("Anda yakin ingin menghapus record ini ?");
	if(a==true){
		window.location.href = control+id;
		//alert(control+id);
	}
}

function confirm_onprogress(id,control){
	var a = confirm("Anda yakin ingin memproses data ini?");
	if(a==true){
		window.location.href = control+id;
	}
}

function confirm_done(id,control){

	var a = confirm("Apakah sudah terkonfirmasi ?");
	if(a==true){
		window.location.href = control+id;
	}
}
function confirm_transaction(id,control,nopol){
	var a = confirm("Anda yakin ingin mengkonfirmasi kedatangan truck dengan nopol "+nopol);
	if(a==true){
		window.location.href = control+id;
	}
}
function confirm_act(id,control){
	var a = confirm("Anda yakin ingin mengaktifkan data ini ?");
	if(a==true){
		window.location.href = control+id;
	}
}

function confirm_approved(id,control){
	var a = confirm("Anda yakin ingin approve data ini ?");
	if(a==true){
		window.location.href = control+id;
	}
}

function confirm_not_approved(id,control){
	var a = confirm("Anda yakin ingin reject data ini ?");
	if(a==true){
		window.location.href = control+id;
	}
}


text:
// Licensed to eXtensoft LLC under one or more agreements.
// eXtensoft LLC licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace XF.Common
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.SqlClient;
    using XF.Common.Special;

    public class SqlServerEventWriter
    {
        private static string cnString;
        private static bool isInitialized;

        private const string ApplicationKeyParamName = "@applicationkey";
        private const string ZoneParamName = "@zone";
        private const string AppContextInstanceParamName = "@appcontextinstance";
        private const string MessageIdParamName = "@messageid";
        private const string CategoryParamName = "@category";
        private const string SeverityParamName = "@severity";
        private const string MessageParamName = "@message";
        private const string XmlDataParamName = "@xmldata";
        private const string DbSchema = "log";

        static SqlServerEventWriter()
        {
            try
            {
                var settings = ConfigurationProvider.ConnectionStrings[eXtensibleConfig.LogKey];
                if (settings != null && !String.IsNullOrWhiteSpace(settings.ConnectionString))
                {
                    cnString = settings.ConnectionString;
                    using (SqlConnection cn = new SqlConnection(cnString))
                    {
                        cn.Open();
                        if (cn.State == System.Data.ConnectionState.Open)
                        {
                            isInitialized = true;
                        }
                    }
                }
            }
            catch
            {
                isInitialized = false;
                cnString = String.Empty;
            }

        }

        public static void Post(eXError error)
        {
            PostError(error);
        }

        public static void PostAlert(List<TypedItem> properties)
        {
            eXAlert model = new eXAlert(properties);
            if (eXtensibleConfig.HandleAlerts)
            {
                HandleAlert(model);
            }
            PostAlert(model);
        }

        public static void PostList(List<TypedItem> properties)
        {
            try
            {
                using (SqlConnection cn = new SqlConnection(cnString))
                {
                    cn.Open();
                    using (SqlCommand cmd = cn.CreateCommand())
                    {
                        const string xmlDocParamName = "@xdoc";
                        const string handlerKeyParamName = "@handler";
                        cmd.CommandType = CommandType.Text;
                        cmd.CommandText = "insert into [log].[eXtensibleList]([handlerkey],[xmldoc]) values (" + handlerKeyParamName + "," + xmlDocParamName + ")";
                        cmd.Parameters.AddWithValue(handlerKeyParamName, "alertHandler");
                        string xml = GenericSerializer.DbParamFromItem(properties);
                        cmd.Parameters.AddWithValue(xmlDocParamName, xml);
                        cmd.ExecuteNonQuery();
                    }

                }

            }
            catch (Exception ex)
            {
                IEventWriter writer = new EventLogWriter();
                string m = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                var props = eXtensibleConfig.GetProperties();
                props.Add("location", "SqlServerEventWriter.line.105");
                writer.WriteError(m, SeverityType.Critical, "EventWriter", props);
            }
        }

        private static void HandleAlert(eXAlert model)
        {

        }

        private static void PostAlert(eXAlert model)
        {

            const string appKeyName = "@key";
            const string appZoneName = "@zone";
            const string appInstanceName = "@instance";
            const string titleParamName = "@title";
            const string sourceParamName = "@source";
            const string importanceParamName = "@importance";
            const string urgencyParamName = "@urgency";
            const string xmlDataParamName = "@xmldata";
            const string dispositionParamName = "@disposition";
            const string createdAtParamName = "@createdat";
            try
            {
                using (SqlConnection cn = new SqlConnection(cnString))
                {
                    cn.Open();
                    using (SqlCommand cmd = cn.CreateCommand())
                    {
                        cmd.CommandType = CommandType.Text;
                        string sql = "insert into [log].[alert] ([appkey],[appzone],[appinstance],[title],[source],[importance],[urgency],[xmldata],[disposition],[createdat]) values ( " +
                            appKeyName + "," + appZoneName + "," + appInstanceName + "," + titleParamName + "," + sourceParamName + "," + importanceParamName + "," +
                            urgencyParamName + "," + xmlDataParamName + "," + dispositionParamName + "," + createdAtParamName + ")";
                        cmd.Parameters.AddWithValue(appKeyName, model.ApplicationKey);
                        cmd.Parameters.AddWithValue(appZoneName, model.Zone);
                        string appinstance;
                        if (model.Items.TryGet<string>("app.context.instance", out appinstance))
                        {
                            cmd.Parameters.AddWithValue(appInstanceName, appinstance);
                        }
                        else
                        {
                            cmd.Parameters.AddWithValue(appInstanceName, "none");
                        }

                        cmd.Parameters.AddWithValue(titleParamName, model.Title);
                        cmd.Parameters.AddWithValue(sourceParamName, !String.IsNullOrWhiteSpace(model.Source) ? model.Source : "none");
                        cmd.Parameters.AddWithValue(importanceParamName, model.Importance);
                        cmd.Parameters.AddWithValue(urgencyParamName, model.Urgency);
                        var xml = GenericSerializer.DbParamFromItem(model);
                        cmd.Parameters.AddWithValue(XmlDataParamName, xml);
                        cmd.Parameters.AddWithValue(dispositionParamName, "none");
                        cmd.Parameters.AddWithValue(createdAtParamName, DateTime.Now);

                        cmd.CommandText = sql;
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                IEventWriter writer = new EventLogWriter();
                string m = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                var props = eXtensibleConfig.GetProperties();
                props.Add("location", "SqlServerEventWriter.line.105");
                writer.WriteError(m, SeverityType.Critical, "EventWriter", props);
            }
        }

        public static void Post(List<TypedItem> properties)
        {
            //throw new NotImplementedException();
        }

        private static string GetSchema()
        {
            DateTime now = DateTime.Now;
            return now.ToSchema(eXtensibleConfig.LoggingSchema, "log");
        }
        private static void PostError(eXError model)
        {
            if (isInitialized)
            {
                try
                {
                    using (SqlConnection cn = new SqlConnection(cnString))
                    {
                        cn.Open();
                        using (SqlCommand cmd = cn.CreateCommand())
                        {
                            cmd.CommandType = CommandType.Text;
                            string schema = GetSchema();
                            string sql = "insert into [" + schema + "].[Error] ( [ApplicationKey],[Zone],[AppContextInstance],[MessageId]," +
                                "[Category],[Severity],[Message],[XmlData] ) values (" +
                                ApplicationKeyParamName + "," + ZoneParamName + "," + AppContextInstanceParamName + "," +
                                MessageIdParamName + "," + CategoryParamName + "," + SeverityParamName + "," +
                                MessageParamName + "," + XmlDataParamName + ")";

                            cmd.CommandText = sql;

                            cmd.Parameters.AddWithValue(ApplicationKeyParamName, model.ApplicationKey.Truncate(15));
                            cmd.Parameters.AddWithValue(ZoneParamName, model.Zone.Truncate(15));
                            cmd.Parameters.AddWithValue(AppContextInstanceParamName, model.AppContextInstance.Truncate(25));
                            cmd.Parameters.AddWithValue(MessageIdParamName, model.MessageId);
                            cmd.Parameters.AddWithValue(CategoryParamName, model.Category.Truncate(25));
                            cmd.Parameters.AddWithValue(SeverityParamName, model.Severity.Truncate(15));
                            cmd.Parameters.AddWithValue(MessageParamName, model.Message.Truncate(100));
                            string items = GenericSerializer.DbParamFromItem(model.Items);
                            cmd.Parameters.AddWithValue(XmlDataParamName, items);

                            cmd.ExecuteNonQuery();
                        }

                    }
                }
                catch (Exception ex)
                {
                    IEventWriter writer = new EventLogWriter();
                    string m = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                    var props = eXtensibleConfig.GetProperties();
                    props.Add("location","SqlServerEventWriter.line.105");
                    writer.WriteError(m,SeverityType.Critical,"EventWriter",props);
                }

            }

        }

    }
}


text:
typedef float* BRAIN_WEIGHTS;

struct Brain {
	BRAIN_WEIGHTS weights;
	size_t weight_num;
	size_t input_num;
	size_t* layers;
	size_t layer_num;
	size_t max_layer_size;
};

void Brain_calc_weight_num(struct Brain* self);

void Brain_calc_max_layer_size(struct Brain* self);

void Brain_link(struct Brain* self, BRAIN_WEIGHTS weights);

BRAIN_WEIGHTS Brain_clone(const struct Brain* self);

BRAIN_WEIGHTS Brain_mutate(const struct Brain* self, float amount);

char* Brain_compute(const struct Brain* self, const char* input);

BRAIN_WEIGHTS random_weights(struct Brain* template, float range);

size_t Brain_input_num(struct Brain* self);

#endif


text:
#include <stdint.h>

#include <grpc/grpc.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>

#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/util/test_config.h"

static void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }

static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
                                            const char* test_name,
                                            grpc_channel_args* client_args,
                                            grpc_channel_args* server_args) {
  grpc_end2end_test_fixture f;
  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
  f = config.create_fixture(client_args, server_args);
  config.init_server(&f, server_args);
  config.init_client(&f, client_args);
  return f;
}

static gpr_timespec n_seconds_from_now(int n) {
  return grpc_timeout_seconds_to_deadline(n);
}

static gpr_timespec five_seconds_from_now(void) {
  return n_seconds_from_now(5);
}

static void drain_cq(grpc_completion_queue* cq) {
  grpc_event ev;
  do {
    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), nullptr);
  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
}

static void shutdown_server(grpc_end2end_test_fixture* f) {
  if (!f->server) return;
  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
  grpc_event ev;
  do {
    ev = grpc_completion_queue_next(f->cq, grpc_timeout_seconds_to_deadline(5),
                                    nullptr);
  } while (ev.type != GRPC_OP_COMPLETE || ev.tag != tag(1000));
  grpc_server_destroy(f->server);
  f->server = nullptr;
}

static void shutdown_client(grpc_end2end_test_fixture* f) {
  if (!f->client) return;
  grpc_channel_destroy(f->client);
  f->client = nullptr;
}

static void end_test(grpc_end2end_test_fixture* f) {
  shutdown_server(f);
  shutdown_client(f);

  grpc_completion_queue_shutdown(f->cq);
  drain_cq(f->cq);
  grpc_completion_queue_destroy(f->cq);
}

static void empty_batch_body(grpc_end2end_test_config /*config*/,
                             grpc_end2end_test_fixture f) {
  grpc_call* c;
  grpc_core::CqVerifier cqv(f.cq);
  grpc_call_error error;
  grpc_op* op = nullptr;

  gpr_timespec deadline = five_seconds_from_now();
  c = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq,
                               grpc_slice_from_static_string("/foo"), nullptr,
                               deadline, nullptr);
  GPR_ASSERT(c);

  error = grpc_call_start_batch(c, op, 0, tag(1), nullptr);
  GPR_ASSERT(GRPC_CALL_OK == error);
  cqv.Expect(tag(1), true);
  cqv.Verify();

  grpc_call_unref(c);
}

static void test_invoke_empty_body(grpc_end2end_test_config config) {
  grpc_end2end_test_fixture f;

  f = begin_test(config, "test_invoke_empty_body", nullptr, nullptr);
  empty_batch_body(config, f);
  end_test(&f);
  config.tear_down_data(&f);
}

void empty_batch(grpc_end2end_test_config config) {
  test_invoke_empty_body(config);
}

void empty_batch_pre_init(void) {}


text:
#include "kitBase/robotModel/robotParts/button.h"

using namespace kitBase::robotModel::robotParts;

Button::Button(const DeviceInfo &info, const PortInfo &port, int code)
	: ScalarSensor(info, port)
	, mCode(code)
{
}

int Button::code() const
{
	return mCode;
}


text:
package com.fluxchess.pulse;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;

import static com.fluxchess.pulse.Color.BLACK;
import static com.fluxchess.pulse.Color.WHITE;
import static com.fluxchess.pulse.Piece.BLACK_BISHOP;
import static com.fluxchess.pulse.Piece.BLACK_KING;
import static com.fluxchess.pulse.Piece.BLACK_KNIGHT;
import static com.fluxchess.pulse.Piece.BLACK_PAWN;
import static com.fluxchess.pulse.Piece.BLACK_QUEEN;
import static com.fluxchess.pulse.Piece.BLACK_ROOK;
import static com.fluxchess.pulse.Piece.NOPIECE;
import static com.fluxchess.pulse.Piece.WHITE_BISHOP;
import static com.fluxchess.pulse.Piece.WHITE_KING;
import static com.fluxchess.pulse.Piece.WHITE_KNIGHT;
import static com.fluxchess.pulse.Piece.WHITE_PAWN;
import static com.fluxchess.pulse.Piece.WHITE_QUEEN;
import static com.fluxchess.pulse.Piece.WHITE_ROOK;
import static com.fluxchess.pulse.PieceType.BISHOP;
import static com.fluxchess.pulse.PieceType.KING;
import static com.fluxchess.pulse.PieceType.KNIGHT;
import static com.fluxchess.pulse.PieceType.PAWN;
import static com.fluxchess.pulse.PieceType.QUEEN;
import static com.fluxchess.pulse.PieceType.ROOK;
import static com.fluxchess.test.AssertUtil.assertUtilityClassWellDefined;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class PieceTest {

  @Test
  public void testUtilityClass()
      throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
    assertUtilityClassWellDefined(Piece.class);
  }

  @Test
  public void testValues() {
    for (int color : Color.values) {
      for (int piecetype : PieceType.values) {
        int piece = Piece.valueOf(color, piecetype);

        assertThat(Piece.values[piece], is(piece));
      }
    }
  }

  @Test
  public void testIsValid() {
    for (int piece : Piece.values) {
      assertThat(Piece.isValid(piece), is(true));
    }

    assertThat(Piece.isValid(NOPIECE), is(false));
  }

  @Test
  public void testGetType() {
    assertThat(Piece.getType(WHITE_PAWN), is(PAWN));
    assertThat(Piece.getType(BLACK_PAWN), is(PAWN));
    assertThat(Piece.getType(WHITE_KNIGHT), is(KNIGHT));
    assertThat(Piece.getType(BLACK_KNIGHT), is(KNIGHT));
    assertThat(Piece.getType(WHITE_BISHOP), is(BISHOP));
    assertThat(Piece.getType(BLACK_BISHOP), is(BISHOP));
    assertThat(Piece.getType(WHITE_ROOK), is(ROOK));
    assertThat(Piece.getType(BLACK_ROOK), is(ROOK));
    assertThat(Piece.getType(WHITE_QUEEN), is(QUEEN));
    assertThat(Piece.getType(BLACK_QUEEN), is(QUEEN));
    assertThat(Piece.getType(WHITE_KING), is(KING));
    assertThat(Piece.getType(BLACK_KING), is(KING));
  }

  @Test
  public void testGetColor() {
    assertThat(Piece.getColor(WHITE_PAWN), is(WHITE));
    assertThat(Piece.getColor(BLACK_PAWN), is(BLACK));
    assertThat(Piece.getColor(WHITE_KNIGHT), is(WHITE));
    assertThat(Piece.getColor(BLACK_KNIGHT), is(BLACK));
    assertThat(Piece.getColor(WHITE_BISHOP), is(WHITE));
    assertThat(Piece.getColor(BLACK_BISHOP), is(BLACK));
    assertThat(Piece.getColor(WHITE_ROOK), is(WHITE));
    assertThat(Piece.getColor(BLACK_ROOK), is(BLACK));
    assertThat(Piece.getColor(WHITE_QUEEN), is(WHITE));
    assertThat(Piece.getColor(BLACK_QUEEN), is(BLACK));
    assertThat(Piece.getColor(WHITE_KING), is(WHITE));
    assertThat(Piece.getColor(BLACK_KING), is(BLACK));
  }

}


text:
require('js-yaml');
var path = require('path');
var Spec = require(path.join(__dirname, 'spec'));
var expect = require('chai').expect;

function validateListOfCommands(list, structure) {
    list.forEach(function(command) {
        if (typeof command === 'string') {
            // OK.
        } else if (command instanceof Object) {
            expect(command, 'A command hash must include both a `template` and an `at` property.').to.include.keys('template', 'at');

            expect(command.template).to.be.a('string', 'The template portion of a command hash must be a string.');
            expect(command.at).to.be.an('object', 'The at portion of a command hash must be a hash');

            if (command.at.host) {
                expect(structure.hosts).to.be.an('object', 'The host property is not a hash.');
                expect(structure.hosts, 'The host ' + command.at.host + ' does not exist.').to.include.keys([command.at.host]);
            } else if (command.at.group) {
                expect(structure.groups).to.be.an('object');
                expect(structure.groups, 'The group ' + command.at.group + ' does not exist.').to.include.keys([command.at.group]);
            } else {
                throw new Error('Command\'s at group has neither a host nor a group.');
            }
        } else {
            throw new Error('Invalid command ');
        }
    });
}

function validateCommandLists(obj, structure) {
    ['before','commands','after','error'].forEach(function(section) {
        if (obj[section]) {
            expect(obj[section]).to.be.an('array', 'The section ' + section + ' is not an array.');
            validateListOfCommands(obj[section], structure);
        }
    });
}

function validate(structure, callback) {
    try {
        expect(structure).to.be.an('object', 'The spec file did not yield a hash.');

        validateCommandLists(structure.default, structure);

        if (structure.groups) {
            expect(structure.groups).to.be.an('object', 'The groups property of the spec is not a hash.');

            Object.keys(structure.groups).forEach(function(groupId) {
                var group = structure.groups[groupId];

                expect(group).to.be.an('object', 'The group ' + groupId + ' is not a hash.');
                validateCommandLists(structure.groups[groupId], structure);

                group.hosts = [];
            });
        } else {
            structure.groups = [];
        }

        expect(structure.hosts).to.be.an('object', 'The hosts property of the spec is not a hash.');
        var hostnames = [];

        Object.keys(structure.hosts).forEach(function(hostId) {
            var host = structure.hosts[hostId];

            expect(host).to.be.an('object', 'The host ' + hostId + ' is not a hash.');

            expect(host, 'The host ' + host + ' does not include a hostname entry.').to.include.keys(['hostname']);
            expect(hostnames, 'The hostname ' + host.hostname + ' is used by more than one host.').to.not.include(host.hostname);

            if (host.groups) {
                expect(host.groups).to.be.an('array', 'The groups property of the host ' + hostId + ' is not a array.');

                host.groups.forEach(function(group) {
                    expect(group).to.be.a('string', 'The group ' + group + ' of the host ' + hostId + ' is not a string.');
                    expect(structure.groups).to.be.an('object', 'The `groups` property of the spec is not a hash.');
                    expect(structure.groups, 'The group ' + group + ' does not exist.').to.include.keys(group);

                    structure.groups[group].hosts.push(host.hostname);
                });
            }

            hostnames.push(host.hostname);
            validateCommandLists(host, structure);
        });

    } catch (err) {
        return callback(err);
    }

    callback(null, new Spec(structure));
}

function parse(path, callback) {
    try {
        var structure = require(path);
    } catch (err) {
        return callback(err);
    }

    validate(structure, callback);
}

module.exports.parse = parse;


text:
package uk.gov.hmrc.ct.accounts.frs102.boxes

import uk.gov.hmrc.ct.accounts.frs102.retriever.Frs102AccountsBoxRetriever
import uk.gov.hmrc.ct.box._
import uk.gov.hmrc.ct.box.retriever.FilingAttributesBoxValueRetriever

case class AC8084(value: Option[Boolean]) extends CtBoxIdentifier(name = "The members have agreed to the preparation of abridged accounts for this accounting period in accordance with Section 444(2A).")
  with CtOptionalBoolean
  with Input
  with ValidatableBox[Frs102AccountsBoxRetriever with FilingAttributesBoxValueRetriever]
  with Validators {

  override def validate(boxRetriever: Frs102AccountsBoxRetriever with FilingAttributesBoxValueRetriever): Set[CtValidation] = {
    collectErrors(
      failIf(boxRetriever.abridgedFiling().value)(validateAsMandatory(this))
    )
  }

}


text:
//
//  XMGNewViewController.m
//  BuDeJie
//
//  Created by xiaomage on 16/3/11.
//  Copyright © 2016年 小码哥. All rights reserved.
//

#import "XMGNewViewController.h"

@interface XMGNewViewController ()

@end

@implementation XMGNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor brownColor];

    [self setupNavBar];
}

#pragma mark - 设置导航条
- (void)setupNavBar
{

    // 左边按钮
    // 把UIButton包装成UIBarButtonItem.就导致按钮点击区域扩大
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithimage:[UIImage imageNamed:@"MainTagSubIcon"] highImage:[UIImage imageNamed:@"MainTagSubIconClick"] target:self action:@selector(tagClick)];

    // titleView
    self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MainTitle"]];

}

#pragma mark - 点击订阅标签调用
- (void)tagClick
{

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
namespace tab_ranker {

// The following two functions are used in multiple tests to make sure the
// conversion, logging and inferencing use the same group of features.
// Returns a default tab features with some field unset.
TabFeatures GetPartialTabFeaturesForTesting() {
  TabFeatures tab;

  tab.has_before_unload_handler = true;
  tab.has_form_entry = true;
  tab.is_pinned = true;
  tab.key_event_count = 121;
  tab.mouse_event_count = 122;
  tab.mru_index = 13;
  tab.navigation_entry_count = 124;
  tab.num_reactivations = 125;
  tab.page_transition_from_address_bar = true;
  tab.page_transition_is_redirect = true;
  tab.time_from_backgrounded = 110000;
  tab.total_tab_count = 130;
  tab.touch_event_count = 128;
  tab.was_recently_audible = true;
  tab.window_is_active = true;
  tab.window_show_state = 3;
  tab.window_tab_count = 127;
  tab.window_type = 4;

  return tab;
}

// Returns a tab features with all field set.
TabFeatures GetFullTabFeaturesForTesting() {
  TabFeatures tab;

  tab.has_before_unload_handler = true;
  tab.has_form_entry = true;
  tab.is_pinned = true;
  tab.key_event_count = 21;
  tab.mouse_event_count = 22;
  tab.mru_index = 27;
  tab.navigation_entry_count = 24;
  tab.num_reactivations = 25;
  tab.page_transition_core_type = 2;
  tab.page_transition_from_address_bar = true;
  tab.page_transition_is_redirect = true;
  tab.site_engagement_score = 26;
  tab.time_from_backgrounded = 10000;
  tab.total_tab_count = 30;
  tab.touch_event_count = 28;
  tab.was_recently_audible = true;
  tab.window_is_active = true;
  tab.window_show_state = 3;
  tab.window_tab_count = 27;
  tab.window_type = 4;

  tab.host = "www.google.com";
  tab.frecency_score = 0.1234f;
  return tab;
}

}  // namespace tab_ranker


text:
import * as Q from 'q';
import * as dbModels from '../db-models/models';
import { MongoModel } from '../classes/MongoModel';
import { Error } from '../interface/Error'
import { returnServerError } from '../services/returnServerError'
import { validateObject } from '../services/returnServerError'

export function registerPerson(personData: dbModels.Person) {
  let person: MongoModel = new MongoModel('person');
	let deferred = Q.defer();

	let basePersonData: dbModels.Person = {
    name: personData.name,
    email: personData.email,
    password: personData.password,
    type: personData.type,
    username: personData.username
	};

	//Begin validate
	let validate = validateObject(basePersonData);

	if (!validate.flag) {

		deferred.reject(validate.error);
		return deferred.promise;
	}
	//End validate

	person.findAll({username: basePersonData.username}).then((respPersonData: dbModels.Person) => {
		if(respPersonData.username === basePersonData.username) {
			deferred.reject({
        httpStatus: 401,
        description: 'Username already taken'
		  });
			return deferred.promise;
		}
		person.insertOne(basePersonData).then( (respPersonData: dbModels.Person ) => {
			deferred.resolve(respPersonData);
		}).catch( () => {
			returnServerError(deferred)
		});
	}).catch( () => {
		returnServerError(deferred)
		return deferred.promise;
	});

	return deferred.promise;
}

export function validateUser(personData: any) {
	let person: MongoModel = new MongoModel('person');
	let deferred = Q.defer();

	let basePersonData = {
    username: personData.username,
    password: personData.password
	};

	//Begin validate
	let validate = validateObject(basePersonData);

	if (!validate.flag) {

		deferred.reject(validate.error);
		return deferred.promise;
	}
	//End validate

	person.findOne({
		username: personData.username
	}).then((resp: dbModels.Person) => {
		if(basePersonData.password === resp.password){
			deferred.resolve(resp);
		}
	}).catch((err) => {
		returnServerError(deferred)
		return deferred.promise;
	});

	return deferred.promise;
}


text:
{-# LANGUAGE DataKinds         #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators     #-}
----------------------------------------------------------------------------
-- |
-- Module      :  Web.Skroutz.Endoints.Model.Product
-- Copyright   :  (c) 2016 Remous-Aris Koutsiamanis
-- License     :  Apache License 2.0
-- Maintainer  :  Remous-Aris Koutsiamanis <ariskou@gmail.com>
-- Stability   :  alpha
-- Portability :  non-portable
--
-- Provides the Skroutz API endpoints/methods for 'Product' retrieval.
----------------------------------------------------------------------------
module Web.Skroutz.Endpoints.Model.Product
where

import           Data.Proxy                         (Proxy (..))
import           Data.Text                          (Text)
import           Servant.API
import           Servant.Client
import           Web.Skroutz.Endpoints.Model.Common
import           Web.Skroutz.Model

type ProductAPI =
        "products" :> Capture "product_id" Int :> DataAPIMethod SingleProductResponse
  :<|>  "shops" :> Capture "shop_id" Int :> "products" :>  "search" :> QueryParam "shop_uid" Text :> DataAPIMethodPaged MultipleProductResponse

productAPI :: Proxy ProductAPI
productAPI = Proxy

getProduct :: Int -> StandardDataParams SingleProductResponse

getShopProducts :: Int -> Maybe Text -> StandardDataParamsPaged MultipleProductResponse

getProduct :<|> getShopProducts = client productAPI


text:
module API
  class AwardEmoji < Grape::API
    before { authenticate! }
    AWARDABLES = [Issue, MergeRequest]

    resource :projects do
      AWARDABLES.each do |awardable_type|
        awardable_string = awardable_type.to_s.underscore.pluralize
        awardable_id_string = "#{awardable_type.to_s.underscore}_id"

        [ ":id/#{awardable_string}/:#{awardable_id_string}/award_emoji",
          ":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji"
        ].each do |endpoint|
          # Get a list of project +awardable+ award emoji
          #
          # Parameters:
          #   id (required)           - The ID of a project
          #   awardable_id (required) - The ID of an issue or MR
          # Example Request:
          #   GET /projects/:id/issues/:awardable_id/award_emoji
          get endpoint do
            if can_read_awardable?
              awards = paginate(awardable.award_emoji)
              present awards, with: Entities::AwardEmoji
            else
              not_found!("Award Emoji")
            end
          end

          # Get a specific award emoji
          #
          # Parameters:
          #   id (required)           - The ID of a project
          #   awardable_id (required) - The ID of an issue or MR
          #   award_id (required)     - The ID of the award
          # Example Request:
          #   GET /projects/:id/issues/:awardable_id/award_emoji/:award_id
          get "#{endpoint}/:award_id" do
            if can_read_awardable?
              present awardable.award_emoji.find(params[:award_id]), with: Entities::AwardEmoji
            else
              not_found!("Award Emoji")
            end
          end

          # Award a new Emoji
          #
          # Parameters:
          #   id (required) - The ID of a project
          #   awardable_id (required) - The ID of an issue or mr
          #   name (required) - The name of a award_emoji (without colons)
          # Example Request:
          #   POST /projects/:id/issues/:awardable_id/award_emoji
          post endpoint do
            required_attributes! [:name]

            not_found!('Award Emoji') unless can_read_awardable? && can_award_awardable?

            award = awardable.create_award_emoji(params[:name], current_user)

            if award.persisted?
              present award, with: Entities::AwardEmoji
            else
              not_found!("Award Emoji #{award.errors.messages}")
            end
          end

          # Delete a +awardables+ award emoji
          #
          # Parameters:
          #   id (required) - The ID of a project
          #   awardable_id (required) - The ID of an issue or MR
          #   award_emoji_id (required) - The ID of an award emoji
          # Example Request:
          #   DELETE /projects/:id/issues/:issue_id/notes/:note_id/award_emoji/:award_id
          delete "#{endpoint}/:award_id" do
            award = awardable.award_emoji.find(params[:award_id])

            unauthorized! unless award.user == current_user || current_user.admin?

            award.destroy
            present award, with: Entities::AwardEmoji
          end
        end
      end
    end

    helpers do
      def can_read_awardable?
        ability = "read_#{awardable.class.to_s.underscore}".to_sym

        can?(current_user, ability, awardable)
      end

      def can_award_awardable?
        awardable.user_can_award?(current_user, params[:name])
      end

      def awardable
        @awardable ||=
          begin
            if params.include?(:note_id)
              noteable.notes.find(params[:note_id])
            else
              noteable
            end
          end
      end

      def noteable
        if params.include?(:issue_id)
          user_project.issues.find(params[:issue_id])
        else
          user_project.merge_requests.find(params[:merge_request_id])
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.donygeorge.simpletweets"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:name=".TwitterApplication"
        android:allowBackup="true"
        android:icon="@mipmap/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name=".activities.LoginActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="@string/intent_host"
                    android:scheme="@string/intent_scheme" />
            </intent-filter>
        </activity>
        <activity android:name=".activities.TimelineActivity">
            <intent-filter>
                <action android:name="android.intent.action.SEND" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>
        <activity android:name=".activities.ProfileActivity" />
        <activity android:name=".activities.FollowActivity" />
        <activity android:name=".activities.SearchActivity"></activity>
    </application>

</manifest>