text:
<?xml version="1.0" encoding="UTF-8"?>
<es:job-bag xmlns:es="http://www.marklogic.com/enhanced-search#">

         <meta property="rnews:description"
               content="In a pioneering experiment, scientists in Japan clone a mouse from white blood cells collected from the tail of a living donor."/>
         <meta property="rnews:datePublished" content="2013-06-27T02:02:45"/>
         <meta property="rnews:thumbnailUrl"
               content="http://news.bbcimg.co.uk/media/images/68391000/jpg/_68391990_58170.jpg"/>
         <meta property="rnews:headline" content="Mouse cloned from drop of blood"/>
         <meta name="CPS_SECTION_PATH" content="Health"/>
         <meta property="rnews:creator" content="http://www.bbc.co.uk#org"/>
         <link rel="copyright"
               href="http://www.bbc.co.uk/terms/"
               title="Terms of Use"/>
         <link rel="http://purl.org/dc/terms/source"
               href="http://www.bbc.co.uk/news/health-23068423"/>
         <title>BBC News - Mouse cloned from drop of blood</title>

               27 June 2013
               Last updated
at
               03:02

Mouse cloned from drop of blood

               By Helen
Briggs
               BBC News

               The mouse was cloned from a blood cell

Scientists in Japan
have cloned a mouse from a single drop of blood.

Circulating blood cells collected from the tail of a donor mouse
were used to produce the clone, a team at the Riken BioResource
Center
reports in the journal Biology of Reproduction.

The female mouse lived a normal lifespan and could give birth to
young, say the researchers.

Scientists at a linked institute recently created nearly 600
exact genetic copies of one mouse.

Mice have been cloned from several different sources of donor
cells, including white blood cells found in the lymph nodes, bone
marrow and liver.

The Japanese research group investigated
whether circulating blood cells could also be used for cloning.

Their aim was to find an easily available source of donor cells
to clone scientifically valuable strains of laboratory mice.

The team, led by Atsuo Ogura, of Riken BioResource Center in
Tsukuba, took blood from the tail of a donor mouse, isolated the
white blood cells, and used the nuclei for cloning experiments,
using the same technique that produced Dolly the sheep in
Edinburgh.

The process, known as somatic cell nuclear transfer, involves
transferring the nucleus from an adult body cell - such as a blood
or skin cell - into an unfertilised egg that has had its nucleus
removed.

Reporting their findings in the US journal, Biology of Reproduction, the
scientists said the study "demonstrated for the first time that
mice could be cloned using the nuclei of peripheral blood
cells".

They added: "These cells could be used for cloning immediately
after collection and no donor animals need to be euthanised.

"This technique would be applicable for
generating genetic copies of invaluable strains of mice, which
cannot be preserved by other assisted reproductive techniques such
as conventional in vitro fertilisation or intracytoplasmic sperm
injection."

Scientists in Japan have years of experience in cloning
mice.

A team at a linked institute recently revealed they had produced
almost 600 mice from one donor mouse after 25 consecutive rounds of
cloning.

The research is aimed at large-scale production of high-quality
animals for farming or conservation purposes, they say.

Commenting on the study, Professor Robin Lovell-Badge of the MRC
National Institute of Medical Research in London, said it was a
useful small advance on previous work showing that it is possible
to clone mice from a variety of adult cell types, including white
blood cells.

He told BBC News: "The efficiency of cloning from these cell
types was very good, suggesting that even a small drop of blood
will contain sufficient numbers...this is helpful if the intention
is to use cloning to propagate and expand numbers of rare or
valuable types of individual or species."

Related Stories

                  GM cows make 'low allergy' milk

                  US confidence in clone
food

"Start Quote

This technique would be applicable for
generating genetic copies of invaluable strains of mice"

            End Quote
            Research team
            Riken BioResource Center, Tsukuba

The cloning method - somatic cell nuclear transfer

Clones of adult animals are produced by a method called somatic
cell nuclear transfer, which refers to the transfer of the nucleus
from a somatic cell into an egg cell

A somatic cell is any cell of the body apart from a germ (sex)
cell

In cloning, the nucleus of a somatic cell is removed and
inserted into a donor unfertilised egg that has had its own nucleus
(containing the genetic material) removed

The embryo is then placed inside a surrogate mother.

   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:og="http://opengraphprotocol.org/schema/"
            xmlns:rnews="http://iptc.org/std/rNews/2011-10-07#">
      <rdf:Description rdf:about="http://www.bbc.co.uk/news/health-23068423">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#NewsItem"/>
         <rnews:identifier rdf:resource="http://www.bbc.co.uk/news/health-23068423"/>
         <rnews:usageTerms rdf:resource="http://www.bbc.co.uk/terms/"/>
         <rnews:description xml:lang="en-GB">In a pioneering experiment, scientists in Japan clone a mouse from white blood cells collected from the tail of a living donor.</rnews:description>
         <rnews:datePublished rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-06-27T02:02:45</rnews:datePublished>
         <rnews:thumbnailUrl rdf:resource="http://news.bbcimg.co.uk/media/images/68391000/jpg/_68391990_58170.jpg"/>
         <rnews:headline xml:lang="en-GB">Mouse cloned from drop of blood</rnews:headline>
         <rnews:articleSection rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Health</rnews:articleSection>
         <rnews:creator rdf:resource="http://www.bbc.co.uk#org"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68384000/jpg/_68384834_58170.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/health-23068423"/>
         <rnews:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">304</rnews:width>
         <rnews:height rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">171</rnews:height>
         <rnews:description xml:lang="en-GB">cloned mouse</rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       c:allowDistribution="true"
                       c:allowSearch="false"
                       c:calaisRequestID="de7d9d10-4f54-4500-13fb-dca7a911b944"
                       c:externalID="mluces"
                       c:id="http://id.opencalais.com/6spHS7VZnwKp4FlSkVZ2vA"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfo"/>
         <c:docDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2013-06-27</c:docDate>
         <c:submitter>ml</c:submitter>
         <owl:sameAs xmlns:owl="http://www.w3.org/2002/07/owl#"
                     rdf:resource="http://www.bbc.co.uk/news/health-23068423"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       c:contentType="TEXT/HTML"
                       c:emVer="7.1.1103.5"
                       c:langIdVer="DefaultLangId"
                       c:language="English"
                       c:processingVer="CalaisJob01"
                       c:submissionDate="2013-07-08 06:18:50.897"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/meta">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:submitterCode>c2b78ae4-093d-1686-b3f0-28ae1ba30b6e</c:submitterCode>
         <c:signature>digestalg-1|YAiLBSI+GS+h9u9pYg8IpNwTaiE=|LjznzOv3p1UqjV/RdzbcUjZxL19OCmOiTXATtgbLMRJJiZddyp+Fig==</c:signature>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/lid/DefaultLangId">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/lid/DefaultLangId"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:lang rdf:resource="http://d.opencalais.com/lid/DefaultLangId/English"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/cat/1">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/cat/DocCat"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:category rdf:resource="http://d.opencalais.com/cat/Calais/Health_Medical_Pharma"/>
         <c:classifierName>Calais</c:classifierName>
         <c:categoryName>Health_Medical_Pharma</c:categoryName>
         <c:score rdf:datatype="http://www.w3.org/2001/XMLSchema#double">1.000</c:score>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/9a6cc1af-de72-3659-ac71-79fa72e64fd6">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Facility"/>
         <c:name>MRC National Institute of Medical Research</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/1">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/9a6cc1af-de72-3659-ac71-79fa72e64fd6"/>
         <c:relevance>0.078</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/ed1c9b63-4b8e-311f-b8db-0f90ea812660">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Country"/>
         <c:name>Japan</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/2">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/ed1c9b63-4b8e-311f-b8db-0f90ea812660"/>
         <c:relevance>0.120</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/4b5a87a0-88ea-304a-bde5-d13a2874ce9a">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonCareer"/>
         <c:person rdf:resource="http://d.opencalais.com/pershash-1/7908a097-1ed3-3b26-89ef-250e100e838e"/>
         <c:organization rdf:resource="http://d.opencalais.com/genericHasher-1/a31318f1-86a9-31ec-be23-852d4db38ee3"/>
         <c:careertype>professional</c:careertype>
         <c:status>current</c:status>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/d56d14fb-5c59-3c7a-a434-a66563326c63">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Technology"/>
         <c:name>nuclear transfer</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/3">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/d56d14fb-5c59-3c7a-a434-a66563326c63"/>
         <c:relevance>0.202</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/89108bf8-c249-3a2d-83bf-cd3eb52ea126">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Position"/>
         <c:name>Professor</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/4">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/89108bf8-c249-3a2d-83bf-cd3eb52ea126"/>
         <c:relevance>0.078</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/0fc77b57-db5b-3271-b4b7-c86a8512c2ea">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Organization"/>
         <c:name>MRC National Institute of Medical Research in London</c:name>
         <c:organizationtype>N/A</c:organizationtype>
         <c:nationality>British</c:nationality>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/5">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/0fc77b57-db5b-3271-b4b7-c86a8512c2ea"/>
         <c:relevance>0.078</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/er/geo/country/ralg-geo1/152649df-347e-e289-1a9e-acc883e07d17">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/er/Geo/Country"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305"/>
         <c:name>United States</c:name>
         <c:latitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">40.4230003233</c:latitude>
         <c:longitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">-98.7372244786</c:longitude>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/11b874c0-6a9f-3b12-9e32-7f02df463fac">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonCareer"/>
         <c:person rdf:resource="http://d.opencalais.com/pershash-1/4183a875-1b47-3b00-bcc5-3d9af1854063"/>
         <c:position rdf:resource="http://d.opencalais.com/genericHasher-1/89108bf8-c249-3a2d-83bf-cd3eb52ea126"/>
         <c:organization rdf:resource="http://d.opencalais.com/genericHasher-1/0fc77b57-db5b-3271-b4b7-c86a8512c2ea"/>
         <c:careertype>professional</c:careertype>
         <c:status>current</c:status>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Country"/>
         <c:name>United States</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/6">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305"/>
         <c:relevance>0.179</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/03bf909f-8233-3e09-b7f9-c00aef5c4770">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/MedicalTreatment"/>
         <c:name>assisted reproductive techniques</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/7">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/03bf909f-8233-3e09-b7f9-c00aef5c4770"/>
         <c:relevance>0.138</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/er/geo/country/ralg-geo1/578ed5a4-eecf-5a15-803a-bdc49f6152d6">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/er/Geo/Country"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/ed1c9b63-4b8e-311f-b8db-0f90ea812660"/>
         <c:name>Japan</c:name>
         <c:latitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">35.4111749285</c:latitude>
         <c:longitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">135.833685568</c:longitude>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/a31318f1-86a9-31ec-be23-852d4db38ee3">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Organization"/>
         <c:name>Riken BioResource Center</c:name>
         <c:organizationtype>N/A</c:organizationtype>
         <c:nationality>N/A</c:nationality>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/8">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a31318f1-86a9-31ec-be23-852d4db38ee3"/>
         <c:relevance>0.410</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/b7a0b7eb-844f-3433-a77c-d1ba48e8bd84">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Technology"/>
         <c:name>cloning</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/9">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b7a0b7eb-844f-3433-a77c-d1ba48e8bd84"/>
         <c:relevance>0.670</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/pershash-1/7908a097-1ed3-3b26-89ef-250e100e838e">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/>
         <c:name>Atsuo Ogura</c:name>
         <c:persontype>N/A</c:persontype>
         <c:nationality>N/A</c:nationality>
         <c:commonname>Atsuo Ogura</c:commonname>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/10">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/pershash-1/7908a097-1ed3-3b26-89ef-250e100e838e"/>
         <c:relevance>0.224</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/0674d0e6-7c17-3a19-b5c9-999d1972b3ca">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/PublishedMedium"/>
         <c:name>the US journal</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/11">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/0674d0e6-7c17-3a19-b5c9-999d1972b3ca"/>
         <c:relevance>0.179</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/daeb2d32-1f8b-3739-81a3-b7874c8fc145">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Facility"/>
         <c:name>Riken BioResource Center</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/12">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/daeb2d32-1f8b-3739-81a3-b7874c8fc145"/>
         <c:relevance>0.320</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/pershash-1/4183a875-1b47-3b00-bcc5-3d9af1854063">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/>
         <c:name>Robin Lovell-Badge</c:name>
         <c:persontype>N/A</c:persontype>
         <c:nationality>N/A</c:nationality>
         <c:commonname>Robin Lovell-Badge</c:commonname>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/13">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/pershash-1/4183a875-1b47-3b00-bcc5-3d9af1854063"/>
         <c:relevance>0.078</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/f8d4beae-e28f-3d9b-adc0-ab8619e790c7">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/City"/>
         <c:name>Edinburgh</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/14">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/f8d4beae-e28f-3d9b-adc0-ab8619e790c7"/>
         <c:relevance>0.224</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/comphash-1/33d20acf-9f02-3410-98ed-eedc9165cc7d">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Company"/>
         <c:name>BBC News</c:name>
         <c:nationality>N/A</c:nationality>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/15">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/comphash-1/33d20acf-9f02-3410-98ed-eedc9165cc7d"/>
         <c:relevance>0.068</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/b05259af-1bad-3cb2-b7db-683d39559a91">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/MedicalTreatment"/>
         <c:name>intracytoplasmic sperm injection</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3/Relevance/16">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/2c81d688-fbca-3738-9ee6-1cfc15e588b3"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b05259af-1bad-3cb2-b7db-683d39559a91"/>
         <c:relevance>0.138</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/71bccbb9-02fb-3c53-a9e5-278a9f5075af">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonLocation"/>
         <c:persongroup>scientists</c:persongroup>
         <c:locationstring>Japan</c:locationstring>
      </rdf:Description>
   </rdf:RDF>
