text:
<?xml version="1.0" encoding="utf-8"?><quotes>
<section name="Luke 7" id="95">
  <quote id="3317">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Now when he had ended all his sayings in the audience of the people, he entered into Capernaum.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:1]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3318">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And a certain centurion's servant, who was dear unto him, was sick, and ready to die.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:2]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3319">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And when he heard of Jesus, he sent unto him the elders of the Jews, beseeching him that he would come and heal his servant.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:3]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3320">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And when they came to Jesus, they besought him instantly, saying, That he was worthy for whom he should do this:]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:4]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3321">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[For he loveth our nation, and he hath built us a synagogue.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:5]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3322">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Then Jesus went with them. And when he was now not far from the house, the centurion sent friends to him, saying unto him, Lord, trouble not thyself: for I am not worthy that thou shouldest enter under my roof:]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:6]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3323">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Wherefore neither thought I myself worthy to come unto thee: but say in a word, and my servant shall be healed.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:7]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3324">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[For I also am a man set under authority, having under me soldiers, and I say unto one, Go, and he goeth; and to another, Come, and he cometh; and to my servant, Do this, and he doeth it.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:8]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3325">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[When Jesus heard these things, he marvelled at him, and turned him about, and said unto the people that followed him, I say unto you, I have not found so great faith, no, not in Israel.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:9]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3326">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And they that were sent, returning to the house, found the servant whole that had been sick.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:10]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3327">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And it came to pass the day after, that he went into a city called Nain; and many of his disciples went with him, and much people.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:11]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3328">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Now when he came nigh to the gate of the city, behold, there was a dead man carried out, the only son of his mother, and she was a widow: and much people of the city was with her.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:12]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3329">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And when the Lord saw her, he had compassion on her, and said unto her, Weep not.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:13]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3330">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And he came and touched the bier: and they that bare him stood still. And he said, Young man, I say unto thee, Arise.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:14]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3331">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And he that was dead sat up, and began to speak. And he delivered him to his mother.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:15]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3332">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And there came a fear on all: and they glorified God, saying, That a great prophet is risen up among us; and, That God hath visited his people.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:16]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3333">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And this rumour of him went forth throughout all Judaea, and throughout all the region round about.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:17]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3334">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And the disciples of John shewed him of all these things.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:18]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3335">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And John calling unto him two of his disciples sent them to Jesus, saying, Art thou he that should come? or look we for another?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:19]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3336">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[When the men were come unto him, they said, John Baptist hath sent us unto thee, saying, Art thou he that should come? or look we for another?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:20]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3337">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And in that same hour he cured many of their infirmities and plagues, and of evil spirits; and unto many that were blind he gave sight.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:21]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3338">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Then Jesus answering said unto them, Go your way, and tell John what things ye have seen and heard; how that the blind see, the lame walk, the lepers are cleansed, the deaf hear, the dead are raised, to the poor the gospel is preached.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:22]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3339">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And blessed is he, whosoever shall not be offended in me.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:23]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3340">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And when the messengers of John were departed, he began to speak unto the people concerning John, What went ye out into the wilderness for to see? A reed shaken with the wind?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:24]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3341">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[But what went ye out for to see? A man clothed in soft raiment? Behold, they which are gorgeously apparelled, and live delicately, are in kings' courts.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:25]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3342">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[But what went ye out for to see? A prophet? Yea, I say unto you, and much more than a prophet.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:26]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3343">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[This is he, of whom it is written, Behold, I send my messenger before thy face, which shall prepare thy way before thee.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:27]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3344">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[For I say unto you, Among those that are born of women there is not a greater prophet than John the Baptist: but he that is least in the kingdom of God is greater than he.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:28]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3345">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And all the people that heard him, and the publicans, justified God, being baptized with the baptism of John.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:29]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3346">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[But the Pharisees and lawyers rejected the counsel of God against themselves, being not baptized of him.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:30]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3347">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And the Lord said, Whereunto then shall I liken the men of this generation? and to what are they like?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:31]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3348">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[They are like unto children sitting in the marketplace, and calling one to another, and saying, We have piped unto you, and ye have not danced; we have mourned to you, and ye have not wept.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:32]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3349">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[For John the Baptist came neither eating bread nor drinking wine; and ye say, He hath a devil.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:33]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3350">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[The Son of man is come eating and drinking; and ye say, Behold a gluttonous man, and a winebibber, a friend of publicans and sinners!]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:34]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3351">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[But wisdom is justified of all her children.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:35]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3352">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And one of the Pharisees desired him that he would eat with him. And he went into the Pharisee's house, and sat down to meat.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:36]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3353">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And, behold, a woman in the city, which was a sinner, when she knew that Jesus sat at meat in the Pharisee's house, brought an alabaster box of ointment,]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:37]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3354">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And stood at his feet behind him weeping, and began to wash his feet with tears, and did wipe them with the hairs of her head, and kissed his feet, and anointed them with the ointment.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:38]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3355">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Now when the Pharisee which had bidden him saw it, he spake within himself, saying, This man, if he were a prophet, would have known who and what manner of woman this is that toucheth him: for she is a sinner.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:39]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3356">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And Jesus answering said unto him, Simon, I have somewhat to say unto thee. And he saith, Master, say on.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:40]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3357">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[There was a certain creditor which had two debtors: the one owed five hundred pence, and the other fifty.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:41]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3358">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And when they had nothing to pay, he frankly forgave them both. Tell me therefore, which of them will love him most?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:42]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3359">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Simon answered and said, I suppose that he, to whom he forgave most. And he said unto him, Thou hast rightly judged.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:43]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3360">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And he turned to the woman, and said unto Simon, Seest thou this woman? I entered into thine house, thou gavest me no water for my feet: but she hath washed my feet with tears, and wiped them with the hairs of her head.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:44]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3361">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Thou gavest me no kiss: but this woman since the time I came in hath not ceased to kiss my feet.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:45]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3362">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[My head with oil thou didst not anoint: but this woman hath anointed my feet with ointment.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:46]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3363">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[Wherefore I say unto thee, Her sins, which are many, are forgiven; for she loved much: but to whom little is forgiven, the same loveth little.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:47]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3364">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And he said unto her, Thy sins are forgiven.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:48]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3365">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And they that sat at meat with him began to say within themselves, Who is this that forgiveth sins also?]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:49]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
    <quote id="3366">
    <introtext><![CDATA[]]></introtext>
	<text><![CDATA[And he said to the woman, Thy faith hath saved thee; go in peace.]]></text>
 	<author><![CDATA[Luke]]></author>
  	<reference><![CDATA[7:50]]></reference>
    <language>en</language>
    <url><![CDATA[]]></url>
  </quote>
  </section>
</quotes>


text:
using testing::_;
using testing::NiceMock;
using testing::Return;

namespace Envoy {
namespace Config {

class FilesystemSubscriptionTestHarness : public SubscriptionTestHarness {
public:
  FilesystemSubscriptionTestHarness()
      : path_(TestEnvironment::temporaryPath("eds.json")),
        api_(Api::createApiForTest(stats_store_)), dispatcher_(api_->allocateDispatcher()),
        subscription_(*dispatcher_, path_, stats_, *api_) {}

  ~FilesystemSubscriptionTestHarness() {
    if (::access(path_.c_str(), F_OK) != -1) {
      EXPECT_EQ(0, ::unlink(path_.c_str()));
    }
  }

  void startSubscription(const std::set<std::string>& cluster_names) override {
    std::ifstream config_file(path_);
    file_at_start_ = config_file.good();
    subscription_.start(cluster_names, callbacks_);
  }

  void updateResources(const std::set<std::string>& cluster_names) override {
    subscription_.updateResources(cluster_names);
  }

  void updateFile(const std::string json, bool run_dispatcher = true) {
    // Write JSON contents to file, rename to path_ and run dispatcher to catch
    // inotify.
    const std::string temp_path = TestEnvironment::writeStringToFileForTest("eds.json.tmp", json);
    TestUtility::renameFile(temp_path, path_);
    if (run_dispatcher) {
      dispatcher_->run(Event::Dispatcher::RunType::NonBlock);
    }
  }

  void expectSendMessage(const std::set<std::string>& cluster_names,
                         const std::string& version) override {
    UNREFERENCED_PARAMETER(cluster_names);
    UNREFERENCED_PARAMETER(version);
  }

  void deliverConfigUpdate(const std::vector<std::string>& cluster_names,
                           const std::string& version, bool accept) override {
    std::string file_json = "{\"versionInfo\":\"" + version + "\",\"resources\":[";
    for (const auto& cluster : cluster_names) {
      file_json += "{\"@type\":\"type.googleapis.com/"
                   "envoy.api.v2.ClusterLoadAssignment\",\"clusterName\":\"" +
                   cluster + "\"},";
    }
    file_json.pop_back();
    file_json += "]}";
    envoy::api::v2::DiscoveryResponse response_pb;
    MessageUtil::loadFromJson(file_json, response_pb);
    EXPECT_CALL(callbacks_, onConfigUpdate(RepeatedProtoEq(response_pb.resources()), version))
        .WillOnce(ThrowOnRejectedConfig(accept));
    if (accept) {
      version_ = version;
    } else {
      EXPECT_CALL(callbacks_, onConfigUpdateFailed(_));
    }
    updateFile(file_json);
  }

  void verifyStats(uint32_t attempt, uint32_t success, uint32_t rejected, uint32_t failure,
                   uint64_t version) override {
    // The first attempt always fail unless there was a file there to begin with.
    SubscriptionTestHarness::verifyStats(attempt, success, rejected,
                                         failure + (file_at_start_ ? 0 : 1), version);
  }

  void expectConfigUpdateFailed() override {
    // initial_fetch_timeout not implemented
  }

  void expectEnableInitFetchTimeoutTimer(std::chrono::milliseconds timeout) override {
    UNREFERENCED_PARAMETER(timeout);
    // initial_fetch_timeout not implemented
  }

  void expectDisableInitFetchTimeoutTimer() override {
    // initial_fetch_timeout not implemented
  }

