text:
/* global
  RSVP,
  NumberLookupService,
  ContactsNumberLookupSource,
  HittaSeNumberLookupSource,
  VemRingdeSeNumberLookupSource,
  callLogs,
  unique
*/

window.Promise = RSVP.Promise;

window.addEventListener('DOMContentLoaded', function() {

  // We'll ask the browser to use strict code to help us catch errors earlier.
  // https://developer.mozilla.org/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode
  'use strict';

  var translate = navigator.mozL10n.get;

  var lock;
  if (navigator.requestWakeLock) {
    lock = navigator.requestWakeLock('cpu');
  }

  // Create the number lookup service and pass constructors for all avaliable sources
  var numberLookupService = new NumberLookupService({
    sources: [
      ContactsNumberLookupSource,
      HittaSeNumberLookupSource,
      VemRingdeSeNumberLookupSource
    ]
  });

  function start() {
    var searchTimer;
    var numberSearchView = document.querySelector('#number-search-view');
    var numberSearchField = document.querySelector('#number-search-field');
    var numberSearchError = document.querySelector('#number-search-error');
    var numberSearchQuery = document.querySelector('#number-search-query');
    var numberSearchErrorQuery = document.querySelector('#number-search-error-query');
    var numberSearchResult = document.querySelector('#number-search-result');
    var numberSearchResultList = document.querySelector('#number-search-result ul');
    var numberSearchResultListItemTemplate = numberSearchResultList.querySelector('li');
    var callLogsList = document.querySelector('#call-logs-view .content ul');
    var callLogsListItemTemplate = callLogsList.querySelector('li');
    var views = document.querySelectorAll('.view');

    function setAccordionHeight() {
      var headerHeight = document.querySelector('.view h1').scrollHeight;

      Array.prototype.forEach.call(views, function (view) {
        if (view.classList.contains('active')) {
          view.style.height = view.scrollHeight + 'px';
        } else {
          view.style.height = headerHeight + 'px';
        }
      });
    }

    function openViewByElement(element) {
      while (element.parentElement && !element.classList.contains('view')) {
        element = element.parentElement;
      }

      if (element.classList.contains('view')) {
        Array.prototype.forEach.call(views, function (view) {
          view.classList.remove('active');
        });

        element.classList.add('active');
      }

      setAccordionHeight();
    }

    Array.prototype.forEach.call(views, function (view) {
      view.querySelector('h1').addEventListener('click', function (event) {
        openViewByElement(event.target);
      });
    });

    function lookup(number, callback) {
      number = number.replace(/[\s\-]+/, '');

      numberSearchError.style.display = 'none';
      numberSearchResult.style.display = 'none';

      numberSearchQuery.textContent = number;
      numberSearchQuery.href = 'tel:' + number;

      numberLookupService.lookup(number).then(function (results) {
        if (results && results.length > 0) {
          numberSearchResultList.innerHTML = '';

          results.forEach(function (result) {
            var listItem = document.createElement('li');
            listItem.innerHTML = numberSearchResultListItemTemplate;
            var valueElements = listItem.querySelectorAll('.info, .source');
            valueElements[0].textContent = result.result;
            valueElements[1].textContent = result.source.description;
            numberSearchResultList.appendChild(listItem);
          });

          numberSearchResult.style.display = 'block';

          if (callback instanceof Function) {
            callback(results);
          }
        } else {
          numberSearchErrorQuery.textContent = number;
          numberSearchErrorQuery.href = 'tel:' + number;
          numberSearchError.style.display = 'block';
        }

        setAccordionHeight();
      });
    }

    function renderSearchResult() {
      clearTimeout(searchTimer);
      searchTimer = setTimeout(function () {
        if (numberSearchField.value) {
          lookup(numberSearchField.value);
        }
      }, 300);
    }

    function renderCallLogs() {
      var logListItem;
      var sameNumberCount = 1;
      var nextNumberCount = 1;
      var lastDate;

      callLogsList.innerHTML = '';

      callLogs.logs.reverse().forEach(function (log, index) {
        var logDateString = log.date.toLocaleDateString();
        var logDateElement;

        if (logDateString !== lastDate) {
          logDateElement = document.createElement('li');
          logDateElement.classList.add('divider-heading');
          logDateElement.textContent = logDateString;
          callLogsList.appendChild(logDateElement);
          lastDate = logDateString;
        }

        if (index > 0 && callLogs.logs[index - 1].number === log.number) {
          sameNumberCount += 1;
        } else {
          logListItem = document.createElement('li');
          callLogsList.appendChild(logListItem);

          (function (logListItem, nextNumberCount) {
            numberLookupService.lookup(log.number).then(function (responses) {
              var info = unique(responses.map(function (response) {
                return response.result;
              })).join(', ');

              logListItem.innerHTML = callLogsListItemTemplate;
              var valueElements = logListItem.querySelectorAll('.number, .info, .count, .time');

              valueElements[0].textContent = info ? info : translate('unknown_number');
              valueElements[1].textContent = log.number;
              valueElements[3].textContent = log.date.toLocaleTimeString();

              if (nextNumberCount > 1) { // Add count to previous item
                valueElements[2].textContent = ' (' + nextNumberCount + ')';
              }

            });
          } (logListItem, nextNumberCount));

          logListItem.addEventListener('click', function () {
            numberSearchField.value = log.number;
            lookup(numberSearchField.value);
            openViewByElement(numberSearchView);
          });

          callLogsList.appendChild(logListItem);

          nextNumberCount = sameNumberCount;
          sameNumberCount = 1;
        }
      });

      setAccordionHeight();
    }

    // Hide elements
    numberSearchError.style.display = 'none';
    numberSearchResult.style.display = 'none';

    // Save templates
    numberSearchResultListItemTemplate.parentNode.removeChild(numberSearchResultListItemTemplate);
    numberSearchResultListItemTemplate = numberSearchResultListItemTemplate.innerHTML;

    callLogsListItemTemplate.parentNode.removeChild(callLogsListItemTemplate);
    callLogsListItemTemplate = callLogsListItemTemplate.innerHTML;

    renderCallLogs();

    if (window.navigator.mozTelephony) {
      window.navigator.mozTelephony.addEventListener('incoming', function (event) {
        callLogs.log(event.call.number);

        renderCallLogs();

        lookup(event.call.number, function (responses) {
          var info = unique(responses.map(function (response) {
            return response.result;
          })).join(', ');

          navigator.mozNotification.createNotification(
            translate('app_title'),
            info,
            window.location.href.replace('index.html', '') + '/img/icons/icon.svg'
          ).show();
        });
      });
    }

    numberSearchField.addEventListener('keyup', renderSearchResult);
    numberSearchField.addEventListener('change', renderSearchResult);

    if (numberSearchField.value) {
      lookup(numberSearchField.value);
    }

    window.addEventListener('resize', setAccordionHeight);
    setAccordionHeight();
  }

  // We want to wait until the localisations library has loaded all the strings.
  // So we'll tell it to var us know once it's ready.
  navigator.mozL10n.once(start);
});


text:
namespace lm {

ARPAInputException::ARPAInputException(const StringPiece &message) throw() {
  *this << message;
}

ARPAInputException::ARPAInputException(const StringPiece &message, const StringPiece &line) throw() {
  *this << message << " in line " << line;
}

ARPAInputException::~ARPAInputException() throw() {}

ARPAOutputException::ARPAOutputException(const char *message, const std::string &file_name) throw() {
  *this << message << " in file " << file_name;
}

ARPAOutputException::~ARPAOutputException() throw() {}

// Seeking is the responsibility of the caller.
void WriteCounts(std::ostream &out, const std::vector<uint64_t> &number) {
  out << "\n\\data\\\n";
  for (unsigned int i = 0; i < number.size(); ++i) {
    out << "ngram " << i+1 << "=" << number[i] << '\n';
  }
  out << '\n';
}

size_t SizeNeededForCounts(const std::vector<uint64_t> &number) {
  std::ostringstream buf;
  WriteCounts(buf, number);
  return buf.tellp();
}

bool IsEntirelyWhiteSpace(const StringPiece &line) {
  for (size_t i = 0; i < static_cast<size_t>(line.size()); ++i) {
    if (!isspace(line.data()[i])) return false;
  }
  return true;
}

ARPAOutput::ARPAOutput(const char *name, size_t buffer_size) : file_name_(name), buffer_(new char[buffer_size]) {
  try {
    file_.exceptions(std::ostream::eofbit | std::ostream::failbit | std::ostream::badbit);
    if (!file_.rdbuf()->pubsetbuf(buffer_.get(), buffer_size)) {
      std::cerr << "Warning: could not enlarge buffer for " << name << std::endl;
      buffer_.reset();
    }
    file_.open(name, std::ios::out | std::ios::binary);
  } catch (const std::ios_base::failure &f) {
    throw ARPAOutputException("Opening", file_name_);
  }
}

void ARPAOutput::ReserveForCounts(std::streampos reserve) {
  try {
    for (std::streampos i = 0; i < reserve; i += std::streampos(1)) {
      file_ << '\n';
    }
  } catch (const std::ios_base::failure &f) {
    throw ARPAOutputException("Writing blanks to reserve space for counts to ", file_name_);
  }
}

void ARPAOutput::BeginLength(unsigned int length) {
  fast_counter_ = 0;
  try {
    file_ << '\\' << length << "-grams:" << '\n';
  } catch (const std::ios_base::failure &f) {
    throw ARPAOutputException("Writing n-gram header to ", file_name_);
  }
}

void ARPAOutput::EndLength(unsigned int length) {
  try {
    file_ << '\n';
  } catch (const std::ios_base::failure &f) {
    throw ARPAOutputException("Writing blank at end of count list to ", file_name_);
  }
  if (length > counts_.size()) {
    counts_.resize(length);
  }
  counts_[length - 1] = fast_counter_;
}

void ARPAOutput::Finish() {
  try {
    file_ << "\\end\\\n";
    file_.seekp(0);
    WriteCounts(file_, counts_);
    file_ << std::flush;
  } catch (const std::ios_base::failure &f) {
    throw ARPAOutputException("Finishing including writing counts at beginning to ", file_name_);
  }
}

} // namespace lm

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<operatorModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ibm.com/xmlns/prod/streams/spl/operator" xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/operator operatorModel.xsd">
  <cppOperatorModel>
    <context>
      <description></description>
      <libraryDependencies>
        <library>
          <cmn:description></cmn:description>
          <cmn:managedLibrary>
            <cmn:lib>flann</cmn:lib>
            <cmn:command>../../impl/bin/archLevel</cmn:command>
          </cmn:managedLibrary>
        </library>
      </libraryDependencies>
      <providesSingleThreadedContext>Never</providesSingleThreadedContext>
      <allowCustomLogic>true</allowCustomLogic>
    </context>
    <parameters>
      <description></description>
      <allowAny>false</allowAny>
      <parameter>
        <name>minNN</name>
        <description>Minimum number of nearest neighbors to use</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Expression</expressionMode>
        <type>uint32</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>maxNN</name>
        <description>Maximum number of nearest neighbors to use</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Expression</expressionMode>
        <type>uint32</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>step</name>
        <description sampleUri="">Step value for deciding the number of k to use</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Expression</expressionMode>
        <type>uint32</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>threads</name>
        <description sampleUri="">Number of threads to use for LOF calculation</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Expression</expressionMode>
        <type>uint32</type>
        <cardinality>1</cardinality>
      </parameter>
    </parameters>
    <inputPorts>
      <inputPortOpenSet>
        <tupleMutationAllowed>true</tupleMutationAllowed>
        <windowingMode>OptionallyWindowed</windowingMode>
        <windowPunctuationInputMode>WindowBound</windowPunctuationInputMode>
      </inputPortOpenSet>
    </inputPorts>
    <outputPorts>
      <outputPortOpenSet>
        <expressionMode>Expression</expressionMode>
        <autoAssignment>false</autoAssignment>
        <completeAssignment>false</completeAssignment>
        <rewriteAllowed>true</rewriteAllowed>
        <windowPunctuationOutputMode>Generating</windowPunctuationOutputMode>
        <windowPunctuationInputPort>-1</windowPunctuationInputPort>
        <tupleMutationAllowed>true</tupleMutationAllowed>
      </outputPortOpenSet>
    </outputPorts>
  </cppOperatorModel>
