text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>I</word>
            <lemma>I</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>1</CharacterOffsetEnd>
            <POS>PRP</POS>
          </token>
          <token id="2">
            <word>'m</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>1</CharacterOffsetBegin>
            <CharacterOffsetEnd>3</CharacterOffsetEnd>
            <POS>VBP</POS>
          </token>
          <token id="3">
            <word>helping</word>
            <lemma>help</lemma>
            <CharacterOffsetBegin>4</CharacterOffsetBegin>
            <CharacterOffsetEnd>11</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="4">
            <word>a</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>12</CharacterOffsetBegin>
            <CharacterOffsetEnd>13</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="5">
            <word>friend</word>
            <lemma>friend</lemma>
            <CharacterOffsetBegin>14</CharacterOffsetBegin>
            <CharacterOffsetEnd>20</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="6">
            <word>start</word>
            <lemma>start</lemma>
            <CharacterOffsetBegin>21</CharacterOffsetBegin>
            <CharacterOffsetEnd>26</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="7">
            <word>an</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>27</CharacterOffsetBegin>
            <CharacterOffsetEnd>29</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="8">
            <word>internet</word>
            <lemma>internet</lemma>
            <CharacterOffsetBegin>30</CharacterOffsetBegin>
            <CharacterOffsetEnd>38</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="9">
            <word>cafe</word>
            <lemma>cafe</lemma>
            <CharacterOffsetBegin>39</CharacterOffsetBegin>
            <CharacterOffsetEnd>43</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="10">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>43</CharacterOffsetBegin>
            <CharacterOffsetEnd>44</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (PRP I)) (VP (VBP 'm) (VP (VBG helping) (S (NP (DT a) (NN friend)) (VP (VB start) (NP (DT an) (NN internet) (NN cafe)))))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">helping</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">helping</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">helping</governor>
            <dependent idx="2">'m</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">friend</governor>
            <dependent idx="4">a</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="6">start</governor>
            <dependent idx="5">friend</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="3">helping</governor>
            <dependent idx="6">start</dependent>
          </dep>
          <dep type="det">
            <governor idx="9">cafe</governor>
            <dependent idx="7">an</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">cafe</governor>
            <dependent idx="8">internet</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">start</governor>
            <dependent idx="9">cafe</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">helping</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">helping</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">helping</governor>
            <dependent idx="2">'m</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">friend</governor>
            <dependent idx="4">a</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="6">start</governor>
            <dependent idx="5">friend</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="3">helping</governor>
            <dependent idx="6">start</dependent>
          </dep>
          <dep type="det">
            <governor idx="9">cafe</governor>
            <dependent idx="7">an</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">cafe</governor>
            <dependent idx="8">internet</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">start</governor>
            <dependent idx="9">cafe</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">helping</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">helping</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">helping</governor>
            <dependent idx="2">'m</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">friend</governor>
            <dependent idx="4">a</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="6">start</governor>
            <dependent idx="5">friend</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="3">helping</governor>
            <dependent idx="6">start</dependent>
          </dep>
          <dep type="det">
            <governor idx="9">cafe</governor>
            <dependent idx="7">an</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">cafe</governor>
            <dependent idx="8">internet</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">start</governor>
            <dependent idx="9">cafe</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="2">
        <tokens>
          <token id="1">
            <word>I</word>
            <lemma>I</lemma>
            <CharacterOffsetBegin>45</CharacterOffsetBegin>
            <CharacterOffsetEnd>46</CharacterOffsetEnd>
            <POS>PRP</POS>
          </token>
          <token id="2">
            <word>was</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>47</CharacterOffsetBegin>
            <CharacterOffsetEnd>50</CharacterOffsetEnd>
            <POS>VBD</POS>
          </token>
          <token id="3">
            <word>wondering</word>
            <lemma>wonder</lemma>
            <CharacterOffsetBegin>51</CharacterOffsetBegin>
            <CharacterOffsetEnd>60</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="4">
            <word>if</word>
            <lemma>if</lemma>
            <CharacterOffsetBegin>61</CharacterOffsetBegin>
            <CharacterOffsetEnd>63</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="5">
            <word>live</word>
            <lemma>live</lemma>
            <CharacterOffsetBegin>64</CharacterOffsetBegin>
            <CharacterOffsetEnd>68</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="6">
            <word>cd</word>
            <lemma>cd</lemma>
            <CharacterOffsetBegin>69</CharacterOffsetBegin>
            <CharacterOffsetEnd>71</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="7">
            <word>'s</word>
            <lemma>'s</lemma>
            <CharacterOffsetBegin>71</CharacterOffsetBegin>
            <CharacterOffsetEnd>73</CharacterOffsetEnd>
            <POS>POS</POS>
          </token>
          <token id="8">
            <word>would</word>
            <lemma>would</lemma>
            <CharacterOffsetBegin>74</CharacterOffsetBegin>
            <CharacterOffsetEnd>79</CharacterOffsetEnd>
            <POS>MD</POS>
          </token>
          <token id="9">
            <word>be</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>80</CharacterOffsetBegin>
            <CharacterOffsetEnd>82</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="10">
            <word>the</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>83</CharacterOffsetBegin>
            <CharacterOffsetEnd>86</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="11">
            <word>best</word>
            <lemma>best</lemma>
            <CharacterOffsetBegin>87</CharacterOffsetBegin>
            <CharacterOffsetEnd>91</CharacterOffsetEnd>
            <POS>JJS</POS>
          </token>
          <token id="12">
            <word>way</word>
            <lemma>way</lemma>
            <CharacterOffsetBegin>92</CharacterOffsetBegin>
            <CharacterOffsetEnd>95</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="13">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>96</CharacterOffsetBegin>
            <CharacterOffsetEnd>98</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="14">
            <word>go</word>
            <lemma>go</lemma>
            <CharacterOffsetBegin>99</CharacterOffsetBegin>
            <CharacterOffsetEnd>101</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="15">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>101</CharacterOffsetBegin>
            <CharacterOffsetEnd>102</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (PRP I)) (VP (VBD was) (VP (VBG wondering) (PP (IN if) (NP (NP (JJ live) (NN cd) (POS 's)) (SBAR (S (VP (MD would) (VP (VB be) (NP (NP (DT the) (JJS best) (NN way)) (SBAR (S (VP (TO to) (VP (VB go)))))))))))))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">wondering</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">wondering</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">wondering</governor>
            <dependent idx="2">was</dependent>
          </dep>
          <dep type="prep">
            <governor idx="3">wondering</governor>
            <dependent idx="4">if</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">cd</governor>
            <dependent idx="5">live</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="4">if</governor>
            <dependent idx="6">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="6">cd</governor>
            <dependent idx="7">'s</dependent>
          </dep>
          <dep type="aux">
            <governor idx="12">way</governor>
            <dependent idx="8">would</dependent>
          </dep>
          <dep type="cop">
            <governor idx="12">way</governor>
            <dependent idx="9">be</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">way</governor>
            <dependent idx="10">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">way</governor>
            <dependent idx="11">best</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="6">cd</governor>
            <dependent idx="12">way</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">go</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="12">way</governor>
            <dependent idx="14">go</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">wondering</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">wondering</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">wondering</governor>
            <dependent idx="2">was</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">cd</governor>
            <dependent idx="5">live</dependent>
          </dep>
          <dep type="prep_if">
            <governor idx="3">wondering</governor>
            <dependent idx="6">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="6">cd</governor>
            <dependent idx="7">'s</dependent>
          </dep>
          <dep type="aux">
            <governor idx="12">way</governor>
            <dependent idx="8">would</dependent>
          </dep>
          <dep type="cop">
            <governor idx="12">way</governor>
            <dependent idx="9">be</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">way</governor>
            <dependent idx="10">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">way</governor>
            <dependent idx="11">best</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="6">cd</governor>
            <dependent idx="12">way</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">go</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="12">way</governor>
            <dependent idx="14">go</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="3">wondering</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="3">wondering</governor>
            <dependent idx="1">I</dependent>
          </dep>
          <dep type="aux">
            <governor idx="3">wondering</governor>
            <dependent idx="2">was</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">cd</governor>
            <dependent idx="5">live</dependent>
          </dep>
          <dep type="prep_if">
            <governor idx="3">wondering</governor>
            <dependent idx="6">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="6">cd</governor>
            <dependent idx="7">'s</dependent>
          </dep>
          <dep type="aux">
            <governor idx="12">way</governor>
            <dependent idx="8">would</dependent>
          </dep>
          <dep type="cop">
            <governor idx="12">way</governor>
            <dependent idx="9">be</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">way</governor>
            <dependent idx="10">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">way</governor>
            <dependent idx="11">best</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="6">cd</governor>
            <dependent idx="12">way</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">go</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="12">way</governor>
            <dependent idx="14">go</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="3">
        <tokens>
          <token id="1">
            <word>If</word>
            <lemma>if</lemma>
            <CharacterOffsetBegin>103</CharacterOffsetBegin>
            <CharacterOffsetEnd>105</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="2">
            <word>computers</word>
            <lemma>computer</lemma>
            <CharacterOffsetBegin>106</CharacterOffsetBegin>
            <CharacterOffsetEnd>115</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="3">
            <word>are</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>116</CharacterOffsetBegin>
            <CharacterOffsetEnd>119</CharacterOffsetEnd>
            <POS>VBP</POS>
          </token>
          <token id="4">
            <word>setup</word>
            <lemma>setup</lemma>
            <CharacterOffsetBegin>120</CharacterOffsetBegin>
            <CharacterOffsetEnd>125</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="5">
            <word>with</word>
            <lemma>with</lemma>
            <CharacterOffsetBegin>126</CharacterOffsetBegin>
            <CharacterOffsetEnd>130</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="6">
            <word>live</word>
            <lemma>live</lemma>
            <CharacterOffsetBegin>131</CharacterOffsetBegin>
            <CharacterOffsetEnd>135</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="7">
            <word>cd</word>
            <lemma>cd</lemma>
            <CharacterOffsetBegin>136</CharacterOffsetBegin>
            <CharacterOffsetEnd>138</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="8">
            <word>'s</word>
            <lemma>'s</lemma>
            <CharacterOffsetBegin>138</CharacterOffsetBegin>
            <CharacterOffsetEnd>140</CharacterOffsetEnd>
            <POS>POS</POS>
          </token>
          <token id="9">
            <word>would</word>
            <lemma>would</lemma>
            <CharacterOffsetBegin>141</CharacterOffsetBegin>
            <CharacterOffsetEnd>146</CharacterOffsetEnd>
            <POS>MD</POS>
          </token>
          <token id="10">
            <word>n't</word>
            <lemma>not</lemma>
            <CharacterOffsetBegin>146</CharacterOffsetBegin>
            <CharacterOffsetEnd>149</CharacterOffsetEnd>
            <POS>RB</POS>
          </token>
          <token id="11">
            <word>they</word>
            <lemma>they</lemma>
            <CharacterOffsetBegin>150</CharacterOffsetBegin>
            <CharacterOffsetEnd>154</CharacterOffsetEnd>
            <POS>PRP</POS>
          </token>
          <token id="12">
            <word>still</word>
            <lemma>still</lemma>
            <CharacterOffsetBegin>155</CharacterOffsetBegin>
            <CharacterOffsetEnd>160</CharacterOffsetEnd>
            <POS>RB</POS>
          </token>
          <token id="13">
            <word>need</word>
            <lemma>need</lemma>
            <CharacterOffsetBegin>161</CharacterOffsetBegin>
            <CharacterOffsetEnd>165</CharacterOffsetEnd>
            <POS>VBP</POS>
          </token>
          <token id="14">
            <word>a</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>166</CharacterOffsetBegin>
            <CharacterOffsetEnd>167</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="15">
            <word>hard</word>
            <lemma>hard</lemma>
            <CharacterOffsetBegin>168</CharacterOffsetBegin>
            <CharacterOffsetEnd>172</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="16">
            <word>drive</word>
            <lemma>drive</lemma>
            <CharacterOffsetBegin>173</CharacterOffsetBegin>
            <CharacterOffsetEnd>178</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="17">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>178</CharacterOffsetBegin>
            <CharacterOffsetEnd>179</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (SBAR (IN If) (S (NP (NNS computers)) (VP (VBP are) (NP (NP (NN setup)) (PP (IN with) (NP (NP (JJ live) (NN cd) (POS 's)) (SBAR (S (VP (MD would) (RB n't)))))))))) (NP (PRP they)) (ADVP (RB still)) (VP (VBP need) (NP (DT a) (JJ hard) (NN drive))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="13">need</dependent>
          </dep>
          <dep type="mark">
            <governor idx="4">setup</governor>
            <dependent idx="1">If</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">setup</governor>
            <dependent idx="2">computers</dependent>
          </dep>
          <dep type="cop">
            <governor idx="4">setup</governor>
            <dependent idx="3">are</dependent>
          </dep>
          <dep type="advcl">
            <governor idx="13">need</governor>
            <dependent idx="4">setup</dependent>
          </dep>
          <dep type="prep">
            <governor idx="4">setup</governor>
            <dependent idx="5">with</dependent>
          </dep>
          <dep type="amod">
            <governor idx="7">cd</governor>
            <dependent idx="6">live</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="5">with</governor>
            <dependent idx="7">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="7">cd</governor>
            <dependent idx="8">'s</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="7">cd</governor>
            <dependent idx="9">would</dependent>
          </dep>
          <dep type="neg">
            <governor idx="9">would</governor>
            <dependent idx="10">n't</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="13">need</governor>
            <dependent idx="11">they</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="13">need</governor>
            <dependent idx="12">still</dependent>
          </dep>
          <dep type="det">
            <governor idx="16">drive</governor>
            <dependent idx="14">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="16">drive</governor>
            <dependent idx="15">hard</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="13">need</governor>
            <dependent idx="16">drive</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="13">need</dependent>
          </dep>
          <dep type="mark">
            <governor idx="4">setup</governor>
            <dependent idx="1">If</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">setup</governor>
            <dependent idx="2">computers</dependent>
          </dep>
          <dep type="cop">
            <governor idx="4">setup</governor>
            <dependent idx="3">are</dependent>
          </dep>
          <dep type="advcl">
            <governor idx="13">need</governor>
            <dependent idx="4">setup</dependent>
          </dep>
          <dep type="amod">
            <governor idx="7">cd</governor>
            <dependent idx="6">live</dependent>
          </dep>
          <dep type="prep_with">
            <governor idx="4">setup</governor>
            <dependent idx="7">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="7">cd</governor>
            <dependent idx="8">'s</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="7">cd</governor>
            <dependent idx="9">would</dependent>
          </dep>
          <dep type="neg">
            <governor idx="9">would</governor>
            <dependent idx="10">n't</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="13">need</governor>
            <dependent idx="11">they</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="13">need</governor>
            <dependent idx="12">still</dependent>
          </dep>
          <dep type="det">
            <governor idx="16">drive</governor>
            <dependent idx="14">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="16">drive</governor>
            <dependent idx="15">hard</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="13">need</governor>
            <dependent idx="16">drive</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="13">need</dependent>
          </dep>
          <dep type="mark">
            <governor idx="4">setup</governor>
            <dependent idx="1">If</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">setup</governor>
            <dependent idx="2">computers</dependent>
          </dep>
          <dep type="cop">
            <governor idx="4">setup</governor>
            <dependent idx="3">are</dependent>
          </dep>
          <dep type="advcl">
            <governor idx="13">need</governor>
            <dependent idx="4">setup</dependent>
          </dep>
          <dep type="amod">
            <governor idx="7">cd</governor>
            <dependent idx="6">live</dependent>
          </dep>
          <dep type="prep_with">
            <governor idx="4">setup</governor>
            <dependent idx="7">cd</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="7">cd</governor>
            <dependent idx="8">'s</dependent>
          </dep>
          <dep type="rcmod">
            <governor idx="7">cd</governor>
            <dependent idx="9">would</dependent>
          </dep>
          <dep type="neg">
            <governor idx="9">would</governor>
            <dependent idx="10">n't</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="13">need</governor>
            <dependent idx="11">they</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="13">need</governor>
            <dependent idx="12">still</dependent>
          </dep>
          <dep type="det">
            <governor idx="16">drive</governor>
            <dependent idx="14">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="16">drive</governor>
            <dependent idx="15">hard</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="13">need</governor>
            <dependent idx="16">drive</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="4">
        <tokens>
          <token id="1">
            <word>The</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>180</CharacterOffsetBegin>
            <CharacterOffsetEnd>183</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="2">
            <word>web</word>
            <lemma>web</lemma>
            <CharacterOffsetBegin>184</CharacterOffsetBegin>
            <CharacterOffsetEnd>187</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="3">
            <word>pages</word>
            <lemma>page</lemma>
            <CharacterOffsetBegin>188</CharacterOffsetBegin>
            <CharacterOffsetEnd>193</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="4">
            <word>still</word>
            <lemma>still</lemma>
            <CharacterOffsetBegin>194</CharacterOffsetBegin>
            <CharacterOffsetEnd>199</CharacterOffsetEnd>
            <POS>RB</POS>
          </token>
          <token id="5">
            <word>need</word>
            <lemma>need</lemma>
            <CharacterOffsetBegin>200</CharacterOffsetBegin>
            <CharacterOffsetEnd>204</CharacterOffsetEnd>
            <POS>VBP</POS>
          </token>
          <token id="6">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>205</CharacterOffsetBegin>
            <CharacterOffsetEnd>207</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="7">
            <word>be</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>208</CharacterOffsetBegin>
            <CharacterOffsetEnd>210</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="8">
            <word>cached</word>
            <lemma>cache</lemma>
            <CharacterOffsetBegin>211</CharacterOffsetBegin>
            <CharacterOffsetEnd>217</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="9">
            <word>?</word>
            <lemma>?</lemma>
            <CharacterOffsetBegin>217</CharacterOffsetBegin>
            <CharacterOffsetEnd>218</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (DT The) (NN web) (NNS pages)) (ADVP (RB still)) (VP (VBP need) (S (VP (TO to) (VP (VB be) (VP (VBN cached)))))) (. ?))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">need</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">pages</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">pages</governor>
            <dependent idx="2">web</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="5">need</governor>
            <dependent idx="3">pages</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="5">need</governor>
            <dependent idx="4">still</dependent>
          </dep>
          <dep type="aux">
            <governor idx="8">cached</governor>
            <dependent idx="6">to</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="8">cached</governor>
            <dependent idx="7">be</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="5">need</governor>
            <dependent idx="8">cached</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">need</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">pages</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">pages</governor>
            <dependent idx="2">web</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="5">need</governor>
            <dependent idx="3">pages</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="5">need</governor>
            <dependent idx="4">still</dependent>
          </dep>
          <dep type="aux">
            <governor idx="8">cached</governor>
            <dependent idx="6">to</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="8">cached</governor>
            <dependent idx="7">be</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="5">need</governor>
            <dependent idx="8">cached</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">need</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">pages</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">pages</governor>
            <dependent idx="2">web</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="5">need</governor>
            <dependent idx="3">pages</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="5">need</governor>
            <dependent idx="4">still</dependent>
          </dep>
          <dep type="aux">
            <governor idx="8">cached</governor>
            <dependent idx="6">to</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="8">cached</governor>
            <dependent idx="7">be</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="5">need</governor>
            <dependent idx="8">cached</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="5">
        <tokens>
          <token id="1">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>218</CharacterOffsetBegin>
            <CharacterOffsetEnd>219</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (NP (. .))) </parse>
        <dependencies type="basic-dependencies"/>
        <dependencies type="collapsed-dependencies"/>
        <dependencies type="collapsed-ccprocessed-dependencies"/>
      </sentence>
      <sentence id="6">
        <tokens>
          <token id="1">
            <word>What</word>
            <lemma>what</lemma>
            <CharacterOffsetBegin>220</CharacterOffsetBegin>
            <CharacterOffsetEnd>224</CharacterOffsetEnd>
            <POS>WP</POS>
          </token>
          <token id="2">
            <word>are</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>225</CharacterOffsetBegin>
            <CharacterOffsetEnd>228</CharacterOffsetEnd>
            <POS>VBP</POS>
          </token>
          <token id="3">
            <word>some</word>
            <lemma>some</lemma>
            <CharacterOffsetBegin>229</CharacterOffsetBegin>
            <CharacterOffsetEnd>233</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="4">
            <word>best</word>
            <lemma>best</lemma>
            <CharacterOffsetBegin>234</CharacterOffsetBegin>
            <CharacterOffsetEnd>238</CharacterOffsetEnd>
            <POS>JJS</POS>
          </token>
          <token id="5">
            <word>practices</word>
            <lemma>practice</lemma>
            <CharacterOffsetBegin>239</CharacterOffsetBegin>
            <CharacterOffsetEnd>248</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="6">
            <word>for</word>
            <lemma>for</lemma>
            <CharacterOffsetBegin>249</CharacterOffsetBegin>
            <CharacterOffsetEnd>252</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="7">
            <word>setting</word>
            <lemma>set</lemma>
            <CharacterOffsetBegin>253</CharacterOffsetBegin>
            <CharacterOffsetEnd>260</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="8">
            <word>up</word>
            <lemma>up</lemma>
            <CharacterOffsetBegin>261</CharacterOffsetBegin>
            <CharacterOffsetEnd>263</CharacterOffsetEnd>
            <POS>RP</POS>
          </token>
          <token id="9">
            <word>internet</word>
            <lemma>internet</lemma>
            <CharacterOffsetBegin>264</CharacterOffsetBegin>
            <CharacterOffsetEnd>272</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="10">
            <word>cafe</word>
            <lemma>cafe</lemma>
            <CharacterOffsetBegin>273</CharacterOffsetBegin>
            <CharacterOffsetEnd>277</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="11">
            <word>computers</word>
            <lemma>computer</lemma>
            <CharacterOffsetBegin>278</CharacterOffsetBegin>
            <CharacterOffsetEnd>287</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="12">
            <word>?</word>
            <lemma>?</lemma>
            <CharacterOffsetBegin>287</CharacterOffsetBegin>
            <CharacterOffsetEnd>288</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (SBARQ (WHNP (WP What)) (VBP are) (NP (NP (DT some) (JJS best) (NNS practices)) (PP (IN for) (S (VP (VBG setting) (PRT (RP up)) (NP (NN internet) (NN cafe) (NNS computers)))))) (. ?))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">What</dependent>
          </dep>
          <dep type="cop">
            <governor idx="1">What</governor>
            <dependent idx="2">are</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">practices</governor>
            <dependent idx="3">some</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">practices</governor>
            <dependent idx="4">best</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="1">What</governor>
            <dependent idx="5">practices</dependent>
          </dep>
          <dep type="prep">
            <governor idx="5">practices</governor>
            <dependent idx="6">for</dependent>
          </dep>
          <dep type="pcomp">
            <governor idx="6">for</governor>
            <dependent idx="7">setting</dependent>
          </dep>
          <dep type="prt">
            <governor idx="7">setting</governor>
            <dependent idx="8">up</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="9">internet</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="10">cafe</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="7">setting</governor>
            <dependent idx="11">computers</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">What</dependent>
          </dep>
          <dep type="cop">
            <governor idx="1">What</governor>
            <dependent idx="2">are</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">practices</governor>
            <dependent idx="3">some</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">practices</governor>
            <dependent idx="4">best</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="1">What</governor>
            <dependent idx="5">practices</dependent>
          </dep>
          <dep type="prepc_for">
            <governor idx="5">practices</governor>
            <dependent idx="7">setting</dependent>
          </dep>
          <dep type="prt">
            <governor idx="7">setting</governor>
            <dependent idx="8">up</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="9">internet</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="10">cafe</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="7">setting</governor>
            <dependent idx="11">computers</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="1">What</dependent>
          </dep>
          <dep type="cop">
            <governor idx="1">What</governor>
            <dependent idx="2">are</dependent>
          </dep>
          <dep type="det">
            <governor idx="5">practices</governor>
            <dependent idx="3">some</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">practices</governor>
            <dependent idx="4">best</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="1">What</governor>
            <dependent idx="5">practices</dependent>
          </dep>
          <dep type="prepc_for">
            <governor idx="5">practices</governor>
            <dependent idx="7">setting</dependent>
          </dep>
          <dep type="prt">
            <governor idx="7">setting</governor>
            <dependent idx="8">up</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="9">internet</dependent>
          </dep>
          <dep type="nn">
            <governor idx="11">computers</governor>
            <dependent idx="10">cafe</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="7">setting</governor>
            <dependent idx="11">computers</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
package com.symbel.appejerciciopractico2;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}

redpajama_set_name: RedPajamaGithub


text:
#import "MDCFeatureHighlightViewController.h"

#import "MaterialTypography.h"
#import "MDFTextAccessibility.h"
#import "private/MDCFeatureHighlightAnimationController.h"
#import "private/MDCFeatureHighlightView+Private.h"

static const CGFloat kMDCFeatureHighlightPulseAnimationInterval = 1.5f;

@interface MDCFeatureHighlightViewController () <UIViewControllerTransitioningDelegate>

@end

@implementation MDCFeatureHighlightViewController {
  MDCFeatureHighlightAnimationController *_animationController;
  MDCFeatureHighlightCompletion _completion;
  MDCFeatureHighlightView *_featureHighlightView;
  NSTimer *_pulseTimer;
  UIView *_displayedView;
  UIView *_highlightedView;
}

- (nonnull instancetype)initWithHighlightedView:(nonnull UIView *)highlightedView
                                    andShowView:(nonnull UIView *)displayedView
                                     completion:(nullable MDCFeatureHighlightCompletion)completion {
  if (self = [super initWithNibName:nil bundle:nil]) {
    _highlightedView = highlightedView;
    _displayedView = displayedView;
    _completion = completion;
    _animationController = [[MDCFeatureHighlightAnimationController alloc] init];
    _animationController.presenting = YES;

    super.transitioningDelegate = self;
    super.modalPresentationStyle = UIModalPresentationCustom;

    [self commonMDCFeatureHighlightViewControllerInit];
  }
  return self;
}

/* Disable setter. Always use internal transition controller */
- (void)setTransitioningDelegate:(id<UIViewControllerTransitioningDelegate>)transitioningDelegate {
  NSAssert(NO, @"MDCAlertController.transitioningDelegate cannot be changed.");
  return;
}

/* Disable setter. Always use custom presentation style */
- (void)setModalPresentationStyle:(UIModalPresentationStyle)modalPresentationStyle {
  NSAssert(NO, @"MDCAlertController.modalPresentationStyle cannot be changed.");
  return;
}

- (nonnull instancetype)initWithHighlightedView:(nonnull UIView *)highlightedView
                                     completion:(nullable MDCFeatureHighlightCompletion)completion {
  UIView *snapshotView = [highlightedView snapshotViewAfterScreenUpdates:YES];
  // We have to wrap the snapshoted view because _UIReplicantViews can't be accessibility elements.
  UIView *displayedView = [[UIView alloc] initWithFrame:snapshotView.bounds];
  [displayedView addSubview:snapshotView];

  // Copy the accessibility values from the view being highlighted.
  displayedView.isAccessibilityElement = YES;
  displayedView.accessibilityTraits = UIAccessibilityTraitButton;
  displayedView.accessibilityLabel = highlightedView.accessibilityLabel;
  displayedView.accessibilityValue = highlightedView.accessibilityValue;
  displayedView.accessibilityHint = highlightedView.accessibilityHint;

  return [self initWithHighlightedView:highlightedView
                           andShowView:displayedView
                            completion:completion];
}

- (void)commonMDCFeatureHighlightViewControllerInit {
  _displayedView.accessibilityTraits = UIAccessibilityTraitButton;

  _featureHighlightView = [[MDCFeatureHighlightView alloc] initWithFrame:CGRectZero];
  _featureHighlightView.displayedView = _displayedView;
  _featureHighlightView.autoresizingMask =
      UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

  __weak __typeof__(self) weakSelf = self;
  _featureHighlightView.interactionBlock = ^(BOOL accepted) {
    __typeof__(self) strongSelf = weakSelf;
    [strongSelf dismiss:accepted];
  };
  self.view = _featureHighlightView;
}

- (void)viewWillLayoutSubviews {
  _featureHighlightView.titleLabel.text = self.titleText;
  _featureHighlightView.bodyLabel.text = self.bodyText;
}

- (void)dealloc {
  [_pulseTimer invalidate];
}

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:animated];

  CGPoint point = [_highlightedView.superview convertPoint:_highlightedView.center
                                         toCoordinateSpace:_featureHighlightView];
  _featureHighlightView.highlightPoint = point;

  if (!self.bodyColor) {
    MDFTextAccessibilityOptions options = MDFTextAccessibilityOptionsPreferLighter;
    if ([MDFTextAccessibility isLargeForContrastRatios:_featureHighlightView.bodyLabel.font]) {
      options |= MDFTextAccessibilityOptionsLargeFont;
    }

    UIColor *outerColor = [self.outerHighlightColor colorWithAlphaComponent:1.0];
    self.bodyColor =
        [MDFTextAccessibility textColorOnBackgroundColor:outerColor
                                         targetTextAlpha:[MDCTypography captionFontOpacity]
                                                 options:options];
  }

  if (!self.titleColor) {
    MDFTextAccessibilityOptions options = MDFTextAccessibilityOptionsPreferLighter;
    if ([MDFTextAccessibility isLargeForContrastRatios:_featureHighlightView.titleLabel.font]) {
      options |= MDFTextAccessibilityOptionsLargeFont;
    }
    UIColor *outerColor = [self.outerHighlightColor colorWithAlphaComponent:1.0];
    // Since MDFTextAccessibility can return either a dark value or light value color we want to
    // guarantee that the title and body have the same value.
    CGFloat titleAlpha = [MDFTextAccessibility minAlphaOfTextColor:self.bodyColor
                                                 onBackgroundColor:outerColor
                                                           options:options];
    titleAlpha = MAX([MDCTypography titleFontOpacity], titleAlpha);
    self.titleColor = [self.bodyColor colorWithAlphaComponent:titleAlpha];
  }
}

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];

  _pulseTimer = [NSTimer scheduledTimerWithTimeInterval:kMDCFeatureHighlightPulseAnimationInterval
                                                 target:_featureHighlightView
                                               selector:@selector(animatePulse)
                                               userInfo:NULL
                                                repeats:YES];
}