  void callInitFetchTimeoutCb() override {
    // initial_fetch_timeout not implemented
  }

  const std::string path_;
  std::string version_;
  Stats::IsolatedStoreImpl stats_store_;
  Api::ApiPtr api_;
  Event::DispatcherPtr dispatcher_;
  NiceMock<Config::MockSubscriptionCallbacks<envoy::api::v2::ClusterLoadAssignment>> callbacks_;
  FilesystemSubscriptionImpl subscription_;
  bool file_at_start_{false};
};

} // namespace Config
} // namespace Envoy

redpajama_set_name: RedPajamaGithub


text:
var win = Titanium.UI.currentWindow;

//
// FIRE EVENT WITH DATA ARRAY
//
var b1 = Titanium.UI.createButton({
	title:'Fire Event 1',
	width:200,
	height:40,
	top:10
});

b1.addEventListener('click', function()
{
	Titanium.App.fireEvent('event_one',{data:['1','2','3']});
});

win.add(b1);

//
// FIRE EVENT WITH OBJECT DATA
//
var b2 = Titanium.UI.createButton({
	title:'Fire Event 2',
	width:200,
	height:40,
	top:60
});

b2.addEventListener('click', function()
{
	Titanium.App.fireEvent('event_two',{name:'Foo', city:'Palo Alto'});
});

win.add(b2);

//
// FIRE EVENT WITH OBJECT DATA
//
var b3 = Titanium.UI.createButton({
	title:'Fire Event 3',
	width:200,
	height:40,
	top:110
});

b3.addEventListener('click', function()
{
	b2.fireEvent('click');
});

win.add(b3);


text:
package tsp

import org.coinor.opents._

case class TravelPlan(customers: Array[Array[Double]])
    extends SolutionAdapter {

  var tour = customers.indices.toArray

  override def clone = {
    val copy  = super.clone.asInstanceOf[TravelPlan]
    copy.tour = tour
    copy
  }

  override def toString = {
    val sb: StringBuffer = new StringBuffer
    sb append s"Solution value: ${getObjectiveValue()(0)}"
    sb append " Sequence: [ "

    for (x <- tour)
      if (x == 0) sb append x
      else sb append ", " append x

    sb append " ]"
    sb.toString
  }
}


text:
Date: Fri, 13 Dec 1996 14:49:15 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Tue, 08 Nov 1994 22:55:06 GMT
Content-length: 265

Nancy Hall

Computer Sciences Department
University of Wisconsin -- Madison
1210 West Dayton Street
Madison, WI 53706-1685

608/262-5945

<!WA0><!WA0><!WA0>Project: SHORE: a Scalable Heterogeneous Object REpository


text:
package org.docksidestage.mysql.dbflute.bsbhv.loader;

import java.util.List;

import org.dbflute.bhv.*;
import org.docksidestage.mysql.dbflute.exbhv.*;
import org.docksidestage.mysql.dbflute.exentity.*;

/**
 * The referrer loader of WHITE_MYSELF_CHECK as TABLE.

 *

 * [primary key]
 *     MYSELF_CHECK_ID
 *
 * [column]
 *     MYSELF_CHECK_ID, MYSELF_CHECK_NAME, MYSELF_ID
 *
 * [sequence]
 *
 *
 * [identity]
 *
 *
 * [version-no]
 *
 *
 * [foreign table]
 *     WHITE_MYSELF
 *
 * [referrer table]
 *
 *
 * [foreign property]
 *     whiteMyself
 *
 * [referrer property]
 *
 *

 * @author DBFlute(AutoGenerator)
 */
public class LoaderOfWhiteMyselfCheck {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    protected List<WhiteMyselfCheck> _selectedList;
    protected BehaviorSelector _selector;
    protected WhiteMyselfCheckBhv _myBhv; // lazy-loaded

    // ===================================================================================
    //                                                                   Ready for Loading
    //                                                                   =================
    public LoaderOfWhiteMyselfCheck ready(List<WhiteMyselfCheck> selectedList, BehaviorSelector selector)
    { _selectedList = selectedList; _selector = selector; return this; }

    protected WhiteMyselfCheckBhv myBhv()
    { if (_myBhv != null) { return _myBhv; } else { _myBhv = _selector.select(WhiteMyselfCheckBhv.class); return _myBhv; } }

    // ===================================================================================
    //                                                                    Pull out Foreign
    //                                                                    ================
    protected LoaderOfWhiteMyself _foreignWhiteMyselfLoader;
    public LoaderOfWhiteMyself pulloutWhiteMyself() {
        if (_foreignWhiteMyselfLoader == null)
        { _foreignWhiteMyselfLoader = new LoaderOfWhiteMyself().ready(myBhv().pulloutWhiteMyself(_selectedList), _selector); }
        return _foreignWhiteMyselfLoader;
    }

    // ===================================================================================
    //                                                                            Accessor
    //                                                                            ========
    public List<WhiteMyselfCheck> getSelectedList() { return _selectedList; }
    public BehaviorSelector getSelector() { return _selector; }
}


text:
import aiohttp
import math
import calendar
from datetime import date
from discord.ext import commands
from __main__ import send_cmd_help
try:   # check if BeautifulSoup4 is installed
    from bs4 import BeautifulSoup
    soupAvailable = True
except:
    soupAvailable = False
try:   # Check if Tabulate is installed
    from tabulate import tabulate
    tabulateAvailable = True
except:
    tabulateAvailable = False

