text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1850ad538">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court District of Nebraska</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2013-07-03</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2013-06-28</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124</identifier>
<identifier type="local">P0b002ee1850ad538</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2013-07-03</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2013-07-03</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ned-8_12-cr-00124</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ned-8_12-cr-00124</accessId>
 <courtType>District</courtType>
 <courtCode>ned</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtState>Nebraska</courtState>
 <courtSortOrder>2300</courtSortOrder>
 <caseNumber>8:12-cr-00124</caseNumber>
 <caseOffice>8 Omaha</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Cory" fullName="Cory Beckstrom" lastName="Beckstrom" role="Defendant"></party>
 <party firstName="Shamus" fullName="Shamus O'Doherty" lastName="O'Doherty" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>USA v. Beckstrom et al</title>
 <partNumber>8:12-cr-00124</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">8:12-cr-00124;12-124</identifier>
<name type="corporate">
 <namePart>United States District Court District of Nebraska</namePart>
 <namePart>8th Circuit</namePart>
 <namePart>8 Omaha</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Cory Beckstrom</displayForm>
 <namePart type="family">Beckstrom</namePart>
 <namePart type="given">Cory</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Shamus O'Doherty</displayForm>
 <namePart type="family">O'Doherty</namePart>
 <namePart type="given">Shamus</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>USA</displayForm>
 <namePart type="family">USA</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ned-8_12-cr-00124</accessId>
 <courtType>District</courtType>
 <courtCode>ned</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtState>Nebraska</courtState>
 <courtSortOrder>2300</courtSortOrder>
 <caseNumber>8:12-cr-00124</caseNumber>
 <caseOffice>8 Omaha</caseOffice>
 <caseType>criminal</caseType>
 <party firstName="Cory" fullName="Cory Beckstrom" lastName="Beckstrom" role="Defendant"></party>
 <party firstName="Shamus" fullName="Shamus O'Doherty" lastName="O'Doherty" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
 <state>Nebraska</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-0/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER APPOINTING COUNSEL - Attorney Barbara J. Thielen is appointed to represent defendant Shamus O'Doherty. Ordered by Magistrate Judge Thomas D. Thalken. (GJG)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-04-25</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9775</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-0</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2012-04-25</dateIssued>
  <docketText>ORDER APPOINTING COUNSEL - Attorney Barbara J. Thielen is appointed to represent defendant Shamus O'Doherty. Ordered by Magistrate Judge Thomas D. Thalken. (GJG)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-1/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER granting 21 Motion to Continue as to Shamus O'Doherty (2). Detention Hearing is continued to 5/17/2012 02:00 PM in Courtroom 7, Roman L. Hruska Federal Courthouse, 111 South 18th Plaza, Omaha, NE before Magistrate Judge Thomas D. Thalken. Since this is a criminal case, the defendant must be present, unless excused by the Court. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-05-04</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-1.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9777</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-1</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2012-05-04</dateIssued>
  <docketText>ORDER granting 21 Motion to Continue as to Shamus O'Doherty (2). Detention Hearing is continued to 5/17/2012 02:00 PM in Courtroom 7, Roman L. Hruska Federal Courthouse, 111 South 18th Plaza, Omaha, NE before Magistrate Judge Thomas D. Thalken. Since this is a criminal case, the defendant must be present, unless excused by the Court. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-2" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-2/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER of Detention pending trial as to defendant Cory Beckstrom. After waiving a detention hearing pursuant to 18 U.S.C. § 3142(f) of the Bail Reform Act on May 6, 2012 (Filing No. 23), the Court orders the defendantdetained pursuant to 18 U.S.C. § 3142(e) and (i). Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>2</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-05-07</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-2.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9778</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-2</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_2.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-2/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-2.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-2</accessId>
  <sequenceNumber>2</sequenceNumber>
  <dateIssued>2012-05-07</dateIssued>
  <docketText>ORDER of Detention pending trial as to defendant Cory Beckstrom. After waiving a detention hearing pursuant to 18 U.S.C. § 3142(f) of the Bail Reform Act on May 6, 2012 (Filing No. 23), the Court orders the defendantdetained pursuant to 18 U.S.C. § 3142(e) and (i). Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-3" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-3/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER that the 25 Motion to Continue is held in abeyance pending compliance with NECrimR 12.1(a) and Paragraph 9 of the Progression Order. Absent compliance on or before May 21, 2012, the motion will be deemed withdrawn and termed on the docket as to Cory Beckstrom (1). Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>3</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-05-14</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-3.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9687</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-3</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_3.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-3/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-3.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-3</accessId>
  <sequenceNumber>3</sequenceNumber>
  <dateIssued>2012-05-14</dateIssued>
  <docketText>ORDER that the 25 Motion to Continue is held in abeyance pending compliance with NECrimR 12.1(a) and Paragraph 9 of the Progression Order. Absent compliance on or before May 21, 2012, the motion will be deemed withdrawn and termed on the docket as to Cory Beckstrom (1). Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-4" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-4/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER granting 25 Motion to Continue as to Cory Beckstrom (1). Beckstrom is given until on or before July 16, 2012, in which to file pretrial motions pursuant to the progression order. The time between May 17, 2012, and July 16, 2012, shall be deemed excludable time in any computation of time under the requirement of the Speedy Trial Act. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>4</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-05-17</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-4.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b977d</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-4</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_4.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-4/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-4.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-4</accessId>
  <sequenceNumber>4</sequenceNumber>
  <dateIssued>2012-05-17</dateIssued>
  <docketText>ORDER granting 25 Motion to Continue as to Cory Beckstrom (1). Beckstrom is given until on or before July 16, 2012, in which to file pretrial motions pursuant to the progression order. The time between May 17, 2012, and July 16, 2012, shall be deemed excludable time in any computation of time under the requirement of the Speedy Trial Act. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-5" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-5/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER as to defendant Cory Beckstrom (1). The motion for discovery and extension of the pretrial motion deadline (Filing No. 36) is granted. The government shall provide Beckstrom with such recordings or provide an explanation why such recordings do not exist or set forth the date when such recordings may have already been produced to the defendant. A certificate of the delivery of such discovery or government's declaration shall be filed on or before July 20, 2012. Thereafter, Beckstrom shall have until August 10, 2012, in which to file any pretrial motions. Pretrial Motion Deadline set for 8/10/2012. Ordered by Magistrate Judge Thomas D. Thalken. (GJG)</subTitle>
  <partNumber>5</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-07-13</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-5.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9782</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-5</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_5.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-5/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-5.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-5</accessId>
  <sequenceNumber>5</sequenceNumber>
  <dateIssued>2012-07-13</dateIssued>
  <docketText>ORDER as to defendant Cory Beckstrom (1). The motion for discovery and extension of the pretrial motion deadline (Filing No. 36) is granted. The government shall provide Beckstrom with such recordings or provide an explanation why such recordings do not exist or set forth the date when such recordings may have already been produced to the defendant. A certificate of the delivery of such discovery or government's declaration shall be filed on or before July 20, 2012. Thereafter, Beckstrom shall have until August 10, 2012, in which to file any pretrial motions. Pretrial Motion Deadline set for 8/10/2012. Ordered by Magistrate Judge Thomas D. Thalken. (GJG)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-6" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-6/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER denying 40 Motion to Modify Conditions of Release as to Cory Beckstrom (1). The motion will be subject to reconsideration upon the clearance of the warrant from the Southern District of Iowa. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>6</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-08-21</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-6.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9783</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-6</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_6.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-6/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-6.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-6</accessId>
  <sequenceNumber>6</sequenceNumber>
  <dateIssued>2012-08-21</dateIssued>
  <docketText>ORDER denying 40 Motion to Modify Conditions of Release as to Cory Beckstrom (1). The motion will be subject to reconsideration upon the clearance of the warrant from the Southern District of Iowa. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-7" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-7/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER denying without prejudice 48 Motion to Modify Conditions of Release as to Cory Beckstrom (1). The motion will be subject to reconsideration upon the clearance of the warrant from the Southern District of Iowa. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</subTitle>
  <partNumber>7</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2012-09-27</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-7.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b977a</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-7</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_7.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-7/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-7.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-7</accessId>
  <sequenceNumber>7</sequenceNumber>
  <dateIssued>2012-09-27</dateIssued>
  <docketText>ORDER denying without prejudice 48 Motion to Modify Conditions of Release as to Cory Beckstrom (1). The motion will be subject to reconsideration upon the clearance of the warrant from the Southern District of Iowa. Ordered by Magistrate Judge Thomas D. Thalken. (ADB)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-8" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-8/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER denying 56 Motion to Continue as to Cory Beckstrom (1). The evidentiary hearing on Beckstrom's motion to suppress (Filing No. 39) will commence at 1:30 p.m. on January 8, 2013, in Courtroom No. 7. Defendant shall be present for such hearing. Ordered by Magistrate Judge Thomas D. Thalken. ( ADB )</subTitle>
  <partNumber>8</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-01-03</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-8.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9779</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-8</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_8.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-8/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-8.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-8</accessId>
  <sequenceNumber>8</sequenceNumber>
  <dateIssued>2013-01-03</dateIssued>
  <docketText>ORDER denying 56 Motion to Continue as to Cory Beckstrom (1). The evidentiary hearing on Beckstrom's motion to suppress (Filing No. 39) will commence at 1:30 p.m. on January 8, 2013, in Courtroom No. 7. Defendant shall be present for such hearing. Ordered by Magistrate Judge Thomas D. Thalken. ( ADB )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-9" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-9/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER granting the 65 Motion to Extend as to Cory Beckstrom (1). Beckstrom shall have to on or before February 20, 2013, in which to file a supplemental brief regarding his motion to suppress. Ordered by Magistrate Judge Thomas D. Thalken. ( MKR)</subTitle>
  <partNumber>9</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-01-23</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-9.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b977c</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-9</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_9.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-9/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-9.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-9</accessId>
  <sequenceNumber>9</sequenceNumber>
  <dateIssued>2013-01-23</dateIssued>
  <docketText>ORDER granting the 65 Motion to Extend as to Cory Beckstrom (1). Beckstrom shall have to on or before February 20, 2013, in which to file a supplemental brief regarding his motion to suppress. Ordered by Magistrate Judge Thomas D. Thalken. ( MKR)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-10" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-10/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>FINDINGS AND RECOMMENDATION that the Motion to Suppress 39 be denied. Any objection to this Findings and Recommendation shall be filed with the Clerk within 10 business days after being served with a copy as to defendant Cory Beckstrom. Ordered by Magistrate Judge Thomas D. Thalken. (JSF)</subTitle>
  <partNumber>10</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-03-18</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-10.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9776</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-10</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_10.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-10/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-10.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-10</accessId>
  <sequenceNumber>10</sequenceNumber>
  <dateIssued>2013-03-18</dateIssued>
  <docketText>FINDINGS AND RECOMMENDATION that the Motion to Suppress 39 be denied. Any objection to this Findings and Recommendation shall be filed with the Clerk within 10 business days after being served with a copy as to defendant Cory Beckstrom. Ordered by Magistrate Judge Thomas D. Thalken. (JSF)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-11" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-11/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER as to defendant Cory Beckstrom (1). Magistrate Judge Thalken's Findings and Recommendation (Filing No. 72) are adopted in their entirety. The Defendant's motion to suppress (Filing No. 39) is denied, in accordance with the Findings and Recommendation. Ordered by Chief Judge Laurie Smith Camp. (GJG)</subTitle>
  <partNumber>11</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-04-01</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-11.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b9781</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-11</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_11.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-11/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-11.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-11</accessId>
  <sequenceNumber>11</sequenceNumber>
  <dateIssued>2013-04-01</dateIssued>
  <docketText>ORDER as to defendant Cory Beckstrom (1). Magistrate Judge Thalken's Findings and Recommendation (Filing No. 72) are adopted in their entirety. The Defendant's motion to suppress (Filing No. 39) is denied, in accordance with the Findings and Recommendation. Ordered by Chief Judge Laurie Smith Camp. (GJG)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-12" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-12/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>ORDER granting 76 Motion to Continue Trial as to Cory Beckstrom. Jury Trial is continued to 6/25/2013 at 9:00 AM in Courtroom 2, Roman L. Hruska Federal Courthouse, 111 South 18th Plaza, Omaha, NE before Chief Judge Laurie Smith Camp. The time between today's date and the anticipated trial is excluded for purposes of computing the limits under the Speedy Trial Act. Ordered by Magistrate Judge F.A. Gossett. ( MLF, )</subTitle>
  <partNumber>12</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-04-24</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-12.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b977b</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-12</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_12.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-12/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-12.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-12</accessId>
  <sequenceNumber>12</sequenceNumber>
  <dateIssued>2013-04-24</dateIssued>
  <docketText>ORDER granting 76 Motion to Continue Trial as to Cory Beckstrom. Jury Trial is continued to 6/25/2013 at 9:00 AM in Courtroom 2, Roman L. Hruska Federal Courthouse, 111 South 18th Plaza, Omaha, NE before Chief Judge Laurie Smith Camp. The time between today's date and the anticipated trial is excluded for purposes of computing the limits under the Speedy Trial Act. Ordered by Magistrate Judge F.A. Gossett. ( MLF, )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-ned-8_12-cr-00124-13" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-13/mods.xml">
 <titleInfo>
  <title>USA v. Beckstrom et al</title>
  <subTitle>PRELIMINARY ORDER OF FORFEITURE as to defendant Cory Beckstrom (1). The United States's Motion for Issuance of Preliminary Order of Forfeiture, filing 89 is hereby sustained. Based upon the Forfeiture Allegation of the Indictment and the Defendant's plea of guilty, the United States is hereby authorized to seize the $999 and $1,920 in United States currency. Upon adjudication of all third-party interests, this Court will enter a Final Order of Forfeiture pursuant to 21 U.S.C. section 853(n), in which all interests will be addressed. Ordered by Chief Judge Laurie Smith Camp. (1 Certified copy to USM)(GJG)</subTitle>
  <partNumber>13</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2013-06-28</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-ned-8_12-cr-00124-13.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1850b977e</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-13</identifier>
 <identifier type="former granule identifier">ned-8_12-cr-00124_13.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ned-8_12-cr-00124/USCOURTS-ned-8_12-cr-00124-13/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ned-8_12-cr-00124/pdf/USCOURTS-ned-8_12-cr-00124-13.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:12-cr-00124; USA v. Beckstrom et al; </searchTitle>
  <courtName>United States District Court District of Nebraska</courtName>
  <state>Nebraska</state>
  <accessId>USCOURTS-ned-8_12-cr-00124-13</accessId>
  <sequenceNumber>13</sequenceNumber>
  <dateIssued>2013-06-28</dateIssued>
  <docketText>PRELIMINARY ORDER OF FORFEITURE as to defendant Cory Beckstrom (1). The United States's Motion for Issuance of Preliminary Order of Forfeiture, filing 89 is hereby sustained. Based upon the Forfeiture Allegation of the Indictment and the Defendant's plea of guilty, the United States is hereby authorized to seize the $999 and $1,920 in United States currency. Upon adjudication of all third-party interests, this Court will enter a Final Order of Forfeiture pursuant to 21 U.S.C. section 853(n), in which all interests will be addressed. Ordered by Chief Judge Laurie Smith Camp. (1 Certified copy to USM)(GJG)</docketText>