- (void)viewWillDisappear:(BOOL)animated {
  [super viewWillDisappear:animated];

  [_pulseTimer invalidate];
}

- (void)viewWillTransitionToSize:(CGSize)size
       withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
  [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
  [coordinator animateAlongsideTransition:
   ^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
     CGPoint point = [_highlightedView.superview convertPoint:_highlightedView.center
                                                       toView:_featureHighlightView];

     _featureHighlightView.highlightPoint = point;
     [_featureHighlightView layoutIfNeeded];
     [_featureHighlightView updateOuterHighlight];
   } completion:nil];
}

- (UIColor *)outerHighlightColor {
  return _featureHighlightView.outerHighlightColor;
}

- (void)setOuterHighlightColor:(UIColor *)outerHighlightColor {
  _featureHighlightView.outerHighlightColor = outerHighlightColor;
}

- (UIColor *)innerHighlightColor {
  return _featureHighlightView.innerHighlightColor;
}

- (void)setInnerHighlightColor:(UIColor *)innerHighlightColor {
  _featureHighlightView.innerHighlightColor = innerHighlightColor;
}

- (UIColor *)titleColor {
  return _featureHighlightView.titleColor;
}

- (void)setTitleColor:(UIColor *)titleColor {
  _featureHighlightView.titleColor = titleColor;
}

