text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <committees>
      <billCommittees>
        <item>
          <subcommittees>
            <item>
              <name>Europe, Eurasia, and Emerging Threats Subcommittee</name>
              <systemCode>hsfa14</systemCode>
              <activities>
                <item>
                  <date>2017-02-16T22:09:00Z</date>
                  <name>Referred to</name>
                </item>
              </activities>
            </item>
          </subcommittees>
          <name>Foreign Affairs Committee</name>
          <activities>
            <item>
              <date>2017-01-12T15:01:15Z</date>
              <name>Referred to</name>
            </item>
          </activities>
          <chamber>House</chamber>
          <systemCode>hsfa00</systemCode>
          <type>Standing</type>
        </item>
      </billCommittees>
    </committees>
    <notes />
    <titles>
      <item>
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <chamberName />
        <title>Crimea Annexation Non-recognition Act</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Short Titles as Introduced</titleType>
        <chamberName />
        <title>Crimea Annexation Non-recognition Act</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Official Title as Introduced</titleType>
        <chamberName />
        <title>To prohibit United States Government recognition of Russia's annexation of Crimea.</title>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <titleType>Display Title</titleType>
        <chamberName />
        <title>Crimea Annexation Non-recognition Act</title>
        <parentTitleType />
        <chamberCode />
      </item>
    </titles>
    <billNumber>463</billNumber>
    <version>1.0.0</version>
    <calendarNumbers />
    <sponsors>
      <item>
        <party>D</party>
        <bioguideId>C001078</bioguideId>
        <middleName>E.</middleName>
        <state>VA</state>
        <identifiers>
          <bioguideId>C001078</bioguideId>
          <lisID>1959</lisID>
          <gpoId>8202</gpoId>
        </identifiers>
        <district>11</district>
        <byRequestType />
        <firstName>Gerald</firstName>
        <fullName>Rep. Connolly, Gerald E. [D-VA-11]</fullName>
        <lastName>Connolly</lastName>
      </item>
    </sponsors>
    <title>Crimea Annexation Non-recognition Act</title>
    <laws />
    <actions>
      <item>
        <actionDate>2017-02-16</actionDate>
        <committee>
          <systemCode>hsfa14</systemCode>
          <name>Europe, Eurasia, and Emerging Threats Subcommittee</name>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Referred to the Subcommittee on Europe, Eurasia, and Emerging Threats.</text>
        <type>Committee</type>
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-01-12</actionDate>
        <links />
        <text>Referred to the House Committee on Foreign Affairs.</text>
        <sourceSystem>
          <name>House floor actions</name>
          2
        </sourceSystem>
        <actionCode>H11100</actionCode>
        <committee>
          <systemCode>hsfa00</systemCode>
          <name>Foreign Affairs Committee</name>
        </committee>
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-01-12</actionDate>
        <links />
        <text>Introduced in House</text>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <actionCode>Intro-H</actionCode>
        <committee />
      </item>
      <item>
        <type>IntroReferral</type>
        <actionDate>2017-01-12</actionDate>
        <links />
        <text>Introduced in House</text>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <actionCode>1000</actionCode>
        <committee />
      </item>
      <actionTypeCounts>
        <placeholderTextForH>1</placeholderTextForH>
        <introducedInHouse>1</introducedInHouse>
        <billReferrals>1</billReferrals>
        <introducedInTheHouse>1</introducedInTheHouse>
      </actionTypeCounts>
      <actionByCounts>
        <houseOfRepresentatives>4</houseOfRepresentatives>
      </actionByCounts>
    </actions>
    <introducedDate>2017-01-12</introducedDate>
    <relatedBills />
    <billType>HR</billType>
    <cboCostEstimates />
    <originChamber>House</originChamber>
    <cosponsors>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <bioguideId>C000266</bioguideId>
        <middleName />
        <identifiers>
          <lisID>186</lisID>
          <bioguideId>C000266</bioguideId>
          <gpoId>8091</gpoId>
        </identifiers>
        <state>OH</state>
        <firstName>STEVE</firstName>
        <fullName>Rep. Chabot, Steve [R-OH-1]</fullName>
        <party>R</party>
        <lastName>CHABOT</lastName>
        <district>1</district>
        <sponsorshipDate>2017-01-12</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>K000009</bioguideId>
        <middleName />
        <identifiers>
          <gpoId>8099</gpoId>
          <bioguideId>K000009</bioguideId>
          <lisID>616</lisID>
        </identifiers>
        <state>OH</state>
        <firstName>MARCY</firstName>
        <fullName>Rep. Kaptur, Marcy [D-OH-9]</fullName>
        <party>D</party>
        <lastName>KAPTUR</lastName>
        <district>9</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>C001084</bioguideId>
        <middleName>N.</middleName>
        <identifiers>
          <gpoId>8139</gpoId>
          <bioguideId>C001084</bioguideId>
          <lisID>2055</lisID>
        </identifiers>
        <state>RI</state>
        <firstName>David</firstName>
        <fullName>Rep. Cicilline, David N. [D-RI-1]</fullName>
        <party>D</party>
        <lastName>Cicilline</lastName>
        <district>1</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>S001165</bioguideId>
        <middleName />
        <identifiers>
          <lisID>1818</lisID>
          <bioguideId>S001165</bioguideId>
          <gpoId>8055</gpoId>
        </identifiers>
        <state>NJ</state>
        <firstName>Albio</firstName>
        <fullName>Rep. Sires, Albio [D-NJ-8]</fullName>
        <party>D</party>
        <lastName>Sires</lastName>
        <district>8</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>K000375</bioguideId>
        <middleName>R.</middleName>
        <identifiers>
          <bioguideId>K000375</bioguideId>
          <lisID>2025</lisID>
          <gpoId>7975</gpoId>
        </identifiers>
        <state>MA</state>
        <firstName>William</firstName>
        <fullName>Rep. Keating, William R. [D-MA-9]</fullName>
        <party>D</party>
        <lastName>Keating</lastName>
        <district>9</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>W000814</bioguideId>
        <middleName>K.</middleName>
        <identifiers>
          <bioguideId>W000814</bioguideId>
          <lisID>2161</lisID>
          <gpoId />
        </identifiers>
        <state>TX</state>
        <firstName>Randy</firstName>
        <fullName>Rep. Weber, Randy K., Sr. [R-TX-14]</fullName>
        <party>R</party>
        <lastName>Weber</lastName>
        <district>14</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>B001257</bioguideId>
        <middleName>M.</middleName>
        <identifiers>
          <lisID>1838</lisID>
          <bioguideId>B001257</bioguideId>
          <gpoId>7881</gpoId>
        </identifiers>
        <state>FL</state>
        <firstName>Gus</firstName>
        <fullName>Rep. Bilirakis, Gus M. [R-FL-12]</fullName>
        <party>R</party>
        <lastName>Bilirakis</lastName>
        <district>12</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>P000096</bioguideId>
        <middleName>J.</middleName>
        <identifiers>
          <lisID>1510</lisID>
          <bioguideId>P000096</bioguideId>
          <gpoId>8050</gpoId>
        </identifiers>
        <state>NJ</state>
        <firstName>WILLIAM</firstName>
        <fullName>Rep. Pascrell, Bill, Jr. [D-NJ-9]</fullName>
        <party>D</party>
        <lastName>PASCRELL</lastName>
        <district>9</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>S000244</bioguideId>
        <middleName>JAMES</middleName>
        <identifiers>
          <bioguideId>S000244</bioguideId>
          <lisID>1041</lisID>
          <gpoId>8218</gpoId>
        </identifiers>
        <state>WI</state>
        <firstName>F.</firstName>
        <fullName>Rep. Sensenbrenner, F. James, Jr. [R-WI-5]</fullName>
        <party>R</party>
        <lastName>SENSENBRENNER</lastName>
        <district>5</district>
        <sponsorshipDate>2017-01-24</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>S001170</bioguideId>
        <middleName />
        <identifiers>
          <bioguideId>S001170</bioguideId>
          <lisID>1861</lisID>
          <gpoId>7528</gpoId>
        </identifiers>
        <state>NH</state>
        <firstName>Carol</firstName>
        <fullName>Rep. Shea-Porter, Carol [D-NH-1]</fullName>
        <party>D</party>
        <lastName>Shea-Porter</lastName>
        <district>1</district>
        <sponsorshipDate>2017-02-07</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>P000592</bioguideId>
        <middleName />
        <identifiers>
          <bioguideId>P000592</bioguideId>
          <lisID>1802</lisID>
          <gpoId>8158</gpoId>
        </identifiers>
        <state>TX</state>
        <firstName>Ted</firstName>
        <fullName>Rep. Poe, Ted [R-TX-2]</fullName>
        <party>R</party>
        <lastName>Poe</lastName>
        <district>2</district>
        <sponsorshipDate>2017-02-07</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>B001296</bioguideId>
        <middleName>F.</middleName>
        <identifiers>
          <lisID>2267</lisID>
          <bioguideId>B001296</bioguideId>
          <gpoId />
        </identifiers>
        <state>PA</state>
        <firstName>Brendan</firstName>
        <fullName>Rep. Boyle, Brendan F. [D-PA-13]</fullName>
        <party>D</party>
        <lastName>Boyle</lastName>
        <district>13</district>
        <sponsorshipDate>2017-02-07</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>G000551</bioguideId>
        <middleName>M.</middleName>
        <identifiers>
          <bioguideId>G000551</bioguideId>
          <lisID>1708</lisID>
          <gpoId>7804</gpoId>
        </identifiers>
        <state>AZ</state>
        <firstName>Raul</firstName>
        <fullName>Rep. Grijalva, Raul M. [D-AZ-3]</fullName>
        <party>D</party>
        <lastName>Grijalva</lastName>
        <district>3</district>
        <sponsorshipDate>2017-02-07</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>Q000023</bioguideId>
        <middleName />
        <identifiers>
          <lisID>1967</lisID>
          <bioguideId>Q000023</bioguideId>
          <gpoId>7925</gpoId>
        </identifiers>
        <state>IL</state>
        <firstName>Mike</firstName>
        <fullName>Rep. Quigley, Mike [D-IL-5]</fullName>
        <party>D</party>
        <lastName>Quigley</lastName>
        <district>5</district>
        <sponsorshipDate>2017-03-13</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>J000295</bioguideId>
        <middleName>P.</middleName>
        <identifiers>
          <lisID>2154</lisID>
          <bioguideId>J000295</bioguideId>
          <gpoId />
        </identifiers>
        <state>OH</state>
        <firstName>David</firstName>
        <fullName>Rep. Joyce, David P. [R-OH-14]</fullName>
        <party>R</party>
        <lastName>Joyce</lastName>
        <district>14</district>
        <sponsorshipDate>2017-03-22</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>R000580</bioguideId>
        <middleName>J.</middleName>
        <identifiers>
          <bioguideId>R000580</bioguideId>
          <lisID>1848</lisID>
          <gpoId>7926</gpoId>
        </identifiers>
        <state>IL</state>
        <firstName>Peter</firstName>
        <fullName>Rep. Roskam, Peter J. [R-IL-6]</fullName>
        <party>R</party>
        <lastName>Roskam</lastName>
        <district>6</district>
        <sponsorshipDate>2017-03-22</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>C001077</bioguideId>
        <middleName />
        <identifiers>
          <bioguideId>C001077</bioguideId>
          <lisID>1912</lisID>
          <gpoId>7864</gpoId>
        </identifiers>
        <state>CO</state>
        <firstName>Mike</firstName>
        <fullName>Rep. Coffman, Mike [R-CO-6]</fullName>
        <party>R</party>
        <lastName>Coffman</lastName>
        <district>6</district>
        <sponsorshipDate>2017-04-27</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>C001106</bioguideId>
        <middleName>A.</middleName>
        <identifiers>
          <bioguideId>C001106</bioguideId>
          <lisID>2266</lisID>
          <gpoId />
        </identifiers>
        <state>PA</state>
        <firstName>Ryan</firstName>
        <fullName>Rep. Costello, Ryan A. [R-PA-6]</fullName>
        <party>R</party>
        <lastName>Costello</lastName>
        <district>6</district>
        <sponsorshipDate>2017-04-27</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>C001090</bioguideId>
        <middleName />
        <identifiers>
          <lisID>2159</lisID>
          <bioguideId>C001090</bioguideId>
          <gpoId />
        </identifiers>
        <state>PA</state>
        <firstName>Matt</firstName>
        <fullName>Rep. Cartwright, Matt [D-PA-17]</fullName>
        <party>D</party>
        <lastName>Cartwright</lastName>
        <district>17</district>
        <sponsorshipDate>2017-05-30</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>L000263</bioguideId>
        <middleName>M.</middleName>
        <identifiers>
          <lisID>683</lisID>
          <bioguideId>L000263</bioguideId>
          <gpoId>7997</gpoId>
        </identifiers>
        <state>MI</state>
        <firstName>SANDER</firstName>
        <fullName>Rep. Levin, Sander M. [D-MI-9]</fullName>
        <party>D</party>
        <lastName>LEVIN</lastName>
        <district>9</district>
        <sponsorshipDate>2017-06-12</sponsorshipDate>
      </item>
      <item>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <bioguideId>G000580</bioguideId>
        <middleName>A.</middleName>
        <identifiers>
          <lisID>2353</lisID>
          <bioguideId>G000580</bioguideId>
          <gpoId />
        </identifiers>
        <state>VA</state>
        <firstName>Thomas</firstName>
        <fullName>Rep. Garrett, Thomas A., Jr. [R-VA-5]</fullName>
        <party>R</party>
        <lastName>Garrett</lastName>
        <district>5</district>
        <sponsorshipDate>2017-09-12</sponsorshipDate>
      </item>
    </cosponsors>
    <congress>115</congress>
    <recordedVotes />
    <updateDate>2017-09-13T07:15:36Z</updateDate>
    <latestAction>
      <text>Referred to the Subcommittee on Europe, Eurasia, and Emerging Threats.</text>
      <links />
      <actionDate>2017-02-16</actionDate>
    </latestAction>
    <summaries>
      <billSummaries>
        <item>
          <name>Introduced in House</name>
          <actionDate>2017-01-12</actionDate>
          <actionDesc>Introduced in House</actionDesc>
          <versionCode>00</versionCode>
          <lastSummaryUpdateDate>2017-02-07T16:18:11Z</lastSummaryUpdateDate>
          <updateDate>2017-01-12T05:00:00Z</updateDate>
          <text><![CDATA[
Crimea Annexation Non-recognition Act

 This bill states that is U.S. policy to not recognize the de jure or de facto sovereignty of the Russian Federation over Crimea, its airspace, or its territorial waters.

The bill prohibits any federal agency from taking any action or extending any assistance that recognizes or implies recognition of the de jure or de facto sovereignty of the Russian Federation over Crimea, its airspace, or its territorial waters.

The President may waive such prohibitions if such a waiver is vital to U.S. national security interests.
]]></text>
        </item>
      </billSummaries>
    </summaries>
    <createDate>2017-01-13T04:55:31Z</createDate>
    <committeeReports />
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. CONNOLLY:H.R. 463.Congress has the power to enact this legislation pursuantto the following:This bill is introduced pursuant to the authoritydelineated in Article I, Section I, which includes an impliedpower for the Congress to regulate the conduct of the UnitedStates with respect to foreign affairs.[Page H471]
]]></constitutionalAuthorityStatementText>
    <policyArea>
      <name>International Affairs</name>
    </policyArea>
    <amendments />
    <subjects>
      <billSubjects>
        <legislativeSubjects>
          <item>
            <name>Europe</name>
          </item>
          <item>
            <name>Foreign aid and international relief</name>
          </item>
          <item>
            <name>Russia</name>
          </item>
          <item>
            <name>Sovereignty, recognition, national governance and status</name>
          </item>
          <item>
            <name>Ukraine</name>
          </item>
        </legislativeSubjects>
        <policyArea>
          <name>International Affairs</name>
        </policyArea>
      </billSubjects>
    </subjects>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