</extension>
</relatedItem>
</mods>


text:
from flask import render_template

from SoftLayer import MessagingManager

from slick.utils.core import get_client

def get_widgets():
    return [MQSummaryWidget()]

class MQSummaryWidget(object):
    def __init__(self):
        self.width = 'small'
        self.height = 'large'
        self.no_body = True
        self.title = 'Message Queue Summary'

    def render(self):
        mgr = MessagingManager(get_client())
        return render_template('mq_widget_summary.html',
                               accounts=mgr.list_accounts())

redpajama_set_name: RedPajamaGithub


text:
debconf-set-selections <<< "mysql-community-server mysql-community-server/data-dir select ''"
debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password secret"
debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password secret"
apt-get install -y mysql-server

# Configure MySQL Password Lifetime

echo "default_password_lifetime = 0" >> /etc/mysql/my.cnf

# Configure MySQL Remote Access

sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf

mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
service mysql restart

mysql --user="root" --password="secret" -e "CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';"
mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
mysql --user="root" --password="secret" -e "FLUSH PRIVILEGES;"
mysql --user="root" --password="secret" -e "CREATE DATABASE homestead;"
service mysql restart

# Add Timezone Support To MySQL

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --user=root --password=secret mysql


text:
#include "lib.h"
#include "lib-signals.h"
#include "hash.h"
#include "child-wait.h"

#include <sys/wait.h>

struct child_wait {
	unsigned int pid_count;

	child_wait_callback_t *callback;
	void *context;
};

/* pid_t => wait */
HASH_TABLE(void *, struct child_wait *) child_pids;

#undef child_wait_new_with_pid
struct child_wait *
child_wait_new_with_pid(pid_t pid, child_wait_callback_t *callback,
			void *context)
{
	struct child_wait *wait;

	wait = i_new(struct child_wait, 1);
	wait->callback = callback;
	wait->context = context;

	if (pid != (pid_t)-1)
		child_wait_add_pid(wait, pid);
	return wait;
}

void child_wait_free(struct child_wait **_wait)
{
	struct child_wait *wait = *_wait;
	struct hash_iterate_context *iter;
	void *key;
	struct child_wait *value;

	*_wait = NULL;

	if (wait->pid_count > 0) {
		/* this should be rare, so iterating hash is fast enough */
		iter = hash_table_iterate_init(child_pids);
		while (hash_table_iterate(iter, child_pids, &key, &value)) {
			if (value == wait) {
				hash_table_remove(child_pids, key);
				if (--wait->pid_count == 0)
					break;
			}
		}
		hash_table_iterate_deinit(&iter);
	}

	i_free(wait);
}

void child_wait_add_pid(struct child_wait *wait, pid_t pid)
{
	wait->pid_count++;
	hash_table_insert(child_pids, POINTER_CAST(pid), wait);
}

void child_wait_remove_pid(struct child_wait *wait, pid_t pid)
{
	wait->pid_count--;
	hash_table_remove(child_pids, POINTER_CAST(pid));
}

static void
sigchld_handler(const siginfo_t *si ATTR_UNUSED, void *context ATTR_UNUSED)
{
	struct child_wait_status status;

	while ((status.pid = waitpid(-1, &status.status, WNOHANG)) > 0) {
		status.wait = hash_table_lookup(child_pids,
						POINTER_CAST(status.pid));
		if (status.wait != NULL) {
			child_wait_remove_pid(status.wait, status.pid);
			status.wait->callback(&status, status.wait->context);
		}
	}

	if (status.pid == -1 && errno != EINTR && errno != ECHILD)
		i_error("waitpid() failed: %m");
}

void child_wait_init(void)
{
	hash_table_create_direct(&child_pids, default_pool, 0);

	lib_signals_set_handler(SIGCHLD, LIBSIG_FLAGS_SAFE,
				sigchld_handler, NULL);
}

void child_wait_deinit(void)
{
	struct hash_iterate_context *iter;
	void *key;
	struct child_wait *value;

	lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);

	iter = hash_table_iterate_init(child_pids);
	while (hash_table_iterate(iter, child_pids, &key, &value))
		i_free(value);
	hash_table_iterate_deinit(&iter);

	hash_table_destroy(&child_pids);
}