- (UIColor *)bodyColor {
  return _featureHighlightView.bodyColor;
}

- (void)setBodyColor:(UIColor *)bodyColor {
  _featureHighlightView.bodyColor = bodyColor;
}

- (void)acceptFeature {
  [self dismiss:YES];
}

- (void)rejectFeature {
  [self dismiss:NO];
}

- (void)dismiss:(BOOL)accepted {
  _animationController.presenting = NO;
  if (accepted) {
    _animationController.dismissStyle = MDCFeatureHighlightDismissAccepted;
  } else {
    _animationController.dismissStyle = MDCFeatureHighlightDismissRejected;
  }
  [self dismissViewControllerAnimated:YES
                           completion:^() {
                             if (self->_completion) {
                               self->_completion(accepted);
                             }
                           }];
}

#pragma mark - Accessibility

- (BOOL)accessibilityPerformEscape {
  [self rejectFeature];

  return YES;
}

#pragma mark - UIViewControllerTransitioningDelegate

- (id<UIViewControllerAnimatedTransitioning>)
    animationControllerForPresentedController:(UIViewController *)presented
                         presentingController:(UIViewController *)presenting
                             sourceController:(UIViewController *)source {
  if (presented == self) {
    return _animationController;
  }
  return nil;
}

- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:
        (UIViewController *)dismissed {
  if (dismissed == self) {
    return _animationController;
  }
  return nil;
}

