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

#include "pdf/pdfium/pdfium_page.h"

#include <utility>
#include <vector>

#include "base/check.h"
#include "base/test/gtest_util.h"
#include "pdf/pdfium/pdfium_engine.h"
#include "pdf/pdfium/pdfium_test_base.h"
#include "pdf/test/test_client.h"
#include "pdf/test/test_utils.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/range/range.h"

namespace chrome_pdf {

namespace {

TEST(PDFiumPageHelperTest, ToPDFiumRotation) {
  EXPECT_EQ(ToPDFiumRotation(PageOrientation::kOriginal), 0);
  EXPECT_EQ(ToPDFiumRotation(PageOrientation::kClockwise90), 1);
  EXPECT_EQ(ToPDFiumRotation(PageOrientation::kClockwise180), 2);
  EXPECT_EQ(ToPDFiumRotation(PageOrientation::kClockwise270), 3);
}

TEST(PDFiumPageHelperDeathTest, ToPDFiumRotation) {
  PageOrientation invalid_orientation = static_cast<PageOrientation>(-1);
#if DCHECK_IS_ON()
  EXPECT_DCHECK_DEATH(ToPDFiumRotation(invalid_orientation));
#else
  EXPECT_EQ(ToPDFiumRotation(invalid_orientation), 0);
#endif
}

void CompareTextRuns(
    const pp::PDF::PrivateAccessibilityTextRunInfo& expected_text_run,
    const pp::PDF::PrivateAccessibilityTextRunInfo actual_text_run) {
  EXPECT_EQ(expected_text_run.len, actual_text_run.len);
  CompareRect(expected_text_run.bounds, actual_text_run.bounds);
  EXPECT_EQ(expected_text_run.direction, actual_text_run.direction);

  const pp::PDF::PrivateAccessibilityTextStyleInfo& expected_style =
      expected_text_run.style;
  const pp::PDF::PrivateAccessibilityTextStyleInfo& actual_style =
      actual_text_run.style;

  EXPECT_EQ(expected_style.font_name, actual_style.font_name);
  EXPECT_EQ(expected_style.font_weight, actual_style.font_weight);
  EXPECT_EQ(expected_style.render_mode, actual_style.render_mode);
  EXPECT_FLOAT_EQ(expected_style.font_size, actual_style.font_size);
  EXPECT_EQ(expected_style.fill_color, actual_style.fill_color);
  EXPECT_EQ(expected_style.stroke_color, actual_style.stroke_color);
  EXPECT_EQ(expected_style.is_italic, actual_style.is_italic);
  EXPECT_EQ(expected_style.is_bold, actual_style.is_bold);
}

template <typename T>
void PopulateTextObjects(const std::vector<gfx::Range>& ranges,
                         std::vector<T>* text_objects) {
  text_objects->resize(ranges.size());
  for (size_t i = 0; i < ranges.size(); ++i) {
    (*text_objects)[i].start_char_index = ranges[i].start();
    (*text_objects)[i].char_count = ranges[i].end() - ranges[i].start();
  }
}

}  // namespace

using PDFiumPageTest = PDFiumTestBase;

TEST_F(PDFiumPageTest, Constructor) {
  PDFiumPage page(/*engine=*/nullptr, 2);
  EXPECT_EQ(page.index(), 2);
  EXPECT_TRUE(page.rect().IsEmpty());
  EXPECT_FALSE(page.available());
}

class PDFiumPageLinkTest : public PDFiumTestBase {
 public:
  PDFiumPageLinkTest() = default;
  ~PDFiumPageLinkTest() override = default;

  const std::vector<PDFiumPage::Link>& GetLinks(PDFiumEngine* engine,
                                                int page_index) {
    PDFiumPage* page = GetPDFiumPageForTest(engine, page_index);
    DCHECK(page);
    page->CalculateLinks();
    return page->links_;
  }