class Tibia:
    """Tibia search cog."""

    def __init__(self, bot):
        self.bot = bot

    @commands.group(pass_context=True)
    async def tibia(self, ctx):
        """This is the list of tibia queries you can perform."""

        if ctx.invoked_subcommand is None:
            await send_cmd_help(ctx)

    @tibia.command(name="item", pass_context=False)
    async def _item_tibia(self, *, itemname):
        """Get a item information from tibia wiki"""
        item = itemname.replace(" ", "_").title()
        if len(item) > 0:
            try:
                url = "http://tibia.wikia.com/wiki/" + str(item)
                async with aiohttp.get(url) as response:
                    soup = BeautifulSoup(await response.text(), "html.parser")
                    isearch = soup.find('div', attrs={'id': 'twbox-image'})
                    img = isearch.find("img")["src"]
                    # ----------------------------------------------------
                    try:
                        div1 = soup.find('div', attrs={'id': 'twbox-look'})
                        div2 = div1.find('div', attrs={'class': 'item-look'})
                        info = div2.get_text()
                    except:
                        info = "Could not find info"
                    # ----------------------------------------------------
                    div4 = soup.find('div', attrs={'id': 'tabular-data'})
                    table = div4.find('table', attrs={'class': 'infobox'})
                    rows = table.find_all('tr')
                    column1 = []
                    column2 = []
                    for row in rows:
                        cols = row.find_all('td', attrs={'class': 'property'})
                        cols = [ele.text.strip() for ele in cols]
                        column1.append([ele for ele in cols if ele])
                    for row in rows:
                        cols = row.find_all('td', attrs={'class': 'value'})
                        cols = [ele.text.strip() for ele in cols]
                        column2.append([ele for ele in cols if ele])
                    v = [x for xs in column1 for x in xs]
                    q = [x for xs in column2 for x in xs]
                    j = list(zip(v, q))
                    t = tabulate(j,  headers=["Property", "Value"])
                    # ----------------------------------------------------
                    try:
                        div3 = soup.find('div', attrs={'class': 'item-droppedby-wrapper'})
                        uls = div3.find('ul', attrs={'class': 'creature-list-generic'})
                        lis = uls.find_all('li')
                        results = []
                        for li in lis:
                            hols = li.find_all('a')
                            hols = [ele.text.strip() for ele in hols]
                            results.append([ele for ele in hols if ele])
                        d = [x for xs in results for x in xs]
                        g = "Creatures that drop this item" + "\n" + "-" * 80 + "\n"
                        k = g + self.column_maker(d, cols=3)
                    except ValueError:
                        try:
                            diva = soup.find('div', attrs={'class': 'spoiler-content'})
                            k = diva.get_text()
                        except AttributeError:
                            k = "This item is not dropped by any creatures or quest"

                    await self.bot.say(img + "\n")
                    await self.bot.say("```" + str(info) + "```")
                    await self.bot.say("```" + str(t) + "```")
                    await self.bot.say("```" + str(k) + "```")
            except:
                await self.bot.say("I could not find this item")
        else:
            await self.bot.say("Oh no! You didn't input a name. Type an" +
                               " item name to search")

    @tibia.command(name="monster", pass_context=False)
    async def _monster_tibia(self, *, monster):
        """Get a monster's information from tibia wiki"""
        monster = monster.replace(" ", "_").title()
        if len(monster) > 0:
            try:
                url = "http://tibia.wikia.com/wiki/" + str(monster)
                async with aiohttp.get(url) as response:
                    soup = BeautifulSoup(await response.text(), "html.parser")
                    # -------------------image------------------------------
                    try:
                        isearch = soup.find('div', attrs={'id': 'twbox-image'})
                        img = isearch.find("img")["src"]
                    except:
                        img = "No image found"
                    # ------------------Abilities----------------------------

                    div1 = soup.find('div', attrs={'id': 'creature-abilities'})
                    p = div1.find('p')
                    title = "Abilities" + "\n"
                    header1 = "Abilities" + "\n" + "-" * 80 + "\n"
                    abilities = p.get_text()
                    # ------------------------Loot------------------------
                    div2 = soup.find('div', attrs={'class': 'loot-table'})
                    ul = div2.find('ul')
                    lis = ul.find_all('li')
                    items = []
                    for li in lis:
                        hols = li.find_all('a')
                        hols = [ele.text.strip() for ele in hols]
                        items.append([ele for ele in hols if ele])
                    d = [x for xs in items for x in xs]
                    header = "Loot Table" + "\n" + "-" * 85 + "\n"
                    k = header + self.column_maker(d, cols=4)
                    # -------------------Table-Info--------------------------
                    div4 = soup.find('div', attrs={'id': 'tabular-data'})
                    table = div4.find('table')
                    rows = table.find_all('tr')
                    column1 = []
                    column2 = []
                    for row in rows:
                        cols = row.find_all('td', attrs={'class': 'property'})
                        cols = [ele.text.strip() for ele in cols]
                        column1.append([ele for ele in cols if ele])
                    for row in rows:
                        cols = row.find_all('td', attrs={'class': 'value'})
                        cols = [ele.text.strip() for ele in cols]
                        column2.append([ele for ele in cols if ele])
                    v = [x for xs in column1 for x in xs]
                    q = [x for xs in column2 for x in xs]
                    splitv = self.split_list(v, wanted_parts=2)
                    halfv1 = splitv[0]
                    halfv2 = splitv[1]
                    splitq = self.split_list(q, wanted_parts=2)
                    halfq1 = splitq[0]
                    halfq2 = splitq[1]
                    j = list(zip(halfv1, halfq1, halfv2, halfq2))
                    t = tabulate(j,  headers=["Property", "Value", "Property", "Value"])

                    # ------------------------OUTPUT-------------------------
                    await self.bot.say(img + "\n")
                    await self.bot.say("```" + title + header1 + str(abilities) + "```")
                    await self.bot.say("```" + str(k) + "```")
                    await self.bot.say("```" + str(t) + "```")
            except:
                await self.bot.say("I could not find this creature.")
        else:
            await self.bot.say("Oh no! You didn't input a name. Type an" +
                               " item name to search")

    @tibia.command(name="online", pass_context=False)
    async def _online_tibia(self):
        """Get total players playing"""
        url = "http://www.tibia.com/community/?subtopic=worlds"
        try:
            async with aiohttp.get(url) as response:
                soup = BeautifulSoup(await response.text(), "html.parser")
                div1 = soup.find('div', attrs={'id': 'RightArtwork'})
                div2 = div1.find('div', attrs={'id': 'PlayersOnline'})
                test = div2.get_text()
                test1 = test.replace("Players Online", "")
                new = "Players currently playing Tibia: " + test1
                # div2 = div1.find('div', attrs={'class': 'Border_2'})
                # div3 = div2.find('div', attrs={'class': 'Border_3'})
                # table = div3.find_all('table', attrs={'class': 'Table1'})
                # tr = table.find_all('tr')
                # tbody = div4.find('div', attrs={'class': 'CaptionInnerContainer'})
                await self.bot.say(str(new))
        except:
            await self.bot.say("Could not retrive data. The webserver may be offline.")

    @tibia.command(name="server", pass_context=False)
    async def _server_tibia(self, servername):
        """Get Server Info"""
        servername = servername.title()
        url = "https://secure.tibia.com/community/?subtopic=worlds&world=" + str(servername)
        try:
            async with aiohttp.get(url) as response:
                soup = BeautifulSoup(await response.text(), "html5lib")
                b = soup.find_all("table", attrs={'class': 'Table1'})
                new = []
                rows = b[1].tbody.div.find_all('td')
                for row in rows:
                    new.append(row.get_text())
                k = new[::2]
                l = new[1::2]
                zipped = list(zip(k, l))
                t = tabulate(zipped, headers=["Category", "Info"])
                await self.bot.say("```Python" + "\n" + str(t) + "```")
        except:
            await self.bot.say("Unable to retrive server data. The webserver may be offline.")

    @tibia.command(name="rashid", pass_context=False)
    async def _rashid_tibia(self):
        """Get Rashid's Location"""
        current_date = date.today()
        if calendar.day_name[current_date.weekday()] == "Sunday":
            await self.bot.say("On Sundays you can find him in Carlin depot, one floor above.")
        elif calendar.day_name[current_date.weekday()] == "Monday":
            await self.bot.say("On Mondays you can find him in Svargrond, in Dankwart's tavern, south of the temple.")
        elif calendar.day_name[current_date.weekday()] == "Tuesday":
            await self.bot.say("On Tuesdays you can find him in Liberty Bay, in Lyonel's tavern, west of the depot.")
        elif calendar.day_name[current_date.weekday()] == "Wednesday":
            await self.bot.say("On Wednesdays you can find him in Port Hope, in Clyde's tavern, north of the ship.")
        elif calendar.day_name[current_date.weekday()] == "Thursday":
            await self.bot.say("On Thursdays you can find him in Ankrahmun, in Arito's tavern, above the post office.")
        elif calendar.day_name[current_date.weekday()] == "Friday":
            await self.bot.say("On Fridays you can find him in Darashia, in Miraia's tavern, south of the guildhalls.")
        elif calendar.day_name[current_date.weekday()] == "Saturday":
            await self.bot.say("On Saturdays you can find him in Edron, in Mirabell's tavern, above the depot.")
        else:
            pass

    def split_list(self, alist, wanted_parts=1):
        length = len(alist)
        return [alist[i*length // wanted_parts: (i+1)*length // wanted_parts]
                for i in range(wanted_parts)]

    def column_maker(self, obj, cols=4, columnwise=True, spacing=4):
        """
        Print the given list in evenly-spaced columns.

        Parameters
        ----------
        obj : list
            The list to be printed.
        cols : int
            The number of columns in which the list should be printed.
        columnwise : bool, default=True
            If True, the items in the list will be printed column-wise.
            If False the items in the list will be printed row-wise.
        gap : int
            The number of spaces that should separate the longest column
            item/s from the next column. This is the effective spacing
            between columns based on the maximum len() of the list items.
        """

        if cols > len(obj): cols = len(obj)
        max_len = max([len(item) for item in obj])
        if columnwise: cols = int(math.ceil(float(len(obj)) / float(cols)))
        plist = [obj[i: i+cols] for i in range(0, len(obj), cols)]
        if columnwise:
            if not len(plist[-1]) == cols:
                plist[-1].extend(['']*(len(obj) - len(plist[-1])))
            plist = zip(*plist)
        printer = '\n'.join([
            ''.join([c.ljust(max_len + spacing) for c in p])
            for p in plist])
        return printer

def setup(bot):
    if soupAvailable:
        if tabulateAvailable:
            n = Tibia(bot)
            bot.add_cog(n)
        else:
            raise RuntimeError("You need to run 'pip3 install tabulate'")
    else:
        raise RuntimeError("You need to run 'pip3 install beautifulsoup4'")


text:
/*
* <auto-generated>
*     This code was generated by a tool.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

#import "MOZUOrderNoteClient.h"
#import "MOZUOrderNoteResource.h"

@interface MOZUOrderNoteResource()
@property(readwrite, nonatomic) MOZUAPIContext * apiContext;
@end

@implementation MOZUOrderNoteResource

-(id)initWithAPIContext:(MOZUAPIContext *)apiContext {
	if (self = [super init]) {
		self.apiContext = apiContext;
		return self;
	}
	else {
		return nil;
	}
}

-(id)cloneWithAPIContextModification:(MOZUAPIContextModificationBlock)apiContextModification {
	MOZUAPIContext* cloned = [self.apiContext cloneWith:apiContextModification];
	return [self initWithAPIContext:cloned];
}

//
#pragma mark -
#pragma mark Get Operations
#pragma mark -
//

/**
Retrieves a list of all notes for an order.
@param orderId Unique identifier of the order.
*/

- (void)orderNotesWithOrderId:(NSString *)orderId completionHandler:(void(^)(NSArray<MOZUOrderNote> *result, MOZUAPIError *error, NSHTTPURLResponse *response))handler
 {
	MOZUClient *client = [MOZUOrderNoteClient clientForGetOrderNotesOperationWithOrderId:orderId];
	client.context = self.apiContext;
	[client executeWithCompletionHandler:^(id result, NSHTTPURLResponse *response, MOZUAPIError *error) {
		if (handler != nil) {
			handler(result, error, response);
		}
	}];
}

/**
Retrieves the details of a specific order note.
@param noteId Unique identifier of a particular note to retrieve.
@param orderId Unique identifier of the order.
@param responseFields Use this field to include those fields which are not included by default.
*/

- (void)orderNoteWithOrderId:(NSString *)orderId noteId:(NSString *)noteId responseFields:(NSString *)responseFields completionHandler:(void(^)(MOZUOrderNote *result, MOZUAPIError *error, NSHTTPURLResponse *response))handler
 {
	MOZUClient *client = [MOZUOrderNoteClient clientForGetOrderNoteOperationWithOrderId:orderId noteId:noteId responseFields:responseFields];
	client.context = self.apiContext;
	[client executeWithCompletionHandler:^(id result, NSHTTPURLResponse *response, MOZUAPIError *error) {
		if (handler != nil) {
			handler(result, error, response);
		}
	}];
}

//
#pragma mark -
#pragma mark Post Operations
#pragma mark -
//

/**
Creates a new merchant note for the specified order.
@param body Properties of an order note for a merchant, which is internal only for administrative purposes and not available to the shopper.
@param orderId Unique identifier of the order.
@param responseFields Use this field to include those fields which are not included by default.
*/

- (void)createOrderNoteWithBody:(MOZUOrderNote *)body orderId:(NSString *)orderId responseFields:(NSString *)responseFields completionHandler:(void(^)(MOZUOrderNote *result, MOZUAPIError *error, NSHTTPURLResponse *response))handler
 {
	MOZUClient *client = [MOZUOrderNoteClient clientForCreateOrderNoteOperationWithBody:body orderId:orderId responseFields:responseFields];
	client.context = self.apiContext;
	[client executeWithCompletionHandler:^(id result, NSHTTPURLResponse *response, MOZUAPIError *error) {
		if (handler != nil) {
			handler(result, error, response);
		}
	}];
}

//
#pragma mark -
#pragma mark Put Operations
#pragma mark -
//

/**
Updates a specific note for an order.
@param body Properties of an order note for a merchant, which is internal only for administrative purposes and not available to the shopper.
@param noteId Unique identifier of a particular note to retrieve.
@param orderId Unique identifier of the order.
@param responseFields Use this field to include those fields which are not included by default.
*/

- (void)updateOrderNoteWithBody:(MOZUOrderNote *)body orderId:(NSString *)orderId noteId:(NSString *)noteId responseFields:(NSString *)responseFields completionHandler:(void(^)(MOZUOrderNote *result, MOZUAPIError *error, NSHTTPURLResponse *response))handler
 {
	MOZUClient *client = [MOZUOrderNoteClient clientForUpdateOrderNoteOperationWithBody:body orderId:orderId noteId:noteId responseFields:responseFields];
	client.context = self.apiContext;
	[client executeWithCompletionHandler:^(id result, NSHTTPURLResponse *response, MOZUAPIError *error) {
		if (handler != nil) {
			handler(result, error, response);
		}
	}];
}

//
#pragma mark -
#pragma mark Delete Operations
#pragma mark -
//

/**
Deletes the specified order note.
@param noteId Unique identifier of a particular note to retrieve.
@param orderId Unique identifier of the order.
*/

- (void)deleteOrderNoteWithOrderId:(NSString *)orderId noteId:(NSString *)noteId completionHandler:(void(^)(MOZUAPIError *error, NSHTTPURLResponse *response))handler
 {
	MOZUClient *client = [MOZUOrderNoteClient clientForDeleteOrderNoteOperationWithOrderId:orderId noteId:noteId];
	client.context = self.apiContext;
	[client executeWithCompletionHandler:^(id result, NSHTTPURLResponse *response, MOZUAPIError *error) {
		if (handler != nil) {
			handler(error, response);
		}
	}];
}

@end


text:
namespace Husky.Alipay
{
	public class AlipayOrderModel
	{
		public decimal Amount { get; set; }
		public string OrderNo { get; set; } = null!;
		public string Subject { get; set; } = null!;
		public string? Body { get; set; }
		public bool AllowCreditCard { get; set; } = true;

		public string? NotifyUrl { get; set; }
		public string? ReturnUrl { get; set; }
	}
}


text:
"""
Graph data structure.
"""

import sys

class DAG:
	"""Directed Acyclic Graph"""

	def __init__(self):
		self.nodes = {}
		self.root_nodes = {}
		self.leaf_nodes = {}
		self.num_edges = 0

	def Nodes(self):
		"""Return a list of tuples. Each tuple contains
		2 members, the node_datum (what the user thinks is the node
		in the DAG) and the Node object."""
		return self.nodes.items()

	def SetUserData(self, node_datum, user_data):
		node = self.nodes[node_datum]
		node.SetUserData(user_data)

	def UserData(self, node_datum):
		node = self.nodes[node_datum]
		return node.UserData()

	def AddNode(self, node_datum):
		"""Add a new node to the DAG. If the node
		already exists, no action is taken."""
		if self.nodes.has_key(node_datum):
			return

		node = Node()
		self.nodes[node_datum] = node

		self.root_nodes[node_datum] = node
		self.leaf_nodes[node_datum] = node

	def AddEdge(self, node_datum_a, node_datum_b):
		"""(child) node_a --> (parent) node_b"""
		node_a = self.nodes[node_datum_a]
		node_b = self.nodes[node_datum_b]

		node_a.AddOutEdge(node_datum_b)
		node_b.AddInEdge(node_datum_a)

		if self.root_nodes.has_key(node_datum_a):
			del self.root_nodes[node_datum_a]

		if self.leaf_nodes.has_key(node_datum_b):
			del self.leaf_nodes[node_datum_b]

		self.num_edges += 1

	def AttachDAG(self, attach_point_node_datum, other_DAG):
		"""Attach another DAG to this DAG, either
		at the root node (node_datum == None), or
		beneath a node."""

		other_root_node_data = other_DAG.Roots()

		# Copy the nodes over to us.
		nodes = other_DAG.Nodes()
		for (node_datum, node) in nodes:
			self.AddNode(node_datum)
			self.SetUserData(node_datum, node.UserData())

		# Copy the edges over too.
		for (node_datum, node) in nodes:

			for in_node_datum in node.InEdges():
				self.AddEdge(in_node_datum, node_datum)

			for out_node_datum in node.OutEdges():
				self.AddEdge(node_datum, out_node_datum)

		# Connect the other DAG's root nodes under
		# the node specified in the method arguments, if
		# any.
		if attach_point_node_datum:
			for other_root_node_datum in other_root_node_data:
				self.AddEdge(other_root_node_datum, attach_point_node_datum)

	def Inputs(self, node_datum):
		"""Input nodes for a particular node."""
		node = self.nodes[node_datum]
		return node.InEdges()

	def Outputs(self, node_datum):
		"""Output nodes for a particular node."""
		node = self.nodes[node_datum]
		return node.OutEdges()

	def Leafs(self):
		"""List of leaf nodes in the DAG."""
		return self.leaf_nodes.keys()

	def Leaves(self):
		"""List of leaf nodes in the DAG."""
		return self.Leafs()

	def Roots(self):
		"""List of root nodes in the DAG."""
		return self.root_nodes.keys()

	def Print(self):
		"""Print DAG to stdout"""
		self.Write(sys.stdout)

	def Write(self, fh):
		"""Write DAG to stream."""
                self._write(fh, None, 0)

	def _write(self, fh, datum, indent_level):
                indent = indent_level * "   "

                if indent_level == 0:
                    inputs = self.root_nodes.keys()
                else:
                    inputs = self.Inputs(datum)

                # If the sub-graphs of multiple inputs are the same,
                # then group them together.
		inputs.sort()
                groups = {}
                for input in inputs:
                    sub_inputs = self.Inputs(input)
                    sub_inputs.sort()
                    group_key = ' '.join(map(str, sub_inputs))
                    group_values = groups.setdefault(group_key, [])
                    group_values.append(input)

		new_indent_level = indent_level + 1
                group_keys = groups.keys()
                group_keys.sort()

                for group_key in group_keys:
                    group = groups[group_key]

                    if len(group) == 1:
                        # Print the single member of the group
                        input = group[0]
                        print >> fh, indent + str(input)

                        # and it's subgraph
                        self._write(fh, group[0], new_indent_level)
                    else:
                        # Print all but the last member of the group,
                        # with a trailing backslash to denote the set of group members.
                        for input in group[:-1]:
                            print >> fh, indent + str(input), "\\"

                        # Then print the last member of the group
                        input = group[-1]
                        print >> fh, indent + str(input)

                        # and it's subgraph (which is shared for all members of the group)
                        self._write(fh, input, new_indent_level)

                        # Add vertical space between groups
                        print >> fh, ""

	def NumNodes(self):
		"""The number of nodes in the DAG."""
		return len(self.nodes)

	def NumEdges(self):
		"""The number of edges in the DAG."""
		return self.num_edges

class Node:
	"""Maintains list of inputs and output nodes for a node."""
	def __init__(self):
		self.in_edges = []
		self.out_edges = []
		self.user_data = None

	def AddOutEdge(self, datum):
		if not datum in self.out_edges:
			self.out_edges.append(datum)

	def AddInEdge(self, datum):
		if not datum in self.in_edges:
			self.in_edges.append(datum)

	def InEdges(self):
		return self.in_edges

	def OutEdges(self):
		return self.out_edges

	def SetUserData(self, user_data):
		self.user_data = user_data

	def UserData(self):
		return self.user_data


text:
namespace compose_bitmaps_helper {

// Ratio of icon size to the amount of padding between the icons.
const int kIconPaddingScale = 8;

std::unique_ptr<SkBitmap> ComposeBitmaps(const std::vector<SkBitmap>& bitmaps,
                                         int desired_size_in_pixel) {
  int num_icons = bitmaps.size();
  DVLOG(1) << "num icons: " << num_icons;
  if (num_icons == 0) {
    return nullptr;
  }

  DVLOG(1) << "desired_size_in_pixel: " << desired_size_in_pixel;
  int icon_padding_pixel_size = desired_size_in_pixel / kIconPaddingScale;

  // Offset to write icons out of frame due to padding.
  int icon_write_offset = icon_padding_pixel_size / 2;

  SkBitmap composite_bitmap;
  SkImageInfo image_info =
      bitmaps[0]
          .info()
          .makeWH(desired_size_in_pixel, desired_size_in_pixel)
          .makeAlphaType(kPremul_SkAlphaType);

  composite_bitmap.setInfo(image_info);
  composite_bitmap.allocPixels();

  int icon_size = desired_size_in_pixel / 2;

  // draw icons in correct areas
  switch (num_icons) {
    case 1: {
      // Centered.
      SkBitmap scaledBitmap = ScaleBitmap(icon_size, bitmaps[0]);
      if (scaledBitmap.empty()) {
        return nullptr;
      }
      composite_bitmap.writePixels(
          scaledBitmap.pixmap(),
          ((icon_size + icon_padding_pixel_size) / 2) - icon_write_offset,
          ((icon_size + icon_padding_pixel_size) / 2) - icon_write_offset);
      break;
    }
    case 2: {
      // Side by side.
      for (int i = 0; i < 2; i++) {
        SkBitmap scaledBitmap = ScaleBitmap(icon_size, bitmaps[i]);
        if (scaledBitmap.empty()) {
          return nullptr;
        }
        composite_bitmap.writePixels(
            scaledBitmap.pixmap(),
            (i * (icon_size + icon_padding_pixel_size)) - icon_write_offset,
            ((icon_size + icon_padding_pixel_size) / 2) - icon_write_offset);
      }
      break;
    }
    case 3: {
      // Two on top, one on bottom.
      for (int i = 0; i < 3; i++) {
        SkBitmap scaledBitmap = ScaleBitmap(icon_size, bitmaps[i]);
        if (scaledBitmap.empty()) {
          return nullptr;
        }
        switch (i) {
          case 0:
            composite_bitmap.writePixels(
                scaledBitmap.pixmap(), -icon_write_offset, -icon_write_offset);
            break;
          case 1:
            composite_bitmap.writePixels(
                scaledBitmap.pixmap(),
                (icon_size + icon_padding_pixel_size) - icon_write_offset,
                -icon_write_offset);
            break;
          default:
            composite_bitmap.writePixels(
                scaledBitmap.pixmap(),
                ((icon_size + icon_padding_pixel_size) / 2) - icon_write_offset,
                (icon_size + icon_padding_pixel_size) - icon_write_offset);
            break;
        }
      }
      break;
    }
    case 4: {
      // One in each corner.
      for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
          int index = i + 2 * j;
          SkBitmap scaledBitmap = ScaleBitmap(icon_size, bitmaps[index]);
          if (scaledBitmap.empty()) {
            return nullptr;
          }
          composite_bitmap.writePixels(
              scaledBitmap.pixmap(),
              (j * (icon_size + icon_padding_pixel_size)) - icon_write_offset,
              (i * (icon_size + icon_padding_pixel_size)) - icon_write_offset);
        }
      }
      break;
    }
    default:
      DLOG(ERROR) << "Invalid number of icons to combine: " << bitmaps.size();
      return nullptr;
  }

  return std::make_unique<SkBitmap>(composite_bitmap);
}

