text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Python Module Index — Spark NLP 4.0.0 documentation</title>

  <link href="static/styles/theme.css?digest=1e1de1a1873e13ef5536" rel="stylesheet">
<link href="static/styles/pydata-sphinx-theme.css?digest=1e1de1a1873e13ef5536" rel="stylesheet">

  <link rel="stylesheet"
    href="static/vendor/fontawesome/6.1.2/css/all.min.css">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2">

    <link rel="stylesheet" type="text/css" href="static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="static/css/custom.css" />

  <link rel="preload" as="script" href="static/scripts/pydata-sphinx-theme.js?digest=1e1de1a1873e13ef5536">

    <link rel="shortcut icon" href="static/fav.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />

  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="docsearch:language" content="en">

  <input type="checkbox" class="sidebar-toggle" name="__primary" id="__primary">

  <input type="checkbox" class="sidebar-toggle" name="__secondary" id="__secondary">

<form class="bd-search d-flex align-items-center" action="search.html" method="get">

  <input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
  Ctrl+K
</form>

        Site Navigation

                        Getting Started

                        API Reference

<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" data-toggle="tooltip">

</button>

<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" data-toggle="tooltip">

</button>

        Site Navigation

                        Getting Started

                        API Reference

Python Module Index

   s

       s

       sparknlp_jsl

       sparknlp_jsl._tf_graph_builders

       sparknlp_jsl._tf_graph_builders.assertion_dl

       sparknlp_jsl._tf_graph_builders.assertion_dl.assertion_model

       sparknlp_jsl._tf_graph_builders.generic_classifier

       sparknlp_jsl._tf_graph_builders.generic_classifier.basetfmodel

       sparknlp_jsl._tf_graph_builders.generic_classifier.build_model

       sparknlp_jsl._tf_graph_builders.generic_classifier.generic_classifier_model

       sparknlp_jsl._tf_graph_builders.generic_classifier.progresstracker

       sparknlp_jsl._tf_graph_builders.generic_classifier.settings

       sparknlp_jsl._tf_graph_builders.graph_builders

       sparknlp_jsl._tf_graph_builders.ner_dl

       sparknlp_jsl._tf_graph_builders.ner_dl.create_graph

       sparknlp_jsl._tf_graph_builders.ner_dl.dataset_encoder

       sparknlp_jsl._tf_graph_builders.ner_dl.ner_model

       sparknlp_jsl._tf_graph_builders.ner_dl.ner_model_saver

       sparknlp_jsl._tf_graph_builders.ner_dl.sentence_grouper

       sparknlp_jsl._tf_graph_builders.tf2contrib

       sparknlp_jsl._tf_graph_builders.tf2contrib.core_rnn_cell

       sparknlp_jsl._tf_graph_builders.tf2contrib.fused_rnn_cell

       sparknlp_jsl._tf_graph_builders.tf2contrib.gru_ops

       sparknlp_jsl._tf_graph_builders.tf2contrib.lstm_ops

       sparknlp_jsl._tf_graph_builders.tf2contrib.rnn

       sparknlp_jsl._tf_graph_builders.tf2contrib.rnn_cell

       sparknlp_jsl._tf_graph_builders_1x

       sparknlp_jsl._tf_graph_builders_1x.assertion_dl

       sparknlp_jsl._tf_graph_builders_1x.assertion_dl.assertion_model

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier.basetfmodel

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier.build_model

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier.generic_classifier_model

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier.progresstracker

       sparknlp_jsl._tf_graph_builders_1x.generic_classifier.settings

       sparknlp_jsl._tf_graph_builders_1x.graph_builders

       sparknlp_jsl._tf_graph_builders_1x.ner_dl

       sparknlp_jsl._tf_graph_builders_1x.ner_dl.create_graph

       sparknlp_jsl._tf_graph_builders_1x.ner_dl.dataset_encoder

       sparknlp_jsl._tf_graph_builders_1x.ner_dl.ner_model

       sparknlp_jsl._tf_graph_builders_1x.ner_dl.ner_model_saver

       sparknlp_jsl._tf_graph_builders_1x.ner_dl.sentence_grouper

       sparknlp_jsl.alab

       sparknlp_jsl.annotator

       sparknlp_jsl.annotator.annotation_merger

       sparknlp_jsl.annotator.assertion

       sparknlp_jsl.annotator.assertion.assertion_dl_reg

       sparknlp_jsl.annotator.assertion.assertionDL

       sparknlp_jsl.annotator.chunker

       sparknlp_jsl.annotator.chunker.assertion_filterer

       sparknlp_jsl.annotator.chunker.chunk_converter

       sparknlp_jsl.annotator.chunker.chunk_key_phrase_extraction

       sparknlp_jsl.annotator.chunker.chunk_sentence_splitter

       sparknlp_jsl.annotator.chunker.chunker_filterer

       sparknlp_jsl.annotator.chunker.chunkmapper

       sparknlp_jsl.annotator.chunker.chunkmapper_filterer

       sparknlp_jsl.annotator.classification

       sparknlp_jsl.annotator.classification.document_log_classifier

       sparknlp_jsl.annotator.classification.medical_bert_for_sequence_classification

       sparknlp_jsl.annotator.classification.medical_bert_for_token_classifier

       sparknlp_jsl.annotator.classification.medical_distilbert_for_sequence_classification

       sparknlp_jsl.annotator.context

       sparknlp_jsl.annotator.context.contextual_parser

       sparknlp_jsl.annotator.deid

       sparknlp_jsl.annotator.deid.deIdentification

       sparknlp_jsl.annotator.deid.doccument_hashcoder

       sparknlp_jsl.annotator.deid.name_obfuscator

       sparknlp_jsl.annotator.deid.reIdentification

       sparknlp_jsl.annotator.deid.replacer

       sparknlp_jsl.annotator.disambiguation

       sparknlp_jsl.annotator.disambiguation.ner_disambiguator

       sparknlp_jsl.annotator.doc2_chunk_internal

       sparknlp_jsl.annotator.embeddings

       sparknlp_jsl.annotator.embeddings.average_embeddings

       sparknlp_jsl.annotator.embeddings.bert_sentence_embeddings

       sparknlp_jsl.annotator.embeddings.entity_chunk_embeddings

       sparknlp_jsl.annotator.generic_classifier

       sparknlp_jsl.annotator.generic_classifier.generic_classifier

       sparknlp_jsl.annotator.merge

       sparknlp_jsl.annotator.merge.chunker_merge

       sparknlp_jsl.annotator.ner

       sparknlp_jsl.annotator.ner.iob_tagger

       sparknlp_jsl.annotator.ner.medical_ner

       sparknlp_jsl.annotator.ner.ner_chunker

       sparknlp_jsl.annotator.ner.ner_converter_internal

       sparknlp_jsl.annotator.ner.zero_shot_ner

       sparknlp_jsl.annotator.normalizer

       sparknlp_jsl.annotator.normalizer.date_normalizer

       sparknlp_jsl.annotator.normalizer.drug_normalizer

       sparknlp_jsl.annotator.qa

       sparknlp_jsl.annotator.qa.qa_ner_generator

       sparknlp_jsl.annotator.re

       sparknlp_jsl.annotator.re.relation_extraction

       sparknlp_jsl.annotator.re.relation_extraction_dl

       sparknlp_jsl.annotator.re.relation_ner_chunk_filter

       sparknlp_jsl.annotator.re.zero_shot_relation_extraction

       sparknlp_jsl.annotator.resolution

       sparknlp_jsl.annotator.resolution.resolver_merger

       sparknlp_jsl.annotator.resolution.sentence_entity_resolver

       sparknlp_jsl.annotator.router

       sparknlp_jsl.annotator.tf_graph_builder

       sparknlp_jsl.base

       sparknlp_jsl.compatibility

       sparknlp_jsl.custom_transformer

       sparknlp_jsl.eval

       sparknlp_jsl.finance

       sparknlp_jsl.finance.chunk_classification

       sparknlp_jsl.finance.chunk_classification.assertion

       sparknlp_jsl.finance.chunk_classification.assertion.assertionDL

       sparknlp_jsl.finance.chunk_classification.deid

       sparknlp_jsl.finance.chunk_classification.deid.deIdentification

       sparknlp_jsl.finance.chunk_classification.deid.document_hashcoder

       sparknlp_jsl.finance.chunk_classification.resolution

       sparknlp_jsl.finance.chunk_classification.resolution.chunkmapper

       sparknlp_jsl.finance.chunk_classification.resolution.sentence_entity_resolver

       sparknlp_jsl.finance.graph

       sparknlp_jsl.finance.graph.relation_extraction

       sparknlp_jsl.finance.graph.relation_extraction.relation_extraction_dl

       sparknlp_jsl.finance.graph.relation_extraction.zero_shot_relation_extraction

       sparknlp_jsl.finance.seq_generation

       sparknlp_jsl.finance.seq_generation.qa_ner_generator

       sparknlp_jsl.finance.sequence_classification

       sparknlp_jsl.finance.sequence_classification.finance_bert_for_sequence_classification

       sparknlp_jsl.finance.sequence_classification.finance_classifier_dl

       sparknlp_jsl.finance.token_classification

       sparknlp_jsl.finance.token_classification.ner

       sparknlp_jsl.finance.token_classification.ner.finance_bert_for_token_classifier

       sparknlp_jsl.finance.token_classification.ner.finance_ner

       sparknlp_jsl.finance.token_classification.ner.zero_shot_ner

       sparknlp_jsl.freeze

       sparknlp_jsl.functions

       sparknlp_jsl.internal

       sparknlp_jsl.legal

       sparknlp_jsl.legal.chunk_classification

       sparknlp_jsl.legal.chunk_classification.assertion

       sparknlp_jsl.legal.chunk_classification.assertion.assertionDL

       sparknlp_jsl.legal.chunk_classification.deid

       sparknlp_jsl.legal.chunk_classification.deid.deIdentification

       sparknlp_jsl.legal.chunk_classification.deid.document_hashcoder

       sparknlp_jsl.legal.chunk_classification.resolution

       sparknlp_jsl.legal.chunk_classification.resolution.chunkmapper

       sparknlp_jsl.legal.chunk_classification.resolution.sentence_entity_resolver

       sparknlp_jsl.legal.graph

       sparknlp_jsl.legal.graph.relation_extraction

       sparknlp_jsl.legal.graph.relation_extraction.relation_extraction_dl

       sparknlp_jsl.legal.graph.relation_extraction.zero_shot_relation_extraction

       sparknlp_jsl.legal.seq_generation

       sparknlp_jsl.legal.seq_generation.qa_ner_generator

       sparknlp_jsl.legal.sequence_classification

       sparknlp_jsl.legal.sequence_classification.legal_bert_for_sequence_classification

       sparknlp_jsl.legal.sequence_classification.legal_classifier_dl

       sparknlp_jsl.legal.token_classification

       sparknlp_jsl.legal.token_classification.ner

       sparknlp_jsl.legal.token_classification.ner.legal_bert_for_token_classifier

       sparknlp_jsl.legal.token_classification.ner.legal_ner

       sparknlp_jsl.legal.token_classification.ner.zero_shot_ner

       sparknlp_jsl.modelTracer

       sparknlp_jsl.nlp_test

       sparknlp_jsl.nlp_test.bias

       sparknlp_jsl.nlp_test.bias.bias_testing

       sparknlp_jsl.nlp_test.noisy_labels

       sparknlp_jsl.nlp_test.noisy_labels.noisy_label_fixing

       sparknlp_jsl.nlp_test.noisy_labels.noisy_label_testing

       sparknlp_jsl.nlp_test.noisy_labels.utils

       sparknlp_jsl.nlp_test.robustness

       sparknlp_jsl.nlp_test.robustness.robustness_fixing

       sparknlp_jsl.nlp_test.robustness.robustness_testing

       sparknlp_jsl.nlp_test.robustness.utils

       sparknlp_jsl.pretrained

       sparknlp_jsl.structured_deidentification

       sparknlp_jsl.text_to_documents_columns

       sparknlp_jsl.training

       sparknlp_jsl.updateModels

       sparknlp_jsl.util

       sparknlp_jsl.utils

       sparknlp_jsl.utils.alab_utils

       sparknlp_jsl.utils.imports

    © Copyright 2022, John Snow Labs.