@end


text:
#include "mod_python.h"

/**
 ** tuple_from_array_header
 **
 *   Given an array header return a tuple. The array elements
 *   assumed to be strings.
 */

PyObject * tuple_from_array_header(const apr_array_header_t *ah)
{

    PyObject *t;
    int i;
    char **s;

    if (ah == NULL)
        t = PyTuple_New(0);
    else {
        t = PyTuple_New(ah->nelts);

        s = (char **) ah->elts;
        for (i = 0; i < ah->nelts; i++)
            PyTuple_SetItem(t, i, MpBytesOrUnicode_FromString(s[i]));
    }
    return t;
}

/**
 ** tuple_from_method_list
 **
 *   Given an apr_method_list_t return a tuple.
 */

PyObject * tuple_from_method_list(const ap_method_list_t *l)
{

    PyObject *t;
    int i;
    char **methods;

    if ((l->method_list == NULL) || (l->method_list->nelts == 0))
        t = PyTuple_New(0);
    else {
        t = PyTuple_New(l->method_list->nelts);

        methods = (char **)l->method_list->elts;
        for (i = 0; i < l->method_list->nelts; ++i)
            PyTuple_SetItem(t, i, MpBytesOrUnicode_FromString(methods[i]));
    }
    return t;
}

/**
 ** tuple_from_finfo
 **
 *  makes a tuple similar to return of os.stat() from apr_finfo_t
 *
 */

PyObject *tuple_from_finfo(apr_finfo_t *f)
{
    PyObject *t;

    if (f->filetype == APR_NOFILE) {
        Py_INCREF(Py_None);
        return Py_None;
    }

    t = PyTuple_New(13);

    /* this should have been first, but was added later */
    PyTuple_SET_ITEM(t, 12, PyLong_FromLong(f->filetype));

    if (f->valid & APR_FINFO_PROT) {
        PyTuple_SET_ITEM(t, 0, PyLong_FromLong(f->protection));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 0, Py_None);
    }
    if (f->valid & APR_FINFO_INODE) {
        PyTuple_SET_ITEM(t, 1, PyLong_FromLong(f->inode));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 1, Py_None);
    }
    if (f->valid & APR_FINFO_DEV) {
        PyTuple_SET_ITEM(t, 2, PyLong_FromLong(f->device));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 2, Py_None);
    }
    if (f->valid & APR_FINFO_NLINK) {
        PyTuple_SET_ITEM(t, 3, PyLong_FromLong(f->nlink));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 3, Py_None);
    }
    if (f->valid & APR_FINFO_USER) {
        PyTuple_SET_ITEM(t, 4, PyLong_FromLong(f->user));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 4, Py_None);
    }
    if (f->valid & APR_FINFO_GROUP) {
        PyTuple_SET_ITEM(t, 5, PyLong_FromLong(f->group));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 5, Py_None);
    }
    if (f->valid & APR_FINFO_SIZE) {
        PyTuple_SET_ITEM(t, 6, PyLong_FromLong(f->size));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 6, Py_None);
    }
    if (f->valid & APR_FINFO_ATIME) {
        PyTuple_SET_ITEM(t, 7, PyLong_FromLong(f->atime*0.000001));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 7, Py_None);
    }
    if (f->valid & APR_FINFO_MTIME) {
        PyTuple_SET_ITEM(t, 8, PyLong_FromLong(f->mtime*0.000001));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 8, Py_None);
    }
    if (f->valid & APR_FINFO_CTIME) {
        PyTuple_SET_ITEM(t, 9, PyLong_FromLong(f->ctime*0.000001));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 9, Py_None);
    }
    if (f->fname) {
        PyTuple_SET_ITEM(t, 10, MpBytesOrUnicode_FromString(f->fname));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 10, Py_None);
    }
    if (f->valid & APR_FINFO_NAME) {
        PyTuple_SET_ITEM(t, 11, MpBytesOrUnicode_FromString(f->name));
    } else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 11, Py_None);
    }
    /* it'd be nice to also return the file dscriptor,
       f->filehand->filedes, but it's platform dependent,
       so may be later... */

    return t;
}

/**
 ** tuple_from_apr_uri
 **
 *  makes a tuple from uri_components
 *
 */

PyObject *tuple_from_apr_uri(apr_uri_t *u)
{
    PyObject *t;

    t = PyTuple_New(9);

    if (u->scheme) {
        PyTuple_SET_ITEM(t, 0, MpBytesOrUnicode_FromString(u->scheme));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 0, Py_None);
    }
    if (u->hostinfo) {
        PyTuple_SET_ITEM(t, 1, MpBytesOrUnicode_FromString(u->hostinfo));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 1, Py_None);
    }
    if (u->user) {
        PyTuple_SET_ITEM(t, 2, MpBytesOrUnicode_FromString(u->user));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 2, Py_None);
    }
    if (u->password) {
        PyTuple_SET_ITEM(t, 3, MpBytesOrUnicode_FromString(u->password));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 3, Py_None);
    }
    if (u->hostname) {
        PyTuple_SET_ITEM(t, 4, MpBytesOrUnicode_FromString(u->hostname));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 4, Py_None);
    }
    if (u->port_str) {
        PyTuple_SET_ITEM(t, 5, PyLong_FromLong(u->port));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 5, Py_None);
    }
    if (u->path) {
        PyTuple_SET_ITEM(t, 6, MpBytesOrUnicode_FromString(u->path));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 6, Py_None);
    }
    if (u->query) {
        PyTuple_SET_ITEM(t, 7, MpBytesOrUnicode_FromString(u->query));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 7, Py_None);
    }
    if (u->fragment) {
        PyTuple_SET_ITEM(t, 8, MpBytesOrUnicode_FromString(u->fragment));
    }
    else {
        Py_INCREF(Py_None);
        PyTuple_SET_ITEM(t, 8, Py_None);
    }
    /* XXX hostent, is_initialized, dns_* */

    return t;
}