SkBitmap ScaleBitmap(int icon_size, const SkBitmap& bitmap) {
  SkBitmap temp_bitmap;
  SkImageInfo scaledIconInfo = bitmap.info().makeWH(icon_size, icon_size);
  temp_bitmap.setInfo(scaledIconInfo);
  temp_bitmap.allocPixels();
  bool did_scale =
      bitmap.pixmap().scalePixels(temp_bitmap.pixmap(), kHigh_SkFilterQuality);
  if (!did_scale) {
    DLOG(ERROR) << "Unable to scale icon";
    return SkBitmap();
  }
  return temp_bitmap;
}

}  // namespace compose_bitmaps_helper


text:
using System;
using Newtonsoft.Json.Linq;
using PX.SurveyMonkeyReader.Commands;
using PX.SurveyMonkeyReader.Extensions;

namespace PX.SurveyMonkeyReader.Repository
{
    public class OAuthRepository : IOAuthRepository
    {
        private static OAuthCommands _commands;

        public OAuthRepository(string clientId, string clientSecret, string redirectUri)
        {
            _commands = new OAuthCommands(clientId, clientSecret, redirectUri);
        }

        public string GetAuthorizationPageUri()
        {
            return _commands.GetAuthorizationPageUri();
        }

        public string GetAccessToken(string code)
        {
            var accessTokenJsonString = _commands.GetAccessToken(code);

            JObject accessTokenJson;
            if (!JObjectExt.TryParse(accessTokenJsonString, out accessTokenJson))
                return null;

            if (accessTokenJson.SelectToken("access_token") != null)
            {
                return accessTokenJson.SelectToken("access_token").ToString();
            }

            if (accessTokenJson.SelectToken("error") != null)
            {
                throw new Exception(string.Concat(accessTokenJson.SelectToken("error").ToString(),
                    accessTokenJson.SelectToken("error_description")?.ToString()));
            }

            throw new Exception("Could not retrieve an access token");
        }
    }
}