</operatorModel>


text:
// Generated by CoffeeScript 1.12.6

/*
 * Command line interface titles parser
 */

(function() {
  'use strict';
  var attach, folders, io, log, object;

  attach = require('../modular/attach');

  folders = require('../modular/folders');

  io = require('./io');

  object = require('../common/object');

  log = require('./log');

  module.exports = {
    process: function(filesHash) {
      var filePath, name, titles;
      titles = {};
      for (name in filesHash) {
        filePath = filesHash[name];
        titles[name] = this.parse(filePath);
      }
      return titles;
    },
    parse: function(filePath) {
      var file, title;
      file = io.readFile(filePath);
      title = file.match(/\/\*\s*\*\s*([^*]*?)\s*\*/);
      if (Array.isArray(title)) {
        title = title[1];
        log.info('titleExtracted', {
          title: title,
          filePath: filePath
        });
        return title;
      }
      log.info('noTitle', filePath);
      return filePath;
    },
    get: function(config) {
      var filesHash, moduleTitles, name, title, titles;
      filesHash = folders.initCodeModules(config);
      filesHash = attach.outside(filesHash, config);
      io.save({
        modulePaths: filesHash
      }, true);
      titles = this.process(filesHash);
      moduleTitles = {};
      for (name in titles) {
        title = titles[name];
        moduleTitles = object.insertKey(moduleTitles, name, title);
      }
      return moduleTitles;
    }
  };

}).call(this);


text:
describe("KoansRunner", function() {
  var env;
  var reporter;
  var body;
  var fakeDocument;

  beforeEach(function() {
    env = new jasmine.Env();
    env.updateInterval = 0;

    body = document.createElement("body");
    fakeDocument = { body: body, location: { search: "" } };
    reporter = new JsKoansReporter(fakeDocument);
  });

  function fakeSpec(name) {
    return {
      getFullName: function() {
        return name;
      }
    };
  }

  function fakeSuite(desc) {
    return {
      parentSuite: null,
      description: desc
    };
  }

  function findElements(divs, withClass) {
    var els = [];
    for (var i = 0; i < divs.length; i++) {
      if (divs[i].className == withClass) els.push(divs[i]);
    }
    return els;
  }

  function findElement(divs, withClass) {
    var els = findElements(divs, withClass);
    if (els.length > 0) return els[0];
    throw new Error("couldn't find div with class " + withClass);
  }

  it("should run only specs beginning with spec parameter", function() {
    fakeDocument.location.search = "?spec=run%20this";
    expect(reporter.specFilter(fakeSpec("run this"))).toBeTruthy();
    expect(reporter.specFilter(fakeSpec("not the right spec"))).toBeFalsy();
    expect(reporter.specFilter(fakeSpec("not run this"))).toBeFalsy();
  });

  it("should display empty divs for every suite when the runner is starting", function() {
    reporter.reportRunnerStarting({
      env: env,
      suites: function() {
        return [ new jasmine.Suite({}, "suite 1", null, null) ];
      }
    });

    var divs = findElements(body.getElementsByTagName("div"), "suite");
    expect(divs.length).toEqual(1);
    expect(divs[0].innerHTML).toContain("suite 1");
  });

  describe('Matcher reporting', function () {
    var getErrorMessageDiv = function (body) {
      var divs = body.getElementsByTagName("div");
      for (var i = 0; i < divs.length; i++) {
        if (divs[i].className.match(/errorMessage/)) {
          return divs[i];
        }
      }
    };

    var runner, spec, fakeTimer;
    beforeEach(function () {
      fakeTimer = new jasmine.FakeTimer();
      env.setTimeout = fakeTimer.setTimeout;
      env.clearTimeout = fakeTimer.clearTimeout;
      env.setInterval = fakeTimer.setInterval;
      env.clearInterval = fakeTimer.clearInterval;
      runner = env.currentRunner();
      var suite = new jasmine.Suite(env, 'some suite');
      runner.add(suite);
      spec = new jasmine.Spec(env, suite, 'some spec');
      suite.add(spec);
      fakeDocument.location.search = "?";
      env.addReporter(reporter);
    });

    describe('toContain', function () {
      it('should show actual and expected', function () {
        spec.runs(function () {
          this.expect('foo').toContain('bar');
        });
        runner.execute();
        fakeTimer.tick(0);

        var resultEl = getErrorMessageDiv(body);
        expect(resultEl.innerHTML).toMatch(/foo/);
        expect(resultEl.innerHTML).toMatch(/bar/);
      });
    });
  });

  describe("failure messages (integration)", function () {
    var spec, results, expectationResult;

    beforeEach(function() {
      results = {
        passed: function() {
          return false;
        },
        getItems: function() {
        }};

      var suite1 = new jasmine.Suite(env, "suite 1", null, null);

      spec = {
        suite: suite1,
        getFullName: function() {
          return "foo";
        },
        results: function() {
          return results;
        }
      };

      reporter.reportRunnerStarting({
        env: env,
        suites: function() {
          return [ suite1 ];
        }
      });
    });

    it("should add the failure message to the DOM (non-toEquals matchers)", function() {
      expectationResult = new jasmine.ExpectationResult({
        matcherName: "toBeNull", passed: false, message: "Expected 'a' to be null, but it was not"
      });

      spyOn(results, 'getItems').andReturn([expectationResult]);

      reporter.reportSpecResults(spec);

      var divs = body.getElementsByTagName("div");
      var errorDiv = findElement(divs, 'errorMessage');
      expect(errorDiv.innerHTML).toEqual("Expected 'a' to be null, but it was not");
    });

    it("should add the failure message to the DOM (non-toEquals matchers) html escaping", function() {
      expectationResult = new jasmine.ExpectationResult({
        matcherName: "toBeNull", passed: false, message: "Expected '1 < 2' to <b>e null, & it was not"
      });

      spyOn(results, 'getItems').andReturn([expectationResult]);

      reporter.reportSpecResults(spec);

      var divs = body.getElementsByTagName("div");
      var errorDiv = findElement(divs, 'errorMessage');
      expect(errorDiv.innerHTML).toEqual("Expected '1 < 2' to <b>e null, & it was not");
    });
  });

  describe("duplicate example names", function() {
    it("should report failures correctly", function() {
      var suite1 = env.describe("suite", function() {
        env.it("will have log messages", function() {
          this.log("this one passes!");
          this.expect(true).toBeTruthy();
        });
      });

      var suite2 = env.describe("suite", function() {
        env.it("will have log messages", function() {
          this.log("this one fails!");
          this.expect(true).toBeFalsy();
        });
      });

      env.addReporter(reporter);
      env.execute();

      var divs = body.getElementsByTagName("div");
      var failedSpecDiv = findElement(divs, 'suite failed');
      expect(failedSpecDiv.className).toEqual('suite failed');
      expect(failedSpecDiv.innerHTML).toContain("damaging your karma");
      expect(failedSpecDiv.innerHTML).not.toContain("has expanded your awareness");

      var passedSpecDiv = findElement(divs, 'suite passed');
      expect(passedSpecDiv.className).toEqual('suite passed');
      expect(passedSpecDiv.innerHTML).toContain("has expanded your awareness");
      expect(passedSpecDiv.innerHTML).not.toContain("damaging your karma");
    });
  });

  describe('#reportSpecStarting', function() {
    var spec1;
    beforeEach(function () {
      env.describe("suite 1", function() {
        spec1 = env.it("spec 1", function() {
        });
      });
    });

    it('should not log running specs by default', function() {
      spyOn(reporter, 'log');

      reporter.reportSpecStarting(spec1);

      expect(reporter.log).not.toHaveBeenCalled();
    });
  });

  describe('showing progress', function() {
    beforeEach(function() {
      env.describe("suite 1", function() {
        env.it("spec A");
        env.it("spec B");
      });
      env.describe("suite 2", function() {
        env.it("spec C");
      });
    });

    describe('subjects', function() {
      describe("with no failures", function() {
        beforeEach(function() {
          env.addReporter(reporter);
          env.execute();
        });

        it("should have 2 subjects", function() {
          expect(reporter.noOfSubjects).toBe(2);
        });

        it("should not have any failed subjects", function() {
          expect(reporter.failedSubjects).toBe(0);
        });
      });

      describe("with 1 failure", function() {
        beforeEach(function() {
          env.describe("suite with error", function() {
            env.it("spec X", function() {
              expect(true).toBeFalsey();
            });
            env.it("spec Y", function() {
              expect(true).toBeFalsey();
            });
          });

          env.addReporter(reporter);
          env.execute();
        });

        it("should have 3 subjects", function() {
          expect(reporter.noOfSubjects).toBe(3);
        });

        it("should have a failure", function() {
          expect(reporter.failedSubjects).toBe(1);
        });
      });

      describe("with 2 failures", function() {
        beforeEach(function() {
          env.describe("suite with error", function() {
            env.it("spec X", function() {
              expect(true).toBeFalsey();
            });
          });
          env.describe("suite with error too", function() {
            env.it("spec Y", function() {
              expect(true).toBeFalsey();
            });
          });

          env.addReporter(reporter);
          env.execute();
        });

        it("should have 4 subjects", function() {
          expect(reporter.noOfSubjects).toBe(4);
        });

        it("should have 2 failures", function() {
          expect(reporter.failedSubjects).toBe(2);
        });
      });

      describe("with embedded suites only outer suites count as subjects", function() {
        beforeEach(function() {
          env.describe("outer suite", function() {
            env.it("spec for outer suite", function() {
              expect(true).toBeFalsey();
            });

            env.describe("inner suite", function() {
              env.it("spec for inner suite", function() {
                expect(true).toBeFalsey();
              });
            });
          });

          env.addReporter(reporter);
          env.execute();
        });

        it("should have 3 suites", function() {
          expect(reporter.noOfSubjects).toBe(3);
        });

        it("should have 1 failure", function() {
          expect(reporter.failedSubjects).toBe(1);
        });

      });
    });
  });

  describe("presentation", function() {
    describe("showing the suite description", function() {
      it("should prefix outer suite descriptions with 'Thinking'", function() {
        suite = fakeSuite("About Pies");
        description = reporter.getSuiteDescription(suite);

        expect(description).toEqual("Thinking About Pies");
      });

      it("should prefix inner suite descriptions with 'Thinking'", function() {
        suite = fakeSuite("cherries");
        suite.parentSuite = "Something";
        description = reporter.getSuiteDescription(suite);

        expect(description).toEqual("Considering cherries");
      });
    });
  });
});


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.taskit.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <feature name="Whitelist">
        <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
        <param name="onload" value="true" />
    </feature>
    <feature name="SplashScreen">
        <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
        <param name="onload" value="true" />
    </feature>
    <allow-intent href="market:*" />
    <name>Task It</name>
    <description>
        A simple task management app using Kinvey mBaaS.
    </description>
    <author email="rajiv.ram@gquotient.com" href="=">
        GQuotient
    </author>
    <content src="index.html" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="17" />
    <preference name="android-installLocation" value="auto" />
    <preference name="SplashScreen" value="res/xml/splash.png" />
    <preference name="SplashScreenDelay" value="10000" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