text:
require 'rails_helper'

describe AppSettingsPolicy do
  subject { AppSettingsPolicy.new(user, AppSettings) }

  context 'for a guest user' do
    let(:user) { nil }

    it { should_not permit(:index) }
    it { should_not permit(:show) }
    it { should_not permit(:create) }
    it { should_not permit(:new) }
    it { should_not permit(:update) }
    it { should_not permit(:edit) }
    it { should_not permit(:destroy) }
  end

  context 'for a signed in non-admin user' do
    let(:user) { FactoryGirl.create(:user) }

    it { should_not permit(:index) }
    it { should_not permit(:show) }
    it { should_not permit(:create) }
    it { should_not permit(:new) }
    it { should_not permit(:update) }
    it { should_not permit(:edit) }
    it { should_not permit(:destroy) }
  end

  context 'for a signed in admin user' do
    let(:user) { FactoryGirl.create(:user, roles: [:admin]) }

    it { should_not permit(:index) }
    it { should permit(:show) }
    it { should_not permit(:create) }
    it { should_not permit(:new) }
    it { should permit(:update) }
    it { should permit(:edit) }
    it { should_not permit(:destroy) }
  end
end


text:
{% extends base_template %}
{% load i18n %}
{% block javascripts %}
    {# commenting out because these are redundant due to webapp <script type="text/javascript" src="{{MEDIA_URL}}/graphing/flot/jquery.js"></script>#}
    <script type="text/javascript" src="{{MEDIA_URL}}/graphing/flot/jquery.flot.js"></script>
    <!--[if IE]><script language="javascript" type="text/javascript" src="{{MEDIA_URL}}/graphing/flot/excanvas.min.js"></script><![endif]-->

    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/graphing/superfish/superfish.css" media="screen">
    <script type="text/javascript" src="{{MEDIA_URL}}/graphing/superfish/hoverIntent.js"></script>
	<script type="text/javascript" src="{{MEDIA_URL}}/graphing/superfish/superfish.js"></script>
    <script type="text/javascript">
		// initialise plugins
		jQuery(function(){
			jQuery('ul.sf-menu').superfish();
		});
	</script>

    {{ form.media }}
{% endblock %}

{% block content %}

<ul class="sf-menu">
	{% include "graphing/inline_graphgroup.html" %}
</ul>

    {% for chart in group_charts %}
		{% include "graphing/inline_rawgraph.html" %}
	{%endfor %}

{%endblock%}


text:
namespace eanim
{

const float PartSkeleton::JOINT_RADIUS = 1.0f;
const float PartSkeleton::NODE_RADIUS = 0.5f;
const float PartSkeleton::WIDTH_LENGTH_RATIO = 0.1f;

PartSkeleton::PartSkeleton(float width, float height)
{
	m_halfWidth = width * 0.5f;
	m_halfHeight = height * 0.5f;
}

PartSkeleton::PartSkeleton(const PartSkeleton& skeleton)
{
	m_halfWidth = skeleton.m_halfWidth;
	m_halfHeight = skeleton.m_halfHeight;

	PartSkeleton::Joint* last = NULL;
 	for (size_t i = 0, n = skeleton.m_joints.size(); i < n; ++i)
 	{
		PartSkeleton::Joint* sJoint = skeleton.m_joints[i];
		PartSkeleton::Joint* dJoint = new PartSkeleton::Joint(*sJoint);

		if (last && last->m_to)
		{
			last->m_to->m_end = dJoint;
			dJoint->m_from = last->m_to;
		}
		if (sJoint->m_to)
		{
			Bone* bone = new PartSkeleton::Bone(*sJoint->m_to);
			bone->m_start = dJoint;
			dJoint->m_to = bone;
		}

		last = dJoint;
		m_joints.push_back(dJoint);
 	}
}

PartSkeleton::~PartSkeleton()
{
	clear();
}

PartSkeleton* PartSkeleton::clone() const
{
	return new PartSkeleton(*this);
}

void PartSkeleton::loadFromTextFile(std::ifstream& fin)
{
	clear();

	size_t size;
	std::string flag;
	fin >> flag >> size;
	PartSkeleton::Joint* last = NULL;
	for (size_t i = 0; i < size; ++i)
	{
		Joint* curr = new Joint;
		curr->loadFromTextFile(fin);

		if (last && last->m_to)
		{
			last->m_to->m_end = curr;
			curr->m_from = last->m_to;
		}
		if (i != size - 1)
		{
			Bone* bone = new Bone;
			bone->loadFromTextFile(fin);
			bone->m_start = curr;
			curr->m_to = bone;
		}

		last = curr;
		m_joints.push_back(curr);
	}
}

void PartSkeleton::storeToTextFile(std::ofstream& fout) const
{
	fout << "joints " << m_joints.size() << '\n';
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		Joint* joint = m_joints[i];
		joint->storeToTextFile(fout);
		fout << '\n';
		assert(i != m_joints.size() - 1 && joint->m_to
			|| i == m_joints.size() - 1 && !joint->m_to);
		if (joint->m_to)
		{
			joint->m_to->storeToTextFile(fout);
			fout << '\n';
		}
	}
}

void PartSkeleton::pushJoint(const ee::Vector& pos)
{
	m_joints.push_back(new Joint(pos, m_halfWidth, m_halfHeight));

	if (m_joints.size() > 1)
	{
		PartSkeleton::Joint *start = m_joints[m_joints.size() - 2],
			*end = m_joints[m_joints.size() - 1];
		float len = ee::Math::getDistance(start->projCoords, end->projCoords);
		PartSkeleton::Bone* bone = new PartSkeleton::Bone(start, end, len, m_halfWidth, m_halfHeight);
		start->m_to = bone;
		end->m_from = bone;
		end->initNodesLocalCoords(len);
		if (m_joints.size() == 2) start->initNodesLocalCoords(len);

		if (m_joints.size() > 2)
		{
			Joint* last = m_joints[m_joints.size() - 2];
			ee::Vector pLeft, pRight;
			last->getNodesPos(pLeft, pRight);
			last->m_left.initCoords(pLeft, m_halfWidth, m_halfHeight);
			last->m_right.initCoords(pRight, m_halfWidth, m_halfHeight);
		}
	}
}

void PartSkeleton::popJoint()
{
	if (m_joints.size() > 2)
	{
		PartSkeleton::Joint* last = m_joints[m_joints.size() - 2];
		delete last->m_to->m_end;
		delete last->m_to, last->m_to = NULL;
		m_joints.pop_back();
	}
}

ee::Vector PartSkeleton::topJoint() const
{
	if (m_joints.empty())
	{
		ee::Vector p;
		p.setInvalid();
		return p;
	}
	else
	{
		return m_joints[m_joints.size() - 1]->projCoords;
	}
}

PartSkeleton::Joint* PartSkeleton::queryJointByPos(const ee::Vector& pos)
{
	PartSkeleton::Joint* nearest = NULL;
	float nearestDis = FLT_MAX;

	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		float dis = ee::Math::getDistance(pos, m_joints[i]->projCoords);
		if (dis < nearestDis)
		{
			nearest = m_joints[i];
			nearestDis = dis;
		}
	}

	return nearestDis < JOINT_RADIUS ? nearest : NULL;
}

PartSkeleton::Node* PartSkeleton::queryNodeByPos(const ee::Vector& pos)
{
	PartSkeleton::Node* nearest = NULL;
	float nearestDis = FLT_MAX;

	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		PartSkeleton::Bone* bone = joint->m_to;
		if (!bone) continue;

		float dis;

		ee::Vector pLeft, pRight;
		bone->getNodesPos(pLeft, pRight);
		dis = ee::Math::getDistance(pLeft, pos);
		if (dis < nearestDis)
		{
			nearest = &bone->m_left;
			nearestDis = dis;
		}
		dis = ee::Math::getDistance(pRight, pos);
		if (dis < nearestDis)
		{
			nearest = &bone->m_right;
			nearestDis = dis;
		}

		if (i != 0)
		{
			joint->getNodesPos(pLeft, pRight);
			dis = ee::Math::getDistance(pLeft, pos);
			if (dis < nearestDis)
			{
				nearest = &joint->m_left;
				nearestDis = dis;
			}
			dis = ee::Math::getDistance(pRight, pos);
			if (dis < nearestDis)
			{
				nearest = &joint->m_right;
				nearestDis = dis;
			}
		}
	}

	return nearest;
}

void PartSkeleton::translateJoint(Joint* joint, const ee::Vector& newPos)
{
	joint->initConnectedCoords(newPos, m_halfWidth, m_halfHeight);
}

void PartSkeleton::translateNode(Node* node, const ee::Vector& newPos)
{
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		PartSkeleton::Bone* bone = joint->m_to;
		if (!bone) continue;

		ee::Vector center = bone->getCenter();
		ee::Vector vector = bone->getVector();
		if (&bone->m_left == node)
		{
			bone->m_left.local = ee::Math::transCoordsWorldToLocal(center, vector, newPos);
			bone->m_left.initCoords(newPos, m_halfWidth, m_halfHeight);
		}
		else if (&bone->m_right == node)
		{
			bone->m_right.local = ee::Math::transCoordsWorldToLocal(center, vector, newPos);
			bone->m_right.initCoords(newPos, m_halfWidth, m_halfHeight);
		}

		if (i != 0)
		{
			ee::Vector center = joint->projCoords;
			ee::Vector vector = (joint->m_from->getVector() + joint->m_to->getVector()) * 0.5f;
			if (&joint->m_left == node)
			{
				joint->m_left.local = ee::Math::transCoordsWorldToLocal(center, vector, newPos);
				joint->m_left.initCoords(newPos, m_halfWidth, m_halfHeight);
			}
			else if (&joint->m_right == node)
			{
				joint->m_right.local = ee::Math::transCoordsWorldToLocal(center, vector, newPos);
				joint->m_right.initCoords(newPos, m_halfWidth, m_halfHeight);
			}
		}
	}
}