Created using Sphinx 5.3.0.


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

Busqueda personalizada

Busqueda por fecha

<form class="form-inline">

        Fecha
        <input type="date" class="form-control" name="fecha1">

        Entre
        <input type="date" class="form-control" name="fecha2">

    <button type="submit" class="btn btn-default">Buscar</button>
</form>

Busqueda por vehículo

Ver listado

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string name="app_name">SMS Backup+</string>

  <string name="app_description">
     Sauvegardez vos SMS dans votre compte Gmail. Ceci est une version ameliorée de l\'application "SMS Backup" de
     Christpoh Studer ajoutant la possibilité de restaurer vos SMS sauvegardés sur votre mobile.
     Cette version est entièrement rétro-compatible avec les sauvegardes faites avec l\'ancienne version.
  </string>

  <string name="ui_sync_button_label_idle">Sauvegarder</string>
  <string name="ui_sync_button_label_canceling">Arrêt</string>
  <string name="ui_sync_button_label_syncing">Annuler</string>

  <string name="ui_restore_button_label_idle">Restaurer</string>
  <string name="ui_restore_button_label_restoring">Annuler</string>

  <string name="status_idle">Inactif</string>
  <string name="status_idle_details">Dernière sauvegarde effectuée le : <xliff:g id="last_backup_date">%1$s</xliff:g></string>
  <string name="status_idle_details_never">Jamais</string>

  <string name="status_working">En état de marche</string>

  <string name="status_backup">Sauvegarde en cours</string>
  <string name="status_restore">Restauration en cours</string>

  <string name="status_backup_details">Sauvegarde élément <xliff:g id="backed_up_items">%1$d</xliff:g>/<xliff:g id="total_items">%2$d</xliff:g>\u2026</string>
  <string name="status_restore_details">Restauration élément <xliff:g id="backed_up_items">%1$d</xliff:g>/<xliff:g id="total_items">%2$d</xliff:g>\u2026</string>
  <string name="status_login_details">Identification :\u2026</string>
  <string name="status_updating_threads">Mise à jour\u2026</string>
  <string name="status_done">Identifié avec succès</string>
  <string name="status_backup_done_details_max_per_sync">Le maximum de %1$d éléments par sauvegarde a été atteint. Relancez la sauvegarde pour continuer.</string>
  <string name="status_backup_done_details_noitems">Il n\'y a pas d\'éléments à sauvegarder.</string>

  <plurals name="status_backup_done_details">
    <item quantity="one">Sauvegardé avec succès <xliff:g id="total_items">%1$d</xliff:g> élément.</item>
    <item quantity="other">Sauvegardé avec succès <xliff:g id="total_items">%1$d</xliff:g> éléments.</item>
  </plurals>

  <plurals name="status_restore_done_details">
    <item quantity="one">Restauré avec succès <xliff:g id="total_items">%1$d</xliff:g> élément (%2$d éléments identiques).</item>
    <item quantity="other">Restauré avec succès <xliff:g id="total_items">%1$d</xliff:g> éléments (%2$d éléments identiques).</item>
  </plurals>

  <string name="status_restore_canceled_details">%1$d/%2$d éléments restaurés avec succès.</string>

  <string name="status_unknown_error">Erreur</string>
  <string name="notification_unknown_error">Erreur SMSBackup+</string>

  <string name="status_unknown_error_details">Erreur pendant la sauvegarde/restauration :\n<xliff:g id="error_description">%1$s</xliff:g></string>
  <string name="status_auth_failure">Erreur d\'identification</string>
  <string name="notification_auth_failure">Erreur d\'identification SMS Backup+</string>

  <string name="status_auth_failure_details_xoauth">Erreur d\'authentification XOAuth. Veuillez vérifier que vous avez bien activé le protocol IMAP dans les réglages de votre compte Gmail.</string>
  <string name="status_auth_failure_details_plain">Erreur d\'authentification IMAP.
  Veuillez vérifier que vos identifiants soient bien saisis.</string>
  <string name="status_calc_details">Calcul en cours\u2026</string>
  <string name="status_canceled">Annulé</string>
  <string name="status_canceled_details">%1$d/%2$d éléments sauvgardés avec succès.</string>
  <string name="status_gmail_temp_error">Erreur IMAP de GMail, veuillez réessayer plus tard.</string>

  <string name="ui_settings_advanced_label">Paramètres avancés</string>
  <string name="ui_settings_advanced_desc">Définir les réglages avancés</string>
  <string name="ui_settings_advanced_server_label">Paramètres de serveur</string>
  <string name="ui_settings_advanced_server_desc">Ne pas modifier si vous ne vous y connaissez pas !</string>

  <string name="imap_settings">Paramètres IMAP</string>
  <string name="ui_login_label">Nom d\'utilisateur</string>
  <string name="ui_login_desc">Adresse e-mail/nom de votre compte IMAP.</string>
  <string name="ui_login_dialog_msg">ATTENTION: Changer le nom d\'utilisateur pourrait perturber certaines fonctions si vous utilisez l\'identification XOAuth.</string>
  <string name="ui_password_label">Mot de passe</string>
  <string name="ui_password_desc">Mot de passe de votre compte IMAP. Utile seulement si l\'identification XOAuth est désactivé.</string>
  <string name="ui_password_dialog_msg">Le mot de passe est stocké sur votre mobile et n\'est utilisé que pour la connexion à votre compte.</string>
  <string name="ui_server_label">Adresse du serveur</string>
  <string name="ui_server_desc">L\'adresse du serveur auquel vous voulez synchroniser votre appareil, ainsi que le port désiré.</string>
  <string name="ui_server_dialog_msg">La configuration par défaut pour Gmail est \"imap.gmail.com:993\"</string>
  <string name="ui_protocol_label">Sécurité</string>
  <string name="ui_protocol_desc">Le protocole de sécurité utilisé par le serveur. Le protocole par défaut pour Gmail est \"SSL (Requis)\"."</string>
  <string name="ui_authentication_label">Authentification</string>
  <string name="ui_authentication_desc">Méthode d\'authentification. La méthode par défaut pour gmail est \"XOauth\".</string>
  <string name="plain">Texte simple</string>
  <string name="xoauth">XOAuth</string>

  <string name="ui_imap_folder_label">Libellé Gmail</string>
  <string name="ui_imap_folder_desc">Le libellé Gmail associé aux SMS.</string>
  <string name="ui_imap_folder_label_dialog_msg">Les SMS sauvegardés seront classés sous ce libellé.</string>
  <string name="ui_mail_subject_prefix_label">Préfixe utilisé dans le sujet de l\'email</string>
  <string name="ui_mail_subject_prefix_desc">Utiliser le nom du dossier IMAP comme préfixe dans le sujet de l\'email</string>

  <string name="ui_max_items_per_sync_label">Éléments par sauvegarde</string>
  <string name="ui_max_items_per_sync_desc">Nombre maximum d\'éléments par sauvegarde.</string>
  <string name="ui_max_items_per_restore_label">Éléments par restauration</string>
  <string name="ui_max_items_per_restore_desc">Nombre maximum de messages à restaurer.</string>

  <string name="ui_restore_starred_only_label">SMS favoris</string>
  <string name="ui_restore_starred_only_desc">Ne restaurer que les SMS classés "favoris".</string>

  <string name="ui_backup_mms_label">Sauvegarde de MMS</string>
  <string name="ui_backup_mms_desc">Activer la sauvegarde de MMS</string>
  <string name="ui_backup_mms_not_supported">La sauvegarde de MMS n\'est pas gérée sur cette plateforme.</string>

  <string name="ui_backup_calllog_label">Sauvegarde du journal d\'appels</string>
  <string name="ui_backup_calllog_desc">Activer la sauvegarde du journal d\'appels</string>

  <string name="ui_backup_calllog_sync_calendar_enabled_label">Synchroniser au calendrier</string>
  <string name="ui_backup_calllog_sync_calendar_enabled_desc">Ajouter les entrées du journal d\'appel au calendrier</string>

  <string name="ui_backup_calllog_types_label">Types d\'appels</string>
  <string name="ui_backup_calllog_types_desc">Types d\'appels à sauvegarder</string>

  <string name="ui_backup_calllog_sync_calendar_label">Aucun</string>
  <string name="ui_backup_calllog_sync_calendar_desc">Calendrier utilisé pour le journal d\'appels.</string>

  <string name="ui_imap_folder_calllog_label">Label du journal d\'appels</string>
  <string name="ui_imap_folder_calllog_desc">Label Gmail pour les journaux.</string>
  <string name="ui_imap_folder_calllog_label_dialog_msg">Les entrées sauvegardées sur Gmail auront ce label.</string>

  <string name="ui_mark_as_read_label">Marquer comme lus (e-mails)</string>
  <string name="ui_mark_as_read_desc">Définir si les messages (dans Gmail) seront inscrits comme étant lus ou non.</string>
  <string name="ui_mark_as_read_restore_label">Marquer comme lus (SMS)</string>
  <string name="ui_mark_as_read_restore_desc">Définir si les messages restaurés seront inscrits comme étant lus ou non.</string>

  <string name="ui_email_address_style_label">Style d\'adresse e-mail</string>
  <string name="ui_email_address_style_desc">Format des adresses e-mail</string>

  <string name="ui_enable_auto_sync_label">Sauvegarde automatique</string>
  <string name="ui_enable_auto_sync_desc">Définir si les nouveaux SMS seront sauvegardés de façon automatique ou non.</string>
  <string name="ui_enable_auto_sync_summary">Sauvergarde automatique de %1$s.</string>

  <string name="sd_card_disclaimer">La sauvegarde automatique pourrait ne pas fonctionner correctement si l\'application est installée sur la carte SD.</string>

  <string name="ui_enable_auto_sync_bg_data">Vous avez également besoin d\'activer les données d\'arrière plan.</string>

  <string name="ui_auto_backup_schedule_label">Intervalle</string>
  <string name="ui_auto_backup_schedule_desc">Définir à quelle fréquence les SMS seront sauvegardés.</string>

  <string name="ui_auto_backup_incoming_schedule_label">Planification des messages entrants</string>
  <string name="ui_auto_backup_incoming_schedule_desc">Définir quand les SMS seront sauvegardés après leur réception.</string>

  <string name="ui_wifi_only_label">WiFi requis</string>
  <string name="ui_wifi_only_desc">Ne sauvegarder/restaurer que quand l\'appareil est connecté au WiFi</string>

  <string name="ui_notifications_label">Notifications</string>
  <string name="ui_notifications_desc">Notifications d\'arrière plan</string>

  <string name="error_wifi_only_no_connection">Pas de connexion WiFi</string>
  <string name="error_no_connection">Pas de connexion internet</string>

  <string name="ui_dialog_missing_credentials_title">Informations d\'identification</string>

  <string name="ui_dialog_missing_credentials_msg_xoauth">Vous devez d\'abord vous connecter à votre compte Gmail.</string>
  <string name="ui_dialog_missing_credentials_msg_plain">Vous devez d\'abord définir vos identifiants.</string>
  <string name="ui_dialog_invalid_imap_folder_title">Nom du libellé invalide</string>
  <string name="ui_dialog_invalid_imap_folder_msg">Le nom du libellé ne peut contenir que des lettres non accentuées et des chiffres (A-Z, a-z, 0-9), \'/\'.</string>
  <string name="ui_dialog_first_sync_title">Première sauvegarde</string>
  <string name="ui_dialog_first_sync_msg">Sauvegarder ou non les messages stockés actuellement sur cet appareil ?</string>
  <string name="ui_dialog_first_sync_msg_batched">Sauvegarder ou non les messages actuellement stockés sur cet appareil ?\n\nA savoir : la sauvegarde se fera par tranche de %1$d messages.</string>
  <string name="ui_dialog_request_token_msg">Connexion à Google…</string>
  <string name="ui_dialog_access_token_msg">Demande d\'accès…</string>

  <string name="ui_dialog_access_token_error_title">Echec de l\'authentification</string>
  <string name="ui_dialog_access_token_error_msg">Impossible d\'obtenir la clé d\'identification. Veuillez vérifier que vous avez bien selectionné \"Autoriser l\'accès\".
  </string>

  <string name="ui_dialog_connect_msg">Votre navigateur va s\'ouvrir, vous demandant de vous identifier à Gmail, afin d\'autoriser %1$s l\'accès à vos e-mails.</string>
  <string name="ui_dialog_connect_token_error">Impossible d\'obtenir la requête d\'identification de Google. Veuillez vérifier que le réseau est actif et que le fuseau horaire est configuré correctement.</string>
  <string name="ui_dialog_disconnect_msg">Êtes-vous certain ? Vous devrez ensuite ré-autoriser l\'accès à votre compte une fois déconnecté, et la syncronisation locale sera réinitialisée.</string>

  <string name="ui_dialog_upgrade_title">Informations de mises à jour</string>
  <string name="ui_dialog_upgrade_msg">
   SMS Backup+ est entièrement rétro-compatible avec SMS Backup. Veuillez cependant vérifier que l\'option \"Sauvegarde automatique\" n\'est activée que dans une des deux applications, sinon vous aurez des sauvegardes en double. Il est également conseillé de séléctionner \"Ignorer\" les messages pour votre première sauvgarde, si vous les avez déjà sauvegardés.
  </string>

  <string name="ui_dialog_brokendroidx_title">Bug SMS DROID X</string>
  <string name="ui_dialog_brokendroidx_msg">Il y a un bug avec le Droid X qui
  empêche cette application de sauvegarder les message entrants. Plus d\'informations dans FAQ
  disponible sur le site.</string>

  <string name="ui_sync">Sauvegarder</string>
  <string name="ui_skip">Ignorer</string>
  <string name="err_sync_requires_login_info">La sauvegarde ne peut être effectuée sans les informations de connexion.</string>
  <string name="menu_info">À propos de</string>
  <string name="menu_reset">Réinitialiser</string>
  <string name="ui_dialog_reset_title">Réinitialiser l\'état actuel de synchronisation</string>
  <string name="ui_dialog_reset_message">Voulez-vous réinitialiser l\'état de synchronisation actuelle ? Vous pourrez choisir d\'ignorer les messages ou non, plus tard.</string>
  <string name="all_messages">Tout</string>

  <string name="gmail_needs_connecting">Appuyez ici pour vous connecter à votre compte Gmail (requis).</string>
  <string name="gmail_already_connected">Connecté à %1$s.</string>

  <string name="ui_connected_label">Connecter</string>
  <string name="ui_connected_desc">Votre compte doit être connecté.</string>

  <string name="call_incoming">appel entrant</string>
  <string name="call_outgoing">appel sortant</string>
  <string name="call_missed">appel raté</string>

  <string name="call_missed_text">Appel raté de %1$s</string>
  <string name="call_incoming_text">Appel de %1$s</string>
  <string name="call_outgoing_text">Appel à %1$s</string>

  <string name="call_number_field">Numéro : %1$s</string>
  <string name="call_duration_field">Durée : %1$s</string>

  <string name="sms_with_field">SMS avec %1$s</string>
  <!-- the subject line needs to be identical otherwise threading will be messed up -->
  <string name="mms_with_field">@string/sms_with_field</string>
  <string name="call_with_field">Appel avec %1$s</string>

  <string name="ui_backup_contact_group_label">Contacts à sauvegarder</string>
  <string name="ui_backup_contact_group_desc">Sauvegarder les données uniquement pour certains groupes spécifiques</string>

  <string name="everybody">Tout le monde</string>

  <string name="call_type_everything">Tous</string>
  <string name="call_type_incoming">Appels entrants seulement</string>
  <string name="call_type_outgoing">Appels sortants seulement</string>
  <string name="call_type_incoming_outgoing">Entrants & Sortants</string>
  <string name="call_type_missed">Appels ratés seulement</string>

  <string name="email_address_style_name">Nom</string>
  <string name="email_address_style_name_and_number">Nom (+00 123456)</string>
  <string name="email_address_style_number">+00 123456</string>

  <string name="_1h">1 h</string>
  <string name="_2h">2 h</string>
  <string name="_6h">6 h</string>
  <string name="_24h">24 h</string>
  <string name="never">Never</string>

  <string name="_1min">1 min</string>
  <string name="_3mins">3 min</string>
  <string name="_30mins">30 min</string>

  <string name="ssl_required">SSL (Requis)</string>
  <string name="ssl_optional">SSL (Facultatif)</string>
  <string name="tls_required">TLS (Requis)</string>
  <string name="tls_optional">TLS (Facultatif)</string>
  <string name="none">Aucun</string>

  <string name="ui_third_party_integration_label">Intégration des applications tierces</string>
  <string name="ui_third_party_integration_desc">Autoriser des applications tierces à lancer le processus de sauvergarde</string>

  <!-- new ui -->
  <string name="ui_backup_settings_label">Paramètres de sauvegarde</string>
  <!-- <string name="ui_backup_settings_desc">Backup settings</string> -->

  <string name="ui_backup_calllog_settings_label">Paramètres de sauvegarde du journal d\'appel</string>
  <!-- <string name="ui_backup_calllog_settings_desc">Call log settings</string> -->

  <string name="auto_backup_settings">Paramètres de sauvegarde automatique</string>
  <string name="ui_auto_backup_settings_label">@string/auto_backup_settings</string>

  <string name="ui_restore_settings_label">Paramètres de restauration</string>
  <!-- <string name="ui_restore_settings_desc">Restore settings</string> -->

  <string name="ui_backup_sms_label">Sauvegarde des SMS</string>
  <string name="ui_backup_sms_desc">Activer la sauvegarde des SMS</string>

  <string name="ui_restore_sms_label">Restaurer les SMS</string>
  <string name="ui_restore_sms_desc"/>

  <string name="ui_feature_not_available_yet">(Fonction encore indisponible)</string>

  <string name="ui_restore_mms_label">Restaurer les MMS</string>
  <string name="ui_restore_mms_desc">@string/ui_feature_not_available_yet</string>

  <string name="ui_restore_calllog_label">Restaurer le journal d\'appel</string>
  <string name="ui_restore_calllog_desc"/>

  <string name="sms">SMS</string>
  <string name="mms">MMS</string>
  <string name="calllog">Journal d\'appel</string>

  <string name="ui_dialog_donate_message">Veuillez spécifier le montant ainsi que la devise :</string>
  <string name="ui_donation_success_message">Don effectué, merci !</string>
  <string name="ui_donation_failure_message">Erreur lors du don : %1$s</string>

  <string name="pref_disable_acra">Rapporter les crashs</string>
  <string name="pref_acra_enabled">SMS Backup+ va automatiquement envoyer un rapport d\'erreur après sa fermeture forcée.</string>
  <string name="pref_acra_disabled">Désactivé</string>

  <string name="app_log_skip_backup_background_data">Skipped because background data is disabled</string>
  <string name="app_log_skip_backup_already_running">Skipped because backup already running</string>
  <string name="app_log_skip_backup_skip_messages">Skip all messages</string>
  <string name="app_log_skip_backup_no_items">Skipped (no items found)</string>
  <string name="app_log_missing_credentials">Skipped (missing credentials)</string>
  <string name="app_log_backup_requested">Sauvegarde demandée (%1$s)</string>
  <string name="app_log_start_backup">Démarrage de la sauvegarde (%1$s)</string>
  <string name="app_log_backup_messages">Sauvegarde en cours (%1$d SMS, %2$d MMS, %3$d appels)</string>
  <string name="app_log_backup_canceled">Sauvegarde annulée</string>
  <string name="app_log_backup_finished">Sauvegarde effectuée</string>

  <string name="app_log_backup_failed_authentication">Erreur d\'authentification : %1$s</string>
  <string name="app_log_backup_failed_messaging">Erreur générale : %1$s</string>
  <string name="app_log_backup_failed_connectivity">Sauvegarde non effectuée, aucune connection</string>
  <string name="app_log_scheduled_next_sync">Prochaine sauvegarde prévue pour : %1$s</string>
  <string name="app_log_no_next_sync">Pas de nouvelle sauvegarde prévue</string>

  <string name="menu_view_log">Voir journal</string>
  <string name="app_log_empty">Le journal est vide. Activez-le dans \"Paramètres avancés\".</string>

  <string name="pref_app_log">Synchroniser journal</string>
  <string name="pref_app_log_enabled">Journal stocké sur la carte SD en tant que \"sms_backup_plus.log\".</string>
  <string name="pref_app_log_disabled">@string/pref_acra_disabled</string>

  <string name="source_incoming">entrant</string>
  <string name="source_regular">régulier</string>
  <string name="source_3rd_party">application tierce</string>
  <string name="source_manual">manuel</string>
  <string name="source_unknown">inconnu</string>