  DISALLOW_COPY_AND_ASSIGN(PDFiumPageLinkTest);
};

TEST_F(PDFiumPageLinkTest, TestLinkGeneration) {
  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("weblinks.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(1, engine->GetNumberOfPages());

  bool is_chromeos = IsRunningOnChromeOS();

  const std::vector<PDFiumPage::Link>& links = GetLinks(engine.get(), 0);
  ASSERT_EQ(3u, links.size());

  const PDFiumPage::Link& link = links[0];
  EXPECT_EQ("http://yahoo.com", link.target.url);
  EXPECT_EQ(7, link.start_char_index);
  EXPECT_EQ(16, link.char_count);
  ASSERT_EQ(1u, link.bounding_rects.size());
  if (is_chromeos) {
    CompareRect({75, 192, 110, 15}, link.bounding_rects[0]);
  } else {
    CompareRect({75, 191, 110, 16}, link.bounding_rects[0]);
  }

  const PDFiumPage::Link& second_link = links[1];
  EXPECT_EQ("http://bing.com", second_link.target.url);
  EXPECT_EQ(52, second_link.start_char_index);
  EXPECT_EQ(15, second_link.char_count);
  ASSERT_EQ(1u, second_link.bounding_rects.size());
  if (is_chromeos) {
    CompareRect({131, 120, 138, 22}, second_link.bounding_rects[0]);
  } else {
    CompareRect({131, 121, 138, 20}, second_link.bounding_rects[0]);
  }

  const PDFiumPage::Link& third_link = links[2];
  EXPECT_EQ("http://google.com", third_link.target.url);
  EXPECT_EQ(92, third_link.start_char_index);
  EXPECT_EQ(17, third_link.char_count);
  ASSERT_EQ(1u, third_link.bounding_rects.size());
  CompareRect({82, 67, 161, 21}, third_link.bounding_rects[0]);
}

TEST_F(PDFiumPageLinkTest, TestAnnotLinkGeneration) {
  struct ExpectedLink {
    int32_t start_char_index;
    int32_t char_count;
    std::vector<pp::Rect> bounding_rects;
    std::string url;
    int page;
    float y_in_pixels;
  };
  static ExpectedLink expected_links[] = {
      {144, 38, {{99, 436, 236, 13}}, "https://pdfium.googlesource.com/pdfium"},
      {27, 38, {{112, 215, 617, 28}}, "", 1, 89.333336},
      {65, 27, {{93, 334, 174, 21}}, "https://www.adobe.com"},
      {253,
       18,
       {{242, 455, 1, 18}, {242, 472, 1, 15}},
       "https://cs.chromium.org"},
      {-1, 0, {{58, 926, 28, 27}}, "https://www.google.com"}};
  if (IsRunningOnChromeOS()) {
    expected_links[0].bounding_rects[0] = {99, 436, 236, 14};
  }
  static constexpr size_t kExpectedLinkCount = base::size(expected_links);

  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("link_annots.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(2, engine->GetNumberOfPages());

  const std::vector<PDFiumPage::Link>& links = GetLinks(engine.get(), 0);
  ASSERT_EQ(kExpectedLinkCount, links.size());

  for (size_t i = 0; i < kExpectedLinkCount; ++i) {
    const PDFiumPage::Link& actual_current_link = links[i];
    const ExpectedLink& expected_current_link = expected_links[i];
    EXPECT_EQ(expected_current_link.start_char_index,
              actual_current_link.start_char_index);
    EXPECT_EQ(expected_current_link.char_count, actual_current_link.char_count);
    size_t bounds_size = actual_current_link.bounding_rects.size();
    ASSERT_EQ(expected_current_link.bounding_rects.size(), bounds_size);
    for (size_t bounds_index = 0; bounds_index < bounds_size; ++bounds_index) {
      CompareRect(expected_current_link.bounding_rects[bounds_index],
                  actual_current_link.bounding_rects[bounds_index]);
    }
    EXPECT_EQ(expected_current_link.url, actual_current_link.target.url);
    if (actual_current_link.target.url.empty()) {
      EXPECT_EQ(expected_current_link.page, actual_current_link.target.page);
      ASSERT_TRUE(actual_current_link.target.y_in_pixels.has_value());
      EXPECT_FLOAT_EQ(expected_current_link.y_in_pixels,
                      actual_current_link.target.y_in_pixels.value());
    }
  }
}

using PDFiumPageImageTest = PDFiumTestBase;

TEST_F(PDFiumPageImageTest, TestCalculateImages) {
  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("image_alt_text.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(1, engine->GetNumberOfPages());

  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);
  page->CalculateImages();
  ASSERT_EQ(3u, page->images_.size());
  CompareRect({380, 78, 67, 68}, page->images_[0].bounding_rect);
  EXPECT_EQ("Image 1", page->images_[0].alt_text);
  CompareRect({380, 385, 27, 28}, page->images_[1].bounding_rect);
  EXPECT_EQ("Image 2", page->images_[1].alt_text);
  CompareRect({380, 678, 1, 1}, page->images_[2].bounding_rect);
  EXPECT_EQ("Image 3", page->images_[2].alt_text);
}

TEST_F(PDFiumPageImageTest, TestImageAltText) {
  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("text_with_image.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(1, engine->GetNumberOfPages());

  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);
  page->CalculateImages();
  ASSERT_EQ(3u, page->images_.size());
  CompareRect({380, 78, 67, 68}, page->images_[0].bounding_rect);
  EXPECT_EQ("Image 1", page->images_[0].alt_text);
  CompareRect({380, 385, 27, 28}, page->images_[1].bounding_rect);
  EXPECT_EQ("", page->images_[1].alt_text);
  CompareRect({380, 678, 1, 1}, page->images_[2].bounding_rect);
  EXPECT_EQ("", page->images_[2].alt_text);
}

using PDFiumPageTextTest = PDFiumTestBase;

TEST_F(PDFiumPageTextTest, GetTextRunInfo) {
  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("weblinks.pdf"));
  ASSERT_TRUE(engine);

  int current_char_index = 0;

  pp::PDF::PrivateAccessibilityTextStyleInfo expected_style_1 = {
      "Times-Roman",
      0,
      PP_TEXTRENDERINGMODE_FILL,
      12,
      0xff000000,
      0xff000000,
      false,
      false};
  pp::PDF::PrivateAccessibilityTextStyleInfo expected_style_2 = {
      "Helvetica", 0,    PP_TEXTRENDERINGMODE_FILL, 16, 0xff000000, 0xff000000,
      false,       false};
  // The links span from [7, 22], [52, 66] and [92, 108] with 16, 15 and 17
  // text run lengths respectively. There are text runs preceding and
  // succeeding them.
  pp::PDF::PrivateAccessibilityTextRunInfo expected_text_runs[] = {
      {7,
       PP_MakeFloatRectFromXYWH(26.666666f, 189.333333f, 38.666672f,
                                13.333344f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_1},
      {16,
       PP_MakeFloatRectFromXYWH(70.666664f, 189.333333f, 108.0f, 14.666672f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_1},
      {20,
       PP_MakeFloatRectFromXYWH(181.333333f, 189.333333f, 117.333333f,
                                14.666672f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_1},
      {9, PP_MakeFloatRectFromXYWH(28.0f, 117.33334f, 89.333328f, 20.0f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_2},
      {15, PP_MakeFloatRectFromXYWH(126.66666f, 117.33334f, 137.33334f, 20.0f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_2},
      {20,
       PP_MakeFloatRectFromXYWH(266.66666f, 118.66666f, 169.33334f, 18.666664f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_2},
      {5, PP_MakeFloatRectFromXYWH(28.0f, 65.333336f, 40.0f, 18.666664f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_2},
      {17, PP_MakeFloatRectFromXYWH(77.333336f, 64.0f, 160.0f, 20.0f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, expected_style_2}};

  if (IsRunningOnChromeOS()) {
    expected_text_runs[4].bounds =
        PP_MakeFloatRectFromXYWH(126.66666f, 117.33334f, 137.33334f, 21.33334f);
    expected_text_runs[5].bounds =
        PP_MakeFloatRectFromXYWH(266.66666f, 118.66666f, 170.66666f, 20.0f);
    expected_text_runs[7].bounds =
        PP_MakeFloatRectFromXYWH(77.333336f, 64.0f, 160.0f, 21.33333f);
  }

  // Test negative char index returns nullopt
  base::Optional<pp::PDF::PrivateAccessibilityTextRunInfo>
      text_run_info_result = engine->GetTextRunInfo(0, -1);
  ASSERT_FALSE(text_run_info_result.has_value());

  // Test valid char index returns expected text run info and expected text
  // style info
  for (const auto& expected_text_run : expected_text_runs) {
    text_run_info_result = engine->GetTextRunInfo(0, current_char_index);
    ASSERT_TRUE(text_run_info_result.has_value());
    const auto& actual_text_run = text_run_info_result.value();
    CompareTextRuns(expected_text_run, actual_text_run);
    current_char_index += actual_text_run.len;
  }

  // Test char index outside char range returns nullopt
  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);
  EXPECT_EQ(page->GetCharCount(), current_char_index);
  text_run_info_result = engine->GetTextRunInfo(0, current_char_index);
  ASSERT_FALSE(text_run_info_result.has_value());
}

TEST_F(PDFiumPageTextTest, TestHighlightTextRunInfo) {
  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("highlights.pdf"));
  ASSERT_TRUE(engine);

  // Highlights span across text run indices 0, 2 and 3.
  static const pp::PDF::PrivateAccessibilityTextStyleInfo kExpectedStyle = {
      "Helvetica", 0,    PP_TEXTRENDERINGMODE_FILL, 16, 0xff000000, 0xff000000,
      false,       false};
  pp::PDF::PrivateAccessibilityTextRunInfo expected_text_runs[] = {
      {5,
       PP_MakeFloatRectFromXYWH(1.3333334f, 198.66667f, 46.666668f, 14.666672f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle},
      {7,
       PP_MakeFloatRectFromXYWH(50.666668f, 198.66667f, 47.999996f, 17.333328f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle},
      {7,
       PP_MakeFloatRectFromXYWH(106.66666f, 198.66667f, 73.333336f, 18.666672f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle},
      {2, PP_MakeFloatRectFromXYWH(188.0f, 202.66667f, 9.333333f, 14.666667f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_NONE, kExpectedStyle},
      {2,
       PP_MakeFloatRectFromXYWH(198.66667f, 202.66667f, 21.333328f, 10.666672f),
       PP_PrivateDirection::PP_PRIVATEDIRECTION_LTR, kExpectedStyle}};

  if (IsRunningOnChromeOS()) {
    expected_text_runs[2].bounds = PP_MakeFloatRectFromXYWH(
        106.66666f, 198.66667f, 73.333336f, 19.999985f);
    expected_text_runs[4].bounds = PP_MakeFloatRectFromXYWH(
        198.66667f, 201.33333f, 21.333328f, 12.000015f);
  }

  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);

  int current_char_index = 0;
  for (const auto& expected_text_run : expected_text_runs) {
    base::Optional<pp::PDF::PrivateAccessibilityTextRunInfo>
        text_run_info_result = engine->GetTextRunInfo(0, current_char_index);
    ASSERT_TRUE(text_run_info_result.has_value());
    const auto& actual_text_run = text_run_info_result.value();
    CompareTextRuns(expected_text_run, actual_text_run);
    current_char_index += actual_text_run.len;
  }
}

using PDFiumPageHighlightTest = PDFiumTestBase;

TEST_F(PDFiumPageHighlightTest, TestPopulateHighlights) {
  struct ExpectedHighlight {
    int32_t start_char_index;
    int32_t char_count;
    pp::Rect bounding_rect;
    uint32_t color;
  };

  constexpr uint32_t kHighlightDefaultColor = MakeARGB(255, 255, 255, 0);
  constexpr uint32_t kHighlightRedColor = MakeARGB(102, 230, 0, 0);
  constexpr uint32_t kHighlightNoColor = MakeARGB(0, 0, 0, 0);
  static const ExpectedHighlight kExpectedHighlights[] = {
      {0, 5, {5, 196, 49, 26}, kHighlightDefaultColor},
      {12, 7, {110, 196, 77, 26}, kHighlightRedColor},
      {20, 1, {192, 196, 13, 26}, kHighlightNoColor}};

  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("highlights.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(1, engine->GetNumberOfPages());

  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);
  page->PopulateAnnotations();
  ASSERT_EQ(base::size(kExpectedHighlights), page->highlights_.size());

  for (size_t i = 0; i < page->highlights_.size(); ++i) {
    ASSERT_EQ(kExpectedHighlights[i].start_char_index,
              page->highlights_[i].start_char_index);
    ASSERT_EQ(kExpectedHighlights[i].char_count,
              page->highlights_[i].char_count);
    CompareRect(kExpectedHighlights[i].bounding_rect,
                page->highlights_[i].bounding_rect);
    ASSERT_EQ(kExpectedHighlights[i].color, page->highlights_[i].color);
  }
}

using PDFiumPageTextFieldTest = PDFiumTestBase;

TEST_F(PDFiumPageTextFieldTest, TestPopulateTextFields) {
  struct ExpectedTextField {
    const char* name;
    const char* value;
    pp::Rect bounding_rect;
    int flags;
  };

  static const ExpectedTextField kExpectedTextFields[] = {
      {"Text Box", "Text", {138, 230, 135, 41}, 0},
      {"ReadOnly", "Elephant", {138, 163, 135, 41}, 1},
      {"Required", "Required Field", {138, 303, 135, 34}, 2},
      {"Password", "", {138, 356, 135, 35}, 8192}};

  TestClient client;
  std::unique_ptr<PDFiumEngine> engine =
      InitializeEngine(&client, FILE_PATH_LITERAL("form_text_fields.pdf"));
  ASSERT_TRUE(engine);
  ASSERT_EQ(1, engine->GetNumberOfPages());

  PDFiumPage* page = GetPDFiumPageForTest(engine.get(), 0);
  ASSERT_TRUE(page);
  page->PopulateAnnotations();
  size_t text_fields_count = page->text_fields_.size();
  ASSERT_EQ(base::size(kExpectedTextFields), text_fields_count);

  for (size_t i = 0; i < text_fields_count; ++i) {
    EXPECT_EQ(kExpectedTextFields[i].name, page->text_fields_[i].name);
    EXPECT_EQ(kExpectedTextFields[i].value, page->text_fields_[i].value);
    CompareRect(kExpectedTextFields[i].bounding_rect,
                page->text_fields_[i].bounding_rect);
    EXPECT_EQ(kExpectedTextFields[i].flags, page->text_fields_[i].flags);
  }
}

using PDFiumPageOverlappingTest = PDFiumTestBase;

// The following scenarios are covered across both test cases:
// 1. Links overlapping amongst themselves.
// 2. Highlights overlapping amongst themselves.
// 3. Links partially and completely overlapping with highlights.
// 4. Adjacent annotations.
TEST_F(PDFiumPageOverlappingTest, CountPartialOverlaps) {
  static const std::vector<gfx::Range> kLinkRanges = {
      {0, 10}, {13, 25}, {37, 52}, {71, 84}, {93, 113}};
  static const std::vector<gfx::Range> kHighlightRanges = {
      {4, 13}, {8, 15}, {14, 22}, {37, 73}, {49, 95}, {80, 101}};
  std::vector<PDFiumPage::Link> links;
  std::vector<PDFiumPage::Highlight> highlights;
  PopulateTextObjects(kLinkRanges, &links);
  PopulateTextObjects(kHighlightRanges, &highlights);
  ASSERT_EQ(15u, PDFiumPage::CountLinkHighlightOverlaps(links, highlights));
}

TEST_F(PDFiumPageOverlappingTest, CountCompleteOverlaps) {
  static const std::vector<gfx::Range> kLinkRanges = {
      {0, 15}, {25, 40}, {30, 50}, {50, 67}, {61, 72}, {67, 81}};
  static const std::vector<gfx::Range> kHighlightRanges = {
      {6, 25}, {25, 40}, {30, 50}, {50, 83}};
  std::vector<PDFiumPage::Link> links;
  std::vector<PDFiumPage::Highlight> highlights;
  PopulateTextObjects(kLinkRanges, &links);
  PopulateTextObjects(kHighlightRanges, &highlights);
  ASSERT_EQ(12u, PDFiumPage::CountLinkHighlightOverlaps(links, highlights));
}

}  // namespace chrome_pdf


text:
//
//  NewsViewModel.h
//  NetEase News
//
//  Created by 1860 on 16/6/21.
//  Copyright © 2016年 FanrongQu. All rights reserved.
//

#import "BaseViewModel.h"
#import "NewsMenuModel.h"

@interface NewsViewModel : BaseViewModel

/**
 *  获取顶部显示分类新闻信息
 */
- (NSArray *)getSlideMenus;

/**
 *  获取更多新闻分类
 */
- (void)getNewsMenus:(NSDictionary *)paramaters CompletionHandle:(void(^)(BOOL writeSucceed, NSError *error))completionHandle;

@end

redpajama_set_name: RedPajamaGithub


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ARPErrorNumbers (Jena Framework)
</TITLE>

<META NAME="date" CONTENT="2010-12-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.hp.hpl.jena.rdf.arp

Interface ARPErrorNumbers

All Known Implementing Classes:
ARPOptions, DOM2Model, JenaReader, NTriple, ParseException, SAX2Model, SAX2RDF, com.hp.hpl.jena.rdf.arp.impl.SAX2RDFImpl, com.hp.hpl.jena.rdf.arp.impl.XMLHandler

public interface ARPErrorNumbers

Error numbers used by ARP.

Author:

jjc

Field Summary

static int
EM_ERROR

          Used as ErrorMode to report error, and not generate associated triples.

static int
EM_FATAL

          Used as ErrorMode to stop processing after reporting error.

static int
EM_IGNORE

          Used as ErrorMode to not report an error.

static int
EM_WARNING

          Used as ErrorMode to report warning and continue processing.

static int
ERR_ABOUTEACH_NOT_TOPLEVEL

          Deprecated. No longer occurs. Any use of rdf:aboutEach is a syntax error.

static int
ERR_BAD_RDF_ATTRIBUTE

          An attribute name in the RDF namespace has been
     used that is reserved as an RDF name, but not as an attribute.

static int
ERR_BAD_RDF_ELEMENT

          An element is tagged rdf:XXX where XXX is an RDF attribute name.

static int
ERR_ENCODING_MISMATCH

          ARP was called with an InputSteamReader or a FileReader which used
 an encoding differnt from that in the XML declaration.

static int
ERR_GENERIC_IO

          An IOException occurred.

static int
ERR_INTERNAL_ERROR

          Deprecated. No longer used.

static int
ERR_INTERRUPTED

          The Thread was interrupted.

static int
ERR_LI_AS_TYPE

          rdf:li is being used in the typed node construction.

static int
ERR_NOT_WHITESPACE

          Non-white character data has occurred where the RDF grammar
     does not permit it.

static int
ERR_RESOLVING_AGAINST_MALFORMED_BASE

          Cannot resolve a relative URI, because base URI is malformed.

static int
ERR_RESOLVING_AGAINST_RELATIVE_BASE

          Cannot resolve a relative URI, because base URI is relative.

static int
ERR_RESOLVING_URI_AGAINST_NULL_BASE

          A base URI was required but not given.

static int
ERR_SAX_ERROR

          The SAX Parser generated an error.

static int
ERR_SAX_FATAL_ERROR

          The SAX Parser generated a.error error.

static int
ERR_STRING_NOT_NORMAL_FORM_C

          Deprecated. See 2nd Last Call docs

 *  (E207).

static int
ERR_SYNTAX_ERROR

          The attributes or element tags contravene the RDF grammar.

static int
ERR_UNABLE_TO_RECOVER

          Deprecated. Not used.

static int
ERR_URI_NOT_NORMAL_FORM_C

          Deprecated. WG decision on williams-01.

static int
ERR_UTF_ENCODING

          The document claimed to be UTF-8 but was not.

static int
IGN_DAML_COLLECTION

          The use of rdf:parseType="daml:collection" does
     not conform with RDF2004.

static int
IGN_NO_BASE_URI_SPECIFIED

          Indicates that no name is known for the current file being parsed.

static int
IGN_PRIVATE_XMLLANG

          An xml:lang attribute uses one or more of the extension
     facilities in RFC3066 or ISO639.

static int
IGN_XMLBASE_SIGNIFICANT

          Indicates that somewhere,
     an xml:base attribute has been used and
     changes the interpretation of some URI (either through a
     relative URI-reference or rdf:ID).

static int
IGN_XMLBASE_USED

          Indicates that somewhere, other than in an XML Literal
     an xml:base attribute has been used.

static int
WARN_BAD_NAME

          An ID symbol or other grammar production that should be an
       XML name is malformed.

static int
WARN_BAD_NAMESPACE_URI

          Some xmlns declaration has a non-URI as its right hand side.

static int
WARN_BAD_RDF_NAMESPACE_URI

          Within RDF, it is not permitted to define an
  XML namespace that has a namespace URI with the
 RDF namespace URI as a proper prefix.

static int
WARN_BAD_XML

          Deprecated.

static int
WARN_BAD_XML_NAMESPACE_URI

          Within RDF, it is not permitted to define an
  XML   namespace that has a namespace URI with the  XML
 namespace URI as a proper prefix.

static int
WARN_BAD_XMLLANG

          The value of an xml:lang attribute while syntactically conforming
       to RFC3066 does not conform with other rules, possibly through not
       being listed in ISO639 or ISO3166 or the IANA language tag
       registry.

static int
WARN_BIG_FILE

          After 10000 rdf:ID attributes have been
 read, ARP no longer checks for
 WARN_REDEFINITION_OF_ID.

static int
WARN_DEPRECATED_XMLLANG

          The value of an xml:lang attribute has been deprecated by IANA (W117).

static int
WARN_ENCODING_MISMATCH

          ARP was called with an InputSteamReader or a FileReader which used
 an encoding differnt from that in the XML declaration.

static int
WARN_IN_STRICT_MODE

          This is an internal only field, not intended for public use.

static int
WARN_LEGAL_REUSE_OF_ID

          Deprecated. Last supported in Jena 2.1 - too expensive.

static int
WARN_MALFORMED_URI

          A URI reference does not conform to the definition of RDF URI Reference.

static int
WARN_MALFORMED_XMLLANG

          The value of an xml:lang attribute does not conform to the
       syntactic rules of RFC3066.

static int
WARN_MINOR_INTERNAL_ERROR

          Deprecated. No longer used.

static int
WARN_NON_IANA_ENCODING

          The character encoding in the XML declaration is not
 registered with IANA.

static int
WARN_NONCANONICAL_IANA_NAME

          The encoding in the XML declaration is an alias
 registered with IANA.

static int
WARN_NOT_RDF_NAMESPACE

          It seems likely that the namespace for rdf: has a typo in it.

static int
WARN_PROCESSING_INSTRUCTION_IN_RDF

          An XML processing instruction occurred in RDF content.

static int
WARN_QNAME_AS_ID

          Deprecated. Superceded by the more general WARN_BAD_NAME

static int
WARN_RDF_NN_AS_TYPE

          rdf:_NNN is being used in the typed node construction.

static int
WARN_REDEFINITION_OF_ID

          The same name has been used for more than one rdf:ID or rdf:bagID,
 in the context of the same xml:base (if any).

static int
WARN_RELATIVE_NAMESPACE_URI_DEPRECATED

          A namespace has been declared with a relative URI.

static int
WARN_RELATIVE_URI

          A URI reference which is a relative reference
has been used either as the starting base URI
or as the outcome of a URI resolution somehow.

static int
WARN_RESOLVING_URI_AGAINST_EMPTY_BASE

          A base URI was required but "" was given.

static int
WARN_SAX_WARNING

          The SAX Parser generated a warning.

static int
WARN_STRING_COMPOSING_CHAR

          String Literals in RDF should not start with a composing char,
 as defined by the CharacterModel working draft.

static int
WARN_STRING_NOT_NORMAL_FORM_C

          String Literals in RDF should be in Unicode Normal Form C

 *  (W131).

static int
WARN_UNKNOWN_PARSETYPE

          An unrecognised value for rdf:parseType has been found.

static int
WARN_UNKNOWN_RDF_ATTRIBUTE

          An attribute name in the RDF namespace has been
     used that is not a reserved RDF attribute name.

static int
WARN_UNKNOWN_RDF_ELEMENT

          An element is tagged rdf:XXX where XXX is not a recognised RDF element name.

static int
WARN_UNKNOWN_XML_ATTRIBUTE

          An attribute from the xml namespace has been used that is not
       recognised.

static int
WARN_UNQUALIFIED_ATTRIBUTE

          Some attribute that is not an RDF keyword is used in an
       unqualified fashion.

static int
WARN_UNQUALIFIED_ELEMENT

          An element tag is not a qualified name.

static int
WARN_UNQUALIFIED_RDF_ATTRIBUTE

          A standard rdf attribute like type or about is used
     without a namespace qualifier.

static int
WARN_UNSUPPORTED_ENCODING

          The character encoding in the XML declaration is not
 fully supported.

static int
WARN_URI_COMPOSING_CHAR

          Deprecated. WG decision on williams-01.

static int
WARN_XMLBASE_MISSING

          Deprecated. IGN_NO_BASE_URI_SPECIFIED

Field Detail

EM_IGNORE

static final int EM_IGNORE

Used as ErrorMode to not report an error.

See Also:
ARPOptions.setErrorMode(int, int),
Constant Field Values

EM_WARNING

static final int EM_WARNING

Used as ErrorMode to report warning and continue processing.

See Also:
ARPOptions.setErrorMode(int, int),
Constant Field Values

EM_ERROR

static final int EM_ERROR

Used as ErrorMode to report error, and not generate associated triples.

 In the event of an error (i.e. a condition with this error mode),
 no further triples involving the resources and literals associated with the error are created.
 The precise definition of 'associated with' is deliberately
 undefined, and may change in future releases.

 When the file includes.error error conditions the parsing is aborted immediately after such an error.
Otherwise, it is possible to see all the triples, including those involving resources and literals associated with any condition, by ensuring that the error mode of every error code is WARNING or IGNORE. (i.e. ARP optionally permits all errors to be downgraded to warnings, or to be ignored).
In this case, the precise rules which ARP uses to generate triples for ill-formed input are not defined by any standard and are subject to change with future releases.
For input involving no errors, ARP creates triples in accordance with the RDF/XML Syntax Revised Recommendation.

See Also:
ARPOptions.setErrorMode(int, int),
Constant Field Values

EM_FATAL

static final int EM_FATAL

Used as ErrorMode to stop processing after reporting error.

See Also:
ARPOptions.setErrorMode(int, int),
Constant Field Values

IGN_PRIVATE_XMLLANG

static final int IGN_PRIVATE_XMLLANG

An xml:lang attribute uses one or more of the extension
     facilities in RFC3066 or ISO639.
In some way, the langauge specified is non-standard.

In both default and strict modes this is ignored; a conservative application
in verbose mode may wish to raise a warning.
 (W001)

See Also:
com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_PRIVATE_USE,
com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_LOCAL_USE,
com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_EXTRA,
Constant Field Values

IGN_XMLBASE_USED

static final int IGN_XMLBASE_USED

Indicates that somewhere, other than in an XML Literal
     an xml:base attribute has been used.
     This is ignored in default and strict mode. (W002)

See Also:
IGN_XMLBASE_SIGNIFICANT,
Constant Field Values

IGN_XMLBASE_SIGNIFICANT

static final int IGN_XMLBASE_SIGNIFICANT

Indicates that somewhere,
     an xml:base attribute has been used and
     changes the interpretation of some URI (either through a
     relative URI-reference or rdf:ID). (W003)
     This is ignored in default and strict mode.

See Also:
IGN_XMLBASE_USED,
Constant Field Values

IGN_DAML_COLLECTION

static final int IGN_DAML_COLLECTION

The use of rdf:parseType="daml:collection" does
     not conform with RDF2004.
     This is ignored in default mode.
     In strict mode the parser follows the conformant behaviour
     which is to silently
     treat this as rdf:parseType="Literal" (W004).

See Also:
Constant Field Values

IGN_NO_BASE_URI_SPECIFIED

static final int IGN_NO_BASE_URI_SPECIFIED

Indicates that no name is known for the current file being parsed.
 (W005)

See Also:
Constant Field Values

WARN_XMLBASE_MISSING

@Deprecated
static final int WARN_XMLBASE_MISSING

Deprecated. IGN_NO_BASE_URI_SPECIFIED
(W100)

See Also:
Constant Field Values

WARN_UNQUALIFIED_RDF_ATTRIBUTE

static final int WARN_UNQUALIFIED_RDF_ATTRIBUTE

A standard rdf attribute like type or about is used
     without a namespace qualifier. In default and strict mode ARP adds the
rdf: qualifier and reports a warning. (W101).

See Also:
Constant Field Values

WARN_UNQUALIFIED_ATTRIBUTE

static final int WARN_UNQUALIFIED_ATTRIBUTE

Some attribute that is not an RDF keyword is used in an
       unqualified fashion. In default mode,  then the namespace of
       the enclosing element
       is used.
       In strict mode this is an error. (W102).

See Also:
Constant Field Values

WARN_UNKNOWN_RDF_ATTRIBUTE

static final int WARN_UNKNOWN_RDF_ATTRIBUTE

An attribute name in the RDF namespace has been
     used that is not a reserved RDF attribute name.
In default and strict modes, a statement is generated with the given name as property.
 In default and strict modes this is a warning. (W103).

See Also:
Constant Field Values

WARN_UNQUALIFIED_ELEMENT

static final int WARN_UNQUALIFIED_ELEMENT

An element tag is not a qualified name.
     In default mode, a resource or property is generated with a malformed URI.
 Strict mode treats this as an error. (W104).

See Also:
Constant Field Values

WARN_REDEFINITION_OF_ID

static final int WARN_REDEFINITION_OF_ID

The same name has been used for more than one rdf:ID or rdf:bagID,
 in the context of the same xml:base (if any).
      The default mode allows this with a warning.
     This check is expensive in memory. When processing very large files,
     it may be sensible to switch the check off by using
     ARPOptions.setErrorMode(int,int) to ignore this condition.
 (W105).

See Also:
WARN_LEGAL_REUSE_OF_ID,
Constant Field Values

WARN_UNKNOWN_PARSETYPE

static final int WARN_UNKNOWN_PARSETYPE

An unrecognised value for rdf:parseType has been found.
     In strict mode, this error is ignored, and it is treated
     as rdf:parseType="Literal", in default mode a warning is issued.
 (W106)

See Also:
Constant Field Values

WARN_MALFORMED_URI

static final int WARN_MALFORMED_URI

A URI reference does not conform to the definition of RDF URI Reference.
       Use Exception.getMessage() for details.
       In default mode, the malformed URI is passed to the RDF
       processing application; strict mode treats this as an error.
 (W107)

See Also:
Constant Field Values

WARN_BAD_NAME

static final int WARN_BAD_NAME

An ID symbol or other grammar production that should be an
       XML name is malformed. In default mode,
      the malformed string is passed to the RDF application. (W108)
Strict mode treats this as an error.

See Also:
Constant Field Values

WARN_RELATIVE_NAMESPACE_URI_DEPRECATED

static final int WARN_RELATIVE_NAMESPACE_URI_DEPRECATED

A namespace has been declared with a relative URI.
      Such relative URI namespaces have been
       deprecated.
       This often results in related WARN_RELATIVE_URI
       warnings.
       (W109)

See Also:
Constant Field Values

WARN_BAD_XML

@Deprecated
static final int WARN_BAD_XML

Deprecated.
No longer used.
(W111)

See Also:
Constant Field Values

WARN_MINOR_INTERNAL_ERROR

@Deprecated
static final int WARN_MINOR_INTERNAL_ERROR

Deprecated. No longer used.
Should not happen.
(W112)

See Also:
Constant Field Values

WARN_UNKNOWN_RDF_ELEMENT

static final int WARN_UNKNOWN_RDF_ELEMENT

An element is tagged rdf:XXX where XXX is not a recognised RDF element name.
The typed node or property element construction is matched.
In both default and strict modes this is a warning. (W113).

See Also:
Constant Field Values

WARN_RDF_NN_AS_TYPE

static final int WARN_RDF_NN_AS_TYPE

rdf:_NNN is being used in the typed node construction.

 In default mode this is a warning; in strict mode it is ignored.(W114)

See Also:
Constant Field Values

WARN_MALFORMED_XMLLANG

static final int WARN_MALFORMED_XMLLANG

The value of an xml:lang attribute does not conform to the
       syntactic rules of RFC3066.
       In default mode this is a warning, in strict mode an error. (W115)

See Also:
Constant Field Values

WARN_BAD_XMLLANG

static final int WARN_BAD_XMLLANG

The value of an xml:lang attribute while syntactically conforming
       to RFC3066 does not conform with other rules, possibly through not
       being listed in ISO639 or ISO3166 or the IANA language tag
       registry. The databases used of these registries was a snapshot of
      July 24, 2001. If you are using language tags that postdate this snapshot,
      you should ignore this condition.
The use of a three letter tag instead of a two letter tag or use of
      the language tag "und" is also reported under this condition, see RFC3066.

       In default mode this is a warning, in strict mode an error. (W116)

See Also:
Constant Field Values

WARN_UNKNOWN_XML_ATTRIBUTE

static final int WARN_UNKNOWN_XML_ATTRIBUTE

An attribute from the xml namespace has been used that is not
       recognised. (W118).
 In default mode this is a warning; in strict mode it is ignored.

See Also:
Constant Field Values

WARN_PROCESSING_INSTRUCTION_IN_RDF

static final int WARN_PROCESSING_INSTRUCTION_IN_RDF

An XML processing instruction occurred in RDF content.
 Such instructions are ignored, and are usually in error. (W119).
 In default mode this is a warning; in strict mode it is ignored.

See Also:
Constant Field Values

WARN_LEGAL_REUSE_OF_ID

@Deprecated
static final int WARN_LEGAL_REUSE_OF_ID

Deprecated. Last supported in Jena 2.1 - too expensive.
No longer used.

See Also:
WARN_REDEFINITION_OF_ID,
Constant Field Values

WARN_STRING_COMPOSING_CHAR

static final int WARN_STRING_COMPOSING_CHAR

String Literals in RDF should not start with a composing char,
 as defined by the CharacterModel working draft.
  This is particularly important if XML 1.1 compatibility is
 required.
  This is a warning in both default and strict modes (W121).

See Also:
Constant Field Values

WARN_QNAME_AS_ID

@Deprecated
static final int WARN_QNAME_AS_ID

Deprecated. Superceded by the more general WARN_BAD_NAME
No longer used. (W122).

See Also:
Constant Field Values

WARN_URI_COMPOSING_CHAR

@Deprecated
static final int WARN_URI_COMPOSING_CHAR

Deprecated. WG decision on williams-01.
No longer used. (W123)

See Also:
Constant Field Values

WARN_BAD_NAMESPACE_URI

static final int WARN_BAD_NAMESPACE_URI

Some xmlns declaration has a non-URI as its right hand side.
 This currently permits non-ASCII characters, awaiting clarification from
 the namespace editor.  This is a warning in default mode and an error in
 strict mode (W124).

See Also:
Constant Field Values

WARN_DEPRECATED_XMLLANG

static final int WARN_DEPRECATED_XMLLANG

The value of an xml:lang attribute has been deprecated by IANA (W117). In strict and default mode this is a warning.

See Also:
Constant Field Values

WARN_IN_STRICT_MODE

static final int WARN_IN_STRICT_MODE

This is an internal only field, not intended for public use.
 In particular, specifically setting the error mode for this
 error should be avoided.
 Errors with this error code cannot happen. (W125)
 When this warning is treated as an error, the non-RDF compliant
 daml:collection production is surpressed.

See Also:
Constant Field Values

WARN_SAX_WARNING

static final int WARN_SAX_WARNING

The SAX Parser generated a warning. Treated as a warning in both default
 and strict modes. (W126)

See Also:
Constant Field Values

WARN_BAD_RDF_NAMESPACE_URI

static final int WARN_BAD_RDF_NAMESPACE_URI

Within RDF, it is not permitted to define an
  XML namespace that has a namespace URI with the
 RDF namespace URI as a proper prefix. (W127).
 A warning in default mode, an error in strict mode.

See Also:
Constant Field Values

WARN_BAD_XML_NAMESPACE_URI

static final int WARN_BAD_XML_NAMESPACE_URI

Within RDF, it is not permitted to define an
  XML   namespace that has a namespace URI with the  XML
 namespace URI as a proper prefix. (W128). A warning in default mode,an
 error in strict mode.

See Also:
Constant Field Values

WARN_ENCODING_MISMATCH

static final int WARN_ENCODING_MISMATCH

ARP was called with an InputSteamReader or a FileReader which used
 an encoding differnt from that in the XML declaration. The usual fix
 is to use an InputStream or a FileInputStream instead. (W129).
 A warning in default mode, an error in strict mode.

See Also:
ERR_ENCODING_MISMATCH,
Constant Field Values

WARN_RESOLVING_URI_AGAINST_EMPTY_BASE

static final int WARN_RESOLVING_URI_AGAINST_EMPTY_BASE

A base URI was required but "" was given. The
 RDF/XML input includes a relative URI, an rdf:ID or
 some other same document reference. (W130).

See Also:
Constant Field Values

WARN_STRING_NOT_NORMAL_FORM_C

static final int WARN_STRING_NOT_NORMAL_FORM_C

String Literals in RDF should be in Unicode Normal Form C

 *  (W131).

See Also:
Constant Field Values

WARN_UNSUPPORTED_ENCODING

static final int WARN_UNSUPPORTED_ENCODING

The character encoding in the XML declaration is not
 fully supported. In particular, advice about
 the IANA registry entry, if any, is not available.
 This warning is only believed to be applicable to
 Java 1.4. Java 1.5 has more extensive support for
 this information, and so upgrading from Java 1.4 to Java 1.5
 is a plausible response to this warning.
 (W132).

See Also:
Constant Field Values

WARN_NON_IANA_ENCODING

static final int WARN_NON_IANA_ENCODING

The character encoding in the XML declaration is not
 registered with IANA. Hence the RDF/XML file
 is not appropriate for use on the Web, but only
 for private interactions, between parties agreeing
 on the character encoding.
 It may not be possible to read this file with superficially
 similar Jena installations, let alone with other RDF systems.
 (W133).

See Also:
Constant Field Values

WARN_NONCANONICAL_IANA_NAME

static final int WARN_NONCANONICAL_IANA_NAME

The encoding in the XML declaration is an alias
 registered with IANA. Better interoperability
 is likely by replacing the encoding declaration
 with the canonical IANA name, provided in the warning
 message.
 (W134).

See Also:
Constant Field Values

WARN_NOT_RDF_NAMESPACE

static final int WARN_NOT_RDF_NAMESPACE

It seems likely that the namespace for rdf: has a typo in it.
 (W135)

See Also:
Constant Field Values

WARN_RELATIVE_URI

static final int WARN_RELATIVE_URI

A URI reference which is a relative reference
has been used either as the starting base URI
or as the outcome of a URI resolution somehow.
In strict mode this is an error.
(W136)

See Also:
Constant Field Values

WARN_BIG_FILE

static final int WARN_BIG_FILE

After 10000 rdf:ID attributes have been
 read, ARP no longer checks for
 WARN_REDEFINITION_OF_ID.
 This warning is to inform the user that
 ARP behaviour has changed during parsing.

See Also:
Constant Field Values

ERR_INTERNAL_ERROR

@Deprecated
static final int ERR_INTERNAL_ERROR

Deprecated. No longer used.
Should not happen.
     (E200)

See Also:
Constant Field Values

ERR_SYNTAX_ERROR

static final int ERR_SYNTAX_ERROR

The attributes or element tags contravene the RDF grammar.
     (XML syntax errors are not reported with this mechanism,
     but as SAXParseException's).
     The detailed error message indicates the nature of the contravention.
     Future releases may specialize these codes, it is better to
     use ParseException.isSyntaxError() to check for syntax errors.
     (E201).

See Also:
Constant Field Values

ERR_NOT_WHITESPACE

static final int ERR_NOT_WHITESPACE

Non-white character data has occurred where the RDF grammar
     does not permit it. This is a special case of ERR_SYNTAX_ERROR,
     which is detected differently.
    (E202)

See Also:
Constant Field Values

ERR_ABOUTEACH_NOT_TOPLEVEL

@Deprecated
static final int ERR_ABOUTEACH_NOT_TOPLEVEL

Deprecated. No longer occurs. Any use of rdf:aboutEach is a syntax error.
rdf:aboutEach may only occur in a top-level obj expansion,
 either an rdf:Description or a typed node. This is a special
 case of ERR_SYNTAX_ERROR, which is detected differently. (E203).

See Also:
Constant Field Values

ERR_LI_AS_TYPE

static final int ERR_LI_AS_TYPE

rdf:li is being used in the typed node construction.
 (E204)

See Also:
Constant Field Values

ERR_BAD_RDF_ELEMENT

static final int ERR_BAD_RDF_ELEMENT

An element is tagged rdf:XXX where XXX is an RDF attribute name.
 (E205)

See Also:
Constant Field Values

ERR_BAD_RDF_ATTRIBUTE

static final int ERR_BAD_RDF_ATTRIBUTE

An attribute name in the RDF namespace has been
     used that is reserved as an RDF name, but not as an attribute.
     These are rdf:Description, rdf:aboutEach, rdf:aboutEachPrefix.
     The latter two are deprecated. (E206).

See Also:
Constant Field Values

ERR_STRING_NOT_NORMAL_FORM_C

@Deprecated
static final int ERR_STRING_NOT_NORMAL_FORM_C

Deprecated. See 2nd Last Call docs

 *  (E207).
No longer used.

See Also:
WARN_STRING_NOT_NORMAL_FORM_C,
Constant Field Values

ERR_URI_NOT_NORMAL_FORM_C

@Deprecated
static final int ERR_URI_NOT_NORMAL_FORM_C

Deprecated. WG decision on williams-01.
No longer used.(E208).

See Also:
Constant Field Values

ERR_SAX_ERROR

static final int ERR_SAX_ERROR

The SAX Parser generated an error.
 Treated as an error in both default and strict modes. (E209)

See Also:
Constant Field Values

ERR_ENCODING_MISMATCH

static final int ERR_ENCODING_MISMATCH

ARP was called with an InputSteamReader or a FileReader which used
 an encoding differnt from that in the XML declaration. Moreover, this
 was detected as probably significant (i.e. the document includes
 characters outside the ascii range). The usual fix is to use an
 InputStream or a FileInputStream instead. (E210).

See Also:
WARN_ENCODING_MISMATCH,
Constant Field Values

ERR_RESOLVING_URI_AGAINST_NULL_BASE

static final int ERR_RESOLVING_URI_AGAINST_NULL_BASE

A base URI was required but not given. The
 RDF/XML input includes a relative URI, an rdf:ID or
 some other same document reference. (E211).

See Also:
Constant Field Values

ERR_UTF_ENCODING

static final int ERR_UTF_ENCODING

The document claimed to be UTF-8 but was not.
 It probably needs an xml declaration with
 an encoding attribute. (E212).

See Also:
Constant Field Values

ERR_GENERIC_IO

static final int ERR_GENERIC_IO

An IOException occurred. (E213).

See Also:
Constant Field Values

ERR_RESOLVING_AGAINST_MALFORMED_BASE

static final int ERR_RESOLVING_AGAINST_MALFORMED_BASE

Cannot resolve a relative URI, because base URI is malformed.
 The base URI, specified in the API call, or
 with an xml:base was malformed,
 (see WARN_MALFORMED_URI).
 A relative URI needs to be resolved against it,
 and this cannot be done correctly. (E214)

See Also:
Constant Field Values

ERR_RESOLVING_AGAINST_RELATIVE_BASE

static final int ERR_RESOLVING_AGAINST_RELATIVE_BASE

Cannot resolve a relative URI, because base URI is relative.
 The base URI, specified in the API call, or
 with an xml:base was relative WARN_RELATIVE_URI.
 A relative URI needs to be resolved against it,
 resulting in a relative URI. (E215)

See Also:
Constant Field Values

ERR_UNABLE_TO_RECOVER

@Deprecated
static final int ERR_UNABLE_TO_RECOVER

Deprecated. Not used.
No longer used. (E300)

See Also:
Constant Field Values

ERR_SAX_FATAL_ERROR

static final int ERR_SAX_FATAL_ERROR

The SAX Parser generated a.error error.
 Resetting this mode is not supported.
 Treated as a.error error in both
 default and strict modes. (E301)

See Also:
Constant Field Values

ERR_INTERRUPTED

static final int ERR_INTERRUPTED

The Thread was interrupted. (E302)

See Also:
Constant Field Values

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright ? 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP


text:
#ifndef __CONFIG_SNOW_H
#define __CONFIG_SNOW_H

#include <configs/exynos5250-common.h>
#include <configs/exynos5-dt-common.h>
#include <configs/exynos5-common.h>

#define CONFIG_BOARD_COMMON

#define CONFIG_DEFAULT_CONSOLE		"console=ttySAC1,115200n8\0"

#endif	/* __CONFIG_SNOW_H */


text:
module SslReminder
  VERSION = "0.0.1".freeze
end


text:
// Copyright 2016 Google Inc. All Rights Reserved.
//
// 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.

using Google.Api.Gax;
using Google.Apis.Storage.v1;
using Google.Apis.Storage.v1.Data;
using System.Threading;
using System.Threading.Tasks;

namespace Google.Storage.V1
{
    public partial class StorageClientImpl
    {
        /// <inheritdoc />
        public override Bucket CreateBucket(string projectId, string bucket, CreateBucketOptions options = null) =>
            CreateCreateBucketRequest(projectId, bucket, options).Execute();

        /// <inheritdoc />
        public override Task<Bucket> CreateBucketAsync(string projectId, string bucket, CreateBucketOptions options = null,
            CancellationToken cancellationToken = default(CancellationToken)) =>
            CreateCreateBucketRequest(projectId, bucket, options).ExecuteAsync(cancellationToken);

        /// <inheritdoc />
        public override Bucket CreateBucket(string projectId, Bucket bucket, CreateBucketOptions options = null) =>
            CreateCreateBucketRequest(projectId, bucket, options).Execute();

        /// <inheritdoc />
        public override Task<Bucket> CreateBucketAsync(string projectId, Bucket bucket, CreateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
            CreateCreateBucketRequest(projectId, bucket, options).ExecuteAsync(cancellationToken);

        private BucketsResource.InsertRequest CreateCreateBucketRequest(string projectId, string bucket, CreateBucketOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            ValidateBucketName(bucket);
            var bucketEntity = new Bucket { Name = bucket };
            var request = Service.Buckets.Insert(bucketEntity, projectId);
            options?.ModifyRequest(request);
            return request;
        }

        private BucketsResource.InsertRequest CreateCreateBucketRequest(string projectId, Bucket bucket, CreateBucketOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            ValidateBucket(bucket, nameof(bucket));
            var request = Service.Buckets.Insert(bucket, projectId);
            options?.ModifyRequest(request);
            return request;
        }
    }
}


text:
"""Leetcode 326. Power of Three
Easy

URL: https://leetcode.com/problems/power-of-three/

Given an integer, write a function to determine if it is a power of three.

Example 1:
Input: 27
Output: true

Example 2:
Input: 0
Output: false

Example 3:
Input: 9
Output: true

Example 4:
Input: 45
Output: false

Follow up:
Could you do it without using any loop / recursion?
"""

class SolutionWhile(object):
    def isPowerOfThree(self, n):
        """
        :type n: int
        :rtype: bool

        Time complexity: O(logn).
        Space complexity: O(1).
        """
        while n > 1:
            if n % 3 != 0:
                return False
            n /= 3.0

        return n == 1

class SolutionLog10(object):
    def isPowerOfThree(self, n):
        """
        :type n: int
        :rtype: bool

        Time complexity: O(1).
        Space complexity: O(1).
        """
        import math

        if n < 1:
            return False

        if n == 1:
            return True

        # If 3^k = n, k * log10(3) = log10(n) => k is int.
        k = math.log10(n) / math.log10(3)
        return k % 1 == 0

def main():
    # Output: True
    n = 27
    print SolutionWhile().isPowerOfThree(n)
    print SolutionLog10().isPowerOfThree(n)

    # Output: False
    n = 0
    print SolutionWhile().isPowerOfThree(n)
    print SolutionLog10().isPowerOfThree(n)

    # Output: True
    n = 9
    print SolutionWhile().isPowerOfThree(n)
    print SolutionLog10().isPowerOfThree(n)

    # Output: False
    n = 45
    print SolutionWhile().isPowerOfThree(n)
    print SolutionLog10().isPowerOfThree(n)

if __name__ == '__main__':
    main()


text:
import datetime
import decimal

from django.test import TestCase
from django.utils import timezone

from . import TRANSFER_CREATED_TEST_DATA, TRANSFER_CREATED_TEST_DATA2
from ..models import Event, Transfer, Customer, CurrentSubscription, Charge
from ..utils import get_user_model

class CustomerManagerTest(TestCase):

    def setUp(self):
        User = get_user_model()
        # create customers and current subscription records
        period_start = datetime.datetime(2013, 4, 1, tzinfo=timezone.utc)
        period_end = datetime.datetime(2013, 4, 30, tzinfo=timezone.utc)
        start = datetime.datetime(2013, 1, 1, tzinfo=timezone.utc)
        for i in range(10):
            customer = Customer.objects.create(
                user=User.objects.create_user(username="patrick{0}".format(i)),
                stripe_id="cus_xxxxxxxxxxxxxx{0}".format(i),
                card_fingerprint="YYYYYYYY",
                card_last_4="2342",
                card_kind="Visa"
            )
            CurrentSubscription.objects.create(
                customer=customer,
                plan="test",
                current_period_start=period_start,
                current_period_end=period_end,
                amount=(500 / decimal.Decimal("100.0")),
                status="active",
                start=start,
                quantity=1
            )
        customer = Customer.objects.create(
            user=User.objects.create_user(username="patrick{0}".format(11)),
            stripe_id="cus_xxxxxxxxxxxxxx{0}".format(11),
            card_fingerprint="YYYYYYYY",
            card_last_4="2342",
            card_kind="Visa"
        )
        CurrentSubscription.objects.create(
            customer=customer,
            plan="test",
            current_period_start=period_start,
            current_period_end=period_end,
            amount=(500 / decimal.Decimal("100.0")),
            status="canceled",
            canceled_at=period_end,
            start=start,
            quantity=1
        )
        customer = Customer.objects.create(
            user=User.objects.create_user(username="patrick{0}".format(12)),
            stripe_id="cus_xxxxxxxxxxxxxx{0}".format(12),
            card_fingerprint="YYYYYYYY",
            card_last_4="2342",
            card_kind="Visa"
        )
        CurrentSubscription.objects.create(
            customer=customer,
            plan="test-2",
            current_period_start=period_start,
            current_period_end=period_end,
            amount=(500 / decimal.Decimal("100.0")),
            status="active",
            start=start,
            quantity=1
        )

    def test_started_during_no_records(self):
        self.assertEquals(
            Customer.objects.started_during(2013, 4).count(),
            0
        )

    def test_started_during_has_records(self):
        self.assertEquals(
            Customer.objects.started_during(2013, 1).count(),
            12
        )

    def test_canceled_during(self):
        self.assertEquals(
            Customer.objects.canceled_during(2013, 4).count(),
            1
        )

    def test_canceled_all(self):
        self.assertEquals(
            Customer.objects.canceled().count(),
            1
        )

    def test_active_all(self):
        self.assertEquals(
            Customer.objects.active().count(),
            11
        )

    def test_started_plan_summary(self):
        for plan in Customer.objects.started_plan_summary_for(2013, 1):
            if plan["current_subscription__plan"] == "test":
                self.assertEquals(plan["count"], 11)
            if plan["current_subscription__plan"] == "test-2":
                self.assertEquals(plan["count"], 1)

    def test_active_plan_summary(self):
        for plan in Customer.objects.active_plan_summary():
            if plan["current_subscription__plan"] == "test":
                self.assertEquals(plan["count"], 10)
            if plan["current_subscription__plan"] == "test-2":
                self.assertEquals(plan["count"], 1)

    def test_canceled_plan_summary(self):
        for plan in Customer.objects.canceled_plan_summary_for(2013, 1):
            if plan["current_subscription__plan"] == "test":
                self.assertEquals(plan["count"], 1)
            if plan["current_subscription__plan"] == "test-2":
                self.assertEquals(plan["count"], 0)

    def test_churn(self):
        self.assertEquals(
            Customer.objects.churn(),
            decimal.Decimal("1") / decimal.Decimal("11")
        )

class TransferManagerTest(TestCase):

    def test_transfer_summary(self):
        event = Event.objects.create(
            stripe_id=TRANSFER_CREATED_TEST_DATA["id"],
            kind="transfer.created",
            livemode=True,
            webhook_message=TRANSFER_CREATED_TEST_DATA,
            validated_message=TRANSFER_CREATED_TEST_DATA,
            valid=True
        )
        event.process()
        event = Event.objects.create(
            stripe_id=TRANSFER_CREATED_TEST_DATA2["id"],
            kind="transfer.created",
            livemode=True,
            webhook_message=TRANSFER_CREATED_TEST_DATA2,
            validated_message=TRANSFER_CREATED_TEST_DATA2,
            valid=True
        )
        event.process()
        self.assertEquals(Transfer.objects.during(2012, 9).count(), 2)
        totals = Transfer.objects.paid_totals_for(2012, 9)
        self.assertEquals(
            totals["total_amount"], decimal.Decimal("19.10")
        )
        self.assertEquals(
            totals["total_net"], decimal.Decimal("19.10")
        )
        self.assertEquals(
            totals["total_charge_fees"], decimal.Decimal("0.90")
        )
        self.assertEquals(
            totals["total_adjustment_fees"], decimal.Decimal("0")
        )
        self.assertEquals(
            totals["total_refund_fees"], decimal.Decimal("0")
        )
        self.assertEquals(
            totals["total_validation_fees"], decimal.Decimal("0")
        )

class ChargeManagerTests(TestCase):

    def setUp(self):
        customer = Customer.objects.create(
            user=get_user_model().objects.create_user(username="patrick"),
            stripe_id="cus_xxxxxxxxxxxxxx"
        )
        Charge.objects.create(
            stripe_id="ch_1",
            customer=customer,
            charge_created=datetime.datetime(2013, 1, 1, tzinfo=timezone.utc),
            paid=True,
            amount=decimal.Decimal("100"),
            fee=decimal.Decimal("3.42"),
            amount_refunded=decimal.Decimal("0")
        )
        Charge.objects.create(
            stripe_id="ch_2",
            customer=customer,
            charge_created=datetime.datetime(2013, 1, 1, tzinfo=timezone.utc),
            paid=True,
            amount=decimal.Decimal("100"),
            fee=decimal.Decimal("3.42"),
            amount_refunded=decimal.Decimal("10")
        )
        Charge.objects.create(
            stripe_id="ch_3",
            customer=customer,
            charge_created=datetime.datetime(2013, 1, 1, tzinfo=timezone.utc),
            paid=False,
            amount=decimal.Decimal("100"),
            fee=decimal.Decimal("3.42"),
            amount_refunded=decimal.Decimal("0")
        )
        Charge.objects.create(
            stripe_id="ch_4",
            customer=customer,
            charge_created=datetime.datetime(2013, 4, 1, tzinfo=timezone.utc),
            paid=True,
            amount=decimal.Decimal("500"),
            fee=decimal.Decimal("6.04"),
            amount_refunded=decimal.Decimal("15.42")
        )

    def test_charges_during(self):
        charges = Charge.objects.during(2013, 1)
        self.assertEqual(charges.count(), 3)

    def test_paid_totals_for_jan(self):
        totals = Charge.objects.paid_totals_for(2013, 1)
        self.assertEqual(totals["total_amount"], decimal.Decimal("200"))
        self.assertEqual(totals["total_fee"], decimal.Decimal("6.84"))
        self.assertEqual(totals["total_refunded"], decimal.Decimal("10"))

    def test_paid_totals_for_apr(self):
        totals = Charge.objects.paid_totals_for(2013, 4)
        self.assertEqual(totals["total_amount"], decimal.Decimal("500"))
        self.assertEqual(totals["total_fee"], decimal.Decimal("6.04"))
        self.assertEqual(totals["total_refunded"], decimal.Decimal("15.42"))

    def test_paid_totals_for_dec(self):
        totals = Charge.objects.paid_totals_for(2013, 12)
        self.assertEqual(totals["total_amount"], None)
        self.assertEqual(totals["total_fee"], None)
        self.assertEqual(totals["total_refunded"], None)


text:
function mogrify(arguments, img_filename, b_verbose)
% Run the unix mogrify command on an image
% mogrify(arguments, img_filename, b_verbose)
%
% Arguments are inserted before the image filename
% Tested on Mac OS X 10.7

% By Daniel Golden (dgolden1 at stanford dot edu) May 2012
% $Id: mogrify.m 233 2013-04-04 22:44:06Z dgolden $

if ~exist('b_verbose', 'var') || isempty(b_verbose)
  b_verbose = false;
end

if ~exist(img_filename, 'file')
  if exist([img_filename '.png'], 'file')
    img_filename = [img_filename '.png'];
  elseif exist([img_filename '.jpg'], 'file')
    img_filename = [img_filename '.jpg'];
  else
    error('File %s does not exist', img_filename);
  end
end

setup_prefix = 'DYLD_LIBRARY_PATH="";'; % Fixes a bug in Matlab implementation of libfreetype.6.dylib
mogrify_path = get_sys_cmd_path('mogrify');

% Manually-downloaded version of ImageMagick to fix bug relating to png getting darker
% after conversion
% setup_prefix = sprintf('export MAGICK_HOME="%s"; ', fullfile(danmatlabroot, 'ImageMagick-6.8.3'));
% setup_prefix = [setup_prefix 'export PATH="$MAGICK_HOME/bin:$PATH"; '];
% setup_prefix = [setup_prefix 'export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"; '];
% mogrify_path = fullfile(danmatlabroot, 'ImageMagick-6.8.3', 'lib', 'ImageMagick-6.8.3', 'bin-Q16', 'mogrify');

img_filename_sanitized = strrep(img_filename, ' ', '\ ');

cmd = sprintf('%s%s %s %s', setup_prefix, mogrify_path, arguments, img_filename_sanitized);

if b_verbose
  fprintf('%s\n', cmd);
end

[status, result] = system(cmd);

if b_verbose || status
  fprintf('%s\n', result);
end


text:
package com.eden.orchid.testhelpers;

import com.caseyjbrooks.clog.Clog;
import com.eden.common.util.EdenUtils;
import com.eden.orchid.api.OrchidContext;
import com.eden.orchid.api.registration.OrchidModule;
import com.eden.orchid.impl.compilers.markdown.FlexmarkModule;
import com.eden.orchid.impl.compilers.pebble.PebbleModule;
import kotlin.Pair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class OrchidIntegrationTest extends BaseOrchidTest {

    protected boolean serve = false;
    protected TestOrchidRunner runner;
    protected OrchidContext testContext;
    protected TestResults testResults;

    protected Map<String, Object> flags;
    protected Map<String, Object> config;
    protected Map<String, Pair<String, Map<String, Object>>> resources;

    protected final Set<OrchidModule> standardAdditionalModules;

    public OrchidIntegrationTest(OrchidModule... standardAdditionalModules) {
        super();
        Set<OrchidModule> standardModules = new HashSet<>();
        Collections.addAll(standardModules, standardAdditionalModules);
        this.standardAdditionalModules = Collections.unmodifiableSet(standardModules);
    }

    @BeforeEach
    public void setUp() {
        super.setUp();
        runner = new TestOrchidRunner();
        flags = new HashMap<>();
        config = new HashMap<>();
        resources = new HashMap<>();
        serve = false;
    }

    @AfterEach
    public void tearDown() {
        super.tearDown();
        runner = null;
        testContext = null;
        testResults = null;
        flags = null;
        config = null;
        resources = null;
        serve = false;
    }

    protected void disableLogging() {
        Clog.getInstance().setMinPriority(Clog.Priority.FATAL);
    }

    protected void enableLogging() {
        Clog.getInstance().setMinPriority(Clog.Priority.VERBOSE);
    }

    protected void flag(String flag, Object value) {
        flags.put(flag, value);
    }

    protected void configObject(String flag, String json) {
        if(config.containsKey(flag)) {
            Object o = config.get(flag);
            if(o instanceof Map) {
                config.put(flag, EdenUtils.merge((Map<String, ?>) o, new JSONObject(json).toMap()));
            }
            else {
                config.put(flag, new JSONObject(json).toMap());
            }
        }
        else {
            config.put(flag, new JSONObject(json).toMap());
        }
    }

    protected void configArray(String flag, String json) {
        config.put(flag, new JSONArray(json).toList());
    }

    protected void resource(String path) {
        resource(path, "");
    }

    protected void resource(String path, String content) {
        resource(path, content, new HashMap<>());
    }

    protected void resource(String path, String content, String json) {
        resource(path, content, new JSONObject(json).toMap());
    }

    protected void resource(String path, String content, Map<String, Object> data) {
        resources.put(path, new Pair<>(content, data));
    }

    protected void serveOn(int port) {
        flag("task", "serve");
        flag("port", port);
        flag("src", "./src");
        flag("dest", "./build/orchid/test");
        this.serve = true;
    }

// Execute test runner
//----------------------------------------------------------------------------------------------------------------------

    protected TestResults execute(OrchidModule... modules) {
        List<OrchidModule> testedModules = new ArrayList<>();
        if(modules != null) {
            Collections.addAll(testedModules, modules);
        }
        testedModules.addAll(standardAdditionalModules);
        testedModules.add(new TestImplModule(serve));
        testedModules.add(new PebbleModule());
        testedModules.add(new FlexmarkModule());

        if(!flags.containsKey("baseUrl")) {
            flag("baseUrl", "http://orchid.test");
        }

        Pair<OrchidContext, TestResults> results = runner.runTest(flags, config, resources, testedModules);
        this.testContext = results.getFirst();
        this.testResults = results.getSecond();
        return testResults;
    }

}


text:
@charset "UTF-8";
@import url(font-awesome.min.css);
@import url("http://fonts.googleapis.com/css?family=Source+Sans+Pro:300");
/* Reset */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline; }

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
  display: block; }

body {
  line-height: 1; }

ol, ul {
  list-style: none; }

blockquote, q {
  quotes: none; }

blockquote:before, blockquote:after, q:before, q:after {
  content: '';
  content: none; }

table {
  border-collapse: collapse;
  border-spacing: 0; }

body {
  -webkit-text-size-adjust: none; }

/* Box Model */
*, *:before, *:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box; }

/* Basic */
@media screen and (max-width: 480px) {
  html, body {
    min-width: 320px; } }

body.is-loading *, body.is-loading *:before, body.is-loading *:after {
  -moz-animation: none !important;
  -webkit-animation: none !important;
  -ms-animation: none !important;
  animation: none !important;
  -moz-transition: none !important;
  -webkit-transition: none !important;
  -ms-transition: none !important;
  transition: none !important; }

html {
  height: 100%; }

body {
  height: 100%;
  background-color: #ffffff;
  background-image: url("images/overlay.png"), -moz-linear-gradient(60deg, rgba(0, 0, 0, 0.55) 5%, rgba(19, 10, 35, 0.58)), url("../../images/bg.jpg");
  background-image: url("images/overlay.png"), -webkit-linear-gradient(60deg, rgba(0, 0, 0, 0.55) 5%, rgba(19, 10, 35, 0.58)), url("../../images/bg.jpg");
  background-image: url("images/overlay.png"), -ms-linear-gradient(60deg, rgba(0, 0, 0, 0.55) 5%, rgba(19, 10, 35, 0.58)), url("../../images/bg.jpg");
  background-image: url("images/overlay.png"), linear-gradient(60deg, rgba(0, 0, 0, 0.55) 5%, rgba(19, 10, 35, 0.58)), url("../../images/bg.jpg");
  background-repeat: repeat,			no-repeat,			no-repeat;
  background-size: 100px 100px,	cover,				cover;
  background-position: top left,		center center,		bottom center;
  background-attachment: fixed,			fixed,				fixed; }
  body:after {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: inherit;
    opacity: 0;
    z-index: 1;
    background-color: #ffffff;
    background-image: url("images/overlay.png"), -moz-linear-gradient(60deg, rgba(0, 0, 0, 0.5) 5%, rgba(19, 10, 35, 0.35));
    background-image: url("images/overlay.png"), -webkit-linear-gradient(60deg, rgba(0, 0, 0, 0.5) 5%, rgba(19, 10, 35, 0.35));
    background-image: url("images/overlay.png"), -ms-linear-gradient(60deg, rgba(0, 0, 0, 0.5) 5%, rgba(19, 10, 35, 0.35));
    background-image: url("images/overlay.png"), linear-gradient(60deg, rgba(0, 0, 0, 0.5) 5%, rgba(19, 10, 35, 0.35));
    background-repeat: repeat,			no-repeat;
    background-size: 100px 100px,	cover;
    background-position: top left,		center center;
    -moz-transition: opacity 1.75s ease-out;
    -webkit-transition: opacity 1.75s ease-out;
    -ms-transition: opacity 1.75s ease-out;
    transition: opacity 1.75s ease-out; }
  body.is-loading:after {
    opacity: 1; }

/* Type */
body, input, select, textarea {
  color: #414f57;
  font-family: "Source Sans Pro", Helvetica, sans-serif;
  font-size: 13pt;
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0em; }
  @media screen and (max-width: 1680px) {
    body, input, select, textarea {
      font-size: 11pt; } }
  @media screen and (max-width: 480px) {
    body, input, select, textarea {
      font-size: 10pt;
      line-height: 1.75; } }

a {
  -moz-transition: color 0.2s ease, border-color 0.2s ease;
  -webkit-transition: color 0.2s ease, border-color 0.2s ease;
  -ms-transition: color 0.2s ease, border-color 0.2s ease;
  transition: color 0.2s ease, border-color 0.2s ease;
  color: inherit;
  text-decoration: none; }
  a:before {
    -moz-transition: color 0.2s ease, text-shadow 0.2s ease;
    -webkit-transition: color 0.2s ease, text-shadow 0.2s ease;
    -ms-transition: color 0.2s ease, text-shadow 0.2s ease;
    transition: color 0.2s ease, text-shadow 0.2s ease; }
  a:hover {
    color: #ff7496; }

strong, b {
  color: #313f47; }

em, i {
  font-style: italic; }

p {
  margin: 0 0 1em 0; }

h1, h2, h3, h4, h5, h6 {
  color: #313f47;
  line-height: 1.5;
  margin: 0 0 0.5em 0; }
  h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color: inherit;
    text-decoration: none; }

h1 {
  font-size: 1.85em;
  letter-spacing: 0em;
  margin: 0 0 0.35em 0; }

h2 {
  font-size: 1.25em; }

h3 {
  font-size: 1em; }

h4 {
  font-size: 1em; }

h5 {
  font-size: 1em; }

h6 {
  font-size: 1em; }

@media screen and (max-width: 480px) {
  h1 {
    font-size: 1.65em; } }

sub {
  font-size: 0.8em;
  position: relative;
  top: 0.5em; }

sup {
  font-size: 0.8em;
  position: relative;
  top: -0.5em; }

hr {
  border: 0;
  border-bottom: solid 1px #c8cccf;
  margin: 2em 0; }

/* Form */
form {
  margin: 0 0 1em 0; }
  form > .field {
    margin: 0 0 1em 0; }
    form > .field > :last-child {
      margin-bottom: 0; }

label {
  color: #313f47;
  display: block;
  font-size: 0.9em;
  margin: 0 0 0.5em 0; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  border-radius: 4px;
  border: solid 1px #c8cccf;
  color: inherit;
  display: block;
  outline: 0;
  padding: 0 1em;
  text-decoration: none;
  width: 100%; }
  input[type="text"]:invalid,
  input[type="password"]:invalid,
  input[type="email"]:invalid,
  input[type="tel"]:invalid,
  select:invalid,
  textarea:invalid {
    box-shadow: none; }
  input[type="text"]:focus,
  input[type="password"]:focus,
  input[type="email"]:focus,
  input[type="tel"]:focus,
  select:focus,
  textarea:focus {
    border-color: #ff7496; }

.select-wrapper {
  text-decoration: none;
  display: block;
  position: relative; }
  .select-wrapper:before {
    content: "";
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-transform: none !important; }
  .select-wrapper:before {
    color: #c8cccf;
    display: block;
    height: 2.75em;
    line-height: 2.75em;
    pointer-events: none;
    position: absolute;
    right: 0;
    text-align: center;
    top: 0;
    width: 2.75em; }
  .select-wrapper select::-ms-expand {
    display: none; }

input[type="text"],
input[type="password"],
input[type="email"],
select {
  height: 2.75em; }

textarea {
  padding: 0.75em 1em; }

input[type="checkbox"],
input[type="radio"] {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  display: block;
  float: left;
  margin-right: -2em;
  opacity: 0;
  width: 1em;
  z-index: -1; }
  input[type="checkbox"] + label,
  input[type="radio"] + label {
    text-decoration: none;
    color: #414f57;
    cursor: pointer;
    display: inline-block;
    font-size: 1em;
    font-weight: 300;
    padding-left: 2.4em;
    padding-right: 0.75em;
    position: relative; }
    input[type="checkbox"] + label:before,
    input[type="radio"] + label:before {
      -moz-osx-font-smoothing: grayscale;
      -webkit-font-smoothing: antialiased;
      font-family: FontAwesome;
      font-style: normal;
      font-weight: normal;
      text-transform: none !important; }
    input[type="checkbox"] + label:before,
    input[type="radio"] + label:before {
      border-radius: 4px;
      border: solid 1px #c8cccf;
      content: '';
      display: inline-block;
      height: 1.65em;
      left: 0;
      line-height: 1.58125em;
      position: absolute;
      text-align: center;
      top: 0.15em;
      width: 1.65em; }
  input[type="checkbox"]:checked + label:before,
  input[type="radio"]:checked + label:before {
    color: #ff7496;
    content: '\f00c'; }
  input[type="checkbox"]:focus + label:before,
  input[type="radio"]:focus + label:before {
    border-color: #ff7496; }

input[type="checkbox"] + label:before {
  border-radius: 4px; }

input[type="radio"] + label:before {
  border-radius: 100%; }

::-webkit-input-placeholder {
  color: #616f77 !important;
  opacity: 1.0; }

:-moz-placeholder {
  color: #616f77 !important;
  opacity: 1.0; }

::-moz-placeholder {
  color: #616f77 !important;
  opacity: 1.0; }

:-ms-input-placeholder {
  color: #616f77 !important;
  opacity: 1.0; }

.formerize-placeholder {
  color: #616f77 !important;
  opacity: 1.0; }

#lat-long-holder > input {
  margin: 10px 0 10px 0;
  display: inline; }

/* Icon */
.icon {
  text-decoration: none;
  position: relative;
  border-bottom: none; }
  .icon:before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-transform: none !important; }
  .icon > .label {
    display: none; }

/* List */
ol {
  list-style: decimal;
  margin: 0 0 1em 0;
  padding-left: 1.25em; }
  ol li {
    padding-left: 0.25em; }

ul {
  list-style: disc;
  margin: 0 0 1em 0;
  padding-left: 1em; }
  ul li {
    padding-left: 0.5em; }
  ul.alt {
    list-style: none;
    padding-left: 0; }
    ul.alt li {
      border-top: solid 1px #c8cccf;
      padding: 0.5em 0; }
      ul.alt li:first-child {
        border-top: 0;
        padding-top: 0; }
  ul.icons {
    cursor: default;
    list-style: none;
    padding-left: 0;
    margin-top: -0.675em; }
    ul.icons li {
      display: inline-block;
      padding: 0.675em 0.5em; }
      ul.icons li a {
        text-decoration: none;
        position: relative;
        display: block;
        width: 3.75em;
        height: 3.75em;
        border-radius: 100%;
        border: solid 1px #c8cccf;
        line-height: 3.75em;
        overflow: hidden;
        text-align: center;
        text-indent: 3.75em;
        white-space: nowrap; }
        ul.icons li a:before {
          -moz-osx-font-smoothing: grayscale;
          -webkit-font-smoothing: antialiased;
          font-family: FontAwesome;
          font-style: normal;
          font-weight: normal;
          text-transform: none !important; }
        ul.icons li a:before {
          color: #ffffff;
          text-shadow: 1.25px 0px 0px #c8cccf, -1.25px 0px 0px #c8cccf, 0px 1.25px 0px #c8cccf, 0px -1.25px 0px #c8cccf; }
        ul.icons li a:hover:before {
          text-shadow: 1.25px 0px 0px #ff7496, -1.25px 0px 0px #ff7496, 0px 1.25px 0px #ff7496, 0px -1.25px 0px #ff7496; }
        ul.icons li a:before {
          position: absolute;
          top: 0;
          left: 0;
          width: inherit;
          height: inherit;
          font-size: 1.85rem;
          line-height: inherit;
          text-align: center;
          text-indent: 0; }
        ul.icons li a:hover {
          border-color: #ff7496; }
    @media screen and (max-width: 480px) {
      ul.icons li a:before {
        font-size: 1.5rem; } }
  ul.actions {
    cursor: default;
    list-style: none;
    padding-left: 0; }
    ul.actions li {
      display: inline-block;
      padding: 0 0.5em 0 0;
      vertical-align: middle; }
      ul.actions li:last-child {
        padding-right: 0; }

dl {
  margin: 0 0 1em 0; }
  dl dt {
    display: block;
    margin: 0 0 0.5em 0; }
  dl dd {
    margin-left: 1em; }

/* Button */
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  -moz-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
  -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
  -ms-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
  display: inline-block;
  height: 2.75em;
  line-height: 2.75em;
  padding: 0 1.5em;
  background-color: transparent;
  border-radius: 4px;
  border: solid 1px #c8cccf;
  color: #414f57 !important;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  white-space: nowrap; }
  input[type="submit"]:hover,
  input[type="reset"]:hover,
  input[type="button"]:hover,
  button:hover,
  .button:hover {
    border-color: #ff7496;
    color: #ff7496 !important; }
  input[type="submit"].icon,
  input[type="reset"].icon,
  input[type="button"].icon,
  button.icon,
  .button.icon {
    padding-left: 1.35em; }
    input[type="submit"].icon:before,
    input[type="reset"].icon:before,
    input[type="button"].icon:before,
    button.icon:before,
    .button.icon:before {
      margin-right: 0.5em; }
  input[type="submit"].fit,
  input[type="reset"].fit,
  input[type="button"].fit,
  button.fit,
  .button.fit {
    display: block;
    width: 100%;
    margin: 0 0 0.5em 0; }
  input[type="submit"].small,
  input[type="reset"].small,
  input[type="button"].small,
  button.small,
  .button.small {
    font-size: 0.8em; }
  input[type="submit"].big,
  input[type="reset"].big,
  input[type="button"].big,
  button.big,
  .button.big {
    font-size: 1.35em; }
  input[type="submit"].disabled, input[type="submit"]:disabled,
  input[type="reset"].disabled,
  input[type="reset"]:disabled,
  input[type="button"].disabled,
  input[type="button"]:disabled,
  button.disabled,
  button:disabled,
  .button.disabled,
  .button:disabled {
    -moz-pointer-events: none;
    -webkit-pointer-events: none;
    -ms-pointer-events: none;
    pointer-events: none;
    opacity: 0.5; }

#mapid {
  height: 350px; }

/* Main */
#main {
  position: relative;
  max-width: 100%;
  min-width: 55%;
  padding: 2.5em 0 2.5em;
  background: #ffffff;
  border-radius: 4px;
  cursor: default;
  opacity: 0.95;
  text-align: center;
  -moz-transform-origin: 50% 50%;
  -webkit-transform-origin: 50% 50%;
  -ms-transform-origin: 50% 50%;
  transform-origin: 50% 50%;
  -moz-transform: rotateX(0deg);
  -webkit-transform: rotateX(0deg);
  -ms-transform: rotateX(0deg);
  transform: rotateX(0deg);
  -moz-transition: opacity 1s ease, -moz-transform 1s ease;
  -webkit-transition: opacity 1s ease, -webkit-transform 1s ease;
  -ms-transition: opacity 1s ease, -ms-transform 1s ease;
  transition: opacity 1s ease, transform 1s ease;
  /*@include vendor('transition', 'all 1s ease !important');*/ }
  #main .avatar {
    position: relative;
    display: block;
    margin-bottom: 1em; }
    #main .avatar img {
      display: block;
      margin: 0 auto;
      box-shadow: 0 0 0 1.5em #ffffff;
      background-color: #ffffff; }
    #main .avatar:before {
      content: '';
      display: block;
      position: absolute;
      top: 50%;
      width: calc(100%);
      height: 1px;
      z-index: -1;
      background: #c8cccf; }
  @media screen and (max-width: 480px) {
    #main {
      min-width: 0;
      width: 100%;
      padding: 4em 2em 3em 2em ; }
      #main .avatar:before {
        left: -2em;
        width: calc(100% + 4em); } }
  body.is-loading #main {
    opacity: 0;
    -moz-transform: rotateX(15deg);
    -webkit-transform: rotateX(15deg);
    -ms-transform: rotateX(15deg);
    transform: rotateX(15deg); }

/* Main */
#wrapper.analysis {
  text-align: left;
  -moz-justify-content: -moz-flex-start;
  -webkit-justify-content: -webkit-flex-start;
  -ms-justify-content: -ms-flex-start;
  justify-content: flex-start; }

/*#main .analysis {
    position: relative;
    max-width: 100%;
    min-width: 90% !important;
    padding: 2.5em 0 2.5em;
    background: _palette(bg);
    border-radius: _size(border-radius);
    cursor: default;
    opacity: 0.95;
    text-align: center;
}*/
/* Footer */
#footer {
  -moz-align-self: -moz-flex-end;
  -webkit-align-self: -webkit-flex-end;
  -ms-align-self: -ms-flex-end;
  align-self: flex-end;
  width: 100%;
  padding: 1em 0 0 0;
  color: rgba(255, 255, 255, 0.75);
  cursor: default;
  text-align: center; }
  #footer .copyright {
    margin: 0;
    padding: 0;
    font-size: 0.9em;
    list-style: none; }
    #footer .copyright li {
      display: inline-block;
      margin: 0 0 0 0.85em;
      padding: 0 0 0 0.85em;
      border-left: solid 1px rgba(255, 255, 255, 0.5);
      line-height: 1; }
      #footer .copyright li:first-child {
        border-left: 0; }

/* Wrapper */
#wrapper {
  display: -moz-flex;
  display: -webkit-flex;
  display: -ms-flex;
  display: flex;
  -moz-align-items: center;
  -webkit-align-items: center;
  -ms-align-items: center;
  align-items: center;
  -moz-justify-content: space-between;
  -webkit-justify-content: space-between;
  -ms-justify-content: space-between;
  justify-content: space-between;
  -moz-flex-direction: column;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -moz-perspective: 1000px;
  -webkit-perspective: 1000px;
  -ms-perspective: 1000px;
  perspective: 1000px;
  position: relative;
  min-height: 100%;
  padding: 1em;
  z-index: 2; }
  #wrapper > * {
    z-index: 1;
    -moz-transition: all 1s ease !important;
    -webkit-transition: all 1s ease !important;
    -ms-transition: all 1s ease !important;
    transition: all 1s ease !important; }
  #wrapper:before {
    content: '';
    display: block; }
  @media screen and (max-width: 360px) {
    #wrapper {
      padding: 0.5em; } }
  body.is-ie #wrapper {
    height: 100%; }