void PartSkeleton::rotateJoint(PartSkeleton::Joint* joint, const ee::Vector& newPos)
{
	if (!joint->m_from) return;

	float oldLen = joint->m_from->getLength();
	const ee::Vector& start = joint->m_from->m_start->projCoords;
	float newLen = ee::Math::getDistance(start, newPos);
	ee::Vector dest = start + (newPos - start) * oldLen / newLen;

	ee::Vector offset = dest - joint->projCoords;
	while (true)
	{
		joint->projCoords += offset;
		if (joint->m_to) joint = joint->m_to->m_end;
		else break;
	}
}

void PartSkeleton::onDraw() const
{
	// Bones
	glLineWidth(2.0f);
	glColor3f(1.0f, 0.0f, 0.0f);
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		if (joint->m_to)
		{
			PartSkeleton::Bone* bone = joint->m_to;
			const ee::Vector& s = bone->m_start->projCoords,
				&e = bone->m_end->projCoords;

			ee::Vector offset = (e - s) * WIDTH_LENGTH_RATIO;
			ee::Vector pLeft = s + ee::Math::rotateVectorRightAngle(offset, true),
				pRight = s + ee::Math::rotateVectorRightAngle(offset, false);
			glBegin(GL_LINE_LOOP);
				glVertex2f(pLeft.x, pLeft.y);
				glVertex2f(pRight.x, pRight.y);
				glVertex2f(e.x, e.y);
			glEnd();
		}
	}
	glLineWidth(1.0f);

	// Joints
	glColor3f(0.0f, 1.0f, 0.0f);
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		Render::drawPos(m_joints[i]->projCoords, JOINT_RADIUS);
	}

	// Nodes
	glColor3f(0.0f, 0.0f, 1.0f);
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		PartSkeleton::Bone* bone = joint->m_to;
		if (!bone) continue;

		ee::Vector pLeft, pRight;
		bone->getNodesPos(pLeft, pRight);
		Render::drawPos(pLeft, NODE_RADIUS);
		Render::drawPos(pRight, NODE_RADIUS);

		if (i != 0)
		{
			joint->getNodesPos(pLeft, pRight);
			Render::drawPos(pLeft, NODE_RADIUS);
			Render::drawPos(pRight, NODE_RADIUS);
		}
	}

	// Meshes
	glColor3f(0.0f, 0.6f, 0.8f);
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		PartSkeleton::Bone* bone = joint->m_to;
		if (!bone) continue;

		ee::Vector pLeft, pRight;
		bone->getNodesPos(pLeft, pRight);
		drawTriangle(bone->m_start->projCoords, bone->m_end->projCoords, pLeft);
		drawTriangle(bone->m_start->projCoords, bone->m_end->projCoords, pRight);

		if (i != 0)
		{
			PartSkeleton::Bone* fBone = joint->m_from;

			ee::Vector fbLeft, fbRight;
			fBone->getNodesPos(fbLeft, fbRight);

			ee::Vector nLeft, nRight;
			joint->getNodesPos(nLeft, nRight);

			drawTriangle(fbLeft, joint->projCoords, nLeft);
			drawTriangle(nLeft, joint->projCoords, pLeft);
			drawTriangle(fbRight, joint->projCoords, nRight);
			drawTriangle(nRight, joint->projCoords, pRight);
		}
	}
}

void PartSkeleton::drawMeshes() const
{
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		PartSkeleton::Joint* joint = m_joints[i];
		PartSkeleton::Bone* bone = joint->m_to;
		if (!bone) continue;

		ee::Vector pLeft, pRight;
		bone->getNodesPos(pLeft, pRight);
		drawTriangle(bone->m_start->projCoords, bone->m_end->projCoords, pLeft,
			bone->m_start->texCoords, bone->m_end->texCoords, bone->m_left.texCoords);
		drawTriangle(bone->m_start->projCoords, bone->m_end->projCoords, pRight,
			bone->m_start->texCoords, bone->m_end->texCoords, bone->m_right.texCoords);

		if (i != 0)
		{
			PartSkeleton::Bone* fBone = joint->m_from;

			ee::Vector fbLeft, fbRight;
			fBone->getNodesPos(fbLeft, fbRight);

			ee::Vector nLeft, nRight;
			joint->getNodesPos(nLeft, nRight);

			drawTriangle(fbLeft, joint->projCoords, nLeft,
				fBone->m_left.texCoords, joint->texCoords, joint->m_left.texCoords);
			drawTriangle(nLeft, joint->projCoords, pLeft,
				joint->m_left.texCoords, joint->texCoords, bone->m_left.texCoords);
			drawTriangle(fbRight, joint->projCoords, nRight,
				fBone->m_right.texCoords, joint->texCoords, joint->m_right.texCoords);
			drawTriangle(nRight, joint->projCoords, pRight,
				joint->m_right.texCoords, joint->texCoords, bone->m_right.texCoords);
		}
	}
}

void PartSkeleton::tween(const PartSkeleton& start, const PartSkeleton& end, float process)
{
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		ee::Vector offset = (end.m_joints[i]->projCoords - start.m_joints[i]->projCoords) * process;
		m_joints[i]->projCoords = start.m_joints[i]->projCoords + offset;
	}
}

void PartSkeleton::clear()
{
	for (size_t i = 0, n = m_joints.size(); i < n; ++i)
	{
		if (m_joints[i]->m_to) delete m_joints[i]->m_to;
		delete m_joints[i];
	}
	m_joints.clear();
}

void PartSkeleton::drawTriangle(const ee::Vector& p0, const ee::Vector& p1, const ee::Vector& p2) const
{
	glBegin(GL_LINE_LOOP);
		glVertex2f(p0.x, p0.y);
		glVertex2f(p1.x, p1.y);
		glVertex2f(p2.x, p2.y);
	glEnd();
}

void PartSkeleton::drawTriangle(const ee::Vector& p0, const ee::Vector& p1, const ee::Vector& p2,
							const ee::Vector& c0, const ee::Vector& c1, const ee::Vector& c2) const
{
	glBegin(GL_TRIANGLES);
		glTexCoord2f(c0.x, c0.y);	glVertex2f(p0.x, p0.y);
		glTexCoord2f(c1.x, c1.y);	glVertex2f(p1.x, p1.y);
		glTexCoord2f(c2.x, c2.y);	glVertex2f(p2.x, p2.y);
	glEnd();
}

//////////////////////////////////////////////////////////////////////////
// class PartSkeleton::Node
//////////////////////////////////////////////////////////////////////////

PartSkeleton::Node::Node(const Node& node)
	: MeshNode(node)
{
	local = node.local;
}

void PartSkeleton::Node::loadFromTextFile(std::ifstream& fin)
{
	MeshNode::loadFromTextFile(fin);
	fin >> local;
}

void PartSkeleton::Node::storeToTextFile(std::ofstream& fout) const
{
	MeshNode::storeToTextFile(fout);
	fout << " " << local;
}

//////////////////////////////////////////////////////////////////////////
// class PartSkeleton::Joint
//////////////////////////////////////////////////////////////////////////

PartSkeleton::Joint::Joint()
{
	m_from = m_to = NULL;
}

PartSkeleton::Joint::Joint(const ee::Vector& p, float hWidth, float hHeight)
{
	initCoords(p, hWidth, hHeight);
	m_from = m_to = NULL;
}

PartSkeleton::Joint::Joint(const Joint& joint)
	: MeshNode(joint), m_left(joint.m_left), m_right(joint.m_right)
{
	m_from = m_to = NULL;
}

void PartSkeleton::Joint::loadFromTextFile(std::ifstream& fin)
{
	MeshNode::loadFromTextFile(fin);
	m_left.loadFromTextFile(fin);
	m_right.loadFromTextFile(fin);
}

void PartSkeleton::Joint::storeToTextFile(std::ofstream& fout) const
{
	MeshNode::storeToTextFile(fout);
	fout << " ";
	m_left.storeToTextFile(fout);
	fout << " ";
	m_right.storeToTextFile(fout);
}

void PartSkeleton::Joint::initNodesLocalCoords(float length)
{
	m_left.local.x = m_right.local.y = 0;
	m_left.local.y = length * 0.5f;
	m_right.local.y = - length * 0.5f;
}

void PartSkeleton::Joint::initConnectedCoords(const ee::Vector& pos, float hWidth, float hHeight)
{
	initCoords(pos, hWidth, hHeight);

	if (m_from && m_to)
	{
		ee::Vector pLeft, pRight;
		getNodesPos(pLeft, pRight);
		m_left.initCoords(pLeft, hWidth, hHeight);
		m_right.initCoords(pRight, hWidth, hHeight);
	}

	if (m_from) m_from->initCoords(hWidth, hHeight, this);
	if (m_to) m_to->initCoords(hWidth, hHeight, this);
}

void PartSkeleton::Joint::getNodesPos(ee::Vector& left, ee::Vector& right) const
{
	ee::Vector center = projCoords;
	ee::Vector vector = (m_from->getVector() + m_to->getVector()) * 0.5f;
	left = ee::Math::transCoordsLocalToWorld(center, vector, m_left.local);
	right = ee::Math::transCoordsLocalToWorld(center, vector, m_right.local);
}

//////////////////////////////////////////////////////////////////////////
// class PartSkeleton::Bone
//////////////////////////////////////////////////////////////////////////

PartSkeleton::Bone::Bone()
{
	m_start = m_end = NULL;
}