</resources>


text:
namespace Bebbs.Harmonize.With.Owl.Intuition.Command.Request
{
    public class Save : IRequest
    {
        public string AsString()
        {
            return Verb.Save;
        }
    }
}


text:
module Pod
  class Installer
    # Controller class responsible of executing the prepare command
    # of a single Pod.
    #
    class PodSourcePreparer
      # @return [Specification] the root specification of the Pod.
      #
      attr_reader :spec

      # @return [Pathname] the folder where the source of the Pod is located.
      #
      attr_reader :path

      # Initialize a new instance
      #
      # @param [Specification] spec the root specification of the Pod.
      # @param [Pathname] path the folder where the source of the Pod is located.
      #
      def initialize(spec, path)
        raise "Given spec isn't a root spec, but must be." unless spec.root?
        @spec = spec
        @path = path
      end

      #-----------------------------------------------------------------------#

      public

      # @!group Preparation

      # Executes the prepare command if there is one.
      #
      # @return [void]
      #
      def prepare!
        run_prepare_command
      end

      #-----------------------------------------------------------------------#

      private

      # @!group Preparation Steps

      extend Executable
      executable :bash

      # Runs the prepare command bash script of the spec.
      #
      # @note   Unsets the `CDPATH` env variable before running the
      #         shell script to avoid issues with relative paths
      #         (issue #1694).
      #
      # @return [void]
      #
      def run_prepare_command
        return unless spec.prepare_command
        UI.section(' > Running prepare command', '', 1) do
          Dir.chdir(path) do
            begin
              ENV.delete('CDPATH')
              ENV['COCOAPODS_VERSION'] = Pod::VERSION
              prepare_command = spec.prepare_command.strip_heredoc.chomp
              full_command = "\nset -e\n" + prepare_command
              bash!('-c', full_command)
            ensure
              ENV.delete('COCOAPODS_VERSION')
            end
          end
        end
      end

      #-----------------------------------------------------------------------#
    end
  end