&nbsp

F.A.Q / TANYA JAWAB

                        Beberapa pertanyaan dan jawaban seputar Kantin Sekolah Elektronik.

Home /

F.A.Q / Tanya Jawab

SEPUTAR KANTIN SEKOLAH ELETRONIK

Apa itu Kantin Sekolah Elektronik ?

Kantin Sekolah Elektronik adalah sistem yang di bangun untuk memudahkan produsen menghasilkan PJAS (Panganan Jajan Anak Sekolah) yang bermutu. Sistem PERTAMA dan SATU-SATUNYA di Indonesia yang menjual PJAS secara online dengan layanan antar (delivery service) ke sekolah sekolah. Menggunakan bahan baku bebas dari bahan yang berbahaya bagi tubuh manusia dengan proses yang hegienis.

Kenapa ada Kantin Sekolah elektronik ?

Kegelisahan akan banyaknya makanan dan jajanan di kantin  siswa yang menggunakan bahan terlarang, bahan pengawet, bahan tambahan pangan berlebihan dan makanan yang memiliki nilai gizi buruk. Disisi Lain tidak ada sistem yang membantu semua pihak turut mensukseskan  kantin sehat di sekolah.

Panganan Jajan Anak Sekolah yang sehat dapat mendorong terciptanya generasi muda yang andal dan berkualitas. "Sarapan atau jajanan sehat melatih disiplin anak dan otak menjadi encer, sehingga daya serap anak saat belajar juga tinggi.

Apa alasan bergabung dengan Kantin Sekolah Elektronik ?

Ada beberapa alasan bila anda bergabung dengan KSE

MENARIK - Info nutrisi disetiap menu sarapan.

TERJADWAL - Menu sarapan dapat diprogram sampai dengan satu bulan ke depan.

TERJAMIN - Didukung oleh pakar dan professional.

AMAN - Pembelian tanpa menggunakan uang tunai.

MUDAH - Pembelian dengan ponsel, unduh melalui playstore (gratis).

CEPAT - Dengan barcode, tidak perlu antri untuk mengambil pesanan.

NYAMAN - Siswa dapat menikmati waktu sarapan lebih panjang.

LANGSUNG - Bermanfaat untuk kesehatan peserta didik.

PRAKTIS - Menu kantin sekolahmu, langusng di unduh diwebsite.

MENARIK - Info nutrisi disetiap produk yang di konsumsi.

SEHAT - Semua menu makanan disupervisi oleh ahli gizi setiap hari.

Apa yang membedakan Kantin Sekolah Konvensional (kantin sekarang) di banding dengan Kantin Sekolah Elektronik ?

Kantin Sekolah elektronik sangat berbeda dengan kantin konvensional saat ini,

kantin konvensional menjual makanan & minuman dengan cara manual ( produk ada di tempat) sehingga bila barang tidak laku, di jual lagi dan lagi, sehingga menurunkan kualitas makanan. sedangkan KSE menjual makanan setelah ada order masuk, jadi  makanan lebih bermutu,sehat, bersih dan aman karena di sesuaikan dengan jenis & jumlah orderan (tidak ada sisa)

Kantin konvensional tidak menampilkan info nutrisi, sedangkan di KSE ditampilkan kandungan nutrisi sehingga orang tua / siswa mengetahui manfaat dari makanan  / minuman yang di konsumsi.

KSE pemesanan menggunakan teknologi modern (gadget) sedangkan Kantin konvensional belum menggunakannya.

KSE dalam pembayaran menggunakan menggunakan non tunai (deposit) sehingga siswa tidak kwatir dan orang tua bisa memantau anaknya apa saja yang di konsumsi tiap hari bahkan sebulan.

KSE di dukung oleh tenaga ahli gizi yang kompeten.

Apa keuntungan gabung dengan KSE ?

Bagi kantin sekolah konvensional yang sudah beroperasi / berjualan di sekolah saat ini bisa bergabung dengan Kantin Sekolah Elektronik secara gratis dan mendapat fasilitas berupa edukasi dan bimbingan / pelatihan dari Tim IT KSE dan ahli gizi.

Kantin konvensional bisa memasukkan menu secara online dan bisa di akses oleh sekolah-sekolah lain, sehingga bisa memperluas pasar.

Bagaimana system KSE bekerja ?

order / pesanan dari siswa akan di teruskan ke server cloud, ke dapur dan ke oulet KSE, Kantin anda bisa mendistibusikan / mendapat order makanan / minuman dari sekolah lain yang terdekat dengan lokasi anda, sehingga bila selama ini hanya bisa menjual makanan di satu lokasi, bergabung dengan KSE bisa lebih dari satu lokasi order. hal ini tentunya akan menambah keuntungan.

