text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="app_name">Wikipedie</string>
  <string name="app_name_beta">Wikipedie Beta</string>
  <string name="yes">Ano</string>
  <string name="no">Ne</string>
  <string name="acra_report_dialog_title">Wikipedie spadla :(</string>
  <string name="acra_report_dialog_text">Pošlete nám zprávu o pádu</string>
  <string name="acra_report_dialog_comment">Co jste dělali, když došlo k pádu?</string>
  <string name="search_hint">Hledání ve Wikipedii</string>
  <string name="history_activity_title">Historie</string>
  <string name="nav_item_history">Historie</string>
  <string name="error_network_error">Nepořadilo se připojit k síti :(</string>
  <string name="search_network_error">Chyba sítě. Klepnutím to zkusíte znovu.</string>
  <string name="page_error_retry">Zkusit znovu</string>
  <string name="menu_clear_all_history">Vymazat historii</string>
  <string name="menu_clear_all_bookmarks">Vymazat záložky</string>
  <string name="menu_clear_all_saved_pages">Vymazat uložené stránky</string>
  <string name="page_does_not_exist_error">Tato stránka neexistuje.</string>
  <string name="dialog_title_clear_history">Vymazat historii prohlížení?</string>
  <string name="saved_pages_activity_title">Uložené stránky</string>
  <string name="nav_item_saved_pages">Uložené stránky</string>
  <string name="menu_update_all_saved_pages">Aktualizovat uložené stránky</string>
  <string name="menu_update_selected_saved_pages">Aktualizovat uložené stránky</string>
  <string name="dialog_prompt_refresh_all_saved_pages">Aktualizovat všechny uložené stránky?</string>
  <string name="toast_saved_page_refreshed">Uložené stránky aktualizovány</string>
  <string name="menu_save_page">Uložit stránku</string>
  <string name="menu_share_page">Sdílet</string>
  <string name="share_via">Sdílet přes</string>
  <string name="dialog_title_clear_saved_pages">Vymazat všechny uložené stránky?</string>
  <string name="dialog_message_clear_saved_pages">Jste si jisti, že chcete vymazat všechny uložené stránky?</string>
  <string name="toast_saving_page">Ukládání stránky…</string>
  <string name="toast_saved_page">Stránka úspěšně uložena</string>
  <string name="toast_saved_page_missing_images">Nepodařilo se uložit všechny obrázky</string>
  <string name="toast_save_page_failed">Uložení stránky se nezdařilo :(</string>
  <string name="toast_refresh_saved_page">Aktualizace uložené stránky…</string>
  <string name="delete_selected_saved_pages">Vymazat</string>
  <string name="toast_saved_page_deleted">Uložené stránky vymazány</string>
  <string name="saved_pages_search_list_hint">Hledat</string>
  <string name="last_updated_text">Naposledy aktualizováno %1$s</string>
  <string name="content_license_html">Obsah je dostupný pod CC BY-SA 3.0, pokud není uvedeno jinak</string>
  <string name="preference_title_language">Jazyk Wikipedie</string>
  <string name="preference_summary_language">Jazyk obsahu</string>
  <string name="preference_languages_filter_hint">Hledat</string>
  <string name="langlinks_filter_hint">Hledat</string>
  <string name="menu_other_languages">Číst v jiných jazycích</string>
  <string name="langlinks_error_retry">Zkusit znovu</string>
  <string name="langlinks_empty">Tato stránka není k dispozici v jiných jazycích</string>
  <string name="settings_activity_title">Nastavení</string>
  <string name="langlinks_activity_title">Jiné jazyky</string>
  <string name="menu_save_changes">Uložit změny</string>
  <string name="edit_section_error_retry">Zkusit znovu</string>
  <string name="dialog_saving_in_progress">Ukládá se…</string>
  <string name="edit_saved_successfully">Editace uložena!</string>
  <string name="dialog_message_edit_failed">Editace se nezdařila!</string>
  <string name="dialog_message_edit_failed_retry">Zkusit znovu</string>
  <string name="dialog_message_edit_failed_cancel">Storno</string>
  <string name="menu_show_toc">Obsah</string>
  <string name="search_no_results_found">Nebyly nalezeny žádné výsledky</string>
  <string name="edit_section_captcha_message">V zájmu ochrany před automatickým spamováním vás prosíme o opsání slov, která vidíte níže</string>
  <string name="edit_section_captcha_hint">Zopakujte výše uvedená slova</string>
  <string name="title_captcha">Zadejte captcha</string>
  <string name="edit_section_abusefilter_back_text">Změnit mou editaci</string>
  <string name="edit_section_captcha_reload">Klepnutím načtete captcha znovu</string>
  <string name="edit_saved_page_refresh">Tato uložená stránka může být zastaralá a pro umožnění editace je potřeba ji aktualizovat. Chcete stránku aktualizovat?</string>
  <string name="nav_item_login">Přihlásit se</string>
  <string name="login_username_hint">Uživatelské jméno</string>
  <string name="login_password_hint">Heslo</string>
  <string name="login_password_show_check">Zobrazovat heslo</string>
  <string name="menu_login">Přihlásit se</string>
  <string name="login_activity_title">Přihlášení do Wikipedie</string>
  <string name="login_in_progress_dialog_message">Přihlašování…</string>
  <string name="login_error_wrong_password">Nesprávné heslo</string>
  <string name="login_error_wrong_username">Nesprávné uživatelské jméno</string>
  <string name="login_success_toast">Přihlášení uspělo!</string>
  <string name="login_error_blocked">Tento uživatel byl zablokován</string>
  <string name="login_error_throttled">Příliš mnoho pokusů o přihlášení. Počkejte několik minut a zkuste to znovu?</string>
  <string name="login_error_unknown">Přihlášení se nezdařilo :(</string>
  <string name="login_error_no_network">Bez připojení k síti</string>
  <string name="nav_item_logout">Odhlásit se</string>
  <string name="preference_title_logout">Odhlásit se</string>
  <string name="preference_summary_logout">Odhlásit se z uživatelského účtu na Wikipedii</string>
  <string name="preference_summary_notloggedin">Nepřihlášen(a).</string>
  <string name="toast_logout_complete">Odhlášeno</string>
  <string name="saved_pages_empty_message" fuzzy="true">Žádné uložené stránky</string>
  <string name="history_empty_message" fuzzy="true">Vaše historie je prázdná.</string>
  <string name="wp_stylized"><big>W</big>IKIPEDI<big>E</big></string>
  <string name="wp_tag_line">Otevřená encyklopedie</string>
  <string name="skip">Přeskočit</string>
  <string name="create_account_username_hint">Uživatelské jméno</string>
  <string name="create_account_password_hint">Heslo</string>
  <string name="menu_create_account">Vytvořit účet</string>
  <string name="login_create_account_link">Nemáte účet? Přidejte se k Wikipedii</string>
  <string name="create_account_login_link">Účet už máte? Přihlaste se</string>
  <string name="create_account_activity_title">Vytvoření účtu</string>
  <string name="edit_section_activity_title">Editace sekce</string>
  <string name="dialog_create_account_checking_progress">Ověřování</string>
  <string name="create_account_email_hint">E-mail (nepovinný)</string>
  <string name="create_account_password_repeat_hint">Opakovat heslo</string>
  <string name="create_account_passwords_mismatch_error">Hesla se neshodují</string>
  <string name="create_account_email_error">Neplatná e-mailová adresa</string>
  <string name="create_account_username_exists_error">Uživatelské jméno se již používá</string>
  <string name="create_account_ip_throttle_error">Z této IP adresy bylo založeno příliš mnoho účtů. Zkuste to znovu později.</string>
  <string name="create_account_open_proxy_error">Této IP adrese bylo zablokováno vytváření účtů.</string>
  <string name="create_account_generic_error">Nepodařilo se vytvořit uživatelský účet</string>
  <string name="create_account_no_network">Bez připojení k síti</string>
  <string name="create_account_next">Další</string>
  <string name="create_account_button">Vytvořit účet</string>
  <string name="preferences_general_heading">Obecné</string>
  <string name="zero_charged_verbiage">Wikipedia Zero je vypnuto</string>
  <string name="zero_charged_verbiage_extended">Načtením jiných článků mohou být účtovány poplatky za přenos dat.</string>
  <string name="zero_search_hint">Hledání ve Wikipedia Zero</string>
  <string name="zero_warn_when_leaving">Varovat při opuštění Wikipedia Zero</string>
  <string name="zero_warn_when_leaving_summary">Pokud váš mobilní operátor neúčtuje poplatky za datové připojení k Wikipedii v rámci partnerství Wikipedia Zero, ponecháním tohoto políčka zaškrtnutého zajistíte, že se dozvíte o opouštění aplikace a možnosti placení za další datové připojení.</string>
  <string name="zero_webpage_title">FAQ k Wikipedia Zero</string>
  <string name="zero_wikipedia_zero_heading">Wikipedia Zero</string>
  <string name="zero_interstitial_title">Opuštění Wikipedia Zero</string>
  <string name="zero_interstitial_leave_app">Mohou být účtovány poplatky za přenos dat. Pokračovat na externí web?</string>
  <string name="zero_interstitial_continue">Odejít</string>
  <string name="zero_interstitial_cancel">Zůstat zde</string>
  <string name="zero_learn_more">V této aplikaci Wikipedie nejsou účtovány poplatky za přenos dat.</string>
  <string name="zero_learn_more_learn_more">Více informací</string>
  <string name="zero_learn_more_dismiss">Zavřít</string>
  <string name="zero_settings">Nastavení</string>
  <string name="zero_settings_devmode">Vývojářský režim Zero</string>
  <string name="zero_settings_devmode_summary">Toto během vývoje umožňuje provádění kódu věcí kolem Wikipedia Zero.</string>
  <string name="edit_preview_fetching_dialog_message">Načítání náhledu…</string>
  <string name="edit_preview_activity_title">Náhled editace</string>
  <string name="create_account_logging_in">Přihlašování…</string>
  <string name="send_feedback">Poslat názor na aplikaci</string>
  <string name="edit_summary_guide_text">Řekněte nám, jak jste tuto stránku vylepšili. To pomůže ostatním editorům vaši editaci rychle zkontrolovat.</string>
  <string name="edit_summary_hint">Shrnutí editace</string>
  <string name="nav_item_random">Náhodně</string>
  <string name="random_progress">Načítá se náhodná stránka…</string>
  <string name="nav_item_login_benefits">Pokud se přihlásíte, budou vaše editace přiřazeny vašemu uživatelskému jménu a vaše IP adresa nebude veřejně viditelná.</string>
  <string name="create_account_account_created_toast">Účet založen!</string>
  <string name="user_contribs_more_action">Načíst další</string>
  <string name="activity_my_contributions_title">Mé příspěvky</string>
  <string name="nav_item_my_contributions">Mé příspěvky</string>
  <string name="edit_save_action_login">Přihlásit se a uložit</string>
  <string name="edit_save_action_ip">Uložit anonymně</string>
  <string name="edit_save_action_login_description">Vaše editace bude veřejně připsána vašemu uživatelskému jménu a ostatní editoři se s vámi budou moci lépe spojit</string>
  <string name="edit_save_action_ip_description">Vaše editace bude veřejně připsána vaší IP adrese, která se často mění</string>
  <string name="preference_title_eventlogging_opt_in">Odesílat zprávy o využití</string>
  <string name="preference_summary_eventlogging_opt_in">Umožnit nadaci Wikimedia sbírat informace o tom, jak aplikaci používáte, abychom ji mohli zlepšovat</string>
  <string name="editing_error_spamblacklist">Detekovány odkazy na zablokované domény (%s). Odstraňte je prosím a zkuste to znovu.</string>
  <string name="history_search_list_hint">Hledání</string>
  <string name="history_search_empty_message">Nenalezena žádná stránka odpovídající "%s"</string>
  <string name="error_can_not_process_link">Nelze zobrazit tento odkaz</string>
  <string name="page_protected_autoconfirmed">Tato stránka je polozamčena.</string>
  <string name="page_protected_sysop">Tato stránka je zamčena.</string>
  <string name="page_protected_other">Tato stránka je zamčena do následujících úrovní: %s</string>
  <string name="page_protected_can_not_edit">Nemáte oprávnění editovat tuto stránku</string>
  <string name="page_protected_can_not_edit_title">Tato stránka je zamčena</string>
  <string name="more_item_preferences">Další</string>
  <string name="more_activity_title">Další</string>
  <string name="about_description">O aplikaci Wikipedie</string>
  <string name="preference_title_version">Verze</string>
  <string name="about_libraries_heading">použité knihovny</string>
  <string name="about_contributors_heading">přispěvatelé</string>
  <string name="about_translators_heading">překladatelé</string>
  <string name="about_translators_translatewiki">Tuto aplikaci přeložili dobrovolní překladatelé na translatewiki.net.</string>
  <string name="about_wmf">Produkt Wikimedia Foundation</string>
  <string name="about_activity_title">O aplikaci</string>
  <string name="edit_unchanged">Stránka nebyla změněna.</string>
  <string name="edit_abandon_confirm">Stránka byla změněna. Jste si jisti, že chcete odejít bez uložení změn?</string>
  <string name="user_blocked_from_editing_title">Zablokováno</string>
  <string name="user_logged_in_blocked_from_editing">Vašemu uživatelskému účtu byla na této wiki zablokována možnost editovat.</string>
  <string name="user_anon_blocked_from_editing">Vaší IP adrese byla zablokována možnost editovat.</string>
  <string name="edit_how_page_improved">Jak jste stránku vylepšili?</string>
  <string name="edit_next">Další</string>
  <string name="edit_done">Uložit</string>
  <string name="edit_preview">Náhled</string>
  <string name="edit_summary_tag_typo">Opraven překlep</string>
  <string name="edit_summary_tag_grammar">Oprava pravopisu</string>
  <string name="edit_summary_tag_links">Přidány odkazy</string>
  <string name="edit_summary_tag_other">Jinak</string>
  <string name="edit_summary_tag_other_hint">Jiný způsob, jakým jste vylepšili stránku</string>
  <string name="find_in_page">Najít na stránce</string>
  <string name="find_next">Najít další</string>
  <string name="find_previous">Najít předchozí</string>
  <string name="find_close">Zavřít vyhledávací lištu</string>
  <string name="error_network_error_try_again">Nepodařilo se připojit k síti, zkuste to znovu.</string>
  <string name="saved_pages_update_all_error_retry">Zkusit znovu</string>
  <string name="saved_pages_update_all_error_message">Chyba aktualizace uložených stránek</string>
  <string name="saved_pages_progress_title">Aktualizují se uložené stránky</string>
  <string name="saved_pages_refresh_pages_complete">Aktualizace dokončena</string>
  <string name="menu_page_saved">Stránka uložena</string>
  <string name="menu_refresh_saved_page">Obnovit stránku</string>
  <string name="abusefilter_title_warn">Může se jednat o nekonstruktivní editaci. Jste si jisti, že ji chcete uložit?</string>
  <string name="abusefilter_title_disallow">Nemůžete uložit tuto editace. Prosím, vraťte se zpět a změnte jí.</string>
  <string name="menu_themechooser">Změnit písmo a vzhled</string>
  <string name="text_size_select">Velikost písma</string>
  <string name="color_theme_select">Vzhled</string>
  <string name="color_theme_light">Světlý</string>
  <string name="color_theme_dark">Tmavý</string>
  <string name="app_store_description">Oficiální aplikace Wikipedie pro Android. Wikipedie je otevřená encyklopedie obsahující více než 32 milionů článků ve 280 jazycích, je to nejrozsáhlejší a nejšířeji používané referenční dílo, které lidstvo kdy vyrobilo. Aplikace byla přebudována od nuly a je lepší než kdy předtím.

Funkce:
   - Rychlost: Naše nová nativní aplikace vám umožňuje prohlížet si a editovat Wikipedii rychleji než kdy dřív.
   - Editace: Wikipedii můžete editovat! Přihlášeni či nepřihlášeni, děkujeme za všechny vaše příspěvky.
   - Nedávné stránky: Nabízíme historii vaší četby, takže můžete proklikávat libovolným množstvím odkazů, aniž byste se někdy ztratili.
   - Uložené stránky: Můžete si uložit vybrané stránky ke čtení offline a číst si je i bez datového připojení.
   - Sdílení: Sdílejte sumu lidských znalostí pomocí svých existujících aplikací sociálních sítí.
   - Podpora jazyků: Aplikace vám umožňuje snadno přecházet mezi čtením Wikipedie v různých jazycích.
   - Wikipedia Zero: Bezplatné datové připojení od účastnících se mobilních operátorů.

Zcela otevřený zdrojový kód. Pokud máte zkušenosti s Javou a SDK Androidu, můžete forkovat! https://github.com/wikimedia/apps-android-wikipedia</string>
</resources>


text:
package org.callimachusproject.behaviours;

import java.io.IOException;
import java.io.InputStream;

import org.callimachusproject.traits.CalliObject;
import org.callimachusproject.xml.XQueryValidator;
import org.openrdf.OpenRDFException;

public abstract class XQuerySupport implements CalliObject {

	public String[] getXQueryValidationErrors(InputStream queryStream)
			throws IOException, OpenRDFException {
		XQueryValidator validator = new XQueryValidator(this.toString(), this.getHttpClient());
		validator.parse(queryStream);
		return validator.getErrorMessages();
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace AppBundle\Form;

use AppBundle\Entity\SertAction;
use AppBundle\Entity\Sertificate;
use AppBundle\Stuff\CertificateStuff;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\AbstractType;

use Doctrine\ORM\EntityManager;

class CertGroupProcessingType extends AbstractType
{
    /** @var Sertificate[] */
    private $certificates;

    /** @var CertificateStuff */
    private $certificateStuff;

    public function __construct(CertificateStuff $certificateStuff)
    {
        $this->certificateStuff = $certificateStuff;
        //$this->certificates = $certificates;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->setAttribute("action", "sdf.php");

        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event){
            /** @var $certificates Sertificate[] */
            $data = $event->getData();
            $certificates = $data["certificates"];
            $actions = $this->certificateStuff->getAvailableActions($data["state_id"]);

            $event->getForm()->
            add("action", ChoiceType::class, array(
                "label" => "Действие",
                "choices" => $actions,
                "choice_label" => function($action){
                    /** @var $action SertAction */
                    return ($action != null) ? $action->getDisplayName() : "";
                },
                "choice_value" => function($action){
                    /** @var $action SertAction */
                    return ($action != null) ? $action->getActionName() : "";
                }
            ))->
            add("certificates", ChoiceType::class, array(
                "label" => "Сертификаты",
                "expanded" => "true",
                "multiple" => "tue",
                "choices" => $certificates,
                "choice_label" => function($certificate){
                    /** @var $certificate Sertificate */
                    return ($certificate != null) ? $certificate->getName() : "";
                },
                "choice_value" => function($certificate){
                    /** @var $certificate Sertificate */
                    return ($certificate != null) ? $certificate->getIDSertificate() : "";
                }
            ));
        });
    }
}


text:
<?php

namespace Z38\SwissPayment;

use DOMDocument;
use InvalidArgumentException;

/**
 * ISRParticipant holds an ISR participation number
 */
class ISRParticipant implements AccountInterface
{
    /**
     * @var string
     */
    protected $number;

    /**
     * Constructor
     *
     * @param string $number
     *
     * @throws \InvalidArgumentException When the participation number is not valid.
     */
    public function __construct($number)
    {
        if (preg_match('/^(0[13])-([0-9]{1,6})-([0-9])$/', $number, $dashMatches)) {
            $this->number = sprintf('%s%06s%s', $dashMatches[1], $dashMatches[2], $dashMatches[3]);
        } elseif (preg_match('/^0[13][0-9]{7}$/', $number)) {
            $this->number = $number;
        } else {
            throw new InvalidArgumentException('ISR participant number is not properly formatted.');
        }
        if (!PostalAccount::validateCheckDigit($this->number)) {
            throw new InvalidArgumentException('ISR participant number has an invalid check digit.');
        }
    }

    /**
     * Format the participant number
     *
     * @return string The formatted participant number
     */
    public function format()
    {
        return sprintf('%s-%s-%s', substr($this->number, 0, 2), ltrim(substr($this->number, 2, 6), '0'), substr($this->number, 8));
    }

    /**
     * {@inheritdoc}
     */
    public function asDom(DOMDocument $doc)
    {
        $root = $doc->createElement('Id');
        $other = $doc->createElement('Othr');
        $other->appendChild($doc->createElement('Id', $this->number));
        $root->appendChild($other);

        return $root;
    }
}


text:
package org.jboss.hal.core.mbui.form;

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

import org.jboss.hal.ballroom.LabelBuilder;
import org.jboss.hal.ballroom.form.Form;
import org.jboss.hal.ballroom.form.FormItem;
import org.jboss.hal.ballroom.form.FormValidation;
import org.jboss.hal.ballroom.form.ValidationResult;
import org.jboss.hal.dmr.ModelNode;
import org.jboss.hal.resources.Resources;

import static java.util.stream.Collectors.toList;

public class RequireAtLeastOneAttributeValidation<T extends ModelNode> implements FormValidation<T> {

    private final List<String> requiresAtLeast;
    private final Resources resources;

    public RequireAtLeastOneAttributeValidation(List<String> requiresAtLeast, Resources resources) {
        this.requiresAtLeast = requiresAtLeast;
        this.resources = resources;
    }

    @Override
    public ValidationResult validate(Form<T> form) {
        LabelBuilder labelBuilder = new LabelBuilder();
        List<String> nonEmptyItems = requiresAtLeast.stream()
                .map(form::getFormItem)
                .filter(formItem -> formItem != null && !formItem.isEmpty())
                .map(FormItem::getName)
                .collect(toList());

        if (nonEmptyItems.isEmpty()) {

            // retrieve the label item, instead the attribute name, for the cases when a complex attribute is in use
            List<String> attributesLabels = new ArrayList<>();
            requiresAtLeast.forEach(requiredAttribute -> {
                FormItem<Object> formItem = form.getFormItem(requiredAttribute);
                attributesLabels.add(formItem.getLabel());
            });

            // show an error on each related form item
            requiresAtLeast.forEach(requiredAttribute -> {
                FormItem<Object> formItem = form.getFormItem(requiredAttribute);
                if (formItem.isEmpty()) {
                    formItem.showError(resources.messages().exactlyOneAlternativeError(
                            labelBuilder.enumeration(attributesLabels, resources.constants().or())));
                }
            });
            // return overall result
            return ValidationResult.invalid(
                    resources.messages()
                            .atLeastOneIsRequired(
                                    labelBuilder.enumeration(attributesLabels, resources.constants().or())));
        } else {
            return ValidationResult.OK;
        }
    }
}


text:
import * as React from 'react'
import { ChatUser } from '../models/user'
import { User } from './user'
import { FlexColumnWrapper } from './generic'
import { lightGrey } from '../colors'
import glamorous from 'glamorous'

const Wrapper = glamorous(FlexColumnWrapper)({
  maxWidth: '250px',
  backgroundColor: lightGrey,
  overflow: 'auto',
})

export const UserList = ({ users }: { users: ChatUser[] }) =>
  <Wrapper>
    {users.map(({ userId, ...user }) => <User key={userId} {...user} />)}
  </Wrapper>


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

namespace Player1
{
    class Player
    {
        List<KeyValuePair<int, string>> playerHand = new List<KeyValuePair<int, string>>();
        public Player(List<KeyValuePair<int, string>> hand)
        {
            playerHand = hand;
        }

        public KeyValuePair<int, string> returnMove()
        {

            KeyValuePair<int, string> move = playerHand[0];
            playerHand.RemoveAt(0);
            return move;
        }

        public List<KeyValuePair<int, string>> returnHand()
        {
            return playerHand;
        }

    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar_wrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/tool_bar"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>


text:
export class ForgotPasswordCredentials {
    constructor(
        public username: String,
        public key: string,
        public newPassword: string,
    ) { }
}


text:
<?php

namespace Google\Cloud\Storage\Tests\Unit;

use Google\Cloud\Storage\Acl;
use Google\Cloud\Storage\Connection\ConnectionInterface;
use Prophecy\Argument;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use Yoast\PHPUnitPolyfills\Polyfills\ExpectException;

/**
 * @group storage
 */
class AclTest extends TestCase
{
    use ExpectException;

    public $connection;

    public function set_up()
    {
        $this->connection = $this->prophesize(ConnectionInterface::class);
    }

    public function testThrowsExceptionWithInvalidType()
    {
        $this->expectException('InvalidArgumentException');

        $acl = new Acl($this->connection->reveal(), 'nope', ['bucket' => 'bucket']);
    }

    public function testDelete()
    {
        $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);

        $this->assertNull($acl->delete('owner'));
    }

    public function testGetAll()
    {
        $accessControls = [
            ['entity' => 'allAuthenticatedUsers']
        ];
        $this->connection->listAcl(Argument::any())->willReturn(['items' => $accessControls]);
        $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);

        $this->assertEquals($accessControls, $acl->get());
    }

    public function testGetWithSpecifiedEntity()
    {
        $accessControl = [
            'entity' => 'allAuthenticatedUsers'
        ];
        $this->connection->getAcl(Argument::any())->willReturn($accessControl);
        $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);

        $this->assertEquals($accessControl, $acl->get(['entity' => 'allAuthenticatedUsers']));
    }

    public function testAdd()
    {
        $accessControl = [
            'entity' => 'allAuthenticatedUsers',
            'role' => 'READER'
        ];
        $this->connection->insertAcl(Argument::any())->willReturn($accessControl);
        $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);

        $this->assertEquals($accessControl, $acl->add('allAuthenticatedUsers', 'READER'));
    }

    public function testUpdate()
    {
        $accessControl = [
            'entity' => 'allAuthenticatedUsers',
            'role' => 'WRITER'
        ];
        $this->connection->patchAcl(Argument::any())->willReturn($accessControl);
        $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);

        $this->assertEquals($accessControl, $acl->update('allAuthenticatedUsers', 'WRITER'));
    }
}


text:
<?php

namespace Google\Service\Iam\Resource;

use Google\Service\Iam\Operation;

/**
 * The "operations" collection of methods.
 * Typical usage is:
 *  <code>
 *   $iamService = new Google\Service\Iam(...);
 *   $operations = $iamService->operations;
 *  </code>
 */
class ProjectsLocationsWorkloadIdentityPoolsOperations extends \Google\Service\Resource
{
  /**
   * Gets the latest state of a long-running operation. Clients can use this
   * method to poll the operation result at intervals as recommended by the API
   * service. (operations.get)
   *
   * @param string $name The name of the operation resource.
   * @param array $optParams Optional parameters.
   * @return Operation
   */
  public function get($name, $optParams = [])
  {
    $params = ['name' => $name];
    $params = array_merge($params, $optParams);
    return $this->call('get', [$params], Operation::class);
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsWorkloadIdentityPoolsOperations::class, 'Google_Service_Iam_Resource_ProjectsLocationsWorkloadIdentityPoolsOperations');


text:
package com.gs.fw.common.mithra.test.domain;
public class TestControlledEntryDatabaseObject extends TestControlledEntryDatabaseObjectAbstract
{
}


text:
module Onebox
  class StatusCheck
    def initialize(url, options = Onebox.options)
      @url = url
      @options = options
      @status = -1
    end

    def ok?
      status > 199 && status < 300
    end

    def status
      check if @status == -1
      @status
    end

    def human_status
      case status
      when 0
        :connection_error
      when 200..299
        :success
      when 400..499
        :client_error
      when 500..599
        :server_error
      else
        :unknown_error
      end
    end

    private

    def check
      res = open(@url, read_timeout: (@options.timeout || Onebox.options.timeout))
      @status = res.status.first.to_i
    rescue OpenURI::HTTPError => e
      @status = e.io.status.first.to_i
    rescue Timeout::Error, Errno::ECONNREFUSED, Net::HTTPError
      @status = 0
    end
  end
end


text:
using UnityEngine;
using System.Collections;

public class ComponnetAccessF : MonoBehaviour {

	public Hoge h{get; set;}

	public void Start()
	{
		h = new Hoge();
		h.oh = Camera.main.gameObject;
	}

	[System.Serializable]
	public class Hoge
	{
		public GameObject oh;
	}
}


text:
import PropTypes from 'prop-types';
import { treemap, hierarchy } from 'd3-hierarchy';

import { flattenHierarchy } from '@potion/util';
import Layout from './Layout';

export default class Pack extends Layout {

  static displayName = 'Tree';

  static propTypes = {
    data: PropTypes.object.isRequired,
    includeRoot: PropTypes.bool,
    sum: PropTypes.func,
    size: PropTypes.arrayOf(PropTypes.number),
    tile: PropTypes.func,
    round: PropTypes.bool,
    padding: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingInner: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingOuter: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingTop: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingBottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
    paddingLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
  };

  static defaultProps = {
    ...Layout.defaultProps,
    includeRoot: true,
    sum: d => d.value,
  };

  getSchema() {
    return {
      layout: treemap,
      layoutProps: [
        'tile',
        'size',
        'round',
        'padding',
        'paddingInner',
        'paddingOuter',
        'paddingTop',
        'paddingRight',
        'paddingBottom',
        'paddingLeft',
      ],
      selectStylesToTween: d => ({
        x0: d.x0,
        y0: d.y0,
        x1: d.x1,
        y1: d.y1,
      }),
    };
  }

  getData() {
    const { data, sum, includeRoot } = this.props;
    return flattenHierarchy(
      this.getLayout()(
        hierarchy(data).sum(sum)
      )
    )
    .slice(includeRoot ? 0 : 1);
  }
}


text:
'use strict';

const _ = require('lodash');
const CONST = require('../constants');
const config = require('../config');
const HttpClient = require('./HttpClient');
const logger = require('../logger');

class ServiceBrokerClient extends HttpClient {
  constructor() {
    super({
      baseUrl: `${config.internal.protocol}://${config.internal.host}`,
      auth: {
        user: config.username,
        pass: config.password
      },
      headers: {
        Accept: 'application/json'
      },
      followRedirect: true,
      rejectUnauthorized: !config.skip_ssl_validation
    });
  }

  startDeploymentBackup(options) {
    logger.info(`-> Starting deployment backup -  name: ${options.deployment_name}`);
    const body = _.omit(options, 'deployment_name');
    return this
      .request({
        method: 'POST',
        url: `/admin/deployments/${options.deployment_name}/backup`,
        auth: {
          user: config.username,
          pass: config.password
        },
        body: body,
        json: true
      }, 202)
      .then(res => res.body);
  }

  getDeploymentBackupStatus(name, token, boshDirectorName) {
    return this
      .request({
        method: 'GET',
        url: `/admin/deployments/${name}/backup/status`,
        auth: {
          user: config.username,
          pass: config.password
        },
        qs: {
          token: token,
          bosh_director: boshDirectorName
        },
        json: true
      }, 200)
      .then(res => res.body);
  }
  getDeploymentRestoreStatus(name, token, boshDirectorName) {
    return this
      .request({
        method: 'GET',
        url: `/admin/deployments/${name}/restore/status`,
        auth: {
          user: config.username,
          pass: config.password
        },
        qs: {
          token: token,
          bosh_director: boshDirectorName
        },
        json: true
      }, 200)
      .then(res => res.body);
  }

  updateServiceInstance(options) {
    logger.info(`-> Updating instance -  name: ${options.instance_id}`);
    const body = _.omit(options, 'instance_id');
    return this
      .request({
        method: 'PATCH',
        url: `/cf/v2/service_instances/${options.instance_id}`,
        auth: {
          user: config.username,
          pass: config.password
        },
        headers: {
          Accept: 'application/json',
          'Content-Type': 'application/json',
          'X-Broker-API-Version': CONST.SF_BROKER_API_VERSION_MIN
        },
        qs: {
          accepts_incomplete: true
        },
        body: body,
        json: true
      }, 202)
      .then(res => res.body);
  }
}

module.exports = new ServiceBrokerClient();


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">

    <link rel="stylesheet" href="fonts/font-awesome/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="css/styles.css">
    <title>Vistas con FlexBox</title>

Ejemplos de CSS3 y HTML5

Ejercicio 1 Flex

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Titulo Articulo

Texto a a la derecha

                                Texto a ocultar

                            Leer Mas

Tabla Responsive Con Flex

Nombre

Apellidos

DNI

F Nacimiento

Email

Telefono

Dirección

Poblacion

C.P.

Maite

Monasterio

DNI

F Nacimiento

Email

Telefono

Dirección

Poblacion

C.P.

Editar

Borrar

Animation

                    <input type="radio" name="slides" id="slides_1"/>
                    <input type="radio" name="slides" checked="checked" id="slides_2"/>
                    <input type="radio" name="slides" id="slides_3"/>
                    <input type="radio" name="slides" id="slides_4"/>
                    <input type="radio" name="slides" id="slides_5"/>
                    <input type="radio" name="slides" id="slides_6"/>

Say hello to CSS3

CSSlider is lightweight & easy to use slider. No JS - pure CSS.

CSS Events

When slide 3 is reached - play CSS animation!

Lots of text

Scrollable one

                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit fusce vel sapien elit in malesuada mi,
                                semper id sollicitudin urna fermentum ut fusce varius nisl ac ipsum gravida vel pretium tellus.

 More examples on github

            RRSS:


text:
module.exports = {
  beforeEach: function(browser) {
    browser
      .url('http://localhost:7890')
      .waitForElementVisible('body', 1000)
      .page.Login().authenticate('admin', 'pwdadmin')
      .page.Sidebar().goToSettings()
      .page.Workers().goToServices();
  },

  'Create services': function(browser) {
    browser
      .pause(100)
      .page.Services().count(1)
      .page.Services().enableEdit()
      .page.Services().save()
      .page.Services().alertContains('At least one service is mandatory')
      .page.Services().set(0, 'shampoo')
      .page.Services().add()
      .page.Services().set(1, 'haircut')
      .page.Services().count(2)
      .page.Services().add()
      .page.Services().set(2, 'color')
      .page.Services().save()
      .end();
  },

  'Update services': function(browser) {
    browser
      .page.Services().count(3)
      .page.Services().enableEdit()
      .page.Services().expected(0, 'shampoo')
      .page.Services().expected(1, 'haircut')
      .page.Services().expected(2, 'color')
      .page.Services().set(0, '')
      .page.Services().remove(2)
      .page.Services().save()

      .page.Services().enableEdit()
      .page.Services().count(1)
      .page.Services().add()
      .page.Services().set(1, 'permanent')
      .page.Services().save()

      .page.Services().count(2)
      .page.Services().expected(0, 'haircut')
      .page.Services().expected(1, 'permanent')
      .end();
  }

};


text:
<!DOCTYPE html>

<TITLE>Manpage of PRINTENV</TITLE>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/main.css" type="text/css">

linux manpages

{"type":"documentation"}

PRINTENV

Section: User Commands (1)
Updated: June 2012
Index
Return to Main Contents

NAME

printenv - print all or part of environment

SYNOPSIS

printenv

[OPTION]... [VARIABLE]...

DESCRIPTION

Print the values of the specified environment VARIABLE(s).
If no VARIABLE is specified, print name and value pairs for them all.

-0, --null

end each output line with 0 byte rather than newline

--help

display this help and exit

--version

output version information and exit

NOTE: your shell may have its own version of printenv, which usually supersedes
the version described here.  Please refer to your shell's documentation
for details about the options it supports.

AUTHOR

Written by David MacKenzie and Richard Mlynarik.

REPORTING BUGS

Report printenv bugs to bug-coreutils@gnu.org

GNU coreutils home page: <http://www.gnu.org/software/coreutils/>

General help using GNU software: <http://www.gnu.org/gethelp/>

Report printenv translation bugs to <http://translationproject.org/team/>

COPYRIGHT

Copyright © 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

SEE ALSO

The full documentation for
printenv

is maintained as a Texinfo manual.  If the
info

and
printenv

programs are properly installed at your site, the command

info coreutils aqprintenv invocationaq

should give you access to the complete manual.

Index

NAME

SYNOPSIS

DESCRIPTION

AUTHOR

REPORTING BUGS

COPYRIGHT

SEE ALSO

This document was created by
man2html,
using the manual pages.

Time: 05:29:09 GMT, December 24, 2015


text:
class Space < ActiveRecord::Base
  validates :name,  :presence => true
  has_many :documents, :dependent => :destroy
  has_many :comments,  :dependent => :destroy
  has_many :versions, :foreign_key => "space_id", :class_name => "Spaceversion"
end


text:
from django.conf.urls import patterns, url
from django.contrib.auth.views import login
from users import views

urlpatterns = patterns('',
    # Auth urls
    url(r'^login/', login, {'template_name': 'users/login.html'}, name='login'),
    url(r'^logout/', 'users.views.logout_view', name='logout_view'),
    url(r'^profile/', 'users.views.profile', name='profile'),
    url(r'^password_change/', 'users.views.password_change_form', name='password_change_form'),
    url(r'^password_change_successful/', 'users.views.password_change_successful', name='password_change_successful'),
    url(r'^register/', 'users.views.register', name='register'),
)


text:
<ot-view>

            <ot-entity-image entity="validationStamp">
                {{validationStamp.name}}
            </ot-entity-image>
            <ot-entity-embedded-decorations decorations="validationStamp.decorations"></ot-entity-embedded-decorations>

                <ot-section-title>Data type</ot-section-title>

                    {{validationStamp.dataType.descriptor.displayName}}
                    <ot-validation-data-type-config value="validationStamp.dataType"></ot-validation-data-type-config>

                    <ot-decorated-chart title="{{ chart.title }}"
                                        chart-options="true"
                                        chart="chart.chart"
                    ></ot-decorated-chart>

            <ot-section-title>History</ot-section-title>

                No validation run has been done yet.

                    Build
                    Run
                    Last status
                    Data
                    Description
                    Creation
                    Source
                    Trigger
                    Run time

                            <ot-range-selector model="selectedValidationRuns" item="validationRun" id="id"></ot-range-selector>

                                {{validationRun.build.name}}

                                #{{validationRun.runOrder}}

                                <ot-validation-run-status status="validationRun.validationRunStatuses[0]"></ot-validation-run-status>

                                <ot-validation-run-data value="validationRun.data"></ot-validation-run-data>

                            <ot-signature value="{time: validationRun.creation.time, user: {name: validationRun.creation.user}}" user="true" time="true"></ot-signature>

                               {{validationRun.runInfo.sourceType}}

                               {{validationRun.runInfo.triggerType}}
                               ->
                               {{validationRun.runInfo.triggerData}}

                                <ot-duration duration="validationRun.runInfo.runTime"></ot-duration>

                                Less than 1 second

                        <button class="btn btn-link" ng-show="validationStamp.validationRunsPaginated.pageInfo.previousPage" ng-click="switchPage(validationStamp.validationRunsPaginated.pageInfo.previousPage)">

                            Newer ones
                        </button>

                        <button class="btn btn-link" ng-show="validationStamp.validationRunsPaginated.pageInfo.nextPage" ng-click="switchPage(validationStamp.validationRunsPaginated.pageInfo.nextPage)">

                            Older ones
                        </button>

                        <button ng-disabled="!selectedValidationRuns.first || !selectedValidationRuns.second" ng-repeat="action in validationStamp.branch.buildDiffActions" class="btn btn-default"
                                id="{{action.id}}-top"
                                ng-click="validationRunDiff(action)">
                            {{action.name}}
                        </button>

            <ot-section-title>Properties</ot-section-title>

                    <ot-entity-properties entity="{_properties: validationStamp.links._properties}"></ot-entity-properties>

    <ot-entity-events entity="{_events: validationStamp.links._events}"></ot-entity-events>
</ot-view>


text:
static Layer* background;
static TextLayer* hour_text;
static TextLayer* minute_text;
static TextLayer* day_text;
static TextLayer* date_text;
static TextLayer* month_text;
static TextLayer* year_text;
static TextLayer* ampm_text;

typedef struct {
	int dx;
	int mx;
	int yx;
} date_t;

static date_t dateFormats[3] = {
	{ .mx = 2, .dx = 38, .yx = 74},
	{ .dx = 2, .mx = 38, .yx = 74},
	{ .yx = 2, .mx = 74, .dx = 110},
};

// utility function to strip a leading space or zero from a string.
static char* strip(char* input)
{
	if (strlen(input) > 1 && (input[0] == ' ' || input[0] == '0'))
	{
		return input + 1;
	}

	return input;
}

// callback function for rendering the background layer
static void background_update_callback(Layer *me, GContext* ctx)
{
	graphics_context_set_fill_color(ctx, COLOR_FOREGROUND);
	graphics_fill_rect(ctx, GRect(2,8,68,68), 4, GCornersAll);
	graphics_fill_rect(ctx, GRect(74,8,68,68), 4, GCornersAll);
	graphics_fill_rect(ctx, GRect(2,92,140,32), 4, GCornersAll);

		graphics_fill_rect(ctx, GRect(dateFormats[dateStyle].yx,128,68,32), 4, GCornersAll);
		graphics_fill_rect(ctx, GRect(dateFormats[dateStyle].mx,128,32,32), 4, GCornersAll);
		graphics_fill_rect(ctx, GRect(dateFormats[dateStyle].dx,128,32,32), 4, GCornersAll);

	graphics_context_set_stroke_color(ctx, COLOR_BACKGROUND);
	graphics_draw_line(ctx, GPoint(2,41), GPoint(142,41));
	graphics_draw_line(ctx, GPoint(2,108), GPoint(142,108));
	graphics_draw_line(ctx, GPoint(2,144), GPoint(142,144));
}

// set update the time and date text layers
static void display_time(struct tm *tick_time)
{
	time_t now;
	if (tick_time == NULL) {
		now = time(NULL);
		tick_time = localtime(&now);
	}

	static char hour[]   = "12";
	static char minute[] = "21";
	static char day[]    = "            ";
	static char date[]   = "  ";
	static char month[]  = "  ";
	static char year[]   = "    ";
	static char ampm[]   = "  ";

	if (clock_is_24h_style())
	{
		strftime(hour, sizeof(hour), "%H", tick_time);
	}
	else
	{
		strftime(hour, sizeof(hour), "%l", tick_time);
	}

	strftime(minute, sizeof(minute), "%M", tick_time);
	strftime(day, sizeof(day), "%A", tick_time);
	strftime(date, sizeof(date), "%e", tick_time);
	strftime(month, sizeof(month), "%m", tick_time);
	strftime(year, sizeof(year), "%Y", tick_time);

	if (!clock_is_24h_style())
	{
		strftime(ampm, sizeof(ampm), "%p", tick_time);
	}

	text_layer_set_text(hour_text, strip(hour));
	text_layer_set_text(minute_text, minute);
	text_layer_set_text(day_text, day);
	text_layer_set_text(date_text, strip(date));
	text_layer_set_text(month_text, strip(month));
	text_layer_set_text(year_text, year);
	text_layer_set_text(ampm_text, ampm);
}

// callback function for minute tick events that update the time and date display
static void handle_tick(struct tm *tick_time, TimeUnits units_changed)
{
	display_time(tick_time);
}

static void update_date_format() {
	GRect rect = layer_get_frame(text_layer_get_layer(date_text));
        rect.origin.x = dateFormats[dateStyle].dx;
        layer_set_frame(text_layer_get_layer(date_text), rect);

	rect = layer_get_frame(text_layer_get_layer(month_text));
        rect.origin.x = dateFormats[dateStyle].mx;
        layer_set_frame(text_layer_get_layer(month_text), rect);

	rect = layer_get_frame(text_layer_get_layer(year_text));
        rect.origin.x = dateFormats[dateStyle].yx;
        layer_set_frame(text_layer_get_layer(year_text), rect);
}

void redraw_retro() {
	text_layer_set_text_color(hour_text, COLOR_BACKGROUND);
	text_layer_set_text_color(minute_text, COLOR_BACKGROUND);
	text_layer_set_text_color(day_text, COLOR_BACKGROUND);
	text_layer_set_text_color(ampm_text, COLOR_BACKGROUND);
	text_layer_set_text_color(date_text, COLOR_BACKGROUND);
	text_layer_set_text_color(month_text, COLOR_BACKGROUND);
	text_layer_set_text_color(year_text, COLOR_BACKGROUND);
	update_date_format();
	display_time(NULL);
}

// utility function for initializing a text layer
static void init_text(TextLayer* textlayer, GFont font)
{
	text_layer_set_text_alignment(textlayer, GTextAlignmentCenter);
	text_layer_set_text_color(textlayer, COLOR_BACKGROUND);
	text_layer_set_background_color(textlayer, GColorClear);
	text_layer_set_font(textlayer, font);
}

static GFont rb46;
static GFont rb22;
static GFont rc10;

// callback function for the app initialization
void load_retro()
{
	background = layer_create(layer_get_frame(rootLayer));
	layer_set_update_proc(background, &background_update_callback);
	layer_add_child(rootLayer, background);

	rb46 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_46));
	rb22 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_22));
	rc10 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_SUBSET_10));

	hour_text = text_layer_create(GRect(2, 8 + 4, 68, 68 - 4));
	init_text(hour_text, rb46);

	minute_text = text_layer_create(GRect(74, 8 + 4, 68, 68 - 4));
	init_text(minute_text, rb46);

	day_text = text_layer_create(GRect(2, 92 + 2, 140, 32 - 2));
	init_text(day_text, rb22);

	ampm_text = text_layer_create(GRect(4, 48, 16, 12));
	init_text(ampm_text, rc10);

		date_text = text_layer_create(GRect(dateFormats[dateStyle].dx, 128 + 2, 32, 32 - 2));
		init_text(date_text, rb22);

		month_text = text_layer_create(GRect(dateFormats[dateStyle].mx, 128 + 2, 32, 32 - 2));
		init_text(month_text, rb22);

		year_text = text_layer_create(GRect(dateFormats[dateStyle].yx, 128 + 2, 68, 32 - 2));
		init_text(year_text, rb22);

	layer_add_child(rootLayer, text_layer_get_layer(hour_text));
	layer_add_child(rootLayer, text_layer_get_layer(minute_text));
	layer_add_child(rootLayer, text_layer_get_layer(day_text));
	layer_add_child(rootLayer, text_layer_get_layer(date_text));
	layer_add_child(rootLayer, text_layer_get_layer(month_text));
	layer_add_child(rootLayer, text_layer_get_layer(year_text));
	layer_add_child(rootLayer, text_layer_get_layer(ampm_text));

	configRedraw();
	display_time(NULL);

	tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
}