text:
namespace extension_debugger_api_constants {

// Keys.
extern const char kCommandKey[];
extern const char kDataKey[];
extern const char kTabIdKey[];
extern const char kVersionIdKey[];

// Events.
extern const char kOnEvent[];
extern const char kOnDetach[];

// Errors.
extern const char kAlreadyAttachedError[];
extern const char kAttachToWebUIError[];
extern const char kDebuggerExecuteFailedError[];
extern const char kNoTabError[];
extern const char kNotAttachedError[];
extern const char kPermissionError[];
extern const char kProtocolVersionNotSupportedError[];

}  // namespace extension_debugger_api_constants

#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEBUGGER_API_CONSTANTS_H_


text:
import { INotice } from './notice';

const FILTERED = '[Filtered]';
const MAX_OBJ_LENGTH = 128;

// jsonifyNotice serializes notice to JSON and truncates params,
// environment and session keys.
export function jsonifyNotice(
  notice: INotice,
  { maxLength = 64000, keysBlocklist = [] } = {}
): string {
  if (notice.errors) {
    for (let i = 0; i < notice.errors.length; i++) {
      let t = new Truncator({ keysBlocklist });
      notice.errors[i] = t.truncate(notice.errors[i]);
    }
  }

  let s = '';
  let keys = ['context', 'params', 'environment', 'session'];
  for (let level = 0; level < 8; level++) {
    let opts = { level, keysBlocklist };
    for (let key of keys) {
      let obj = notice[key];
      if (obj) {
        notice[key] = truncate(obj, opts);
      }
    }

    s = JSON.stringify(notice);
    if (s.length < maxLength) {
      return s;
    }
  }

  let params = {
    json: s.slice(0, Math.floor(maxLength / 2)) + '...',
  };
  keys.push('errors');
  for (let key of keys) {
    let obj = notice[key];
    if (!obj) {
      continue;
    }

    s = JSON.stringify(obj);
    params[key] = s.length;
  }

  let err = new Error(
    `airbrake: notice exceeds max length and can't be truncated`
  );
  (err as any).params = params;
  throw err;
}

function scale(num: number, level: number): number {
  return num >> level || 1;
}

interface ITruncatorOptions {
  level?: number;
  keysBlocklist?: any[];
}

class Truncator {
  private maxStringLength = 1024;
  private maxObjectLength = MAX_OBJ_LENGTH;
  private maxArrayLength = MAX_OBJ_LENGTH;
  private maxDepth = 8;

  private keys: string[] = [];
  private keysBlocklist: any[] = [];
  private seen: any[] = [];

  constructor(opts: ITruncatorOptions) {
    let level = opts.level || 0;
    this.keysBlocklist = opts.keysBlocklist || [];

    this.maxStringLength = scale(this.maxStringLength, level);
    this.maxObjectLength = scale(this.maxObjectLength, level);
    this.maxArrayLength = scale(this.maxArrayLength, level);
    this.maxDepth = scale(this.maxDepth, level);
  }

  public truncate(value: any, key = '', depth = 0): any {
    if (value === null || value === undefined) {
      return value;
    }

    switch (typeof value) {
      case 'boolean':
      case 'number':
      case 'function':
        return value;
      case 'string':
        return this.truncateString(value);
      case 'object':
        break;
      default:
        return this.truncateString(String(value));
    }

    if (value instanceof String) {
      return this.truncateString(value.toString());
    }

    if (
      value instanceof Boolean ||
      value instanceof Number ||
      value instanceof Date ||
      value instanceof RegExp
    ) {
      return value;
    }

    if (value instanceof Error) {
      return this.truncateString(value.toString());
    }

    if (this.seen.indexOf(value) >= 0) {
      return `[Circular ${this.getPath(value)}]`;
    }

    let type = objectType(value);

    depth++;
    if (depth > this.maxDepth) {
      return `[Truncated ${type}]`;
    }

    this.keys.push(key);
    this.seen.push(value);

    switch (type) {
      case 'Array':
        return this.truncateArray(value, depth);
      case 'Object':
        return this.truncateObject(value, depth);
      default:
        let saved = this.maxDepth;
        this.maxDepth = 0;

        let obj = this.truncateObject(value, depth);
        obj.__type = type;

        this.maxDepth = saved;

        return obj;
    }
  }

  private getPath(value): string {
    let index = this.seen.indexOf(value);
    let path = [this.keys[index]];
    for (let i = index; i >= 0; i--) {
      let sub = this.seen[i];
      if (sub && getAttr(sub, path[0]) === value) {
        value = sub;
        path.unshift(this.keys[i]);
      }
    }
    return '~' + path.join('.');
  }

  private truncateString(s: string): string {
    if (s.length > this.maxStringLength) {
      return s.slice(0, this.maxStringLength) + '...';
    }
    return s;
  }

  private truncateArray(arr: any[], depth = 0): any[] {
    let length = 0;
    let dst: any = [];
    for (let i = 0; i < arr.length; i++) {
      let el = arr[i];
      dst.push(this.truncate(el, i.toString(), depth));

      length++;
      if (length >= this.maxArrayLength) {
        break;
      }
    }
    return dst;
  }

  private truncateObject(obj: any, depth = 0): any {
    let length = 0;
    let dst = {};
    for (let key in obj) {
      if (!Object.prototype.hasOwnProperty.call(obj, key)) {
        continue;
      }
      if (isBlocklisted(key, this.keysBlocklist)) {
        dst[key] = FILTERED;
        continue;
      }

      let value = getAttr(obj, key);

      if (value === undefined || typeof value === 'function') {
        continue;
      }
      dst[key] = this.truncate(value, key, depth);

      length++;
      if (length >= this.maxObjectLength) {
        break;
      }
    }
    return dst;
  }
}

export function truncate(value: any, opts: ITruncatorOptions = {}): any {
  let t = new Truncator(opts);
  return t.truncate(value);
}

function getAttr(obj: any, attr: string): any {
  // Ignore browser specific exception trying to read an attribute (#79).
  try {
    return obj[attr];
  } catch (_) {
    return;
  }
}

function objectType(obj: any): string {
  let s = Object.prototype.toString.apply(obj);
  return s.slice('[object '.length, -1);
}