Bila sudah bergabung apa yang perlu dipersiapkan ?

bergabung sebagai siswa / member KSE

hal perlu disiapkan adalah bagi siswa SMP dan SMA bila sudah tergabung dengan KSE dan sudah mempunyai kartu dan sudah deposit, siswa cukup mendowload aplikasi KSE secara gratis di playstore, bagi siswa SD pemesanan bisa di lakukan orang tua.

Bergabung sebagai Pengelola kantin

mempersiapkan gadget dan mendowload aplikasi KSE di playstore secara gratis, selanjutnya sudah siap menerima orderan.

Bergabung sebagai Pemasok

siap menerima order sebagai pemasok bahan baku makanan dan minuman untuk dapur-dapur seluruh Indonesia

Berapa biaya pembuatan kartu Kantin Sekolah Elektronik ?

biaya untuk mencetak kartu gratis, masa berlaku kartu 5 tahun untuk mahaiswa, 3 tahun utk SMP dan SMA, 6 tahun untuk SD

Apakah dengan hadirnya KSE ini, Kantin yang sudah berjalan saat ini masih bisa terus jualan ?

sangat bisa, justru dengan hadirnya KSE ini dapat melengkapi yang sudah ada, bisa bersinergi , bisa memberikan edukasi sehingga secara bertahap kantin - kantin semua bisa memenuhi standart, karena MEA sebentar lagi bergulir pastinya akan lebih sulit bersaing bila kantin-kantin saat ini tidak berbenah.

Saya UMKM kuliner, apakah bisa gabung juga di KSE ?

sangat bisa bergabung, karena semuanya bisa bergabung termasuk PKL kuliner, warung, catering, usaha rumahan dll, caranya wajib mempunyai produk yang baik layak konsumsi, daftarkan diri anda, selanjutnya KSE akan memberikan pendamping utk ahli gizi yang kompeten.

Saya tertarik sebagai investor/mitra, apakah bisa bergabung ?

Anda bisa bekerjasama dengan kami, misal pembelian hardware, pencetakan kartu dll, semua bisa dikerjasamakan, segera hubungi kami.

Apakah program KSE berlaku di seluruh Indonesia ?

iya, betul sekali, sistem KSE menyeluruh bisa di pakai di sekolah-sekolah seluruh Indonesia

Hal-hal apa yang perlu di persiapkan pihak sekolah, supaya KSE bisa segera di implementasikan di sekolah - sekolah ?

mensosialisasikan program KSE ke siswa, walimurid, kantin dan guru

memberikan data siswa untuk di masukkan ke system KSE sesuai format yang sudah ada di website

memberikan data kantin/dapur saat ini untuk dimasukkan ke system KSE sesuai format yang sudah ada di website

Apakah orang tua siswa bisa mengkonsumsi PJAS yang ada di KSE ?

bisa, siswa bisa melakukan pemesanan lebih dari satu dan bisa memilih beragam jenis PJAS yang disediakan di sistem KSE, sehingga bisa di bawa pulang untuk di konsumsi orang tua.

Seberapa amankah menggunakan sistem ini ?

Sistem KSE menggunakan https: (security) setingkat perbankan sehingga sudah teruji aman dan lancar.

redpajama_set_name: RedPajamaGithub


text:
package org.apache.hadoop.hdfs.server.namenode;

import java.io.IOException;

import org.apache.hadoop.hdfs.protocol.FSConstants;
import org.apache.hadoop.hdfs.protocol.FSConstants.UpgradeAction;
import org.apache.hadoop.hdfs.server.common.HdfsConstants;
import org.apache.hadoop.hdfs.server.common.IncorrectVersionException;
import org.apache.hadoop.hdfs.server.common.UpgradeManager;
import org.apache.hadoop.hdfs.server.common.UpgradeStatusReport;
import org.apache.hadoop.hdfs.server.protocol.UpgradeCommand;

/**
 * Upgrade manager for name-nodes.
 *
 * Distributed upgrades for a name-node starts when the safe mode conditions
 * are met and the name-node is about to exit it.
 * At this point the name-node enters manual safe mode which will remain
 * on until the upgrade is completed.
 * After that the name-nodes processes upgrade commands from data-nodes
 * and updates its status.
 */
class UpgradeManagerNamenode extends UpgradeManager {
  public HdfsConstants.NodeType getType() {
    return HdfsConstants.NodeType.NAME_NODE;
  }

  private final FSNamesystem namesystem;

  UpgradeManagerNamenode(FSNamesystem namesystem) {
    this.namesystem = namesystem;
  }

  /**
   * Start distributed upgrade.
   * Instantiates distributed upgrade objects.
   *
   * @return true if distributed upgrade is required or false otherwise
   * @throws IOException
   */
  public synchronized boolean startUpgrade() throws IOException {
    if(!upgradeState) {
      initializeUpgrade();
      if(!upgradeState) return false;
      // write new upgrade state into disk
      namesystem.getFSImage().writeAll();
    }
    assert currentUpgrades != null : "currentUpgrades is null";
    this.broadcastCommand = currentUpgrades.first().startUpgrade();
    NameNode.LOG.info("\n   Distributed upgrade for NameNode version "
        + getUpgradeVersion() + " to current LV "
        + FSConstants.LAYOUT_VERSION + " is started.");
    return true;
  }

  synchronized UpgradeCommand processUpgradeCommand(UpgradeCommand command
                                                    ) throws IOException {
    NameNode.LOG.debug("\n   Distributed upgrade for NameNode version "
        + getUpgradeVersion() + " to current LV "
        + FSConstants.LAYOUT_VERSION + " is processing upgrade command: "
        + command.getAction() + " status = " + getUpgradeStatus() + "%");
    if(currentUpgrades == null) {
      NameNode.LOG.info("Ignoring upgrade command: "
          + command.getAction() + " version " + command.getVersion()
          + ". No distributed upgrades are currently running on the NameNode");
      return null;
    }
    UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
    if(command.getVersion() != curUO.getVersion())
      throw new IncorrectVersionException(command.getVersion(),
          "UpgradeCommand", curUO.getVersion());
    UpgradeCommand reply = curUO.processUpgradeCommand(command);
    if(curUO.getUpgradeStatus() < 100) {
      return reply;
    }
    // current upgrade is done
    curUO.completeUpgrade();
    NameNode.LOG.info("\n   Distributed upgrade for NameNode version "
        + curUO.getVersion() + " to current LV "
        + FSConstants.LAYOUT_VERSION + " is complete.");
    // proceede with the next one
    currentUpgrades.remove(curUO);
    if(currentUpgrades.isEmpty()) { // all upgrades are done
      completeUpgrade();
    } else {  // start next upgrade
      curUO = (UpgradeObjectNamenode)currentUpgrades.first();
      this.broadcastCommand = curUO.startUpgrade();
    }
    return reply;
  }

  public synchronized void completeUpgrade() throws IOException {
    // set and write new upgrade state into disk
    setUpgradeState(false, FSConstants.LAYOUT_VERSION);
    namesystem.getFSImage().writeAll();
    currentUpgrades = null;
    broadcastCommand = null;
    namesystem.leaveSafeMode(false);
  }

  UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action
                                                ) throws IOException {
    boolean isFinalized = false;
    if(currentUpgrades == null) { // no upgrades are in progress
      FSImage fsimage = namesystem.getFSImage();
      isFinalized = fsimage.isUpgradeFinalized();
      if(isFinalized) // upgrade is finalized
        return null;  // nothing to report
      return new UpgradeStatusReport(fsimage.getLayoutVersion(),
                                     (short)101, isFinalized);
    }
    UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first();
    boolean details = false;
    switch(action) {
    case GET_STATUS:
      break;
    case DETAILED_STATUS:
      details = true;
      break;
    case FORCE_PROCEED:
      curUO.forceProceed();
    }
    return curUO.getUpgradeStatusReport(details);
  }
}


text:
/*
---

name: Event.CSS3

description: Provides CSS3 events.

license: MIT-style license.

authors:
	- Jean-Philippe Dery (jeanphilippe.dery@gmail.com)

requires:
	- Custom-Event/Element.defineCustomEvent

provides:
	- Event.CSS3

...
*/

(function() {
	var dummyStyle = document.createElement('div').style,
		vendor = (function () {
			var vendors = 't,webkitT,MozT,msT,OT'.split(','),
				t,
				i = 0,
				l = vendors.length;

			for ( ; i < l; i++ ) {
				t = vendors[i] + 'ransform';
				if ( t in dummyStyle ) {
					return vendors[i].substr(0, vendors[i].length - 1);
				}
			}

			return false;
		})();

	function prefixStyle (style) {
		if ( vendor === '' ) {
			return style.toLowerCase();
		}

		style = style.charAt(0).toUpperCase() + style.substr(1);
		return vendor + style;
	}

var a = prefixStyle('AnimationEnd');
var t = prefixStyle('TransitionEnd');

Element.NativeEvents[a] = 2;
Element.NativeEvents[t] = 2;
Element.Events['transitionend'] = { base: t, onAdd: function(){}, onRemove: function(){} };
Element.Events['animationend'] = { base: a, onAdd: function(){}, onRemove: function(){} };

Element.defineCustomEvent('owntransitionend', {
	base: 'transitionend',
	condition: function(e) {
		e.stop();
		return e.target === this;
	}
});

Element.defineCustomEvent('ownanimationend', {
	base: 'animationend',
	condition: function(e) {
		e.stop();
		return e.target === this;
	}
})

})();


text:
from . import base
from . import mixins

from datetime import date
from .. import cleaver