/**
 ** python_decref
 **
 *   This helper function is used with apr_pool_cleanup_register to destroy
 *   python objects when a certain pool is destroyed.
 */

apr_status_t python_decref(void *object)
{
    Py_XDECREF((PyObject *) object);
    return 0;
}

/**
 ** find_module
 **
 *   Find an Apache module by name, used by get_addhandler_extensions
 */

static module *find_module(char *name)
{
    int n;
    for (n = 0; ap_loaded_modules[n]; ++n) {

        if (strcmp(name, ap_loaded_modules[n]->name) == 0)
            return ap_loaded_modules[n];

    }
    return NULL;
}

/**
 ** get_addhandler_extensions
 **
 *   Get extensions specified for AddHandler, if any. To do this we
 *   retrieve mod_mime's config. This is used by the publisher to strip
 *   file extentions from modules in the most meaningful way.
 *
 *   XXX This function is a hack and will stop working if mod_mime people
 *   decide to change their code. A better way to implement this would
 *   be via the config tree, but it doesn't seem to be quite there just
 *   yet, because it doesn't have .htaccess directives.
 */

char * get_addhandler_extensions(request_rec *req)
{

    /* these typedefs are copied from mod_mime.c */

    typedef struct {
        apr_hash_t  *extension_mappings;
        apr_array_header_t *remove_mappings;
        char *default_language;
        int multimatch;
    } mime_dir_config;

    typedef struct extension_info {
        char *forced_type;                /* Additional AddTyped stuff */
        char *encoding_type;              /* Added with AddEncoding... */
        char *language_type;              /* Added with AddLanguage... */
        char *handler;                    /* Added with AddHandler... */
        char *charset_type;               /* Added with AddCharset... */
        char *input_filters;              /* Added with AddInputFilter... */
        char *output_filters;             /* Added with AddOutputFilter... */
    } extension_info;

    mime_dir_config *mconf;

    apr_hash_index_t *hi;
    void *val;
    void *key;
    extension_info *ei;
    char *result = NULL;

    module *mod_mime = find_module("mod_mime.c");
    mconf = (mime_dir_config *) ap_get_module_config(req->per_dir_config, mod_mime);

    if (mconf->extension_mappings) {

        for (hi = apr_hash_first(req->pool, mconf->extension_mappings); hi; hi = apr_hash_next(hi)) {
            apr_hash_this(hi, (const void **)&key, NULL, &val);
            ei = (extension_info *)val;
            if (ei->handler)
                if (strcmp("mod_python", ei->handler) == 0 ||
                    strcmp("python-program", ei->handler) == 0)
                    result = apr_pstrcat(req->pool, (char *)key, " ", result, NULL);
        }
    }

    return result;
}

/**
 ** find_memberdef
 **
 *   Find a memberdef in a PyMemberDef array
 */

PyMemberDef *find_memberdef(const PyMemberDef *mlist, const char *name)
{
    const PyMemberDef *md;

    for (md = mlist; md->name != NULL; md++)
        if (name[0] == md->name[0] &&
            strcmp(md->name+1, name+1) == 0)
            return (PyMemberDef *)md;

    /* this should never happen or the mlist is screwed up */
    return NULL;
}

/**
 ** cfgtree_walk
 **
 *  walks ap_directive_t tree returning a list of
 *  tuples and lists
 */

PyObject *cfgtree_walk(ap_directive_t *dir)
{

    PyObject *list = PyList_New(0);
    if (!list)
        return PyErr_NoMemory();

    while (dir) {

        PyObject *t = Py_BuildValue("(s, s)", dir->directive, dir->args);
        if (!t)
            return PyErr_NoMemory();

        PyList_Append(list, t);

        Py_DECREF(t);

        if (dir->first_child) {

            PyObject *child = cfgtree_walk(dir->first_child);
            if (!child)
                return PyErr_NoMemory();

            PyList_Append(list, child);

            Py_DECREF(child);

        }

        dir = dir->next;
    }

    return list;
}

/**
 ** makeipaddr
 **
 *  utility func to make an ip address
 */

static PyObject *makeipaddr(struct apr_sockaddr_t *addr)
{
    char *str = NULL;
    apr_status_t rc;
    PyObject *ret = NULL;

    rc = apr_sockaddr_ip_get(&str, addr);
    if (rc==APR_SUCCESS) {
        ret = MpBytesOrUnicode_FromString(str);
    }
    else {
        PyErr_SetString(PyExc_SystemError,"apr_sockaddr_ip_get failure");
    }
    return ret;
}

/**
 ** makesockaddr
 **
 *  utility func to make a socket address
 */

PyObject *makesockaddr(struct apr_sockaddr_t *addr)
{
    PyObject *addrobj = makeipaddr(addr);
    PyObject *ret = NULL;

    if (addrobj) {
        apr_port_t port;
        port = addr->port;
        ret = Py_BuildValue("Oi", addrobj, port );
        Py_DECREF(addrobj);
    }
    return ret;
}


text:
import * as types from './types'

export default function session(state = null, action) {
  switch (action.type) {
    case types.SESSION_STARTED:
    case types.SESSION_RESUMED:
      return action.session
    default:
      return state
  }
}


text:
import './customisations';
import './hero-skill-tab';
import './overlay-frame';
import './upgrades-and-extras';


text:
package org.apache.hadoop.hdfs;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.io.RandomAccessFile;
import java.net.URI;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.util.LinkedList;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.util.InjectionEvent;
import org.apache.hadoop.util.InjectionHandler;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.data.Stat;

public class CachingAvatarZooKeeperClient extends AvatarZooKeeperClient {
  private String cacheDir = null;
  private boolean useCache = false;
  private static final Log LOG = LogFactory.getLog(CachingAvatarZooKeeperClient.class);

  // This needs to be thread local so that each thread maintains its own copy of
  // last file read time for a cache file. In this way multiple threads using
  // the same client would still go to zookeeper only once. We use a linked list
  // since the number of elements in this data structure won't be large and
  // hence we don't pay a huge lookup penalty and at the same time save memory.
  private ThreadLocal<LinkedList<CacheEntry>> lastCacheMod =
    new ThreadLocal<LinkedList<CacheEntry>>() {
    @Override
    protected LinkedList<CacheEntry> initialValue() {
      return new LinkedList<CacheEntry>();
    }
  };

  private static class CacheEntry {
    public final String key;
    public long readTime;

    public CacheEntry(String key, long readTime) {
      this.key = key;
      this.readTime = readTime;
    }
  }

  private CacheEntry findEntry(String key) {
    for (CacheEntry entry : lastCacheMod.get()) {
      if (entry.key.equals(key)) {
        return entry;
      }
    }
    return null;
  }

  private Long getReadTime(String key) {
    CacheEntry entry = findEntry(key);
    return (entry != null) ? entry.readTime : null;
  }

  private void updateReadTime(String key, long readTime) {
    CacheEntry entry = findEntry(key);
    if (entry != null) {
      entry.readTime = readTime;
    } else {
      entry = new CacheEntry(key, readTime);
      lastCacheMod.get().add(entry);
    }
  }

  public abstract class ZooKeeperCall {

    private final String dataFileSuffix;
    private final String lockFileSuffix;
    protected final URI address;

    private ZooKeeperCall(String dataFileSuffix, String lockFileSuffix,
        URI address) {
      this.dataFileSuffix = dataFileSuffix;
      this.lockFileSuffix = lockFileSuffix;
      this.address = address;
    }

    public File getDataFile(String cacheDir) {
      return new File(cacheDir, address.getAuthority() + dataFileSuffix);
    }

    public File getLockFile(String cacheDir) {
      return new File(cacheDir, ".avatar_zk_cache_lock" + lockFileSuffix);
    }

    public abstract String invoke() throws IOException, InterruptedException,
        KeeperException;
  }

  public class GetAddr extends ZooKeeperCall {
    private final boolean retry;
    private final Stat stat;

    public GetAddr(URI address, Stat stat, boolean retry) {
      super("", "", address);
      this.stat = stat;
      this.retry = retry;
    }

    public String invoke() throws IOException, InterruptedException,
        KeeperException {
          InjectionHandler.processEvent(
              InjectionEvent.CACHINGAVATARZK_GET_PRIMARY_ADDRESS);
      return CachingAvatarZooKeeperClient.super.getPrimaryAvatarAddress(
          address.getAuthority(), stat,
          retry);
    }
  }

  public class GetStat extends ZooKeeperCall {
    public GetStat(URI address) {
      super("_stat", "_stat", address);
    }

    public String invoke() throws IOException, InterruptedException,
        KeeperException {
      return ""
          + CachingAvatarZooKeeperClient.super
              .getPrimaryRegistrationTime(address);
    }
  }

  public CachingAvatarZooKeeperClient(Configuration conf, Watcher watcher) {
    super(conf, watcher);
    this.cacheDir = conf.get("fs.ha.zookeeper.cache.dir", "/tmp");
    this.useCache = conf.getBoolean("fs.ha.zookeeper.cache", false);
  }

  private String retrieveAndPopulateCache(File cache, ZooKeeperCall call)
      throws IOException, KeeperException, InterruptedException {
    String val = call.invoke();
    FileWriter writer = new FileWriter(cache);
    writer.write(val);
    writer.close();
    setRWPermissions(cache);
    updateReadTime(cache.getName(), cache.lastModified());
    return val;
  }