PartSkeleton::Bone::Bone(Joint* start, Joint* end, float length, float hWidth, float hHeight)
{
	m_start = start;
	m_end = end;

	initNodesLocalCoords(length);

	ee::Vector pLeft, pRight;
	getNodesPos(pLeft, pRight);
	m_left.initCoords(pLeft, hWidth, hHeight);
	m_right.initCoords(pRight, hWidth, hHeight);
}

PartSkeleton::Bone::Bone(const Bone& bone)
	: m_left(bone.m_left), m_right(bone.m_right)
{
	m_start = m_end = NULL;
}

void PartSkeleton::Bone::loadFromTextFile(std::ifstream& fin)
{
	m_left.loadFromTextFile(fin);
	m_right.loadFromTextFile(fin);
}

void PartSkeleton::Bone::storeToTextFile(std::ofstream& fout) const
{
	m_left.storeToTextFile(fout);
	fout << '\n';
	m_right.storeToTextFile(fout);
}

float PartSkeleton::Bone::getLength() const
{
	return ee::Math::getDistance(m_start->projCoords, m_end->projCoords);
}

ee::Vector PartSkeleton::Bone::getCenter() const
{
	return (m_start->projCoords + m_end->projCoords) * 0.5f;
}

ee::Vector PartSkeleton::Bone::getVector() const
{
	return m_end->projCoords - m_start->projCoords;
}

void PartSkeleton::Bone::getNodesPos(ee::Vector& left, ee::Vector& right) const
{
	ee::Vector center = getCenter();
	ee::Vector vector = getVector();
	left = ee::Math::transCoordsLocalToWorld(center, vector, m_left.local);
	right= ee::Math::transCoordsLocalToWorld(center, vector, m_right.local);
}

void PartSkeleton::Bone::initNodesLocalCoords(float length)
{
	m_left.local.x = 0;
	m_left.local.y = length * 0.5f;

	m_right.local.x = 0;
	m_right.local.y = - length * 0.5f;
}

void PartSkeleton::Bone::initCoords(float hWidth, float hHeight, Joint* except)
{
	ee::Vector pLeft, pRight;
	getNodesPos(pLeft, pRight);
	m_left.initCoords(pLeft, hWidth, hHeight);
	m_right.initCoords(pRight, hWidth, hHeight);

	if (m_start != except && m_start->m_from)
	{
		m_start->getNodesPos(pLeft, pRight);
		m_start->m_left.initCoords(pLeft, hWidth, hHeight);
		m_start->m_right.initCoords(pRight, hWidth, hHeight);
	}
	if (m_end != except && m_end->m_to)
	{
		m_end->getNodesPos(pLeft, pRight);
		m_end->m_left.initCoords(pLeft, hWidth, hHeight);
		m_end->m_right.initCoords(pRight, hWidth, hHeight);
	}
}

} // eanim


text:
package org.dashbuilder.common.client.error;

import org.dashbuilder.common.client.StringUtils;

/**
 * Class that wraps errors either captured or generated on client runtime.
 */
public class ClientRuntimeError {

    private String message;
    private Throwable throwable;

    public ClientRuntimeError(String message) {
        this(message, null);
    }

    public ClientRuntimeError(Throwable e) {
        this(null, e);
    }

    public ClientRuntimeError(String message, Throwable e) {
        this.message = message;
        this.throwable = e;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public String getMessage() {
        if (!StringUtils.isBlank(message)) {
            return message;
        }

        Throwable root = getRootCause();
        return root.toString();
    }

    public String getCause() {
        Throwable root = getRootCause();
        if (root == null || getMessage().equals(root.toString())) {
            return null;
        } else {
            return root.getMessage();
        }
    }

    public Throwable getRootCause() {
        Throwable target = throwable;
        while (true) {
            if (target == null || target.getCause() == null) {
                return target;
            } else {
                target = target.getCause();
            }
        }
    }

    public String toString() {
        String cause = getCause();
        return getMessage() + (cause != null ? " (cause: " + cause + ")" : "");
    }
}


text:
<ion-view title="Sync Demo">
    <ion-content padding="'true'" class="has-header">
        <ion-list ng-repeat="item in list" can-swipe="true">
            <ion-item menu-close="" href="#!/tabs/detail/{{item.id}}">
                {{item.data.name}}

{{item.id}}

                {{item.moment}}
                <ion-option-button class="button-dark" ng-click="delete(item)">
                       Delete
                </ion-option-button>
            </ion-item>
        </ion-list>
    </ion-content>
</ion-view>


text:
package org.apache.spark.sql

import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite}

/**
 * Test cases for the builder pattern of [[SparkSession]].
 */
class SparkSessionBuilderSuite extends SparkFunSuite {

  private var initialSession: SparkSession = _

  private lazy val sparkContext: SparkContext = {
    initialSession = SparkSession.builder()
      .master("local")
      .config("spark.ui.enabled", value = false)
      .config("some-config", "v2")
      .getOrCreate()
    initialSession.sparkContext
  }

  test("create with config options and propagate them to SparkContext and SparkSession") {
    // Creating a new session with config - this works by just calling the lazy val
    sparkContext
    assert(initialSession.sparkContext.conf.get("some-config") == "v2")
    assert(initialSession.conf.get("some-config") == "v2")
    SparkSession.clearDefaultSession()
  }

  test("use global default session") {
    val session = SparkSession.builder().getOrCreate()
    assert(SparkSession.builder().getOrCreate() == session)
    SparkSession.clearDefaultSession()
  }

  test("config options are propagated to existing SparkSession") {
    val session1 = SparkSession.builder().config("spark-config1", "a").getOrCreate()
    assert(session1.conf.get("spark-config1") == "a")
    val session2 = SparkSession.builder().config("spark-config1", "b").getOrCreate()
    assert(session1 == session2)
    assert(session1.conf.get("spark-config1") == "b")
    SparkSession.clearDefaultSession()
  }

  test("use session from active thread session and propagate config options") {
    val defaultSession = SparkSession.builder().getOrCreate()
    val activeSession = defaultSession.newSession()
    SparkSession.setActiveSession(activeSession)
    val session = SparkSession.builder().config("spark-config2", "a").getOrCreate()

    assert(activeSession != defaultSession)
    assert(session == activeSession)
    assert(session.conf.get("spark-config2") == "a")
    SparkSession.clearActiveSession()

    assert(SparkSession.builder().getOrCreate() == defaultSession)
    SparkSession.clearDefaultSession()
  }

  test("create a new session if the default session has been stopped") {
    val defaultSession = SparkSession.builder().getOrCreate()
    SparkSession.setDefaultSession(defaultSession)
    defaultSession.stop()
    val newSession = SparkSession.builder().master("local").getOrCreate()
    assert(newSession != defaultSession)
    newSession.stop()
  }

  test("create a new session if the active thread session has been stopped") {
    val activeSession = SparkSession.builder().master("local").getOrCreate()
    SparkSession.setActiveSession(activeSession)
    activeSession.stop()
    val newSession = SparkSession.builder().master("local").getOrCreate()
    assert(newSession != activeSession)
    newSession.stop()
  }

  test("create SparkContext first then SparkSession") {
    sparkContext.stop()
    val conf = new SparkConf().setAppName("test").setMaster("local").set("key1", "value1")
    val sparkContext2 = new SparkContext(conf)
    val session = SparkSession.builder().config("key2", "value2").getOrCreate()
    assert(session.conf.get("key1") == "value1")
    assert(session.conf.get("key2") == "value2")
    assert(session.sparkContext.conf.get("key1") == "value1")
    assert(session.sparkContext.conf.get("key2") == "value2")
    assert(session.sparkContext.conf.get("spark.app.name") == "test")
    session.stop()
  }

  test("SPARK-15887: hive-site.xml should be loaded") {
    val session = SparkSession.builder().master("local").getOrCreate()
    assert(session.sessionState.newHadoopConf().get("hive.in.test") == "true")
    assert(session.sparkContext.hadoopConfiguration.get("hive.in.test") == "true")
    session.stop()
  }

  test("SPARK-15991: Set global Hadoop conf") {
    val session = SparkSession.builder().master("local").getOrCreate()
    val mySpecialKey = "my.special.key.15991"
    val mySpecialValue = "msv"
    try {
      session.sparkContext.hadoopConfiguration.set(mySpecialKey, mySpecialValue)
      assert(session.sessionState.newHadoopConf().get(mySpecialKey) == mySpecialValue)
    } finally {
      session.sparkContext.hadoopConfiguration.unset(mySpecialKey)
      session.stop()
    }
  }
}


text:
/*
  Write a recursive method that converts a decimal number into a binary
  number as a string. The method header is:

  public static String dec2Bin(int value)

  Write a test program that prompts the user to enter a decimal number and
  displays its binary equivalent.
*/

import java.util.Scanner;

public class E18_21 {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    System.out.print("Enter an integer: ");
    int value = input.nextInt();

    System.out.println(dec2Bin(value));
  }

  public static String dec2Bin(int value) {
    // Because the recursive method breaks when the value becomes zero through
    // repeated division by 2, we need a separate hook to ensure that when the
    // user enters "0", it will actually be returned in binary, rather than an
    // empty string.
    boolean startingValueIsZero = (value == 0);
    return dec2Bin(value, "", startingValueIsZero);
  }

  public static String dec2Bin(
    int value, String binString, boolean startingValueIsZero) {
    if (startingValueIsZero) {
      return "0";
    } else {
      if (value == 0) { return binString; }
      binString = (value % 2 == 0 ? "0" : "1") + binString;
      return dec2Bin(value / 2, binString, startingValueIsZero);
    }
  }
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.test.bpmn.event.timer;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.activiti.engine.impl.test.PluggableActivitiTestCase;
import org.activiti.engine.impl.util.ClockUtil;
import org.activiti.engine.runtime.Job;
import org.activiti.engine.runtime.JobQuery;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.test.Deployment;