text:
<?php

namespace AppBundle\Controller;

use Doctrine\ORM\Mapping as ORM;
use AppBundle\Entity\Membres;
use AppBundle\Form\MembresType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;

class MembresController extends Controller
{
    /**
     * @Route("/membres/list")
     */
    public function listAction()
    {
        return $this->render('AppBundle:Membres:list.html.twig', array(
            // ...
        ));
    }

    /**
     * @Route("/membres/add")
     */
    public function addAction(Request $request)
    {
        $form = $this->createForm(MembresType::class);

        $form->handleRequest($request);

        if ($form->isValid()){
            /** @var Membres $membre */
            $membre = $form->getData();
            $em = $this->getDoctrine()->getEntityManager();

            $em->persist($membre); # créer la requête
            $em->flush(); #execute la requête

            $this->addFlash('success',
                "Votre inscription  {$membre->getNom()} a bien été prise en compte");

            return $this->redirectToRoute('homepage');
        }

        return $this->render('AppBundle:Membres:add.html.twig', array(
            'membreForm' => $form->createView()
        ));
    }

    /**
     * @Route("/membres/{id}")
     */
    public function showAction($id)
    {
        $repo = $this->getDoctrine()->getRepository('AppBundle:Membres');

        $membre = $repo->find($id);

        return $this->render('AppBundle:Membres:show.html.twig', array(
            'membre' => $membre
        ));

    }

}