void unload_retro()
{
	tick_timer_service_unsubscribe();

	text_layer_destroy(hour_text);
	text_layer_destroy(minute_text);
	text_layer_destroy(day_text);
	text_layer_destroy(ampm_text);
	text_layer_destroy(date_text);
	text_layer_destroy(month_text);
	text_layer_destroy(year_text);

	// TODO: unload custom fonts

	layer_destroy(background);
	fonts_unload_custom_font(rb46);
	fonts_unload_custom_font(rb22);
	fonts_unload_custom_font(rc10);
}


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

using Org.Apache.REEF.Wake.Remote;

namespace Org.Apache.REEF.Network.Naming.Events
{
    /// <summary>
    /// Event representing a lookup, registering, or unregistering of
    /// an identifier with the Name Service.
    /// </summary>
    internal abstract class NamingEvent
    {
        /// <summary>
        /// The link for communication between the NameClient and NameServer
        /// </summary>
        public ILink<NamingEvent> Link { get; set; }
    }
}


text:
@implementation QKFirstHome

@end


text:
package com.lucidastar.hodgepodge.ui.activity.otherfeature.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import android.widget.Toast;

import java.text.SimpleDateFormat;
import java.util.Date;

public class InterceptSMSReceiver extends BroadcastReceiver {
    public static final String TAG = "InterceptReceiver";
    public static final String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";