/**
 * @author Joram Barrez
 */
public class BoundaryTimerEventTest extends PluggableActivitiTestCase {

  /*
   * Test for when multiple boundary timer events are defined on the same user
   * task
   *
   * Configuration: - timer 1 -> 2 hours -> secondTask - timer 2 -> 1 hour ->
   * thirdTask - timer 3 -> 3 hours -> fourthTask
   *
   * See process image next to the process xml resource
   */
  @Deployment
  public void testMultipleTimersOnUserTask() {

    // Set the clock fixed
    Date startTime = new Date();

    // After process start, there should be 3 timers created
    ProcessInstance pi = runtimeService.startProcessInstanceByKey("multipleTimersOnUserTask");
    JobQuery jobQuery = managementService.createJobQuery().processInstanceId(pi.getId());
    List<Job> jobs = jobQuery.list();
    assertEquals(3, jobs.size());

    // After setting the clock to time '1 hour and 5 seconds', the second timer should fire
    ClockUtil.setCurrentTime(new Date(startTime.getTime() + ((60 * 60 * 1000) + 5000)));
    waitForJobExecutorToProcessAllJobs(5000L, 25L);
    assertEquals(0L, jobQuery.count());

    // which means that the third task is reached
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("Third Task", task.getName());
  }

  @Deployment
  public void testTimerOnNestingOfSubprocesses() {

    Date testStartTime = ClockUtil.getCurrentTime();

    runtimeService.startProcessInstanceByKey("timerOnNestedSubprocesses");
    List<Task> tasks = taskService.createTaskQuery().orderByTaskName().asc().list();
    assertEquals(2, tasks.size());
    assertEquals("Inner subprocess task 1", tasks.get(0).getName());
    assertEquals("Inner subprocess task 2", tasks.get(1).getName());

    // Timer will fire in 2 hours
    ClockUtil.setCurrentTime(new Date(testStartTime.getTime() + ((2 * 60 * 60 *1000) + 5000)));
    Job timer = managementService.createJobQuery().timers().singleResult();
    managementService.executeJob(timer.getId());

    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("task outside subprocess", task.getName());
  }

  @Deployment
  public void testExpressionOnTimer(){
    // Set the clock fixed
    Date startTime = new Date();

    HashMap<String, Object> variables = new HashMap<String, Object>();
    variables.put("duration", "PT1H");

    // After process start, there should be a timer created
    ProcessInstance pi = runtimeService.startProcessInstanceByKey("testExpressionOnTimer", variables);

    JobQuery jobQuery = managementService.createJobQuery().processInstanceId(pi.getId());
    List<Job> jobs = jobQuery.list();
    assertEquals(1, jobs.size());

    // After setting the clock to time '1 hour and 5 seconds', the second timer should fire
    ClockUtil.setCurrentTime(new Date(startTime.getTime() + ((60 * 60 * 1000) + 5000)));
    waitForJobExecutorToProcessAllJobs(5000L, 25L);
    assertEquals(0L, jobQuery.count());

    // which means the process has ended
    assertProcessEnded(pi.getId());
  }

  // this leaks a job
  @Deployment
  public void FAILING_testTimerInSingleTransactionProcess() {
    ProcessInstance startProcessInstanceByKey = runtimeService.startProcessInstanceByKey("timerOnSubprocesses");
  }

}


text:
package com.ctrip.hermes.producer.monitor;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.locks.ReentrantLock;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.unidal.lookup.annotation.Named;
import org.unidal.tuple.Pair;

import com.ctrip.hermes.core.constants.CatConstants;
import com.ctrip.hermes.core.message.ProducerMessage;
import com.ctrip.hermes.core.transport.command.SendMessageCommand;
import com.ctrip.hermes.core.transport.command.SendMessageResultCommand;
import com.ctrip.hermes.producer.status.ProducerStatusMonitor;
import com.dianping.cat.Cat;
import com.dianping.cat.message.Transaction;
import com.dianping.cat.message.internal.DefaultTransaction;
import com.dianping.cat.message.spi.MessageTree;
import com.google.common.util.concurrent.SettableFuture;

/**
 * @author Leo Liang(jhliang@ctrip.com)
 *
 */
@Named(type = SendMessageResultMonitor.class)
public class DefaultSendMessageResultMonitor implements SendMessageResultMonitor {
	private static final Logger log = LoggerFactory.getLogger(DefaultSendMessageResultMonitor.class);

	private Map<Long, Pair<SendMessageCommand, SettableFuture<Boolean>>> m_cmds = new ConcurrentHashMap<>();

	private ReentrantLock m_lock = new ReentrantLock();

	@Override
	public Future<Boolean> monitor(SendMessageCommand cmd) {
		m_lock.lock();
		try {
			SettableFuture<Boolean> future = SettableFuture.create();
			m_cmds.put(cmd.getHeader().getCorrelationId(), new Pair<SendMessageCommand, SettableFuture<Boolean>>(cmd,
			      future));
			return future;
		} finally {
			m_lock.unlock();
		}
	}

	@Override
	public void resultReceived(SendMessageResultCommand result) {
		if (result != null) {
			Pair<SendMessageCommand, SettableFuture<Boolean>> pair = null;
			m_lock.lock();
			try {
				pair = m_cmds.remove(result.getHeader().getCorrelationId());
			} finally {
				m_lock.unlock();
			}
			if (pair != null) {
				try {
					SendMessageCommand sendMessageCommand = pair.getKey();
					SettableFuture<Boolean> future = pair.getValue();

					ProducerStatusMonitor.INSTANCE.brokerResultReceived(sendMessageCommand.getTopic(),
					      sendMessageCommand.getPartition(), sendMessageCommand.getMessageCount());

					if (isResultSuccess(result)) {
						future.set(true);
					} else {
						future.set(false);
					}
					sendMessageCommand.onResultReceived(result);
					tracking(sendMessageCommand, true);
				} catch (Exception e) {
					log.warn("Exception occurred while calling resultReceived", e);
				}

			}
		}
	}

	private boolean isResultSuccess(SendMessageResultCommand result) {
		Map<Integer, Boolean> successes = result.getSuccesses();
		for (Boolean success : successes.values()) {
			if (!success) {
				return false;
			}
		}

		return true;
	}

	private void tracking(SendMessageCommand sendMessageCommand, boolean success) {
		String status = success ? Transaction.SUCCESS : "Timeout";

		for (List<ProducerMessage<?>> msgs : sendMessageCommand.getProducerMessages()) {
			for (ProducerMessage<?> msg : msgs) {
				Transaction t = Cat.newTransaction("Message.Produce.Acked", msg.getTopic());
				MessageTree tree = Cat.getManager().getThreadLocalMessageTree();

				String msgId = msg.getDurableSysProperty(CatConstants.SERVER_MESSAGE_ID);
				String parentMsgId = msg.getDurableSysProperty(CatConstants.CURRENT_MESSAGE_ID);
				String rootMsgId = msg.getDurableSysProperty(CatConstants.ROOT_MESSAGE_ID);

				tree.setMessageId(msgId);
				tree.setParentMessageId(parentMsgId);
				tree.setRootMessageId(rootMsgId);

				Transaction elapseT = Cat.newTransaction("Message.Produce.Elapse", msg.getTopic());
				if (elapseT instanceof DefaultTransaction) {
					((DefaultTransaction) elapseT).setDurationStart(msg.getBornTimeNano());
					elapseT.addData("command.message.count", sendMessageCommand.getMessageCount());
				}
				elapseT.setStatus(status);
				elapseT.complete();

				t.setStatus(status);
				t.complete();
			}
		}
	}

	@Override
	public void cancel(SendMessageCommand cmd) {
		m_lock.lock();
		try {
			m_cmds.remove(cmd.getHeader().getCorrelationId());
		} finally {
			m_lock.unlock();
		}
	}

}


text:
using System;
using System.ComponentModel.Composition;
using System.IO;
using System.Text;

namespace GameRes.Formats.BaseUnit
{
    [Export(typeof(AudioFormat))]
    public class WstAudio : AudioFormat
    {
        public override string         Tag { get { return "WST"; } }
        public override string Description { get { return "IPAC ADPCM audio format"; } }
        public override uint     Signature { get { return 0x32545357; } } // 'WST2'

        public override SoundInput TryOpen (IBinaryStream file)
        {
            var adpcm_data = new byte[0x20];
            file.Position = 12;
            if (0x1C != file.Read (adpcm_data, 4, 0x1C))
                return null;
            adpcm_data[0] = 0xF4;
            adpcm_data[1] = 7;
            adpcm_data[2] = 7;
            int data_length = (int)(file.Length - file.Position);
            int total_size = 0x4E - 8 + data_length;
            var wav_file = new MemoryStream (total_size+4);
            try
            {
                using (var wav = new BinaryWriter (wav_file, Encoding.Default, true))
                {
                    wav.Write (Wav.Signature);
                    wav.Write (total_size);
                    wav.Write (0x45564157); // 'WAVE'
                    wav.Write (0x20746d66); // 'fmt '
                    wav.Write (0x32);
                    wav.Write ((ushort)2); // ADPCM
                    wav.Write ((ushort)2); // channels
                    wav.Write ((uint)0xAC44);
                    wav.Write ((uint)0xAC44);
                    wav.Write ((ushort)0x800);
                    wav.Write ((ushort)4);
                    wav.Write ((ushort)0x20);
                    wav.Write (adpcm_data, 0, adpcm_data.Length);
                    wav.Write (0x61746164); // 'data'
                    wav.Write (data_length);
                    file.AsStream.CopyTo (wav_file);
                }
                wav_file.Position = 0;
                var sound = new WaveInput (wav_file);
                file.Dispose();
                return sound;
            }
            catch
            {
                wav_file.Dispose();
                throw;
            }
        }
    }
}