text:
(function() {
    'use strict';

    var isIonic = !!window.ionic;

    function trailappMap() {
        return {
            restrict: 'E',
            templateUrl: 'shared/map/map.html',
            scope: {
                height: '@',
                map: '=?',
                mapMarkers: '=',
                mapCenter: '=',
                onMoveEnd: '&',
                onMarkerClick: '&',
                onCurrentLocation: '&'
            },
            controller: 'TrailappMapController',
            controllerAs: 'TrailappMapCtrl'
        };
    }

    function trailappDirectionsButton() {
        return {
            restrict: 'E',
            templateUrl: 'shared/map/directions.html',
            scope: {
                destination: '='
            },
            link: function(scope, el, attr) {
                scope.launchnavigator = launchnavigator;
            }
        };
    }

    function TrailappMapController($scope, leafletData, TrailappMapService, TrailappUtilsService) {
        var self = this;

        $scope.mapId = TrailappMapService.generateId();
        $scope.mapControls = TrailappMapService.getDefaultControls();
        $scope.mapDefaults = {
            tileLayer: TrailappUtilsService.getMapTilesUrl()
        };

        if (isIonic) {
            $scope.mapDefaults.zoomControl = false;
            self.locateControl = $scope.mapControls.custom.locate;
            self.locateControl.options.setView = false;
        }

        var firstMove = true;
        $scope.$on('leafletDirectiveMap.moveend', function(event) {
            if (firstMove)
                firstMove = false;
            else
                $scope.onMoveEnd({
                    event: event
                });
        });
        $scope.$on('leafletDirectiveMarker.click', function(e, args) {
            $scope.onMarkerClick({
                markerName: args.markerName
            });
        });

        $scope.onQueryChange = function() {
            var bounds;
            if ($scope.geoQuery) { // only if there is a query
                if (Object.keys($scope.mapMarkers).length) {
                    bounds = TrailappMapService.getBoundsFromMarkers($scope.mapMarkers);
                } else {
                    bounds = $scope.mapBounds;
                }

                $scope.queryStatus = 'loading';
                var promise = TrailappMapService.geocode($scope.geoQuery, bounds, _.omit($scope.mapCenter, 'zoom'));

                promise.then(function(data) {
                    $scope.queryStatus = 'success';
                    var loc = data[0], // Pick the most relevant result
                        zoom = $scope.map.getBoundsZoom([
                            [loc.leafletBounds.southWest.lat, loc.leafletBounds.southWest.lng],
                            [loc.leafletBounds.northEast.lat, loc.leafletBounds.northEast.lng]
                        ]);

                    $scope.mapCenter = {
                        lat: loc.lat,
                        lng: loc.lon,
                        zoom: zoom
                    };
                }, function(error) {
                    $scope.queryStatus = 'no_results';
                    console.log('error', error);
                });
            }
        };

        leafletData.getMap('trailapp-map-' + $scope.mapId).then(function(map) {
            $scope.map = map;
            TrailappMapService.setDefaultProvider(map);

            map.attributionControl.addAttribution('Geocoding Courtesy of MapQuest ');
            if (isIonic) {
                map.on('locationfound', function(e) {
                    $scope.onCurrentLocation({
                        err: null,
                        position: {
                            coords: e,
                            timestamp: e.timestamp
                        }
                    });

                    // fit map to bounds (markers + current location)
                    var latLngs = Object.keys($scope.mapMarkers).map(function(key) {
                        return [$scope.mapMarkers[key].lat, $scope.mapMarkers[key].lng];
                    });

                    var bounds = L.latLngBounds(latLngs).extend(e.bounds);
                    map.fitBounds(bounds, {
                        padding: self.locateControl.options.circlePadding,
                        maxZoom: self.locateControl.options.keepCurrentZoomLevel ?
                            map.getZoom() : self.locateControl.options.locateOptions.maxZoom
                    });
                });
                // locate the user as soon as possible
                self.locateControl.start();
            }
        });
    }

    TrailappMapController.$inject = ['$scope', 'leafletData', 'TrailappMapService', 'TrailappUtilsService'];

    function TrailappMapService($q, $resource, TrailappUtilsService, trailappConfig) {
        var service = {};
        var self = this;

        self.serviceUrl = TrailappUtilsService.getProtocol() + '://open.mapquestapi.com/nominatim/v1/search.php';

        service.geocode = function(query, bounds, center) {
            var deferred = $q.defer(),
                defaultParams = {
                    format: 'json',
                    limit: 20,
                    countrycodes: ['gb'].join(','),
                    // bounded: 1, this restricts results to the viewbox
                },
                Geocode = $resource(self.serviceUrl, defaultParams);

            var viewbox = bounds ?
                [bounds.southWest.lng, bounds.southWest.lat, bounds.northEast.lng, bounds.northEast.lat].join(',') : undefined;
            Geocode.query({
                q: query,
                viewboxlbrt: viewbox
            }, function(data) {
                if (data.length === 0)
                    deferred.reject('No results');
                else {
                    data.forEach(function(loc) { // parse strings into floats
                        loc.lat = parseFloat(loc.lat);
                        loc.lon = parseFloat(loc.lon);
                        loc.boundingbox = _.map(loc.boundingbox, _.ary(parseFloat, 1));
                        loc.leafletBounds = { // boundingbox is [south Latitude, north Latitude, west Longitude, east Longitude]
                            southWest: {
                                lat: loc.boundingbox[0],
                                lng: loc.boundingbox[2]
                            },
                            northEast: {
                                lat: loc.boundingbox[1],
                                lng: loc.boundingbox[3]
                            }
                        };
                    });

                    if (bounds) {
                        var sorted = _.sortBy(data, function(loc) { // sort by distance from centre of given bounds
                            return TrailappUtilsService.getDistance(loc.lat, loc.lon, (bounds.southWest.lat + bounds.northEast.lat) / 2, (bounds.southWest.lng + bounds.northEast.lng) / 2);
                        });
                        deferred.resolve(sorted);
                    } else {
                        deferred.resolve(data);
                    }
                }
            }, function(error) {
                deferred.reject(error);
            });

            return deferred.promise;
        };

        service.getBoundsFromMarkers = function(markers, tighter) {
            var minLat = 9999,
                minLon = 9999,
                maxLat = -9999,
                maxLon = -9999;
            for (var i in markers) {
                var m = markers[i];
                if (m.lat > maxLat) maxLat = m.lat;
                if (m.lng > maxLon) maxLon = m.lng;
                if (m.lat < minLat) minLat = m.lat;
                if (m.lng < minLon) minLon = m.lng;
            }
            var factor = tighter ? 6 : 5;
            var extendLatBy = (maxLat - minLat) / factor;
            minLat = (((90 + minLat) - extendLatBy) % 180) - 90;
            maxLat = (((90 + maxLat) + extendLatBy) % 180) - 90;
            var extendLonBy = (maxLon - minLon) / factor;
            minLon = (((180 + minLon) - extendLonBy) % 360) - 180;
            maxLon = (((180 + maxLon) + extendLonBy) % 360) - 180;
            return {
                southWest: {
                    lat: minLat,
                    lng: minLon
                },
                northEast: {
                    lat: maxLat,
                    lng: maxLon
                }
            };
        };

        service.setDefaultProvider = function(map) {
            map.eachLayer(function(layer) {
                if (layer._url) {
                    map.removeLayer(layer);
                    L.tileLayer.provider('HERE.normalDay' + (isIonic ? 'Mobile' : ''), {
                        app_id: trailappConfig.HEREAppId,
                        app_code: trailappConfig.HEREAppCode
                    }).addTo(map);
                }
            });
        };

        service.getLocateControl = function() {
            return L.control.locate({
                position: 'bottomright',
                follow: false,
                keepCurrentZoomLevel: true,
                strings: {
                    popup: 'You are within {distance} metres from this point'
                },
                locateOptions: {
                    watch: false
                }
            });
        };

        service.getDefaultControls = function() {
            var controls = {};
            controls.custom = {};

            if (!isIonic)
                controls.draw = {};
            else {
                controls.custom.locate = service.getLocateControl();
            }

            return controls;
        };

        service.generateId = (function() {
            var counter = 0;
            return function() {
                return ++counter;
            };
        })();

        return service;
    }

    TrailappMapService.$inject = ['$q', '$resource', 'TrailappUtilsService', 'trailappConfig'];

    function TrailappMapConfig() {
        if (isIonic) {
            L.AwesomeMarkers.Icon.prototype.options.prefix = 'ion';
            L.AwesomeMarkers.Icon.prototype.options.extraClasses += ' icon';
        }
    }

    angular
        .module('trailapp.map', [])
        .directive('trailappDirectionsButton', trailappDirectionsButton)
        .directive('trailappMap', trailappMap)
        .controller('TrailappMapController', TrailappMapController)
        .factory('TrailappMapService', TrailappMapService)
        .config(TrailappMapConfig);
})();


