text:
/* /////////////////////////////////////////////////////////////////////////
 * includes
 */

#include <libclimate/main/api.h>

#include <libclimate/internal/clasp.clasp.h>

#include <platformstl/system/console_functions.h>

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

/* /////////////////////////////////////////////////////////////////////////
 * helper functions
 */

static
int
libCLImate_get_console_width_()
{
  size_t const r = platformstl_C_get_console_width();

  return (~(size_t)0 == r) ? -1 : (int)r;
}

static
int
libCLImate_show_usage_to_(
  clasp_arguments_t const*  args
, clasp_alias_t const*      aliases
, FILE*                     stm
, int                       verMajor
, int                       verMinor
, int                       verRevision
, int                       buildNumber
, char const*               programName
, char const*               summary
, char const*               copyright
, char const*               description
, char const*               usage
, int                       showBlanksBetweenItems
, void                      (*pfnHeader)(clasp_arguments_t const*, clasp_usageinfo_t const* , clasp_alias_t const* )
, void                      (*pfnBody)(clasp_arguments_t const*, clasp_usageinfo_t const* , clasp_alias_t const* )
)
{
  clasp_usageinfo_t info  = { 0 };

  info.version.major      = verMajor;
  info.version.minor      = verMinor;
  info.version.revision   = verRevision;
  info.version.build      = buildNumber;

  info.toolName           = programName;
  info.summary            = summary;
  info.copyright          = copyright;
  info.description        = description;
  info.usage              = usage;

  info.param              = stm;
  info.width              = libCLImate_get_console_width_();
#ifdef PLATFORMSTL_OS_IS_WINDOWS
  info.assumedTabWidth    = -4;
#else /* ? OS */
  info.assumedTabWidth    = 4;
#endif /* OS */
  info.blanksBetweenItems = showBlanksBetweenItems;

  if(NULL != pfnHeader)
  {
    (*pfnHeader)(args, &info, aliases);
  }
  if(NULL != pfnBody)
  {
    (*pfnBody)(args, &info, aliases);
  }

  return (stdout == stm) ? EXIT_SUCCESS : EXIT_FAILURE;
}

/* /////////////////////////////////////////////////////////////////////////
 * API functions
 */

int
libCLImate_show_usage(
  clasp_arguments_t const*  args
, clasp_alias_t const*      aliases
, FILE*                     stm
, int                       verMajor
, int                       verMinor
, int                       verRevision
, int                       buildNumber
, char const*               programName
, char const*               summary
, char const*               copyright
, char const*               description
, char const*               usage
, int                       showBlanksBetweenItems
)
{
  return libCLImate_show_usage_to_(
    args
  , aliases
  , stm
  , verMajor
  , verMinor
  , verRevision
  , buildNumber
  , programName
  , summary
  , copyright
  , description
  , usage
  , showBlanksBetweenItems
  , clasp_showHeaderByFILE
  , clasp_showBodyByFILE
  );
}

int
libCLImate_show_usage_header(
  clasp_arguments_t const*  args
, clasp_alias_t const*      aliases
, FILE*                     stm
, int                       verMajor
, int                       verMinor
, int                       verRevision
, int                       buildNumber
, char const*               programName
, char const*               summary
, char const*               copyright
, char const*               description
, char const*               usage
, int                       showBlanksBetweenItems
)
{
  return libCLImate_show_usage_to_(
    args
  , aliases
  , stm
  , verMajor
  , verMinor
  , verRevision
  , buildNumber
  , programName
  , summary
  , copyright
  , description
  , usage
  , showBlanksBetweenItems
  , clasp_showHeaderByFILE
  , NULL
  );
}

int
libCLImate_show_usage_body(
  clasp_arguments_t const*  args
, clasp_alias_t const*      aliases
, FILE*                     stm
, int                       verMajor
, int                       verMinor
, int                       verRevision
, int                       buildNumber
, char const*               programName
, char const*               summary
, char const*               copyright
, char const*               description
, char const*               usage
, int                       showBlanksBetweenItems
)
{
  return libCLImate_show_usage_to_(
    args
  , aliases
  , stm
  , verMajor
  , verMinor
  , verRevision
  , buildNumber
  , programName
  , summary
  , copyright
  , description
  , usage
  , showBlanksBetweenItems
  , NULL
  , clasp_showBodyByFILE
  );
}

int
libCLImate_show_version(
  clasp_arguments_t const*  args
, clasp_alias_t const*      aliases
, FILE*                     stm
, int                       verMajor
, int                       verMinor
, int                       verRevision
, int                       buildNumber
, char const*               programName
)
{
  clasp_usageinfo_t info  = { 0 };

  info.version.major      = verMajor;
  info.version.minor      = verMinor;
  info.version.revision   = verRevision;
  info.version.build      = buildNumber;

  info.toolName           = programName;

  info.param              = stm;

  clasp_showVersionByFILE(args, &info, aliases);

  return (stdout == stm) ? EXIT_SUCCESS : EXIT_FAILURE;
}

/* ///////////////////////////// end of file //////////////////////////// */


text:
<metadata xmlns:ns0="http://purl.org/ornl/schema/mercury/terms/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/ornl/schema/mercury/terms/v1.0 mercury-ornl-v1.xsd">
  <idinfo>
    <citation>
      <citeinfo>
        <origin>Schulze, Prof. Dr. Ernst-Detlef</origin>
        <title>Carbon and Nitrogen Cycling in Forest Ecosystems (CANIF)</title>
        <onlink>http://daac.ornl.gov/metadata/bluangel_harvest/RGED/QC/metadata/vegetation_canif.xml</onlink>
        <alt_onlink>http://daac.ornl.gov/metadata/bluangel_harvest/RGED/QC/metadata/vegetation_canif.xml</alt_onlink>
        <onlink>http://www.bgc-jena.mpg.de/bgc-processes/research/Schulze_Euro_CANIF.html</onlink>
        <onlink>http://www.bgc-jena.mpg.de/</onlink>
        <onlink />
      </citeinfo>
    </citation>
    <descript>
      <abstract>CANIF is an investigation of the carbon and nitrogen cycles in coniferous and deciduous forests along a transect of climate and deposition through Europe with emphasis of the biogeochemical cycles and their interaction with biodiversity. CANIF addresses the following questions:

1) What are the processes regulating the carbon and nitrogen cycles of deciduous and coniferous forests in different environments?
2) How do these cycles interact and relate to the function of plants, animals, fungi and microorganisms?

The final report of the CANIF project is available as:
Schulze E-D (ed.).  2000. Carbon and nitrogen cycling in European forest ecosystems, Ecological Studies 142, 500 pp +CD-ROM, Springer: Berlin, Heidelberg, New York.