</widget>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Resource.Animation
   | Sensus Documentation </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Resource.Animation
   | Sensus Documentation ">
    <meta name="generator" content="docfx 2.31.0.0">

    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

    <meta property="docfx:rel" content="../">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Class Resource.Animation

Inheritance

System.Object

Resource.Animation

Namespace: Sensus.Android

Assembly: SensusAndroid.dll

Syntax

public class Animation : Object

Fields

abc_fade_in

Declaration

public const int abc_fade_in = 2130968576

Field Value

        Type
        Description

        System.Int32

abc_fade_out

Declaration

public const int abc_fade_out = 2130968577

Field Value

        Type
        Description

        System.Int32

abc_grow_fade_in_from_bottom

Declaration

public const int abc_grow_fade_in_from_bottom = 2130968578

Field Value

        Type
        Description

        System.Int32

abc_popup_enter

Declaration

public const int abc_popup_enter = 2130968579

Field Value

        Type
        Description

        System.Int32

abc_popup_exit

Declaration

public const int abc_popup_exit = 2130968580

Field Value

        Type
        Description

        System.Int32

abc_shrink_fade_out_from_bottom

Declaration

public const int abc_shrink_fade_out_from_bottom = 2130968581

Field Value

        Type
        Description

        System.Int32

abc_slide_in_bottom

Declaration

public const int abc_slide_in_bottom = 2130968582

Field Value

        Type
        Description

        System.Int32

abc_slide_in_top

Declaration

public const int abc_slide_in_top = 2130968583

Field Value

        Type
        Description

        System.Int32

abc_slide_out_bottom

Declaration

public const int abc_slide_out_bottom = 2130968584

Field Value

        Type
        Description

        System.Int32

abc_slide_out_top

Declaration

public const int abc_slide_out_top = 2130968585

Field Value

        Type
        Description

        System.Int32

design_bottom_sheet_slide_in

Declaration

public const int design_bottom_sheet_slide_in = 2130968586

Field Value

        Type
        Description

        System.Int32

design_bottom_sheet_slide_out

Declaration

public const int design_bottom_sheet_slide_out = 2130968587

Field Value

        Type
        Description

        System.Int32

design_snackbar_in

Declaration

public const int design_snackbar_in = 2130968588

Field Value

        Type
        Description

        System.Int32

design_snackbar_out

Declaration

public const int design_snackbar_out = 2130968589

Field Value

        Type
        Description

        System.Int32

fadein

Declaration

public const int fadein = 2130968590

Field Value

        Type
        Description

        System.Int32

fadeout

Declaration

public const int fadeout = 2130968591

Field Value

        Type
        Description

        System.Int32

scale_in

Declaration

public const int scale_in = 2130968592

Field Value

        Type
        Description

        System.Int32

scale_out

Declaration

public const int scale_out = 2130968593

Field Value

        Type
        Description

        System.Int32

tooltip_enter

Declaration

public const int tooltip_enter = 2130968594

Field Value

        Type
        Description

        System.Int32

tooltip_exit

Declaration

public const int tooltip_exit = 2130968595

Field Value

        Type
        Description

        System.Int32

              Back to top

            Copyright © 2014-2018 University of Virginia
Generated by DocFX


text:
"""
Queue is a ring-based array/queue. It needs:
* Enqueue(Message) (or, call it PutMessage or PutEvent or whatever)
** Place item in list
** Advance tail, i.e. tail = (tail + 1) % length
* Dequeue() (or, call it GetEvent or GetMessages or whatever)
** Return item at head
** head = (head + 1) % length
* Clear()
** Set head = tail
* RegisterListener(listener)
* RegisteredListeners()
** Return a reference to the queue data member
* _queue = list
* _registeredListeners = list
* _head = int
* _tail = int
"""

import collections

class MessageQueue:
    def __init__(self):
        self._queue = []
        self._registeredListeners = collections.defaultdict(list) # A list of dict objects. The dict objects contain the Listener Name (for lookups) and a reference to the listener instance
        self._head = 0
        self._tail = 0
        self._empty = True

    def Enqueue(self, msg_obj):
        """ Enqueue a message object

            Message objects contain a topic and a payload. Still trying to work out exactly how to design message objects. In Python, they can be a dict
        """
        if self._empty:
            self._empty = False
        else:
            self._tail = (self._tail + 1) % len(self._queue)
            assert (self._tail != self._head) # If tail == head, that means we've enqueued too many messages and we're wrapping around
        self._queue[self._tail] = msg_obj
        #print "DEBUG Enqueued message: {}".format(msg_obj)

    def Dequeue(self):
        if self._empty:
            return None

        else:
            return_obj = self._queue[self._head]

            if self._head == self._tail and not self._empty:
                self._empty = True
            else:
                self._head = (self._head + 1) % len(self._queue)

            #print "DEBUG Dequeued message: {}".format(return_obj)
            return return_obj

    def RegisterListener(self, listener_name, listener, topic):
        """Register a message listener with the MessageQueue

           NOTE: This function does not test for containment before adding/replacing items.
        """
        #print "DEBUG Registering Listener: {} {} topic={}".format(listener_name, listener, topic)
        self._registeredListeners[topic].append( { 'name': listener_name, 'ref': listener} )

    def RegisteredListeners(self, topic):
        return self._registeredListeners[topic]

    def Clear(self):
        self._head = 0
        self._tail = 0
        del self._queue[:]
        self._empty = True

    def Initialize(self, num_slots):
        """Allocate space for the message queue

           NOTE: This function should only ever be run once. The class is not designed for re-allocating memory at runtime
        """
        assert(len(self._queue) == 0)

        for i in range(0, num_slots):
            self._queue.append(None)
            pass


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.cyc.session.spi.SessionConfigurationLoader (Core Client Implementation 1.1.1 API)</title>
<meta name="date" content="2018-01-24">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Cyc Core Client Implementation

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.cyc.session.spi.SessionConfigurationLoader

Packages that use SessionConfigurationLoader

Package
Description

com.cyc.session.internal

Internal implementation classes for common Session API functionality.

com.cyc.session.services

Uses of SessionConfigurationLoader in com.cyc.session.internal

Methods in com.cyc.session.internal that return types with arguments of type SessionConfigurationLoader

Modifier and Type
Method and Description

protected Map<String,SessionConfigurationLoader>
ConfigurationLoaderManager.getConfigurationLoaders()

Methods in com.cyc.session.internal with parameters of type SessionConfigurationLoader

Modifier and Type
Method and Description

com.cyc.session.CycSessionConfiguration
ConfigurationLoaderManager.loadConfiguration(SessionConfigurationLoader loader,
                 EnvironmentConfiguration environment)

Uses of SessionConfigurationLoader in com.cyc.session.services

Classes in com.cyc.session.services that implement SessionConfigurationLoader

Modifier and Type
Class and Description

class
AbstractConfigurationLoader

Abstract implementation of SessionConfigurationLoader.

class
EnvironmentConfigurationLoader

A SessionConfigurationLoader devoted specifically to providing EnvironmentConfigurations
 from System properties.

class
PropertiesConfigurationLoader

A Properties file-based SessionConfigurationLoader loader.

class
SimpleInteractiveLoader

An interactive SessionConfigurationLoader which prompts the user for a CycServer address with
 the CycServerPanel.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Cyc Core Client Implementation

Prev

Next

Frames

No Frames

All Classes

Copyright © 2013–2018 Cycorp, Inc. All rights reserved.


text:
'use strict';

const calendar = require('./calendar');
const dateNotation = require('./date-notation');
const beforeAfter = require('./before-after');
const month = require('./month');
const jpRelativeDates = require('./japanese-relative-dates');
const week = require('./week');

const replacer = [calendar, dateNotation, beforeAfter, month, week, jpRelativeDates];

exports.replacer = replacer;


text:
<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "typecourse".
 *
 * @property integer $id
 * @property string $name
 * @property integer $created_at
 * @property integer $updated_at
 *
 * @property Course[] $courses
 * @property WebCourse[] $webCourses
 */