text:
namespace TheCollection.Application.Services.ViewModels {

    public class RefValue {
        public RefValue(string id, string name, bool canaddnew) {
            this.id = id;
            this.name = name;
            this.canaddnew = canaddnew;
        }

        public string id { get; }
        public string name { get; }
        public bool canaddnew { get; }
    }
}


text:
title: cursus
slug: rireki
created: 05-08-2016, 17:44
date: 05-08-2016, 17:44
modified: 04-11-2016, 23:18
visible: false
routable: false
robots: 'noindex, nofollow'
taxonomy:
   category: [profile, en]
pure_g: false
pure_u: 2-3
style: 'margin-left: 0px'
---
##Professional cursus

*[JETRO]: Japanese External Trade Organization
*[JLRT]: Japanese Listening and Reading Test

| hidden | hidden |
| -------------------------- | -- |
| 1999 | Obtention of the Certificate of Japanese-Language Proficency Test [Level 3][2] of the Association of International Education, Japan |
| 2003 | Admitted to the  8th JETRO[^1] [Business Japanese Proficency Test JLRT][3][^2]  |
| 2011 | Obtention of the title of [Guide-Conférencier][5] at the [Toulouse-Jean Jaurès University][4] |

[2]: http://www.jlpt.jp/e/index.html "http://www.jlpt.jp/e/index.html"
[3]: http://www.kanken.or.jp/bjt/english/ "http://www.kanken.or.jp/bjt/english/"
[4]: https://www.google.fr/maps/place/Universit%C3%A9+Toulouse+-+Jean+Jaur%C3%A8s/@43.5779941,1.3996184,17z/data=!3m1!4b1!4m5!3m4!1s0x12aeba4c48abb62d:0xaa534804f879cf3b!8m2!3d43.5779941!4d1.4018071 "https://www.google.fr/maps/place/Université+Toulouse+-+Jean+Jaurès"
[5]: http://www.entreprises.gouv.fr/tourisme/metiers/guide-conferencier "http://www.entreprises.gouv.fr/tourisme/metiers/guide-conferencier"
[^1]:
   JETRO: Japanese External Trade Organization
[^2]:
   JLRT: Japanese Listening and Reading Test


text:
#ifndef __USERDB__
#define __USERDB__

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

#include "hiredis_libevent2.h"

#include "ns_turn_utils.h"
#include "ns_turn_maps.h"
#include "ns_turn_server.h"

#include "apputils.h"

#ifdef __cplusplus
extern "C" {
#endif

//////////// Defines //////////////////////////////

#define DEFAULT_USERDB_FILE "turnuserdb.conf"

#define AUTH_SECRET_SIZE (512)

//////////// REALM //////////////

struct _realm_status_t;
typedef struct _realm_status_t realm_status_t;

struct _realm_params_t;
typedef struct _realm_params_t realm_params_t;

struct _realm_status_t {

	vint total_current_allocs;
	ur_string_map *alloc_counters;

};

struct _realm_params_t {

	int is_default_realm;

	realm_options_t options;

	realm_status_t status;

};

void lock_realms(void);
void unlock_realms(void);
void update_o_to_realm(ur_string_map * o_to_realm_new);

//////////// USER DB //////////////////////////////

struct auth_message {
	turnserver_id id;
	turn_credential_type ct;
	int in_oauth;
	int out_oauth;
	int max_session_time;
	u08bits username[STUN_MAX_USERNAME_SIZE + 1];
	u08bits realm[STUN_MAX_REALM_SIZE + 1];
	hmackey_t key;
	st_password_t pwd;
	get_username_resume_cb resume_func;
	ioa_net_data in_buffer;
	u64bits ctxkey;
	int success;
};

enum _TURN_USERDB_TYPE {
	TURN_USERDB_TYPE_FILE=0
#if !defined(TURN_NO_PQ)
	,TURN_USERDB_TYPE_PQ
#endif
#if !defined(TURN_NO_MYSQL)
	,TURN_USERDB_TYPE_MYSQL
#endif
#if !defined(TURN_NO_MONGO)
	,TURN_USERDB_TYPE_MONGO
#endif
#if !defined(TURN_NO_HIREDIS)
	,TURN_USERDB_TYPE_REDIS
#endif
};

typedef enum _TURN_USERDB_TYPE TURN_USERDB_TYPE;

enum _TURNADMIN_COMMAND_TYPE {
	TA_COMMAND_UNKNOWN,
	TA_PRINT_KEY,
	TA_UPDATE_USER,
	TA_DELETE_USER,
	TA_LIST_USERS,
	TA_SET_SECRET,
	TA_SHOW_SECRET,
	TA_DEL_SECRET,
	TA_ADD_ORIGIN,
	TA_DEL_ORIGIN,
	TA_LIST_ORIGINS,
	TA_SET_REALM_OPTION,
	TA_LIST_REALM_OPTIONS
};

typedef enum _TURNADMIN_COMMAND_TYPE TURNADMIN_COMMAND_TYPE;

/////////// SHARED SECRETS //////////////////

struct _secrets_list {
	char **secrets;
	size_t sz;
};
typedef struct _secrets_list secrets_list_t;

/////////// USERS PARAM /////////////////////

#define TURN_LONG_STRING_SIZE (1025)

typedef struct _ram_users_db_t {
	size_t users_number;
	ur_string_map *static_accounts;
	ur_string_map *dynamic_accounts;
	secrets_list_t static_auth_secrets;
} ram_users_db_t;

typedef struct _persistent_users_db_t {

	char userdb[TURN_LONG_STRING_SIZE];
	void *connection;

} persistent_users_db_t;

typedef struct _default_users_db_t
{
	TURN_USERDB_TYPE userdb_type;

	persistent_users_db_t persistent_users_db;

	ram_users_db_t ram_db;

} default_users_db_t;

/////////////////////////////////////////////

realm_params_t* get_realm(char* name);
void set_default_realm_name(char *realm);
int change_total_quota(char *realm, int value);
int change_user_quota(char *realm, int value);

/////////////////////////////////////////////

void init_secrets_list(secrets_list_t *sl);
void init_dynamic_ip_lists(void);
void update_white_and_black_lists(void);
void clean_secrets_list(secrets_list_t *sl);
size_t get_secrets_list_size(secrets_list_t *sl);
const char* get_secrets_list_elem(secrets_list_t *sl, size_t i);
void add_to_secrets_list(secrets_list_t *sl, const char* elem);

/////////// USER DB CHECK //////////////////

int get_user_key(int in_oauth, int *out_oauth, int *max_session_time, u08bits *uname, u08bits *realm, hmackey_t key, ioa_network_buffer_handle nbh);
int get_user_pwd(u08bits *uname, st_password_t pwd);
u08bits *start_user_check(turnserver_id id, turn_credential_type ct, int in_oauth, int *out_oauth, u08bits *uname, u08bits *realm, get_username_resume_cb resume, ioa_net_data *in_buffer, u64bits ctxkey, int *postpone_reply);
int check_new_allocation_quota(u08bits *username, int oauth, u08bits *realm);
void release_allocation_quota(u08bits *username, int oauth, u08bits *realm);

/////////// Handle user DB /////////////////

#if defined(DB_TEST)
	void run_db_test(void);
#endif

void read_userdb_file(int to_print);
void auth_ping(redis_context_handle rch);
void reread_realms(void);
int add_user_account(char *user, int dynamic);
int adminuser(u08bits *user, u08bits *realm, u08bits *pwd, u08bits *secret, u08bits *origin, TURNADMIN_COMMAND_TYPE ct, int is_st, perf_options_t* po);

int add_ip_list_range(const char* range, const char* realm, ip_range_list_t * list);
ip_range_list_t* get_ip_list(const char *kind);
void ip_list_free(ip_range_list_t *l);

///////////// Redis //////////////////////

#if !defined(TURN_NO_HIREDIS)
redis_context_handle get_redis_async_connection(struct event_base *base, const char* connection_string, int delete_keys);
#endif

////////////////////////////////////////////

#ifdef __cplusplus
}
#endif

#endif
/// __USERDB__///


text:
<?php // vim:set ts=4 sw=4 et:
namespace ElasticSearch\DSL\tests\units;

require_once __DIR__ . '/../Base.php';