</es:job-bag>


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

  angular
      .module('Note.folder')
      .controller('FolderController', FolderController);

  FolderController.$inject = [
    '$scope', '$state', '$stateParams', '$rootScope',
    '$ionicModal', '$cordovaDialogs', '$ionicLoading',
    'FolderUtils'
  ];

  function FolderController($scope, $state, $stateParams, $rootScope,
                             $ionicModal, $cordovaDialogs, $ionicLoading,
                             FolderUtils) {
    var folderId = $stateParams.folderId;
    var isUpdate = $stateParams.update;
    $scope.notesDone = 0;

    getFolder(folderId);
    getNotes(folderId);

    function getFolder(folderId) {
      $ionicLoading.show({
        template: '<ion-spinner icon="bubbles"></ion-spinner>'
      });

      FolderUtils.getFolder(folderId)
          .then(function (folder) {
            $scope.folder = folder;

            $ionicLoading.hide();

            if (isUpdate) {
              $scope.updateFolderDialog.show();
            }
          }, function (err) {
            console.log(err);
          });
    }

    function getNotes(folderId) {
      FolderUtils.getNotes(folderId)
          .then(function (notes) {
            $scope.notes = notes;

            for(var i in $scope.notes) {
              if ($scope.notes[i].done) $scope.notesDone++;
            }

            console.log(notes);
          }, function (err) {
            console.log(err);
          });
    }

    $ionicModal.fromTemplateUrl('update-folder-modal.html', {
      scope: $scope,
      animation: 'slide-in-up'
    }).then(function (modal) {
      $scope.updateFolderDialog = modal;
    });

    $scope.getNoteInfo = function (note) {
      $state.go('app.note', { noteId: note._id });
    };

    $scope.updateFolder = function () {
      $scope.updateFolderDialog.show();
    };

    $scope.closeFolderDialog = function () {
      $scope.updateFolderDialog.hide();
    };

    $scope.saveUpdate = function () {
      FolderUtils.updateFolder($scope.folder)
          .then(function (ok) {
            $scope.updateFolderDialog.hide();
          }, function (err) {
            console.log(err);
          })
    };

    $scope.removeFolder = function () {
      $cordovaDialogs.confirm('Are you want to remove folder: ' + $scope.folder.title + '?', 'Remove folder', [ 'Remove', 'Cancel' ])
          .then(function(buttonIndex) {
            if (buttonIndex != 1) { return; }

            FolderUtils.removeFolder($scope.folder._id)
                .then(function (ok) {
                  $state.go('app.folders');
                }, function (err) {
                  console.log(err);
                });

          });
    };

    $scope.createNote = function () {
      $rootScope.wereCreateNote = 'app.folder';
      $rootScope.wereCreateNoteParams = {
        folderId: folderId
      };

      $state.go('app.newNote');
    };
  }
})();

redpajama_set_name: RedPajamaGithub


text:
package org.apache.ambari.server.audit.request.creator;

import java.util.Collection;
import java.util.Collections;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;

public class AuditEventCreatorTestBase {

  protected final static String userName = "testuser";

  @BeforeClass
  public static void beforeClass() {
    SecurityContextHolder.setContext(new SecurityContext() {
      @Override
      public Authentication getAuthentication() {
        return new Authentication() {
          @Override
          public Collection<? extends GrantedAuthority> getAuthorities() {
            return null;
          }

          @Override
          public Object getCredentials() {
            return null;
          }

          @Override
          public Object getDetails() {
            return null;
          }

          @Override
          public Object getPrincipal() {
            return new User(userName, "password", Collections.emptyList());
          }

          @Override
          public boolean isAuthenticated() {
            return true;
          }

          @Override
          public void setAuthenticated(boolean b) throws IllegalArgumentException {

          }

          @Override
          public String getName() {
            return ((User) getPrincipal()).getUsername();
          }
        };
      }

      @Override
      public void setAuthentication(Authentication authentication) {

      }
    });
  }
  @AfterClass
  public static void afterClass(){
    SecurityContextHolder.clearContext();
  }
}


text:
package com.tvh.tricsql.test.load;

public interface WebAppLoadTestConstants {

	String MAKE = "make";

	String MODEL = "model";

}


text:
module CP
  module Shape

    class Circle

      attr_reader :radius, :center

      def initialize_with_radius body, radius, center
        @radius, @center = radius, center
        initialize_without_radius body, radius, center
      end
      alias_method_chain :initialize, :radius

      def debug window, _
        window.draw_circle body.p.x, body.p.y, radius, Gosu::Color::RED
      end

    end

  end
end


text:
<?php

namespace Magento\Quote\Test\Unit\Model\GuestCart;

class GuestCartRepositoryTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Quote\Model\GuestCart\GuestCartRepository
     */
    protected $model;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $quoteMock;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $quoteRepositoryMock;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $quoteIdMaskFactoryMock;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $quoteIdMaskMock;

    /**
     * @var string
     */
    protected $maskedCartId;

    /**
     * @var int
     */
    protected $cartId;

    protected function setUp()
    {
        $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->quoteRepositoryMock = $this->getMock('Magento\Quote\Api\CartRepositoryInterface', [], [], '', false);
        $this->quoteMock = $this->getMock('Magento\Quote\Model\Quote', [], [], '', false);

        $this->maskedCartId = 'f216207248d65c789b17be8545e0aa73';
        $this->cartId = 123;

        $guestCartTestHelper = new GuestCartTestHelper($this);
        list($this->quoteIdMaskFactoryMock, $this->quoteIdMaskMock) = $guestCartTestHelper->mockQuoteIdMask(
            $this->maskedCartId,
            $this->cartId
        );

        $this->model = $objectManager->getObject(
            'Magento\Quote\Model\GuestCart\GuestCartRepository',
            [
                'quoteRepository' => $this->quoteRepositoryMock,
                'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock
            ]
        );
    }

    public function testGet()
    {
        $this->quoteRepositoryMock->expects($this->once())->method('get')->willReturn($this->quoteMock);
        $this->assertEquals($this->quoteMock, $this->model->get($this->maskedCartId));
    }
}


text:
<?php

/**
 * Zend_XmlRpc_Value_Scalar
 */
require_once 'Zend/XmlRpc/Value/Scalar.php';

/**
 * @category   Zend
 * @package    Zend_XmlRpc
 * @subpackage Value
 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_XmlRpc_Value_DateTime extends Zend_XmlRpc_Value_Scalar
{

    /**
     * Set the value of a dateTime.iso8601 native type
     *
     * The value is in iso8601 format, minus any timezone information or dashes
     *
     * @param mixed $value Integer of the unix timestamp or any string that can be parsed
     *                     to a unix timestamp using the PHP strtotime() function
     */
    public function __construct($value)
    {
        $this->_type = self::XMLRPC_TYPE_DATETIME;

        // If the value is not numeric, we try to convert it to a timestamp (using the strtotime function)
        if (is_numeric($value)) {   // The value is numeric, we make sure it is an integer
            $value = (int)$value;
        } else {
            $value = strtotime($value);
            if ($value === false || $value == -1) { // cannot convert the value to a timestamp
                throw new Zend_XmlRpc_Value_Exception('Cannot convert given value \''. $value .'\' to a timestamp');
            }
        }
        $value = date('c', $value); // Convert the timestamp to iso8601 format

        // Strip out TZ information and dashes
        $value = preg_replace('/(\+|-)\d{2}:\d{2}$/', '', $value);
        $value = str_replace('-', '', $value);

        $this->_value = $value;
    }

    /**
     * Return the value of this object as iso8601 dateTime value
     *
     * @return int As a Unix timestamp
     */
    public function getValue()
    {
        return $this->_value;
    }

}


text:
![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)

Debian image that will be base of my docker containers.

## License

This is free sofware licensed under MIT license. See LICENSE file.


text:
TelemetryRails::Engine.routes.draw do
  match 'dismiss', to: 'telemetry#dismiss', as: :dismiss, via: [:get, :post]
end


text:
package net.ssehub.easy.instantiation.core.model.buildlangModel.matchLoop;

import net.ssehub.easy.instantiation.core.model.buildlangModel.Rule;
import net.ssehub.easy.instantiation.core.model.common.VilException;

/**
 * Applies the result of the matches determined by the
 * {@link LhsRhsMatchLoop#matchLoop(Rule, Object[], Applicator, ITracer)} method.
 *
 * @author Holger Eichelberger
 */
public abstract class Applicator {

    protected Rule rule;
    protected Object[] rhsValues;

    /**
     * Initializes the applicator for the underlying loop. This method has been
     * defined here in order to ensure consistency between applicator and underlying
     * loop.
     *
     * @param rule the rule to work on
     * @param rhsValues the RHS value
     */
    protected void initialize(Rule rule, Object[] rhsValues) {
        this.rule = rule;
        this.rhsValues = rhsValues;
    }

    /**
     * Apply this applicator for one combination which requires building. This may
     * be due to the fact that rhsValue
     *

     *
is newer than expectedLhsValue

     *
exists but expectedLhsValue does not exist

     *
exists but no LHS is specified (expectedLhsValue is null)
     *

     *
     * @param expectedLhsValue the expected result after building rhsValue (may be null)
     * @param rhsValue the value determined for the right side as part of a match
     * @param index the 0-based index of the RHS match condition in the specifying rule ({@link #getElementCount()}
     * @throws IndexOutOfBoundsException if index is invalid
     * @throws VilException in case that executing parts of a rule or setting variable values fails
     */
    public abstract void apply(Object expectedLhsValue, Object rhsValue, int index) throws VilException;

    /**
     * Returns the value of the elements handles by this applicator, i.e., the maximum index + 1.
     *
     * @return the element count
     */
    public int getElementCount() {
        return null == rhsValues ? 0 : rhsValues.length;
    }

    /**
     * Enables a pre-exit of the match loop.
     *
     * @return true if the match loop shall exit before the next iteration,
     *   false if the loop shall continue (default)
     */
    protected boolean stopMatchLoop() {
        return false;
    }

    /**
     * Enables a pre-exit of the condition loop.
     *
     * @return true if the condition loop shall exit before the next iteration,
     *   false if the loop shall continue (default)
     */
    protected boolean stopConditionLoop() {
        return false;
    }

    /**
     * Notifies when the match loop terminated.
     *
     * @throws VilException in case that executing parts of a rule fails
     */
    protected void matchLoopFinished() throws VilException {
    }

    /**
     * Notifies when the condition loop terminated.
     *
     * @throws VilException in case that executing parts of a rule fails
     */
    protected void conditionLoopFinished() throws VilException {
    }

}


text:
package greenapi.core.model.data;

import greenapi.core.model.resources.net.NetworkInterface;

public class TxNetworkInterfaceData extends NetworkInterfaceData {

	/**
	 * Serial code version serialVersionUID
	 */
	private static final long serialVersionUID = -6392966571035880614L;

	private final long collisions;

	private final long carrier;

	public TxNetworkInterfaceData(NetworkInterface networkInterface,
			long bytes, long dropped, long overruns, long errors, long packets,
			long collisions, long carrier) {
		super(networkInterface, bytes, dropped, overruns, errors, packets);
		this.collisions = collisions;
		this.carrier = carrier;
	}

	@Override
	public NetworkInterfaceDataType type() {
		return NetworkInterfaceDataType.TX;
	}

	/**
	 * @return the collisions
	 */
	public long collisions() {
		return collisions;
	}

	/**
	 * @return the carrier
	 */
	public long carrier() {
		return carrier;
	}
}


text:
#include <Core/Algorithms/Fields/TransformMesh/GeneratePolarProjectionImage.h>
#include <Core/Algorithms/Fields/TransformMesh/PolarProjectionTools.h>

#include <Core/Geometry/Transform.h>

#include <Core/Datatypes/VField.h>
#include <Core/Datatypes/VMesh.h>
#include <Core/Datatypes/FieldInformation.h>