class Typecourse extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */

    public function behaviors()
    {
        return [
          TimestampBehavior::className(),
        ];
    }

    public static function tableName()
    {
        return 'typecourse';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['created_at', 'updated_at'], 'integer'],
            [['name'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'รหัสประเภทคอร์ส',
            'name' => 'ชื่อประเภทคอร์ส',
            'created_at' => 'วันที่สร้าง',
            'updated_at' => 'วันที่แก้ไข',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCourses()
    {
        return $this->hasMany(Course::className(), ['typecourse_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getWebCourses()
    {
        return $this->hasMany(WebCourse::className(), ['typecourse_id' => 'id']);
    }
}


text:
/**
 * Test hooks
 */

import expect from 'expect'
import configureStore from 'store.js'
import { memoryHistory } from 'react-router'
import { put } from 'redux-saga/effects'
import { fromJS } from 'immutable'

import {
  injectAsyncReducer,
  injectAsyncSagas,
  getHooks,
} from 'utils/hooks'

// Fixtures

const initialState = fromJS({ reduced: 'soon' })

const reducer = (state = initialState, action) => {
  switch (action.type) {
    case 'TEST':
      return state.set('reduced', action.payload)
    default:
      return state
  }
}

const sagas = [
  function* testSaga() {
    yield put({ type: 'TEST', payload: 'yup' })
  },
]

describe('hooks', () => {
  let store

  describe('getHooks', () => {
    before(() => {
      store = configureStore({}, memoryHistory)
    })

    it('given a store, should return all hooks', () => {
      const { injectReducer, injectSagas } = getHooks(store)

      injectReducer('test', reducer)
      injectSagas(sagas)

      const actual = store.getState().get('test')
      const expected = initialState.merge({ reduced: 'yup' })

      expect(actual.toJS()).toEqual(expected.toJS())
    })
  })

  describe('helpers', () => {
    before(() => {
      store = configureStore({}, memoryHistory)
    })

    describe('injectAsyncReducer', () => {
      it('given a store, it should provide a function to inject a reducer', () => {
        const injectReducer = injectAsyncReducer(store)

        injectReducer('test', reducer)

        const actual = store.getState().get('test')
        const expected = initialState

        expect(actual.toJS()).toEqual(expected.toJS())
      })
    })

    describe('injectAsyncSagas', () => {
      it('given a store, it should provide a function to inject a saga', () => {
        const injectSagas = injectAsyncSagas(store)

        injectSagas(sagas)

        const actual = store.getState().get('test')
        const expected = initialState.merge({ reduced: 'yup' })

        expect(actual.toJS()).toEqual(expected.toJS())
      })
    })
  })
})


text:
package vos;

import org.codehaus.jackson.annotate.*;

/**
 * clase que representa un restaurante
 * @author angeloMarcetty
 *
 */
public class Restaurante {

	//// Atributos

	@JsonProperty(value="id")
	private Long id;

	@JsonProperty(value="nombre")
	private String nombre;

	@JsonProperty(value="cuentaBancaria")
	private Long cuentaBancaria;

	@JsonProperty(value="personalizable")
	private Boolean personalizable;

	@JsonProperty(value="descripcion")
	private String descripcion;

	@JsonProperty(value="tipo")
	private String tipo;

	@JsonProperty(value="paginaWeb")
	private String paginaWeb;

	@JsonProperty(value="representante")
	private String representante;

	public Restaurante(@JsonProperty(value="id")Long id, @JsonProperty(value="nombre")String nombre,@JsonProperty(value="cuentaBancaria")Long cuentaBancaria,
			@JsonProperty(value="personalizable")Boolean personalizable,@JsonProperty(value="descripcion")String descripcion,@JsonProperty(value="tipo")String tipo,
			@JsonProperty(value="paginaWeb")String paginaWeb,@JsonProperty(value="representante")String representante ){

		super();
		this.id = id;
		this.nombre = nombre;
		this.cuentaBancaria = cuentaBancaria;
		this.personalizable = personalizable;
		this.descripcion = descripcion;
		this.tipo = tipo;
		this.paginaWeb = paginaWeb;
		this.representante = representante;

	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public String getNombre() {
		return nombre;
	}
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public Long getCuentaBancaria() {
		return cuentaBancaria;
	}
	public void setCuentaBancaria(Long cuentaBancaria) {
		this.cuentaBancaria = cuentaBancaria;
	}

	public Boolean getPersonalizable() {
		return personalizable;
	}
	public void setPersonalizable(Boolean personalizable) {
		this.personalizable = personalizable;
	}

	public String getDescripcion() {
		return descripcion;
	}
	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public String getTipo() {
		return tipo;
	}
	public void setTipo(String tipo) {
		this.tipo = tipo;
	}

	public String getPaginaWeb() {
		return paginaWeb;
	}
	public void setPaginaWeb(String paginaWeb) {
		this.paginaWeb = paginaWeb;
	}

	public String getRepresentante() {
		return representante;
	}

	public void setRepresentante(String representante) {
		this.representante = representante;
	}

}


text:
package com.tle.core.xstream.mapping;

import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.tle.core.xstream.XMLDataConverter;
import com.tle.core.xstream.XMLDataMappings;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

/** */
public class MapMapping extends AbstractTypeMapping {
  private String keyPath;
  private String valuePath;
  private XMLDataConverter converter;

  public MapMapping(String name, String node, String keyPath, String valuePath) {
    this(name, node, null, keyPath, valuePath);
  }

  public MapMapping(String name, String node, Class<?> type, String keyPath, String valuePath) {
    super(name, node, type);
    converter = new XMLDataConverter();
    this.valuePath = valuePath;
    this.keyPath = keyPath;
  }

  // Presumably the intent is to return the implementation class, so we
  // ignore Sonar's "loose coupling" warning
  @Override
  public Class<?> getDefaultType() {
    return HashMap.class; // NOSONAR
  }

  @Override
  public Class<?> getRequiredType() {
    return Map.class;
  }

  @SuppressWarnings("nls")
  @Override
  public void unmarshal(
      HierarchicalStreamReader reader, UnmarshallingContext context, Object object) {
    Map<Object, Object> map = getInstantiatedMap(object);
    MapHolder holder = new MapHolder(map);
    XMLDataMappings mappings = createDataMappings(holder);
    converter.recurseUnmarshal(object, reader, context, "", mappings);
  }

  @Override
  public void marshal(HierarchicalStreamWriter writer, MarshallingContext context, Object object) {
    Map<?, ?> map = getMap(object);
    if (map != null) {
      for (Entry<?, ?> entry : map.entrySet()) {
        MapKeyValue kv = new MapKeyValue(entry.getKey(), entry.getValue());
        marshallValue(writer, context, kv);
      }
    }
  }

  protected void marshallValue(
      HierarchicalStreamWriter writer, MarshallingContext context, Object value) {
    XMLDataMappings mappings = createDataMappings(null);

    MapKeyValue kv = (MapKeyValue) value;

    converter.marshal(kv, mappings, writer, context);
  }

  protected AbstractMapping createMapNodeMapping(String path, MapHolder holder, boolean isKey) {
    return new MapNodeMapping(path, holder, isKey);
  }

  protected XMLDataMappings createDataMappings(MapHolder holder) {
    XMLDataMappings mappings = new XMLDataMappings();

    AbstractMapping valueMap = createMapNodeMapping(valuePath, holder, false);
    AbstractMapping keyMap = createMapNodeMapping(keyPath, holder, true);
    mappings.addNodeMapping(keyMap);
    mappings.addNodeMapping(valueMap);
    return mappings;
  }

  protected static class MapHolder {
    int count = 0;
    Map<Object, Object> map;
    MapKeyValue kv;

    public MapHolder(Map<Object, Object> map) {
      this.map = map;
      this.kv = new MapKeyValue();
    }

    public void add(Object value, boolean key) {
      if (key) {
        kv.key = value;
      } else {
        kv.value = value;
      }
      count++;
      if (count == 2) {
        count = 0;
        map.put(kv.key, kv.value);
      }
    }
  }

  private static class MapNodeMapping extends NodeMapping {
    private boolean key;
    private final MapHolder holder;

    @SuppressWarnings("nls")
    public MapNodeMapping(String node, MapHolder holder, boolean key) {
      super("", node);
      this.holder = holder;
      this.key = key;
    }

    @Override
    public void unmarshal(
        HierarchicalStreamReader reader, UnmarshallingContext context, Object object) {
      Object value = getUnmarshalledValue(object, reader, context);
      holder.add(value, key);
    }

    @Override
    protected Object getMarshalledValue(Object object) {
      return ((MapKeyValue) object).getValue(key);
    }
  }

  protected static class MapKeyValue {
    Object key;
    Object value;

    public MapKeyValue(Object key, Object value) {
      this.key = key;
      this.value = value;
    }

    public MapKeyValue() {
      // EMPTY
    }

    public Object getValue(boolean isKey) {
      return isKey ? key : value;
    }
  }

  private Map<?, ?> getMap(Object object) {
    return (Map<?, ?>) getField(object);
  }

  @SuppressWarnings("unchecked")
  private Map<Object, Object> getInstantiatedMap(Object object) {
    return (Map<Object, Object>) getInstantiatedField(object);
  }

  @Override
  public boolean hasValue(Object object) {
    Map<?, ?> map = getMap(object);
    return map != null && map.size() > 0;
  }
}


text:
#import "../AmazonServiceRequestConfig.h"

/**
 * Execute Policy Request
 */

@interface AutoScalingExecutePolicyRequest:AmazonServiceRequestConfig

{
    NSString *autoScalingGroupName;
    NSString *policyName;
    bool     honorCooldown;
    bool     honorCooldownIsSet;
}

/**
 * Default constructor for a new  object.  Callers should use the
 * property methods to initialize this object after creating it.
 */
-(id)init;

/**
 * The name or ARN of the Auto Scaling group.
 *

 * Constraints:

 * Length: 1 - 1600

 * Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 */
@property (nonatomic, retain) NSString *autoScalingGroupName;

/**
 * The name or PolicyARN of the policy you want to run.
 *

 * Constraints:

 * Length: 1 - 1600

 * Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 */
@property (nonatomic, retain) NSString *policyName;

/**
 * Set to True if you want Auto Scaling to reject this
 * request when the Auto Scaling group is in cooldown.
 */
@property (nonatomic) bool           honorCooldown;

@property (nonatomic, readonly) bool honorCooldownIsSet;

/**
 * Returns a string representation of this object; useful for testing and
 * debugging.
 *
 * @return A string representation of this object.
 */
-(NSString *)description;

@end


text:
'use strict';

var React = require('react');
var classNames = require('classnames');
var ClassNameMixin = require('./mixins/ClassNameMixin');
var Button = require('./Button');
var Col = require('./Col');

var ListNews = React.createClass({
  mixins: [ClassNameMixin],

  propTypes: {
    classPrefix: React.PropTypes.string,
    theme: React.PropTypes.oneOf(['default']),
    data: React.PropTypes.object,
    header: React.PropTypes.node,
    footer: React.PropTypes.node,
    morePosition: React.PropTypes.oneOf(['top', 'bottom']),
    moreText: React.PropTypes.string,
    thumbPosition: React.PropTypes.oneOf(['top', 'left', 'right', 'bottom-left',
      'bottom-right'])
  },

  getDefaultProps: function() {
    return {
      classPrefix: 'list-news',
      theme: 'default',
      moreText: '更多 \u00BB'
    };
  },

  renderHeader: function() {
    var data = this.props.data;

    return data && data.header && data.header.title ? (

        {data.header.link ? (

{data.header.title}

            {this.props.morePosition === 'top' ? (

              {this.props.moreText}

            ) : null}

        ) : (
{data.header.title}
)}

    ) : null;
  },

  // `more` on bottom
  renderFooter: function() {
    return this.props.morePosition === 'bottom' &&
    this.props.data.header.link ? (

        <Button
          className={this.prefixClass('more')}
          href={this.props.data.header.link}>
          {this.props.moreText}
        </Button>

    ) : null;
  },

  getListItemClasses: function(item) {
    return classNames(
      this.setClassNamespace('g'),
      item.date ? this.setClassNamespace('list-item-dated') : false,
      item.desc ? this.setClassNamespace('list-item-desced') : false,
      item.img ? this.setClassNamespace('list-item-thumbed') : false,
      this.props.thumbPosition ? this.setClassNamespace('list-item-thumb-' +
        this.props.thumbPosition) : false
    );
  },

  renderBody: function(children) {
    return (

          {children}

    );
  },

  renderList: function() {
    var position = this.props.thumbPosition;
    var orderChildren = function(item, i) {
      var thumb = this.renderItemThumb(item, i);
      var main = this.renderItemMain(item, i);

      return (position === 'right' || position === 'bottom-right') ?
        [main, thumb] : [thumb, main];
    }.bind(this);

    return (this.props.data.main.map(function(item, i) {
      return (

          {position === 'bottom-left' || position === 'bottom-right' ?
            this.renderThumbItemTitle(item) : null}

          {orderChildren(item, i)}

      );
    }.bind(this)));
  },

  renderItemMisc: function(item, type) {
    var Tag = type === 'date' ? 'span' : 'div';
    var className;

    switch (type) {
      case 'date':
        className = 'list-date';
        break;
      case 'desc':
        className = 'list-item-text';
        break;
      case 'mainAddition':
        className = 'list-news-addon';
        break;
      case 'thumbAddition':
        className = 'list-thumb-addon';
    }

    return item[type] ? (
      <Tag className={this.setClassNamespace(className)}>
        {item[type]}
      </Tag>
    ) : null;
  },

  renderItemThumb: function(item, i) {
    var cols = this.props.thumbPosition === 'top' ? 12 : 4;

    return item.img ? (<Col
      key={'thumb' + i}
      sm={cols}
      className={this.setClassNamespace('list-thumb')}>

      {this.renderItemMisc(item, 'thumbAddition')}
    </Col>) : null;
  },

  renderItemMain: function(item, i) {
    var position = this.props.thumbPosition;
    var date = this.renderItemMisc(item, 'date');
    var desc = this.renderItemMisc(item, 'desc');
    var addon = this.renderItemMisc(item, 'mainAddition');
    // title of list without thumbnail
    var itemWithoutThumbTitle = !position && item.title ? (

        {item.title}

    ) : null;
    var cols = position === 'top' ? 12 : item.img ? 8 : 12;

    return position ? (
      <Col
        sm={cols}
        className={this.setClassNamespace('list-main')}
        key={'itemMain' + i}>
        {position !== 'bottom-left' && position !== 'bottom-right' ?
          this.renderThumbItemTitle(item) : null}
        {date}
        {desc}
        {addon}
      </Col>
    ) : [itemWithoutThumbTitle, date, desc, addon];
  },

  renderThumbItemTitle: function(item) {
    return item.title ? (

          {item.title}

    ) : null;
  },

  render: function() {
    var classSet = this.getClassSet();

    return (

        {this.props.header || this.renderHeader()}
        {this.renderBody(
            this.renderList()
        )}
        {this.props.footer || this.renderFooter()}

    );
  }
});

module.exports = ListNews;


text:
#ifndef BERRYABSTRACTHANDLEOBJECTEVENT_H_
#define BERRYABSTRACTHANDLEOBJECTEVENT_H_

#include "berryAbstractBitSetEvent.h"

namespace berry {

/**
 *

 * An event fired from a NamedHandleObject. This provides
 * notification of changes to the defined state, the name and the description.
 *

 *
 * @since 3.2
 */
class BERRY_COMMANDS AbstractHandleObjectEvent : public AbstractBitSetEvent
{

public:
  berryObjectMacro(AbstractHandleObjectEvent);

  /**
   * Returns whether or not the defined property changed.
   *
   * @return true, iff the defined property changed.
   */
  bool IsDefinedChanged() const;

protected:

  /**
   * The bit used to represent whether the category has changed its defined
   * state.
   */
  static int CHANGED_DEFINED(); // = 1;

  /**
   * The last used bit so that subclasses can add more properties.
   */
  static int LAST_BIT_USED_ABSTRACT_HANDLE(); // = CHANGED_DEFINED;

  /**
   * Constructs a new instance of AbstractHandleObjectEvent.
   *
   * @param definedChanged
   *            true, iff the defined property changed.
   */
  AbstractHandleObjectEvent(bool definedChanged);

};

}

#endif /* BERRYABSTRACTHANDLEOBJECTEVENT_H_ */


text:
- [Using Sentry Social]({url}/usage)
- [Extending Sentry Social]({url}/extending)


text:
'use strict';

/**
 * @ngdoc function
 * @name ng311.states:Account
 * @description billing workflows configurations
 */
angular
  .module('ng311')
  .config(function ($stateProvider) {

    $stateProvider
      .state('account', {
        abstract: true,
        parent: 'app.create_servicerequests',
        url: '',
        onEnter: ['$uibModal', '$state', function ($uibModal, $state) {
          $uibModal.open({
            animation: true,
            ariaLabelledBy: 'modal-title',
            ariaDescribedBy: 'modal-body',
            templateUrl: 'views/account/index.html',
            size: 'lg'
          }).result.finally(function () {
            $state.go('app.create_servicerequests');
          });
        }],
      })
      .state('account.details', {
        views: {
          "account@": {
            templateUrl: 'views/account/_partials/account_details.html',
            controller: 'AccountIndexCtrl'
          }
        }
      })
      .state('account.accessors', {
        views: {
          "account@": {
            templateUrl: 'views/account/_partials/accessors_list.html',
            controller: 'AccountAccessorsIndexCtrl'
          }
        }
      })
      .state('account.create', {
        params: {
          accessor: null
        },
        views: {
          "account@": {
            templateUrl: 'views/account/_partials/create.html',
            controller: 'AccountAccessorsCreateCtrl'
          }
        }
      });
  });


text:
Before Running test, please create localDb DapperBulkTest
the connection string as : Server=(localdb)\\mssqllocaldb;Database=DapperBulkTest;Trusted_Connection=True;MultipleActiveResultSets=true;


text:
set -eu

GO117BIN="go1.17.9"

command -v $GO117BIN >/dev/null 2>&1 || {
  go install golang.org/dl/$GO117BIN@latest
  $GO117BIN download
}

find ./internal/lsp/testdata -name *.golden ! -name summary*.txt.golden -delete
# Here we intentionally do not run the ./internal/lsp/source tests with
# -golden. Eventually these tests will be deleted, and in the meantime they are
# redundant with the ./internal/lsp tests.
#
# Note: go1.17.9 tests must be run *before* go tests, as by convention the
# golden output should match the output of gopls built with the most recent
# version of Go. If output differs at 1.17, tests must be tolerant of the 1.17
# output.
$GO117BIN test ./internal/lsp -golden
go test ./internal/lsp -golden
$GO117BIN test ./test  -golden
go test ./test  -golden


text:
BOOTSTRAP = ./docs/assets/css/bootstrap.css
BOOTSTRAP_LESS = ./less/bootstrap.less
BOOTSTRAP_RESPONSIVE = ./docs/assets/css/bootstrap-responsive.css
BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less
LESS_COMPRESSOR ?= `which lessc`
WATCHR ?= `which watchr`

#
# BUILD DOCS
#

docs: bootstrap
	rm docs/assets/bootstrap.zip
	zip -r docs/assets/bootstrap.zip bootstrap
	rm -r bootstrap
	lessc ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
	lessc ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
	node docs/build
	cp img" > bootstrap/js/copyright.js
	cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
	rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js

#
# MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O  )
#

gh-pages: docs
	rm -f ../bootstrap-gh-pages/assets/bootstrap.zip
	node docs/build production
	cp -r docs/* ../bootstrap-gh-pages

#
# WATCH LESS FILES
#

watch:
	echo "Watching less files..."; \
	watchr -e "watch('less/.*\.less') { system 'make' }"

.PHONY: docs watch gh-pages


text:
cmapi.channel["map.overlay.update"] = {
    schema: {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "map.overlay.update",
        "description": "Update an existing overlay.",
        "properties": {
            "name": {
                "description": "The new name of the overlay. Note that overlay names do not have to be unique and are intended for display purposes only.",
                "type": "string",
				"default": "N/A"
            },
            "overlayId": {
                "description": "The unique ID of the overlay being updated. If no overlayId is included, default overlay with ID equal to sending widget's ID is assumed. If an overlay with the given ID already exists, this message will update that overlay. If an overlay with the given ID does not exist, an error is generated.  Note that overlay IDs MUST be unique even across multiple parent overlays.",
                "type": "string",
				"default": "sending widget's ID"
            },
            "parentId": {
                "description": "The ID of the parent overlay that is associated with this overlay.  If no ID is provided, the overlay will keep its existing parentage.  If a parentId is provided, the parentage of the overlay will be changed to the new parentId.  If an overlay with an ID of parentId does not exist, a new overlay will be created and the parentage of the overlay identified by overlayId will be changed to the newly created parent overlay.",
                "type": "string",
				"default": "N/A"
            }
        },
        "required" : []
    },
    notes : []
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>Video Motion Test Playground</title>
</head>
<body>
    <!-- FPS counter, Syntax highlighter, Blocks, Renderer -->
    <script src="./vendor.js"></script>
    <!-- Storage module -->
    <script src="./scratch-storage.js"></script>
    <!-- Stage rendering -->
    <script src="./scratch-render.js"></script>
    <!-- Extension -->
    <script src="./video-sensing-extension-debug.js"></script>
    <!-- Motion -->
    <script src="./video-sensing.js"></script>
</body>
</html>


text:
package com.eaux.app.muzei.bgg;

import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.net.Uri;
import android.preference.Preference;
import android.text.TextUtils;
import android.util.AttributeSet;

public class ViewUriPreference extends Preference {

	private String mUri;

	public ViewUriPreference(Context context) {
		super(context);
		init();
	}

	public ViewUriPreference(Context context, AttributeSet attrs) {
		super(context, attrs);
		parseAttributeSet(context, attrs);
		init();
	}

	public ViewUriPreference(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		parseAttributeSet(context, attrs);
		init();
	}

	@Override
	public CharSequence getSummary() {
		CharSequence summary = super.getSummary();
		if (TextUtils.isEmpty(summary)) {
			if (!TextUtils.isEmpty(mUri)) {
				return Uri.parse(mUri).getHost();
			}
		}
		return summary;
	}

	private void parseAttributeSet(Context context, AttributeSet attrs) {
		TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ViewUriPreference, 0, 0);
		mUri = a.getString(R.styleable.ViewUriPreference_uri);
		a.recycle();
	}

	private void init() {
		if (!TextUtils.isEmpty(mUri)) {
			Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUri));
			intent.addCategory(Intent.CATEGORY_BROWSABLE);
			setIntent(intent);
		}
	}
}


text:
<resources>
    <string-array name="ThemeActionsArray">
        <item>К первому</item>
        <item>К последнему</item>
        <item>К первому непрочитанному</item>
    </string-array>

    <string-array name="ThemeActionsValues">
        <item>getfirstpost</item>
        <item>getlastpost</item>
        <item>getnewpost</item>
    </string-array>

    <string-array name="SearchSourceArray">
        <item>Везде</item>
        <item>Только в заголовках тем</item>
        <item>Только в сообщениях</item>
    </string-array>

    <string-array name="SearchSourceValues">
        <item>all</item>
        <item>top</item>
        <item>pst</item>
    </string-array>

    <string-array name="ConnectTypeArray">
        <item>Всегда</item>
        <item>Только Wi-Fi</item>
        <item>Никогда</item>
    </string-array>

    <string-array name="ConnectTypeValues">
        <item>1</item>
        <item>2</item>
        <item>0</item>
    </string-array>

    <string-array name="AvatarsShowTitles">
        <item>Всегда</item>
        <item>Wi-Fi</item>
        <item>Никогда</item>
    </string-array>

    <string-array name="AvatarsShowValues">
        <item>0</item>
        <item>1</item>
        <item>2</item>
    </string-array>

    <string-array name="NewsListViewTitles">
        <item>Полный</item>
        <item>Сокращенный</item>
    </string-array>

    <string-array name="NewsListViewValues">
        <item>full</item>
        <item>medium</item>
    </string-array>

    <string-array name="SearchSortArray">
        <item>Соответствие запросу</item>
        <item>Дата (от новых к старым)</item>
        <item>Дата (от старых к новым)</item>
    </string-array>

    <string-array name="SearchSortValues">
        <item>rel</item>
        <item>dd</item>
        <item>da</item>
    </string-array>

    <string-array name="SearchResultTitles">
        <item>Сообщения</item>
        <item>Темы</item>
    </string-array>

    <string-array name="SearchResultValues">
        <item>posts</item>
        <item>topics</item>

    </string-array>

    <string-array name="EncodingArray">
        <item>Windows-1251</item>
        <item>UTF-8</item>

    </string-array>

    <string-array name="EncodingValues">
        <item>Windows-1251</item>
        <item>UTF-8</item>
    </string-array>

    <string-array name="appthemesArray">
        <item>Светлый</item>
        <item>Темный</item>
        <item>Material Light</item>
        <item>Material Dark</item>
        <item>Стандартный 4PDA</item>
    </string-array>

    <string-array name="appthemesValues">
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>

    <string-array name="screenOrienationArray">
        <item>Авто</item>
        <item>Горизонтально</item>
        <item>Вертикально</item>
    </string-array>

    <string-array name="screenOrienationValues">
        <item>-1</item>
        <item>0</item>
        <item>1</item>
    </string-array>

    <string-array name="downloaderManagersArray">
        <item>Системного менеджера</item>
        <item>Клиента</item>
        <item>Внешнего менеджера</item>
    </string-array>

    <string-array name="downloaderManagersValues">
        <item>1</item>
        <item>0</item>
        <item>2</item>
    </string-array>

    <string-array name="listOffsetsArray">
        <item>Выше</item>
        <item>Нормально</item>
        <item>Ниже</item>
    </string-array>
    <string-array name="listOffsetsValues">
        <item>-1</item>
        <item>0</item>
        <item>1</item>
    </string-array>

    <string-array name="CacheModeArray">
        <item>По умолчанию</item>
        <item>Нормальный</item>
        <item>Ниже</item>
    </string-array>
    <string-array name="CacheModeValues">
        <item>-1</item>
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
    </string-array>

    <string-array name="video_player_types_titles">
        <item>@string/client_player</item>
        <item>@string/system_player</item>
        <item>@string/ask_player</item>
    </string-array>
    <string-array name="video_player_types_values">
        <item>0</item>
        <item>1</item>
        <item>-1</item>
    </string-array>
    <string-array name="drawermenupositions_titles">
        <item>Слева</item>
        <item>Справа</item>
    </string-array>
    <string-array name="drawermenupositions_values">
        <item>left</item>
        <item>right</item>
    </string-array>

    <string-array name="forum_topics_sort_key_titles">
        <item>последнему сообщению</item>
        <item>последнему автору</item>
        <item>названиям темы</item>
        <item>автору темы</item>
        <item>дате открытия</item>
        <item>присоединениям</item>
        <item>ответам</item>
        <item>просмотрам</item>
    </string-array>
    <string-array name="forum_topics_sort_key_values">
        <item>last_post</item>
        <item>last_poster_name</item>
        <item>title</item>
        <item>starter_name</item>
        <item>start_date</item>
        <item>topic_hasattach</item>
        <item>posts</item>
        <item>views</item>
    </string-array>

    <string-array name="forum_topics_sort_by_titles">
        <item>А-Я</item>
        <item>Я-А</item>
    </string-array>
    <string-array name="forum_topics_sort_by_values">
        <item>A-Z</item>
        <item>Z-A</item>
    </string-array>

    <string-array name="forum_topics_prune_day_titles">
        <item>сегодня</item>
        <item>5 дней</item>
        <item>7 дней</item>
        <item>10 дней</item>
        <item>15 дней</item>
        <item>20 дней</item>
        <item>25 дней</item>
        <item>30 дней</item>
        <item>60 дней</item>
        <item>90 дней</item>
        <item>все время</item>
    </string-array>
    <string-array name="forum_topics_prune_day_values">
        <item>1</item>
        <item>5</item>
        <item>7</item>
        <item>10</item>
        <item>15</item>
        <item>20</item>
        <item>25</item>
        <item>30</item>
        <item>60</item>
        <item>90</item>
        <item>100</item>
    </string-array>

    <string-array name="forum_topics_topicfilter_titles">
        <item>Все</item>
        <item>Открытые</item>
        <item>Горячие</item>
        <item>Опросы</item>
        <item>Закрытые</item>
        <item>Перемещенные</item>
        <item>Созданные мною</item>
        <item>С моими ответами</item>
    </string-array>
    <string-array name="forum_topics_topicfilter_values">
        <item>all</item>
        <item>open</item>
        <item>hot</item>
        <item>poll</item>
        <item>locked</item>
        <item>moved</item>
        <item>istarted</item>
        <item>ireplied</item>
    </string-array>

    <string-array name="ImageViwersTitles">
        <item>Системного менеджера</item>
        <item>Клиента</item>
    </string-array>
    <string-array name="ImageViwersValues">
        <item>system</item>
        <item>client</item>
    </string-array>
</resources>


text:
package com.linecorp.armeria.client.endpoint;

import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

import com.linecorp.armeria.client.Endpoint;
import com.linecorp.armeria.common.Flags;
import com.linecorp.armeria.common.annotation.UnstableApi;

/**
 * An {@link EndpointGroupException} raised when an {@link EndpointGroup} fails to resolve
 * an {@link Endpoint} within a configured selection timeout.
 */
@UnstableApi
public final class EndpointSelectionTimeoutException extends EndpointGroupException {

    private static final long serialVersionUID = -3079582212067997365L;

    private static final EndpointSelectionTimeoutException INSTANCE =
            new EndpointSelectionTimeoutException();

    /**
     * Returns an {@link EndpointSelectionTimeoutException} which prints a message about
     * the {@link EndpointGroup} when thrown.
     */
    public static EndpointSelectionTimeoutException get(EndpointGroup endpointGroup,
                                                        long selectionTimeoutMillis) {
        requireNonNull(endpointGroup, "endpointGroup");
        checkArgument(selectionTimeoutMillis >= 0, "selectionTimeoutMillis: %s (expected: >= 0)",
                      selectionTimeoutMillis);
        return Flags.verboseExceptionSampler().isSampled(EndpointSelectionTimeoutException.class) ?
               new EndpointSelectionTimeoutException(endpointGroup, selectionTimeoutMillis) : INSTANCE;
    }

    private EndpointSelectionTimeoutException() {}

    private EndpointSelectionTimeoutException(EndpointGroup endpointGroup, long selectionTimeoutMillis) {
        super("Failed to select within " + selectionTimeoutMillis + " ms an endpoint from: " + endpointGroup);
    }
}


text:
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _BrowserContext_connection;
import { BrowserContext as BrowserContextBase } from '../../api/BrowserContext.js';
import { Page } from './Page.js';
/**
 * @internal
 */
export class BrowserContext extends BrowserContextBase {
    constructor(connection) {
        super();
        _BrowserContext_connection.set(this, void 0);
        __classPrivateFieldSet(this, _BrowserContext_connection, connection, "f");
    }
    async newPage() {
        const result = (await __classPrivateFieldGet(this, _BrowserContext_connection, "f").send('browsingContext.create', {
            type: 'tab',
        }));
        return new Page(__classPrivateFieldGet(this, _BrowserContext_connection, "f"), result.context);
    }
    async close() { }
}
_BrowserContext_connection = new WeakMap();
//# sourceMappingURL=BrowserContext.js.map


text:
package types

import (
	"fmt"
	"go/ast"
	"go/token"
	"strings"
)

func assert(p bool) {
	if !p {
		panic("assertion failed")
	}
}

func unreachable() {
	panic("unreachable")
}

func (check *checker) sprintf(format string, args ...interface{}) string {
	for i, arg := range args {
		switch a := arg.(type) {
		case nil:
			args[i] = "<nil>"
		case operand:
			panic("internal error: should always pass *operand")
		case token.Pos:
			args[i] = check.fset.Position(a).String()
		case ast.Expr:
			args[i] = ExprString(a)
		}
	}
	return fmt.Sprintf(format, args...)
}

func (check *checker) trace(pos token.Pos, format string, args ...interface{}) {
	fmt.Printf("%s:\t%s%s\n",
		check.fset.Position(pos),
		strings.Repeat(".  ", check.indent),
		check.sprintf(format, args...),
	)
}

// dump is only needed for debugging
func (check *checker) dump(format string, args ...interface{}) {
	fmt.Println(check.sprintf(format, args...))
}

func (check *checker) err(pos token.Pos, msg string) {
	err := Error{check.fset, pos, msg}
	if check.firstErr == nil {
		check.firstErr = err
	}
	f := check.conf.Error
	if f == nil {
		panic(bailout{}) // report only first error
	}
	f(err)
}

func (check *checker) errorf(pos token.Pos, format string, args ...interface{}) {
	check.err(pos, check.sprintf(format, args...))
}

func (check *checker) invalidAST(pos token.Pos, format string, args ...interface{}) {
	check.errorf(pos, "invalid AST: "+format, args...)
}

func (check *checker) invalidArg(pos token.Pos, format string, args ...interface{}) {
	check.errorf(pos, "invalid argument: "+format, args...)
}

func (check *checker) invalidOp(pos token.Pos, format string, args ...interface{}) {
	check.errorf(pos, "invalid operation: "+format, args...)
}


text:
=========================
An introduction to Docker
=========================

Date:
 * Tuesday, March 24, 2015 6:30 PM

Venue:
 * MixRadio, Prudential Buildings, 11-19 Wine St., Bristol, BS1 2PH, Bristol, Bristol
 * http://maps.google.com/maps?f=q&hl=en&q=Prudential+Buildings%2C+11-19+Wine+St.%2C+Bristol%2C+BS1+2PH%2C+Bristol%2C+Bristol%2C+gb

Meetup:
 * http://www.meetup.com/CodeHub-Bristol/events/219720033/

(There are a limited number of places at the venue, so if any of you have RSVPd to the Meetup but are not able to attend, please go to the Meetup page and change your status so that others can take your place and so that we can estimate how much food and drink to order.)

Slides:
 * http://htmlpreview.github.io/?https://github.com/wallrj/docker-tutorial/blob/master/docker-tutorial.html#/

Presenter:
 * Richard Wall

Preparations
============

It would be really helpful if you could install some or all of the following software on your laptop before the Docker workshop.
Don't worry if you can't, we'll be able to help you get set up when you arrive.
But the more you can get installed before hand, the further we'll be able to get in the limited time tomorrow evening.

* **Bring your laptop!**

And if possible, pre-install:

* **VirtualBox**: https://www.virtualbox.org
* **Vagrant**: https://docs.vagrantup.com/v2/installation
* **Git**: http://git-scm.com/downloads

For bonus points, pre-install Docker:

* Docker: https://docs.docker.com/installation/#installation

(but we'll cover that during the workshop and provide an Ubuntu Linux virtual machine with Docker pre-installed)

I've also uploaded a tutorial box to Vagrantcloud.
So if you want to be super prepared and if you've managed to install Git and Vagrant on your laptop (see messages below),
please clone this repository:

```
git clone https://github.com/wallrj/docker-tutorial.git
```

Then change to the `docker-tutorial` directory
and install the tutorial environment, by running the following command:

```
vagrant up
```

Vagrant will download the virtual machine and start it up for you.

If all goes well you should now be able to run docker commands on the virtual machine:

```
vagrant ssh -- docker run hello-world
```

And see output like this:

```
Hello from Docker.
This message shows that your installation appears to be working correctly.
...
```


text:
set @query_script_skip_cleanup := true;
set @query := 'update test.t1 STRAIGHT_JOIN test.t2 set val = val + 1';
call _interpret(@query, false);
call _get_split_query_single_table (
   1, 10000, @query_type_supported, @tables_found, @table_schema, @table_name
);

select
  @query_type_supported = 1
  and @tables_found = 'multi'
  and @table_schema is null
  and @table_name is null;


text:
package org.apache.spark.resource

import org.apache.spark.{SparkConf, SparkFunSuite}
import org.apache.spark.internal.config._
import org.apache.spark.internal.config.Python.PYSPARK_EXECUTOR_MEMORY
import org.apache.spark.resource.TestResourceIDs._

class ResourceProfileSuite extends SparkFunSuite {

  override def beforeAll(): Unit = {
    try {
      ResourceProfile.clearDefaultProfile()
    } finally {
      super.beforeAll()
    }
  }

  override def afterEach(): Unit = {
    try {
      ResourceProfile.clearDefaultProfile()
    } finally {
      super.afterEach()
    }
  }

  test("Default ResourceProfile") {
    val rprof = ResourceProfile.getOrCreateDefaultProfile(new SparkConf)
    assert(rprof.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID)
    assert(rprof.executorResources.size === 3,
      "Executor resources should contain cores, heap and offheap memory by default")
    assert(rprof.executorResources(ResourceProfile.CORES).amount === 1,
      "Executor resources should have 1 core")
    assert(rprof.getExecutorCores.get === 1,
      "Executor resources should have 1 core")
    assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 1024,
      "Executor resources should have 1024 memory")
    assert(rprof.executorResources.get(ResourceProfile.PYSPARK_MEM) == None,
      "pyspark memory empty if not specified")
    assert(rprof.executorResources.get(ResourceProfile.OVERHEAD_MEM) == None,
      "overhead memory empty if not specified")
    assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 0,
      "Executor resources should have 0 offheap memory")
    assert(rprof.taskResources.size === 1,
      "Task resources should just contain cpus by default")
    assert(rprof.taskResources(ResourceProfile.CPUS).amount === 1,
      "Task resources should have 1 cpu")
    assert(rprof.getTaskCpus.get === 1,
      "Task resources should have 1 cpu")
  }

  test("Executor cores should be None by default for standalone cluster") {
    val sparkConf = new SparkConf()
      .setMaster("spark://ut.cluster")
      .remove(EXECUTOR_CORES.key)
    val rprof = ResourceProfile.getOrCreateDefaultProfile(sparkConf)
    assert(rprof.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID)
    assert(!rprof.executorResources.contains(ResourceProfile.CORES),
      "Executor cores should be None by default for standalone cluster")
    assert(rprof.getExecutorCores.isEmpty,
      "Executor cores should be None by default for standalone cluster")
  }

  test("Get resource for standalone cluster") {
    val sparkConf = new SparkConf()
      .setMaster("spark://ut.cluster")
      .remove(EXECUTOR_CORES.key)
    val defaultExecutorResource = ResourceProfile.getDefaultProfileExecutorResources(sparkConf)
    assert(defaultExecutorResource.cores.isEmpty)
    assert(defaultExecutorResource.executorMemoryMiB === 1024L)
    assert(defaultExecutorResource.memoryOffHeapMiB === 0L)
    assert(defaultExecutorResource.memoryOverheadMiB.isEmpty)
    assert(defaultExecutorResource.pysparkMemoryMiB.isEmpty)
    assert(defaultExecutorResource.customResources.isEmpty)

    val rpBuilder = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("cpu", 2)
    val execReq =
      new ExecutorResourceRequests().cores(4)
    val rp = rpBuilder.require(taskReq).require(execReq).build()
    val executorResourceForRp = ResourceProfile.getResourcesForClusterManager(
      rp.id, rp.executorResources, 0.0, sparkConf, false, Map.empty)
    // Standalone cluster only take cores and executor memory as built-in resources.
    assert(executorResourceForRp.cores.get === 4)
    assert(executorResourceForRp.executorMemoryMiB === 1024L)
  }

  test("Default ResourceProfile with app level resources specified") {
    val conf = new SparkConf
    conf.set(PYSPARK_EXECUTOR_MEMORY.key, "2g")
    conf.set(EXECUTOR_MEMORY_OVERHEAD.key, "1g")
    conf.set(EXECUTOR_MEMORY.key, "4g")
    conf.set(EXECUTOR_CORES.key, "4")
    conf.set(MEMORY_OFFHEAP_ENABLED.key, "true")
    conf.set(MEMORY_OFFHEAP_SIZE.key, "3m")
    conf.set(TASK_GPU_ID.amountConf, "1")
    conf.set(EXECUTOR_GPU_ID.amountConf, "1")
    conf.set(EXECUTOR_GPU_ID.discoveryScriptConf, "nameOfScript")
    val rprof = ResourceProfile.getOrCreateDefaultProfile(conf)
    assert(rprof.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID)
    val execResources = rprof.executorResources
    assert(execResources.size === 6, s"Executor resources should contain cores, pyspark " +
      s"memory, memory overhead, memory, offHeap memory and gpu $execResources")
    assert(execResources.contains("gpu"), "Executor resources should have gpu")
    assert(rprof.executorResources(ResourceProfile.CORES).amount === 4,
      "Executor resources should have 4 core")
    assert(rprof.getExecutorCores.get === 4,
      "Executor resources should have 4 core")
    assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 4096,
      "Executor resources should have 1024 memory")
    assert(rprof.executorResources(ResourceProfile.PYSPARK_MEM).amount == 2048,
      "pyspark memory empty if not specified")
    assert(rprof.executorResources(ResourceProfile.OVERHEAD_MEM).amount == 1024,
      "overhead memory empty if not specified")
    assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount == 3,
      "Executor resources should have 3 offHeap memory")
    assert(rprof.taskResources.size === 2,
      "Task resources should just contain cpus and gpu")
    assert(rprof.taskResources.contains("gpu"), "Task resources should have gpu")
  }

  test("test default profile task gpus fractional") {
    val sparkConf = new SparkConf()
      .set(EXECUTOR_GPU_ID.amountConf, "2")
      .set(TASK_GPU_ID.amountConf, "0.33")
    val immrprof = ResourceProfile.getOrCreateDefaultProfile(sparkConf)
    assert(immrprof.taskResources.get("gpu").get.amount == 0.33)
  }

  test("maxTasksPerExecutor cpus") {
    val sparkConf = new SparkConf()
      .set(EXECUTOR_CORES, 1)
    val rprof = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("gpu", 1)
    val execReq =
      new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprof.require(taskReq).require(execReq)
    val immrprof = new ResourceProfile(rprof.executorResources, rprof.taskResources)
    assert(immrprof.limitingResource(sparkConf) == "cpus")
    assert(immrprof.maxTasksPerExecutor(sparkConf) == 1)
  }

  test("maxTasksPerExecutor/limiting no executor cores") {
    val sparkConf = new SparkConf().setMaster("spark://testing")
    val rprof = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("gpu", 1)
    val execReq =
      new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprof.require(taskReq).require(execReq)
    val immrprof = new ResourceProfile(rprof.executorResources, rprof.taskResources)
    assert(immrprof.limitingResource(sparkConf) == "gpu")
    assert(immrprof.maxTasksPerExecutor(sparkConf) == 2)
    assert(immrprof.isCoresLimitKnown == false)
  }

  test("maxTasksPerExecutor/limiting no other resource no executor cores") {
    val sparkConf = new SparkConf().setMaster("spark://testing")
    val immrprof = ResourceProfile.getOrCreateDefaultProfile(sparkConf)
    assert(immrprof.limitingResource(sparkConf) == "")
    assert(immrprof.maxTasksPerExecutor(sparkConf) == 1)
    assert(immrprof.isCoresLimitKnown == false)
  }

  test("maxTasksPerExecutor/limiting executor cores") {
    val sparkConf = new SparkConf().setMaster("spark://testing").set(EXECUTOR_CORES, 2)
    val rprof = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("gpu", 1)
    val execReq =
      new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprof.require(taskReq).require(execReq)
    val immrprof = new ResourceProfile(rprof.executorResources, rprof.taskResources)
    assert(immrprof.limitingResource(sparkConf) == ResourceProfile.CPUS)
    assert(immrprof.maxTasksPerExecutor(sparkConf) == 2)
    assert(immrprof.isCoresLimitKnown == true)
  }

  test("Create ResourceProfile") {
    val rprof = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("gpu", 1)
    val eReq = new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprof.require(taskReq).require(eReq)

    assert(rprof.executorResources.size === 1)
    assert(rprof.executorResources.contains("gpu"),
      "Executor resources should have gpu")
    assert(rprof.executorResources.get("gpu").get.vendor === "nvidia",
      "gpu vendor should be nvidia")
    assert(rprof.executorResources.get("gpu").get.discoveryScript === "myscript",
      "discoveryScript should be myscript")
    assert(rprof.executorResources.get("gpu").get.amount === 2,
    "gpu amount should be 2")

    assert(rprof.taskResources.size === 1, "Should have 1 task resource")
    assert(rprof.taskResources.contains("gpu"), "Task resources should have gpu")
    assert(rprof.taskResources.get("gpu").get.amount === 1,
      "Task resources should have 1 gpu")

    val ereqs = new ExecutorResourceRequests()
    ereqs.cores(2).memory("4096")
    ereqs.memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072")
    val treqs = new TaskResourceRequests()
    treqs.cpus(1)

    rprof.require(treqs)
    rprof.require(ereqs)

    assert(rprof.executorResources.size === 6)
    assert(rprof.executorResources(ResourceProfile.CORES).amount === 2,
      "Executor resources should have 2 cores")
    assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 4096,
      "Executor resources should have 4096 memory")
    assert(rprof.executorResources(ResourceProfile.OVERHEAD_MEM).amount === 2048,
      "Executor resources should have 2048 overhead memory")
    assert(rprof.executorResources(ResourceProfile.PYSPARK_MEM).amount === 1024,
      "Executor resources should have 1024 pyspark memory")
    assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 3072,
      "Executor resources should have 3072 offHeap memory")

    assert(rprof.taskResources.size === 2)
    assert(rprof.taskResources("cpus").amount === 1, "Task resources should have cpu")
  }

  test("test ResourceProfiles equal") {
    val rprofBuilder = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests().resource("gpu", 1)
    val eReq = new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprofBuilder.require(taskReq).require(eReq)
    val rprof = rprofBuilder.build

    val rprofBuilder2 = new ResourceProfileBuilder()
    val taskReq2 = new TaskResourceRequests().resource("gpu", 1)
    val eReq2 = new ExecutorResourceRequests().resource("gpu", 2, "myscript", "nvidia")
    rprofBuilder2.require(taskReq2).require(eReq2)
    val rprof2 = rprofBuilder.build
    rprof2.setResourceProfileId(rprof.id)

    assert(rprof === rprof2, "resource profile equality not working")
    rprof2.setResourceProfileId(rprof.id + 1)
    assert(rprof.id != rprof2.id, "resource profiles should not have same id")
    assert(rprof.resourcesEqual(rprof2), "resource profile resourcesEqual not working")
  }

  test("Test ExecutorResourceRequests memory helpers") {
    val rprof = new ResourceProfileBuilder()
    val ereqs = new ExecutorResourceRequests()
    ereqs.memory("4g")
    ereqs.memoryOverhead("2000m").pysparkMemory("512000k").offHeapMemory("1g")
    rprof.require(ereqs)

    assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 4096,
      "Executor resources should have 4096 memory")
    assert(rprof.executorResources(ResourceProfile.OVERHEAD_MEM).amount === 2000,
      "Executor resources should have 2000 overhead memory")
    assert(rprof.executorResources(ResourceProfile.PYSPARK_MEM).amount === 500,
      "Executor resources should have 512 pyspark memory")
    assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 1024,
      "Executor resources should have 1024 offHeap memory")
  }

  test("Test TaskResourceRequest fractional") {
    val rprof = new ResourceProfileBuilder()
    val treqs = new TaskResourceRequests().resource("gpu", 0.33)
    rprof.require(treqs)

    assert(rprof.taskResources.size === 1, "Should have 1 task resource")
    assert(rprof.taskResources.contains("gpu"), "Task resources should have gpu")
    assert(rprof.taskResources.get("gpu").get.amount === 0.33,
      "Task resources should have 0.33 gpu")

    val fpgaReqs = new TaskResourceRequests().resource("fpga", 4.0)
    rprof.require(fpgaReqs)

    assert(rprof.taskResources.size === 2, "Should have 2 task resource")
    assert(rprof.taskResources.contains("fpga"), "Task resources should have gpu")
    assert(rprof.taskResources.get("fpga").get.amount === 4.0,
      "Task resources should have 4.0 gpu")

    var taskError = intercept[AssertionError] {
      rprof.require(new TaskResourceRequests().resource("gpu", 1.5))
    }.getMessage()
    assert(taskError.contains("The resource amount 1.5 must be either <= 0.5, or a whole number."))

    taskError = intercept[AssertionError] {
      rprof.require(new TaskResourceRequests().resource("gpu", 0.7))
    }.getMessage()
    assert(taskError.contains("The resource amount 0.7 must be either <= 0.5, or a whole number."))
  }

  test("ResourceProfile has correct custom executor resources") {
    val rprof = new ResourceProfileBuilder()
    val eReq = new ExecutorResourceRequests()
      .cores(2).memory("4096")
      .memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072")
      .resource("gpu", 2)
    rprof.require(eReq)

    // Update this if new resource type added
    assert(ResourceProfile.allSupportedExecutorResources.size === 5,
      "Executor resources should have 5 supported resources")
    assert(ResourceProfile.getCustomExecutorResources(rprof.build).size === 1,
      "Executor resources should have 1 custom resource")
  }

  test("ResourceProfile has correct custom task resources") {
    val rprof = new ResourceProfileBuilder()
    val taskReq = new TaskResourceRequests()
      .resource("gpu", 1)
    val eReq = new ExecutorResourceRequests()
      .cores(2).memory("4096")
      .memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072")
    rprof.require(taskReq).require(eReq)

    assert(ResourceProfile.getCustomTaskResources(rprof.build).size === 1,
      "Task resources should have 1 custom resource")
  }
}