function isBlocklisted(key: string, keysBlocklist: any[]): boolean {
  for (let v of keysBlocklist) {
    if (v === key) {
      return true;
    }
    if (v instanceof RegExp) {
      if (key.match(v)) {
        return true;
      }
    }
  }
  return false;
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /Applications/MAMP/htdocs/initialDB2.0/initialDB/Manager</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/style.css" rel="stylesheet">

/Applications/MAMP/htdocs/initialDB2.0/initialDB

Manager

(Dashboard)

Code Coverage

Lines

Functions and Methods

Classes and Traits

      Total

           72.92% covered (warning)

72.92%

35 / 48

           57.14% covered (warning)

57.14%

4 / 7

           50.00% covered (danger)

50.00%

1 / 2

       Helpers

           72.92% covered (warning)

72.92%

35 / 48

           57.14% covered (warning)

57.14%

4 / 7

           50.00% covered (danger)

50.00%

1 / 2

Legend

     Low: 0% to 50%
     Medium: 50% to 90%
     High: 90% to 100%

     Generated by PHP_CodeCoverage 2.2.4 using PHP 5.5.38 and PHPUnit 4.8.35 at Mon Mar 13 18:04:57 UTC 2017.


text:
#include "QmitkDTIAtlasAppWorkbenchAdvisor.h"

#include "internal/QmitkDTIAtlasAppApplicationPlugin.h"

#include <berryPlatform.h>
#include <berryIPreferencesService.h>
#include <berryWorkbenchPreferenceConstants.h>
#include <berryQtAssistantUtil.h>
#include <QmitkExtWorkbenchWindowAdvisor.h>

#include <QApplication>

const std::string QmitkDTIAtlasAppWorkbenchAdvisor::WELCOME_PERSPECTIVE_ID = "org.mitk.dtiatlasapp.perspectives.welcome";

void
QmitkDTIAtlasAppWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer)
{
  berry::QtWorkbenchAdvisor::Initialize(configurer);

  configurer->SetSaveAndRestore(true);

  // TODO This should go into the products plugin_customization.ini file (when
  // the product and branding support is finished, see bug 2146).
  // This will not work anymore, if bug 2822 is fixed.
  berry::IPreferencesService::Pointer prefService = berry::Platform::GetServiceRegistry().GetServiceById<berry::IPreferencesService>(berry::IPreferencesService::ID);
  prefService->GetSystemPreferences()->Put(berry::WorkbenchPreferenceConstants::PREFERRED_SASH_LAYOUT, berry::WorkbenchPreferenceConstants::RIGHT);

  QString collectionFile = QmitkDTIAtlasAppApplicationPlugin::GetDefault()->GetQtHelpCollectionFile();
  if (!collectionFile.isEmpty())
  {
//    berry::QtAssistantUtil::SetHelpCollectionFile(collectionFile);
//    berry::QtAssistantUtil::SetDefaultHelpUrl("qthelp://org.mitk.gui.qt.dtiatlasapp/bundle/index.html");

    typedef std::vector<berry::IBundle::Pointer> BundleContainer;
    BundleContainer bundles = berry::Platform::GetBundles();
    berry::QtAssistantUtil::RegisterQCHFiles(bundles);
  }

}

berry::WorkbenchWindowAdvisor*
QmitkDTIAtlasAppWorkbenchAdvisor::CreateWorkbenchWindowAdvisor(
        berry::IWorkbenchWindowConfigurer::Pointer configurer)
{
  std::vector<std::string> perspExcludeList;
  perspExcludeList.push_back( std::string("org.mitk.dtiatlasapp.perspectives.welcome") );
  perspExcludeList.push_back( std::string("org.mitk.perspectives.diffusionimaginginternal") );
  perspExcludeList.push_back( std::string("org.mitk.perspectives.publicdiffusionimaging") );
  perspExcludeList.push_back( std::string("org.mitk.extapp.defaultperspective") );
  perspExcludeList.push_back( std::string("org.mitk.coreapp.defaultperspective") );

  std::vector<std::string> viewExcludeList;
  viewExcludeList.push_back( std::string("org.mitk.views.partialvolumeanalysis") );
  viewExcludeList.push_back( std::string("org.mitk.views.globalfibertracking") );
  viewExcludeList.push_back( std::string("org.mitk.views.tractbasedspatialstatistics") );
  viewExcludeList.push_back( std::string("org.mitk.views.fibertracking") );
  viewExcludeList.push_back( std::string("org.mitk.views.ivim") );
  viewExcludeList.push_back( std::string("org.mitk.views.qballreconstruction") );
  viewExcludeList.push_back( std::string("org.mitk.views.diffusiondicomimport") );
  viewExcludeList.push_back( std::string("org.mitk.views.diffusionpreprocessing") );
  viewExcludeList.push_back( std::string("org.mitk.views.diffusionquantification") );
  viewExcludeList.push_back( std::string("org.mitk.views.tensorreconstruction") );
  viewExcludeList.push_back( std::string("org.mitk.views.perspectiveswitcher") );
  viewExcludeList.push_back( std::string("org.mitk.views.basicimageprocessing") );
  viewExcludeList.push_back( std::string("org.mitk.views.fiberbundleoperations") );
  viewExcludeList.push_back( std::string("org.mitk.views.measurement") );
  viewExcludeList.push_back( std::string("org.mitk.views.moviemaker") );
  viewExcludeList.push_back( std::string("org.mitk.views.odfdetails") );
  viewExcludeList.push_back( std::string("org.mitk.views.propertylistview") );
  viewExcludeList.push_back( std::string("org.mitk.views.screenshotmaker") );
  viewExcludeList.push_back( std::string("org.mitk.views.segmentation") );
  viewExcludeList.push_back( std::string("org.mitk.views.imagestatistics") );
//  viewExcludeList.push_back( std::string("org.mitk.views.controlvisualizationpropertiesview") );
  viewExcludeList.push_back( std::string("org.mitk.views.volumevisualization") );
  viewExcludeList.push_back( std::string("org.mitk.views.simplemeasurement") );

  configurer->SetShowPerspectiveBar(false);
  configurer->SetInitialSize(berry::Point(1000,770));

  QmitkExtWorkbenchWindowAdvisor* advisor = new QmitkExtWorkbenchWindowAdvisor(this, configurer);
  advisor->SetPerspectiveExcludeList(perspExcludeList);
  advisor->SetViewExcludeList(viewExcludeList);
  advisor->ShowViewToolbar(false);
  advisor->ShowVersionInfo(false);
  advisor->ShowMitkVersionInfo(false);
  advisor->SetProductName("based on MITK Diffusion Imaging App");
  advisor->SetWindowIcon(":/org.mitk.gui.qt.dtiatlasapp/app-icon.png");
  return advisor;
}

std::string QmitkDTIAtlasAppWorkbenchAdvisor::GetInitialWindowPerspectiveId()
{
  return WELCOME_PERSPECTIVE_ID;
}


text:
from django.db import models
from django.conf import settings

from products.models import Product

class Cart(models.Model):
    session_key = models.CharField(max_length=40, unique=True, null=True)

    def __unicode__(self):
        return str(self.id)

class CartItem(models.Model):
    cart = models.ForeignKey(Cart)
    product = models.ForeignKey(Product)
    qty = models.PositiveIntegerField()


text:
<?php
namespace SBData\Model\Value;

/**
 * Stores a value and checks whether it is a valid natural number.
 */
class NaturalNumberValue extends IntegerValue
{
	/**
	 * @see IntegerValue::__construct()
	 */
	public function __construct(bool $mandatory = false, int $maxlength = null, $defaultValue = null, int $maxValue = null)
	{
		parent::__construct($mandatory, $maxlength, $defaultValue, 0, null);
	}
}
?>


text:
Github Time Localization
========================