  private String getFromCache(ZooKeeperCall call) throws IOException,
          InterruptedException, KeeperException {
    FileWithLock fileWithLock = tryLock(call);
    String result = null;
    BufferedReader reader = null;
    try {
      File cache = call.getDataFile(cacheDir);
      if (!cache.exists()) {
        return retrieveAndPopulateCache(cache, call);
      }
      updateReadTime(cache.getName(), cache.lastModified());
      reader = new BufferedReader(new FileReader(cache));
      result = reader.readLine();
    } finally {
      if (reader != null) {
        reader.close();
      }
      if (fileWithLock != null) {
        if (fileWithLock.lock != null) {
          fileWithLock.lock.release();
        }
        if (fileWithLock.file != null) {
          fileWithLock.file.close();
        }
      }
    }
    return result;
  }

  /**
   * Makes sure the given file has r/w permissions for everyone. We need this
   * since the cache files might be accessed by different users on the
   * same machine.
   */
  private void setRWPermissions(File f) {
    if (!f.setReadable(true, false) || !f.setWritable(true, false)) {
      LOG.info("Could not set permissions for file : "
          + f + " probably because user : " + System.getProperty("user.name")
          + " is not the owner");
    }
  }

  class FileWithLock {
    public final FileLock lock;
    public final RandomAccessFile file;
    public FileWithLock(FileLock lock, RandomAccessFile file) {
      this.lock = lock;
      this.file = file;
    }
  }

  private FileWithLock tryLock(ZooKeeperCall call)
      throws IOException, InterruptedException {
    File lockFile = call.getLockFile(cacheDir);
    RandomAccessFile file = null;

    for (int i = 0; i < 10; i++) {
      try {
        file = new RandomAccessFile(lockFile, "rws");
        break;
      } catch (FileNotFoundException fnfe) {
        // We experience this exception for unknown reason, we retry
        // a few times.
        if (!new File(cacheDir).exists()) {
          new File(cacheDir).mkdir();
        }
        if (i == 9) {
          throw fnfe;
        } else {
          Thread.sleep(250);
        }
      }
    }
    setRWPermissions(lockFile);

    FileLock lock = null;
    do {
      try {
        lock = file.getChannel().tryLock();
      } catch (OverlappingFileLockException ex) {
        // A thread inside of this JVM has the lock on the file
        lock = null;
        Thread.sleep(1000);
      }
    } while (lock == null);
    return new FileWithLock(lock, file);
  }

  private String populateCache(ZooKeeperCall call)
      throws IOException, InterruptedException, KeeperException {
    FileWithLock fileWithLock = tryLock(call);
    String val = null;
    try {
      File cache = call.getDataFile(cacheDir);
      long fileModTime = cache.lastModified();
      Long lastFileReadTime = getReadTime(cache.getName());
      if (lastFileReadTime != null && lastFileReadTime >= fileModTime) {
        // Cache has not been updated and we need to populate it
        val = retrieveAndPopulateCache(cache, call);
      }
    } finally {
      if (fileWithLock != null) {
        if (fileWithLock.lock != null) {
          fileWithLock.lock.release();
        }
        if (fileWithLock.file != null) {
          fileWithLock.file.close();
        }
      }
    }
    if (val == null) {
      val = getFromCache(call);
    }
    return val;
  }

  @Override
  public long getPrimaryRegistrationTime(URI address) throws IOException,
      KeeperException, InterruptedException {
    if (!useCache) {
      return super.getPrimaryRegistrationTime(address);
    }
    ZooKeeperCall call = new GetStat(address);
    return Long.parseLong(populateCache(call));
  }

  public String getPrimaryAvatarAddress(URI address, Stat stat, boolean retry,
      boolean firstAttempt) throws IOException, KeeperException,
         InterruptedException {
    if (!useCache) {
      return super.getPrimaryAvatarAddress(address.getAuthority(), stat, retry);
    }
    ZooKeeperCall call = new GetAddr(address, stat, retry);
    return populateCache(call);
  }

  public boolean isCacheEnabled() {
    return useCache;
  }

  String getCacheDir() {
    return this.cacheDir;
  }
}


text:
<?php
namespace Document\Controller\Plugin;

use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use Zend\ServiceManager\ServiceManager;

/**
 *
 * @deprecated
 * @author Sergio
 *
 */
class MainModuleService
	extends AbstractPlugin
{
	/**
	 * @var ServiceManager
	 */
	private $sm;

	public function __construct(ServiceManager $sm)
	{
		$this->sm = $sm;
	}

	public function __invoke()
	{
		//trigger_error('non posso chiamarlo MainModuleService, si può usare in tutti i moduli!!');
		$locator = $this->sm->getServiceLocator();
		return $locator->get('neosearch.service.main');
	}
}


text:
package api

import (
	"encoding/json"
	"fmt"
	"net/url"
	"regexp"
)

// MetricQuery object
type MetricQuery struct {
	Query string `json:"query"`
	Type  string `json:"type"`
}

// MetricCluster object
type MetricCluster struct {
	CID                 string              `json:"_cid,omitempty"`
	MatchingMetrics     []string            `json:"_matching_metrics,omitempty"`
	MatchingUUIDMetrics map[string][]string `json:"_matching_uuid_metrics,omitempty"`
	Description         string              `json:"description"`
	Name                string              `json:"name"`
	Queries             []MetricQuery       `json:"queries"`
	Tags                []string            `json:"tags"`
}

var baseMetricClusterPath = "/metric_cluster"

// FetchMetricClusterByID fetch a metric cluster configuration by id
func (a *API) FetchMetricClusterByID(id IDType, extras string) (*MetricCluster, error) {
	reqURL := url.URL{
		Path: fmt.Sprintf("%s/%d", baseMetricClusterPath, id),
	}
	cid := CIDType(reqURL.String())
	return a.FetchMetricClusterByCID(cid, extras)
}

// FetchMetricClusterByCID fetch a check bundle configuration by id
func (a *API) FetchMetricClusterByCID(cid CIDType, extras string) (*MetricCluster, error) {
	if matched, err := regexp.MatchString("^"+baseMetricClusterPath+"/[0-9]+$", string(cid)); err != nil {
		return nil, err
	} else if !matched {
		return nil, fmt.Errorf("Invalid metric cluster CID %v", cid)
	}

	reqURL := url.URL{
		Path: string(cid),
	}

	extra := ""
	switch extras {
	case "metrics":
		extra = "_matching_metrics"
	case "uuids":
		extra = "_matching_uuid_metrics"
	}

	if extra != "" {
		q := url.Values{}
		q.Set("extra", extra)
		reqURL.RawQuery = q.Encode()
	}

	resp, err := a.Get(reqURL.String())
	if err != nil {
		return nil, err
	}

	cluster := &MetricCluster{}
	if err := json.Unmarshal(resp, cluster); err != nil {
		return nil, err
	}

	return cluster, nil
}

// MetricClusterSearch returns list of metric clusters matching a search query (or all metric
// clusters if no search query is provided)
//    - a search query not a filter (see: https://login.circonus.com/resources/api#searching)
func (a *API) MetricClusterSearch(searchCriteria SearchQueryType) ([]MetricCluster, error) {
	reqURL := url.URL{
		Path: baseMetricClusterPath,
	}

	if searchCriteria != "" {
		q := url.Values{}
		q.Set("search", string(searchCriteria))
		reqURL.RawQuery = q.Encode()
	}

	resp, err := a.Get(reqURL.String())
	if err != nil {
		return nil, fmt.Errorf("[ERROR] API call error %+v", err)
	}

	var clusters []MetricCluster
	if err := json.Unmarshal(resp, &clusters); err != nil {
		return nil, err
	}

	return clusters, nil
}

// CreateMetricCluster create a new metric cluster
func (a *API) CreateMetricCluster(config *MetricCluster) (*MetricCluster, error) {
	reqURL := url.URL{
		Path: baseMetricClusterPath,
	}
	cfg, err := json.Marshal(config)
	if err != nil {
		return nil, err
	}

	resp, err := a.Post(reqURL.String(), cfg)
	if err != nil {
		return nil, err
	}

	cluster := &MetricCluster{}
	if err := json.Unmarshal(resp, cluster); err != nil {
		return nil, err
	}

	return cluster, nil
}

// UpdateMetricCluster updates a metric cluster
func (a *API) UpdateMetricCluster(config *MetricCluster) (*MetricCluster, error) {
	if matched, err := regexp.MatchString("^"+baseMetricClusterPath+"/[0-9]+$", string(config.CID)); err != nil {
		return nil, err
	} else if !matched {
		return nil, fmt.Errorf("Invalid metric cluster CID %v", config.CID)
	}

	reqURL := url.URL{
		Path: config.CID,
	}

	cfg, err := json.Marshal(config)
	if err != nil {
		return nil, err
	}

	resp, err := a.Put(reqURL.String(), cfg)
	if err != nil {
		return nil, err
	}

	cluster := &MetricCluster{}
	if err := json.Unmarshal(resp, cluster); err != nil {
		return nil, err
	}

	return cluster, nil
}


text:
package org.opencloudb.server.response;

import java.nio.ByteBuffer;

import org.opencloudb.config.Fields;
import org.opencloudb.mysql.PacketUtil;
import org.opencloudb.net.mysql.EOFPacket;
import org.opencloudb.net.mysql.FieldPacket;
import org.opencloudb.net.mysql.ResultSetHeaderPacket;
import org.opencloudb.net.mysql.RowDataPacket;
import org.opencloudb.server.ServerConnection;
import org.opencloudb.util.StringUtil;

/**
 * @author mycat
 */