namespace SCIRunAlgo {

using namespace SCIRun;

bool
GeneratePolarProjectionImageAlgo::
run(FieldHandle input,
    FieldHandle& mask_field,
    FieldHandle& point_field,
    FieldHandle& area_field)
{
  FieldHandle x,y,z;
  return (run(input,mask_field,point_field,area_field,x,y,z));
}

bool
GeneratePolarProjectionImageAlgo::
run(FieldHandle input,
    FieldHandle& point_field,
    FieldHandle& mask_field,
    FieldHandle& area_field,
    FieldHandle& x_field,
    FieldHandle& y_field,
    FieldHandle& z_field)
{
  // Mark that we are starting the algorithm, but do not report progress
  algo_start("GeneratePolarProjectionImage");

  // Handle: the function get_rep() returns the pointer contained in the handle
  if (input.get_rep() == 0)
  {
    // If we encounter a null pointer we return an error message and return to
    // the program to deal with this error.
    error("No input field");
    algo_end(); return (false);
  }

  FieldInformation fi(input);

  // First find dimensions of the mesh.

  Point origin = get_point("origin");
  Vector axis = get_vector("direction");

  // Find the two vectors that span the image plane
  Vector v1, v2;
  axis.normalize();
  axis.find_orthogonal(v1,v2);
  v1.normalize();
  v2.normalize();

  VMesh* imesh = input->vmesh();

  // Find the node that is the origin of the projection
  imesh->synchronize(Mesh::NODES_E|Mesh::DELEMS_E|
                     Mesh::ELEM_NEIGHBORS_E|Mesh::NODE_NEIGHBORS_E|
                     Mesh::FIND_CLOSEST_NODE_E);

  VMesh::Node::index_type start_node;
  Point p_origin;

  imesh->find_closest_node(p_origin,start_node,origin);

  // Get number of nodes in mesh
  VMesh::size_type num_nodes = imesh->num_nodes();

  BBox bbox;
  bbox.extend(Point(0.0,0.0,0.0));

  // compute a bounding box around the projection field
  for (VMesh::Node::index_type idx=0; idx<num_nodes; idx++)
  {
    Point p;
    imesh->get_center(p,idx);

    double length = 0.0;
    Point point;

    Vector normal = Cross(p-p_origin,axis);
    if(normal.normalize() > 0.0)
    {
      if(!(GenerateEdgeProjection(imesh,start_node,normal,axis,-1.0,idx,point,length)))
        length = 0.0;
    }

    Vector v = p - p_origin;
    v.safe_normalize();

    double d1 = Abs(Dot(v,v1));
    double d2 = Abs(Dot(v,v2));

    bbox.extend(Point(2.0*(d1/(d1+d2))*length,2.0*(d2/(d1+d2))*length,0.0));
  }

  bbox.extend(0.1*bbox.diagonal().length());

  Vector d = bbox.diagonal();
  double xy = Max(Abs(d.x()),Abs(d.y()));

  Point corner = origin + 0.5*(v1*xy + v2*xy);
  Transform Trans(corner,-v1*xy,-v2*xy,Cross(-v1,-v2));

  VMesh::size_type xsize = get_int("xsize");
  VMesh::size_type ysize = get_int("ysize");

  FieldInformation mask_fo(IMAGEMESH_E,CONSTANTDATA_E,CHAR_E);
  FieldInformation point_fo(IMAGEMESH_E,CONSTANTDATA_E,VECTOR_E);
  FieldInformation area_fo(IMAGEMESH_E,CONSTANTDATA_E,DOUBLE_E);
  FieldInformation x_fo(IMAGEMESH_E,CONSTANTDATA_E,DOUBLE_E);
  FieldInformation y_fo(IMAGEMESH_E,CONSTANTDATA_E,DOUBLE_E);
  FieldInformation z_fo(IMAGEMESH_E,CONSTANTDATA_E,DOUBLE_E);

  MeshHandle mesh = CreateMesh(mask_fo,xsize,ysize,Point(0.0,0.0,0.0),Point(1.0,1.0,0.0));
  mesh->vmesh()->transform(Trans);

  if (mesh.get_rep() == 0)
  {
    error("Could not generate output mesh");
    algo_end(); return (false);
  }

  mask_field = CreateField(mask_fo,mesh);
  point_field = CreateField(point_fo,mesh);
  area_field = CreateField(area_fo,mesh);
  x_field = CreateField(area_fo,mesh);
  y_field = CreateField(area_fo,mesh);
  z_field = CreateField(area_fo,mesh);

  VMesh* omesh = mesh->vmesh();
  VField* mfield = mask_field->vfield();
  VField* pfield = point_field->vfield();
  VField* afield = area_field->vfield();
  VField* xfield = x_field->vfield();
  VField* yfield = y_field->vfield();
  VField* zfield = z_field->vfield();

  if (mfield == 0)
  {
    error("Could not allocate mask field");
    algo_end(); return (false);
  }

  if (pfield == 0)
  {
    error("Could not allocate projection point field");
    algo_end(); return (false);
  }

  if (afield == 0)
  {
    error("Could not allocate area field");
    algo_end(); return (false);
  }

  if (xfield == 0)
  {
    error("Could not allocate x field");
    algo_end(); return (false);
  }

  if (yfield == 0)
  {
    error("Could not allocate y field");
    algo_end(); return (false);
  }

  if (zfield == 0)
  {
    error("Could not allocate z field");
    algo_end(); return (false);
  }

  // Get number of nodes in mesh
  VMesh::size_type num_elems = omesh->num_elems();
  Point p, point;
  VMesh::Node::array_type nodes;
  std::vector<Point> points(4);

  for (VMesh::Elem::index_type idx=0; idx<num_elems; idx++)
  {
    omesh->get_center(p,idx);
    Vector v = p-origin;
    Vector normal = Cross(v,axis);
    double distance = v.length();
    double length;
    bool valid = true;

    if(normal.normalize() > 0.0)
    {
      if(!(GenerateEdgeProjection(imesh,start_node,normal,axis,distance,-1,point,length)))
      {
        valid = false;
      }
    }
    else
    {
      length = 0.0; point = p_origin;
    }

    // Set mask indicating which pixels actually contain data
    // Set point of the original data where it is located

    omesh->get_nodes(nodes,idx);
    omesh->get_centers(points,nodes);
    double area = 0.0;

    if (points.size() == 4)
    {
      for (size_t k=0;k<4;k++)
      {
        Vector v = points[k]-origin;
        Vector normal = Cross(v,axis);
        double distance = v.length();
        double length;
        Point  point;
        if(normal.normalize() > 0.0)
        {
          if(!(GenerateEdgeProjection(imesh,start_node,normal,axis,distance,-1,points[k],length)))
          {
            valid = false;
          }
        }
        else
        {
          points[k] = p_origin;
        }
      }
    }

    if (valid)
    {
      area = 0.5*(Cross(points[0]-points[1],points[0]-points[3]).length()) +
             0.5*(Cross(points[2]-points[1],points[2]-points[3]).length());
    }

    if (valid)
    {
      mfield->set_value(1,idx);
      pfield->set_value(point.asVector(),idx);
      afield->set_value(area,idx);
      xfield->set_value(point.x(),idx);
      yfield->set_value(point.y(),idx);
      zfield->set_value(point.z(),idx);
    }
    else
    {
      mfield->set_value(0,idx);
      pfield->set_value(Vector(0.0,0.0,0.0),idx);
      afield->set_value(0.0,idx);
      xfield->set_value(0.0,idx);
      yfield->set_value(0.0,idx);
      zfield->set_value(0.0,idx);
    }

  }

  // Success:
  algo_end(); return (true);
}

} // End namespace SCIRunAlgo


text:
// Copyright 2013 Google Inc.
//
// 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.

/**
 * @fileoverview Walkers to traverse a table.
 * @author dtseng@google.com (David Tseng)
 */

goog.provide('cvox.TableShifter');

goog.require('cvox.AbstractShifter');
goog.require('cvox.ColumnWalker');
goog.require('cvox.CursorSelection');
goog.require('cvox.DomPredicates');
goog.require('cvox.DomUtil');
goog.require('cvox.NavBraille');
goog.require('cvox.RowWalker');

/**
 * @constructor
 * @extends {cvox.AbstractShifter}
 */
cvox.TableShifter = function() {
  this.rowWalker_ = new cvox.RowWalker();
  this.columnWalker_ = new cvox.ColumnWalker();
  this.currentWalker_ = this.rowWalker_;
  this.bumpedEdge_ = false;
  this.begin_ = true;
  goog.base(this);
};
goog.inherits(cvox.TableShifter, cvox.AbstractShifter);

/**
 * @override
 */
cvox.TableShifter.prototype.next = function(sel) {
  var nextSel = this.currentWalker_.next(sel);
  if (!nextSel) {
    // Bumped edge.
    this.bumpedEdge_ = true;
    return sel;
  }
  return nextSel;
};

/**
 * @override
 */
cvox.TableShifter.prototype.sync = function(sel) {
  if (sel.start.node.tagName == 'TABLE') {
    return sel.isReversed() ? this.currentWalker_.goToLastCell(sel) :
        this.currentWalker_.goToFirstCell(sel);
  }
  return this.currentWalker_.sync(sel);
};

/**
 * @override
 */
cvox.TableShifter.prototype.getName = function() {
  return cvox.ChromeVox.msgs.getMsg('table_shifter');
};

/**
 * @override
 * @suppress {checkTypes} actual parameter 2 of
 * cvox.AbstractMsgs.prototype.getMsg does not match formal parameter
 * found   : Array.<number>
 * required: (Array.<string>|null|undefined)
 */
cvox.TableShifter.prototype.getDescription = function(prevSel, sel) {
  var descs = this.currentWalker_.getDescription(prevSel, sel);
  if (descs.length > 0) {
    if (this.bumpedEdge_) {
      descs[0].pushEarcon(cvox.AbstractEarcons.WRAP_EDGE);
      this.bumpedEdge_ = false;
    }
    if (this.begin_) {
      var len = descs.length;
      var summaryText = this.currentWalker_.tt.summaryText();
      var locationInfo = this.currentWalker_.getLocationInfo(sel);
      if (locationInfo != null) {
        descs.push(new cvox.NavDescription({
          context: cvox.ChromeVox.msgs.getMsg('table_location', locationInfo),
          text: '',
          annotation: summaryText ? summaryText + ' ' : ''
        }));
      }
      if (this.currentWalker_.tt.isSpanned()) {
        descs.push(new cvox.NavDescription({
          text: '',
          annotation: cvox.ChromeVox.msgs.getMsg('spanned')
        }));
      }
      this.begin_ = false;
    }
  }
  return descs;
};

/**
 * @override
 */
cvox.TableShifter.prototype.getBraille = function(prevSel, sel) {
  return this.currentWalker_.getBraille(prevSel, sel);
};

/**
 * @override
 */
cvox.TableShifter.prototype.getGranularityMsg = function() {
  return this.currentWalker_.getGranularityMsg();
};

/**
 * @override
 */
cvox.TableShifter.prototype.makeLessGranular = function() {
  goog.base(this, 'makeLessGranular');
  this.currentWalker_ = this.rowWalker_;
};

/**
 * @override
 */
cvox.TableShifter.prototype.makeMoreGranular = function() {
  goog.base(this, 'makeMoreGranular');
  this.currentWalker_ = this.columnWalker_;
};

/**
 * @override
 */
cvox.TableShifter.create = function(sel) {
  var ancestors = cvox.DomUtil.getAncestors(sel.start.node);
  if (cvox.DomPredicates.tablePredicate(ancestors) &&
      !cvox.DomPredicates.captionPredicate(ancestors)) {
    return new cvox.TableShifter();
  }
  return null;
};