end


text:
package org.jruby.ast.visitor.rewriter;

import org.jruby.ast.visitor.rewriter.utils.Indentor;

public interface FormatHelper {

	public abstract Indentor getIndentor();

	public abstract String getListSeparator();

	public abstract String beforeCallArguments();

	public abstract String afterCallArguments();

	public abstract String beforeMethodArguments();

	public abstract String afterMethodArguments();

	public abstract String hashAssignment();

	public abstract String beforeHashContent();

	public abstract String afterHashContent();

	public abstract String matchOperator();

	public abstract String beforeAssignment();

	public abstract String beforeIterBrackets();

	public abstract String afterAssignment();

	public abstract String beforeIterVars();

	public abstract String afterIterVars();

	public abstract String beforeClosingIterBrackets();

	public abstract String classBodyElementsSeparator();

	public abstract String getLineDelimiter();
}


text:
<!doctype html>

	<title>Thread Demo - toxiclibs.js examples</title>
	<meta name="author" content="Kyle Phillips">

	<link href="css/style.css" rel="stylesheet" type="text/css" media="screen">

		<hgroup>

Thread Demo

w/ Processing.js
		</hgroup>

<canvas id="myCanvas" width="200" height="200">
	your browser doesnt support canvas
</canvas>

original example by Karsten Schmidt

	Toxiclibs ported to js by Kyle Phillips

Usage:

Click the mouse to lock/unlock the end of the string at its current position.

The head of the string is always linked to the current mouse position

 Thread demo showing the following:

construction of a 2D string made from particles and springs/sticks using the toxi.physics2d.ParticleString2D class

dynamic locking & unlocking of particles


text:
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(30) NOT NULL,
  `psw` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;


text:
package ba.jamax.util.rest.service;

import ba.jamax.util.rest.model.TestEntity;
import ba.jamax.util.rest.service.GenericServiceImpl;

public class TestService extends GenericServiceImpl<TestEntity> {

}


text:
using Gigya.Microdot.Interfaces.Configuration;

namespace Gigya.Microdot.Configuration
{
    public class Configuration : IConfiguration
    {
        private readonly IConfigFuncFactory _configFuncFactory;

        public Configuration(IConfigFuncFactory configFuncFactory)
        {
            _configFuncFactory = configFuncFactory;
        }

        public T GetObject<T>() where T : IConfigObject
        {
            return _configFuncFactory.CreateConfigFunc<T>()();
        }
    }
}


text:
import qmk
import pu.utils

class RotateNCommand(qmk.Command):
    '''Perform a Caesar cipher and return the result.'''
    def __init__(self):
        self._name = 'rotate-n'
        self._help = self.__doc__

    @qmk.Command.actionRequiresArgument
    def action(self, arg):
        qmk.Message()(pu.utils.rotn(arg))

def commands(): return [ RotateNCommand() ]


text:
sudo apt-get install -y zlib1g-dev libssl-dev

.ci/install-libuv.sh
autoreconf -fi
./configure --enable-debug
make distcheck 2>/dev/null


text:
package org.apache.geode.pdx.internal.unsafe;

import java.lang.reflect.Field;

import sun.misc.Unsafe;

/**
 * This class wraps the sun.misc.Unsafe class which is only available on Sun JVMs. It is also
 * available on other JVMs (like IBM).
 *
 *
 */
public class UnsafeWrapper {

  private final Unsafe unsafe;
  {
    Unsafe tmp = null;
    try {
      Field field = Unsafe.class.getDeclaredField("theUnsafe");
      field.setAccessible(true);
      tmp = (Unsafe) field.get(null);
    } catch (Exception e) {
      throw new AssertionError(e);
    }
    unsafe = tmp;
  }

  public long objectFieldOffset(Field f) {
    return this.unsafe.objectFieldOffset(f);
  }

  public int getInt(Object o, long offset) {
    return this.unsafe.getInt(o, offset);
  }

  public int getIntVolatile(Object o, long offset) {
    return this.unsafe.getIntVolatile(o, offset);
  }

  /**
   * Returns 4 if this is a 32bit jvm; otherwise 8. Note it does not account for compressed oops.
   */
  public int getAddressSize() {
    return this.unsafe.addressSize();
  }

  public void putInt(Object o, long offset, int v) {
    this.unsafe.putInt(o, offset, v);
  }

  public void putIntVolatile(Object o, long offset, int v) {
    this.unsafe.putIntVolatile(o, offset, v);
  }

  public boolean compareAndSwapInt(Object o, long offset, int expected, int v) {
    return this.unsafe.compareAndSwapInt(o, offset, expected, v);
  }

  public boolean getBoolean(Object o, long offset) {
    return this.unsafe.getBoolean(o, offset);
  }

  public void putBoolean(Object o, long offset, boolean v) {
    this.unsafe.putBoolean(o, offset, v);
  }

  public byte getByte(Object o, long offset) {
    return this.unsafe.getByte(o, offset);
  }

  public void putByte(Object o, long offset, byte v) {
    this.unsafe.putByte(o, offset, v);
  }

  public short getShort(Object o, long offset) {
    return this.unsafe.getShort(o, offset);
  }

  public void putShort(Object o, long offset, short v) {
    this.unsafe.putShort(o, offset, v);
  }

  public char getChar(Object o, long offset) {
    return this.unsafe.getChar(o, offset);
  }

  public void putChar(Object o, long offset, char v) {
    this.unsafe.putChar(o, offset, v);
  }

  public long getLong(Object o, long offset) {
    return this.unsafe.getLong(o, offset);
  }

  public long getLongVolatile(Object o, long offset) {
    return this.unsafe.getLongVolatile(o, offset);
  }

  public void putLong(Object o, long offset, long v) {
    this.unsafe.putLong(o, offset, v);
  }

  public void putLongVolatile(Object o, long offset, long v) {
    this.unsafe.putLongVolatile(o, offset, v);
  }

  public boolean compareAndSwapLong(Object o, long offset, long expected, long v) {
    return this.unsafe.compareAndSwapLong(o, offset, expected, v);
  }

  public float getFloat(Object o, long offset) {
    return this.unsafe.getFloat(o, offset);
  }

  public void putFloat(Object o, long offset, float v) {
    this.unsafe.putFloat(o, offset, v);
  }

  public double getDouble(Object o, long offset) {
    return this.unsafe.getDouble(o, offset);
  }

  public void putDouble(Object o, long offset, double v) {
    this.unsafe.putDouble(o, offset, v);
  }

  public Object getObject(Object o, long offset) {
    return this.unsafe.getObject(o, offset);
  }

  public void putObject(Object o, long offset, Object v) {
    this.unsafe.putObject(o, offset, v);
  }

  public Object allocateInstance(Class<?> c) throws InstantiationException {
    return this.unsafe.allocateInstance(c);
  }

  public long allocateMemory(long size) {
    return this.unsafe.allocateMemory(size);
  }

  public byte getByte(long addr) {
    return this.unsafe.getByte(addr);
  }

  public void putByte(long addr, byte value) {
    this.unsafe.putByte(addr, value);
  }

  public void copyMemory(Object o1, long addr1, Object o2, long addr2, long size) {
    this.unsafe.copyMemory(o1, addr1, o2, addr2, size);
  }

  public void copyMemory(long src, long dst, long size) {
    this.unsafe.copyMemory(src, dst, size);
  }

  public void freeMemory(long addr) {
    this.unsafe.freeMemory(addr);
  }

  public int arrayBaseOffset(Class c) {
    return this.unsafe.arrayBaseOffset(c);
  }

  public int arrayScaleIndex(Class c) {
    return this.unsafe.arrayIndexScale(c);
  }

  public long fieldOffset(Field f) {
    return this.unsafe.objectFieldOffset(f);
  }

  public int getPageSize() {
    return this.unsafe.pageSize();
  }

  public void setMemory(long addr, long size, byte v) {
    this.unsafe.setMemory(addr, size, v);
  }
}


text:
package serilogj.policies;

import serilogj.core.ILogEventPropertyValueFactory;
import serilogj.core.IScalarConversionPolicy;
import serilogj.core.ScalarConversionPolicyResult;
import serilogj.events.ScalarValue;

// Copyright 2013-2015 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
public class ByteArrayScalarConversionPolicy implements IScalarConversionPolicy {
	private static final int MaximumByteArrayLength = 1024;

	@Override
	public ScalarConversionPolicyResult tryConvertToScalar(Object value,
			ILogEventPropertyValueFactory propertyValueFactory) {
		ScalarConversionPolicyResult result = new ScalarConversionPolicyResult();
		if (value instanceof byte[]) {
			byte[] arr = (byte[]) value;
			if (arr.length > MaximumByteArrayLength) {
				String description = "";
				for (int i = 0; i < 16; i++) {
					description = description + String.format("%02X", arr[i]);
				}
				description = description + "... (" + arr.length + " bytes)";

				result.isValid = true;
				result.result = new ScalarValue(description);
			} else {
				byte[] clone = new byte[arr.length];
				for (int i = 0; i < arr.length; i++) {
					clone[i] = arr[i];
				}

				result.isValid = true;
				result.result = new ScalarValue(clone);
			}
		}
		return result;
	}
}


text:
package com.vaadin.tests.application;

import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.vaadin.server.DeploymentConfiguration;
import com.vaadin.server.RequestHandler;
import com.vaadin.server.ServiceException;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinResponse;
import com.vaadin.server.VaadinServlet;
import com.vaadin.server.VaadinServletService;
import com.vaadin.server.VaadinSession;
import com.vaadin.server.communication.HeartbeatHandler;
import com.vaadin.server.communication.UidlRequestHandler;
import com.vaadin.ui.UI;

public class CommErrorEmulatorServlet extends VaadinServlet {

    private Map<UI, Integer> uidlResponseCode = Collections
            .synchronizedMap(new HashMap<UI, Integer>());
    private Map<UI, Integer> heartbeatResponseCode = Collections
            .synchronizedMap(new HashMap<UI, Integer>());