public class SelectDatabase {
    private static final int FIELD_COUNT = 1;
    private static final ResultSetHeaderPacket header = PacketUtil.getHeader(FIELD_COUNT);
    private static final FieldPacket[] fields = new FieldPacket[FIELD_COUNT];
    private static final EOFPacket eof = new EOFPacket();
    static {
        int i = 0;
        byte packetId = 0;
        header.packetId = ++packetId;
        fields[i] = PacketUtil.getField("DATABASE()", Fields.FIELD_TYPE_VAR_STRING);
        fields[i++].packetId = ++packetId;
        eof.packetId = ++packetId;
    }

    public static void response(ServerConnection c) {
        ByteBuffer buffer = c.allocate();
        buffer = header.write(buffer, c);
        for (FieldPacket field : fields) {
            buffer = field.write(buffer, c);
        }
        buffer = eof.write(buffer, c);
        byte packetId = eof.packetId;
        RowDataPacket row = new RowDataPacket(FIELD_COUNT);
        row.add(StringUtil.encode(c.getSchema(), c.getCharset()));
        row.packetId = ++packetId;
        buffer = row.write(buffer, c);
        EOFPacket lastEof = new EOFPacket();
        lastEof.packetId = ++packetId;
        buffer = lastEof.write(buffer, c);
        c.write(buffer);
    }

}


text:
title: Use Github Static Pages to Host Your Front End Projects
---
**Benefits**

I love Codepen.io, it's a wonderful, easy-to-use tool for simple front-end experimentation. But as the fcc projects got more complex, I realized coding locally was going to save me a bunch of headaches. My text-editor and codekit combo are just waaay faster.

*   Autocomplete
*   Compile everything (codepen was really dragging trying to compile Jade)
*   Better auto-refresh
*   Built in bower
*   Git versioning
*   Improved screen real-estate experience

## Git to Github

Since I'm already saving locally, and using git for version control, I figured might as well upload to Github. Plus, Github has a fantastic, free service for front-end projects called Github Pages. Just update your repo and your changes are live.

How it works is simple. Github checks if your repository has a branch called `gh-pages` and serves any code that's sitting in that branch. No back-end stuff here, but HTML, CSS and JS work like a charm.

## First things first

Let's make a new folder for your project. I'll use the Camper News project as my example.

Got to your work directory and make a new one. You can do this in the terminal (or not).