class TransformedRecord(
        mixins.GenericCompensationMixin,
        mixins.GenericDepartmentMixin, mixins.GenericIdentifierMixin,
        mixins.GenericJobTitleMixin, mixins.GenericPersonMixin,
        mixins.MembershipMixin, mixins.OrganizationMixin, mixins.PostMixin,
        mixins.RaceMixin, mixins.LinkMixin, base.BaseTransformedRecord):

    MAP = {
        'full_name': 'FNAME',
        'department': 'DEPT',
        'job_title': 'TITLE',
        'hire_date': 'HIREDATE',
        'compensation': 'GROSS',
        'employee_type': 'FULL_PART',
        'gender': 'GENDER',
        'race': 'ETHNICITY',
    }

    ORGANIZATION_NAME = 'Midwestern State University'

    ORGANIZATION_CLASSIFICATION = 'University'

    DATE_PROVIDED = date(2016, 5, 2)

    URL = ('http://raw.texastribune.org.s3.amazonaws.com/'
           'midwestern_state_university/salaries/2016-05/'
           'midwestern.xlsx')

    # There are some people listed as Other status, because they retired in 2015, which the data represents
    REJECT_ALL_IF_INVALID_RECORD_EXISTS = False

    @property
    def is_valid(self):
        # Adjust to return False on invalid fields.  For example:
        return self.employee_type.strip() != 'O'

    @property
    def compensation_type(self):
        emptype = self.get_mapped_value('employee_type')

        if emptype == 'P':
            return 'PT'
        else:
            return 'FT'

    @property
    def description(self):
        emptype = self.get_mapped_value('employee_type')
        title = self.get_mapped_value('job_title')

        if emptype == 'P':
            return 'Part-time 2015 gross annual salary'

        if emptype == 'F':
            if title == 'President':
                return 'Budgeted annual salary'
            else:
                return '2015 gross annual salary'

    @property
    def person(self):
        name = self.get_name()
        r = {
            'family_name': name.last,
            'given_name': name.first,
            'additional_name': name.middle,
            'name': unicode(name),
            'gender': self.gender.strip()
        }

        return r

    def get_name(self):
        return cleaver.EmployeeNameCleaver(
            self.get_mapped_value('full_name')).parse()

transform = base.transform_factory(TransformedRecord)


text:
Creates a _SparseColumn by combining sparse_id_column with a weight column.

Example:

  ```python
  sparse_feature = sparse_column_with_hash_bucket(column_name="sparse_col",
                                                  hash_bucket_size=1000)
  weighted_feature = weighted_sparse_column(sparse_id_column=sparse_feature,
                                            weight_column_name="weights_col")
  ```

  This configuration assumes that input dictionary of model contains the
  following two items:
    * (key="sparse_col", value=sparse_tensor) where sparse_tensor is
      a SparseTensor.
    * (key="weights_col", value=weights_tensor) where weights_tensor
      is a SparseTensor.
   Following are assumed to be true:
     * sparse_tensor.indices = weights_tensor.indices
     * sparse_tensor.dense_shape = weights_tensor.dense_shape

##### Args:

*  <b>`sparse_id_column`</b>: A `_SparseColumn` which is created by
    `sparse_column_with_*` functions.
*  <b>`weight_column_name`</b>: A string defining a sparse column name which represents
    weight or value of the corresponding sparse id feature.
*  <b>`dtype`</b>: Type of weights, such as `tf.float32`

##### Returns:

  A _WeightedSparseColumn composed of two sparse features: one represents id,
  the other represents weight (value) of the id feature in that example.

##### Raises:

*  <b>`ValueError`</b>: if dtype is not convertible to float.


text:
package tasks

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import java.util.Calendar

class TaskScheduler {

  def perform[T, R](task: Task[T, R], argument: T): Future[R] = {
    val taskResult = Future {
      task.unitOfWork.apply(argument)
    }

    taskResult.onComplete { case _ =>
      println(s"[${Calendar.getInstance().getTime()}] Completed: ${task.name}($argument)")
    }

    taskResult
  }

}


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

import cn.ucloud.sdk.vo.UcloudOutVo;

/**
 *
 * @author Jack shen<37393993@qq.com>
 *
 */
public class CreateUHostInstanceSnapshotOutVo extends UcloudOutVo {
    private String uHostId;
    private String snapshotName;

    public String getuHostId() {
        return uHostId;
    }

    public void setuHostId(String uHostId) {
        this.uHostId = uHostId;
    }

    public String getSnapshotName() {
        return snapshotName;
    }

    public void setSnapshotName(String snapshotName) {
        this.snapshotName = snapshotName;
    }

}


text:
try:
    import urllib.request as urllib_request
    import urllib.error as urllib_error
    import io
except ImportError:
    import urllib2 as urllib_request
    import urllib2 as urllib_error
import json
from ssl import SSLError
import socket
import sys

from .api import TwitterCall, wrap_response

class TwitterJSONIter(object):

    def __init__(self, handle, uri, arg_data, block=True):
        self.decoder = json.JSONDecoder()
        self.handle = handle
        self.buf = b""
        self.block = block

    def __iter__(self):
        if sys.version_info >= (3, 0):
            sock = self.handle.fp.raw._sock
        else:
            sock = self.handle.fp._sock.fp._sock
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
        if not self.block:
            sock.setblocking(False)
        while True:
            try:
                utf8_buf = self.buf.decode('utf8').lstrip()
                res, ptr = self.decoder.raw_decode(utf8_buf)
                self.buf = utf8_buf[ptr:].encode('utf8')
                yield wrap_response(res, self.handle.headers)
                continue
            except ValueError as e:
                if self.block:
                    pass
                else:
                    yield None
            except urllib_error.HTTPError as e:
                raise TwitterHTTPError(e, uri, self.format, arg_data)
            # this is a non-blocking read (ie, it will return if any data is available)
            try:
                self.buf += sock.recv(1024)
            except SSLError as e:
                if (not self.block) and (e.errno == 2):
                    # Apparently this means there was nothing in the socket buf
                    pass
                else:
                    raise

def handle_stream_response(req, uri, arg_data, block):
    handle = urllib_request.urlopen(req,)
    return iter(TwitterJSONIter(handle, uri, arg_data, block))

class TwitterStreamCall(TwitterCall):
    def _handle_response(self, req, uri, arg_data, _timeout=None):
        return handle_stream_response(req, uri, arg_data, block=True)

class TwitterStreamCallNonBlocking(TwitterCall):
    def _handle_response(self, req, uri, arg_data, _timeout=None):
        return handle_stream_response(req, uri, arg_data, block=False)

class TwitterStream(TwitterStreamCall):
    """
    The TwitterStream object is an interface to the Twitter Stream API
    (stream.twitter.com). This can be used pretty much the same as the
    Twitter class except the result of calling a method will be an
    iterator that yields objects decoded from the stream. For
    example::

        twitter_stream = TwitterStream(auth=OAuth(...))
        iterator = twitter_stream.statuses.sample()

        for tweet in iterator:
            ...do something with this tweet...

    The iterator will yield tweets forever and ever (until the stream
    breaks at which point it raises a TwitterHTTPError.)

    The `block` parameter controls if the stream is blocking. Default
    is blocking (True). When set to False, the iterator will
    occasionally yield None when there is no available message.
    """
    def __init__(
        self, domain="stream.twitter.com", secure=True, auth=None,
        api_version='1.1', block=True):
        uriparts = ()
        uriparts += (str(api_version),)

        if block:
            call_cls = TwitterStreamCall
        else:
            call_cls = TwitterStreamCallNonBlocking

        TwitterStreamCall.__init__(
            self, auth=auth, format="json", domain=domain,
            callable_cls=call_cls,
            secure=secure, uriparts=uriparts)


text:
#include "tbackgroundprocess.h"
#include <QMetaType>
#include <QObject>
#include <TBackgroundProcessHandler>
#include <TWebApplication>

/*!
  \class TBackgroundProcess
  \brief The TBackgroundProcess class is used to start external programs in background.
*/

TBackgroundProcess::TBackgroundProcess(QObject *parent) :
    QProcess(parent)
{
    moveToThread(Tf::app()->databaseContextMainThread());
}

void TBackgroundProcess::connectToSlots(TBackgroundProcessHandler *handler)
{
    if (handler) {
        QObject::connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), handler, SLOT(handleFinished(int, QProcess::ExitStatus)));
        QObject::connect(this, SIGNAL(readyReadStandardError()), handler, SLOT(handleReadyReadStandardError()));
        QObject::connect(this, SIGNAL(readyReadStandardOutput()), handler, SLOT(handleReadyReadStandardOutput()));
        QObject::connect(this, SIGNAL(started()), handler, SLOT(handleStarted()));
        QObject::connect(this, SIGNAL(stateChanged(QProcess::ProcessState)), handler, SLOT(handleStateChanged(QProcess::ProcessState)));
#if QT_VERSION >= 0x050600
        QObject::connect(this, SIGNAL(errorOccurred(QProcess::ProcessError)), handler, SLOT(handleErrorOccurred(QProcess::ProcessError)));
#endif
        QObject::connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), handler, SLOT(deleteAutoDeleteHandler()));
        QObject::connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(handleFinished()), Qt::QueuedConnection);

        handler->_process = this;
    }
}

void TBackgroundProcess::start(const QString &program, const QStringList &arguments, OpenMode mode, TBackgroundProcessHandler *handler)
{
    connectToSlots(handler);
    QMetaObject::invokeMethod(this, "callStart", Qt::QueuedConnection,
        Q_ARG(QString, program),
        Q_ARG(QStringList, arguments),
        Q_ARG(int, mode));
}

void TBackgroundProcess::start(const QString &command, OpenMode mode, TBackgroundProcessHandler *handler)
{
    connectToSlots(handler);
    QMetaObject::invokeMethod(this, "callStart", Qt::QueuedConnection,
        Q_ARG(QString, command),
        Q_ARG(QStringList, QStringList()),
        Q_ARG(int, mode));
}

void TBackgroundProcess::start(OpenMode mode, TBackgroundProcessHandler *handler)
{
    connectToSlots(handler);
    QMetaObject::invokeMethod(this, "callStart", Qt::QueuedConnection,
        Q_ARG(QString, QString()),
        Q_ARG(QStringList, QStringList()),
        Q_ARG(int, mode));
}

bool TBackgroundProcess::autoDelete() const
{
    return _autoDelete;
}

void TBackgroundProcess::setAutoDelete(bool autoDelete)
{
    _autoDelete = autoDelete;
}

void TBackgroundProcess::handleFinished()
{
    if (_autoDelete) {
        deleteLater();
    }
}

void TBackgroundProcess::callStart(const QString &program, const QStringList &arguments, int mode)
{
    if (program.isEmpty()) {
        QProcess::start((OpenMode)mode);
    } else {
        QProcess::start(program, arguments, (OpenMode)mode);
    }
}

// RegisterMetaType - QProcess::ProcessState
Q_DECLARE_METATYPE(QProcess::ProcessState)