    private final CommErrorUIDLRequestHandler uidlHandler = new CommErrorUIDLRequestHandler();
    private final CommErrorHeartbeatHandler heartbeatHandler = new CommErrorHeartbeatHandler();

    public class CommErrorUIDLRequestHandler extends UidlRequestHandler {
        @Override
        public boolean synchronizedHandleRequest(VaadinSession session,
                VaadinRequest request, VaadinResponse response)
                throws IOException {
            UI ui = session.getService().findUI(request);
            if (ui != null && uidlResponseCode.containsKey(ui)) {
                response.sendError(uidlResponseCode.get(ui), "Error set in UI");
                return true;
            }

            return super.synchronizedHandleRequest(session, request, response);
        }
    }

    public class CommErrorHeartbeatHandler extends HeartbeatHandler {
        @Override
        public boolean synchronizedHandleRequest(VaadinSession session,
                VaadinRequest request, VaadinResponse response)
                throws IOException {
            UI ui = session.getService().findUI(request);
            if (ui != null && heartbeatResponseCode.containsKey(ui)) {
                response.sendError(heartbeatResponseCode.get(ui),
                        "Error set in UI");
                return true;
            }

            return super.synchronizedHandleRequest(session, request, response);
        }

    }

    public class CommErrorEmulatorService extends VaadinServletService {

        public CommErrorEmulatorService(VaadinServlet servlet,
                DeploymentConfiguration deploymentConfiguration)
                throws ServiceException {
            super(servlet, deploymentConfiguration);
        }

        @Override
        protected List<RequestHandler> createRequestHandlers()
                throws ServiceException {
            List<RequestHandler> handlers = super.createRequestHandlers();
            handlers.add(uidlHandler);
            handlers.add(heartbeatHandler);
            return handlers;
        }
    }

    @Override
    protected VaadinServletService createServletService(
            DeploymentConfiguration deploymentConfiguration)
            throws ServiceException {
        CommErrorEmulatorService s = new CommErrorEmulatorService(this,
                deploymentConfiguration);
        s.init();
        return s;
    }

    public void setUIDLResponseCode(final UI ui, int responseCode,
            final int delay) {
        uidlResponseCode.put(ui, responseCode);
        System.out.println("Responding with " + responseCode
                + " to UIDL requests for " + ui + " for the next " + delay
                + "s");

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(delay * 1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("Handing UIDL requests normally again");

                uidlResponseCode.remove(ui);
            }
        }).start();
    }

    public void setHeartbeatResponseCode(final UI ui, int responseCode,
            final int delay) {
        heartbeatResponseCode.put(ui, responseCode);

        System.out.println("Responding with " + responseCode
                + " to heartbeat requests for " + ui + " for the next " + delay
                + "s");

        new Thread(new Runnable() {

            @Override
            public void run() {
                try {
                    Thread.sleep(delay * 1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("Handing heartbeat requests normally again");
                heartbeatResponseCode.remove(ui);
            }
        }).start();
    }

}


text:
namespace blink {

class KURL;

// Provides a mock object for the navigatorcontentutils client.
class NavigatorContentUtilsClientMock final : public NavigatorContentUtilsClient {
public:
    static PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClientMock> create()
    {
        return adoptPtrWillBeNoop(new NavigatorContentUtilsClientMock);
    }

    ~NavigatorContentUtilsClientMock() override { }

    virtual void registerProtocolHandler(const String& scheme, const KURL&, const String& title);

    virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const KURL&);
    virtual void unregisterProtocolHandler(const String& scheme, const KURL&);

private:
    NavigatorContentUtilsClientMock() { }

    typedef struct {
        String scheme;
        KURL url;
        String title;
    } ProtocolInfo;

    typedef HashMap<String, ProtocolInfo> RegisteredProtocolMap;
    RegisteredProtocolMap m_protocolMap;
};

} // namespace blink

#endif // NavigatorContentUtilsClientMock_h


text:
package xesende