text:
<ion-header>
  <ion-navbar color="dark">
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Spots</ion-title>
    <ion-buttons end>
      <button ion-button icon-only (click)="newSpot()">
        <ion-icon name="add"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-list>
    <button ion-item *ngFor="let spot of spots" (click)="onSelect(spot)">
      <ion-icon name="flask" item-left></ion-icon>
      {{spot.name}}
      <div class="item-note" item-right>
        {{spot.id}}
      </div>
    </button>
  </ion-list>
</ion-content>


text:
<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>
      {{ 'IMAGE_DETAIL' | translate }}
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content>

{{imageDescription}}

  <button class="btn-speak-again" color="dark" ion-button large block *ngIf="isSpeak" (click)="speakAgain()">{{ 'SPEAK_AGAIN' | translate }}</button>
</ion-content>


text:
from .models import cloudwatch_backends
from ..core.models import base_decorator, deprecated_base_decorator

cloudwatch_backend = cloudwatch_backends['us-east-1']
mock_cloudwatch = base_decorator(cloudwatch_backends)
mock_cloudwatch_deprecated = deprecated_base_decorator(cloudwatch_backends)


text:
package uk.gov.nationalarchives.utf8.validator;

/**
 * An Exception caused by a UTF8 Validation error
 *
 * @author Adam Retter <adam.retter@googlemail.com>
 */