class StaticQProcessProcessStateRegisterMetaType {
public:
    StaticQProcessProcessStateRegisterMetaType() { qRegisterMetaType<QProcess::ProcessState>(); }
};
static StaticQProcessProcessStateRegisterMetaType _staticQProcessProcessStateRegisterMetaType;


text:
module Arts
  include ActionView::Helpers::PrototypeHelper
  include ActionView::Helpers::ScriptaculousHelper
  include ActionView::Helpers::JavaScriptHelper

  include ActionView::Helpers::UrlHelper
  include ActionView::Helpers::TagHelper

  def assert_rjs(action, *args, &block)
    case action.to_sym
      when :insert_html
        return assert_rjs_insert_html(*args)
      when :replace_html
        return assert_rjs_replace_html(*args)
      when :replace
        return assert_rjs_replace(*args)
      else
        assert lined_response.include?(create_generator.send(action, *args, &block)),
               generic_error(action, args)
    end
  end

  def assert_rjs_insert_html(*args)
    position = args.shift
    item_id = args.shift
    content = create_generator.send(:arguments_for_call, args)

    unless content.blank?
      assert lined_response.include?("new Insertion.#{position.to_s.camelize}(\"#{item_id}\", #{content});"),
             "No insert_html call found for \n" +
             "     position: '#{position}' id: '#{item_id}' \ncontent: \n" +
             "#{content}\n" +
             "in response:\n#{lined_response}"
    else
      assert_match Regexp.new("new Insertion\.#{position.to_s.camelize}(.*#{item_id}.*,.*?);"),
                   @response.body
    end
  end

  def assert_rjs_replace_html(*args)
    div = args.shift
    content = create_generator.send(:arguments_for_call, args)

    unless content.blank?
      assert lined_response.include?("Element.update(\"#{div}\", #{content});"),
             "No replace_html call found on div: '#{div}' and content: \n#{content}\n" +
             "in response:\n#{lined_response}"
    else
      assert_match Regexp.new("Element.update(.*#{div}.*,.*?);"), @response.body
    end
  end

  def assert_rjs_replace(*args)
    div = args.shift
    content = create_generator.send(:arguments_for_call, args)

    unless content.blank?
      assert lined_response.include?("Element.replace(\"#{div}\", #{content});"),
             "No replace call found on div: '#{div}' and content: \n#{content}\n" +
             "in response:\n#{lined_response}"
    else
      assert_match Regexp.new("Element.replace(.*#{div}.*,.*?);"), @response.body
    end
  end

  protected

  def lined_response
    @response.body.split("\n")
  end

  def create_generator
    block = Proc.new { |*args| yield *args if block_given? }
    JavaScriptGenerator.new self, &block
  end

  def generic_error(action, args)
    "#{action} with args [#{args.join(" ")}] does not show up in response:\n#{lined_response}"
  end
end


text:
package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Queue;

import javax.annotation.Nullable;

/**
 * This class contains static utility methods that operate on or return objects
 * of type {@link Iterator}. Except as noted, each method has a corresponding
 * {@link Iterable}-based method in the {@link Iterables} class.
 *
 *
Performance notes: Unless otherwise noted, all of the iterators
 * produced in this class are lazy, which means that they only advance
 * the backing iteration when absolutely necessary.
 *
 * @author Kevin Bourrillion
 * @author Jared Levy
 * @since 2.0 (imported from Google Collections Library)
 */
@GwtCompatible(emulated = true)
public final class Iterators {
  private Iterators() {}

  static final UnmodifiableIterator<Object> EMPTY_ITERATOR
      = new UnmodifiableIterator<Object>() {
        @Override
        public boolean hasNext() {
          return false;
        }
        @Override
        public Object next() {
          throw new NoSuchElementException();
        }
      };

  /**
   * Returns the empty iterator.
   *
   *
The {@link Iterable} equivalent of this method is {@link
   * ImmutableSet#of()}.
   */
  // Casting to any type is safe since there are no actual elements.
  @SuppressWarnings("unchecked")
  public static <T> UnmodifiableIterator<T> emptyIterator() {
    return (UnmodifiableIterator<T>) EMPTY_ITERATOR;
  }

  private static final Iterator<Object> EMPTY_MODIFIABLE_ITERATOR =
      new Iterator<Object>() {
        @Override public boolean hasNext() {
          return false;
        }

        @Override public Object next() {
          throw new NoSuchElementException();
        }

        @Override public void remove() {
          throw new IllegalStateException();
        }
      };

  /**
   * Returns the empty {@code Iterator} that throws
   * {@link IllegalStateException} instead of
   * {@link UnsupportedOperationException} on a call to
   * {@link Iterator#remove()}.
   */
  // Casting to any type is safe since there are no actual elements.
  @SuppressWarnings("unchecked")
  static <T> Iterator<T> emptyModifiableIterator() {
    return (Iterator<T>) EMPTY_MODIFIABLE_ITERATOR;
  }

  /** Returns an unmodifiable view of {@code iterator}. */
  public static <T> UnmodifiableIterator<T> unmodifiableIterator(
      final Iterator<T> iterator) {
    checkNotNull(iterator);
    if (iterator instanceof UnmodifiableIterator) {
      return (UnmodifiableIterator<T>) iterator;
    }
    return new UnmodifiableIterator<T>() {
      @Override
      public boolean hasNext() {
        return iterator.hasNext();
      }
      @Override
      public T next() {
        return iterator.next();
      }
    };
  }

  /**
   * Simply returns its argument.
   *
   * @deprecated no need to use this
   * @since 10.0
   */
  @Deprecated public static <T> UnmodifiableIterator<T> unmodifiableIterator(
      UnmodifiableIterator<T> iterator) {
    return checkNotNull(iterator);
  }

  /**
   * Returns the number of elements remaining in {@code iterator}. The iterator
   * will be left exhausted: its {@code hasNext()} method will return
   * {@code false}.
   */
  public static int size(Iterator<?> iterator) {
    int count = 0;
    while (iterator.hasNext()) {
      iterator.next();
      count++;
    }
    return count;
  }