import (
	"net/http/httptest"
	"net/url"
	"strconv"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestAccountMessagesSent(t *testing.T) {
	const (
		startIndex  = 0
		count       = 15
		totalCount  = 200
		id          = "messageheaderid"
		uri         = "http://somemessageheader"
		reference   = "EXETRTRE"
		status      = "STATUS"
		messageType = Voice
		to          = "4538224364236"
		from        = "428377843"
		summary     = "SUM"
		bodyURI     = "http://rrehekr"
		direction   = "OUT"
		parts       = 1
		username    = "user"
	)

	var (
		lastStatusAt    = time.Date(2012, 1, 1, 12, 0, 5, 0, time.UTC)
		lastStatusAtStr = "2012-01-01T12:00:05.000"
		submittedAt     = time.Date(2012, 1, 1, 12, 0, 2, 0, time.UTC)
		submittedAtStr  = "2012-01-01T12:00:02.000"
	)

	h := newRecordingHandler(`<?xml version="1.0" encoding="utf-8"?>
<messageheaders startindex="`+strconv.Itoa(startIndex)+`" count="`+strconv.Itoa(count)+`" totalcount="`+strconv.Itoa(totalCount)+`" xmlns="http://api.esendex.com/ns/">
 <messageheader id="`+id+`" uri="`+uri+`">
  <reference>`+reference+`</reference>
  <status>`+status+`</status>
  <laststatusat>`+lastStatusAtStr+`</laststatusat>
  <submittedat>`+submittedAtStr+`</submittedat>
  <type>`+string(messageType)+`</type>
  <to>
    <phonenumber>`+to+`</phonenumber>
  </to>
  <from>
   <phonenumber>`+from+`</phonenumber>
  </from>
  <summary>`+summary+`</summary>
  <body uri="`+bodyURI+`"/>
  <direction>`+direction+`</direction>
  <parts>`+strconv.Itoa(parts)+`</parts>
  <username>`+username+`</username>
 </messageheader>
</messageheaders>`, 200, map[string]string{})
	s := httptest.NewServer(h)
	defer s.Close()

	client := New("user", "pass")
	client.BaseURL, _ = url.Parse(s.URL)

	account := client.Account("EXHEY")

	result, err := account.Sent()

	assert := assert.New(t)

	assert.Nil(err)

	assert.Equal("GET", h.Request.Method)
	assert.Equal("/v1.0/messageheaders", h.Request.URL.Path)

	if user, pass, ok := h.Request.BasicAuth(); assert.True(ok) {
		assert.Equal("user", user)
		assert.Equal("pass", pass)
	}

	query := h.Request.URL.Query()
	assert.Equal("EXHEY", query.Get("accountReference"))

	assert.Equal(startIndex, result.StartIndex)
	assert.Equal(count, result.Count)
	assert.Equal(totalCount, result.TotalCount)

	if assert.Equal(1, len(result.Messages)) {
		message := result.Messages[0]

		assert.Equal(id, message.ID)
		assert.Equal(uri, message.URI)
		assert.Equal(reference, message.Reference)
		assert.Equal(status, message.Status)
		assert.Equal(lastStatusAt, message.LastStatusAt)
		assert.Equal(submittedAt, message.SubmittedAt)
		assert.Equal(messageType, message.Type)
		assert.Equal(to, message.To)
		assert.Equal(from, message.From)
		assert.Equal(summary, message.Summary)
		assert.Equal(bodyURI, message.bodyURI)
		assert.Equal(direction, message.Direction)
		assert.Equal(parts, message.Parts)
		assert.Equal(username, message.Username)
	}
}

func TestAccountMessagesReceived(t *testing.T) {
	const (
		startIndex  = 0
		count       = 15
		totalCount  = 200
		id          = "messageheaderid"
		uri         = "http://somemessageheader"
		reference   = "EXETRTRE"
		status      = "STATUS"
		messageType = SMS
		to          = "4538224364236"
		from        = "428377843"
		summary     = "SUM"
		bodyURI     = "http://rrehekr"
		direction   = "OUT"
		parts       = 1
		readBy      = "someone"
	)

	var (
		receivedAt    = time.Date(2012, 1, 1, 12, 0, 5, 0, time.UTC)
		receivedAtStr = "2012-01-01T12:00:05"
		readAt        = time.Date(2012, 1, 1, 12, 0, 2, 0, time.UTC)
		readAtStr     = "2012-01-01T12:00:02"
	)

	h := newRecordingHandler(`<?xml version="1.0" encoding="utf-8"?>
<messageheaders startindex="`+strconv.Itoa(startIndex)+`" count="`+strconv.Itoa(count)+`" totalcount="`+strconv.Itoa(totalCount)+`" xmlns="http://api.esendex.com/ns/">
 <messageheader id="`+id+`" uri="`+uri+`">
  <reference>`+reference+`</reference>
  <status>`+status+`</status>
  <receivedat>`+receivedAtStr+`</receivedat>
  <type>`+string(messageType)+`</type>
  <to>
    <phonenumber>`+to+`</phonenumber>
  </to>
  <from>
   <phonenumber>`+from+`</phonenumber>
  </from>
  <summary>`+summary+`</summary>
  <body uri="`+bodyURI+`"/>
  <direction>`+direction+`</direction>
  <parts>`+strconv.Itoa(parts)+`</parts>
  <readat>`+readAtStr+`</readat>
  <readby>`+readBy+`</readby>
 </messageheader>
</messageheaders>`, 200, map[string]string{})
	s := httptest.NewServer(h)
	defer s.Close()

	client := New("user", "pass")
	client.BaseURL, _ = url.Parse(s.URL)

	account := client.Account("EXHEY")
	result, err := account.Received()

	assert := assert.New(t)

	assert.Nil(err)

	assert.Equal("GET", h.Request.Method)
	assert.Equal("/v1.0/inbox/EXHEY/messages", h.Request.URL.String())

	if user, pass, ok := h.Request.BasicAuth(); assert.True(ok) {
		assert.Equal("user", user)
		assert.Equal("pass", pass)
	}

	assert.Equal(startIndex, result.StartIndex)
	assert.Equal(count, result.Count)
	assert.Equal(totalCount, result.TotalCount)

	if assert.Equal(1, len(result.Messages)) {
		message := result.Messages[0]

		assert.Equal(id, message.ID)
		assert.Equal(uri, message.URI)
		assert.Equal(reference, message.Reference)
		assert.Equal(status, message.Status)
		assert.Equal(receivedAt, message.ReceivedAt)
		assert.Equal(messageType, message.Type)
		assert.Equal(to, message.To)
		assert.Equal(from, message.From)
		assert.Equal(summary, message.Summary)
		assert.Equal(bodyURI, message.bodyURI)
		assert.Equal(direction, message.Direction)
		assert.Equal(parts, message.Parts)
		assert.Equal(readAt, message.ReadAt)
		assert.Equal(readBy, message.ReadBy)
	}
}


text:
var $ = require('tinyselector');
var minimatch = require('minimatch');

function View(options) {
  var self = this;
  var o = self._options = options || {};
  var dom = self._dom = self.create(o);
  $(dom).attr('id', o.id).ac('xw-view');
  dom.view = self;
  self.init(o);
  if( o.hidden ) this.hide(o);
}

View.prototype = {
  get id() {
    return $(this.dom()).attr('id');
  },
  init: function(o) {
    var self = this;
    var dom = self.dom();
    var el = $(dom);

    if( o.style ) el.css(o.style);
    if( o.cls ) el.ac(o.cls);
    if( o.flexbox ) el.attr('flexbox', o.flexbox);
    if( o.flex ) el.attr('flex', o.flex);
    if( o.state ) self.state(o.state);
    if( typeof o.attrs == 'object' ) el.attrs(o.attrs);
    if( typeof o.attrs == 'function' ) el.attrs(o.attrs.call(self));
    if( typeof o.state == 'string' ) el.ac('xw-state-responder');
    if( typeof o.html == 'string' ) self.html(o.html);
    if( typeof o.html == 'function' ) self.html(o.html.call(self));

    var width = o.width;
    if( width ) {
      if( typeof width == 'function' ) width = width.call(self);

      if( typeof +width == 'number' ) el.css('width', width + 'px');
      else if( typeof width == 'string' ) el.css('width', width);
    }

    var height = o.height;
    if( height ) {
      if( typeof height == 'function' ) height = height.call(self);

      if( typeof +height == 'number' ) el.css('height', o.height + 'px');
      else if( typeof height == 'string' ) el.css('height', o.height);
    }

    Object.getOwnPropertyNames(o).forEach(function(name) {
      var fn = o[name];
      if( typeof fn != 'function' ) return;

      if( name.startsWith('on') ) self.on(name.substring(2), fn);
      else if( name.startsWith('$') ) self.on(name.substring(1), fn);
    });
  },
  create: function(o) {
    return $('<div/>')[0];
  },
  options: function(options) {
    var self = this;
    if( !arguments.length ) return self._options;
    self._options = options || {};
    self.fire('options', {options:options});
    return self;
  },
  state: function(state) {
    if( !arguments.length ) return this.stateresponder;

    var self = this;
    var dom = self.dom();
    var el = $(dom);

    if( !state ) {
      el.rc('xw-state-responder').attr('data-state', null);
      this.stateresponder = null;
      return self;
    }

    var responder;
    el.ac('xw-state-responder');
    if( typeof state == 'string' ) {
      el.attr('data-state', state);
      responder = function(o) {
        return minimatch(o.href, state);
      };
    } else if( Array.isArray(state) ) {
      el.attr('data-state', state.join(','));
      responder = function(o) {
        var href = o.href;
        var matched = false;
        state.forEach(function(s) {
          if( minimatch(href, s) ) matched = true;
        });
        return matched;
      };
    } else if( typeof state == 'function' ) {
      responder = state;
    }

    self.stateresponder = responder;
    return self;
  },
  dom: function() {
    return this._dom;
  },
  body: function() {
    return this._dom;
  },
  html: function(html) {
    var self = this;
    var el = $(self.body());
    if( !arguments.length ) return el.html();
    el.html(html);
    return self;
  },
  findview: function(selector) {
    var nodes = $(this.dom()).find(selector);
    if( !nodes.length ) return null;

    var node = nodes[0];
    if( node.view ) return node.view;
    var parent = $(node).parent('.xw-view')[0];
    return parent && parent.view;
  },
  find: function(id) {
    if( id instanceof View ) return id;
    if( typeof id == 'string' ) {
      var node = this.dom().querySelector('#' + id + '.xw-view');
      return node && node.view;
    }
    return this.findall(id)[0];
  },
  findall: function(id) {
    var el = $(this.dom());
    if( typeof id == 'string' ) els = el.find('#' + id + '.xw-view');
    else els = el.find('.xw-view');

    return els.map(function(node) {
      if( typeof id == 'string' ) return node.view;
      if( typeof id == 'function' ) return (node.view instanceof id) && node.view;
    }).filter(function(item) {
      return item;
    });
  },
  query: function(selector) {
    return $(this.dom()).find(selector);
  },
  remove: function() {
    var self = this;
    $(self.dom()).remove();
    self.fire('remove');
    return self;
  },
  clear: function() {
    var self = this;
    $(self.body()).empty();
    self.fire('clear');
    return self;
  },
  workbench: function() {
    var self = this;
    return $(self.dom()).parent(function() {
      return this.workbench;
    }, true).map(function(p) {
      return p && p.workbench;
    })[0];
  },
  data: function(data) {
    var self = this;
    if( !arguments.length ) return self._data;
    self._data = data;
    self.fire('data', {data:data});
    return self;
  },
  show: function() {
    $(this.dom()).css('display', '');
    return this;
  },
  hide: function() {
    $(this.dom()).css('display', 'none');
    return this;
  },
  style: function(options) {
    $(this.dom()).css(options);
    return this;
  },
  fire: function(type, detail, cancellable, bubble) {
    return !!$(this.dom()).fire(type, detail, cancellable, bubble)[0];
  },
  on: function(type, fn) {
    var self = this;
    fn._wrapper = function() {
      return fn.apply(self, arguments);
    };

    $(this.dom()).on(type, fn._wrapper);
    return this;
  },
  once: function(type, fn) {
    var self = this;
    fn._wrapper = function() {
      return fn.apply(self, arguments);
    };

    $(this.dom()).once(type, fn._wrapper);
    return this;
  },
  off: function(type, fn) {
    $(this.dom()).off(type, fn._wrapper || fn);
    return this;
  }
};

function Separator(options) {
  View.apply(this, arguments);
}

Separator.prototype = Object.create(View.prototype, {
  create: {
    value: function() {
      return $('<div class="xw-separator" />')[0];
    }
  }
});

var types = {};
types['default'] = View;

View.type = function(name, fn) {
  if( arguments.length <= 1 ) return types[name];

  types[name] = fn;
  return this;
};

View.create = function(o, deftype) {
  if( !arguments.length ) return new View();
  if( !o ) return console.error('arguments cannot be null');
  if( o instanceof View ) return o;
  if( o === '-' ) return new Separator();

  var Type = o.type ? types[o.type] : types[deftype || 'default'];
  if( !Type ) return console.error('not fount view type: ' + (o.type || deftype));

  return new Type(o);
};

View.type('separator', Separator);
View.type('view', View);
module.exports = View;


text:
var test = require('test');
test.assert(require('a').foo() == 1, 'transitive');
test.print('DONE', 'info');


text:
package org.azizkhani.model.baseInfo;

import org.azizkhani.model.BaseEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

public class BaseInformation extends BaseEntity{
	private int code;
	private String topic;
	private BaseInformation parent;

	public void setCode(int code) {
		this.code = code;
	}
	public int getCode() {
		return code;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}
	public String getTopic() {
		return topic;
	}
	@JsonProperty
	public void setParent(BaseInformation parent) {
		this.parent = parent;
	}
	@JsonIgnore
	public BaseInformation getParent() {
		return parent;
	}
	public BaseInformation() {
		super();
	}
	public BaseInformation(int id) {
		super();
		setId(id);
	}

}


text:
package org.apache.hadoop.fs.ozone;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdfs.server.datanode.ObjectStoreHandler;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.web.handlers.BucketArgs;
import org.apache.hadoop.ozone.web.handlers.UserArgs;
import org.apache.hadoop.ozone.web.handlers.VolumeArgs;
import org.apache.hadoop.ozone.web.interfaces.StorageHandler;
import org.apache.hadoop.ozone.web.utils.OzoneUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

import static org.junit.Assert.assertTrue;

/**
 * Unit Test for verifying directory rename operation through OzoneFS.
 */
public class TestOzoneFsRenameDir {
  public static final Logger LOG = LoggerFactory.getLogger(
      TestOzoneFsRenameDir.class);

  private MiniOzoneCluster cluster = null;
  private OzoneConfiguration conf = null;
  private static StorageHandler storageHandler;
  private static FileSystem fs;

  @Before
  public void init() throws Exception {
    conf = new OzoneConfiguration();
    cluster = MiniOzoneCluster.newBuilder(conf)
        .setNumDatanodes(1)
        .build();
    cluster.waitForClusterToBeReady();
    storageHandler =
        new ObjectStoreHandler(conf).getStorageHandler();

    // create a volume and a bucket to be used by OzoneFileSystem
    String userName = "user" + RandomStringUtils.randomNumeric(5);
    String adminName = "admin" + RandomStringUtils.randomNumeric(5);
    String volumeName = "volume" + RandomStringUtils.randomNumeric(5);
    String bucketName = "bucket" + RandomStringUtils.randomNumeric(5);
    UserArgs userArgs = new UserArgs(null, OzoneUtils.getRequestID(),
        null, null, null, null);
    VolumeArgs volumeArgs = new VolumeArgs(volumeName, userArgs);
    volumeArgs.setUserName(userName);
    volumeArgs.setAdminName(adminName);
    storageHandler.createVolume(volumeArgs);
    BucketArgs bucketArgs = new BucketArgs(volumeName, bucketName, userArgs);
    storageHandler.createBucket(bucketArgs);

    // Fetch the host and port for File System init
    DatanodeDetails datanodeDetails = cluster.getHddsDatanodes().get(0)
        .getDatanodeDetails();

    // Set the fs.defaultFS and start the filesystem
    String uri = String.format("%s://%s.%s/",
        OzoneConsts.OZONE_URI_SCHEME, bucketName, volumeName);
    conf.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, uri);
    fs =  FileSystem.get(conf);
    LOG.info("fs.defaultFS=" + fs.getUri());
  }

  @After
  public void teardown() {
    if (cluster != null) {
      cluster.shutdown();
      cluster = null;
    }
  }

  /**
   * Tests directory rename opertion through OzoneFS.
   */
  @Test(timeout=300_000)
  public void testRenameDir() throws IOException {
    final String dir = "/root_dir/dir1";
    final Path source = new Path(fs.getUri().toString() + dir);
    final Path dest = new Path(source.toString() + ".renamed");
    // Add a sub-dir to the directory to be moved.
    final Path subdir = new Path(source, "sub_dir1");
    fs.mkdirs(subdir);
    LOG.info("Created dir {}", subdir);
    LOG.info("Will move {} to {}", source, dest);
    fs.rename(source, dest);
    assertTrue("Directory rename failed", fs.exists(dest));
    // Verify that the subdir is also renamed i.e. keys corresponding to the
    // sub-directories of the renamed directory have also been renamed.
    assertTrue("Keys under the renamed direcotry not renamed",
        fs.exists(new Path(dest, "sub_dir1")));
  }
}


text:
.class Lcom/samsung/android/settings/wifi/WifiOffloadDialog$1;
.super Ljava/lang/Object;
.source "WifiOffloadDialog.java"

# interfaces
.implements Landroid/view/View$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/samsung/android/settings/wifi/WifiOffloadDialog;->initialize()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/samsung/android/settings/wifi/WifiOffloadDialog;