public class ValidationException extends Exception {

   /**
    * @param message Description of the validation error
    * @param byteOffset offset in the underlying data that failed validation
    */
   public ValidationException(final String message, final long byteOffset) {
       super(message + " @ byte position: " + byteOffset);
   }

   /**
    * @param message Description of the validation error
    * @param byteOffset offset in the underlying data that failed validation
    * @param cause
    */
   public ValidationException(final String message, final long byteOffset, final Throwable cause) {
       super(message + " @ byte position: " + byteOffset, cause);
   }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /var/www/mysite.com/public/application/models</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">

/var/www/mysite.com/public/application

models

(Dashboard)

Code Coverage

Lines

Functions and Methods

Classes and Traits

      Total

           0.00% covered (danger)

0.00%

0 / 365

           0.00% covered (danger)

0.00%

0 / 21

           0.00% covered (danger)

0.00%

0 / 6

       Album_images_model.php

           0.00% covered (danger)

0.00%

0 / 96

           0.00% covered (danger)

0.00%

0 / 4

           0.00% covered (danger)

0.00%

0 / 1

       Albums_model.php

           0.00% covered (danger)

0.00%

0 / 61

           0.00% covered (danger)

0.00%

0 / 3

           0.00% covered (danger)

0.00%

0 / 1