text:
module Utils
  extend self

  def camelize(obj)
    obj.to_s.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
  end
end


text:
package org.wikiup.modules.hibernate;

import org.wikiup.framework.bootstrap.inf.ResourceHandler;
import org.wikiup.core.inf.ext.Resource;
import org.wikiup.core.util.Assert;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class HibernatePropertiesResourceHandler implements ResourceHandler {
    public void handle(Resource resource) {
        InputStream is = null;
        Properties properties = new Properties();
        try {
            try {
                is = resource.open();
                properties.load(is);
                HibernateEntityManager.getInstance().getConfiguration().setProperties(properties);
            } finally {
                if(is != null)
                    is.close();
            }
        } catch(IOException ex) {
            Assert.fail(ex);
        }
    }

    public void finish() {
    }
}


text:
title: Creating a module
---

Creating a module is simple and straightforward. Run the following command to create a module.

``` bash
php artisan module:make <module-name>
```

Replace `<module-name>` by your desired name.

It is also possible to create multiple modules in one command.

``` bash
php artisan module:make Blog User Auth
```

By default when you create a new module, the command will add some resources like a controller, seed class, service provider, etc. automatically. If you don't want these, you can add `--plain` flag, to generate a plain module.

``` bash
php artisan module:make Blog --plain
# or
php artisan module:make Blog -p
```

## Naming convention

Because we are autoloading the modules using [psr-4](http://www.php-fig.org/psr/psr-4/), we strongly recommend using StudlyCase convention.

## Folder structure

```
app/
bootstrap/
vendor/
Modules/
  ├── Blog/
      ├── Assets/
      ├── Config/
      ├── Console/
      ├── Database/
          ├── Migrations/
          ├── Seeders/
      ├── Entities/
      ├── Http/
          ├── Controllers/
          ├── Middleware/
          ├── Requests/
          ├── routes.php
      ├── Providers/
          ├── BlogServiceProvider.php
      ├── Resources/
          ├── lang/
          ├── views/
      ├── Repositories/
      ├── Tests/
      ├── composer.json
      ├── module.json
      ├── start.php
```


text:
<?php
namespace AlbumRestTest\Controller;

use AlbumRestTest\Bootstrap;
use AlbumRest\Controller\AlbumRestController;
use Zend\Http\Request;
use Zend\Http\Response;
use Zend\Mvc\MvcEvent;
use Zend\Mvc\Router\RouteMatch;
use Zend\Mvc\Router\Http\TreeRouteStack as HttpRouter;
use PHPUnit_Framework_TestCase;

class testtest extends PHPUnit_Framework_TestCase {
	protected $controller;
	protected $request;
	protected $response;
	protected $routeMatch;
	protected $event;
	protected function setUp() {
		$serviceManager = Bootstrap::getServiceManager ();
		$this->controller = new AlbumRestController ();
		$this->request = new Request ();
		$this->routeMatch = new RouteMatch ( array (
				'controller' => 'index'
		) );
		$this->event = new MvcEvent ();
		$config = $serviceManager->get ( 'Config' );
		$routerConfig = isset ( $config ['router'] ) ? $config ['router'] : array ();
		$router = HttpRouter::factory ( $routerConfig );
		$this->event->setRouter ( $router );
		$this->event->setRouteMatch ( $this->routeMatch );
		$this->controller->setEvent ( $this->event );
		$this->controller->setServiceLocator ( $serviceManager );
	}
	public function testGetListCanBeAccessed() {
		$result = $this->controller->dispatch ( $this->request );
		$response = $this->controller->getResponse ();

		$this->assertEquals ( 200, $response->getStatusCode () );
	}
	public function testGetCanBeAccessed() {
		$this->routeMatch->setParam ( 'id', '1' );

		$result = $this->controller->dispatch ( $this->request );
		$response = $this->controller->getResponse ();

		$this->assertEquals ( 200, $response->getStatusCode () );
	}
	public function testCreateCanBeAccessed() {
		$this->request->setMethod ( 'post' );
		$this->request->getPost ()->set ( 'artist', 'foo' );
		$this->request->getPost ()->set ( 'title', 'bar' );

		$result = $this->controller->dispatch ( $this->request );
		$response = $this->controller->getResponse ();

		$this->assertEquals ( 200, $response->getStatusCode () );
	}
	public function testUpdateCanBeAccessed() {
		$this->routeMatch->setParam ( 'id', '1' );
		$this->request->setMethod ( 'put' );

		$result = $this->controller->dispatch ( $this->request );
		$response = $this->controller->getResponse ();

		$this->assertEquals ( 200, $response->getStatusCode () );
	}
	public function testDeleteCanBeAccessed() {
		$this->routeMatch->setParam ( 'id', '1' );
		$this->request->setMethod ( 'delete' );

		$result = $this->controller->dispatch ( $this->request );
		$response = $this->controller->getResponse ();

		$this->assertEquals ( 200, $response->getStatusCode () );
	}
}

?>


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\DB;

class BlogController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        // $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        // $this->create_distance_table();
        $tag = $request->query('tag');

        $data['white_header'] = true;
        $data['tags']= DB::table('blogs')->select('tag')->distinct()->get()->toArray();
        array_unshift($data['tags'], (object) array("tag"=>"all"));
        // dd($data['tags']);
        // exit();
        $data['curr_tag']= isset($tag) ? $tag : 'all';

        if ($data['curr_tag'] == 'all') {
            $data['blogs'] = DB::table('blogs')->paginate(3);
        } else {
            $data['blogs'] = DB::table('blogs')->where('tag', $data['curr_tag'])->paginate(3);
        }
        return view('blog', $data);
    }
    public function detail($id)
    {
        $data['white_header'] = true;
        $data['blog'] = DB::table('blogs')->where('id', $id)->first();
        $data['contents'] = DB::table('blog_contents')->where('blog_id', $id) ->orderBy('order')->get();
        $data['related_blog'] = DB::table('blogs')->where([['tag', $data['blog']->tag],['id','<>', $id]])->inRandomOrder()->first();
        //   dd($data);
        return view('blog_detail', $data);
    }
}


text:
#region Basic header

// MIT License
//
// Copyright (c) 2016 Paul Kirth
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#endregion

#region

using System;
using System.Collections.Generic;
using System.Linq;
using compiler.middleend.ir;

#endregion

namespace compiler.middleend.optimization
{
    internal static class Prune
    {
        private static HashSet<Node> _visited;

        public static bool StartPrune(Node root)
        {
            _visited = new HashSet<Node>();
            return PruneBranches(root);
        }