# direct methods
.method constructor <init>(Lcom/samsung/android/settings/wifi/WifiOffloadDialog;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/settings/wifi/WifiOffloadDialog$1;->this$0:Lcom/samsung/android/settings/wifi/WifiOffloadDialog;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 2

    iget-object v0, p0, Lcom/samsung/android/settings/wifi/WifiOffloadDialog$1;->this$0:Lcom/samsung/android/settings/wifi/WifiOffloadDialog;

    const/4 v1, 0x1

    invoke-static {v0, v1}, Lcom/samsung/android/settings/wifi/WifiOffloadDialog;->-wrap0(Lcom/samsung/android/settings/wifi/WifiOffloadDialog;Z)V

    return-void
.end method


text:
#include <aws/iot/model/DescribeCACertificateRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::IoT::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DescribeCACertificateRequest::DescribeCACertificateRequest() :
    m_certificateIdHasBeenSet(false)
{
}

Aws::String DescribeCACertificateRequest::SerializePayload() const
{
  return "";
}


text:
Difficulty: Easy

https://leetcode.com/problems/cells-with-odd-values-in-a-matrix/

Given n and m which are the dimensions of a matrix initialized by zeros and given an array indices where indices[i] = [ri, ci]. For each pair of [ri, ci] you have to increment all cells in row ri and column ci by 1.

Return the number of cells with odd values in the matrix after applying the increment to all indices.

**Example 1:**
![ex1](e1.png)
```
Input: n = 2, m = 3, indices = [[0,1],[1,1]]
Output: 6
Explanation: Initial matrix = [[0,0,0],[0,0,0]].
After applying first increment it becomes [[1,2,1],[0,1,0]].
The final matrix will be [[1,3,1],[1,3,1]] which contains 6 odd numbers.
```

**Example 2:**
![ex2](e2.png)
```
Input: n = 2, m = 2, indices = [[1,1],[0,0]]
Output: 0
Explanation: Final matrix = [[2,2],[2,2]]. There is no odd number in the final matrix.
```

**Constraints:**

* 1 <= n <= 50
* 1 <= m <= 50
* 1 <= indices.length <= 100
* 0 <= indices[i][0] < n
* 0 <= indices[i][1] < m


text:
using MailManager.Web.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MailManager.Web.Services
{
    public interface IApplicationUsersService
    {
        IQueryable<ApplicationUser> GetApplicationUsers();

        Task<ApplicationUser> GetApplicationUserAsync(string username);

        Task<ApplicationUser> UpdateUserAsync(ApplicationUser applicationUser);
    }
}


text:
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "../../include/javascript/JavaScript.h"
#include "../../include/javascript/IJavaScript.h"
#include "../../include/javascript/JS_Define.h"
#include "../../include/javascript/JS_Object.h"
#include "../../include/javascript/JS_Value.h"
#include "../../include/javascript/JS_GlobalData.h"
#include "../../include/javascript/global.h"
#include "../../include/javascript/JS_EventHandler.h"
#include "../../include/javascript/JS_Context.h"

/* ---------------------------- global ---------------------------- */

// Helper class for compile-time calculation of hash values in order to
// avoid having global object initializers.
template <unsigned ACC, wchar_t... Ns>
struct CHash;

// Only needed to hash single-character strings.
template <wchar_t N>
struct CHash<N> {
  static const unsigned value = N;
};

template <unsigned ACC, wchar_t N>
struct CHash<ACC, N> {
  static const unsigned value = (ACC * 1313LLU + N) & 0xFFFFFFFF;
};

template <unsigned ACC, wchar_t N, wchar_t... Ns>
struct CHash<ACC, N, Ns...> {
  static const unsigned value = CHash<CHash<ACC, N>::value, Ns...>::value;
};

extern const unsigned int JSCONST_nStringHash =
  CHash<'s','t','r','i','n','g'>::value;
extern const unsigned int JSCONST_nNumberHash =
  CHash<'n','u','m','b','e','r'>::value;
extern const unsigned int JSCONST_nBoolHash =
  CHash<'b','o','o','l','e','a','n'>::value;
extern const unsigned int JSCONST_nDateHash =
  CHash<'d','a','t','e'>::value;
extern const unsigned int JSCONST_nObjectHash =
  CHash<'o','b','j','e','c','t'>::value;
extern const unsigned int JSCONST_nFXobjHash =
  CHash<'f','x','o','b','j'>::value;
extern const unsigned int JSCONST_nNullHash =
  CHash<'n','u','l','l'>::value;
extern const unsigned int JSCONST_nUndefHash =
  CHash<'u','n','d','e','f','i','n','e','d'>::value;

#ifdef _DEBUG
class HashVerify
{
public:
  HashVerify();
} g_hashVerify;

HashVerify::HashVerify()
{
  ASSERT(JSCONST_nStringHash ==
    JS_CalcHash(VALUE_NAME_STRING,wcslen(VALUE_NAME_STRING)));
  ASSERT(JSCONST_nNumberHash ==
    JS_CalcHash(VALUE_NAME_NUMBER,wcslen(VALUE_NAME_NUMBER)));
  ASSERT(JSCONST_nBoolHash ==
    JS_CalcHash(VALUE_NAME_BOOLEAN,wcslen(VALUE_NAME_BOOLEAN)));
  ASSERT(JSCONST_nDateHash ==
    JS_CalcHash(VALUE_NAME_DATE,wcslen(VALUE_NAME_DATE)));
  ASSERT(JSCONST_nObjectHash ==
    JS_CalcHash(VALUE_NAME_OBJECT,wcslen(VALUE_NAME_OBJECT)));
  ASSERT(JSCONST_nFXobjHash ==
    JS_CalcHash(VALUE_NAME_FXOBJ,wcslen(VALUE_NAME_FXOBJ)));
  ASSERT(JSCONST_nNullHash ==
    JS_CalcHash(VALUE_NAME_NULL,wcslen(VALUE_NAME_NULL)));
  ASSERT(JSCONST_nUndefHash ==
    JS_CalcHash(VALUE_NAME_UNDEFINED,wcslen(VALUE_NAME_UNDEFINED)));
}
#endif

BEGIN_JS_STATIC_CONST(CJS_Global)
END_JS_STATIC_CONST()

BEGIN_JS_STATIC_PROP(CJS_Global)
END_JS_STATIC_PROP()

BEGIN_JS_STATIC_METHOD(CJS_Global)
	JS_STATIC_METHOD_ENTRY(setPersistent, 2)
END_JS_STATIC_METHOD()

IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global);

FX_BOOL	CJS_Global::InitInstance(IFXJS_Context* cc)
{
	CJS_Context* pContext = (CJS_Context*)cc;
	ASSERT(pContext != NULL);

	global_alternate* pGlobal = (global_alternate*)GetEmbedObject();
	ASSERT(pGlobal != NULL);

	pGlobal->Initial(pContext->GetReaderApp());

	return TRUE;
};

global_alternate::global_alternate(CJS_Object* pJSObject)
	: CJS_EmbedObj(pJSObject),
	m_pApp(NULL)
{
}

global_alternate::~global_alternate(void)
{
	ASSERT(m_pApp != NULL);

//	CommitGlobalPersisitentVariables();
	DestroyGlobalPersisitentVariables();

	CJS_RuntimeFactory* pFactory = m_pApp->m_pJSRuntimeFactory;
	ASSERT(pFactory);

	pFactory->ReleaseGlobalData();
}

void global_alternate::Initial(CPDFDoc_Environment* pApp)
{
	m_pApp = pApp;

	CJS_RuntimeFactory* pFactory = pApp->m_pJSRuntimeFactory;
	ASSERT(pFactory);
	m_pGlobalData = pFactory->NewGlobalData(pApp);
	UpdateGlobalPersistentVariables();
}

FX_BOOL	global_alternate::QueryProperty(FX_LPCWSTR propname)
{
	return CFX_WideString(propname) != L"setPersistent";
}

FX_BOOL	global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, JS_ErrorString& sError)
{
	js_global_data* pData = NULL;
	CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);

	if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
	{
		pData->bDeleted = TRUE;
		return TRUE;
	}

	return FALSE;
}

FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, JS_ErrorString& sError)
{
	if (vp.IsSetting())
	{
		CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
		switch (vp.GetType())
		{
		case VT_number:
			{
				double dData;
				vp >> dData;
				return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE);
			}
		case VT_boolean:
			{
				bool bData;
				vp >> bData;
				return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
			}
		case VT_string:
			{
				CFX_ByteString sData;
				vp >> sData;
				return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE);
			}
		case VT_object:
			{
				JSObject pData = (JSObject)vp;
				return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
// 				else
// 				{
// 					if (vp.IsArrayObject())
// 					{
// 						CJS_Array array;
// 						vp.ConvertToArray(array);
// 						return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
// 							(Dobject*)(Darray*)array, FALSE);
// 					}
// 					else
// 						return FALSE;
// 				}
			}
		case VT_null:
			{
				return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE);
			}
		case VT_undefined:
			{
				DelProperty(cc, propname, sError);
				return TRUE;
			}
		default:
			return FALSE;
		}
	}
	else
	{
		js_global_data* pData = NULL;
		CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);

		if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
		{
			if (pData)
			{
				if (!pData->bDeleted)
				{
					switch (pData->nType)
					{
					case JS_GLOBALDATA_TYPE_NUMBER:
						vp << pData->dData;
						break;
					case JS_GLOBALDATA_TYPE_BOOLEAN:
						vp << pData->bData;
						break;
					case JS_GLOBALDATA_TYPE_STRING:
						vp << pData->sData;
						break;
					case JS_GLOBALDATA_TYPE_OBJECT:
						{
							v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData);
							vp << obj;
							break;
						}
					case JS_GLOBALDATA_TYPE_NULL:
						vp.SetNull();
						break;
					default:
						return FALSE;
					}
					return TRUE;
				}
				else
				{
					return TRUE;
				}
			}
			else
			{
				vp.SetNull();
				return TRUE;
			}
		}
		else
		{
			vp.SetNull();
			return TRUE;
		}
	}

	return FALSE;
}

FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError)
{
	if (params.size() != 2)
	{
		//sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
		return FALSE;
	}

	CFX_ByteString sName = params[0];

	js_global_data* pData = NULL;
	if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData))
	{
		if (pData && !pData->bDeleted)
		{
			pData->bPersistent = (bool)params[1];
			return TRUE;
		}
	}

	//sError = JSGetStringFromID(IDS_JSPARAM_INCORRECT);
	return FALSE;
}

void global_alternate::UpdateGlobalPersistentVariables()
{
	ASSERT(m_pGlobalData != NULL);

	for (int i=0,sz=m_pGlobalData->GetSize(); i<sz; i++)
	{
		CJS_GlobalData_Element* pData = m_pGlobalData->GetAt(i);
		ASSERT(pData != NULL);

		switch (pData->data.nType)
		{
		case JS_GLOBALDATA_TYPE_NUMBER:
			this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NUMBER, pData->data.dData, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
			JS_PutObjectNumber(NULL,(JSFXObject)(*m_pJSObject),
				pData->data.sKey.UTF8Decode(), pData->data.dData);
			break;
		case JS_GLOBALDATA_TYPE_BOOLEAN:
			this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)(pData->data.bData == 1), "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
			JS_PutObjectBoolean(NULL,(JSFXObject)(*m_pJSObject),
				pData->data.sKey.UTF8Decode(), (bool)(pData->data.bData == 1));
			break;
		case JS_GLOBALDATA_TYPE_STRING:
			this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_STRING, 0, false, pData->data.sData, v8::Handle<v8::Object>(), pData->bPersistent == 1);
			JS_PutObjectString(NULL,(JSFXObject)(*m_pJSObject),
				pData->data.sKey.UTF8Decode(),
				pData->data.sData.UTF8Decode());
			break;
		case JS_GLOBALDATA_TYPE_OBJECT:
			{
				IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
				v8::Handle<v8::Object> pObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);

				PutObjectProperty(pObj, &pData->data);

				this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
					(JSObject)pObj, pData->bPersistent == 1);
				JS_PutObjectObject(NULL,(JSFXObject)(*m_pJSObject),
					pData->data.sKey.UTF8Decode(), (JSObject)pObj);
			}
			break;
		case JS_GLOBALDATA_TYPE_NULL:
			this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
			JS_PutObjectNull(NULL,(JSFXObject)(*m_pJSObject),
				pData->data.sKey.UTF8Decode());
			break;
		}
	}
}