       Cache_model.php

           0.00% covered (danger)

0.00%

0 / 29

           0.00% covered (danger)

0.00%

0 / 4

           0.00% covered (danger)

0.00%

0 / 1

       Reset_model.php

           0.00% covered (danger)

0.00%

0 / 73

           0.00% covered (danger)

0.00%

0 / 4

           0.00% covered (danger)

0.00%

0 / 1

       Resized_model.php

           0.00% covered (danger)

0.00%

0 / 99

           0.00% covered (danger)

0.00%

0 / 5

           0.00% covered (danger)

0.00%

0 / 1

       Users_model.php

           0.00% covered (danger)

0.00%

0 / 7

           0.00% covered (danger)

0.00%

0 / 1

           0.00% covered (danger)

0.00%

0 / 1

Legend

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

     Generated by PHP_CodeCoverage 3.3.1 using PHP 5.6.21-1+donate.sury.org~trusty+1 and PHPUnit 5.3.2 at Thu May 12 13:04:40 EEST 2016.


text:
#ifndef PROTO_TIMER_H
#include <proto/timer.h>
#endif /* PROTO_TIMER_H */

/****************************************************************************/

#include <sys/time.h>

/****************************************************************************/

#ifndef _TIME_HEADERS_H
#include "time_headers.h"
#endif /* _TIME_HEADERS_H */

#ifndef _LOCALE_HEADERS_H
#include "locale_headers.h"
#endif /* _LOCALE_HEADERS_H */

#ifndef _UNISTD_HEADERS_H
#include "unistd_headers.h"
#endif /* _UNISTD_HEADERS_H */

/****************************************************************************/

/* The following is not part of the ISO 'C' (1994) standard. */

/****************************************************************************/

int
gettimeofday(struct timeval *tp, struct timezone *tzp)
{
	#if defined(__amigaos4__)
	struct TimerIFace * ITimer = __ITimer;
	#else
	struct Library * TimerBase = __TimerBase;
	#endif /* __amigaos4__ */

	ULONG seconds,microseconds;

	ENTER();

	/* Obtain the current system time. */
	PROFILE_OFF();

	#if defined(__NEW_TIMEVAL_DEFINITION_USED__)
	{
		struct TimeVal tv;

		GetSysTime(&tv);

		seconds		= tv.Seconds;
		microseconds	= tv.Microseconds;
	}
	#else
	{
		struct timeval tv;

		GetSysTime(&tv);

		seconds		= tv.tv_sec;
		microseconds	= tv.tv_usec;
	}
	#endif /* __NEW_TIMEVAL_DEFINITION_USED__ */

	PROFILE_ON();

	/* Convert the number of seconds so that they match the Unix epoch, which
	   starts (January 1st, 1970) eight years before the AmigaOS epoch. */
	seconds += UNIX_TIME_OFFSET;

	__locale_lock();

	/* If possible, adjust for the local time zone. We do this because the
	   AmigaOS system time is returned in local time and we want to return
	   it in UTC. */
	if(__default_locale != NULL)
		seconds += 60 * __default_locale->loc_GMTOffset;

	if(tp != NULL)
	{
		tp->tv_sec	= (long)seconds;
		tp->tv_usec	= (long)microseconds;

		SHOWVALUE(tp->tv_sec);
		SHOWVALUE(tp->tv_usec);
	}

	if(tzp != NULL)
	{
		if(__default_locale != NULL)
			tzp->tz_minuteswest = __default_locale->loc_GMTOffset;
		else
			tzp->tz_minuteswest = 0;

		/* The -1 means "we do not know if the time given is in
		   daylight savings time". */
		tzp->tz_dsttime = -1;

		SHOWVALUE(tzp->tz_minuteswest);
		SHOWVALUE(tzp->tz_dsttime);
	}

	__locale_unlock();

	RETURN(0);
	return(0);
}