  /**
   * Returns {@code true} if {@code iterator} contains {@code element}.
   */
  public static boolean contains(Iterator<?> iterator, @Nullable Object element)
  {
    if (element == null) {
      while (iterator.hasNext()) {
        if (iterator.next() == null) {
          return true;
        }
      }
    } else {
      while (iterator.hasNext()) {
        if (element.equals(iterator.next())) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * Traverses an iterator and removes every element that belongs to the
   * provided collection. The iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}.
   *
   * @param removeFrom the iterator to (potentially) remove elements from
   * @param elementsToRemove the elements to remove
   * @return {@code true} if any element was removed from {@code iterator}
   */
  public static boolean removeAll(
      Iterator<?> removeFrom, Collection<?> elementsToRemove) {
    checkNotNull(elementsToRemove);
    boolean modified = false;
    while (removeFrom.hasNext()) {
      if (elementsToRemove.contains(removeFrom.next())) {
        removeFrom.remove();
        modified = true;
      }
    }
    return modified;
  }

  /**
   * Removes every element that satisfies the provided predicate from the
   * iterator. The iterator will be left exhausted: its {@code hasNext()}
   * method will return {@code false}.
   *
   * @param removeFrom the iterator to (potentially) remove elements from
   * @param predicate a predicate that determines whether an element should
   *     be removed
   * @return {@code true} if any elements were removed from the iterator
   * @since 2.0
   */
  public static <T> boolean removeIf(
      Iterator<T> removeFrom, Predicate<? super T> predicate) {
    checkNotNull(predicate);
    boolean modified = false;
    while (removeFrom.hasNext()) {
      if (predicate.apply(removeFrom.next())) {
        removeFrom.remove();
        modified = true;
      }
    }
    return modified;
  }

  /**
   * Traverses an iterator and removes every element that does not belong to the
   * provided collection. The iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}.
   *
   * @param removeFrom the iterator to (potentially) remove elements from
   * @param elementsToRetain the elements to retain
   * @return {@code true} if any element was removed from {@code iterator}
   */
  public static boolean retainAll(
      Iterator<?> removeFrom, Collection<?> elementsToRetain) {
    checkNotNull(elementsToRetain);
    boolean modified = false;
    while (removeFrom.hasNext()) {
      if (!elementsToRetain.contains(removeFrom.next())) {
        removeFrom.remove();
        modified = true;
      }
    }
    return modified;
  }

  /**
   * Determines whether two iterators contain equal elements in the same order.
   * More specifically, this method returns {@code true} if {@code iterator1}
   * and {@code iterator2} contain the same number of elements and every element
   * of {@code iterator1} is equal to the corresponding element of
   * {@code iterator2}.
   *
   *
Note that this will modify the supplied iterators, since they will have
   * been advanced some number of elements forward.
   */
  public static boolean elementsEqual(
      Iterator<?> iterator1, Iterator<?> iterator2) {
    while (iterator1.hasNext()) {
      if (!iterator2.hasNext()) {
        return false;
      }
      Object o1 = iterator1.next();
      Object o2 = iterator2.next();
      if (!Objects.equal(o1, o2)) {
        return false;
      }
    }
    return !iterator2.hasNext();
  }

  /**
   * Returns a string representation of {@code iterator}, with the format
   * {@code [e1, e2, ..., en]}. The iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}.
   */
  public static String toString(Iterator<?> iterator) {
    if (!iterator.hasNext()) {
      return "[]";
    }
    StringBuilder builder = new StringBuilder();
    builder.append('[').append(iterator.next());
    while (iterator.hasNext()) {
      builder.append(", ").append(iterator.next());
    }
    return builder.append(']').toString();
  }

  /**
   * Returns the single element contained in {@code iterator}.
   *
   * @throws NoSuchElementException if the iterator is empty
   * @throws IllegalArgumentException if the iterator contains multiple
   *     elements.  The state of the iterator is unspecified.
   */
  public static <T> T getOnlyElement(Iterator<T> iterator) {
    T first = iterator.next();
    if (!iterator.hasNext()) {
      return first;
    }

    StringBuilder sb = new StringBuilder();
    sb.append("expected one element but was: <" + first);
    for (int i = 0; i < 4 && iterator.hasNext(); i++) {
      sb.append(", " + iterator.next());
    }
    if (iterator.hasNext()) {
      sb.append(", ...");
    }
    sb.append('>');

    throw new IllegalArgumentException(sb.toString());
  }

  /**
   * Returns the single element contained in {@code iterator}, or {@code
   * defaultValue} if the iterator is empty.
   *
   * @throws IllegalArgumentException if the iterator contains multiple
   *     elements.  The state of the iterator is unspecified.
   */
  public static <T> T getOnlyElement(
      Iterator<T> iterator, @Nullable T defaultValue) {
    return iterator.hasNext() ? getOnlyElement(iterator) : defaultValue;
  }

  /**
   * Adds all elements in {@code iterator} to {@code collection}. The iterator
   * will be left exhausted: its {@code hasNext()} method will return
   * {@code false}.
   *
   * @return {@code true} if {@code collection} was modified as a result of this
   *         operation
   */
  public static <T> boolean addAll(
      Collection<T> addTo, Iterator<? extends T> iterator) {
    checkNotNull(addTo);
    boolean wasModified = false;
    while (iterator.hasNext()) {
      wasModified |= addTo.add(iterator.next());
    }
    return wasModified;
  }

  /**
   * Returns the number of elements in the specified iterator that equal the
   * specified object. The iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}.
   *
   * @see Collections#frequency
   */
  public static int frequency(Iterator<?> iterator, @Nullable Object element) {
    int result = 0;
    if (element == null) {
      while (iterator.hasNext()) {
        if (iterator.next() == null) {
          result++;
        }
      }
    } else {
      while (iterator.hasNext()) {
        if (element.equals(iterator.next())) {
          result++;
        }
      }
    }
    return result;
  }

  /**
   * Returns an iterator that cycles indefinitely over the elements of {@code
   * iterable}.
   *
   *
The returned iterator supports {@code remove()} if the provided iterator
   * does. After {@code remove()} is called, subsequent cycles omit the removed
   * element, which is no longer in {@code iterable}. The iterator's
   * {@code hasNext()} method returns {@code true} until {@code iterable} is
   * empty.
   *
   *
Warning: Typical uses of the resulting iterator may produce an
   * infinite loop. You should use an explicit {@code break} or be certain that
   * you will eventually remove all the elements.
   */
  public static <T> Iterator<T> cycle(final Iterable<T> iterable) {
    checkNotNull(iterable);
    return new Iterator<T>() {
      Iterator<T> iterator = emptyIterator();
      Iterator<T> removeFrom;

      @Override
      public boolean hasNext() {
        if (!iterator.hasNext()) {
          iterator = iterable.iterator();
        }
        return iterator.hasNext();
      }
      @Override
      public T next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        removeFrom = iterator;
        return iterator.next();
      }
      @Override
      public void remove() {
        checkState(removeFrom != null,
            "no calls to next() since last call to remove()");
        removeFrom.remove();
        removeFrom = null;
      }
    };
  }

  /**
   * Returns an iterator that cycles indefinitely over the provided elements.
   *
   *
The returned iterator supports {@code remove()} if the provided iterator
   * does. After {@code remove()} is called, subsequent cycles omit the removed
   * element, but {@code elements} does not change. The iterator's
   * {@code hasNext()} method returns {@code true} until all of the original
   * elements have been removed.
   *
   *
Warning: Typical uses of the resulting iterator may produce an
   * infinite loop. You should use an explicit {@code break} or be certain that
   * you will eventually remove all the elements.
   */
  public static <T> Iterator<T> cycle(T... elements) {
    return cycle(Lists.newArrayList(elements));
  }

  /**
   * Combines two iterators into a single iterator. The returned iterator
   * iterates across the elements in {@code a}, followed by the elements in
   * {@code b}. The source iterators are not polled until necessary.
   *
   *
The returned iterator supports {@code remove()} when the corresponding
   * input iterator supports it.
   */
  @SuppressWarnings("unchecked")
  public static <T> Iterator<T> concat(Iterator<? extends T> a,
      Iterator<? extends T> b) {
    checkNotNull(a);
    checkNotNull(b);
    return concat(Arrays.asList(a, b).iterator());
  }

  /**
   * Combines three iterators into a single iterator. The returned iterator
   * iterates across the elements in {@code a}, followed by the elements in
   * {@code b}, followed by the elements in {@code c}. The source iterators
   * are not polled until necessary.
   *
   *
The returned iterator supports {@code remove()} when the corresponding
   * input iterator supports it.
   */
  @SuppressWarnings("unchecked")
  public static <T> Iterator<T> concat(Iterator<? extends T> a,
      Iterator<? extends T> b, Iterator<? extends T> c) {
    checkNotNull(a);
    checkNotNull(b);
    checkNotNull(c);
    return concat(Arrays.asList(a, b, c).iterator());
  }

  /**
   * Combines four iterators into a single iterator. The returned iterator
   * iterates across the elements in {@code a}, followed by the elements in
   * {@code b}, followed by the elements in {@code c}, followed by the elements
   * in {@code d}. The source iterators are not polled until necessary.
   *
   *
The returned iterator supports {@code remove()} when the corresponding
   * input iterator supports it.
   */
  @SuppressWarnings("unchecked")
  public static <T> Iterator<T> concat(Iterator<? extends T> a,
      Iterator<? extends T> b, Iterator<? extends T> c,
      Iterator<? extends T> d) {
    checkNotNull(a);
    checkNotNull(b);
    checkNotNull(c);
    checkNotNull(d);
    return concat(Arrays.asList(a, b, c, d).iterator());
  }

  /**
   * Combines multiple iterators into a single iterator. The returned iterator
   * iterates across the elements of each iterator in {@code inputs}. The input
   * iterators are not polled until necessary.
   *
   *
The returned iterator supports {@code remove()} when the corresponding
   * input iterator supports it.
   *
   * @throws NullPointerException if any of the provided iterators is null
   */
  public static <T> Iterator<T> concat(Iterator<? extends T>... inputs) {
    return concat(ImmutableList.copyOf(inputs).iterator());
  }

  /**
   * Combines multiple iterators into a single iterator. The returned iterator
   * iterates across the elements of each iterator in {@code inputs}. The input
   * iterators are not polled until necessary.
   *
   *
The returned iterator supports {@code remove()} when the corresponding
   * input iterator supports it. The methods of the returned iterator may throw
   * {@code NullPointerException} if any of the input iterators is null.
   */
  public static <T> Iterator<T> concat(
      final Iterator<? extends Iterator<? extends T>> inputs) {
    checkNotNull(inputs);
    return new Iterator<T>() {
      Iterator<? extends T> current = emptyIterator();
      Iterator<? extends T> removeFrom;

      @Override
      public boolean hasNext() {
        // http://code.google.com/p/google-collections/issues/detail?id=151
        // current.hasNext() might be relatively expensive, worth minimizing.
        boolean currentHasNext;
        // checkNotNull eager for GWT
        // note: it must be here & not where 'current' is assigned,
        // because otherwise we'll have called inputs.next() before throwing
        // the first NPE, and the next time around we'll call inputs.next()
        // again, incorrectly moving beyond the error.
        while (!(currentHasNext = checkNotNull(current).hasNext())
            && inputs.hasNext()) {
          current = inputs.next();
        }
        return currentHasNext;
      }
      @Override
      public T next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        removeFrom = current;
        return current.next();
      }
      @Override
      public void remove() {
        checkState(removeFrom != null,
            "no calls to next() since last call to remove()");
        removeFrom.remove();
        removeFrom = null;
      }
    };
  }

  /**
   * Divides an iterator into unmodifiable sublists of the given size (the final
   * list may be smaller). For example, partitioning an iterator containing
   * {@code [a, b, c, d, e]} with a partition size of 3 yields {@code
   * [[a, b, c], [d, e]]} -- an outer iterator containing two inner lists of
   * three and two elements, all in the original order.
   *
   *
The returned lists implement {@link java.util.RandomAccess}.
   *
   * @param iterator the iterator to return a partitioned view of
   * @param size the desired size of each partition (the last may be smaller)
   * @return an iterator of immutable lists containing the elements of {@code
   *     iterator} divided into partitions
   * @throws IllegalArgumentException if {@code size} is nonpositive
   */
  public static <T> UnmodifiableIterator<List<T>> partition(
      Iterator<T> iterator, int size) {
    return partitionImpl(iterator, size, false);
  }

  /**
   * Divides an iterator into unmodifiable sublists of the given size, padding
   * the final iterator with null values if necessary. For example, partitioning
   * an iterator containing {@code [a, b, c, d, e]} with a partition size of 3
   * yields {@code [[a, b, c], [d, e, null]]} -- an outer iterator containing
   * two inner lists of three elements each, all in the original order.
   *
   *
The returned lists implement {@link java.util.RandomAccess}.
   *
   * @param iterator the iterator to return a partitioned view of
   * @param size the desired size of each partition
   * @return an iterator of immutable lists containing the elements of {@code
   *     iterator} divided into partitions (the final iterable may have
   *     trailing null elements)
   * @throws IllegalArgumentException if {@code size} is nonpositive
   */
  public static <T> UnmodifiableIterator<List<T>> paddedPartition(
      Iterator<T> iterator, int size) {
    return partitionImpl(iterator, size, true);
  }