text:
(function(){
var registrationData = function ($http, authentication) {
    var currentUser = authentication.currentUser();

    var addNewPersonData = function (data) {
        return $http.post('api/registration', data,
            {
                headers: {Authorization: 'Bearer ' + authentication.getToken()}
            }
        );
    };

    return {
        addNewPersonData: addNewPersonData
    };
};

angular.module('managementApp')
    .service('registrationData', registrationData);
})();


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/empty_service.proto

namespace GPBMetadata\Src\Proto\Grpc\Testing;

class EmptyService
{
    public static $is_initialized = false;

    public static function initOnce() {
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();

        if (static::$is_initialized == true) {
          return;
        }
        $pool->internalAddGeneratedFile(hex2bin(
            "0a520a2a7372632f70726f746f2f677270632f74657374696e672f656d7074795f736572766963652e70726f746f120c677270632e74657374696e67320e0a0c456d70747953657276696365620670726f746f33"
        ), true);

        static::$is_initialized = true;
    }
}


text:
    {{user.name}}

{{user.name}}


text:
echo "-Setting ROS workspace"
#http://stackoverflow.com/questions/16011245/source-files-in-a-bash-script
. ${DRONE_WORKSPACE}/setup.bash

NETWORK_ROSCORE=$1
# http://stackoverflow.com/questions/6482377/bash-shell-script-check-input-argument
if [ -z $NETWORK_ROSCORE ] # Check if NETWORK_ROSCORE is NULL
  then
    echo "-Setting roscore in localhost"
    export ROS_MASTER_URI=http://localhost:11311
  else
    echo "-Setting roscore in $NETWORK_ROSCORE"
    export ROS_MASTER_URI=http://$NETWORK_ROSCORE:11311
fi