        private static bool PruneBranches(Node root)
        {
            if ((root == null) || _visited.Contains(root))
            {
                return false;
            }

            _visited.Add(root);

            if (root.GetType() == typeof(CompareNode))
            {
                var instList = root.Bb.Instructions;
                Instruction cmp = instList.Find((current) => current.Op == IrOps.Cmp);

                if ((cmp?.Arg1.OpenOperand().Kind == Operand.OpType.Constant) &&
                    (cmp.Arg2.OpenOperand().Kind == Operand.OpType.Constant))
                {
                    var branch = instList.Last();
                    bool takeBranch;

                    var arg1 = cmp.Arg1.OpenOperand().Val;
                    var arg2 = cmp.Arg2.OpenOperand().Val;

                    switch (branch.Op)
                    {
                        case IrOps.Bne:
                            takeBranch = arg1 != arg2;
                            break;
                        case IrOps.Beq:
                            takeBranch = arg1 == arg2;
                            break;
                        case IrOps.Ble:
                            takeBranch = arg1 <= arg2;
                            break;
                        case IrOps.Blt:
                            takeBranch = arg1 < arg2;
                            break;
                        case IrOps.Bge:
                            takeBranch = arg1 >= arg2;
                            break;
                        case IrOps.Bgt:
                            takeBranch = arg1 > arg2;
                            break;
                        default:
                            throw new Exception("Comparison cannot be evaluated!");
                    }

                    CompareNode compareNode = (CompareNode) root;
                    Node begin = compareNode.Parent;
                    JoinNode join = compareNode.Join;
                    Node joinParent = takeBranch ? join.FalseParent : join.Parent;
                    Node end = join.Child;
                    Node keep = takeBranch ? compareNode.FalseNode : compareNode.Child;

                    // propagate phi results
                    foreach (Instruction bbInstruction in join.Bb.Instructions)
                    {
                        if (takeBranch)
                        {
                            bbInstruction.ReplaceInst(bbInstruction.Arg2.Inst);
                        }
                        else
                        {
                            bbInstruction.ReplaceInst(bbInstruction.Arg1.Inst);
                        }
                    }

                    // check to see if we have a real else branch or a regular if
                    // only required to check if the evaluation is always false
                    if (takeBranch && (compareNode.Join == compareNode.FalseNode))
                    {
                        begin.Child = end;
                        end.Parent = begin;
                    }
                    else
                    {
                        // move nodes around
                        begin.Child = keep;
                        keep.Parent = begin;

                        joinParent.Child = end;
                        end.Parent = joinParent;
                    }

                    //begin.Consolidate();

                    PruneBranches(begin.Child);
                    return true;
                }
            }

            List<Node> children = root.GetAllChildren();

            return children.Aggregate(false, (current, child) => (current || PruneBranches(child)));
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;

namespace WeConnect.Tests
{
    public class InstanceCredentialProviderTest
    {
        [Fact]
        public void TestInvalidCase()
        {
            var provider = new InstanceCredentialProvider();

            Assert.Throws<ArgumentNullException>(() =>
            {
                var credential = provider.GenerateCredential();
            });
        }
    }
}


text:
<?php

namespace CodeIgniter\Session\Handlers\Database;

use CodeIgniter\Database\BaseBuilder;
use CodeIgniter\Session\Handlers\DatabaseHandler;
use ReturnTypeWillChange;

/**
 * Session handler for Postgre
 */
class PostgreHandler extends DatabaseHandler
{
    /**
     * Sets SELECT clause
     */
    protected function setSelect(BaseBuilder $builder)
    {
        $builder->select("encode(data, 'base64') AS data");
    }

    /**
     * Decodes column data
     *
     * @param mixed $data
     *
     * @return false|string
     */
    protected function decodeData($data)
    {
        return base64_decode(rtrim($data), true);
    }

    /**
     * Prepare data to insert/update
     */
    protected function prepareData(string $data): string
    {
        return '\x' . bin2hex($data);
    }

    /**
     * Cleans up expired sessions.
     *
     * @param int $max_lifetime Sessions that have not updated
     *                          for the last max_lifetime seconds will be removed.
     *
     * @return false|int Returns the number of deleted sessions on success, or false on failure.
     */
    #[ReturnTypeWillChange]
    public function gc($max_lifetime)
    {
        $separator = '\'';
        $interval  = implode($separator, ['', "{$max_lifetime} second", '']);

        return $this->db->table($this->table)->where('timestamp <', "now() - INTERVAL {$interval}", false)->delete() ? 1 : $this->fail();
    }

    /**
     * Lock the session.
     */
    protected function lockSession(string $sessionID): bool
    {
        $arg = "hashtext('{$sessionID}')" . ($this->matchIP ? ", hashtext('{$this->ipAddress}')" : '');
        if ($this->db->simpleQuery("SELECT pg_advisory_lock({$arg})")) {
            $this->lock = $arg;

            return true;
        }

        return $this->fail();
    }

    /**
     * Releases the lock, if any.
     */
    protected function releaseLock(): bool
    {
        if (! $this->lock) {
            return true;
        }

        if ($this->db->simpleQuery("SELECT pg_advisory_unlock({$this->lock})")) {
            $this->lock = false;

            return true;
        }

        return $this->fail();
    }
}


text:
"""Creates a bunch of images with a plain background."""

from itertools import product
from pathlib import Path
from functools import partial
import os

from PIL import Image

DATA_DIR = Path.home() / "dlrc/training_data/colors"
os.makedirs(DATA_DIR, exist_ok=True)

IMAGE_SIZE = 64

# step of 10 generates 17,575 images!
STEP = 20

def color_range(step):
    return range(0, 255, step)

color_combos = product(color_range(STEP), color_range(STEP), color_range(STEP))
for num_id, (red, green, blue) in enumerate(color_combos):
    im = Image.new(mode='RGB', size=(IMAGE_SIZE, IMAGE_SIZE), color=(red, green, blue))
    im.save(DATA_DIR / "plain-{}.png".format(num_id))


text:
The fade dynamic color is provided via the `fade(...)` free function in the
`termox/painter/dynamic_colors.hpp` header. The resulting `Dynamic_color` will
fade between two given color values.

```cpp
template <typename Shape>
auto fade(True_color a,
          True_color b,
          unsigned resolution              = 400,
          Dynamic_color::Period_t interval = std::chrono::milliseconds{40}) -> Dynamic_color;
```

The `Shape` template parameter is the modulator that defines how the two numbers
will be interpolated between, there are many pre-built Shapes, such as `Sine`,
`Sawtooth_up`, etc... as well as Shape modifiers like `Invert`, and `Convex`
that take a Shape type as template parameter and distort the output in some way.

The Shape parameter will provide an `operator()` that outputs a ratio[0, 1] of
where between the two colors `a` and `b` the fade is currently at.

`resolution` is the number of steps the `Shape` will increment through before
repeating itself, a new step is calculated every `interval`.

## Shapes

- `Triangle`
- `Sine`
- `Sawtooth_up`
- `Sawtooth_down`
- `Square`
- `Random`

## Shape Modifiers

- `Invert`
- `Concave`
- `Convex`

## Creating New Shapes

To create a new Shape type, you'll need to create a type with a public `auto
operator() -> double` overload that will be interpreted as the ratio between the
two colors that are being faded between. This ratio is applied to the difference
of each of the Hue, Saturation, and Lightness between the two colors. The call
operator will be called on each step of the animation.

It will also need a constructor that takes an `unsigned` resolution parameter.

There is a helper base class called `Modulation_base` that can be inherited
from. This provides a `Modulation_base::get_next_ratio() -> double` helper
method that returns the ratio of the current step count and the resolution. Each
call to this method will increment the current step, wrapping to zero at the
provided resolution. This ratio is helpful if the Shape is cyclical and your
Shape depends on some mathematical function that depends on this ratio.


text:
<?php namespace Modules\Menu\Entities;

use Dimsav\Translatable\Translatable;
use Illuminate\Database\Eloquent\Model;
use TypiCMS\NestableTrait;

class Menuitem extends Model
{
    use Translatable, NestableTrait;

    public $translatedAttributes = ['title', 'uri', 'url', 'status'];
    protected $fillable = [
        'menu_id',
        'page_id',
        'parent_id',
        'position',
        'target',
        'module_name',
        'title',
        'uri',
        'url',
        'status',
        'is_root',
        'icon'
    ];
    protected $table = 'menu__menuitems';

    /**
     * For nested collection
     *
     * @var array
     */
    public $children = [];

    public function menu()
    {
        return $this->belongsTo('Modules\Menu\Entities\Menu');
    }

    /**
     * Make the current menu item child of the given root item
     * @param Menuitem $rootItem
     */
    public function makeChildOf(Menuitem $rootItem)
    {
        $this->parent_id = $rootItem->id;
        $this->save();
    }

    /**
     * Check if the current menu item is the root
     * @return bool
     */
    public function isRoot()
    {
        return (bool) $this->is_root;
    }

    /**
     * Check if page_id is empty and returning null instead empty string
     * @return number
     */
    public function setPageIdAttribute($value)
    {
        $this->attributes['page_id'] = ! empty($value) ? $value : null;
    }
}


text:
namespace nek
{
    template <bool C, class T = void>
    struct enable_if_c
    {
        using type = T;
    };

    template <class T>
    struct enable_if_c<false, T>
    {
    };

    template <class Cond, class T = void>
    struct enable_if
        : public enable_if_c<Cond::value, T>
    {
    };

    template <class Cond, class T = void>
    using enable_if_t = typename enable_if<Cond, T>::type;

    template <bool C, class T = void>
    struct disable_if_c
    {
        using type = T;
    };

    template <class T>
    struct disable_if_c<true, T>
    {
    };

    template <class Cond, class T = void>
    struct disable_if
        : public disable_if_c<Cond::value, T>
    {
    };

    template <class Cond, class T = void>
    using disable_if_t = typename disable_if<Cond, T>::type;
}

#endif


text:
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
    QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
    transactionTableModel(0),
    cachedBalance(0), cachedUnconfirmedBalance(0), cachedNumTransactions(0),
    cachedEncryptionStatus(Unencrypted)
{
    // Until signal notifications is built into the bitcoin core,
    //  simply update everything after polling using a timer.
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(update()));
    timer->start(MODEL_UPDATE_DELAY);

    addressTableModel = new AddressTableModel(wallet, this);
    transactionTableModel = new TransactionTableModel(wallet, this);
}

qint64 WalletModel::getBalance() const
{
    return wallet->GetBalance();
}

qint64 WalletModel::getUnconfirmedBalance() const
{
    return wallet->GetUnconfirmedBalance();
}

int WalletModel::getNumTransactions() const
{
    int numTransactions = 0;
    CRITICAL_BLOCK(wallet->cs_wallet)
    {
        numTransactions = wallet->mapWallet.size();
    }
    return numTransactions;
}

void WalletModel::update()
{
    qint64 newBalance = getBalance();
    qint64 newUnconfirmedBalance = getUnconfirmedBalance();
    int newNumTransactions = getNumTransactions();
    EncryptionStatus newEncryptionStatus = getEncryptionStatus();

    if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance)
        emit balanceChanged(newBalance, newUnconfirmedBalance);

    if(cachedNumTransactions != newNumTransactions)
        emit numTransactionsChanged(newNumTransactions);

    if(cachedEncryptionStatus != newEncryptionStatus)
        emit encryptionStatusChanged(newEncryptionStatus);

    cachedBalance = newBalance;
    cachedUnconfirmedBalance = newUnconfirmedBalance;
    cachedNumTransactions = newNumTransactions;

    addressTableModel->update();
}

bool WalletModel::validateAddress(const QString &address)
{
    CBitcoinAddress addressParsed(address.toStdString());
    return addressParsed.IsValid();
}

WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipient> &recipients)
{
    qint64 total = 0;
    QSet<QString> setAddress;
    QString hex;

    if(recipients.empty())
    {
        return OK;
    }

    // Pre-check input data for validity
    foreach(const SendCoinsRecipient &rcp, recipients)
    {
        if(!validateAddress(rcp.address))
        {
            return InvalidAddress;
        }
        setAddress.insert(rcp.address);

        if(rcp.amount <= 0)
        {
            return InvalidAmount;
        }
        total += rcp.amount;
    }

    if(recipients.size() > setAddress.size())
    {
        return DuplicateAddress;
    }

    if(total > getBalance())
    {
        return AmountExceedsBalance;
    }

    if((total + nTransactionFee) > getBalance())
    {
        return SendCoinsReturn(AmountWithFeeExceedsBalance, nTransactionFee);
    }

    CRITICAL_BLOCK(cs_main)
    CRITICAL_BLOCK(wallet->cs_wallet)
    {
        // Sendmany
        std::vector<std::pair<CScript, int64> > vecSend;
        foreach(const SendCoinsRecipient &rcp, recipients)
        {
            CScript scriptPubKey;
            scriptPubKey.SetBitcoinAddress(rcp.address.toStdString());
            vecSend.push_back(make_pair(scriptPubKey, rcp.amount));
        }

        CWalletTx wtx;
        CReserveKey keyChange(wallet);
        int64 nFeeRequired = 0;
        bool fCreated = wallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);

        if(!fCreated)
        {
            if((total + nFeeRequired) > wallet->GetBalance())
            {
                return SendCoinsReturn(AmountWithFeeExceedsBalance, nFeeRequired);
            }
            return TransactionCreationFailed;
        }
        if(!ThreadSafeAskFee(nFeeRequired, tr("Sending...").toStdString(), NULL))
        {
            return Aborted;
        }
        if(!wallet->CommitTransaction(wtx, keyChange))
        {
            return TransactionCommitFailed;
        }
        hex = QString::fromStdString(wtx.GetHash().GetHex());
    }

    // Add addresses that we've sent to to the address book
    foreach(const SendCoinsRecipient &rcp, recipients)
    {
        std::string strAddress = rcp.address.toStdString();
        CRITICAL_BLOCK(wallet->cs_wallet)
        {
            if (!wallet->mapAddressBook.count(strAddress))
                wallet->SetAddressBookName(strAddress, rcp.label.toStdString());
        }
    }

    // Update our model of the address table
    addressTableModel->updateList();

    return SendCoinsReturn(OK, 0, hex);
}

OptionsModel *WalletModel::getOptionsModel()
{
    return optionsModel;
}

AddressTableModel *WalletModel::getAddressTableModel()
{
    return addressTableModel;
}

TransactionTableModel *WalletModel::getTransactionTableModel()
{
    return transactionTableModel;
}

WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const
{
    if(!wallet->IsCrypted())
    {
        return Unencrypted;
    }
    else if(wallet->IsLocked())
    {
        return Locked;
    }
    else
    {
        return Unlocked;
    }
}

bool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase)
{
    if(encrypted)
    {
        // Encrypt
        return wallet->EncryptWallet(passphrase);
    }
    else
    {
        // Decrypt -- TODO; not supported yet
        return false;
    }
}

bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase)
{
    if(locked)
    {
        // Lock
        return wallet->Lock();
    }
    else
    {
        // Unlock
        return wallet->Unlock(passPhrase);
    }
}

bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureString &newPass)
{
    bool retval;
    CRITICAL_BLOCK(wallet->cs_wallet)
    {
        wallet->Lock(); // Make sure wallet is locked before attempting pass change
        retval = wallet->ChangeWalletPassphrase(oldPass, newPass);
    }
    return retval;
}

// WalletModel::UnlockContext implementation
WalletModel::UnlockContext WalletModel::requestUnlock()
{
    bool was_locked = getEncryptionStatus() == Locked;
    if(was_locked)
    {
        // Request UI to unlock wallet
        emit requireUnlock();
    }
    // If wallet is still locked, unlock was failed or cancelled, mark context as invalid
    bool valid = getEncryptionStatus() != Locked;

    return UnlockContext(this, valid, was_locked);
}

WalletModel::UnlockContext::UnlockContext(WalletModel *wallet, bool valid, bool relock):
        wallet(wallet),
        valid(valid),
        relock(relock)
{
}

WalletModel::UnlockContext::~UnlockContext()
{
    if(valid && relock)
    {
        wallet->setWalletLocked(true);
    }
}

void WalletModel::UnlockContext::CopyFrom(const UnlockContext& rhs)
{
    // Transfer context; old object no longer relocks wallet
    *this = rhs;
    rhs.relock = false;
}


text:
// Copyright 2011-2016 Google LLC
//
// 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 com.google.security.zynamics.binnavi.Gui.GraphWindows.Panels;

/**
 * This package contains classes that define the standard GUI perspective and the debug GUI
 * perspective of the graph window. The user can switch between these two perspectives like you can
 * switch between perspectives in Eclipse.
 */


text:
namespace Summator
{
    public partial class SummatorForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }

            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tbxAddend1 = new System.Windows.Forms.TextBox();
            this.tbxAddend2 = new System.Windows.Forms.TextBox();
            this.tbxSum = new System.Windows.Forms.TextBox();
            this.btnCalculate = new System.Windows.Forms.Button();
            this.lblEqual = new System.Windows.Forms.Label();
            this.lblPlus = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // tbxAddend1
            //
            this.tbxAddend1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.tbxAddend1.Location = new System.Drawing.Point(27, 44);
            this.tbxAddend1.Name = "tbxAddend1";
            this.tbxAddend1.Size = new System.Drawing.Size(100, 29);
            this.tbxAddend1.TabIndex = 0;
            this.tbxAddend1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // tbxAddend2
            //
            this.tbxAddend2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.tbxAddend2.Location = new System.Drawing.Point(186, 44);
            this.tbxAddend2.Name = "tbxAddend2";
            this.tbxAddend2.Size = new System.Drawing.Size(100, 29);
            this.tbxAddend2.TabIndex = 1;
            this.tbxAddend2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // tbxSum
            //
            this.tbxSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.tbxSum.Location = new System.Drawing.Point(345, 44);
            this.tbxSum.Name = "tbxSum";
            this.tbxSum.Size = new System.Drawing.Size(151, 29);
            this.tbxSum.TabIndex = 2;
            this.tbxSum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // btnCalculate
            //
            this.btnCalculate.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.btnCalculate.Location = new System.Drawing.Point(27, 115);
            this.btnCalculate.Name = "btnCalculate";
            this.btnCalculate.Size = new System.Drawing.Size(469, 32);
            this.btnCalculate.TabIndex = 3;
            this.btnCalculate.Text = "Calculate";
            this.btnCalculate.UseVisualStyleBackColor = true;
            this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
            //
            // lblEqual
            //
            this.lblEqual.AutoSize = true;
            this.lblEqual.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.lblEqual.Location = new System.Drawing.Point(305, 46);
            this.lblEqual.Name = "lblEqual";
            this.lblEqual.Size = new System.Drawing.Size(21, 24);
            this.lblEqual.TabIndex = 4;
            this.lblEqual.Text = "=";
            //
            // lblPlus
            //
            this.lblPlus.AutoSize = true;
            this.lblPlus.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.20895F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.lblPlus.Location = new System.Drawing.Point(146, 46);
            this.lblPlus.Name = "lblPlus";
            this.lblPlus.Size = new System.Drawing.Size(21, 24);
            this.lblPlus.TabIndex = 5;
            this.lblPlus.Text = "+";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(525, 184);
            this.Controls.Add(this.lblPlus);
            this.Controls.Add(this.lblEqual);
            this.Controls.Add(this.btnCalculate);
            this.Controls.Add(this.tbxSum);
            this.Controls.Add(this.tbxAddend2);
            this.Controls.Add(this.tbxAddend1);
            this.MaximumSize = new System.Drawing.Size(545, 237);
            this.MinimumSize = new System.Drawing.Size(545, 237);
            this.Name = "Form1";
            this.Text = "Summator";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox tbxAddend1;
        private System.Windows.Forms.TextBox tbxAddend2;
        private System.Windows.Forms.TextBox tbxSum;
        private System.Windows.Forms.Button btnCalculate;
        private System.Windows.Forms.Label lblEqual;
        private System.Windows.Forms.Label lblPlus;
    }
}


text:
layout: page
title: Gilmore Solutions Executive Retreat
date: 2016-05-24
author: Louis Park
tags: weekly links, java
status: published
summary: Vestibulum ipsum tortor, tempus et viverra euismod, maximus.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 06/11/2017
  endDate: 06/13/2017
  ctyhocn: ANCAKHX
  groupCode: GSER
published: true
---
Mauris at leo eu dui dapibus dictum. Aenean a arcu sapien. Vivamus sit amet laoreet diam, molestie placerat est. Aenean sagittis dictum sodales. Duis quam diam, dapibus sed arcu sed, pellentesque rutrum ante. Proin dui mauris, congue nec diam a, euismod commodo eros. Morbi ac erat nulla. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque id condimentum purus. Proin bibendum mi eu velit consectetur, eu euismod lorem convallis.

1 Nullam blandit nisi ut lacus iaculis, ut tempus nunc sodales.

Suspendisse finibus hendrerit velit, ac tristique elit tempus at. Sed augue arcu, sodales sed gravida ut, rutrum at sapien. Fusce fringilla elit mi, nec vestibulum urna varius nec. Etiam ac nibh eleifend, elementum turpis in, lacinia sapien. Donec lobortis imperdiet sapien nec consequat. Maecenas quis sem lobortis turpis commodo fringilla convallis quis arcu. Ut interdum magna aliquet, euismod dolor id, tempor odio. Nam consequat lacus eu elit ultrices, non fringilla orci placerat. Morbi mattis vehicula magna et auctor. Integer maximus enim id ligula congue ultrices. Suspendisse mollis, odio a rutrum eleifend, erat neque cursus massa, vitae molestie massa nisl quis augue. Nunc in velit efficitur, ullamcorper eros vitae, feugiat massa. Nullam commodo rutrum est quis feugiat.


text:
===============================
KrakenMaster
===============================

A web interface for controlling a network of things

Quickstart
----------

::

    git clone https://github.com/peterdemartini/KrakenMaster
    cd KrakenMaster
    sudo pip install -r requirements/dev.txt
    python manage.py db init
    python manage.py db migrate
    python manage.py db upgrade
    python manage.py server

Deployment
----------

In your production environment, make sure the ``KRAKEN_ENV`` environment variable is set to ``"prod"``.

Shell
-----

To open the interactive shell, run ::

    python manage.py shell

By default, you will have access to ``app``, ``db``, and the ``User`` model.

Running Tests
-------------

To run all tests, run ::

    python manage.py test

Migrations
----------

Whenever a database migration needs to be made. Run the following commmands:
::

    python manage.py db migrate

This will generate a new migration script. Then run:
::

    python manage.py db upgrade

To apply the migration.

For a full migration command reference, run ``python manage.py db --help``.


text:
package org.apache.sling.hc.it.core;

import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.junitBundles;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.provision;
import static org.ops4j.pax.exam.CoreOptions.repository;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.when;

import java.util.Arrays;
import java.util.List;

import org.apache.sling.hc.api.execution.HealthCheckExecutionOptions;
import org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
import org.apache.sling.hc.api.execution.HealthCheckExecutor;
import org.apache.sling.hc.api.execution.HealthCheckSelector;
import org.ops4j.pax.exam.Option;

/** Test utilities */
public class U {

    /** Wait until the specified number of health checks are seen by supplied executor */
    static void expectHealthChecks(int howMany, HealthCheckExecutor executor, String ... tags) {
        expectHealthChecks(howMany, executor, new HealthCheckExecutionOptions(), tags);
    }

    /** Wait until the specified number of health checks are seen by supplied executor */
    static void expectHealthChecks(int howMany, HealthCheckExecutor executor, HealthCheckExecutionOptions options, String ... tags) {
        final long timeout = System.currentTimeMillis() + 10000L;
        int count = 0;
        while(System.currentTimeMillis() < timeout) {
            final List<HealthCheckExecutionResult> results = executor.execute(HealthCheckSelector.tags(tags), options);
            count = results.size();
            if(count== howMany) {
                return;
            }
            try {
                Thread.sleep(100L);
            } catch(InterruptedException iex) {
                throw new RuntimeException("Unexpected InterruptedException");
            }
        }
        fail("Did not get " + howMany + " health checks with tags " + Arrays.asList(tags) + " after " + timeout + " msec (last count=" + count + ")");
    }

    static Option[] config() {
        final String apiVersion = System.getProperty("sling.hc.api.version");
        final String coreVersion = System.getProperty("sling.hc.core.version");
        final String samplesVersion = System.getProperty("sling.hc.samples.version");
        final String johnzonVersion = System.getProperty("sling.johnzon.version");
        final String localRepo = System.getProperty("maven.repo.local", "");
        final boolean felixShell = "true".equals(System.getProperty("felix.shell", "false"));

        return options(
            repository("https://repo.maven.apache.org/maven2/").id("central"),
            repository("https://repository.apache.org/snapshots/").id("apache-snapshots").allowSnapshots(),
            when(localRepo.length() > 0).useOptions(
                    systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
            ),
            junitBundles(),
            when(felixShell).useOptions(
                    provision(
                            mavenBundle("org.apache.felix", "org.apache.felix.gogo.shell", "0.10.0"),
                            mavenBundle("org.apache.felix", "org.apache.felix.gogo.runtime", "0.10.0"),
                            mavenBundle("org.apache.felix", "org.apache.felix.gogo.command", "0.12.0"),
                            mavenBundle("org.apache.felix", "org.apache.felix.shell.remote", "1.1.2")
                    )
            ),
            provision(
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "4.0.6"),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.6"),
                    mavenBundle("org.slf4j", "slf4j-api", "1.7.13"),
                    mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.13"),
                    mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.13"),
                    mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.8"),
                    mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.10"),
                    mavenBundle("org.apache.felix", "org.apache.felix.http.servlet-api", "1.1.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", johnzonVersion),
                    mavenBundle("org.apache.sling", "org.apache.sling.hc.api", apiVersion),
                    mavenBundle("org.apache.sling", "org.apache.sling.hc.core", coreVersion),
                    mavenBundle("org.apache.sling", "org.apache.sling.hc.samples", samplesVersion),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.2.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.jcr.jcr-wrapper", "2.0.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.api", "2.4.2"),
                    mavenBundle("org.apache.sling", "org.apache.sling.jcr.api", "2.1.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.2.8"),
                    mavenBundle("org.apache.sling", "org.apache.sling.auth.core", "1.1.2"),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.mime", "2.1.4"),
                    mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.2.2"),
                    mavenBundle("org.apache.sling", "org.apache.sling.launchpad.api", "1.1.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.scripting.api", "2.1.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.threads", "3.1.0"),
                    mavenBundle("org.apache.sling", "org.apache.sling.commons.scheduler", "2.4.2"),
                    mavenBundle("commons-collections", "commons-collections", "3.2.1"),
                    mavenBundle("commons-io", "commons-io", "1.4"),
                    mavenBundle("commons-fileupload", "commons-fileupload", "1.2.2"),
                    mavenBundle("commons-lang", "commons-lang", "2.5")            )
        );
    }
}


text: to jest naprawdę odjazdowe repozytorium


text:
package org.onosproject.distributedprimitives.cli;

import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.store.serializers.KryoNamespaces;
import org.onosproject.store.service.ConsistentMap;
import org.onosproject.store.service.Serializer;
import org.onosproject.store.service.StorageService;
import org.onosproject.store.service.Versioned;

/**
 * CLI command to manipulate a distributed value.
 */
@Command(scope = "onos", name = "map-test",
        description = "Manipulate a consistent map")
public class ConsistentMapTestCommand extends AbstractShellCommand {

    @Argument(index = 0, name = "name",
            description = "map name",
            required = true, multiValued = false)
    String name = null;

    @Argument(index = 1, name = "operation",
            description = "operation name",
            required = true, multiValued = false)
    String operation = null;

    @Argument(index = 2, name = "key",
            description = "first arg",
            required = false, multiValued = false)
    String arg1 = null;

    @Argument(index = 3, name = "value1",
            description = "second arg",
            required = false, multiValued = false)
    String arg2 = null;

    @Argument(index = 4, name = "value2",
            description = "third arg",
            required = false, multiValued = false)
    String arg3 = null;

    ConsistentMap<String, String> map;

    @Override
    protected void execute() {
        StorageService storageService = get(StorageService.class);
        map = storageService.<String, String>consistentMapBuilder()
                                    .withName(name)
                                    .withSerializer(Serializer.using(KryoNamespaces.BASIC))
                                    .build();
        if ("get".equals(operation)) {
            print(map.get(arg1));
        } else if ("put".equals(operation)) {
            print(map.put(arg1, arg2));
        } else if ("size".equals(operation)) {
            print("%d", map.size());
        } else if ("isEmpty".equals(operation)) {
            print("%b", map.isEmpty());
        } else if ("putIfAbsent".equals(operation)) {
            print(map.putIfAbsent(arg1, arg2));
        } else if ("putAndGet".equals(operation)) {
            print(map.putAndGet(arg1, arg2));
        } else if ("clear".equals(operation)) {
            map.clear();
        } else if ("remove".equals(operation)) {
            if (arg2 == null) {
                print(map.remove(arg1));
            } else {
                print("%b", map.remove(arg1, arg2));
            }
        } else if ("containsKey".equals(operation)) {
            print("%b", map.containsKey(arg1));
        } else if ("containsValue".equals(operation)) {
            print("%b", map.containsValue(arg1));
        } else if ("replace".equals(operation)) {
            if (arg3 == null) {
                print(map.replace(arg1, arg2));
            } else {
                print("%b", map.replace(arg1, arg2, arg3));
            }
        }
    }

    void print(Versioned<String> value) {
        if (value == null) {
            print("null");
        } else {
            print("%s", value.value());
        }
    }
}


text:
require 'flue/filters/markdown.rb'
require 'flue/filters/erb.rb'
require 'flue/filters/textile.rb'
require 'flue/filters/emoji.rb'
require 'flue/filters/code.rb'
require 'flue/filters/sass.rb'
require 'flue/filters/coffee_script.rb'

module Flue

  FilterRegister.register :erb, ERBFilter
  FilterRegister.register :md, MarkdownFilter
  FilterRegister.register :textile, TextileFilter
  FilterRegister.register :emoji, EmojiFilter
  FilterRegister.register :code, CodeFilter
  FilterRegister.register :html, CodeFilter
  FilterRegister.register :html, EmojiFilter
  FilterRegister.register :scss, SassFilter
  FilterRegister.register :coffee, CoffeeScriptFilter

end