    public InterceptSMSReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.

        if (ACTION_SMS_RECEIVED.equals(intent.getAction())) {
            Bundle carryContent = intent.getExtras();
            if (carryContent != null) {
                StringBuilder sb = new StringBuilder();

                // 通过pdus获取接收到的所有短信息,获取短信内容
                Object[] pdus = (Object[]) carryContent.get("pdus");
                // 构建短信对象数组
                SmsMessage[] mges = new SmsMessage[pdus.length];
                for (int i = 0, len = pdus.length; i < len; i++) {
                    // 获取单条短信内容,以pdu格式存,并生成短信对象
                    mges[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
                }

                for (SmsMessage mge : mges) {
                    sb.append("短信来自:" ).append(mge.getDisplayOriginatingAddress()).append("\n")
                            .append("短信内容:").append(mge.getMessageBody()).append("\n");

                    Date sendDate = new Date(mge.getTimestampMillis());
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    sb.append("短信发送时间:").append(format.format(sendDate));
                }
                Log.i(TAG,sb.toString()); // 打印日志记录
                Toast.makeText(context,sb.toString(),Toast.LENGTH_LONG).show();
                this.abortBroadcast(); // 不再往下传播
            }
        }

        throw new UnsupportedOperationException("Not yet implemented");
    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>get_acl (AppControllerClient)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

# File lib/app_controller_client.rb, line 129
  def get_acl(job_data)
    result = ""
    make_call(NO_TIMEOUT, false) {
      result = conn.neptune_get_acl(job_data, @secret)
    }
    abort(result) if result =~ /Error:/
    return result
  end


text:
"""
Convention:
 - Do not include any `_TYPE` suffix
 - Types used in public hooks (as those in the `LightningModule` and `Callback`) should be public (no trailing `_`)
"""
from numbers import Number
from pathlib import Path
from typing import Any, Dict, Iterator, List, Mapping, Sequence, Type, Union

import torch
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
from torch.utils.data import DataLoader
from torchmetrics import Metric

_METRIC = Union[Metric, torch.Tensor, Number]
_METRIC_COLLECTION = Union[_METRIC, Mapping[str, _METRIC]]
STEP_OUTPUT = Union[torch.Tensor, Dict[str, Any]]
EPOCH_OUTPUT = List[STEP_OUTPUT]
_EVALUATE_OUTPUT = List[Dict[str, float]]  # 1 dict per DataLoader
_PREDICT_OUTPUT = Union[List[Any], List[List[Any]]]
_PARAMETERS = Iterator[torch.nn.Parameter]
_PATH = Union[str, Path]
TRAIN_DATALOADERS = Union[
    DataLoader,
    Sequence[DataLoader],
    Sequence[Sequence[DataLoader]],
    Sequence[Dict[str, DataLoader]],
    Dict[str, DataLoader],
    Dict[str, Dict[str, DataLoader]],
    Dict[str, Sequence[DataLoader]],
]
EVAL_DATALOADERS = Union[DataLoader, Sequence[DataLoader]]
LRSchedulerTypeTuple = (_LRScheduler, ReduceLROnPlateau)
LRSchedulerType = Union[Type[_LRScheduler], Type[ReduceLROnPlateau]]


text:
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

    <changeSet id="2013091001" author="Maxim Valyanskiy">
        <sql>
            CREATE INDEX tags_values_prefix_idx ON tags_values (value text_pattern_ops);
        </sql>
        <rollback>
            DROP INDEX tags_values_prefix_idx;
        </rollback>
    </changeSet>

</databaseChangeLog>


text:
#ifndef itkDiscreteMinimumCurvatureQuadEdgeMeshFilter_h
#define itkDiscreteMinimumCurvatureQuadEdgeMeshFilter_h

#include "itkDiscretePrincipalCurvaturesQuadEdgeMeshFilter.h"

namespace itk
{
/**
 * \class DiscreteMinimumCurvatureQuadEdgeMeshFilter
 *
 * \brief FIXME    add documentation here
 *
 * \ingroup ITKQuadEdgeMeshFiltering
 */
template< typename TInputMesh, typename TOutputMesh=TInputMesh >
class DiscreteMinimumCurvatureQuadEdgeMeshFilter:
  public DiscretePrincipalCurvaturesQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
{
public:
  typedef DiscreteMinimumCurvatureQuadEdgeMeshFilter  Self;
  typedef SmartPointer< Self >                        Pointer;
  typedef SmartPointer< const Self >                  ConstPointer;
  typedef DiscretePrincipalCurvaturesQuadEdgeMeshFilter<
    TInputMesh, TOutputMesh >                         Superclass;

  typedef typename Superclass::InputMeshType    InputMeshType;
  typedef typename Superclass::InputMeshPointer InputMeshPointer;

  typedef typename Superclass::OutputMeshType                OutputMeshType;
  typedef typename Superclass::OutputMeshPointer             OutputMeshPointer;
  typedef typename Superclass::OutputPointsContainerPointer  OutputPointsContainerPointer;
  typedef typename Superclass::OutputPointsContainerIterator OutputPointsContainerIterator;
  typedef typename Superclass::OutputPointType               OutputPointType;
  typedef typename Superclass::OutputVectorType              OutputVectorType;
  typedef typename Superclass::OutputCoordType               OutputCoordType;
  typedef typename Superclass::OutputPointIdentifier         OutputPointIdentifier;
  typedef typename Superclass::OutputCellIdentifier          OutputCellIdentifier;
  typedef typename Superclass::OutputQEType                  OutputQEType;
  typedef typename Superclass::OutputMeshTraits              OutputMeshTraits;
  typedef typename Superclass::OutputCurvatureType           OutputCurvatureType;

  typedef typename Superclass::TriangleType TriangleType;

  /** Run-time type information (and related methods).   */
  itkTypeMacro(DiscreteMinimumCurvatureQuadEdgeMeshFilter, DiscretePrincipalCurvaturesQuadEdgeMeshFilter);

  /** New macro for creation of through a Smart Pointer   */
  itkNewMacro(Self);

#ifdef ITK_USE_CONCEPT_CHECKING
  // Begin concept checking
  itkConceptMacro( OutputIsFloatingPointCheck,
                   ( Concept::IsFloatingPoint< OutputCurvatureType > ) );
  // End concept checking
#endif

protected:
  DiscreteMinimumCurvatureQuadEdgeMeshFilter() {}
  ~DiscreteMinimumCurvatureQuadEdgeMeshFilter() {}

  virtual OutputCurvatureType EstimateCurvature(const OutputPointType & iP) ITK_OVERRIDE
  {
    this->ComputeMeanAndGaussianCurvatures(iP);
    return this->m_Mean - std::sqrt( this->ComputeDelta() );
  }

private:
  DiscreteMinimumCurvatureQuadEdgeMeshFilter(const Self &) ITK_DELETE_FUNCTION;
  void operator=(const Self &) ITK_DELETE_FUNCTION;
};
}

#endif


text:
<?php

namespace Afosto\ActiveAnts;

class Model {

    /**
     * Return a new model
     * @return \static
     */
    public static function model() {
        return new static();
    }

    /**
     * The query response
     * @var array
     */
    protected $result;

    /**
     * The result message
     * @var string
     */
    protected $message;

    /**
     * The model's primary key
     * Null when model has no search function, this way we will skipp the
     * isNewRecord check, which is mandatory for some models
     * @var boolean
     */
    protected $primaryKey = null;

    /**
     * The action called for searching
     */
    protected $findAction = 'search';

    /**
     * The request type
     * @var string
     */
    protected $findMethod = 'POST';

    /**
     * Set the models attributes
     * @param array $attributes
     */
    public function setAttributes($attributes) {
        if (is_array($attributes)) {
            foreach ($attributes as $key => $value) {
                $this->$key = $value;
            }
        }
    }

    /**
     * Returns true when product exists at ActiveAnts
     * @param array $modelName
     * @return boolean
     */
    public function isNewRecord() {
        if (!is_null($this->primaryKey)) {
            $response = App::getInstance()->client->request($this->_getPath() . '/' . $this->findAction, array($this->primaryKey => $this->_getPrimaryKey()));
            return !$response->success;
        }
        return true;
    }

    /**
     * Return all data from api
     * @param string $attributes
     * @return array
     */
    public function findAll($attributes = array()) {
        $results = $this->getData($attributes);
        $data = array();
        foreach ($results as $result) {
            $name = get_called_class();
            $object = new $name;
            foreach ($result as $key => $value) {
                $object->$key = $value;
            }
            $data[] = $object;
        }
        return $data;
    }

    /**
     * Find by the primary key
     * @param string $pk
     * @return array
     */
    public function findByPk($pk) {
        $response = App::getInstance()->client->request($this->_getPath() . '/' . $this->findAction, array($this->primaryKey => $pk), $this->findMethod);
        $result = $response->result;
        if (count($result) == 1) {
            $name = get_called_class();
            $object = new $name;
            foreach ($result[0] as $key => $value) {
                //Fix the fact that for shipment data (only use case) properties
                //are camelcase (as expected) but for all the other models aren't
                $key = strtoupper(substr($key, 0,1)) . substr($key, 1);
                $object->$key = $value;
            }
            return $object;
        }
    }

    /**
     * Return the data from the api
     * @param array $attributes
     * @return array
     */
    protected function getData($attributes = array()) {
        $response = App::getInstance()->client->request($this->_getPath() . '/' . $this->findAction, $attributes, $this->findMethod);
        if (!$response->success) {
            return array();
        }
        $result = $response->result;
        if (count($result) == 1) {
            return array($result);
        }
        return $result;
    }

    /**
     * Save the model
     * @param string $modelName
     * @return boolean
     */
    public function save() {
        if ($this->isNewRecord()) {
            $response = App::getInstance()->client->request($this->_getPath() . '/add', (array) json_decode(json_encode($this)));
        } else {
            $response = App::getInstance()->client->request($this->_getPath() . '/edit', (array) json_decode(json_encode($this)));
        }
        $this->message = $response->message;
        $this->result = $response->result;
        return $response->success;
    }

    /**
     * Returns the response for the query
     * @return array
     */
    public function getResult() {
        return $this->result;
    }

    /**
     * Returns the message string
     * @return string
     */
    public function getMessage() {
        return $this->message;
    }

    /**
     * Return the contents of the search key
     * @return string
     */
    private function _getPrimaryKey() {
        $key = $this->primaryKey;
        return $this->$key;
    }

    /**
     * Return the models path
     * @return string
     */
    private function _getPath() {
        $classPath = explode("\\", get_called_class());
        return strtolower(end($classPath));
    }

}


text:
class VEditorScrollControl : public GuiScrollCtrl
{
    typedef GuiScrollCtrl Parent;

public:

    // Mouse.

    virtual void    onMouseUp( const GuiEvent &pEvent );
    virtual void    onRightMouseUp( const GuiEvent &pEvent );

    void            onMouseEvent( const char *pEventName, const GuiEvent &pEvent );

    // Rendering.

    void            onRender( Point2I pOffset, const RectI &pUpdateRect );

    // Console Declaration.

    DECLARE_CONOBJECT( VEditorScrollControl );
};

//-----------------------------------------------------------------------------

#endif // _VT_VEDITORSCROLLCONTROL_H_


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;

namespace SistemaMundoAnimal.Source.IO.Exportar {
    public static class ExportarDataGrid {

        private static readonly string HTMLHeader = @"<!doctype HTML><meta charset='iso-8859-1'><title>{0}</title>";
        private static readonly string HTMLBody = @"{0}";
        private static readonly string HTMLTable = @"
{0}
";
        private static readonly string HTMLTableRow = @"
{0}
";
        private static readonly string HTMLTableHeader = @"{0}	";
        private static readonly string HTMLTableCell = @"{0}	";
        private static readonly string HTMLEnd = @"";

        ///
        /// Exporta um DataGridView para uma planilha no excel.
        ///
        /// <param name="grid">Um DataGridView</param>
        public static void ParaExcel(DataGridView grid) {
            Excel.Application App; // Aplicação Excel
            Excel.Workbook WorkBook; // Pasta
            Excel.Worksheet WorkSheet; // Planilha
            object misValue = System.Reflection.Missing.Value;

            App = new Excel.Application();
            WorkBook = App.Workbooks.Add(misValue);
            WorkSheet = (WorkBook.Worksheets.get_Item(1) as Excel.Worksheet);

            for (int i = 0; i < grid.RowCount; i += 1) {
                for (int j = 0; j < grid.ColumnCount; j += 1) {
                    DataGridViewCell cell = grid[j, i];
                    WorkSheet.Cells[i + 1, j + 1] = cell.Value;
                }
            }

            using (var salvar = new SaveFileDialog()) {
                salvar.Title = "Exportar para Excel";
                salvar.Filter = "Arquivo do Excel *.xls | *.xls";
                if (salvar.ShowDialog() == DialogResult.OK) {
                    WorkBook.SaveAs(salvar.FileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue,
                        Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
                }
            }

            WorkBook.Close(true, misValue, misValue);
            App.Quit();
        }

        ///
        /// Exporta um DataGridView para o formato CSV, comma separated values, que pode ser aberto em editores
        /// de planilhas, como o excel ou open office.
        ///
        /// <param name="grid">Um DataGridView com informações de uma pesquisa.</param>
        public static void ParaCsv(DataGridView grid) {
            var salvar = new SaveFileDialog();

            salvar.DefaultExt = "csv";
            salvar.Filter = "Comma Separated Values (*.csv)|*.csv";
            salvar.FileName = "Resultado";

            if (salvar.ShowDialog() == DialogResult.OK) {
                using (var sw = new StreamWriter(File.Open(salvar.FileName, FileMode.Create),
                                                                                Encoding.GetEncoding("iso-8859-1"))) {

                    for (int i = 0, len = grid.Columns.Count; i < len; i += 1) {
                        sw.Write(grid.Columns[i].HeaderText);
                        sw.Write((i < len - 1) ? ";" : "");
                    }

                    sw.WriteLine();

                    for (int i = 0, rows = grid.RowCount; i < rows; i += 1) {
                        for (int j = 0, cols = grid.Columns.Count; j < cols; j += 1) {
                            sw.Write(grid[j, i].Value.ToString());
                            sw.Write((j < cols - 1) ? ";" : "");
                        }
                        sw.WriteLine();
                    }

                    sw.Close();
                }
            }
        }

        ///
        /// Exporta o datagrid no formato html.
        ///
        /// <param name="grid"></param>
        /// <param name="titulo"></param>
        public static void ParaHTML(DataGridView grid, string titulo) {
            var salvar = new SaveFileDialog();

            salvar.DefaultExt = "html";
            salvar.Filter = "HTML - Página da Web |*.html";
            salvar.FileName = "Resultado";

            if (salvar.ShowDialog() == DialogResult.OK) {
                using (var sw = new StreamWriter(File.Open(salvar.FileName, FileMode.Create), Encoding.GetEncoding("iso-8859-1"))) {
                    string header = "", table = "", row = "";

                    sw.Write(string.Format(HTMLHeader, titulo));

                    for (int i = 0, len = grid.Columns.Count; i < len; i += 1) {
                        header += string.Format(HTMLTableHeader, grid.Columns[i].HeaderText);
                    }

                    header = string.Format(HTMLTableRow, header);

                    for (int i = 0, rows = grid.RowCount; i < rows; i += 1) {
                        row = "";
                        for (int j = 0, cols = grid.Columns.Count; j < cols; j += 1) {
                            row += string.Format(HTMLTableCell, grid[j, i].Value.ToString());
                        }
                        table += string.Format(HTMLTableRow, row);
                    }

                    table = string.Format(HTMLTable, header + table);

                    sw.Write(string.Format(HTMLBody, table));
                    sw.Write(HTMLEnd);
                }

                Process.Start(salvar.FileName);
            }
        }

    }
}


text:
'''Function with parameter.'''

def happyBirthday(person):
    print("Happy Birthday to you!")
    print("Happy Birthday to you!")
    print("Happy Birthday, dear " + person + ".")
    print("Happy Birthday to you!")

happyBirthday('Emily')
happyBirthday('Andre')


text:
package com.txui.core.utils;

import android.content.Context;

import java.util.ArrayDeque;
import java.util.Queue;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by mykolakoshurenko on 8/12/16.
 */
public class DialogStackHandler {

    private DialogModelHandler mCurrentRunnable;
    private ViewContext mViewContext;
    private Queue<DialogModelHandler> mDialogQueue = new ArrayDeque<>();

    private boolean isDisplaying;

    private Subscriber<? super Runnable> mDialogSubscriber;
    private Observable.OnSubscribe<Runnable> mSubscriberDialog = subscriber -> {
        mDialogSubscriber = subscriber;
    };

    private Subscriber<? super Void> mDismissSubscriber;
    private Observable.OnSubscribe<Void> mDismissDialog = subscriber -> {
        mDismissSubscriber = subscriber;
    };

    public void init(ViewContext viewContext) {

        mViewContext = viewContext;

        Observable<Void> mUserClick = Observable.create(mDismissDialog);
        Observable<Runnable> mDialogStream = Observable.create(mSubscriberDialog);

        Observable.zip(mUserClick, mDialogStream, (click, dialogRun) ->
                dialogRun
        ).subscribe(Runnable::run);
    }

    public void dismiss() {
        mDismissSubscriber.onNext(null);

        isDisplaying = false;
        mCurrentRunnable = null;
        if (!mDialogQueue.isEmpty()) {
            mCurrentRunnable = mDialogQueue.remove();
        }
        displayDialog();
    }

    public void onResume() {
        if (!isDisplaying && mViewContext.onAttach()) {
            displayDialog();
        }
    }

    public void onDestroy() {
        isDisplaying = false;
    }
//    public void onDestroy() {
//        if (isDisplaying) {
//            mDialogQueue.add(mCurrentRunnable);
//            mCurrentRunnable = null;
//        }
//    }

    private void displayDialog() {
        if (mViewContext.onAttach() && null != mCurrentRunnable) {
            mCurrentRunnable.getDialogRunnable().run();
            isDisplaying = true;
        }
    }

    public void show(Runnable runnable) {
        DialogModelHandler dialog = new DialogModelHandler(runnable);
        if (null != mCurrentRunnable) {
            mDialogQueue.add(dialog);
            //throw new RuntimeException("You should call dismiss method first");
        } else {
            mCurrentRunnable = dialog;
            displayDialog();
        }
        mDialogSubscriber.onNext(runnable);
    }

    public interface ViewContext {
        Context getViewContext();

        boolean onAttach();
    }

    private static final class DialogModelHandler {
        private final Runnable mRunnable;

        public DialogModelHandler(Runnable runnable) {
            this.mRunnable = runnable;
        }

        public Runnable getDialogRunnable() {
            return mRunnable;
        }
    }

}


text:
package org.zstack.appliancevm;

import org.zstack.header.network.l3.L3NetworkEO;
import org.zstack.header.vm.VmInstanceEO;
import org.zstack.header.vm.VmNicVO;
import org.zstack.header.vo.ForeignKey;
import org.zstack.header.vo.ForeignKey.ReferenceOption;
import org.zstack.header.vo.Index;
import org.zstack.utils.CollectionUtils;
import org.zstack.utils.function.Function;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;

/**
 */
@Entity
@Table
public class ApplianceVmFirewallRuleVO {
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column
    private long id;

    @Column
    @ForeignKey(parentEntityClass = VmInstanceEO.class, onDeleteAction = ReferenceOption.CASCADE)
    private String applianceVmUuid;

    @Column
    @Index
    @Enumerated(EnumType.STRING)
    private ApplianceVmFirewallProtocol protocol;

    @Column
    @Index
    private int startPort;

    @Column
    @Index
    private int endPort;

    @Column
    @Index
    private String allowCidr;

    @Column
    @Index
    private String sourceIp;

    @Column
    @Index
    private String destIp;

    @Column
    @ForeignKey(parentEntityClass = L3NetworkEO.class, onDeleteAction = ReferenceOption.CASCADE)
    private String l3NetworkUuid;

    @Column
    @Index
    private String identity;

    @Column
    private Timestamp createDate;

    @Column
    private Timestamp lastOpDate;

    @PreUpdate
    private void preUpdate() {
        lastOpDate = null;
    }

    public void makeIdentity() {
        identity = String.format("%s-%s-%s-%s-%s-%s-%s-%s",
                applianceVmUuid, l3NetworkUuid, startPort, endPort, protocol, allowCidr, sourceIp, destIp);
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getL3NetworkUuid() {
        return l3NetworkUuid;
    }

    public void setL3NetworkUuid(String l3NetworkUuid) {
        this.l3NetworkUuid = l3NetworkUuid;
    }

    public long getId() {
        return id;
    }

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

    public String getApplianceVmUuid() {
        return applianceVmUuid;
    }

    public void setApplianceVmUuid(String applianceVmUuid) {
        this.applianceVmUuid = applianceVmUuid;
    }

    public ApplianceVmFirewallProtocol getProtocol() {
        return protocol;
    }

    public void setProtocol(ApplianceVmFirewallProtocol protocol) {
        this.protocol = protocol;
    }

    public int getStartPort() {
        return startPort;
    }

    public void setStartPort(int startPort) {
        if (endPort == 0) {
            endPort = startPort;
        }
        this.startPort = startPort;
    }

    public String getSourceIp() {
        return sourceIp;
    }

    public void setSourceIp(String sourceIp) {
        this.sourceIp = sourceIp;
    }

    public String getDestIp() {
        return destIp;
    }

    public void setDestIp(String destIp) {
        this.destIp = destIp;
    }

    public int getEndPort() {
        return endPort;
    }

    public void setEndPort(int endPort) {
        this.endPort = endPort;
    }

    public String getAllowCidr() {
        return allowCidr;
    }

    public void setAllowCidr(String allowCidr) {
        this.allowCidr = allowCidr;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public Timestamp getLastOpDate() {
        return lastOpDate;
    }

    public void setLastOpDate(Timestamp lastOpDate) {
        this.lastOpDate = lastOpDate;
    }

    public ApplianceVmFirewallRuleTO toRuleTO(Collection<VmNicVO> nics) {
        ApplianceVmFirewallRuleTO to = new ApplianceVmFirewallRuleTO();
        VmNicVO nic = CollectionUtils.find(nics, new Function<VmNicVO, VmNicVO>() {
            @Override
            public VmNicVO call(VmNicVO arg) {
                if (arg.getL3NetworkUuid().equals(l3NetworkUuid)) {
                    return arg;
                }
                return null;
            }
        });
        to.setDestIp(destIp);
        to.setSourceIp(sourceIp);
        to.setAllowCidr(allowCidr);
        to.setEndPort(endPort);
        to.setStartPort(startPort);
        to.setProtocol(protocol.toString());
        to.setNicMac(nic.getMac());
        return to;
    }
}


text:
Cognitive services are APIs that are built by Microsoft teams using deep learning and other techniques.
You can start here: <https://www.microsoft.com/cognitive-services>

Here is an overview of those APIs:

![](cognitiveservices/1.png)

Here is a list of APIs you may want to see in more details for the Hackathon:

[*Text Analytics API*](https://www.microsoft.com/cognitive-services/en-us/text-analytics-api):

Detect sentiment, key phrases, topics, and language from your text.

 ![](cognitiveservices/4.png)

[*Linguistic Analysis API*](https://www.microsoft.com/cognitive-services/en-us/linguistic-analysis-api):

Simplify complex language concepts and parse text with the Linguistic Analysis API.

![](cognitiveservices/2.png)

[*Language Understanding Intelligent Service (LUIS)*](https://www.microsoft.com/cognitive-services/en-us/language-understanding-intelligent-service-luis):

Understand language contextually, so your app communicates with people in the way they speak.

![](cognitiveservices/3.png)

[*Entity Linking Intelligence Service*](https://www.microsoft.com/cognitive-services/en-us/entity-linking-intelligence-service):

Power your app's data links with named entity recognition and disambiguation

![](cognitiveservices/5.png)

You can start for free, or buy on Azure as in this example:

![](cognitiveservices/6.png)

![](cognitiveservices/7.png)

This provides you with API keys:

![](cognitiveservices/8.png)


text:
require_relative 'data_organizer'
require 'contentful/management'
require 'csv'
require 'fileutils'
require 'yaml'
require 'pp'
require 'api_cache'
require 'open-uri'

module Contentful
  module Exporter
    class ParallelExporter

      Encoding.default_external = 'utf-8'

      attr_reader :space, :config, :logger, :data_organizer
      attr_accessor :content_type

      def initialize(settings)
        @config = settings
        @logger = Logger.new(STDOUT)
        @data_organizer = DataOrganizer.new(@config)
        Contentful::Management::Client.new(config.config['access_token'], default_locale: config.config['default_locale'] || 'en-US')
        initialize_space
      end

      def initialize_space
        @space = Contentful::Management::Space.find(config.config['space_id'])
      end

      def export_content_types
        @space.content_types.all.each { |ct| export_content_type(ct) }
      end

      def export_data
        export_content_types
        export_entries
        export_assets
      end

      def test_credentials
        spaces = Contentful::Management::Space.all
        if spaces.is_a? Contentful::Management::Array
          logger.info 'Contentful Management API credentials: OK'
        end
      rescue NoMethodError => _error
        logger.info 'Contentful Management API credentials: INVALID (check README)'
      end

      def export_entries
        @space.entries.all({:limit => 1000}).each do |entry|
          export_entry(entry)
        end
      end

      def export_assets
        create_directory(File.join(@config.assets_dir, 'files'))
        @space.assets.all({:limit => 1000}).each do |asset|
          export_asset(asset)
        end
      end

      def export_asset(asset)
        logger.info "export asset - #{asset.sys[:id]}"

        json_dirname = @config.assets_dir
        num = Dir[json_dirname + '/*'].count
        json_filename = num.to_s + '.json'
        json_filepath = File.join(json_dirname, json_filename)

        create_asset_file(asset)
        create_asset_json_file(json_filepath, asset)
      end

      def create_asset_json_file(filepath, asset)
        asset_params = {
          :id => asset.sys[:id],
          :title => asset.fields[:title],
          :description => asset.fields[:description],
        }
        filename = asset_file_name(asset)
        asset_params[:url] = filename if filename

        File.open(filepath, 'w') do |file|
          file.write(JSON.pretty_generate(asset_params))
        end
      end

      def asset_file_name(asset)
        return nil if !asset.file
        asset.file.properties[:fileName]
      end

      def create_asset_file(asset)
        filename = asset_file_name(asset)
        return if !filename

        dirname = @config.assets_dir
        asset_path = File.join(dirname, 'files', filename)
        open('http:' + asset.fields[:file].properties[:url]) {|f|
          File.open(asset_path, 'wb') do |file|
            file.puts f.read
          end
        }
      end

      private

      def export_content_type(content_type)
        logger.info "export content type - #{content_type.sys[:id]}"
        dirname = @config.collections_dir
        create_directory(dirname)
        ct_path = File.join(dirname, content_type.properties[:name] + '.json')
        ct_file = File.open(ct_path, 'w')
        ct_data = create_content_type(content_type)
        ct_json = JSON.pretty_generate(ct_data)
        ct_file.write(ct_json)
      end

      def create_content_type(content_type)
        return {
          :id => content_type.sys[:id],
          :name => content_type.properties[:name],
          :description => content_type.properties[:properties],
          :displayField => content_type.properties[:displayField],
          :fields => create_content_type_fields(content_type),
        }
      end

      def get_id(params)
        File.basename(params['id'] || params['url'])
      end

      def create_content_type_fields(content_type)
        return content_type.properties[:fields].each_with_object([]) do |field, fields|
          fields << create_field_params(field)
        end
      end

      def export_entry(entry)
        logger.info "export entry - #{entry.sys[:id]}"
        entry_params = {:id => entry.sys[:id]}
        entry_params.merge!(create_entry_parameters(entry))
        content_type_id = entry.sys[:contentType].sys[:id]
        content_type = content_type(content_type_id, @space.sys[:id])

        dirname = File.join(@config.entries_dir, content_type.properties[:name])
        create_directory(dirname)

        num = Dir[dirname + '/*'].count
        filename = num.to_s + '.json'

        entry_path = File.join(dirname, filename)
        entry_file = File.open(entry_path, 'w')
        entry_json = JSON.pretty_generate(entry_params)
        entry_file.write(entry_json)
      end

      def create_entry_parameters(entry)
        entry.fields.each_with_object({}) do |(attr, value), entry_params|
          entry_param = if value.is_a? Contentful::Management::Location
                          {
                            :type => 'Location',
                            :lat => value.properties[:lat],
                            :lng => value.properties[:lon]
                          }
                        elsif value.is_a? Hash
                          parse_attributes_from_hash(value)
                        elsif value.is_a? Array
                          parse_attributes_from_array(value)
                        else
                          value
                        end
          entry_params[attr.to_sym] = entry_param
        end
      end

      def parse_attributes_from_hash(params)
        attrs = {:id => params['sys']['id']}
        type = params['sys']['linkType']
        if type
          case type
          when 'Asset'
            attrs[:type] = 'File'
          else
            attrs[:type] = 'Link'
          end
        end
        attrs
      end

      def parse_attributes_from_array(params)
        params.each_with_object([]) do |attr, array_attributes|
          if attr.is_a? Hash
            array_attributes << parse_attributes_from_hash(attr)
          else
            array_attributes << attr
          end
        end
      end

      def content_type(content_type_id, space_id)
        @content_type = APICache.get("content_type_#{content_type_id}", :period => -5) do
          Contentful::Management::ContentType.find(space_id, content_type_id)
        end
      end

      def create_field_params(field)
        field_params = {
          :id => field.properties[:id],
          :name => field.properties[:name],
          :required => field.properties[:required],
        }
        field_params.merge!(additional_field_params(field))
        validations = field_validations(field)
        field_params[:validations] = validations if validations != []
        return field_params
      end

      def field_validations(field)
        if !field.validations.is_a? Array
          []
        else
          field.validations.each_with_object([]) do |validation, validations|
             type, params = validation.properties.find {|k,v| ![nil, "", false].include?(v) and k != :validations}
             validations << {:type => type, :params => params}
          end
        end
      end

      def additional_field_params(field)
        field_type = field.properties[:type]
        if field_type == 'Link'
          {:link => 'Link', :type => field.properties[:linkType]}
        elsif field_type == 'Array'
          params = {:type => 'Array'}
          params[:link] = field.properties[:items].properties[:type] || 'Link'
          if params[:link] == 'Link'
            params[:link_type] = field.properties[:items].properties[:linkType]
          end
          params
        else
          {:type => field_type}
        end
      end

      def create_directory(path)
        FileUtils.mkdir_p(path) unless File.directory?(path)
      end

    end
  end
end


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

namespace StatTag.Core.Generator
{
    public class TableParameterGenerator : BaseParameterGenerator
    {
        public string CreateParameters(Tag tag)
        {
            var builder = new StringBuilder();
            builder.Append(GetLabelParameter(tag));
            builder.Append(GetRunFrequencyParameter(tag));
            builder.Append(CreateTableParameters(tag));

            return CleanResult(builder.ToString());
        }

        protected void AppendFilter(FilterFormat filter, StringBuilder builder)
        {
            if (filter != null && filter.Enabled)
            {
                if (!string.IsNullOrEmpty(builder.ToString()))
                {
                    builder.AppendFormat(", ");
                }

                builder.AppendFormat("{0}{1}={2}, {0}{3}=\"{4}\", {0}{5}=\"{6}\"", filter.Prefix,
                    Constants.TableParameters.FilterEnabled, filter.Enabled,
                    Constants.TableParameters.FilterType, filter.Type,
                    Constants.TableParameters.FilterValue, filter.Value);
            }
        }

        public string CreateTableParameters(Tag tag)
        {
            var builder = new StringBuilder();

            // If the table format is null, or both filters are disabled we are not going to add anything
            // to the output (just to reduce clutter).
            if (tag.TableFormat != null &&
                (tag.TableFormat.ColumnFilter.Enabled || tag.TableFormat.RowFilter.Enabled))
            {
                AppendFilter(tag.TableFormat.ColumnFilter, builder);
                AppendFilter(tag.TableFormat.RowFilter, builder);
            }

            return CleanResult(builder.ToString());
        }
    }
}


text:
namespace ChefInCSharp
{
    using System;

    public class Program
    {
        public static void Main()
        {
            Console.WriteLine("Testing task 1 and task 2 - first part:");
            TestTask1AndTask2FirstPart();
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey(true);

            Console.WriteLine("\nTesting task 2 - second part:");
            TestTask2SecondPart();
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey(true);

            Console.WriteLine("\nTesting task 3:");
            TestTask3();
        }

        private static void TestTask1AndTask2FirstPart()
        {
            var vegetableFactory = new VegetableFactory();
            var potato = vegetableFactory.GetVegetable(VegetableType.Potato);
            var chef = new Chef();
            var preCookedPotato = chef.PreCook(potato);

            if (preCookedPotato == null)
            {
                throw new Exception("potato cannot be null");
            }

            if (preCookedPotato.IsPeeled && !preCookedPotato.IsRotten)
            {
                chef.Cook(potato);
            }
        }

        private static void TestTask2SecondPart()
        {
            const int MIN_X = 0;
            const int MAX_X = 9;
            const int MIN_Y = 0;
            const int MAX_Y = 9;

            int x = 5;
            int y = 5;

            bool isInRange = (MIN_X <= x) && (x <= MAX_X) && (MIN_Y <= y) && (y <= MAX_Y);

            bool canVisitCell = true;

            if (isInRange && canVisitCell)
            {
                VisitCell();
            }
        }

        private static void TestTask3()
        {
            int[] array = new int[100];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = i;
            }

            int expectedValue = 50;
            bool isValueFound = false;
            for (int i = 0; i < array.Length; i++)
            {
                if (i % 10 == 0)
                {
                    if (array[i] == expectedValue)
                    {
                        isValueFound = true;
                    }
                }

                Console.WriteLine(array[i]);
            }

            if (isValueFound)
            {
                Console.WriteLine("Value Found");
            }
        }

        private static void VisitCell()
        {
            Console.WriteLine("Visiting the cell...");
        }
    }
}


text:
package com.ctao.baselib.lib.explosionfield;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import com.ctao.baselib.utils.BitmapUtils;
import com.ctao.baselib.utils.DisplayUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

/**
 * 感谢 https://github.com/tyrantgit/ExplosionField
 */
public class ExplosionFieldView extends View {

    private List<ExplosionAnimator> mExplosions = new ArrayList<>();
    private int[] mExpandInset = new int[2];

    public ExplosionFieldView(Context context) {
        this(context, null);
    }

    public ExplosionFieldView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ExplosionFieldView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        // 将指定的int值赋给指定数组的每个元素的整数。
        Arrays.fill(mExpandInset, DisplayUtils.converDip2px(32));
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        for (ExplosionAnimator explosion : mExplosions) {
            explosion.draw(canvas);
        }
    }

    /**
     * 扩大爆炸范围
     * @param dx x方向向两边
     * @param dy y方向向上下
     */
    public void expandExplosionBound(int dx, int dy) {
        mExpandInset[0] = dx;
        mExpandInset[1] = dy;
    }

    /**
     * 爆炸
     * @param bitmap 爆炸图片
     * @param bound 爆炸区域
     * @param startDelay 启动爆炸延迟
     * @param duration 爆炸持续时间
     * @param listener 动画结束回调
     */
    public void explode(Bitmap bitmap, Rect bound, long startDelay, long duration, final OnAnimationEndListener listener) {
        final ExplosionAnimator explosion = new ExplosionAnimator(this, bitmap, bound);
        explosion.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                mExplosions.remove(animation);
                if(listener != null){
                    listener.onAnimationEnd();
                }
            }
        });
        explosion.setStartDelay(startDelay); //启动延迟
        explosion.setDuration(duration); //动画持续时间
        mExplosions.add(explosion); //添加到动画集合
        explosion.start(); //启动动画
    }

    /**
     * 爆炸
     * @param view 爆炸view
     * @param isJitterAnima 是否执行抖动动画
     * @param listener 动画结束回调
     */
    public void explode(final View view, boolean isJitterAnima, OnAnimationEndListener listener) {
        Rect r = new Rect();
        view.getGlobalVisibleRect(r); //view
        int[] location = new int[2];
        getLocationOnScreen(location);
        r.offset(-location[0], -location[1]);
        r.inset(-mExpandInset[0], -mExpandInset[1]);
        int startDelay = 100;

        if(isJitterAnima){
            ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f).setDuration(150);
            animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

                Random random = new Random();

                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    view.setTranslationX((random.nextFloat() - 0.5f) * view.getWidth() * 0.05f);
                    view.setTranslationY((random.nextFloat() - 0.5f) * view.getHeight() * 0.05f);

                }
            });
            animator.start();
            view.animate().setDuration(150).setStartDelay(startDelay).scaleX(0f).scaleY(0f).alpha(0f).start();
        }else{
            view.setScaleX(0);
            view.setScaleY(0);
            view.setAlpha(0);
        }

        explode(BitmapUtils.createBitmapFromView(view), r, startDelay, ExplosionAnimator.DEFAULT_DURATION, listener);
    }

    public void clear() {
        mExplosions.clear();
        invalidate();
    }

    public static ExplosionFieldView attach2Window(Activity activity) {
        ViewGroup rootView = (ViewGroup) activity.findViewById(Window.ID_ANDROID_CONTENT);
        ExplosionFieldView explosionField = new ExplosionFieldView(activity.getApplication());
        rootView.addView(explosionField, new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        return explosionField;
    }

    public interface OnAnimationEndListener{
        void onAnimationEnd();
    }
}


text:
@interface MLComment : NSObject
@property (nonatomic, retain) NSString *time;
@property (nonatomic, retain) NSString *mid;
@property (nonatomic, retain) NSString *newsid;
@property (nonatomic, retain) NSString *parent;
@property (nonatomic, retain) NSString *suppor;
@property (nonatomic, retain) NSString *uid;
@property (nonatomic, retain) NSString *level;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *area;
@property (nonatomic, retain) NSString *profile;
@property (nonatomic, retain) NSString *content;
@property (nonatomic, retain) NSArray  *replay;

@property (nonatomic, assign) BOOL isExtension;// content 字数过多,如果为YES,则是用户手工点展开后

@end