Localize time on GitHub. [Install](http://userscripts.org/scripts/source/149087.user.js)

Browser
-------

- Chrome
- Firefox - need [Greasemonekey](https://addons.mozilla.org/ja/firefox/addon/greasemonkey/)
- Safari - need [NinjaKit](http://d.hatena.ne.jp/os0x/20100612/1276330696)

Author
------

- @linyows

License
-------

[The MIT License](https://raw.github.com/linyows/github-time-localization/master/LICENSE)


text:
require 'dotenv'
Dotenv.load
require "spec_helper"
require "flex_commerce_api"
require "active_support/tagged_logging"
require "json_matchers/rspec"
root = File.expand_path("../", __dir__)
Dir[File.join root, "spec/support_e2e/**/*.rb"].sort.each { |f| require f }
raise "API_ROOT, API_ACCOUNT and API_KEY must be set in your environment" unless ENV.key?("API_ROOT") && ENV.key?("API_ACCOUNT") && ENV.key?("API_KEY")
FlexCommerceApi.config do |config|
  config.flex_root_url = ENV["API_ROOT"]
  config.flex_account = ENV["API_ACCOUNT"]
  config.flex_api_key = ENV["API_KEY"]

  # Paypal Secrets
  config.paypal_login = ENV.fetch("PAYPAL_LOGIN")
  config.paypal_password = ENV.fetch("PAYPAL_PASSWORD")
  config.paypal_signature = ENV.fetch("PAYPAL_SIGNATURE")
  config.order_test_mode = ENV.fetch("ORDER_TEST_MODE", "true")

  config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Can. J. Bot. 67(5): 1535 (1989)

#### Original name
Leptosphaeria sorghi-arundinacei Luc

### Remarks
null


text:
<!doctype html>

    <meta charset='utf-8'/>
    <title> | Documentation</title>
    <meta name='viewport' content='width=device-width,initial-scale=1'>
    <link href='assets/bass.css' type='text/css' rel='stylesheet'/>
    <link href='assets/style.css' type='text/css' rel='stylesheet'/>
    <link href='assets/github.css' type='text/css' rel='stylesheet'/>

                <input
                        placeholder='Filter'
                        id='filter-input'
                        class='col12 block input'
                        type='text'/>

                            defaults
                            ▸

Static members

                                        .strings

                                        .typeSpeed

                                        .startDelay

                                        .backSpeed

                                        .smartBackspace

                                        .shuffle

                                        .backDelay

                                        .fadeOut

                                        .loop

                                        .showCursor

                                        .attr

                                        .bindInputFocusEvents

                                        .contentType

                                        .onComplete

                                        .preStringTyped

                                        .onStringTyped

                                        .onLastStringBackspaced

                                        .onTypingPaused

                                        .onTypingResumed

                                        .onReset

                                        .onStop

                                        .onStart

                                        .onDestroy

                            HTMLParser

                            Initializer

                            Typed
                            ▸

Instance members

                                        #toggle

                                        #stop

                                        #start

                                        #destroy

                                        #reset

                    Need help reading this?

                        defaults

Defaults & options

defaults

Returns

                object:
                Typed defaults & options

Static Members

                                ▸
                                strings

strings

Properties

                                        strings (array)
                                        : strings to be typed

                                        stringsElement (string)
                                        : ID of element containing string children

                                ▸
                                typeSpeed

typeSpeed

Properties

                                        typeSpeed (number)
                                        : type speed in milliseconds

                                ▸
                                startDelay

startDelay

Properties

                                        startDelay (number)
                                        : time before typing starts in milliseconds

                                ▸
                                backSpeed

backSpeed

Properties

                                        backSpeed (number)
                                        : backspacing speed in milliseconds

                                ▸
                                smartBackspace

smartBackspace

Properties

                                        smartBackspace (boolean)
                                        : only backspace what doesn't match the previous string

                                ▸
                                shuffle

shuffle

Properties

                                        shuffle (boolean)
                                        : shuffle the strings

                                ▸
                                backDelay

backDelay

Properties

                                        backDelay (number)
                                        : time before backspacing in milliseconds

                                ▸
                                fadeOut

fadeOut

Properties

                                        fadeOut (boolean)
                                        : Fade out instead of backspace

                                        fadeOutClass (string)
                                        : css class for fade animation

                                        fadeOutDelay (boolean)
                                        : Fade out delay in milliseconds

                                ▸
                                loop

loop

Properties

                                        loop (boolean)
                                        : loop strings

                                        loopCount (number)
                                        : amount of loops

                                ▸
                                showCursor

showCursor

Properties

                                        showCursor (boolean)
                                        : show cursor

                                        cursorChar (string)
                                        : character for cursor

                                        autoInsertCss (boolean)
                                        : insert CSS for cursor and fadeOut into HTML

                                ▸
                                attr

attr

Properties

                                        attr (string)
                                        : attribute for typing
                                        Ex: input placeholder, value, or just HTML text

                                ▸
                                bindInputFocusEvents

bindInputFocusEvents

Properties

                                        bindInputFocusEvents (boolean)
                                        : bind to focus and blur if el is text input

                                ▸
                                contentType

contentType

Properties

                                        contentType (string)
                                        : 'html' or 'null' for plaintext

                                ▸
                                onComplete(self)

All typing is complete

onComplete(self: Typed)

Parameters

                                            self (Typed)

                                ▸
                                preStringTyped(arrayPos, self)

Before each string is typed

preStringTyped(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onStringTyped(arrayPos, self)

After each string is typed

onStringTyped(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onLastStringBackspaced(self)

During looping, after last string is typed

onLastStringBackspaced(self: Typed)

Parameters

                                            self (Typed)

                                ▸
                                onTypingPaused(arrayPos, self)

Typing has been stopped

onTypingPaused(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onTypingResumed(arrayPos, self)

Typing has been started after being stopped

onTypingResumed(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onReset(self)

After reset

onReset(self: Typed)

Parameters

                                            self (Typed)

                                ▸
                                onStop(arrayPos, self)

After stop

onStop(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onStart(arrayPos, self)

After start

onStart(arrayPos: number,
                                    self: Typed)

Parameters

                                            arrayPos (number)

                                            self (Typed)

                                ▸
                                onDestroy(self)

After destroy

onDestroy(self: Typed)

Parameters

                                            self (Typed)

                        HTMLParser

TODO: These methods can probably be combined somehow
                    Parse HTML tags & HTML Characters

new HTMLParser()

                        Initializer

Initialize the Typed object

new Initializer()

                        Typed

Welcome to Typed.js!

new Typed(elementId: string,
                    options: object):
                    object

Parameters

                            elementId (string)
                            HTML element ID
                            OR
                            HTML element

                            options (object)
                            options object

Returns

                object:
                a new Typed object

Instance Members

                                ▸
                                toggle()

Toggle start() and stop() of the Typed instance

toggle()

                                ▸
                                stop()

Stop typing / backspacing and enable cursor blinking

stop()

                                ▸
                                start()

Start typing / backspacing after being stopped

start()

                                ▸
                                destroy()

Destroy this instance of Typed

destroy()

                                ▸
                                reset(restart?)

Reset Typed and optionally restarts

reset(restart: boolean?=
                                    nser)

Parameters

                                            restart (boolean?=
                                            nser)


text:
<?php

namespace Ilios\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Re-generate foreign keys to allow for cascading deletes of sessions.
 */
class Version20160106190703 extends AbstractMigration
{
    /**
     * @inheritdoc
     */
    public function up(Schema $schema)
    {
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE session_learning_material DROP FOREIGN KEY FK_9BE2AF8D613FECDF');
        $this->addSql('ALTER TABLE session_learning_material ADD CONSTRAINT FK_9BE2AF8D613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE session_description DROP FOREIGN KEY FK_91BD5E51613FECDF');
        $this->addSql('ALTER TABLE session_description ADD CONSTRAINT FK_91BD5E51613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE offering DROP FOREIGN KEY FK_A5682AB1613FECDF');
        $this->addSql('ALTER TABLE offering ADD CONSTRAINT FK_A5682AB1613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id) ON DELETE CASCADE');
    }

    /**
     * @inheritdoc
     */
    public function down(Schema $schema)
    {
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE offering DROP FOREIGN KEY FK_A5682AB1613FECDF');
        $this->addSql('ALTER TABLE offering ADD CONSTRAINT FK_A5682AB1613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id)');
        $this->addSql('ALTER TABLE session_description DROP FOREIGN KEY FK_91BD5E51613FECDF');
        $this->addSql('ALTER TABLE session_description ADD CONSTRAINT FK_91BD5E51613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id)');
        $this->addSql('ALTER TABLE session_learning_material DROP FOREIGN KEY FK_9BE2AF8D613FECDF');
        $this->addSql('ALTER TABLE session_learning_material ADD CONSTRAINT FK_9BE2AF8D613FECDF FOREIGN KEY (session_id) REFERENCES session (session_id)');
    }
}


text:
BinaryTreeNode::BinaryTreeNode(BinaryTreeNode* p, int cap, int bin)
{
	parent = p;
	capacity = cap;
	binNumber = bin;
}


text:
from django.conf import settings
from psz import config
from psz.models import Dnskey
from psz import  named
import dns.rrset
import os

TEST_ZONE_NAME = 'psz.test.zone.co.uk'

def setup_module():
    config.DEFAULTS['path_zonedir'] = '/tmp'
    os.chdir('/tmp')
    if not os.path.exists(TEST_ZONE_NAME):
        os.mkdir(TEST_ZONE_NAME)
        os.mkdir(os.path.join(TEST_ZONE_NAME, 'newkeys'))
        os.mkdir(os.path.join(TEST_ZONE_NAME, 'oldkeys'))
    os.chdir(os.path.join(TEST_ZONE_NAME, 'newkeys'))

def teardown():
    keys = Dnskey.objects.all()
    for key in keys:
        key.unlink()
        key.delete()

def test_key_empty_dnskey():
    key = Dnskey()
    s = str(key)
    assert key.dnsdata is None

def test_key_generate_key():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    assert key.keytag is not ''
    keynamebit = 'K' + TEST_ZONE_NAME
    assert keynamebit in key.path_public
    assert keynamebit in key.path_private
    assert key.directory == os.getcwd()
    assert key.dnsdata is not None
    assert TEST_ZONE_NAME in key.dnsdata
    path = os.path.join(config.DEFAULTS['path_zonedir'],
        TEST_ZONE_NAME, 'newkeys')
    assert os.path.exists(key.path_public)
    assert os.path.exists(key.path_private)
    key.save()

def test_key_dnskey_read():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME, keytype='ksk')
    dns = key.dnsdata
    key.save()
    keyid = key.id
    key = Dnskey.objects.get(pk=keyid)
    assert key.dnsdata == dns

def test_key_unlink():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    path = os.path.join(config.DEFAULTS['path_zonedir'],
        TEST_ZONE_NAME, 'newkeys')
    assert os.path.exists(key.path_public)
    assert os.path.exists(key.path_private)
    key.unlink()
    assert not os.path.exists(key.path_public)
    assert not os.path.exists(key.path_private)

def test_key_move():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    key.save()
    path = os.path.join(config.DEFAULTS['path_zonedir'],
        TEST_ZONE_NAME, 'newkeys')
    assert os.path.exists(key.path_public)
    assert os.path.exists(key.path_private)
    newpath = os.path.join(config.DEFAULTS['path_zonedir'],
        TEST_ZONE_NAME, 'oldkeys')
    key.move(newpath)
    key.status = 'expired'
    key.save()
    public_file = '%s.key' % key.keyname
    new_path_public = os.path.join(newpath, public_file)
    assert os.path.exists(os.path.join(newpath, key.path_public))
    assert key.path_public == new_path_public
    assert os.path.exists(os.path.join(newpath, key.path_private))
    private_file = '%s.private' % key.keyname
    new_path_private = os.path.join(newpath, private_file)
    assert key.path_private == new_path_private

def test_key_get_zone_keys():
    count = Dnskey.objects.get_zone_keys(TEST_ZONE_NAME).count()
    key1 = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    key1.save()
    key2 = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    key2.save()
    keys = Dnskey.objects.get_zone_keys(TEST_ZONE_NAME)
    assert keys.count() == count + 2

def test_key_directory():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    key.save()
    keyid = key.id
    oldpath = os.path.realpath(key.directory)
    keyfromdb = Dnskey.objects.get(pk=keyid)
    newpath = os.path.realpath(keyfromdb.directory)
    assert newpath == oldpath

def test_named_keygen():
    key = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME)
    key.save()
    dnstext = key.dnsdata.split(' ', 3)[-1]
    dnskeys = dns.rrset.from_text(TEST_ZONE_NAME, 300, 'in', 'dnskey', dnstext)
    assert int(key.keytag) == named.keytag(dnskeys[0])
    key2 = Dnskey.from_dnssec_keygen(TEST_ZONE_NAME, algname='RSAMD5')
    key2.save()
    dnstext = key2.dnsdata.split(' ', 3)[-1]
    dnskeys = dns.rrset.from_text(TEST_ZONE_NAME, 300, 'in', 'dnskey', dnstext)
    assert int(key2.keytag) == named.keytag(dnskeys[0])


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace frameQuest.ViewModels
{
    public class ElaboraViewModel
    {
        public string chiave { get; set; }
        public string valore { get; set; }

        public int IdDomanda { get; set; }
        public int IdRisposta { get; set; }
    }
}


text:
CREATE TABLE IF NOT EXISTS settings (
	id		INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
	name		CHAR(32)	NOT NULL,
	value		CHAR(128)
);

CREATE TABLE IF NOT EXISTS files (
	id		INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
	name		TEXT		NOT NULL,
	type		TINYINT,
	file_size	INTEGER,
	update_time	INTEGER,
	status		TINYINT,
	favorite	TINYINT		DEFAULT 0,
	file_exists	TINYINT,
	change_detected	INTEGER,
	last_name	TEXT		NOT NULL
	);

INSERT INTO settings VALUES
(NULL, 'configured', 'false'),
(NULL, 'host', ''),
(NULL, 'port', '22'),
(NULL, 'username', ''),
(NULL, 'password', ''),
(NULL, 'basedir', '/'),
(NULL, 'update_interval', '60'),
(NULL, 'last_update', ''),
(NULL, 'last_status', ''),
(NULL, 'force_update', ''),
(NULL, 'hide_basedir', 'false');


text:
# asciidoc-dependency-graph [![Build Status](https://travis-ci.org/azu/asciidoc-dependency-graph.svg)](https://travis-ci.org/azu/asciidoc-dependency-graph)

Generate dependency-graph JSON tree from [AsciiDoc](http://www.methods.co.nz/asciidoc/ "AsciiDoc").

This library collect `id` and `referenceId` of each asciidoc file.

## Installation

``` sh
npm install asciidoc-dependency-graph
```

## Usage

`new AsciidocDependency(options)`

### options

`cwd` : current working directory

e.g) `"cwd" : process.cwd(),`

`pattern` : glob pattern using minimatch module

e.g) `"cwd" : "doc/**/*.adoc"`

``` js
var adocDependency = new AsciidocDependency({
    "cwd": __dirname,
    "pattern": "fixtures/*.adoc"
});
adocDependency.parse().then(function (array) {
    console.log(array);
}).catch(console.error.bind(console));
// or
adocDependency.parse(function(error,array){
    console.log(array);
});
/*
[
{ filePath: '/Users/azu/Dropbox/workspace/JavaScript/library/asciidoc-dependency-graph/test/fixtures/x.adoc',
    ids: [ 'x-doc' ],
    referenceIds: [] },
{ filePath: '/Users/azu/Dropbox/workspace/JavaScript/library/asciidoc-dependency-graph/test/fixtures/y.adoc',
    ids: [ 'y-doc', 'embed-y-code' ],
    referenceIds: [ 'x-doc' ] }
]
*/
```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT


text:
namespace hexclient {

// static
void ClientApp::CreateBrowserDelegates(BrowserDelegateSet& delegates) {
}

// static
void ClientApp::CreateRenderDelegates(RenderDelegateSet& delegates) {
}

// static
void ClientApp::RegisterCustomSchemes(
    CefRefPtr<CefSchemeRegistrar> registrar,
    std::vector<CefString>& cookiable_schemes) {
}

}  // namespace hexclient


text:
package org.jboss.weld.environment.servlet.jsf;

import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;

/**
 * @author pmuir
 * @author alesj
 */
public class WeldApplicationFactory extends ApplicationFactory {

    private final ApplicationFactory applicationFactory;

    private volatile Application application;

    public WeldApplicationFactory(ApplicationFactory applicationFactory) {
        this.applicationFactory = applicationFactory;
    }

    protected ApplicationFactory delegate() {
        return applicationFactory;
    }

    @Override
    public Application getApplication() {
        if (application == null) {
            synchronized (this) {
                if (application == null) {
                    application = new WeldApplication(delegate().getApplication());
                }
            }
        }
        return application;
    }

    @Override
    public void setApplication(Application application) {
        synchronized (this) {
            this.application = null; // invalidate the instance, so it picks up new application
            delegate().setApplication(application);
        }
    }

    @Override
    public boolean equals(Object obj) {
        return delegate().equals(obj);
    }

    @Override
    public int hashCode() {
        return delegate().hashCode();
    }

    @Override
    public String toString() {
        return delegate().toString();
    }

    @Override
    public ApplicationFactory getWrapped() {
        return delegate();
    }
}


text:
using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(Detective.Noodle.Startup))]
namespace Detective.Noodle
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            //ConfigureAuth(app);
        }
    }
}


text:
#ifndef _ASM_RESOURCE_H
#define _ASM_RESOURCE_H

#include <asm-generic/resource.h>

#endif /* _ASM_RESOURCE_H */


text:
Write your plugin documentation here.

The following parameters are used to configuration the plugin's behavior:

* **url** - The URL to POST the webhook to.

The following is a sample maze-build configuration in your
.drone.yml file:

```yaml
notify:
  maze-build:
    image: mikkeloscar/maze-build
    url: http://mockbin.org/
```


text:
static NSString * const kKeyNamespaceId = @"id";
static NSString * const kKeyName = @"name";
static NSString * const kKeyPath = @"path";
static NSString * const kKeyDescription = @"description";
static NSString * const kKeyCreatedAt = @"created_at";
static NSString * const kKeyUpdatedAt = @"updated_at";
static NSString * const kKeyOwnerId = @"owner_id";

@implementation GLNamespace

- (instancetype)initWithJSON:(NSDictionary *)json
{
    if (self = [super init]) {
        _namespaceId = [json[kKeyNamespaceId] longLongValue];
        _name = [self checkForNull:json[kKeyName]];
        _path = [self checkForNull:json[kKeyPath]];
        _namespaceDescription = [self checkForNull:json[kKeyDescription]];
        _createdAt = [[[GLGitlabApi sharedInstance] gitLabDateFormatter] dateFromString:json[kKeyCreatedAt]];
        _updatedAt = [[[GLGitlabApi sharedInstance] gitLabDateFormatter] dateFromString:json[kKeyUpdatedAt]];
        _ownerId = [json[kKeyOwnerId] longLongValue];
    }
    return self;
}

- (BOOL)isEqual:(id)other {
    if (other == self)
        return YES;
    if (!other || ![[other class] isEqual:[self class]])
        return NO;

    return [self isEqualToGlNamespace:other];
}

- (BOOL)isEqualToGlNamespace:(GLNamespace *)glNamespace {
    if (self == glNamespace)
        return YES;
    if (glNamespace == nil)
        return NO;
    if (self.namespaceId != glNamespace.namespaceId)
        return NO;
    if (self.name != glNamespace.name && ![self.name isEqualToString:glNamespace.name])
        return NO;
    if (self.path != glNamespace.path && ![self.path isEqualToString:glNamespace.path])
        return NO;
    if (self.namespaceDescription != glNamespace.namespaceDescription && ![self.namespaceDescription isEqualToString:glNamespace.namespaceDescription])
        return NO;
    if (self.createdAt != glNamespace.createdAt && ![self.createdAt isEqualToDate:glNamespace.createdAt])
        return NO;
    if (self.updatedAt != glNamespace.updatedAt && ![self.updatedAt isEqualToDate:glNamespace.updatedAt])
        return NO;
    if (self.ownerId != glNamespace.ownerId)
        return NO;
    return YES;
}

- (NSUInteger)hash {
    NSUInteger hash = (NSUInteger) self.namespaceId;
    hash = hash * 31u + [self.name hash];
    hash = hash * 31u + [self.path hash];
    hash = hash * 31u + [self.namespaceDescription hash];
    hash = hash * 31u + [self.createdAt hash];
    hash = hash * 31u + [self.updatedAt hash];
    hash = hash * 31u + (NSUInteger) self.ownerId;
    return hash;
}

- (NSString *)description {
    NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: ", NSStringFromClass([self class])];
    [description appendFormat:@"self.namespaceId=%qi", self.namespaceId];
    [description appendFormat:@", self.name=%@", self.name];
    [description appendFormat:@", self.path=%@", self.path];
    [description appendFormat:@", self.namespaceDescription=%@", self.namespaceDescription];
    [description appendFormat:@", self.createdAt=%@", self.createdAt];
    [description appendFormat:@", self.updatedAt=%@", self.updatedAt];
    [description appendFormat:@", self.ownerId=%qi", self.ownerId];
    [description appendString:@">"];
    return description;
}

- (NSDictionary *)jsonRepresentation
{
    NSDateFormatter *formatter = [[GLGitlabApi sharedInstance] gitLabDateFormatter];
    NSNull *null = [NSNull null];
    return @{
             kKeyNamespaceId: @(_namespaceId),
             kKeyName: _name ?: null,
             kKeyPath: _path ?: null,
             kKeyDescription: _namespaceDescription ?: null,
             kKeyCreatedAt: [formatter stringFromDate:_createdAt],
             kKeyUpdatedAt: [formatter stringFromDate:_updatedAt],
             kKeyOwnerId: @(_ownerId)
             };
}

@end


text:
class CreateAssets < ActiveRecord::Migration
  def change
    create_table :assets do |t|
      t.integer :user_id

      t.timestamps

    end

    add_index :assets, :user_id
  end
end


text:
<?php

namespace balou\MediaBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class balouMediaBundle extends Bundle
{
}


text:
#import "PNErrorStatus+Private.h"
#import "PNServiceData+Private.h"
#import "PNResult+Private.h"

#pragma mark - Interface implementation

@implementation PNErrorData

- (NSArray *)channels {

    return self.serviceData[@"channels"];
}

- (NSArray *)channelGroups {

    return self.serviceData[@"channelGroups"];
}

- (NSString *)information {

    return self.serviceData[@"information"];
}

- (id)data {

    return self.serviceData[@"data"];
}

#pragma mark -

@end

@implementation PNErrorStatus

#pragma mark - Information

- (id)copyWithZone:(NSZone *)zone {

    PNErrorStatus *status = [super copyWithZone:zone];
    status.associatedObject = self.associatedObject;

    return status;
}

- (PNErrorData *)errorData {

    return [PNErrorData dataWithServiceResponse:self.serviceData];
}

#pragma mark -

@end