class Stringify extends \ElasticSearch\tests\Base
{
    public function testNamedTerm() {
        $arr = array(
            'query' => array(
                'term' => array('title' => 'cool')
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $strDsl = (string)$dsl;
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:cool');
    }

    public function testTerm() {
        $arr = array(
            'query' => array(
                'term' => 'cool'
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('cool');
    }

    public function testGroupedTerms() {
        $arr = array(
            'query' => array(
                'term' => 'cool stuff'
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('"cool stuff"');
    }

    public function testNamedGroupedTerms() {
        $arr = array(
            'query' => array(
                'term' => array('title' => 'cool stuff')
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:"cool stuff"');
    }

    public function testSort() {
        $arr = array(
            'sort' => array(
                array('title' => 'desc')
            ),
            'query' => array(
                'term' => array('title' => 'cool stuff')
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:"cool stuff"&sort=title:reverse');

        $arr['sort'] = array('title');
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:"cool stuff"&sort=title');

        $arr['sort'] = array(array('title' => array('reverse' => true)));
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:"cool stuff"&sort=title:reverse');
    }

    public function testLimitReturnFields() {
        $arr = array(
            'fields' => array('title','body'),
            'query' => array(
                'term' => array('title' => 'cool')
            )
        );
        $dsl = new \ElasticSearch\DSL\Stringify($arr);
        $this->assert->string((string) $dsl)
            ->isEqualTo('title:cool&fields=title,body');
    }
}


text:
namespace base {
class FilePath;
}  // namespace base

namespace extensions {

namespace app_file_handler_util {
class MimeTypeCollector;
}  // namespace app_file_handler_util

// Implements the chrome.fileManagerPrivate.executeTask method.
class FileManagerPrivateExecuteTaskFunction
    : public LoggedAsyncExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.executeTask",
                             FILEMANAGERPRIVATE_EXECUTETASK)

 protected:
  virtual ~FileManagerPrivateExecuteTaskFunction() {}

  // AsyncExtensionFunction overrides.
  virtual bool RunAsync() OVERRIDE;

 private:
  void OnTaskExecuted(
      extensions::api::file_manager_private::TaskResult success);
};

// Implements the chrome.fileManagerPrivate.getFileTasks method.
class FileManagerPrivateGetFileTasksFunction
    : public LoggedAsyncExtensionFunction {
 public:
  FileManagerPrivateGetFileTasksFunction();

  DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getFileTasks",
                             FILEMANAGERPRIVATE_GETFILETASKS)

 protected:
  virtual ~FileManagerPrivateGetFileTasksFunction();

  // AsyncExtensionFunction overrides.
  virtual bool RunAsync() OVERRIDE;

 private:
  void OnMimeTypesCollected(scoped_ptr<std::vector<std::string> > mime_types);

  void OnSniffingMimeTypeCompleted(
      scoped_ptr<app_file_handler_util::PathAndMimeTypeSet> path_mime_set,
      scoped_ptr<std::vector<GURL> > file_urls);

  scoped_ptr<app_file_handler_util::MimeTypeCollector> collector_;
  std::vector<GURL> file_urls_;
  std::vector<base::FilePath> local_paths_;
};

// Implements the chrome.fileManagerPrivate.setDefaultTask method.
class FileManagerPrivateSetDefaultTaskFunction
    : public ChromeSyncExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.setDefaultTask",
                             FILEMANAGERPRIVATE_SETDEFAULTTASK)

 protected:
  virtual ~FileManagerPrivateSetDefaultTaskFunction() {}

  // SyncExtensionFunction overrides.
  virtual bool RunSync() OVERRIDE;
};

}  // namespace extensions

#endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_


text:
package hr.fer.zesoi.bioinf.fasta;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Class represents a single FASTA sequence. Sequence name, description and the
 * sequence itself is stored.
 *
 * @author Dino Pacandi
 *
 */
public class FASTASequence {

	/**
	 * Sequence identifier.
	 */
	private String name;

	/**
	 * Sequence description.
	 */
	private String description;

	/**
	 * Sequence.
	 */
	private String sequence;

	/**
	 * Default constructor for FASTA sequence.
	 *
	 * @param name
	 *            Sequence name.
	 * @param description
	 *            Sequence description.
	 * @param sequence
	 *            Sequence itself.
	 */
	public FASTASequence(String name, String description, String sequence) {
		this.name = name;
		this.description = description;
		this.sequence = sequence;
	}

	/**
	 * Getter for sequence name.
	 *
	 * @return Sequence name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Getter for the sequence description.
	 *
	 * @return Sequence description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Getter for the sequence.
	 *
	 * @return Sequence.
	 */
	public String getSequence() {
		return sequence;
	}

	public void writeSequenceAsFASTA(String fileName) {
		StringBuilder sb = new StringBuilder();
		sb.append(">").append(name).append(" ").append(description).append("\n");
		int strLen = sequence.length();
		for (int i = 0; i < strLen; i += 60) {
			sb.append(sequence.substring(i, Math.min(i + 60, strLen))).append("\n");
		}
		try {
			BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
			writer.write(sb.toString());
			writer.close();
		} catch (IOException e) {
			System.err.println("Failed to write sequence to FASTA file: " + fileName);
		}

	}

	/**
	 * Getter for sequence length.
	 *
	 * @return Sequence length.
	 */
	public long getSequenceLength() {
		return sequence.length();
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Sequence name:  ").append(name).append("\n");
		sb.append("Sequence description:  ").append(description).append("\n");

		int strLen = sequence.length();
		for (int i = 0; i < strLen; i += 60) {
			sb.append(sequence.substring(i, Math.min(i + 60, strLen))).append("\n");
		}
		sb.deleteCharAt(sb.length() - 1);

		return sb.toString();
	}

}


text:
Installing HTTP2 support with the curl command

## Command Rundown

1. Just to get us started (really only need git), If you have them, ignore this step:

    ```bash
    user $ sudo apt-get install -y tmux curl vim wget htop git
    ```

2. Check the curl can run:

    ```bash
    user $ curl -I https://nghttp2.org/

    > HTTP/1.1 200 OK
    > Date: Fri, 04 Dec 2015 00:00:06 GMT
    > Content-Type: text/html
    > Content-Length: 6680
    > Last-Modified: Thu, 26 Nov 2015 15:28:33 GMT
    > Etag: "56572521-1a18"
    > Accept-Ranges: bytes
    > X-Backend-Header-Rtt: 0.000642
    > Server: nghttpx nghttp2/1.5.1-DEV
    > Via: 1.1 nghttpx
    > strict-transport-security: max-age=31536000
    ```

    From the result: We can see it returns HTTP1.1 response.

3. Try to send `HTTP2`:

    ```bash
    user $ curl --http2 -I https://nghttp2.org/

    (1)unsupported protocol
    ```

    If get the error message, go on and upgrade CURL to lastest which support HTTP2. Otherwise, you need not do
    run following command.

4. Install ngHttp2:

    CURL supports http2 must depend on third party module [ngHttp2](https://nghttp2.org/), it a `C` library.

    Install dependences

    ```bash
    # Get build requirements
    # Some of these are used for the Python bindings
    # this package also installs
    user $ sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
      zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
      libjemalloc-dev cython python3-dev python-setuptools
    ```

    If you install them failed with `dependencies error`, you can try this first, then run the above commands

    ```
    user $ sudo apt-get -f install
    ```

    Clone the nghttp2 source code from git

    ```bash
    # Build nghttp2 from source
    user $ git clone https://github.com/tatsuhiro-t/nghttp2.git

    # If you have github account and have configured the SSH key, you can try this
    user $ git clone git@github.com:tatsuhiro-t/nghttp2.git
    ```

    Build nghttp2

    ```bash
    user $ cd nghttp2
    user $ autoreconf -i
    user $ automake
    user $ autoconf
    user $ ./configure
    user $ make
    user $ sudo make install
    ```

5. Upgrade or install lastest CURL:

    ```bash
    user $ cd ~
    user $ sudo apt-get build-dep curl
    user $ wget http://curl.haxx.se/download/curl-7.46.0.tar.bz2
    user $ tar -xvjf curl-7.46.0.tar.bz2
    user $ cd curl-7.46.0
    user ~/curl-7.46.0$ ./configure --with-nghttp2=/usr/local --with-ssl
    user ~/curl-7.46.0$ make & sudo make install
    user ~/curl-7.46.0$ sudo ldconfig
    ```

6. Retry the CURL can send HTTP2 request:

    ```bash
    user $ curl --http2 -I https://nghttp2.org/

    > HTTP/2.0 200
    > server:nginx/1.9.7
    > date:Fri, 04 Dec 2015 02:20:54 GMT
    > content-type:text/html
    > content-length:12
    > last-modified:Fri, 04 Dec 2015 02:11:11 GMT
    > etag:"5660f63f-c"
    > accept-ranges:bytes
    ```

    If you get errors, May be the CURL path is wrong, you can try setting this constant to tell curl where to find shared libraries.

    ```bash
    user $ LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/curl --http2 -I nghttp2.org

    > HTTP/2.0 200
    > server:nginx/1.9.7
    > date:Fri, 04 Dec 2015 02:20:54 GMT
    > content-type:text/html
    > content-length:12
    > last-modified:Fri, 04 Dec 2015 02:11:11 GMT
    > etag:"5660f63f-c"
    > accept-ranges:bytes
    ```


text:
class MyUpcomingEventsController {
  constructor() {
    this.name = 'My Upcoming Events';
  }
}

export default MyUpcomingEventsController;


text:
package uk.ac.ncl.la.soar.glance.eval.cli

import cats.MonadError
import monix.eval.Task
import monix.cats._

/**
  * Non-sealed trait which defines a structure for creating cli commands.
  *
  * TODO: Work out whether I should seal this trait. The downside is that both assessor and generator whould have to be
  *   placed in this file, which would hurt readability. Upside is pattern matching and neatness. Alternatives are to
  *   seal this heirarchy and create simple case objects which mix in Assessor and Generator traits defined elsewhere or
  *   to make this a typeclass, which has the benefit of consistency with what I do in other places, but feels overweight.
  */
trait Command[A <: CommandConfig, B] {

  //TODO: abstract over some effect type F. I thought that MonadError was the appropriate typeclass, but Doobie requires
  //  Catchable and Suspendable. Could attempt and rewrap using fromEither, but that seems crazy
  def run(conf: A): Task[B]
}


text:
using Autofac;

using Neo.Gui.Base.Managers.Interfaces;

using Neo.Gui.Wpf.Implementations.Managers;

namespace Neo.Gui.Wpf.RegistrationModules
{
    public class ManagersRegistrationModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder
                .RegisterType<ClipboardManager>()
                .As<IClipboardManager>()
                .SingleInstance();

            builder
                .RegisterType<DialogManager>()
                .As<IDialogManager>()
                .SingleInstance();

            builder
                .RegisterType<SettingsManager>()
                .As<ISettingsManager>()
                .SingleInstance();

            builder
                .RegisterType<ThemeManager>()
                .As<IThemeManager>()
                .SingleInstance();

            base.Load(builder);
        }
    }
}