  private static <T> UnmodifiableIterator<List<T>> partitionImpl(
      final Iterator<T> iterator, final int size, final boolean pad) {
    checkNotNull(iterator);
    checkArgument(size > 0);
    return new UnmodifiableIterator<List<T>>() {
      @Override
      public boolean hasNext() {
        return iterator.hasNext();
      }
      @Override
      public List<T> next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        Object[] array = new Object[size];
        int count = 0;
        for (; count < size && iterator.hasNext(); count++) {
          array[count] = iterator.next();
        }
        for (int i = count; i < size; i++) {
          array[i] = null; // for GWT
        }

        @SuppressWarnings("unchecked") // we only put Ts in it
        List<T> list = Collections.unmodifiableList(
            (List<T>) Arrays.asList(array));
        return (pad || count == size) ? list : list.subList(0, count);
      }
    };
  }

  /**
   * Returns the elements of {@code unfiltered} that satisfy a predicate.
   */
  public static <T> UnmodifiableIterator<T> filter(
      final Iterator<T> unfiltered, final Predicate<? super T> predicate) {
    checkNotNull(unfiltered);
    checkNotNull(predicate);
    return new AbstractIterator<T>() {
      @Override protected T computeNext() {
        while (unfiltered.hasNext()) {
          T element = unfiltered.next();
          if (predicate.apply(element)) {
            return element;
          }
        }
        return endOfData();
      }
    };
  }

  /**
   * Returns {@code true} if one or more elements returned by {@code iterator}
   * satisfy the given predicate.
   */
  public static <T> boolean any(
      Iterator<T> iterator, Predicate<? super T> predicate) {
    checkNotNull(predicate);
    while (iterator.hasNext()) {
      T element = iterator.next();
      if (predicate.apply(element)) {
        return true;
      }
    }
    return false;
  }

  /**
   * Returns {@code true} if every element returned by {@code iterator}
   * satisfies the given predicate. If {@code iterator} is empty, {@code true}
   * is returned.
   */
  public static <T> boolean all(
      Iterator<T> iterator, Predicate<? super T> predicate) {
    checkNotNull(predicate);
    while (iterator.hasNext()) {
      T element = iterator.next();
      if (!predicate.apply(element)) {
        return false;
      }
    }
    return true;
  }

  /**
   * Returns the first element in {@code iterator} that satisfies the given
   * predicate; use this method only when such an element is known to exist. If
   * no such element is found, the iterator will be left exhausted: its {@code
   * hasNext()} method will return {@code false}. If it is possible that
   * no element will match, use {@link #tryFind)} or {@link
   * #find(Iterator, Predicate, T)} instead.
   *
   * @throws NoSuchElementException if no element in {@code iterator} matches
   *     the given predicate
   */
  public static <T> T find(
      Iterator<T> iterator, Predicate<? super T> predicate) {
    return filter(iterator, predicate).next();
  }

  /**
   * Returns the first element in {@code iterator} that satisfies the given
   * predicate. If no such element is found, {@code defaultValue} will be
   * returned from this method and the iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}. Note that this can
   * usually be handled more naturally using {@code
   * tryFind(iterator, predicate).or(defaultValue)}.
   *
   * @since 7.0
   */
  public static <T> T find(Iterator<T> iterator, Predicate<? super T> predicate,
      @Nullable T defaultValue) {
    UnmodifiableIterator<T> filteredIterator = filter(iterator, predicate);
    return filteredIterator.hasNext() ? filteredIterator.next() : defaultValue;
  }

  /**
   * Returns an {@link Optional} containing the first element in {@code
   * iterator} that satisfies the given predicate, if such an element exists. If
   * no such element is found, an empty {@link Optional} will be returned from
   * this method and the the iterator will be left exhausted: its {@code
   * hasNext()} method will return {@code false}.
   *
   *
Warning: avoid using a {@code predicate} that matches {@code
   * null}. If {@code null} is matched in {@code iterator}, a
   * NullPointerException will be thrown.
   *
   * @since 11.0
   */
  public static <T> Optional<T> tryFind(
      Iterator<T> iterator, Predicate<? super T> predicate) {
    UnmodifiableIterator<T> filteredIterator = filter(iterator, predicate);
    return filteredIterator.hasNext()
        ? Optional.of(filteredIterator.next())
        : Optional.<T>absent();
  }

  /**
   * Returns the index in {@code iterator} of the first element that satisfies
   * the provided {@code predicate}, or {@code -1} if the Iterator has no such
   * elements.
   *
   *
More formally, returns the lowest index {@code i} such that
   * {@code predicate.apply(Iterators.get(iterator, i))} returns {@code true},
   * or {@code -1} if there is no such index.
   *
   *
If -1 is returned, the iterator will be left exhausted: its
   * {@code hasNext()} method will return {@code false}.  Otherwise,
   * the iterator will be set to the element which satisfies the
   * {@code predicate}.
   *
   * @since 2.0
   */
  public static <T> int indexOf(
      Iterator<T> iterator, Predicate<? super T> predicate) {
    checkNotNull(predicate, "predicate");
    int i = 0;
    while (iterator.hasNext()) {
      T current = iterator.next();
      if (predicate.apply(current)) {
        return i;
      }
      i++;
    }
    return -1;
  }

  /**
   * Returns an iterator that applies {@code function} to each element of {@code
   * fromIterator}.
   *
   *
The returned iterator supports {@code remove()} if the provided iterator
   * does. After a successful {@code remove()} call, {@code fromIterator} no
   * longer contains the corresponding element.
   */
  public static <F, T> Iterator<T> transform(final Iterator<F> fromIterator,
      final Function<? super F, ? extends T> function) {
    checkNotNull(fromIterator);
    checkNotNull(function);
    return new Iterator<T>() {
      @Override
      public boolean hasNext() {
        return fromIterator.hasNext();
      }
      @Override
      public T next() {
        F from = fromIterator.next();
        return function.apply(from);
      }
      @Override
      public void remove() {
        fromIterator.remove();
      }
    };
  }

  /**
   * Advances {@code iterator} {@code position + 1} times, returning the
   * element at the {@code position}th position.
   *
   * @param position position of the element to return
   * @return the element at the specified position in {@code iterator}
   * @throws IndexOutOfBoundsException if {@code position} is negative or
   *     greater than or equal to the number of elements remaining in
   *     {@code iterator}
   */
  public static <T> T get(Iterator<T> iterator, int position) {
    checkNonnegative(position);

    int skipped = 0;
    while (iterator.hasNext()) {
      T t = iterator.next();
      if (skipped++ == position) {
        return t;
      }
    }

    throw new IndexOutOfBoundsException("position (" + position
        + ") must be less than the number of elements that remained ("
        + skipped + ")");
  }

  private static void checkNonnegative(int position) {
    if (position < 0) {
      throw new IndexOutOfBoundsException("position (" + position
          + ") must not be negative");
    }
  }

  /**
   * Advances {@code iterator} {@code position + 1} times, returning the
   * element at the {@code position}th position or {@code defaultValue}
   * otherwise.
   *
   * @param position position of the element to return
   * @param defaultValue the default value to return if the iterator is empty
   *     or if {@code position} is greater than the number of elements
   *     remaining in {@code iterator}
   * @return the element at the specified position in {@code iterator} or
   *     {@code defaultValue} if {@code iterator} produces fewer than
   *     {@code position + 1} elements.
   * @throws IndexOutOfBoundsException if {@code position} is negative
   * @since 4.0
   */
  public static <T> T get(Iterator<T> iterator, int position,
      @Nullable T defaultValue) {
    checkNonnegative(position);

    try {
      return get(iterator, position);
    } catch (IndexOutOfBoundsException e) {
      return defaultValue;
    }
  }

  /**
   * Returns the next element in {@code iterator} or {@code defaultValue} if
   * the iterator is empty.  The {@link Iterables} analog to this method is
   * {@link Iterables#getFirst}.
   *
   * @param defaultValue the default value to return if the iterator is empty
   * @return the next element of {@code iterator} or the default value
   * @since 7.0
   */
  public static <T> T getNext(Iterator<T> iterator, @Nullable T defaultValue) {
    return iterator.hasNext() ? iterator.next() : defaultValue;
  }

  /**
   * Advances {@code iterator} to the end, returning the last element.
   *
   * @return the last element of {@code iterator}
   * @throws NoSuchElementException if the iterator is empty
   */
  public static <T> T getLast(Iterator<T> iterator) {
    while (true) {
      T current = iterator.next();
      if (!iterator.hasNext()) {
        return current;
      }
    }
  }

  /**
   * Advances {@code iterator} to the end, returning the last element or
   * {@code defaultValue} if the iterator is empty.
   *
   * @param defaultValue the default value to return if the iterator is empty
   * @return the last element of {@code iterator}
   * @since 3.0
   */
  public static <T> T getLast(Iterator<T> iterator, @Nullable T defaultValue) {
    return iterator.hasNext() ? getLast(iterator) : defaultValue;
  }

  /**
   * Calls {@code next()} on {@code iterator}, either {@code numberToSkip} times
   * or until {@code hasNext()} returns {@code false}, whichever comes first.
   *
   * @return the number of elements skipped
   * @since 3.0
   */
  @Beta
  public static <T> int skip(Iterator<T> iterator, int numberToSkip) {
    checkNotNull(iterator);
    checkArgument(numberToSkip >= 0, "number to skip cannot be negative");

    int i;
    for (i = 0; i < numberToSkip && iterator.hasNext(); i++) {
      iterator.next();
    }
    return i;
  }

  /**
   * Creates an iterator returning the first {@code limitSize} elements of the
   * given iterator. If the original iterator does not contain that many
   * elements, the returned iterator will have the same behavior as the original
   * iterator. The returned iterator supports {@code remove()} if the original
   * iterator does.
   *
   * @param iterator the iterator to limit
   * @param limitSize the maximum number of elements in the returned iterator
   * @throws IllegalArgumentException if {@code limitSize} is negative
   * @since 3.0
   */
  public static <T> Iterator<T> limit(
      final Iterator<T> iterator, final int limitSize) {
    checkNotNull(iterator);
    checkArgument(limitSize >= 0, "limit is negative");
    return new Iterator<T>() {
      private int count;

      @Override
      public boolean hasNext() {
        return count < limitSize && iterator.hasNext();
      }

      @Override
      public T next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        count++;
        return iterator.next();
      }

      @Override
      public void remove() {
        iterator.remove();
      }
    };
  }

  /**
   * Returns a view of the supplied {@code iterator} that removes each element
   * from the supplied {@code iterator} as it is returned.
   *
   *
The provided iterator must support {@link Iterator#remove()} or
   * else the returned iterator will fail on the first call to {@code
   * next}.
   *
   * @param iterator the iterator to remove and return elements from
   * @return an iterator that removes and returns elements from the
   *     supplied iterator
   * @since 2.0
   */
  public static <T> Iterator<T> consumingIterator(final Iterator<T> iterator) {
    checkNotNull(iterator);
    return new UnmodifiableIterator<T>() {
      @Override
      public boolean hasNext() {
        return iterator.hasNext();
      }

      @Override
      public T next() {
        T next = iterator.next();
        iterator.remove();
        return next;
      }
    };
  }

  // Methods only in Iterators, not in Iterables

  /**
   * Clears the iterator using its remove method.
   */
  static void clear(Iterator<?> iterator) {
    checkNotNull(iterator);
    while (iterator.hasNext()) {
      iterator.next();
      iterator.remove();
    }
  }

  /**
   * Returns an iterator containing the elements of {@code array} in order. The
   * returned iterator is a view of the array; subsequent changes to the array
   * will be reflected in the iterator.
   *
   *
Note: It is often preferable to represent your data using a
   * collection type, for example using {@link Arrays#asList(Object[])}, making
   * this method unnecessary.
   *
   *
The {@code Iterable} equivalent of this method is either {@link
   * Arrays#asList(Object[])}, {@link ImmutableList#copyOf(Object[])}},
   * or {@link ImmutableList#of}.
   */
  public static <T> UnmodifiableIterator<T> forArray(final T... array) {
    // TODO(kevinb): compare performance with Arrays.asList(array).iterator().
    checkNotNull(array);  // eager for GWT.
    return new AbstractIndexedListIterator<T>(array.length) {
      @Override protected T get(int index) {
        return array[index];
      }
    };
  }

  /**
   * Returns an iterator containing the elements in the specified range of
   * {@code array} in order. The returned iterator is a view of the array;
   * subsequent changes to the array will be reflected in the iterator.
   *
   *
The {@code Iterable} equivalent of this method is {@code
   * Arrays.asList(array).subList(offset, offset + length)}.
   *
   * @param array array to read elements out of
   * @param offset index of first array element to retrieve
   * @param length number of elements in iteration
   * @throws IndexOutOfBoundsException if {@code offset} is negative, {@code
   *     length} is negative, or {@code offset + length > array.length}
   */
  static <T> UnmodifiableIterator<T> forArray(
      final T[] array, final int offset, int length) {
    checkArgument(length >= 0);
    int end = offset + length;

    // Technically we should give a slightly more descriptive error on overflow
    Preconditions.checkPositionIndexes(offset, end, array.length);

    /*
     * We can't use call the two-arg constructor with arguments (offset, end)
     * because the returned Iterator is a ListIterator that may be moved back
     * past the beginning of the iteration.
     */
    return new AbstractIndexedListIterator<T>(length) {
      @Override protected T get(int index) {
        return array[offset + index];
      }
    };
  }

  /**
   * Returns an iterator containing only {@code value}.
   *
   *
The {@link Iterable} equivalent of this method is {@link
   * Collections#singleton}.
   */
  public static <T> UnmodifiableIterator<T> singletonIterator(
      @Nullable final T value) {
    return new UnmodifiableIterator<T>() {
      boolean done;
      @Override
      public boolean hasNext() {
        return !done;
      }
      @Override
      public T next() {
        if (done) {
          throw new NoSuchElementException();
        }
        done = true;
        return value;
      }
    };
  }

  /**
   * Adapts an {@code Enumeration} to the {@code Iterator} interface.
   *
   *
This method has no equivalent in {@link Iterables} because viewing an
   * {@code Enumeration} as an {@code Iterable} is impossible. However, the
   * contents can be copied into a collection using {@link
   * Collections#list}.
   */
  public static <T> UnmodifiableIterator<T> forEnumeration(
      final Enumeration<T> enumeration) {
    checkNotNull(enumeration);
    return new UnmodifiableIterator<T>() {
      @Override
      public boolean hasNext() {
        return enumeration.hasMoreElements();
      }
      @Override
      public T next() {
        return enumeration.nextElement();
      }
    };
  }

  /**
   * Adapts an {@code Iterator} to the {@code Enumeration} interface.
   *
   *
The {@code Iterable} equivalent of this method is either {@link
   * Collections#enumeration} (if you have a {@link Collection}), or
   * {@code Iterators.asEnumeration(collection.iterator())}.
   */
  public static <T> Enumeration<T> asEnumeration(final Iterator<T> iterator) {
    checkNotNull(iterator);
    return new Enumeration<T>() {
      @Override
      public boolean hasMoreElements() {
        return iterator.hasNext();
      }
      @Override
      public T nextElement() {
        return iterator.next();
      }
    };
  }

  /**
   * Implementation of PeekingIterator that avoids peeking unless necessary.
   */
  private static class PeekingImpl<E> implements PeekingIterator<E> {

    private final Iterator<? extends E> iterator;
    private boolean hasPeeked;
    private E peekedElement;

    public PeekingImpl(Iterator<? extends E> iterator) {
      this.iterator = checkNotNull(iterator);
    }

    @Override
    public boolean hasNext() {
      return hasPeeked || iterator.hasNext();
    }

    @Override
    public E next() {
      if (!hasPeeked) {
        return iterator.next();
      }
      E result = peekedElement;
      hasPeeked = false;
      peekedElement = null;
      return result;
    }

    @Override
    public void remove() {
      checkState(!hasPeeked, "Can't remove after you've peeked at next");
      iterator.remove();
    }

    @Override
    public E peek() {
      if (!hasPeeked) {
        peekedElement = iterator.next();
        hasPeeked = true;
      }
      return peekedElement;
    }
  }

  /**
   * Returns a {@code PeekingIterator} backed by the given iterator.
   *
   *
Calls to the {@code peek} method with no intervening calls to {@code
   * next} do not affect the iteration, and hence return the same object each
   * time. A subsequent call to {@code next} is guaranteed to return the same
   * object again. For example:
   {@code
   *
   *   PeekingIterator<String> peekingIterator =
   *       Iterators.peekingIterator(Iterators.forArray("a", "b"));
   *   String a1 = peekingIterator.peek(); // returns "a"
   *   String a2 = peekingIterator.peek(); // also returns "a"
   *   String a3 = peekingIterator.next(); // also returns "a"}

   *
   * Any structural changes to the underlying iteration (aside from those
   * performed by the iterator's own {@link PeekingIterator#remove()} method)
   * will leave the iterator in an undefined state.
   *
   *
The returned iterator does not support removal after peeking, as
   * explained by {@link PeekingIterator#remove()}.
   *
   *
Note: If the given iterator is already a {@code PeekingIterator},
   * it might be returned to the caller, although this is neither
   * guaranteed to occur nor required to be consistent.  For example, this
   * method might choose to pass through recognized implementations of
   * {@code PeekingIterator} when the behavior of the implementation is
   * known to meet the contract guaranteed by this method.
   *
   *
There is no {@link Iterable} equivalent to this method, so use this
   * method to wrap each individual iterator as it is generated.
   *
   * @param iterator the backing iterator. The {@link PeekingIterator} assumes
   *     ownership of this iterator, so users should cease making direct calls
   *     to it after calling this method.
   * @return a peeking iterator backed by that iterator. Apart from the
   *     additional {@link PeekingIterator#peek()} method, this iterator behaves
   *     exactly the same as {@code iterator}.
   */
  public static <T> PeekingIterator<T> peekingIterator(
      Iterator<? extends T> iterator) {
    if (iterator instanceof PeekingImpl) {
      // Safe to cast <? extends T> to <T> because PeekingImpl only uses T
      // covariantly (and cannot be subclassed to add non-covariant uses).
      @SuppressWarnings("unchecked")
      PeekingImpl<T> peeking = (PeekingImpl<T>) iterator;
      return peeking;
    }
    return new PeekingImpl<T>(iterator);
  }

  /**
   * Simply returns its argument.
   *
   * @deprecated no need to use this
   * @since 10.0
   */
  @Deprecated public static <T> PeekingIterator<T> peekingIterator(
      PeekingIterator<T> iterator) {
    return checkNotNull(iterator);
  }

  /**
   * Returns an iterator over the merged contents of all given
   * {@code iterators}, traversing every element of the input iterators.
   * Equivalent entries will not be de-duplicated.
   *
   *
Callers must ensure that the source {@code iterators} are in
   * non-descending order as this method does not sort its input.
   *
   *
For any equivalent elements across all {@code iterators}, it is
   * undefined which element is returned first.
   *
   * @since 11.0
   */
  @Beta
  public static <T> UnmodifiableIterator<T> mergeSorted(
      Iterable<? extends Iterator<? extends T>> iterators,
      Comparator<? super T> comparator) {
    checkNotNull(iterators, "iterators");
    checkNotNull(comparator, "comparator");

    return new MergingIterator<T>(iterators, comparator);
  }

  /**
   * An iterator that performs a lazy N-way merge, calculating the next value
   * each time the iterator is polled. This amortizes the sorting cost over the
   * iteration and requires less memory than sorting all elements at once.
   *
   *
Retrieving a single element takes approximately O(log(M)) time, where M
   * is the number of iterators. (Retrieving all elements takes approximately
   * O(N*log(M)) time, where N is the total number of elements.)
   */
  private static class MergingIterator<T> extends AbstractIterator<T> {
    final Queue<PeekingIterator<T>> queue;
    final Comparator<? super T> comparator;

    public MergingIterator(Iterable<? extends Iterator<? extends T>> iterators,
        Comparator<? super T> itemComparator) {
      this.comparator = itemComparator;

      // A comparator that's used by the heap, allowing the heap
      // to be sorted based on the top of each iterator.
      Comparator<PeekingIterator<T>> heapComparator =
          new Comparator<PeekingIterator<T>>() {
            @Override
            public int compare(PeekingIterator<T> o1, PeekingIterator<T> o2) {
              return comparator.compare(o1.peek(), o2.peek());
            }
          };

      queue = new PriorityQueue<PeekingIterator<T>>(2, heapComparator);

      for (Iterator<? extends T> iterator : iterators) {
        if (iterator.hasNext()) {
          queue.add(Iterators.peekingIterator(iterator));
        }
      }
    }

    @Override
    protected T computeNext() {
      if (queue.isEmpty()) {
        return endOfData();
      }

      PeekingIterator<T> nextIter = queue.poll();
      T next = nextIter.next();

      if (nextIter.hasNext()) {
        queue.add(nextIter);
      }

      return next;
    }
  }
}


text:
	Using namespaces

Below is an example of how to use namespaces with the
Namespace annotation.
Here two namespaces are declared without a prefix, this means they belong to the default namespace.

@Root
public class Example {

   @Namespace(reference="http://www.blah.com/ns/a")
   @Element
   private String a;

   @Namespace(reference="http://www.blah.com/ns/b")
   @Element
   private String b;
}

The below snippet shows an example of the resulting XML, as can be seen the namespaces are
used to qualify the resulting elements.

<example>
  <a xmlns="http://www.blah.com/ns/a">foo</a>
  <b xmlns="http://www.blah.com/ns/b">bar</b>
</example>

This example can be downloaded from here.


text:
@interface TXViewController ()

@end

@implementation TXViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
  [self.myview setDraggingEnabled:YES];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end