![Project Directory](//discourse-user-assets.s3.amazonaws.com/original/2X/2/2e3faaa2752657c592a9991ceed29a0200f332e6.png)

Now, go into the project directory, and (for sure in the terminal this time) use the command `git init`. Note, this tutorial assumes you have git installed.

Alright, awesome. Now we're ready to work.

## Next steps

Create some files in your campNews directory. I don't know, maybe an index.html and probably app.css and app.js, or whatever naming convention you prefer. Put your code in these files. Alright, now we're ready for our first commit. It takes **two steps**.

1.  `git add -A` will prep all these new files and the new code inside them
2.  `git commit -m 'relevant message'` will commit all the work you've done to the branch you're currently on ('master' by default)

## The key to this whole thing

OK, so far we're still local. There's some stuff we gotta do to take our work and move it to github. It's at this point I like to switch branches. Remember - github only serves from gh-pages, and if you've followed along so far, your branch is called 'master'. Let's make a new (local) gh-pages branch.

`git checkout -b gh-pages` will create it, copy all the work from master into gh-pages and switch me over to the branch. Phew.

`git branch -d master` will get rid of the master branch. Sounds crazy I know, but what do we need it for? Just think of gh-pages as your NEW master branch.

Now, `git add -A` and `git commit -m 'relevant message'` again, just in case. And be prepared to leave your editor and terminal and go online for the first time.

Go to your github profile and create a new repo. Name it something relevant, like campNews.

![New Repo](//discourse-user-assets.s3.amazonaws.com/original/2X/3/3f113af87b94fcd649c78d5f6d36463795671e7b.png)

Once it's created, go in and grab the HTTPS clone URL. (Ignore the files in my screenshot, your repo will be empty at this point).

![clone url](//discourse-user-assets.s3.amazonaws.com/original/2X/a/a0f3da26ba0802342d7d6f7890763a2bca32b62a.png)

## Putting it all together

And you can leave the online world. Back to the terminal! Let's connect our local project to this github repo. All it takes is one command.

`git remote add origin <server>` Just replace server with the HTTPS url you just copied. So my command looks like this:

`git remote add origin https://github.com/gkobilansky/campNews.git`.

OK, so far we've:

1.  Created our project
2.  Versioned it in git
3.  Commited some changes
4.  Switched it to the 'gh-pages' branch
5.  Connected it to github

## Last step!

Push you project to github. Again, simple:

`git push origin gh-pages`

That command will make sure your latest commits get uploaded to github. Once you've done this at least once, your project should be available http://_username_.github.io/_repository_, so for me it's http://gkobilansky.github.io/campNews.

Once this is all done, the process just repeats itself:

1.  `git add -A`
2.  `git commit -m 'relevant message'`
3.  `git push origin gh-pages`

Granted, steeper learning curve than codepen.io, but faster and more flexible once you get the hang of it.

Happy coding!

PS. Thanks to this guide by Roger Dudler for keeping things simple.


text:
<?php

namespace Oro\Bundle\ImportExportBundle\Handler;

use Oro\Bundle\ImportExportBundle\Context\StepExecutionProxyContext;

use Oro\Bundle\ImportExportBundle\Processor\ProcessorRegistry;
use Symfony\Component\HttpFoundation\File\File;

class HttpImportHandler extends AbstractImportHandler
{

    /**
     * {@inheritdoc}
     */
    public function handleImportValidation(
        $jobName,
        $processorAlias,
        array $options = []
    ) {
        $entityName = $this->processorRegistry->getProcessorEntityName(
            ProcessorRegistry::TYPE_IMPORT_VALIDATION,
            $processorAlias
        );

        $jobResult = $this->executeValidation(
            $jobName,
            $processorAlias,
            $options,
            $entityName
        );

        $counts = $this->getValidationCounts($jobResult);

        $errorsAndExceptions = [];
        $context = $jobResult->getContext();
        if (!empty($counts['errors'])) {
            $contextErrors = [];
            if ($context) {
                $contextErrors = $context->getErrors();
            }
            $errorsAndExceptions = array_slice(
                array_merge($jobResult->getFailureExceptions(), $contextErrors),
                0,
                100
            );
        }
        if ($context && $context instanceof StepExecutionProxyContext) {
            // each warning is for an invalid item
            $countWarnings = count($context->getWarnings());
            $counts['error_entries'] += $countWarnings;
        }

        return [
            'success'        => $jobResult->isSuccessful() && isset($counts['process']) && $counts['process'] > 0,
            'processorAlias' => $processorAlias,
            'counts'         => $counts,
            'errors'         => $errorsAndExceptions,
            'entityName'     => $entityName,
            'options'        => $options
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function handleImport(
        $jobName,
        $processorAlias,
        array $options = []
    ) {
        $jobResult = $this->executeJob($jobName, $processorAlias, $options);
        $counts = $this->getValidationCounts($jobResult);
        $importInfo = '';

        if ($jobResult->isSuccessful()) {
            $message = $this->translator->trans('oro.importexport.import.success');

            $entityName = $this->processorRegistry->getProcessorEntityName(
                ProcessorRegistry::TYPE_IMPORT,
                $processorAlias
            );

            $importInfo = $this->getImportInfo($counts, $entityName);
        } else {
            $message = $this->translator->trans('oro.importexport.import.error');
        }

        $errors = [];
        if ($context = $jobResult->getContext()) {
            $errors = $context->getErrors();
        }
        if ($jobResult->getFailureExceptions()) {
            $errors = array_merge($errors, $jobResult->getFailureExceptions());
        }

        $errorsAndExceptions = array_slice($errors, 0, 100);

        return [
            'success'    => $jobResult->isSuccessful(),
            'message'    => $message,
            'importInfo' => $importInfo,
            'errors'     => $errorsAndExceptions,
            'counts'     => $counts,
        ];
    }
}


text:
const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
//~^ ERROR expected at least one digit in exponent
//~| ERROR unknown start of token: \u{2212}
//~| ERROR cannot subtract `{integer}` from `{float}`

fn main() {}


text:
namespace CGAL {

/*!
\ingroup PkgConvexHull2Traits

The class `Convex_hull_constructive_traits_2` serves as a traits class for all the two-dimensional
convex hull and extreme point calculation function. Unlike the class
`CGAL::Convex_hull_traits_2<R>`, this class makes use of previously
computed results to avoid redundancy. For example,
in the sidedness tests, lines (of type `R::Line_2`) are constructed,
which is equivalent to the precomputation of subdeterminants of
the orientation-determinant for three points.

\cgalModels `ConvexHullTraits_2`

\sa `CGAL::Projection_traits_xy_3<K>`
\sa `CGAL::Projection_traits_yz_3<K>`
\sa `CGAL::Projection_traits_xz_3<K>`

\sa `CGAL::Convex_hull_traits_2<R>`

*/
template< typename R >
class Convex_hull_constructive_traits_2 {
public:

/// \name Types
/// @{

/*!

*/
typedef R::Point_2 Point_2;

/*!

*/
typedef R::Less_xy_2 Less_xy_2;

/*!

*/
typedef R::Less_yx_2 Less_yx_2;

/*!

*/
typedef CGAL::r_Less_dist_to_line<R>
Less_signed_distance_to_line_2;

/*!

*/
typedef R::Less_rotate_ccw Less_rotate_ccw_2;

/*!

*/
typedef R::Left_turn_2 Left_turn_2;

/*!

*/
typedef R::Equal_2 Equal_2;

/// @}

/// \name Creation
/// @{

/*!
default constructor.
*/
Convex_hull_constructive_traits_2();

/// @}

/// \name Operations
/// @{

/*!

*/
Less_xy_2 less_xy_2_object();

/*!

*/
Less_yx_2 less_yx_2_object();

/*!

*/
Less_signed_distance_to_line_2
less_signed_distance_to_line_2_object();

/*!

*/
Less_rotate_ccw_2
less_rotate_ccw_2_object();

/*!

*/
Left_turn_2 left_turn_2_object();

/*!

*/
Equal_2 equal_2_object();

/// @}

}; /* end Convex_hull_constructive_traits_2 */
} /* end namespace CGAL */


text:
require File.dirname(__FILE__) + '/ordered_options'
require File.dirname(__FILE__) + '/../lib/app_config'
require 'test/unit'

#require '../lib/app_config'
class AppConfigTest < Test::Unit::TestCase

    def test_accessor_methods
        AppConfig::Base.mail_from_address = 'sender@address.com'
        assert_equal( 'sender@address.com', AppConfig.mail_from_address)
        assert_nil AppConfig.mail_from_address_WRONG

        hash = {:k1=>Time.now, :k2=>'12312'}
        AppConfig::Base.hash_option = hash
        assert hash===AppConfig.hash_option
        assert_nil AppConfig.hash_optio_WRONG

        # not allowed methods:
        # (.*)= e.g. AppConfig.name=123,
        assert_raise(NoMethodError){ AppConfig.hash_option= 123 }
        assert_raise(NoMethodError){ AppConfig[:mail_from_address]= 123 }

        # (.*) with parameters e.g. AppConfig.name(1,2,3)
        assert_raise(NoMethodError){ AppConfig.mail_from_address(1) }
        assert_raise(NoMethodError){ AppConfig.mail_from_address(1,2) }
    end

    def test_hashlike_access
        AppConfig::Base.mail_from_address = 'sender@address.com'
        assert_equal( 'sender@address.com', AppConfig[:mail_from_address])
        assert_equal( 'sender@address.com', AppConfig['mail_from_address'])

        hash = {:k1=>Time.now, :k2=>'12312'}
        AppConfig::Base.hash_option = hash
        assert hash===AppConfig[:hash_option]
        assert hash===AppConfig['hash_option']
    end

    def test_param_with_default_access
        AppConfig::Base.mail_from_address = 'sender@address.com'
        assert_equal( 'sender@address.com', AppConfig.param(:mail_from_address))
        assert_equal( 'sender@address.com', AppConfig.param('mail_from_address'))

        # access to no existing parameter
        # without default val
        assert_nil(AppConfig.param(:NOmail_from_address))
        assert_nil(AppConfig.param('NOmail_from_address'))

        # with default value
        assert_equal( 'default@address.com', AppConfig.param(:NOmail_from_address, 'default@address.com'))
        assert_equal( 'default@address.com', AppConfig.param('NOmail_from_address', 'default@address.com'))
    end

    def test_param_with_block
        AppConfig::Base.mail_from_address = 'sender@address.com'
        assert_equal( 'sender@address.com', AppConfig.param(:mail_from_address){false})
        assert_equal( 'sender@address.com', AppConfig.param(:mail_from_address){false})

        # access to no existing parameter
        assert(AppConfig.param(:NOmail_from_address){true})
        assert(AppConfig.param('NOmail_from_address'){true})

        # enter either default or block, or...
        assert_raise ArgumentError do
             AppConfig.param(:foobar, 'default'){ true }
        end
    end

    def test_param_existing_check
        AppConfig::Base.mail_from_address = 'sender@address.com'
        assert AppConfig.has_param?(:mail_from_address)
        assert AppConfig.has_param?('mail_from_address')

        # parameter with nil value
        AppConfig::Base.nil_param = nil
        assert AppConfig.has_param?(:nil_param)
        assert AppConfig.has_param?('nil_param')

        # no existing parameter
        assert_equal false, AppConfig.has_param?(:no_exists)
        assert_equal false, AppConfig.has_param?('no_exists')
    end

    def test_boolean_params
        AppConfig::Base.some_param = false

        assert_equal false, AppConfig['some_param']
        assert_equal false, AppConfig.param('some_param')
        assert_equal false, AppConfig.param('some_param', true )
    end

end


text:
<?php

class Upload extends CI_Controller {

        public function __construct()
        {
                parent::__construct();
                $this->load->helper(array('form', 'url'));
        }

        public function index()
        {
                $this->load->view('ebillupload', array('error' => ' ' ));
        }

        public function do_upload()
        {
                $filename = $this->input->post('eImg');
                echo "<script>alert('$filename')</script>";

                $config['upload_path']          = './public/db_img';
                $config['allowed_types']        = 'jpg';

                $this->load->library('upload', $config);

                if ( ! $this->upload->do_upload())
                {
                        $error = array('error' => $this->upload->display_errors());

                        $this->load->view('ebillupload', $error);
                }
                else
                {
                        $data = array('upload_data' => $this->upload->data());

                        $this->load->view('ebillsuccess', $data);
                }
        }
}
?>


text:
package com.battlelancer.seriesguide.settings;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.battlelancer.seriesguide.BuildConfig;

public class AppSettings {

    public static final String KEY_VERSION = "oldversioncode";

    public static final String KEY_GOOGLEANALYTICS = "enableGAnalytics";

    public static final String KEY_HAS_SEEN_NAV_DRAWER = "hasSeenNavDrawer";

    /**
     * Returns the version code of the previously installed version. Is the current version on
     * fresh
     * installs.
     */
    public static int getLastVersionCode(Context context) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

        int lastVersionCode = prefs.getInt(KEY_VERSION, -1);
        if (lastVersionCode == -1) {
            // set current version as default value
            lastVersionCode = BuildConfig.VERSION_CODE;
            prefs.edit().putInt(KEY_VERSION, lastVersionCode).commit();
        }

        return lastVersionCode;
    }

    public static boolean isGaAppOptOut(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(KEY_GOOGLEANALYTICS, false);
    }

    /**
     * Whether the user was shown the nav drawer for this app.
     */
    public static boolean hasSeenNavDrawer(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(KEY_HAS_SEEN_NAV_DRAWER, false);
    }
}


text:
package de.zib.chordsharp;

import java.util.Vector;

/**
 * Public ChordSharp Interface.
 *
 * @author Nico Kruber, kruber@zib.de
 * @version 1.4
 */
public class ChordSharp {

	/**
	 * Gets the value stored with the given {@code key}.
	 *
	 * @param key
	 *            the key to look up
	 * @return the value stored under the given {@code key}
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 * @throws TimeoutException
	 *             if a timeout occurred while trying to fetch the value
	 * @throws NotFoundException
	 *             if the requested key does not exist
	 * @throws UnknownException
	 *             if any other error occurs
	 */
	public static String read(String key) throws ConnectionException,
			TimeoutException, UnknownException, NotFoundException {
		return ChordSharpConnection.readString(key);
	}

	/**
	 * Stores the given {@code key}/{@code value} pair.
	 *
	 * @param key
	 *            the key to store the value for
	 * @param value
	 *            the value to store
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 * @throws TimeoutException
	 *             if a timeout occurred while trying to write the value
	 * @throws UnknownException
	 *             if any other error occurs
	 */
	public static void write(String key, String value)
			throws ConnectionException, TimeoutException, UnknownException {
		ChordSharpConnection.write(key, value);
	}

	/**
	 * Publishes an event under a given {@code topic}.
	 *
	 * @param topic
	 *            the topic to publish the content under
	 * @param content
	 *            the content to publish
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 */
	public static void publish(String topic, String content) throws ConnectionException {
		ChordSharpConnection.publish(topic, content);
	}

	/**
	 * Subscribes a url for a {@code topic}.
	 *
	 * Note: Since version 1.4 erlang's return type is evaluated and additional
	 * exceptions were added to comply with that change.
	 *
	 * @param topic
	 *            the topic to subscribe the url for
	 * @param url
	 *            the url of the subscriber (this is where the events are send
	 *            to)
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 * @throws TimeoutException
	 *             if a timeout occurred while trying to write the value
	 * @throws UnknownException
	 *             if any other error occurs
	 */
	public static void subscribe(String topic, String url)
			throws ConnectionException, TimeoutException, UnknownException {
		ChordSharpConnection.subscribe(topic, url);
	}

	/**
	 * Unsubscribes a url from a {@code topic}.
	 *
	 * Note: Since version 1.4 erlang's return type is evaluated and additional
	 * exceptions were added to comply with that change.
	 *
	 * @param topic
	 *            the topic to unsubscribe the url from
	 * @param url
	 *            the url of the subscriber
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 * @throws TimeoutException
	 *             if a timeout occurred while trying to write the value
	 * @throws NotFoundException
	 *             if the topic does not exist or the given subscriber is not
	 *             subscribed to the given topic
	 * @throws UnknownException
	 *             if any other error occurs
	 *
	 * @since 1.3
	 */
	public static void unsubscribe(String topic, String url)
			throws ConnectionException, TimeoutException, NotFoundException, UnknownException {
		ChordSharpConnection.unsubscribe(topic, url);
	}

	/**
	 * Gets a list of subscribers of a {@code topic}.
	 *
	 * @param topic
	 *            the topic to get the subscribers for
	 * @return the subscriber URLs
	 * @throws ConnectionException
	 *             if the connection is not active or a communication error
	 *             occurs or an exit signal was received or the remote node
	 *             sends a message containing an invalid cookie
	 * @throws UnknownException
	 *             is thrown if the return type of the erlang method does not
	 *             match the expected one
	 */
	public static Vector<String> getSubscribers(String topic)
			throws ConnectionException, UnknownException {
		return ChordSharpConnection.getSubscribers(topic);
	}
}