The data on CD-ROM are free for anyone to use when crediting data products and holders by correct citation.  The data are also available for downloading in Excel or Ascii format at [http://www.bgc-jena.mpg.de/bgc-processes/research/canif_cd/readme.html].

Part 1 of the CANIF database contains figures, figure data, and tables from the book.

Part 2 of the CANIF database contains field data for each site in separate files for each study site. The collected data include data on the tree species, field-layer vegetation, soil organic matter, soil data, soil chemistry data, hydrology as well as climatic conditions and deposition data. The databank covers mainly the years 1993-1998, although information from earlier years is also included when available. The data include primary data from the sites. The availability of data varies between the sites depending on the depth of the study.

Part 3 of the CANIF database contains data on abundance and diversity of soil fauna, soil microfungi, and mycorrhizae.  These data are given in separate files containing lists of species present and abundances of these species. Data are ordered by groups of organisms; each file contains data for several sites.</abstract>
      <supplinf />
    </descript>
    <timeperd>
      <timeinfo>
        <rngdates>
          <begdate>19930101</begdate>
          <enddate>19981231</enddate>
        </rngdates>
      </timeinfo>
    </timeperd>
    <status>
      <progress>Final</progress>
      <update>As appropriate</update>
    </status>
    <spdom>
      <bounding>
        <westbc>-25.1</westbc>
        <eastbc>35</eastbc>
        <northbc>71.3</northbc>
        <southbc>34.9</southbc>
      </bounding>
    </spdom>
    <keywords>
      <theme>
        <themekt>Parameter_Sensor_Source</themekt>
        <themekey>FOREST COMPOSITION/STRUCTURE|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>CARBON|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>NITROGEN|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>MYCORRHIZAE|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>SOIL MICROFUNGI|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>SOIL FAUNA|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>SOIL CHEMISTRY|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>ORGANIC MATTER|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>HYDROPATTERN|TRANSECTS|FIELD INVESTIGATION</themekey>
        <themekey>DEPOSITION|TRANSECTS|FIELD INVESTIGATION</themekey>
      </theme>
      <theme>
        <themekt>Parameter</themekt>
        <themekey>FOREST COMPOSITION/STRUCTURE</themekey>
      </theme>
      <theme>
        <themekt>Source</themekt>
        <themekey>FIELD INVESTIGATION</themekey>
      </theme>
      <theme>
        <themekt>Sensor</themekt>
        <themekey>TRANSECTS</themekey>
      </theme>
      <place>
        <placekt>Place Keywords</placekt>
        <placekey>Europe</placekey>
      </place>
    </keywords>
    <ptcontac>
      <cntinfo>
        <cntperp>
          <cntper>Schulze, Prof. Dr. Ernst-Detlef</cntper>
        </cntperp>
        <cntfax>6.1.10.8 Contact Electronic Mail: INTERNET &gt; dschulze@bgc-jena.mpg.de</cntfax>
      </cntinfo>
    </ptcontac>
  </idinfo>
  <distinfo>
    <distrib>
      <cntinfo>
        <cntperp>
          <cntorg>Max-Planck-Institut f&#252;r Biogeochemie, Jena, Germany</cntorg>
          <cntper>Schulze, Prof. Dr. Ernst-Detlef</cntper>
        </cntperp>
        <cntvoice>+49-3641-643702</cntvoice>
        <cntfax>6.1.10.8 Contact Electronic Mail: INTERNET &gt; dschulze@bgc-jena.mpg.de</cntfax>
        <cntemail>dschulze@bgc-jena.mpg.de</cntemail>
      </cntinfo>
    </distrib>
    <stdorder>
      <digform>
        <digtopt>
          <onlinopt>
            <computer>http://www.bgc-jena.mpg.de/bgc-processes/index.html</computer>
            <accinstr>Public</accinstr>
          </onlinopt>
        </digtopt>
      </digform>
    </stdorder>
    <resdesc>This database should be treated as a publication. For all data, you will find information on who collected this data. The format of the citation should be:

NAME (2000) SUBJECT (e.g. tree biomass data), CD-ROM Database. In: Schulze, E-D (ed). 2000. Carbon and nitrogen cycling in European forest ecosystems. Ecological studies 142. Springer: Berlin, Heidelberg, New York.</resdesc>
  </distinfo>
  <metainfo>
    <metd>20040420 162001</metd>
    <metc>
      <cntinfo>
        <cntorgp>
          <cntper>Curtis, Carroll</cntper>
        </cntorgp>
        <cntperp>
          <cntper>Curtis, Carroll</cntper>
        </cntperp>
        <cntvoice>+1-804-769-2495</cntvoice>
        <cntemail>cncurtis@crosslink.net</cntemail>
      </cntinfo>
    </metc>
    <metstdn>FGDC Content Standard for Digital Geospatial Metadata</metstdn>
  </metainfo>
  <mercury>
    <begdate>19930101</begdate>
    <enddate>19981231</enddate>
    <Site_Information>
      <Site>Europe</Site>
      <Westernmost_Longitude>-25.1</Westernmost_Longitude>
      <Easternmost_Longitude>35</Easternmost_Longitude>
      <Northernmost_Latitude>71.3</Northernmost_Latitude>
      <Southernmost_Latitude>34.9</Southernmost_Latitude>
    </Site_Information>
    <Keywords>Biodiversity</Keywords>
    <Keywords>Biogeochemical cycles</Keywords>
    <Keywords>CANIF</Keywords>
    <Keywords>Carbon cycle</Keywords>
    <Keywords>Climatic conditions</Keywords>
    <Keywords>Coniferous forests</Keywords>
    <Keywords>Deciduous forests</Keywords>
    <Keywords>Deposition</Keywords>
    <Keywords>EOSDIS</Keywords>
    <Keywords>Europe</Keywords>
    <Keywords>Forest ecosystems</Keywords>
    <Keywords>Hydrology</Keywords>
    <Keywords>Mycorrhizae</Keywords>
    <Keywords>Nitrogen cycle</Keywords>
    <Keywords>Soil chemistry data</Keywords>
    <Keywords>Soil fauna</Keywords>
    <Keywords>Soil microfungi</Keywords>
    <Keywords>Soil organic matter</Keywords>
    <Keywords>Soils</Keywords>
    <Keywords>Tree species</Keywords>
    <Keywords>Vegetation</Keywords>
    <Keywords>Vegetation Collections</Keywords>
    <Parameter_Description>
      <Parameter>FOREST COMPOSITION/STRUCTURE</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>TERRESTRIAL HABITAT</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>CARBON</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>VEGETATION</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>NITROGEN</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>VEGETATION</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>MYCORRHIZAE</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>FUNGI</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>SOIL MICROFUNGI</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>FUNGI</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>SOIL FAUNA</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>MICROBIOTA</Term>
      <Topic>BIOSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>SOIL CHEMISTRY</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>SOILS</Term>
      <Topic>LAND SURFACE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>ORGANIC MATTER</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>SOILS</Term>
      <Topic>LAND SURFACE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>HYDROPATTERN</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>SURFACE WATER</Term>
      <Topic>HYDROSPHERE</Topic>
    </Parameter_Description>
    <Parameter_Description>
      <Parameter>DEPOSITION</Parameter>
      <Sensor>TRANSECTS</Sensor>
      <Source>FIELD INVESTIGATION</Source>
      <Term>ATMOSPHERIC CHEMISTRY</Term>
      <Topic>ATMOSPHERE</Topic>
    </Parameter_Description>
    <Project>Research Project of the Terrestrial Ecosystem Research Initiative (TERI)</Project>
    <Project>Environment and Climate Research Programme of the European Commission</Project>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|FOREST COMPOSITION/STRUCTURE</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|CARBON</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|NITROGEN</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|MYCORRHIZAE</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|SOIL MICROFUNGI</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|SOIL FAUNA</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|SOIL CHEMISTRY</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|ORGANIC MATTER</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|HYDROPATTERN</Navpath>
    <Navpath>FIELD INVESTIGATION|TRANSECTS|DEPOSITION</Navpath>
    <Principal_Investigator>
      <Name>Schulze, Prof. Dr. Ernst-Detlef</Name>
      <Email>dschulze@bgc-jena.mpg.de</Email>
    </Principal_Investigator>
    <Data_Set_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/canif_cd/readme.html</URL>
      Overview of Database for the European Forest Transect
      <Link_Note>This overview describes the book [Schulze, E-D (ed), 2000] and provides links to the data on the CD-ROM database.</Link_Note>
    </Data_Set_Link>
    <Data_Set_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/canif_cd/html/part1.html</URL>
      CANIF Figures, Figure Data, and Tables from the Book [Schulze, E-D (ed), 2000]
      <Link_Note>All figures and tables are available as pdf-files, and all figure data are available as ASCII files (separation of columns by tabs).</Link_Note>
    </Data_Set_Link>
    <Data_Set_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/canif_cd/html/part2.html</URL>
      CANIF Field Data For Each Site
      <Link_Note>All field data are available as Excel files and as ASCII files (separation of columns by tabs). The collected data include data on the tree species, field-layer vegetation, soil organic matter, soil data, soil chemistry data, hydrology as well as climatic conditions and deposition data.</Link_Note>
    </Data_Set_Link>
    <Data_Set_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/canif_cd/html/part3.html</URL>
      CANIF Data on Abundance and Diversity of Soil Fauna, Soil Microfungi, and Mycorrhizae
      <Link_Note>All data are available as Excel files and as ASCII files (separation of columns by tabs). The data  files contain lists of species present and abundances of these species.</Link_Note>
    </Data_Set_Link>
    <Documentation_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/Schulze_Euro_CANIF.html</URL>
      CANIF Web Site
      <Text />
    </Documentation_Link>
    <Documentation_Link>
      <URL>http://www.bgc-jena.mpg.de/</URL>
      Max-Planck-Institut f&#252;r Biogeochemie
      <Text />
    </Documentation_Link>
    <Documentation_Link>
      <URL />

    </Documentation_Link>
    <Alternate_Data_Access>
      <Data_Set_Status />
      <Data_Set_Restrictions />
      <Data_Set_Location />
      <Data_Contact_Person>
        <Email />
        <Name />
        <Phone />
        <Data_Center_URL />
      </Data_Contact_Person>
      <Data_Center_URL />
      <Data_Set_Citation />
      <Data_Set_Link>
        <URL />

        <Link_Note />
        <Data_Center_URL />
      </Data_Set_Link>
    </Alternate_Data_Access>
    <OME_Software_Version>Version 4.3.04, Revision Date: 13 April 2004</OME_Software_Version>
    <OME_DTD_Version>metadata24.dtd</OME_DTD_Version>
    <Contact_Person>
      <Email>dschulze@bgc-jena.mpg.de</Email>
      <Name>Schulze, Prof. Dr. Ernst-Detlef</Name>
      <Phone>+49-3641-643702</Phone>
    </Contact_Person>
    <Temporal_Resolution />
    <enddate_blank />
    <File_ID>Created 20011114 181159 by 206.246.119.52</File_ID>
    <Spatial_Reference_Method>Point</Spatial_Reference_Method>
    <Spatial_Extent>2187.64</Spatial_Extent>
    <Search_Text_Link>
      <URL>http://www.bgc-jena.mpg.de/bgc-processes/research/Schulze_Euro_CANIF.html</URL>
      CANIF Web Site
    </Search_Text_Link>
    <Search_Text_Link>
      <URL>http://www.bgc-jena.mpg.de/</URL>
      Max-Planck-Institut f&#252;r Biogeochemie
    </Search_Text_Link>
    <Other_Link>
      <URL />

    </Other_Link>
    <Granule_Details />
    <OGC_URL />
  </mercury>
  <sourceData>database</sourceData>
</metadata>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">

    <string name="button_cancel">Cancelar</string>
    <string name="button_enter_details">Inserir detalhes</string>
    <string name="button_scan_qr">Ler código QR</string>
    <string name="button_save">Salvar</string>
    <string name="button_new_tag">Novo marcador</string>
    <string name="button_settings">Configurações</string>
    <string name="button_all_tags">Todos os marcadores</string>
    <string name="button_no_tags">Sem marcadores</string>
    <string name="button_qr_from_image">Código QR de uma imagem</string>
    <string name="button_accept">Aceitar</string>

    <string name="format_custom_period">%d s</string>

    <string name="hint_label">Marcador</string>
    <string name="hint_secret">Segredo</string>

    <string name="label_hidden">Oculto</string>
    <string name="label_type">Tipo</string>
    <string name="label_secret">Segredo</string>
    <string name="label_period">Período</string>
    <string name="label_digits">Dígitos</string>
    <string name="label_counter">Contador</string>
    <string name="label_issuer">Emissor</string>
    <string name="label_label">Marcador</string>
    <string name="label_algorithm">Algoritmo</string>
    <string name="label_tags">Marcadores</string>
    <string name="label_advanced">Opções avançadas</string>

    <string name="drawer_open">Mostrar marcadores</string>
    <string name="drawer_close">Ocultar marcadores</string>

    <string name="menu_main_about">Sobre</string>
    <string name="menu_main_backup">Backup</string>
    <string name="menu_main_search">Buscar</string>
    <string name="menu_main_settings">Configurações</string>
    <string name="menu_main_sort">Ordenar por</string>
    <string name="menu_sort_none">Desordenado</string>
    <string name="menu_sort_issuer">Emissor</string>
    <string name="menu_sort_label">Marcador</string>
    <string name="menu_sort_last_used">Usado pela última vez</string>
    <string name="menu_sort_most_used">Mais usados</string>
    <string name="menu_popup_edit">Editar</string>
    <string name="menu_popup_change_image">Alterar imagem</string>
    <string name="menu_popup_remove">Remover</string>
    <string name="menu_popup_show_qr_code">Exibir código QR</string>
    <string name="menu_popup_establish_pin">Digite o pin</string>
    <string name="menu_send_keystrokes">Compartilhar como teclas pressionadas</string>

    <string name="button_card_options">Mais opções</string>
    <string name="button_card_options_format">Mais opções para %1$s</string>
    <string name="button_card_copy">Copiar token</string>
    <string name="button_card_copy_format">Copiar token %1$s</string>
    <string name="button_add">Adicionar nova conta</string>
    <string name="button_close_menu">Fechar menu</string>

    <string name="toast_auth_failed">Falha na autenticação. Por favor, tente novamente.</string>
    <string name="toast_auth_failed_fatal">Falha na autenticação, fechando o aplicativo.</string>
    <string name="toast_copied_to_clipboard">Copiado para a área de transferência</string>
    <string name="toast_entry_exists">Esta conta já existe</string>
    <string name="toast_invalid_qr_code">Código QR inválido</string>
    <string name="toast_encryption_key_empty">Chave de criptografia não carregada</string>
    <string name="toast_intent_creation_failed">Código da aplicação inválido</string>
    <string name="toast_intent_creation_succeeded">Código da aplicação adicionado</string>
    <string name="toast_file_load_error">Não foi possível abrir o arquivo</string>
    <string name="toast_qr_error">Não foi possível encontrar/confirmar o código QR</string>
    <string name="toast_qr_checksum_exception">Falha na verificação de checksum ao decodificar código QR</string>
    <string name="toast_qr_format_error">Erro de formatação no código QR</string>
    <string name="toast_qr_unsuported">Código QR não suportado</string>
    <string name="toast_qr_failed_to_generate">Falha ao gerar código QR</string>

    <string name="error_invalid_secret">Código secreto inválido</string>

    <string name="dialog_title_auth">Autenticar</string>
    <string name="dialog_title_manual_entry">Inserir detalhes</string>
    <string name="dialog_title_remove">Remover</string>
    <string name="dialog_title_rename">Renomear</string>
    <string name="dialog_title_counter">Contador</string>
    <string name="dialog_title_used_tokens">Uso de tokens</string>
    <string name="dialog_title_keystore_error">Erro de armazenamento de chaves</string>
    <string name="dialog_title_qr_code">Código QR</string>
    <string name="dialog_title_pin">PIN</string>
    <string name="dialog_title_enter_password">Digite a senha</string>
    <string name="dialog_title_auto_time">Horário automático</string>
    <string name="dialog_label_enter_password">Digite a senha</string>
    <string name="dialog_label_confirm_password">Confirme a senha</string>
    <string name="dialog_msg_auth">Por favor, insira credenciais do dispositivo para iniciar andOTP.</string>
    <string name="dialog_msg_confirm_delete">Você tem certeza que deseja remover a conta \"%1$s\"?</string>
    <string name="dialog_msg_used_tokens">andOTP vai rastrear seu uso dos tokens (usando a ferramenta
        \"Toque para revelar\" ou copiando para a área de transferência) para conseguir
        classificá-los por \"Mais usados\" ou \"Usados por último\".\n\nEssa mensagem não será exibida novamente.</string>
    <string name="dialog_msg_keystore_error">Falha ao carregar a chave de criptografia da KeyStore.
        Quaisquer alterações adicionadas serão perdidas.\n\nPara continuar usando o andOTP, você precisa ir         até as Configurações e alterar a Criptografia do Banco de Dados para Senha/PIN.</string>
    <string name="dialog_msg_auto_time">Ative a opção Data e hora automáticas nas
         Configurações do seu telefone para garantir a correta geração
        de senhas-de-uso-único baseadas no horário (TOTP).</string>
    <string name="dialog_hint_dont_show_again">Não mostrar esta mensagem novamente.</string>
    <string name="yes">Sim</string>
    <string name="no">Não</string>

    <string name="shortcut_name_scan_qr">Ler código QR</string>
    <string name="shortcut_name_import_qr">Importar código QR</string>
    <string name="shortcut_name_enter_details">Insira detalhes</string>

    <string name="empty_list_view_text">Comece a adicionar seus tokens pressionando \"+\" na parte inferior</string>
</resources>


text:
package org.finos.waltz.jobs.generators;

import org.finos.waltz.model.app_group.AppGroupKind;
import org.finos.waltz.schema.tables.records.ApplicationGroupRecord;
import org.jooq.DSLContext;
import org.jooq.impl.DSL;
import org.springframework.context.ApplicationContext;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static java.lang.String.format;
import static org.finos.waltz.schema.tables.ApplicationGroup.APPLICATION_GROUP;
import static org.finos.waltz.schema.tables.ApplicationGroupEntry.APPLICATION_GROUP_ENTRY;

public class AppGroupGenerator implements SampleDataGenerator {

    private static final String[] names = {
            "Risk Working Group",
            "Finance Initiative '17",
            "Strategy .Next",
            "Ad hoc 32",
    };

    @Override
    public Map<String, Integer> create(ApplicationContext ctx) {
        DSLContext dsl = getDsl(ctx);

        List<ApplicationGroupRecord> groupRecords = Arrays
                .stream(names)
                .map(n -> {
                    ApplicationGroupRecord record = dsl.newRecord(APPLICATION_GROUP);
                    record.setName(n);
                    record.setKind(AppGroupKind.PUBLIC.name());
                    record.setDescription(format("%s : Description of %s", SAMPLE_DATA_PROVENANCE, n));

                    return record;
                })
                .collect(Collectors.toList());

        dsl.batchStore(groupRecords).execute();

        return null;
    }

    @Override
    public boolean remove(ApplicationContext ctx) {
        DSLContext dsl = getDsl(ctx);

        dsl.deleteFrom(APPLICATION_GROUP_ENTRY)
                .where(APPLICATION_GROUP_ENTRY.GROUP_ID.in(
                        DSL.select(APPLICATION_GROUP.ID)
                                .from(APPLICATION_GROUP)
                                .where(APPLICATION_GROUP.DESCRIPTION.startsWith(SAMPLE_DATA_PROVENANCE))
                ))
                .execute();

        dsl.deleteFrom(APPLICATION_GROUP)
                .where(APPLICATION_GROUP.DESCRIPTION.startsWith(SAMPLE_DATA_PROVENANCE))
                .execute();

        return false;
    }
}


text:
#include <vector>
using namespace std;

/*
Solution: inspired by these references

1. Blog post --> https://leetcode.com/problems/range-sum-query-mutable/discuss/1406686/C%2B%2BJavaPython-Binary-Indexed-Tree

2. YouTube video --> https://www.youtube.com/watch?v=RgITNht_f4Q

3. GeeksForGeeks blog post --> https://www.geeksforgeeks.org/binary-indexed-tree-or-fenwick-tree-2/#:~:text=To%20update%20a%20value%2C%20simply,index%20in%20this%20new%20array.
*/

class BinaryIndexedTree
{
    private:
        vector<int> tree;

    public:
        BinaryIndexedTree()
        {

        }

        BinaryIndexedTree(int size)
        {
            tree.resize(size + 1, 0);
        }

        int getSum(int index)
        {
            int sum=0;

            for(;index>0;index-=(index & (-index)))
            {
                sum+=tree[index];
            }

            return sum;
        }

        void addValue(int index, int value)
        {
            for(;index<tree.size();index+=(index & (-index)))
            {
                tree[index]+=value;
            }
        }
};

class NumArray
{
    private:
        BinaryIndexedTree binaryIndexedTree;

        vector<int> numbers;

    public:
        NumArray(vector<int> & nums)
        {
            this->binaryIndexedTree=BinaryIndexedTree(nums.size());

            this->numbers=nums;

            for(int i=0;i<nums.size();i++)
            {
                binaryIndexedTree.addValue(i + 1, numbers[i]);
            }
        }

        void update(int index, int val)
        {
            int difference=val - numbers[index];

            binaryIndexedTree.addValue(index + 1, difference);

            numbers[index]=val;
        }

        int sumRange(int left, int right)
        {
            return binaryIndexedTree.getSum(right + 1) - binaryIndexedTree.getSum(left);
        }
};


text:
define(["jquery", "backbone"],
    function ($, Backbone) {

        var Block = Backbone.Model.extend({

            defaults: {
                blockId: 0,
                title: '',
                description: '',
                detailedDescription: '',
                imageUrl: ''
            }

        });

        return Block;
    }

);


text:
<?php

/**
 * RESTo Geometry utilities functions
 */
class RestoGeometryUtil
{

    /**
     * Check if input object is a valid GeoJSON object
     *
     * Valid GeoJSON geometry
     *
     *      array(
     *          'type' =>,
     *          'coordinates' => array(...)
     *      )
     *
     * @param array $object : json object
     * @return array
     */
    public static function checkGeoJSONGeometry($object)
    {

        $allowedGeometryTypes = array(
            'Point',
            'Polygon',
            'LineString',
            'MultiPoint',
            'MultiPolygon',
            'MultiLineString'
        );

        if (!$object || !is_array($object)) {
            return false;
        }

        if (!isset($object['coordinates']) || !is_array($object['coordinates'])) {
            return false;
        }

        if (!isset($object['type']) || !in_array($object['type'], $allowedGeometryTypes)) {
            return false;
        }

        return true;

    }

    /**
     * Check if input object is a valid GeoJSON object
     *
     * Valid GeoJSON Feature
     *
     *      array(
     *          'type' => 'Feature',
     *          'geometry' => array(
     *              'type' =>,
     *              'coordinates' => array(...)
     *          ),
     *          'properties' => array(...)
     *      )
     *
     * @param array $object : json object
     * @return array
     */
    public static function checkGeoJSONFeature($object)
    {

        // Default is nice
        $error = 'Invalid GeoJSON feature';

        if (!$object || !is_array($object)) {
            return array(
                'isValid' => false,
                'error' => $error
            );
        }

        if (!isset($object['type']) || $object['type'] !== 'Feature') {
            return array(
                'isValid' => false,
                'error' => $error . ' - only type *Feature* is supported'
            );
        }

        /*
         * Empty geometry are allowed in GeoJSON specification
         *
         * "The value of the geometry member SHALL be either a Geometry object as
         *  defined above or, in the case that the Feature is unlocated, a JSON null value"
         *
         * (See https://tools.ietf.org/html/rfc7946#section-1.4)
         */
        if ( isset($object['geometry']) ) {
            if (!is_array($object['geometry']) || ! RestoGeometryUtil::checkGeoJSONGeometry($object['geometry'])) {
                return array(
                    'isValid' => false,
                    'error' => $error . ' - invalid geometry'
                );
            }
        }

        if (!isset($object['properties']) || !is_array($object['properties'])) {
            return array(
                'isValid' => false,
                'error' => $error . ' - invalid properties'
            );
        }

        return array(
            'isValid' => true
        );

    }

    /**
     * Check if input object is a valid WKT object
     *
     * [TODO] Does not support mutligeometries and/or (multi)geometries with holes
     * [TODO] This function does not validates the coordinates validity
     *
     * @param string $wktstring
     * @return boolean
     */
    public static function isValidWKT($wktstring)
    {
        if (! isset($wktstring) ) {
            return false;
        }
        if ( substr(strtolower($wktstring), 0, 6) === 'point(' && substr($wktstring, -1) === ')') {
            return true;
        }
        if ( substr(strtolower($wktstring), 0, 9) === 'polygon((' && substr($wktstring, -2) === '))') {
            return true;
        }
        if ( substr(strtolower($wktstring), 0, 12) === 'linestring((' && substr($wktstring, -2) === '))') {
            return true;
        }
        return true;
    }

    /**
     * Check if input object is a valid WKT polygon
     *
     * @param string $wktPolygon
     * @return boolean
     */
    public static function isValidWKTPolygon($wktPolygon)
    {
        if (! isset($wktPolygon) || substr(strtolower($wktPolygon), 0, 9) !== 'polygon((' || substr($wktPolygon, -2) !== '))') {
            return false;
        }
        return true;
    }

    /**
     * Return radius length in degrees for a radius in meters
     * at a given latitude
     *
     * @param float $radius
     * @param float $lat
     * @return float
     */
    public static function radiusInDegrees($radius, $lat)
    {
        return ($radius * cos(deg2rad($lat))) / 52520.0;
    }

    /**
     * Transform EPSG:3857 coordinate into EPSG:4326
     *
     * @param {array} $xy : array(x, y)
     */
    public static function inverseMercator($xy)
    {
        if (!is_array($xy) || count($xy) !== 2) {
            return null;
        }

        return array(
            180.0 * $xy[0] / 20037508.34,
            180.0 / M_PI * (2.0 * atan(exp(($xy[1] / 20037508.34) * M_PI)) - M_PI / 2.0)
        );
    }

    /**
     * Transform EPSG:4326 coordinate into EPSG:3857
     *
     * @param {array} $lonlat : array(lon, lat)
     */
    public static function forwardMercator($lonlat)
    {
        if (!is_array($lonlat) || count($lonlat) !== 2) {
            return null;
        }

        /*
         * Constrain latitude limits between -85/+85 degrees
         */
        if ($lonlat[1] > 85) {
            $lonlat[1] = 85;
        }
        else if ($lonlat[1] < -85) {
            $lonlat[1] = -85;
        }

        return array(
            $lonlat[0] * 20037508.34 / 180.0,
            max(-20037508.34, min(log(tan((90.0 + $lonlat[1]) * M_PI / 360.0)) / M_PI * 20037508.34, 20037508.34))
        );

    }

    /**
     * Return a PostGIS BOX2D to a bbox array
     *
     * @param string $box2d
     * @return array
     */
    public static function box2dTobbox($box2d)
    {
        return isset($box2d) ? array_map('floatval', explode(',', str_replace(' ', ',', substr(substr($box2d, 0, strlen($box2d) - 1), 4)))) : null;
    }

    /**
     * Transform EPSG:4326 BBOX to EPSG:3857 bbox
     *
     * @param array $bbox : bbox in EPSG:4326 (i.e. [lonmin,latmin,lonmax,latmax])
     */
    public static function bboxToMercator($bbox)
    {
        if (!isset($bbox) || count($bbox) !== 4) {
            return null;
        }

        /*
         * Lower left coordinate
         */
        $lowerLeft = RestoGeometryUtil::forwardMercator(array(floatval($bbox[0]), floatval($bbox[1])));
        if (!$lowerLeft) {
            return null;
        }

        /*
         * Upper right coordinate
         */
        $upperRight = RestoGeometryUtil::forwardMercator(array(floatval($bbox[2]), floatval($bbox[3])));
        if (!$upperRight) {
            return null;
        }

        return join(',', $lowerLeft) . ',' . join(',', $upperRight);
    }

    /**
     * Return WKT from geometry
     * @param array $geometry - GeoJSON geometry
     */
    public static function geoJSONGeometryToWKT($geometry)
    {

        if (!isset($geometry)) {
            return null;
        }

        $type = strtoupper($geometry['type']);
        $epsgCode = RestoGeometryUtil::geoJSONGeometryToSRID($geometry);
        $srid = $epsgCode === 4326 ? '' : 'SRID=' . $epsgCode . ';';
        switch ($type) {
            case 'POINT':
                $wkt = $srid . $type . RestoGeometryUtil::toPoint($geometry['coordinates']);
                break;

            case 'MULTIPOINT':
                $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toPoint');
                break;

            case 'LINESTRING':
                $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates']);
                break;

            case 'MULTILINESTRING':
            case 'POLYGON':
                $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toLineString');
                break;

            case 'MULTIPOLYGON':
                $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toPolygon');
                break;

            case 'GEOMETRYCOLLECTION':
                $wkts = array();
                for ($i = count($geometry['geometries']); $i--;) {
                    $wkts[] = RestoGeometryUtil::geoJSONGeometryToWKT($geometry['geometries'][$i]);
                }
                $wkt = $srid . $type . '(' . join(',', $wkts). ')';
                break;

            default:
                $wkt = null;

        }

        return $wkt;
    }

    /**
     * Return SRID from GeoJSON geometry
     * @param array $geometry - GeoJSON geometry
     */
    public static function geoJSONGeometryToSRID($geometry)
    {
        if (isset($geometry) && isset($geometry['crs']) && isset($geometry['crs']['properties']) && isset($geometry['crs']['properties']['name'])) {
            // Get code from EPSG string (e.g. urn:ogc:def:crs:EPSG:8.8.1:32610)
            $exploded = explode(':', $geometry['crs']['properties']['name']);
            $epsgCode = $exploded[count($exploded) - 1];
            return (integer) $epsgCode;

        }
        return 4326;
    }

    /**
     * Convert input GeoJSON string geometry into WKT or leave it untouched if already a WKT
     *
     * @param string $geostring
     */
    public static function forceWKT($geostring)
    {

        // Issue #329 - pystac_client GeoJSON string is within double quotes (so not valid GeoJSON)
        // e.g. "intersects":"\"{\\\"type\\\": \\\"Polygon\\\", \\\"coordinates\\\": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}\""
        $geostring = stripslashes(trim($geostring, '\'"'));

        if (isset($geostring) && isset($geostring[0]) && $geostring[0] === '{') {
            $geostring = RestoGeometryUtil::geoJSONGeometryToWKT(json_decode($geostring, true));
        }

        if ( !isset($geostring) || !RestoGeometryUtil::isValidWKT($geostring) ) {
            return RestoLogUtil::httpError(400, 'Invalid input geometry for intersects - should be a valid GeoJSON or Well Known Text standard (WKT)');
        }

        return $geostring;

    }

    /**
     * Returns point array from WKT point.
     *
     * @param string $wktPoint WKT point
     * @return array
     */
    public static function WKTPointToArray($wktPoint)
    {
        $coordsAsString = explode(' ', substr($wktPoint, 6, -1));
        return array((float) $coordsAsString[0], (float) $coordsAsString[1]);
    }

    /**
     * Returns polygon array from WKT polygon.
     *
     * @param string $wktPolygon WKT polygon
     * @throws Exception
     * @return array
     */
    public static function WKTPolygonToArray($wktPolygon) {

        /*
         * Result
         */
        $coordinates = array ();

        /*
         * Patterns
         */
        $lon = $lat = '[-]?[0-9]{1,3}\.?[0-9]*';
        $values = "($lon $lat)(\s*,\s*$lon $lat)*";
        $pattern = "/^POLYGON\s*\(\s*\(\s*($values)\s*\)\s*\)$/i";

        /*
         * Checks input parameter (WKT String)
         */
        if (preg_match($pattern, $wktPolygon, $matches)) {

            if (count($matches) >= 1) {

                /*
                 * Explodes coordinates string
                 */
                $coordinates = explode(',', $matches[1]);

                /*
                 * For each coordinate, stores lon/lat
                 */
                for($i = 0, $ii = count($coordinates); $i < $ii; $i++) {
                    $coordinates[$i] = array_map('floatval', explode(' ', $coordinates[$i]));
                }
            }
        }
        else {
            throw new Exception(__method__ . ': Invalid input WKT');
        }

        /*
         * Returns result
         */
        return $coordinates;

    }

    /**
     * Return a WKT Polygon from centroid and radius
     *
     * @param float $lon lon
     * @param float $lat Lat
     * @param float $radius (in meters)
     * @throws Exception
     * @return multitype:NULL polygon array
     */
    public static function WKTPolygonFromLonLat($lon, $lat, $radius)
    {
        $radius = RestoGeometryUtil::radiusInDegrees($radius, $lat);
        $lonmin = $lon - $radius;
        $latmin =  $lat - $radius;
        $lonmax = $lon + $radius;
        $latmax =  $lat  + $radius;
        return 'POLYGON((' . $lonmin . ' ' . $latmin . ',' . $lonmin . ' ' . $latmax . ',' . $lonmax . ' ' . $latmax . ',' . $lonmax . ' ' . $latmin . ',' . $lonmin . ' ' . $latmin . '))';
    }

    /**
     * Return POINT WKT from coordinates (without WKT type)
     *
     * @param array $coordinates - GeoJSON geometry
     */
    private static function toPoint($coordinates)
    {
        return '(' . join(' ', $coordinates) . ')';
    }

    /**
     * Generic code to transform input coordinates array to WKT string
     *
     * @param array $coordinates
     * @param function $functionName
     * @return string
     */
    private static function coordinatesToString($coordinates, $functionName = null)
    {
        $output = array();
        for ($i = 0, $l = count($coordinates); $i < $l; $i++) {
            switch ($functionName) {
                case 'toPoint':
                    $output[] = RestoGeometryUtil::toPoint($coordinates[$i]);
                    break;
                case 'toLineString':
                    $output[] = RestoGeometryUtil::coordinatesToString($coordinates[$i]);
                    break;
                case 'toPolygon':
                    $output[] = RestoGeometryUtil::coordinatesToString($coordinates[$i], 'toLineString');
                    break;
                default:
                    $output[] = join(' ', $coordinates[$i]);
            }
        }
        return '(' . join(',', $output) . ')';
    }

}


text:
title: CSS Skin File Selector
page_title: CSS Skin File Selector - RadDropDownTree
description: Check our Web Forms article about CSS Skin File Selector.
slug: dropdowntree/appearance-and-styling/css-skin-file-selector
tags: css,skin,file,selector
published: False
position: 2
---

# CSS Skin File Selector

Required introduction

## Optional section title

Add one or more sections with content

# See Also


text: Code and notebooks related to my book, *Probably Overthinking It*.


text:
<?php
namespace SlimStarter\Middleware;

/**
*
*/
class CSRFMiddleware
{
	protected $csrf;
	protected $view;

	public function __construct($csrf, $view) {
		$this->csrf = $csrf;
		$this->view = $view;
	}

	public function __invoke($request, $response, $next){

		$this->view->getEnvironment()->addGlobal('csrf', [
				'field' =>
				'<input type="hidden" name="' .$this->csrf->getTokenNameKey() . '" value="'.$this->csrf->getTokenName(). '">
				<input type="hidden" name="' .$this->csrf->getTokenValueKey() . '" value="'.$this->csrf->getTokenValue(). '">'
			]);

		$response = $next($request, $response);
		return $response;
	}

}


text:
package ocp._02_advanced_java_class_design.enum_example;

public enum Coffees {
	CAPPUCCINO(425),
	RISTRETTO(999);

	private int caffeineMg;

	private Coffees(int caffeineMg) {
		this.caffeineMg = caffeineMg;
	}

	public int getCaffeineMg() {
		return caffeineMg;
	}
}


text:
import {FlagService} from './flag.service';
import {ConfigService} from './config.service';

describe('service: FlagService', () => {
  let service: FlagService;
  let flags: {
    firstTime: boolean;
  };
  let configService: ConfigService;

  beforeEach(() => {
    flags = {
      firstTime: false
    };
    process.env.ENV = 'development';
    configService = new ConfigService();
    service = new FlagService(configService);
  });

  afterAll(() => {
    service = null;
    flags = null;
  });

  it('should be defined', () => {
    expect(service).toBeDefined();
  });

  describe('refresh', () => {
    it('should refresh flags from storage', () => {
      spyOn(localStorage, 'getItem').and.returnValue(JSON.stringify(flags));
      expect(service.flags).toEqual({});
      service.refresh();
      expect(service.flags).toEqual(flags);
    });
  });

  describe('getFlag', () => {
    beforeEach(() => {
      service.flags = flags;
    });

    afterEach(() => {
      service.flags = null;
    });

    it('should return the value of flag if it exists', () => {
      expect(service.getFlag('firstTime')).toEqual(false);
    });

    it('should return undefined if flag does not exist', () => {
      expect(service.getFlag('flag')).toEqual(undefined);
    });
  });

  describe('setFlag', () => {
    it('should set the specified flag with value and call storage setItem with flagsKey and flags data', () => {
      service.flags = flags;
      expect(service.flags.firstTime).toEqual(false);
      spyOn(localStorage, 'setItem');
      service.setFlag('firstTime', true);
      expect(service.flags.firstTime).toEqual(true);
      expect(localStorage.setItem).toHaveBeenCalledWith('zazu.flags.test', JSON.stringify(service.flags));
    });
  });
});


text:
<?php
include('requires.inc.php');
include("./../config/loadConfiguration.php");
include('./../validate-member.php');
include('./../navigation.inc.php');
?>

<title><?=getConfigValue("General", "siteTitle")?></title>
<link href="/theme/style.css" rel="stylesheet" type="text/css" />

<?php
include_once("../analyticstracking.php");
?>

<?php
        if (isset($_POST["id"]) && isset($_POST["firstName"]) && isset($_POST["lastName"]) && isset($_POST["email"]) && isset($_POST["phoneNumber"]) && isset($_POST["newPassword1"])) {
            $player = new Player();
            $player->id = $_POST["id"];
            $player->firstName = $_POST["firstName"];
            $player->lastName = $_POST["lastName"];
            $player->emailAddress = $_POST["email"];
            $player->phoneNumber = $_POST["phoneNumber"];

            PlayerDAO::editAccount($player);

            $newPassword = $_POST["newPassword1"];
            if ($newPassword != "") {
                PlayerDAO::changePassword($player->id, $newPassword);
            }
?>

<?php
        } else {
            $player = PlayerDAO::getPlayer($_SESSION['userid']);
            if (null == $player) {
?>

<?php
            } else {
?>
        <form name="playerForm" id="playerForm" method="POST" action="myAccount.php">
            <fieldset class="editPlayerFields">

                    First Name:  <input name="id" type="hidden"
                        value="<?=$player->id?>" /> <input name="firstName" type="text"
                        size="78" maxlength="50" value="<?=$player->firstName?>" />

                    Last Name:  <input name="lastName" type="text" size="78"
                        maxlength="50" value="<?=$player->lastName?>" />

                    Email Address:  <input name="email" type="text" size="78"
                        maxlength="50" value="<?=$player->emailAddress?>" />

                    Phone Number:
                     <input name="phoneNumber" type="text"
                        size="78" maxlength="20" value="<?=$player->phoneNumber?>" />

                    Change Password?
                    <input type="checkbox" name="newPasswordCheckbox" id="newPasswordCheckbox" onchange="hideOrShowNewPasswordFields()"/>

                            New Password:
                            <input type="password" name="newPassword1" id="newPassword1"/>

                            Verify Password:
                            <input type="password" name="newPassword2" id="newPassword2"/>

                     <input name="updatePlayerButton" type="button"
                        value="Update" onclick="editPlayer()" />

            </fieldset>
        </form>

                Handicap History

        <?php
            }
        }
?>

    <?php
include("./../utilities.inc.php");
?>


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddUserSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_settings', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('key');
            $table->string('value');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user_settings');
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mem. Real Acad. Ci. Exact. Madrid 2:478. 1854

#### Original name
null

### Remarks
null


text:
namespace HWHCore.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class Init : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Addresses",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        AddressStreet1 = c.String(),
                        AddressStreet2 = c.String(),
                        AddressStreet3 = c.String(),
                        City = c.String(),
                        State = c.String(),
                        Zip = c.String(),
                        Country = c.String(),
                        AddressType = c.Int(nullable: false),
                        CustomerId = c.Int(),
                        EmployeeId = c.Int(),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Customers", t => t.CustomerId)
                .ForeignKey("dbo.Employees", t => t.EmployeeId)
                .Index(t => t.CustomerId)
                .Index(t => t.EmployeeId);

            CreateTable(
                "dbo.Customers",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Description = c.String(),
                        FirstName = c.String(),
                        LastName = c.String(),
                        MiddleInitial = c.String(),
                        IsActive = c.Boolean(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "dbo.ContactInfoes",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ContactInfoType = c.Int(nullable: false),
                        AssociationType = c.Int(nullable: false),
                        Notes = c.String(),
                        ContactDetail = c.String(),
                        EmployeeId = c.Int(),
                        CustomerId = c.Int(),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Customers", t => t.CustomerId)
                .ForeignKey("dbo.Employees", t => t.EmployeeId)
                .Index(t => t.EmployeeId)
                .Index(t => t.CustomerId);

            CreateTable(
                "dbo.Employees",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        HireDate = c.DateTime(nullable: false),
                        DateTerminated = c.DateTime(),
                        Notes = c.String(),
                        Title = c.String(),
                        FirstName = c.String(),
                        LastName = c.String(),
                        MiddleInitial = c.String(),
                        IsActive = c.Boolean(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "dbo.GasReciepts",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        EmployeeId = c.Int(nullable: false),
                        TruckId = c.Int(nullable: false),
                        RecieptTotal = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Notes = c.String(),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Employees", t => t.EmployeeId, cascadeDelete: true)
                .ForeignKey("dbo.WaterTrucks", t => t.TruckId, cascadeDelete: true)
                .Index(t => t.EmployeeId)
                .Index(t => t.TruckId);

            CreateTable(
                "dbo.WaterTrucks",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        ManufactureYear = c.DateTime(nullable: false),
                        PurchaseDate = c.DateTime(),
                        Model = c.String(),
                        Make = c.String(),
                        LoadVolume = c.Int(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id);

            CreateTable(
                "dbo.Bills",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        PriceOfWater = c.Decimal(nullable: false, precision: 18, scale: 2),
                        LoadVolume = c.Int(nullable: false),
                        NumberOfLoads = c.Int(nullable: false),
                        PriceNet = c.Decimal(precision: 18, scale: 2),
                        GrossAmount = c.Decimal(precision: 18, scale: 2),
                        DriverRetainagePercent = c.Decimal(nullable: false, precision: 18, scale: 2),
                        TruckId = c.Int(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.WaterTrucks", t => t.TruckId, cascadeDelete: true)
                .Index(t => t.TruckId);

            CreateTable(
                "dbo.Payments",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        PaymentType = c.Int(nullable: false),
                        CheckNumber = c.Int(),
                        PaymentAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        CustomerId = c.Int(nullable: false),
                        BillId = c.Int(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Bills", t => t.BillId, cascadeDelete: true)
                .ForeignKey("dbo.Customers", t => t.CustomerId, cascadeDelete: true)
                .Index(t => t.CustomerId)
                .Index(t => t.BillId);

            CreateTable(
                "dbo.Sales",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        SaleType = c.Int(nullable: false),
                        DateOfSale = c.DateTime(nullable: false),
                        PaymentDueDate = c.DateTime(),
                        FullPaymentRecieved = c.Boolean(nullable: false),
                        DriverRetainagePercent = c.Decimal(nullable: false, precision: 18, scale: 2),
                        BillId = c.Int(nullable: false),
                        CustomerId = c.Int(nullable: false),
                        EmployeeId = c.Int(nullable: false),
                        CreatedDateTime = c.DateTime(nullable: false),
                        ModifiedDateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Bills", t => t.BillId, cascadeDelete: true)
                .ForeignKey("dbo.Customers", t => t.CustomerId, cascadeDelete: true)
                .ForeignKey("dbo.Employees", t => t.EmployeeId, cascadeDelete: true)
                .Index(t => t.BillId)
                .Index(t => t.CustomerId)
                .Index(t => t.EmployeeId);

        }

        public override void Down()
        {
            DropForeignKey("dbo.Sales", "EmployeeId", "dbo.Employees");
            DropForeignKey("dbo.Sales", "CustomerId", "dbo.Customers");
            DropForeignKey("dbo.Sales", "BillId", "dbo.Bills");
            DropForeignKey("dbo.GasReciepts", "TruckId", "dbo.WaterTrucks");
            DropForeignKey("dbo.Bills", "TruckId", "dbo.WaterTrucks");
            DropForeignKey("dbo.Payments", "CustomerId", "dbo.Customers");
            DropForeignKey("dbo.Payments", "BillId", "dbo.Bills");
            DropForeignKey("dbo.GasReciepts", "EmployeeId", "dbo.Employees");
            DropForeignKey("dbo.ContactInfoes", "EmployeeId", "dbo.Employees");
            DropForeignKey("dbo.Addresses", "EmployeeId", "dbo.Employees");
            DropForeignKey("dbo.ContactInfoes", "CustomerId", "dbo.Customers");
            DropForeignKey("dbo.Addresses", "CustomerId", "dbo.Customers");
            DropIndex("dbo.Sales", new[] { "EmployeeId" });
            DropIndex("dbo.Sales", new[] { "CustomerId" });
            DropIndex("dbo.Sales", new[] { "BillId" });
            DropIndex("dbo.Payments", new[] { "BillId" });
            DropIndex("dbo.Payments", new[] { "CustomerId" });
            DropIndex("dbo.Bills", new[] { "TruckId" });
            DropIndex("dbo.GasReciepts", new[] { "TruckId" });
            DropIndex("dbo.GasReciepts", new[] { "EmployeeId" });
            DropIndex("dbo.ContactInfoes", new[] { "CustomerId" });
            DropIndex("dbo.ContactInfoes", new[] { "EmployeeId" });
            DropIndex("dbo.Addresses", new[] { "EmployeeId" });
            DropIndex("dbo.Addresses", new[] { "CustomerId" });
            DropTable("dbo.Sales");
            DropTable("dbo.Payments");
            DropTable("dbo.Bills");
            DropTable("dbo.WaterTrucks");
            DropTable("dbo.GasReciepts");
            DropTable("dbo.Employees");
            DropTable("dbo.ContactInfoes");
            DropTable("dbo.Customers");
            DropTable("dbo.Addresses");
        }
    }
}


text:
package nanomsg // import "github.com/alice-go/fer/mq/nanomsg"

import (
	"github.com/alice-go/fer/mq"
	"golang.org/x/xerrors"
	"nanomsg.org/go-mangos"
	"nanomsg.org/go-mangos/protocol/bus"
	"nanomsg.org/go-mangos/protocol/pair"
	"nanomsg.org/go-mangos/protocol/pub"
	"nanomsg.org/go-mangos/protocol/pull"
	"nanomsg.org/go-mangos/protocol/push"
	"nanomsg.org/go-mangos/protocol/rep"
	"nanomsg.org/go-mangos/protocol/req"
	"nanomsg.org/go-mangos/protocol/sub"
	"nanomsg.org/go-mangos/transport/inproc"
	"nanomsg.org/go-mangos/transport/ipc"
	"nanomsg.org/go-mangos/transport/tcp"
)

type socket struct {
	mangos.Socket
	typ mq.SocketType
}

func (s socket) Type() mq.SocketType {
	return s.typ
}

type driver struct{}

func (driver) Name() string {
	return "nanomsg"
}

func (driver) NewSocket(typ mq.SocketType) (mq.Socket, error) {
	var sck mangos.Socket
	var err error

	switch typ {
	case mq.Sub, mq.XSub:
		sck, err = sub.NewSocket()
		if err == nil {
			err = sck.SetOption(mangos.OptionSubscribe, []byte(""))
		}
	case mq.Pub, mq.XPub:
		sck, err = pub.NewSocket()
	case mq.Push:
		sck, err = push.NewSocket()
	case mq.Pull:
		sck, err = pull.NewSocket()
	case mq.Req, mq.Dealer:
		sck, err = req.NewSocket()
	case mq.Rep, mq.Router:
		sck, err = rep.NewSocket()
	case mq.Pair:
		sck, err = pair.NewSocket()
	case mq.Bus:
		sck, err = bus.NewSocket()
	default:
		return nil, xerrors.Errorf("fer/nanomsg: invalid socket type %v (%d)", typ, int(typ))
	}

	if err != nil {
		return nil, err
	}

	sck.AddTransport(ipc.NewTransport())
	sck.AddTransport(tcp.NewTransport())
	sck.AddTransport(inproc.NewTransport())
	return socket{Socket: sck, typ: typ}, err
}

func init() {
	mq.Register("nanomsg", driver{})
}


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

<title>D-Index</title>
<meta name="date" content="2012-10-21">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N O P R S T U V W

D

Database - Class in main.tool

Database() - Constructor for class main.tool.Database

DatabaseException - Exception in main.data.error

DatabaseException() - Constructor for exception main.data.error.DatabaseException

DatabaseException(String) - Constructor for exception main.data.error.DatabaseException

DatabaseException(String, Throwable) - Constructor for exception main.data.error.DatabaseException

DatabaseException(Throwable) - Constructor for exception main.data.error.DatabaseException

Date - Class in main.data.file

Date(long, long, long) - Constructor for class main.data.file.Date

Dates - Class in main.tool

Dates() - Constructor for class main.tool.Dates

DAY - Static variable in class main.tool.Dates

dblocation - Variable in class main.config.Config

dbpassword - Variable in class main.config.Config

dbuser - Variable in class main.config.Config

decrypt(String, String) - Static method in class main.tool.Encryptor

delete(Connection, Links) - Method in class main.service.file.LinksDb

dir - Variable in class main.data.file.Links

dir - Variable in class main.data.rank.Change

docs - Variable in class main.data.file.AllFiles

Documents - Class in main.data.file

Documents(String, String, Date, String, Integer, boolean, boolean, boolean, String, String, Integer) - Constructor for class main.data.file.Documents

Documents(Integer, String, String, Date, String, Integer, boolean, boolean, boolean, String, String, Integer, String, Boolean) - Constructor for class main.data.file.Documents

Documents - Class in main.service.query

Documents() - Constructor for class main.service.query.Documents

done - Variable in class main.data.file.Links

A B C D E F G H I L M N O P R S T U V W

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
package com.atooma.plugin.chickenfoot;

import java.io.UnsupportedEncodingException;

import org.apache.http.entity.StringEntity;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.os.RemoteException;

import com.atooma.plugin.ParameterBundle;
import com.atooma.plugin.Performer;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.JsonHttpResponseHandler;

public class PE_RIGHT extends Performer {

	public PE_RIGHT(Context context, String id, int version) {
		super(context, id, version);
	}

	@Override
	public void declareParameters() {
		addParameter(R.string.address, R.string.address, "ADDRESS", "STRING", true);
		addParameter(R.string.duration, R.string.duration, "DURATION", "NUMBER", true);
	}

	@Override
	public ParameterBundle onInvoke(String ruleId, ParameterBundle parameters) throws RemoteException {
		String baseUrl = (String) parameters.get("ADDRESS");
		Double duration = (Double) parameters.get("DURATION");

		String url = baseUrl + "/move";

		try {
			JSONObject json = new JSONObject("{\"type\": \"right\", \"duration\" : " + duration + "}");
			AsyncHttpClient client = new AsyncHttpClient();
			StringEntity entity;
			try {
				entity = new StringEntity(json.toString());
				client.post(this.getContext(), url, null, entity, "application/json", new JsonHttpResponseHandler() {
					public void onSuccess(final JSONObject json) {

					}

					public void onFailure(final Throwable e, final JSONObject response) {
					}

				});
			} catch (UnsupportedEncodingException e1) {
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}

		return new ParameterBundle();
	}

	@Override
	public void defineUI() {
		setTitle(R.string.pe_right);
		setIcon(R.drawable.icon_right);
	}

}


text:
{% load i18n %}

        {% blocktrans with item.created|timesince as created %}
            {{ created }} ago
        {% endblocktrans %}

        {% include item.view_template %}


text:
package main

import (
	"fmt"

	"github.com/wandoulabs/codis/pkg/models"

	"github.com/docopt/docopt-go"
	log "github.com/ngaut/logging"
)

func cmdProxy(argv []string) (err error) {
	usage := `usage:
	codis-config proxy list
	codis-config proxy offline <proxy_name>
	codis-config proxy online <proxy_name>
`
	args, err := docopt.Parse(usage, argv, true, "", false)
	if err != nil {
		log.Error(err)
		return err
	}
	log.Debug(args)

	if args["list"].(bool) {
		return runProxyList()
	}

	proxyName := args["<proxy_name>"].(string)
	if args["online"].(bool) {
		return runSetProxyStatus(proxyName, models.PROXY_STATE_ONLINE)
	}
	if args["offline"].(bool) {
		return runSetProxyStatus(proxyName, models.PROXY_STATE_MARK_OFFLINE)
	}
	return nil
}

func runProxyList() error {
	var v interface{}
	err := callApi(METHOD_GET, "/api/proxy/list", nil, &v)
	if err != nil {
		return err
	}
	fmt.Println(jsonify(v))
	return nil
}

func runSetProxyStatus(proxyName, status string) error {
	info := models.ProxyInfo{
		Id:    proxyName,
		State: status,
	}
	var v interface{}
	err := callApi(METHOD_POST, "/api/proxy", info, &v)
	if err != nil {
		return err
	}
	fmt.Println(jsonify(v))
	return nil
}


text:
package org.glenrockindiancommunity.controller;

import org.glenrockindiancommunity.integrate.AdminApproval;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminUserController {

  @Autowired
  private AdminApproval approval;

  @PostMapping(path = "/admin/approve/{adminId}")
  public void acceptRegistration(@PathVariable Integer adminId) {
    approval.approveAdmin(adminId);
  }

}


text:
package ru.szhernovoy.spring.carstore.persistance.impl;/**
 * Created by Admin on 05.02.2017.
 */

import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.stereotype.Repository;
import ru.szhernovoy.spring.carstore.domain.DriveType;
import ru.szhernovoy.spring.carstore.persistance.DriveTypeCrud;

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

@Repository
public class DriveTypeCrudOperationImpl implements DriveTypeCrud {
    private static final Logger LOGGER = LoggerFactory.getLogger(DriveTypeCrudOperationImpl.class);

    private List<DriveType> list = new ArrayList<>();
    private int id = 0;

    public DriveTypeCrudOperationImpl() {

        DriveType partCar = new DriveType();

        partCar.setName("передний");
        partCar.setId(id++);
        list.add(partCar);

        partCar = new DriveType();
        partCar.setName("задний");
        partCar.setId(id++);
        list.add(partCar);

        partCar = new DriveType();
        partCar.setName("полный");
        partCar.setId(id++);
        list.add(partCar);

    }

    @Override
    public synchronized DriveType add(DriveType driveType) {
        driveType.setId(id++);
        this.list.add(driveType);
        return driveType;
    }

    @Override
    public synchronized boolean delete(DriveType driveType) {
        boolean result = false;
        if(this.list.contains(driveType)){
            this.list.remove(driveType);
            result = true;
        }
        return result;
    }

    @Override
    public synchronized DriveType update(DriveType driveType) {
        if(this.list.contains(driveType)){
            this.list.set(driveType.getId(),driveType);
        }
        return driveType;
    }

    @Override
    public List<DriveType> getAll() {
        return this.list;
    }

    @Override
    public synchronized DriveType getById(int id) {
        DriveType partCar = null;
        for(DriveType driveType : this.getAll()){
            if(driveType.getId() == id){
                partCar = driveType;
                break;
            }
        }
        return partCar;
    }
}


text:
function pointLocations = markImagePoints(imgax,varname,clr)
% Pass in a handle to an image-containing axes
% (optional; default is returned by imgca);
%
% Brett Shoelson, PhD
% brett.shoelson@mathworks.com
% 3/25/2011
%
% Copyright 2011 MathWorks, Inc.

if nargin == 0 || isempty(imgax)
    imgax = imgca;
end
axes(imgax);%#ok
imghandle = imhandles(imgax);
if isempty(imghandle)
    error('MarkImagePoints: specified axes does not contain an image!')
end
imghandle = imghandle(1); % Just in case there are multiple images in the axes
parentfig = ancestor(imgax,'figure');
pointLocationsRequested = nargin > 1;
pointLocations = [];
if pointLocationsRequested
    requestedvar = varname;
    if isempty(requestedvar)
        requestedvar = 'MarkedPoints';
    end
end
if nargin < 3
    clr = [1 0 0]; %default = red
end
oldTitleProps = get(get(imgax,'title'));
tmp       = title(imgax,'Click to define object(s). Press <ENTER> to finish selection.');
set(tmp,'color',clr,'fontsize',12, 'fontweight','b','tag','markImagePoints', 'Visible', 'on');
currBDF   = get(imgax,'ButtonDownFcn');
currKPF   = get(parentfig,'KeyPressFcn');
set(imgax,'ButtonDownFcn','');
set(imghandle,'ButtonDownFcn',@placePoint);
set(parentfig,'KeyPressFcn',  @noMorePoints);

    function roi = impoint2(varargin)
        % impoint2: improved impoint object
        roi      = impoint(varargin{:});
        % Add a context menu for adding points
        l        = findobj(roi,'type','hggroup');
        uic      = unique( get(l,'UIContextMenu') );
        for u = 1:numel(uic)
            uimenu( uic(u), 'Label', 'Delete', 'Callback', @deleteROI )
        end

        function deleteROI(src,evt) %#ok
            delete(roi);
        end

    end

    function pointLocations = noMorePoints(~,evt)
        finished  = strcmpi(evt.Key,'return');
        if finished
            % Delete title, reset original functionality
            %delete(findall(parentfig,'tag','markImagePoints'));
            set(findall(parentfig,'tag','markImagePoints'),...
                'string',oldTitleProps.String,...
                'color',oldTitleProps.Color,...
                'tag',oldTitleProps.Tag,...
                'fontsize',oldTitleProps.FontSize,...
                'fontweight',oldTitleProps.FontWeight,...
                'visible',oldTitleProps.Visible);
            set(imghandle,'ButtonDownFcn','');
            set(parentfig,'KeyPressFcn','');
            set(imgax,'ButtonDownFcn',currBDF);
            set(parentfig,'KeyPressFcn',currKPF);
            if pointLocationsRequested
                roi = findall(imgax,'type','hggroup');
                pointLocations = NaN(numel(roi),2);
                for ii = 1:numel(roi)
                    tmp = get(roi(ii),'children');
                    pointLocations(ii,1) = get(tmp(1),'xdata');
                    pointLocations(ii,2) = get(tmp(1),'ydata');
                end
                assignin('base',requestedvar,pointLocations);
            end
        end

    end

    function placePoint(varargin)
        point_loc = get(imgax,'CurrentPoint');
        point_loc = point_loc(1,1:2);
        impoint2(imgax,point_loc);
    end

end


text:
set -e

. /opt/kolla/config-neutron.sh

check_required_vars DEBUG_LOGGING \
                    VERBOSE_LOGGING

cfg=/etc/neutron/l3_agent.ini
neutron_conf=/etc/neutron/neutron.conf

# Logging
crudini --set $neutron_conf \
    DEFAULT \
    log_file \
    "${NEUTRON_L3_AGENT_LOG_FILE}"

# Configure l3_agent.ini
crudini --set $cfg \
    DEFAULT \
    verbose \
    "${VERBOSE_LOGGING}"
crudini --set $cfg \
    DEFAULT \
    debug \
    "${DEBUG_LOGGING}"
if [[ "${MECHANISM_DRIVERS}" =~ linuxbridge ]] ; then
    crudini --set $cfg \
        DEFAULT \
        interface_driver \
        "neutron.agent.linux.interface.BridgeInterfaceDriver"
    crudini --set $cfg \
        DEFAULT \
        gateway_external_network_id \
        ""
    crudini --set $cfg \
        DEFAULT \
        external_network_bridge \
        ""
elif [[ "${MECHANISM_DRIVERS}" =~ .*openvswitch* ]] ; then
    crudini --set $cfg \
        DEFAULT \
        interface_driver \
        "neutron.agent.linux.interface.OVSInterfaceDriver"
    crudini --set $cfg \
        DEFAULT \
        gateway_external_network_id \
        "${NEUTRON_FLAT_NETWORK_BRIDGE}"
    crudini --set $cfg \
        DEFAULT \
        external_network_bridge \
        "${NEUTRON_FLAT_NETWORK_BRIDGE}"
fi

crudini --set $cfg \
    DEFAULT \
    use_namespaces \
    "${USE_NAMESPACES}"

if [ "${USE_NAMESPACES}" == "false" ] ; then
    source /openrc
    # Create router if it does not exist
    /usr/bin/neutron router-list | grep admin-router || /usr/bin/neutron router-create admin-router
    # Set router-id
    crudini --set $cfg \
        DEFAULT \
        router_id \
        "$(/usr/bin/neutron router-list | awk '/ admin-router / {print $2}')"
elif [ "${USE_NAMESPACES}" == "true" ] ; then
    crudini --set $cfg \
        DEFAULT \
        router_delete_namespaces \
        "true"
fi

# TODO: SamYaple remove this section for thin neutron containers
# The reason we remove existing namespaces is because network namespaces don't
# persist between container restarts because the network proc mountpoint dies
# when the container mount namespace dies. The mountpoint in /run/netns does
# persist however, and that is all we are cleaning up here.

# Remove any existing qrouter namespaces
ip netns list | grep qrouter | while read -r line ; do
    ip netns delete $line
done

# Start L3 Agent
exec /usr/bin/neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-dir /etc/neutron


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Extending</title>
</head>
<body>
<script>
  class MovieCollection extends Array {
    // Capture with the rest operator
    constructor(name, ...items) {
      // Send items with the spread operator
      super(...items);
      this.name = name;
    }
    add(movie) {
      this.push(movie);
    }
    topRated(limit = 10) {
      return this.sort((a, b) => (a.stars > b.stars ? -1 : 1)).slice(0, limit);
    }
  }

  const movies = new MovieCollection('Wengerk\'s Fav Movies',
    { name: 'Bee Movie', stars: 10 },
    { name: 'Star Wars Trek', stars: 1 },
    { name: 'Virgin Suicides', stars: 7 },
    { name: 'King of the Road', stars: 8 }
  );

  movies.add({ name: 'Titanic', stars: 5 });

  console.table(movies.topRated(2)); // → ["Bee Movie", "King of the Road"]

</script>
</body>
</html>


text:
typedef void(^sure)();

typedef void(^fyl_sheet_action_handler)(NSInteger index);

@interface FYLPopView : UIView

+ (void)showViewWithTitle:(NSString *)title;
+ (void)showViewWithTitle:(NSString *)title aotuHidden:(CGFloat)duration;
+ (void)showViewWithTitle:(NSString *)title withComplete:(sure)sure;

+ (void)showActivityIndicatorView;
//+ (void)addAFHTTPRequestOperationToActivityIndicatorView:(AFHTTPRequestOperation *)op;
+ (void)hideActivityIndicatorView;

+ (void)showMessage:(NSString *)msg;

+ (void)showActionSheetControllerWithTitle:(NSString *)title message:(NSString *)message destructiveBtnTitle:(NSString *)destructiveTitle otherBtnTitles:(NSArray *)titles action:(fyl_sheet_action_handler)block inVc:(UIViewController *)vc;
+ (void)showAlertControllerWithTitle:(NSString *)title message:(NSString *)message sureBtnTitle:(NSString *)sureTitle otherBtnTitles:(NSArray *)titles action:(fyl_sheet_action_handler)block inVc:(UIViewController *)vc;
@end


text:
package org.tic.vertx.examples.service.discovery;

import io.vertx.core.AbstractVerticle;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import io.vertx.servicediscovery.Record;
import io.vertx.servicediscovery.ServiceDiscovery;
import io.vertx.servicediscovery.types.HttpEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HttpEndpointServiceProviderVerticle extends AbstractVerticle {

    private static final Logger logger = LoggerFactory.getLogger(HttpEndpointServiceProviderVerticle.class);

    private static final String API_NAME = "product-api";

    @Override
    public void start() throws Exception {
        ServiceDiscovery discovery = ServiceDiscovery.create(vertx);

        Record record = HttpEndpoint.createRecord(API_NAME, "localhost", 9999, "/api/product");

        Router router = Router.router(vertx);
        router.get("/api/product").handler(this::apiProduct);

        vertx.createHttpServer().requestHandler(router::accept)
                .listen(9999);

        discovery.publish(record, ar -> {
            if (ar.succeeded()) {
                logger.info(API_NAME + " http endpoint service provider published succeed !");
            } else {
                logger.error(API_NAME + " http endpoint service provider published failed !");
            }
        });
    }

    private void apiProduct(RoutingContext rc) {
        logger.info("/api/product http endpoint request ok !");
        rc.response().end("this is the response content, keep it !");
    }

}


text:
<!DOCTYPE html>

<link>
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="../css/qunit-1.19.0.css" />

Crud de Categoria

Categoria Form

        <form id="form-categoria" action="#" method="post" role="form">
          <input type="hidden" value="057cfacb9d350ad5c951d9c56f90b9a8" name="_csrf_code">

            Nome
            <input id="input-nome" type="text" class="form-control" name="nome" value="">

          <button  type="submit" class="btn btn-success">Save</button>
        </form>

      <button id="mostrar-form-botao" class="btn btn-success">Criar Nova Categoria</button>

Lista de Categorias

          Id
          Creation
          Nome


text:
package info.shibafu528.arthursiren;

import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.wearable.view.FragmentGridPagerAdapter;
import info.shibafu528.libarthur.Quest;

import java.util.List;

/**
 * Created by shibafu on 15/01/18.
 */
public class QuestsGridPagerAdapter extends FragmentGridPagerAdapter {
    private final Context context;
    private final List<Quest> quests;

    public QuestsGridPagerAdapter(FragmentManager fm, Context context, List<Quest> quests) {
        super(fm);
        this.context = context;
        this.quests = quests;
    }

    @Override
    public Fragment getFragment(int row, int column) {
        Quest quest = quests.get(row);
        switch (column) {
            case 0:
                return QuestCardFragment.newInstance(quest);
            default:
                return null;
        }
    }

    @Override
    public int getRowCount() {
        return quests.size();
    }

    @Override
    public int getColumnCount(int row) {
        return 1;
    }

    @Override
    public Drawable getBackgroundForPage(int row, int column) {
        return new ColorDrawable(context.getResources().getColor(R.color.primary));
    }
}


text:
Before do
  @root = "tmp/features"

  FileUtils.rm_rf @root
end


text:
/*jslint node: true */
"use strict";

var _ = require('lodash');
var assert = require('assert');

var H = require('../index').EventEmitter;
var routes = require('./routes');

describe('HevEmitter on listener', function () {

    var h;
    beforeEach(function () {
        h = new H();
    });

    var shouldReceive = function (onRoute, emitRoute) {
        it('should receive at ' + '"' + onRoute.join('/') + '" messages emitted to "' + emitRoute.join('/') + '"', function () {
            var msg = { emitted: 0 };
            h.on(onRoute, function (msg) {
                msg.emitted += 1;
            });
            assert(h.emit(emitRoute, msg));
            assert(h.emit(emitRoute, msg));
            assert.equal(2, msg.emitted);
        });

        it('should receive at ' + '"' + onRoute.join('/') + '" messages emitted with multiple arguments to "' + emitRoute.join('/') + '"', function () {
            var msg = { emitted: 0 };
            h.on(onRoute, function (a, msg) {
                assert.equal(a, 'a');
                msg.emitted += 1;
            });
            assert(h.emit(emitRoute, 'a', msg));
            assert(h.emit(emitRoute, 'a', msg));
            assert.equal(2, msg.emitted);
        });
    };

    var shouldReceiveInOrder = function (firstRoute, secondRoute, emitRoute) {
        it('should receive at ' + '"' + firstRoute.join('/') + '" before "' + secondRoute.join('/') + '" on messages emitted to "' + emitRoute.join('/') + '"', function () {
            var msg = { emitted: [] };
            h.on(firstRoute, function (msg) {
                msg.emitted.push('a');
            });
            h.on(secondRoute, function (msg) {
                msg.emitted.push('b');
            });
            assert(h.emit(emitRoute, msg));
            assert.deepEqual(['a', 'b'], msg.emitted);
        });

        it('should receive at ' + '"' + firstRoute.join('/') + '" before "' + secondRoute.join('/') + '" on messages emitted to "' + emitRoute.join('/') + '" (opposite order)', function () {
            var msg = { emitted: [] };
            h.on(secondRoute, function (msg) {
                msg.emitted.push('b');
            });
            h.on(firstRoute, function (msg) {
                msg.emitted.push('a');
            });
            assert(h.emit(emitRoute, msg));
            assert.deepEqual(['a', 'b'], msg.emitted);
        });
    };

    var shouldNotReceive = function (onRoute, emitRoute) {
        it('should *not* receive at ' + '"' + onRoute.join('/') + '" messages emitted to "' + emitRoute.join('/') + '"', function () {
            var msg = { emitted: 0 };
            h.on(onRoute, function (msg) {
                msg.emitted += 1;
            });
            assert(!h.emit(emitRoute, msg));
            assert(!h.emit(emitRoute, msg));
            assert.equal(0, msg.emitted);
        });
    };

    _.each(routes.matchRoutes, function (args) {
        shouldReceive.apply(null, args);
    });

    _.each(routes.notMatchRoutes, function (args) {
        shouldNotReceive.apply(null, args);
    });

    _.each(routes.matchOrders, function (args) {
        shouldReceiveInOrder.apply(null, args);
    });

    describe('undefined routes', function () {

        it('should be *NOT* be able to add listeners to undefined routes', function () {
            // this is most likely an error on the user's part
            assert.throws(function () {
                h.on([void 0], function () {});
            }, /undefined/);
        });

    });

});


text:
title: PAT Advanced 1112 Stucked Keyboard
author: sigmainfy
excerpt: PAT Advanced 1112 Stucked Keyboard tests mod operation, count consecutive characters and test if it can be divided by k, if so, print it in the original order.
layout: post
categories:
  - PAT
  - Algorithm
tags:
  - PAT
  - Mod
---

## Overview
PAT Advanced 1112 Stucked Keyboard: tests mod operation, count consecutive characters and test if it can be divided by k, if so, print it in the original order.

## PAT Advenced 1112 Stucked Keyboard

On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen for k times.

Now given a resulting string on screen, you are supposed to list all the possible stucked keys, and the original string.

Notice that there might be some characters that are typed repeatedly. The stucked key will always repeat output for a fixed k times whenever it is pressed. For example, when k=3, from the string "thiiis iiisss a teeeeeest" we know that the keys "i" and "e" might be stucked, but "s" is not even though it appears repeatedly sometimes. The original string could be "this isss a teest".

**Input Specification:**

Each input file contains one test case. For each case, the 1st line gives a positive integer k ( 1<k<=100 ) which is the output repeating times of a stucked key. The 2nd line contains the resulting string on screen, which consists of no more than 1000 characters from {a-z}, {0-9} and "_". It is guaranteed that the string is non-empty.

**Output Specification:**

For each test case, print in one line the possible stucked keys, in the order of being detected. Make sure that each key is printed once only. Then in the next line print the original string. It is guaranteed that there is at least one stucked key.

**Sample Input:**

3
caseee1__thiiis_iiisss_a_teeeeeest

**Sample Output:**

ei
case1__this_isss_a_teest

## PAT Advenced 1112 Stucked Keyboard Solution

The algorithm is not too difficult, scan the input, count all the consecutive appearances of each same characters, if all of them could be divided by k exactly, then it is a stucked key, so for eaxmaple, 2 aabaaa, a is not stucked, because we say three a's.

Note the stucked keys need to be printed in the order of being detected, since we normally would use map to store the occurrence, we can't directly use the order of the keys in the map data structre, be careful about this, then it should pass the OJ.

The following is the C++ source code that could be accepted by PAT OJ to pass this PAT Advenced 1112 Stucked Key:
{% highlight cpp linenos %}
#include <string>
#include <iostream>
#include <cstdio>
#include <map>
#include <vector>

using std::string;
using std::cin;
using std::cout;
using std::endl;
using std::map;
using std::vector;

int main() {
	int k;
	cin >> k;
	getchar();

	string line;
	std::getline(cin, line);

	map<char, vector<int> > cs;
	map<char, bool> flags;
	for (int i = 0, len = line.size(), cnt = 1; i < len; i += cnt) {
		cnt = 1;
		for (int j = i + 1; j < len && line.at(j - 1) == line.at(j); ++j, ++cnt);
		cs[line.at(i)].push_back(cnt);
	}

	for(auto const& ele : cs) {
		char c = ele.first;
		bool f = true;
		for(auto const& cnt : ele.second) {
			f = f && (cnt % k == 0);
		}
		flags[c] = f;
	}

	map<char, bool> pp;
	for (auto & c: line) {
		if (!pp[c]) {
			if (flags[c]) {
				cout << c;
			}
			pp[c] = true;
		}
	}
	cout << endl;

	for (int i = 0, len = line.size(), cnt = 1; i < len; i += cnt) {
		cnt = 1;
		for (int j = i + 1; j < len && line.at(j - 1) == line.at(j); ++j, ++cnt);

		if (flags[line.at(i)]) {
			cout << std::string(cnt / k, line.at(i));
		} else {
			cout << std::string(cnt, line.at(i));
		}
	}

	return 0;
}
{% endhighlight %}

## Summary
PAT Advanced 1112 Stucked Keyboard: tests mod operation, count consecutive characters and test if it can be divided by k, if so, print it in the original order.


text:
using System;
using starshipxac.Shell.PropertySystem.Interop;

namespace starshipxac.Shell.PropertySystem
{
    /// <summary>
    ///     Define the property display method.
    /// </summary>
    [Flags]
    public enum PropertyViewFlags
    {
        Default = PROPDESC_VIEW_FLAGS.PDVF_DEFAULT,

        CenterAlign = PROPDESC_VIEW_FLAGS.PDVF_CENTERALIGN,

        RightAlign = PROPDESC_VIEW_FLAGS.PDVF_RIGHTALIGN,

        BeginNewGroup = PROPDESC_VIEW_FLAGS.PDVF_BEGINNEWGROUP,

        FillArea = PROPDESC_VIEW_FLAGS.PDVF_FILLAREA,

        SortDescending = PROPDESC_VIEW_FLAGS.PDVF_SORTDESCENDING,

        ShowOnlyIfPresent = PROPDESC_VIEW_FLAGS.PDVF_SHOWONLYIFPRESENT,

        ShowByDefault = PROPDESC_VIEW_FLAGS.PDVF_SHOWBYDEFAULT,

        ShowInPrimaryList = PROPDESC_VIEW_FLAGS.PDVF_SHOWINPRIMARYLIST,

        ShowInSecondaryList = PROPDESC_VIEW_FLAGS.PDVF_SHOWINSECONDARYLIST,

        HideLabel = PROPDESC_VIEW_FLAGS.PDVF_HIDELABEL,

        Hidden = PROPDESC_VIEW_FLAGS.PDVF_HIDDEN,

        CanWrap = PROPDESC_VIEW_FLAGS.PDVF_CANWRAP,

        MaskAll = PROPDESC_VIEW_FLAGS.PDVF_MASK_ALL,
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>Tableview</title>
    <link rel="stylesheet" href="../chui/chui.ios.css">

	<app>
		<view id="main" ui-background-style="striped" ui-navigation-status="current">
			<navbar>

Tableview

			</navbar>
			<subview ui-associations="withNavBar">
				<scrollpanel>
					<tableview>
						<tablecell>
							<celltitle>Sleep</celltitle>
							<switchcontrol class="on" id="sleepSwitch">
								 <thumb></thumb>
								 <input type="checkbox" value="ZZZZZZZZ!" name="sleepSwitch">
							</switchcontrol>
						</tablecell>
						<tablecell>
							<celltitle>Food</celltitle>
							<switchcontrol class="off" id="breakfastSwitch">
							 	<thumb></thumb>
								<input type="checkbox" value="I'm hungry!" name="breakfastSwitch">
							</switchcontrol>
						</tablecell>
						<tablecell ui-implements="celltitle-with-button">
							<celltitle>Things</celltitle>
							<uibutton>
								View
							</uibutton>
						</tablecell>
						<tablecell ui-implements="celltitle-with-button">
							<celltitle>Animals</celltitle>
							<uibutton>
								See
							</uibutton>
						</tablecell>
						<tablecell>
							<celltitle>Food</celltitle>
						</tablecell>
					</tableview>
				</scrollpanel>
			</subview>
		</view>
	</app>


text:
<?php

namespace Liuggio\StatsDClientBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
 * This is the class that loads and manages your bundle configuration.
 *
 * To learn more see {@link https://symfony.com/doc/current/bundles/extension.html}
 */
class LiuggioStatsDClientExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration($container->getParameter('kernel.debug'));
        $config = $this->processConfiguration($configuration, $configs);

        foreach ($config['connection'] as $k => $v) {
            $container->setParameter($this->getAlias().'.connection.'.$k, $v);
        }
        $container->setParameter($this->getAlias().'.enable_collector', $config['enable_collector']);
        $container->setParameter($this->getAlias().'.collectors', $config['collectors']);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        if ($config['enable_collector']) {
            $loader->load('collectors.yml');

            if (\count($config['collectors'])) {
                // Define the Listener
                $definition = new Definition('Liuggio\StatsDClientBundle\Listener\StatsDCollectorListener',
                    [new Reference('liuggio_stats_d_client.collector.service')]
                );
                $definition->addTag('kernel.event_subscriber');
                $container->setDefinition('liuggio_stats_d_client.collector.listener', $definition);
            }
        }
        // monolog
        if (!empty($config['monolog']) && $config['monolog']['enable']) {
            $this->loadMonologHandler($config, $container);
        }

        // set the debug sender
        if ($config['connection']['debug']) {
            $senderService = new Definition($config['connection']['debug_class'], []);
            $container->setDefinition('liuggio_stats_d_client.sender.service', $senderService);
        } else {
            $senderService = new Definition($config['connection']['class'], [
                $config['connection']['host'],
                $config['connection']['port'],
                $config['connection']['protocol'],
            ]);
            $container->setDefinition('liuggio_stats_d_client.sender.service', $senderService);
        }
    }

    private function convertLevelToConstant($level)
    {
        return \is_int($level) ? $level : \constant('Monolog\Logger::'.\strtoupper($level));
    }

    /**
     * Loads the Monolog configuration.
     *
     * @param array            $config    A configuration array
     * @param ContainerBuilder $container A ContainerBuilder instance
     */
    protected function loadMonologHandler(array $config, ContainerBuilder $container)
    {
        $def2 = new Definition($config['monolog']['formatter']['class'], [
                $config['monolog']['formatter']['format'],
                $config['monolog']['formatter']['context_logging'],
                $config['monolog']['formatter']['extra_logging'],
                $config['monolog']['formatter']['words'],
            ]
        );
        $container->setDefinition('monolog.formatter.statsd', $def2);

        $def = new Definition('Liuggio\StatsdClient\Monolog\Handler\StatsDHandler', [
            new Reference('liuggio_stats_d_client.service'),
            new Reference('liuggio_stats_d_client.factory'),
            $config['monolog']['prefix'],
            $this->convertLevelToConstant($config['monolog']['level']),
        ]);
        $def->setPublic(false);
        $def->addMethodCall('setFormatter', [new Reference('monolog.formatter.statsd')]);

        $container->setDefinition('monolog.handler.statsd', $def);
    }
}


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import {PriceQuoterComponent} from "./price.quoter.component";
import {OrderComponent} from "./order.component";

@NgModule({
  declarations: [
    AppComponent, PriceQuoterComponent, OrderComponent
  ],
  imports: [BrowserModule],
  bootstrap: [AppComponent]
})
export class AppModule { }