void global_alternate::CommitGlobalPersisitentVariables()
{
	ASSERT(m_pGlobalData != NULL);

	FX_POSITION	 pos = m_mapGlobal.GetStartPosition();
	while (pos)
	{
		CFX_ByteString name;
		js_global_data* pData = NULL;
		m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);

		if (pData)
		{
			if (pData->bDeleted)
			{
				m_pGlobalData->DeleteGlobalVariable(name);
			}
			else
			{
				switch (pData->nType)
				{
				case JS_GLOBALDATA_TYPE_NUMBER:
					m_pGlobalData->SetGlobalVariableNumber(name, pData->dData);
					m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
					break;
				case JS_GLOBALDATA_TYPE_BOOLEAN:
					m_pGlobalData->SetGlobalVariableBoolean(name, pData->bData);
					m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
					break;
				case JS_GLOBALDATA_TYPE_STRING:
					m_pGlobalData->SetGlobalVariableString(name, pData->sData);
					m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
					break;
				case JS_GLOBALDATA_TYPE_OBJECT:
					//if (pData->pData)
					{
						CJS_GlobalVariableArray array;
						v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(GetJSObject()->GetIsolate(),pData->pData);
						ObjectToArray(obj, array);
						m_pGlobalData->SetGlobalVariableObject(name, array);
						m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
					}
					break;
				case JS_GLOBALDATA_TYPE_NULL:
					m_pGlobalData->SetGlobalVariableNull(name);
					m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
					break;
				}
			}
		}
	}
}

void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array)
{
	v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(pObj);
	int	nObjElements = pKeyList->Length();

	v8::Local<v8::Context> context = pObj->CreationContext();
	v8::Isolate* isolate = context->GetIsolate();

	for (int i=0; i<nObjElements; i++)
	{

		CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i));
		CFX_ByteString sKey = ws.UTF8Encode();

		v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws.c_str());
		FXJSVALUETYPE vt = GET_VALUE_TYPE(v);
		switch (vt)
		{
		case VT_number:
			{
				CJS_KeyValue* pObjElement = new CJS_KeyValue;
				pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER;
				pObjElement->sKey = sKey;
				pObjElement->dData = JS_ToNumber(v);
				array.Add(pObjElement);
			}
			break;
		case VT_boolean:
			{
				CJS_KeyValue* pObjElement = new CJS_KeyValue;
				pObjElement->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
				pObjElement->sKey = sKey;
				pObjElement->dData = JS_ToBoolean(v);
				array.Add(pObjElement);
			}
			break;
		case VT_string:
			{
				CFX_ByteString sValue = CJS_Value(isolate, v, VT_string);
				CJS_KeyValue* pObjElement = new CJS_KeyValue;
				pObjElement->nType = JS_GLOBALDATA_TYPE_STRING;
				pObjElement->sKey = sKey;
				pObjElement->sData = sValue;
				array.Add(pObjElement);
			}
			break;
		case VT_object:
			{
				CJS_KeyValue* pObjElement = new CJS_KeyValue;
				pObjElement->nType = JS_GLOBALDATA_TYPE_OBJECT;
				pObjElement->sKey = sKey;
				ObjectToArray(JS_ToObject(v), pObjElement->objData);
				array.Add(pObjElement);
			}
			break;
		case VT_null:
			{
				CJS_KeyValue* pObjElement = new CJS_KeyValue;
				pObjElement->nType = JS_GLOBALDATA_TYPE_NULL;
				pObjElement->sKey = sKey;
				array.Add(pObjElement);
			}
			break;
		default:
			break;
		}
	}
}

void global_alternate::PutObjectProperty(v8::Handle<v8::Object> pObj, CJS_KeyValue* pData)
{
	ASSERT(pData != NULL);

	for (int i=0,sz=pData->objData.Count(); i<sz; i++)
	{
		CJS_KeyValue* pObjData = pData->objData.GetAt(i);
		ASSERT(pObjData != NULL);

		switch (pObjData->nType)
		{
		case JS_GLOBALDATA_TYPE_NUMBER:
			JS_PutObjectNumber(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->dData);
			break;
		case JS_GLOBALDATA_TYPE_BOOLEAN:
			JS_PutObjectBoolean(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), (bool)(pObjData->bData == 1));
			break;
		case JS_GLOBALDATA_TYPE_STRING:
			JS_PutObjectString(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->sData.UTF8Decode());
			break;
		case JS_GLOBALDATA_TYPE_OBJECT:
			{
				IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
				v8::Handle<v8::Object> pNewObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);
				PutObjectProperty(pNewObj, pObjData);
				JS_PutObjectObject(NULL, (JSObject)pObj, pObjData->sKey.UTF8Decode(), (JSObject)pNewObj);
			}
			break;
		case JS_GLOBALDATA_TYPE_NULL:
			JS_PutObjectNull(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode());
			break;
		}
	}
}

void global_alternate::DestroyGlobalPersisitentVariables()
{
	FX_POSITION	 pos = m_mapGlobal.GetStartPosition();
	while (pos)
	{
		CFX_ByteString name;
		js_global_data* pData = NULL;
		m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
		delete pData;
	}

	m_mapGlobal.RemoveAll();
}

FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
				double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
{
	if (propname == NULL) return FALSE;

	js_global_data* pTemp = NULL;
	m_mapGlobal.Lookup(propname, (FX_LPVOID&)pTemp);

	if (pTemp)
	{
		if (pTemp->bDeleted || pTemp->nType != nType)
		{
			pTemp->dData = 0;
			pTemp->bData = 0;
			pTemp->sData = "";
			pTemp->nType = nType;
		}

		pTemp->bDeleted = FALSE;

		switch (nType)
		{
		case JS_GLOBALDATA_TYPE_NUMBER:
			{
				pTemp->dData = dData;
			}
			break;
		case JS_GLOBALDATA_TYPE_BOOLEAN:
			{
				pTemp->bData = bData;
			}
			break;
		case JS_GLOBALDATA_TYPE_STRING:
			{
				pTemp->sData = sData;
			}
			break;
		case JS_GLOBALDATA_TYPE_OBJECT:
			{
				pTemp->pData.Reset(JS_GetRuntime(pData), pData);
			}
			break;
		case JS_GLOBALDATA_TYPE_NULL:
			break;
		default:
			return FALSE;
		}

		return TRUE;
	}

	js_global_data* pNewData = NULL;

	switch (nType)
	{
	case JS_GLOBALDATA_TYPE_NUMBER:
		{
			pNewData = new js_global_data;
			pNewData->nType = JS_GLOBALDATA_TYPE_NUMBER;
			pNewData->dData = dData;
			pNewData->bPersistent = bDefaultPersistent;
		}
		break;
	case JS_GLOBALDATA_TYPE_BOOLEAN:
		{
			pNewData = new js_global_data;
			pNewData->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
			pNewData->bData = bData;
			pNewData->bPersistent = bDefaultPersistent;
		}
		break;
	case JS_GLOBALDATA_TYPE_STRING:
		{
			pNewData = new js_global_data;
			pNewData->nType = JS_GLOBALDATA_TYPE_STRING;
			pNewData->sData = sData;
			pNewData->bPersistent = bDefaultPersistent;
		}
		break;
	case JS_GLOBALDATA_TYPE_OBJECT:
		{
			pNewData = new js_global_data;
			pNewData->nType = JS_GLOBALDATA_TYPE_OBJECT;
			pNewData->pData.Reset(JS_GetRuntime(pData), pData);
			pNewData->bPersistent = bDefaultPersistent;
		}
		break;
	case JS_GLOBALDATA_TYPE_NULL:
		{
			pNewData = new js_global_data;
			pNewData->nType = JS_GLOBALDATA_TYPE_NULL;
			pNewData->bPersistent = bDefaultPersistent;
		}
		break;
	default:
		return FALSE;
	}

	m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData);

	return TRUE;
}

FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p)
{
  const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p));

  if (nHash == JSCONST_nUndefHash)
    return VT_undefined;
  if (nHash == JSCONST_nNullHash)
    return VT_null;
  if (nHash == JSCONST_nStringHash)
    return VT_string;
  if (nHash == JSCONST_nNumberHash)
    return VT_number;
  if (nHash == JSCONST_nBoolHash)
    return VT_boolean;
  if (nHash == JSCONST_nDateHash)
    return VT_date;
  if (nHash == JSCONST_nObjectHash)
    return VT_object;
  if (nHash == JSCONST_nFXobjHash)
    return VT_fxobject;

  return VT_unknown;
}


text:
title: How to install the spice guest agent
category: howto
authors: nkesick
wiki_title: How to install the spice guest agent
wiki_revision_count: 4
wiki_last_updated: 2015-01-18
---

# How to install the spice guest agent

Installing the Spice Guest Agent in a Linux virtual machine is fairly simple and will provide a better guest console experience. For more information, see the [Spice Agent](Understanding_Guest_Agents_and_Other_Tools#Spice_Agent) section. In many recent Linux distibutions, the Spice Guest Agent is installed by default with the desktop install. If you performed a custom install or have an older distribution, these directions will still apply. The process has one main step which is installing the spice-vdagent package.

## Methods for Installation

There are two methods you can use. The easiest is to use a terminal prompt or through the Software Center application, where available. This requires that the virtual machine has access to the internet or at least to a repository mirror.

### Fedora

Installing on a Fedora guest? Click to expand this section.

1 Open Terminal

2 Run the following command

    sudo yum install spice-vdagent

### Centos/RHEL 5,6,7

Installing on a Centos guest? Click to expand this section.

Note: Available for RHEL/CentOS 5, 6 and 7 in [EPEL](https://fedoraproject.org/wiki/EPEL) **Centos 6.x**

**Centos 7.x**

1 Open Terminal

2 Run the following command

    sudo yum install spice-vdagent

### Ubuntu

Installing on a Ubuntu? Click to expand this section.

Ubuntu 14.04 LTS and Newer

1 Open Terminal

2 sudo apt-get install spice-vdagent

### Debian

Installing on a Debian 7+ guest? Click to expand this section.

**Via Add/Remove Software**

1 Click Applications > System Tools > Add/Remove Software

2 Search for "spice-vdagent"

3 Check the box below the spice-vdagent package and press apply to install.

**Via Terminal** (rough draft - in default repos or refer to external repo?)

1 Open Terminal

2 Run the following commands

    # su -
    # apt-get install spice-vdagent

### OpenSUSE

OpenSUSE does not appear to have the spice-vdagent package at this time.


text:
module Tako
  module ActiveRecordExt
    module SingularAssociation
      def self.included(mod)
        mod.extend(ShardedMethods)
        mod.sharded_methods :reader,
                            :writer,
                            :create,
                            :create!,
                            :build
      end
    end
  end
end

ActiveRecord::Associations::SingularAssociation.class_eval do
  include Tako::ActiveRecordExt::SingularAssociation
end