text:
package org.folio.marccat.dao.persistence;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import org.folio.marccat.business.common.PersistentObjectWithView;
import org.folio.marccat.dao.AbstractDAO;
import org.folio.marccat.dao.DAOBibItem;
import org.folio.marccat.exception.DataAccessException;

import java.io.Serializable;

public class BIB_ITM extends ItemEntity implements PersistentObjectWithView, Serializable {

  private char canadianContentIndicator = '0';
  private char controlTypeCode = ' ';
  private String countryStringText;
  private char descriptiveCataloguingCode = ' ';
  private String formOfMusicStringText;
  private int inputSourceCode = 96;
  private char itemBibliographicLevelCode = 'm';
  private String itemDateFirstPublication;
  private String itemDateLastPublication = "    ";
  private char itemDateTypeCode = 's';
  private char itemRecordTypeCode = 'a';
  private String languageCode;
  private String languageStringText;
  private char linkedRecordCode = ' ';
  private String marcCountryCode;
  private String projectedPublicationDateCode;
  private char recordCataloguingSourceCode;
  private char recordModifiedCode = ' ';
  private char replacementStatusCode = '1';
  private String specialCodedDatesStringText;
  private String translationCode = "";
  private String userViewString = "0000000000000000";

  public BIB_ITM() {
    super();
  }

  public boolean equals(Object obj) {
    if (!(obj instanceof BIB_ITM))
      return false;

    BIB_ITM other = (BIB_ITM) obj;
    return (other.getAmicusNumber().equals(this.getAmicusNumber()) && other.getUserViewString().equals(this.getUserViewString()));
  }

  /* (non-Javadoc)
   * @see java.lang.Object#hashCode()
   */
  public int hashCode() {
    if (getAmicusNumber() == null) {
      return -1;
    } else {
      return getAmicusNumber().intValue();
    }
  }

  /* (non-Javadoc)
   * @see librisuite.business.common.PersistentObject#generateNewKey()
   */
  public void generateNewKey(final Session session) throws DataAccessException, HibernateException {
		/*SystemNextNumberDAO dao = new SystemNextNumberDAO();
		setAmicusNumber(new Integer(dao.getNextNumber("BI")));*/
  }

  public char getCanadianContentIndicator() {
    return canadianContentIndicator;
  }

  public void setCanadianContentIndicator(char canadianContentIndicator) {
    this.canadianContentIndicator = canadianContentIndicator;
  }

  public char getControlTypeCode() {
    return controlTypeCode;
  }

  public void setControlTypeCode(char c) {
    controlTypeCode = c;
  }

  public String getCountryStringText() {
    return countryStringText;
  }

  public void setCountryStringText(String string) {
    countryStringText = string;
  }

  public AbstractDAO getDAO() {
    return new DAOBibItem();
  }

  public char getDescriptiveCataloguingCode() {
    return descriptiveCataloguingCode;
  }

  public void setDescriptiveCataloguingCode(char c) {
    descriptiveCataloguingCode = c;
  }

  public String getFormOfMusicStringText() {
    return formOfMusicStringText;
  }

  public void setFormOfMusicStringText(String string) {
    formOfMusicStringText = string;
  }

  public int getInputSourceCode() {
    return inputSourceCode;
  }

  public void setInputSourceCode(int inputSourceCode) {
    this.inputSourceCode = inputSourceCode;
  }

  public char getItemBibliographicLevelCode() {
    return itemBibliographicLevelCode;
  }

  public void setItemBibliographicLevelCode(char c) {
    itemBibliographicLevelCode = c;
  }

  public String getItemDateFirstPublication() {
    return itemDateFirstPublication;
  }

  public void setItemDateFirstPublication(String string) {
    itemDateFirstPublication = string;
  }

  public String getItemDateLastPublication() {
    return itemDateLastPublication;
  }

  public void setItemDateLastPublication(String string) {
    itemDateLastPublication = string;
  }

  public char getItemDateTypeCode() {
    return itemDateTypeCode;
  }

  public void setItemDateTypeCode(char c) {
    itemDateTypeCode = c;
  }

  public char getItemRecordTypeCode() {
    return itemRecordTypeCode;
  }

  public void setItemRecordTypeCode(char c) {
    itemRecordTypeCode = c;
  }

  public String getLanguageCode() {
    return languageCode;
  }

  public void setLanguageCode(String string) {
    languageCode = string;
  }

  public String getLanguageStringText() {
    return languageStringText;
  }

  public void setLanguageStringText(String string) {
    languageStringText = string;
  }

  public char getLinkedRecordCode() {
    return linkedRecordCode;
  }

  public void setLinkedRecordCode(char c) {
    linkedRecordCode = c;
  }

  public String getMarcCountryCode() {
    return marcCountryCode;
  }

  public void setMarcCountryCode(String string) {
    marcCountryCode = string;
  }

  public String getProjectedPublicationDateCode() {
    return projectedPublicationDateCode;
  }

  public void setProjectedPublicationDateCode(String c) {
    projectedPublicationDateCode = c;
  }

  public char getRecordCataloguingSourceCode() {
    return recordCataloguingSourceCode;
  }

  public void setRecordCataloguingSourceCode(char c) {
    recordCataloguingSourceCode = c;
  }

  public char getRecordModifiedCode() {
    return recordModifiedCode;
  }

  public void setRecordModifiedCode(char c) {
    recordModifiedCode = c;
  }

  public char getReplacementStatusCode() {
    return replacementStatusCode;
  }

  public void setReplacementStatusCode(char replacementStatusCode) {
    this.replacementStatusCode = replacementStatusCode;
  }

  public String getSpecialCodedDatesStringText() {
    return specialCodedDatesStringText;
  }

  public void setSpecialCodedDatesStringText(String string) {
    specialCodedDatesStringText = string;
  }

  public String getTranslationCode() {
    return translationCode;
  }

  public void setTranslationCode(String c) {
    translationCode = c;
  }

  public String getUserViewString() {
    return userViewString;
  }

  public void setUserViewString(String string) {
    userViewString = string;
  }
}


text: var CheckboxTextfield = require('./../index');

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>Mesenteric venous thrombosis is a blood clot in one or more of the major veins that drain blood from the intestine.</value>
		<pattern_crowdsource> Mesenteric venous thrombosis is a [[blood clot|C0302148]] in one or more of the major veins that drain blood from the [[intestine|C0021853]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood clot</surface-form>
				<RDF-ID>C0302148</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>one</surface-form>
				<RDF-ID>C0205447</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>more</surface-form>
				<RDF-ID>C0205172</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>major veins</surface-form>
				<RDF-ID>C0682606</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood</surface-form>
				<RDF-ID>C0005767</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intestine</surface-form>
				<RDF-ID>C0021853</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0021853 LOCATION_OF C0302148</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Mesenteric venous thrombosis is a clot that blocks blood flow in a mesenteric vein.</value>
		<pattern_crowdsource> [[Mesenteric venous thrombosis|C0267412]] is a clot that blocks [[blood flow|C0232338]] in a [[mesenteric vein|C1281658]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood flow</surface-form>
				<RDF-ID>C0232338</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric vein</surface-form>
				<RDF-ID>C1281658</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0267412 AFFECTS C0232338</triple>
			<triple>C1281658 LOCATION_OF C0267412</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>There are several diseases that can lead to mesenteric venous thrombosis.</value>
		<pattern_crowdsource> There are several [[diseases|C0012634]] that can lead to [[mesenteric venous thrombosis|C0267412]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>several</surface-form>
				<RDF-ID>C0443302</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>diseases</surface-form>
				<RDF-ID>C0012634</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0012634 CAUSES C0267412</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Many of the diseases cause swelling (inflammation) of the tissues surrounding the veins, and include:  - Appendicitis  - Cancer  - Diverticulitis  - Liver disease with cirrhosis  - Pancreatitis    Patients who have disorders that make the blood more likely to stick together (clot) have a higher risk of mesenteric venous thrombosis.</value>
		<pattern_crowdsource> Many of the [[diseases|C0012634]] cause [[swelling|C0013604]] (inflammation) of the tissues surrounding the veins, and include:  - Appendicitis  - Cancer  - Diverticulitis  - Liver disease with cirrhosis  - Pancreatitis    [[Patients|C0030705]] who have [[disorders|C0012634]] that make the blood more likely to stick together (clot) have a higher risk of mesenteric venous thrombosis.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>diseases</surface-form>
				<RDF-ID>C0012634</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>swelling</surface-form>
				<RDF-ID>C0013604</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>inflammation</surface-form>
				<RDF-ID>C0021368</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>tissues</surface-form>
				<RDF-ID>C0040300</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>veins</surface-form>
				<RDF-ID>C0042449</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Appendicitis</surface-form>
				<RDF-ID>C0003615</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Cancer</surface-form>
				<RDF-ID>C0006826</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Diverticulitis</surface-form>
				<RDF-ID>C0012813</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Liver disease</surface-form>
				<RDF-ID>C0023895</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>cirrhosis</surface-form>
				<RDF-ID>C0016059</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Pancreatitis</surface-form>
				<RDF-ID>C0030305</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Patients</surface-form>
				<RDF-ID>C0030705</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>disorders</surface-form>
				<RDF-ID>C0012634</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood</surface-form>
				<RDF-ID>C0005767</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>likely</surface-form>
				<RDF-ID>C0332148</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>higher</surface-form>
				<RDF-ID>C0205250</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>risk</surface-form>
				<RDF-ID>C0035647</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0012634 CAUSES C0013604</triple>
			<triple>C0012634 PROCESS_OF C0030705</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>A CT scan is the main test used to diagnose mesenteric venous thrombosis.</value>
		<pattern_crowdsource> A [[CT scan|C0040405]] is the main test used to diagnose [[mesenteric venous thrombosis|C0267412]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>CT scan</surface-form>
				<RDF-ID>C0040405</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>main</surface-form>
				<RDF-ID>C0205225</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>test</surface-form>
				<RDF-ID>C0039593</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0040405 DIAGNOSES C0267412</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Other tests may include:  - Angiogram (studying the blood flow to the intestine)  - MRI of the abdomen   - Ultrasound of the abdomen and mesenteric veins</value>
		<pattern_crowdsource> Other tests may include:  - Angiogram (studying the blood flow to the intestine)  - MRI of the [[abdomen   - Ultrasound|C0203464]] of the [[abdomen|C0000726]] and [[mesenteric veins|C0025473]]		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>tests</surface-form>
				<RDF-ID>C0392366</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>Angiogram</surface-form>
				<RDF-ID>C0002978</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>blood flow</surface-form>
				<RDF-ID>C0232338</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>intestine</surface-form>
				<RDF-ID>C0021853</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>MRI</surface-form>
				<RDF-ID>C0024485</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>abdomen   - Ultrasound</surface-form>
				<RDF-ID>C0203464</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>abdomen</surface-form>
				<RDF-ID>C0000726</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric veins</surface-form>
				<RDF-ID>C0025473</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0000726 LOCATION_OF C0203464</triple>
			<triple>C0025473 LOCATION_OF C0203464</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>Blood thinners (most commonly heparin or related drugs) are used to treat mesenteric venous thrombosis when there is no associated bleeding.</value>
		<pattern_crowdsource> [[Blood thinners|C0003280]] (most commonly [[heparin|C0019134]] or related [[drugs|C0013227]]) are used to treat [[mesenteric venous thrombosis|C0267412]] when there is no associated bleeding.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Blood thinners</surface-form>
				<RDF-ID>C0003280</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>most</surface-form>
				<RDF-ID>C0205393</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>heparin</surface-form>
				<RDF-ID>C0019134</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>related</surface-form>
				<RDF-ID>C1522149</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>drugs</surface-form>
				<RDF-ID>C0013227</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>mesenteric venous thrombosis</surface-form>
				<RDF-ID>C0267412</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>bleeding</surface-form>
				<RDF-ID>C0019080</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0019134 ISA C0003280</triple>
			<triple>C0013227 ISA C0003280</triple>
			<triple>C0003280 TREATS C0267412</triple>
			<triple>C0019134 TREATS C0267412</triple>
			<triple>C0013227 TREATS C0267412</triple>
		</triples>
	</Sentence>

</Document>


text:
import {LOCALE_ID, NgModule} from '@angular/core';
import {Title} from '@angular/platform-browser';

import {
    FindLanguageFromKeyPipe,
    GatewaySharedLibsModule,
    JhiAlertComponent,
    JhiAlertErrorComponent,
    JhiLanguageHelper
} from './';

@NgModule({
    imports: [
        GatewaySharedLibsModule
    ],
    declarations: [
        FindLanguageFromKeyPipe,
        JhiAlertComponent,
        JhiAlertErrorComponent
    ],
    providers: [
        JhiLanguageHelper,
        Title,
        {
            provide: LOCALE_ID,
            useValue: 'en'
        }
    ],
    exports: [
        GatewaySharedLibsModule,
        FindLanguageFromKeyPipe,
        JhiAlertComponent,
        JhiAlertErrorComponent
    ]
})
export class GatewaySharedCommonModule {}


text:
class Solution(object):
    def lowestCommonAncestor(self, root, p, q):
        """
        :type root: TreeNode
        :type p: TreeNode
        :type q: TreeNode
        :rtype: TreeNode
        """
        if p.val > q.val:
            p,q = q,p
        if p.val <= root.val and q.val >= root.val:
            return root
        if q.val < root.val:
            return self.lowestCommonAncestor(root.left, p, q)
        if p.val > root.val:
            return self.lowestCommonAncestor(root.right, p, q)


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>me.dslztx</groupId>
    <artifactId>assist-parent</artifactId>
    <version>3.0.8</version>
  </parent>

  <artifactId>assist-domain</artifactId>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>org.quartz-scheduler</groupId>
      <artifactId>quartz</artifactId>
    </dependency>
  </dependencies>
</project>


text:
# Selector component

> General modal container.

## Selector TestKit API

### Enzyme / ReactTestUtils
| method | arguments | returned value | description |
|--------|-----------|----------------|-------------|
| title | - | string | title |

## Usage Example

> Unit testing example

```javascript
  import React from 'react';
  import {selectorTestkitFactory} from 'wix-style-react/dist/testkit';
  import {selectorTestkitFactory as enzymeSelectorTestkitFactory} from 'wix-style-react/dist/testkit/enzyme';

  /***************
   enzyme example
  ***************/

  const dataHook = 'myDataHook';
  const wrapper = mount(<div/><Selector {...props} dataHook={dataHook}/></div>);
  const testkit = enzymeSelectorTestkitFactory({wrapper, dataHook});

  //Do tests
  expect(testkit.isOpen()).toBeFalsy();

  /**********************
   ReactTestUtils example
  **********************/

  const div = document.createElement('div');
  const dataHook = 'myDataHook';
  const wrapper = div.appendChild(
    ReactTestUtils.renderIntoDocument(<div/><Selector {...props} dataHook={dataHook}/></div>, {dataHook})
  );
  const testkit = selectorTestkitFactory({wrapper, dataHook});

  //Do tests
  expect(testkit.exists()).toBeTruthy();
```


text:
"use strict";

import Rule from "../rule";
import DefinitionBNFNode from "../node/bnf/definition";
import DefinitionDefinition from "../definition/definition";

import { DefinitionRuleName } from "../ruleNames";

export default class DefinitionRule extends Rule {
  constructor() {
    const name = DefinitionRuleName,
          definitionDefinition = new DefinitionDefinition(),
          ambiguous = false,
          definitions = [
            definitionDefinition
          ],
          Node = DefinitionBNFNode;

    super(name, ambiguous, definitions, Node)
  }
}


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

package google.registry.rde;

import static com.google.appengine.api.urlfetch.FetchOptions.Builder.validateCertificate;
import static com.google.appengine.api.urlfetch.HTTPMethod.PUT;
import static com.google.common.io.BaseEncoding.base64;
import static com.google.common.net.HttpHeaders.AUTHORIZATION;
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
import static google.registry.util.DomainNameUtils.canonicalizeHostname;
import static java.nio.charset.StandardCharsets.UTF_8;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_OK;

import com.google.appengine.api.urlfetch.HTTPHeader;
import com.google.appengine.api.urlfetch.HTTPRequest;
import com.google.appengine.api.urlfetch.HTTPResponse;
import com.google.appengine.api.urlfetch.URLFetchService;
import com.google.common.flogger.FluentLogger;
import google.registry.config.RegistryConfig.Config;
import google.registry.keyring.api.KeyModule.Key;
import google.registry.request.HttpException.InternalServerErrorException;
import google.registry.util.Retrier;
import google.registry.xjc.XjcXmlTransformer;
import google.registry.xjc.iirdea.XjcIirdeaResponseElement;
import google.registry.xjc.iirdea.XjcIirdeaResult;
import google.registry.xjc.rdeheader.XjcRdeHeader;
import google.registry.xjc.rdereport.XjcRdeReportReport;
import google.registry.xml.XmlException;
import java.io.ByteArrayInputStream;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
import javax.inject.Inject;

/**
 * Class that uploads a decrypted XML deposit report to ICANN's webserver.
 *
 * @see RdeReportAction
 */
public class RdeReporter {

  private static final FluentLogger logger = FluentLogger.forEnclosingClass();

  /**
   * @see
   *     ICANN Registry Interfaces - Interface details
   */
  private static final String REPORT_MIME = "text/xml";

  @Inject Retrier retrier;
  @Inject URLFetchService urlFetchService;

  @Inject @Config("rdeReportUrlPrefix") String reportUrlPrefix;
  @Inject @Key("icannReportingPassword") String password;
  @Inject RdeReporter() {}

  /** Uploads {@code reportBytes} to ICANN. */
  public void send(byte[] reportBytes) throws XmlException {
    XjcRdeReportReport report = XjcXmlTransformer.unmarshal(
        XjcRdeReportReport.class, new ByteArrayInputStream(reportBytes));
    XjcRdeHeader header = report.getHeader().getValue();

    // Send a PUT request to ICANN's HTTPS server.
    URL url = makeReportUrl(header.getTld(), report.getId());
    String username = header.getTld() + "_ry";
    String token = base64().encode(String.format("%s:%s", username, password).getBytes(UTF_8));
    final HTTPRequest req = new HTTPRequest(url, PUT, validateCertificate().setDeadline(60d));
    req.addHeader(new HTTPHeader(CONTENT_TYPE, REPORT_MIME));
    req.addHeader(new HTTPHeader(AUTHORIZATION, "Basic " + token));
    req.setPayload(reportBytes);
    logger.atInfo().log("Sending report:\n%s", new String(reportBytes, UTF_8));
    HTTPResponse rsp =
        retrier.callWithRetry(
            () -> {
              HTTPResponse rsp1 = urlFetchService.fetch(req);
              switch (rsp1.getResponseCode()) {
                case SC_OK:
                case SC_BAD_REQUEST:
                  break;
                default:
                  throw new RuntimeException("PUT failed");
              }
              return rsp1;
            },
            SocketTimeoutException.class);

    // Ensure the XML response is valid.
    XjcIirdeaResult result = parseResult(rsp.getContent());
    if (result.getCode().getValue() != 1000) {
      logger.atWarning().log(
          "PUT rejected: %d %s\n%s",
          result.getCode().getValue(), result.getMsg(), result.getDescription());
      throw new InternalServerErrorException(result.getMsg());
    }
  }

  /**
   * Unmarshals IIRDEA XML result object from {@link HTTPResponse} payload.
   *
   * @see
   *     ICANN Registry Interfaces - IIRDEA Result Object
   */
  private XjcIirdeaResult parseResult(byte[] responseBytes) throws XmlException {
    logger.atInfo().log("Received response:\n%s", new String(responseBytes, UTF_8));
    XjcIirdeaResponseElement response = XjcXmlTransformer.unmarshal(
        XjcIirdeaResponseElement.class, new ByteArrayInputStream(responseBytes));
    return response.getResult();
  }

  private URL makeReportUrl(String tld, String id) {
    try {
      return new URL(String.format("%s/%s/%s", reportUrlPrefix, canonicalizeHostname(tld), id));
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
}


text:
<?php

namespace Awesomite\ErrorDumper\Listeners;

use Awesomite\ErrorDumper\AbstractTestCase;
use Awesomite\ErrorDumper\TestHelpers\Beeper;
use Awesomite\ErrorDumper\Views\ViewInterface;

/**
 * @internal
 */
final class OnExceptionDevViewTest extends AbstractTestCase
{
    public function testTrigger()
    {
        $beeper = new Beeper();
        $listener = new OnExceptionDevView($this->createView($beeper));
        $this->assertSame(0, $beeper->countBeeps());
        $listener->onException(new \Exception());
        $this->assertSame(1, $beeper->countBeeps());
    }

    /**
     * @param Beeper $beeper
     *
     * @return ViewInterface
     */
    private function createView(Beeper $beeper)
    {
        $mock = $this->getMock('Awesomite\\ErrorDumper\\Views\\ViewInterface');
        $mock->method('display')->willReturnCallback(function () use ($beeper) {
            $beeper->beep();
        });

        return $mock;
    }
}


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
Put unreleased changes here
- Preprocessor flag `#if canImport(UIKit)` moved to wrap all UIKit related types.

## [4.6.0] - 2019-09-30
### Changed
- Adds support for Xcode11 & Swift 5.1

## [4.4.4] - 2019-01-03
### Changed
`fillContainer` now returns self to make it chainable

## [4.4.3] - 2019-01-03
### Changed
Fixes Equation api >= broken operator

## [4.4.2] - 2019-01-03
### Changed
Fixes view.bottom/top/right/leftConstraint possibly returning wrong constraint if the one you want is not there yet. (looking for constraint in the view itself after looking for it in the superview)
The fix makes sure it only looks for the constraint in the view itself for width and height constraints, that corresponds to constraints added via width/heightAnchors api.

## [4.4.1] - 2018-12-28
### Changed
- Make sure userAddedConstraints doesn't return layout margins. Fixes #104 Kudos @mpsnp 👏
- Code clean
- Removing deprecated tap helper (discussion here #42) alternatives : https://github.com/XCEssentials/ViewEvents

## [4.4.0] - 2018-09-18
### Changed
- Add support for Xcode10 & Swift 4.2

## [4.3.2] - 2018-09-09
### Added
- Adds support for baselines, kudos to [@bellebethcooper](https://github.com/bellebethcooper) for bringing this up 🚀

```swift
align(lastBaselines: label, label2, label3)
label.FirstBaseline == label.LastBaseline
```

### Changed
- Fixes "view.heightConstraint being nil" when set from IB or anchors.  Thanks [@leidi0129](https://github.com/leidi0129) for spotting the issue 👏

## [4.3.0] - 2018-04-04
### Changed
- Supports Xcode 9.3 & Swift 4.1

## [4.2.0] - 2018-01-09

### Changed
- `==` operator now works even if views are not at the same level in the view hierarchy
- `==` operator is now reflexive
- Re-opening Layout([array]) overload Some needed it for dynamic layout so it's back :)

## [4.1.0] - 2017-11-20

### Added
- UILayoutSupport & UILayoutGuide are now supported in Equation base api.

## [4.1.0] - 2017-09-29

### Changed
- Supports Xcode 9 & Swift 4

## [3.2.0] - 2017-06-14

### Changed
- Size constraints such as width and height can now be added without the need for a superview.

### Added
- New leadingConstraint & trailingConstraint property

- Kudos to [@trupin](https://github.com/trupin) and [@cowgp](https://github.com/cowgp) for this release 🎉

## [3.1.4] - 2017-06-14

### Added
- tvOS Support

## [3.1.4] - 2017-06-14

### Changed
- Built with Xcode 8.3.1


text:
<!DOCTYPE html>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

<title>Rails Application Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

    Home
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Pages

README_FOR_APP

Class and Module Index

AboutController

ApplicationController

ApplicationHelper

Authorization

CalendarController

CalendarHelper

DailyWod

DashboardHelper

DashboardsController

Event

EventColor

EventsController

EventsHelper

Exercise

ExerciseCategory

ExerciseWorkout

ExercisesController

ExercisesHelper

Goal

GoalsController

GoalsHelper

HealthRecord

HealthRecordsController

HealthRecordsHelper

HomeController

HomeHelper

InjuryRecord

InjuryRecordsController

InjuryRecordsHelper

PasswordResetsHelper

PersonalRecord

PersonalRecordsController

PersonalRecordsHelper

Profile

ProfileHelper

ProfilesController

SessionsController

SessionsHelper

ShareController

ShareHelper

StatsController

StatsHelper

Trainer

TrainerHelper

TrainersController

User

UserHelper

UserSessionHelper

UserSessionsHelper

Workout

WorkoutCategory

WorkoutHelper

WorkoutRecord

WorkoutRecordsController

WorkoutRecordsHelper

WorkoutsController

This is the API documentation for Rails Application Documentation.

[Validate]

Generated by RDoc 3.12.

Generated with the Darkfish Rdoc Generator 3.


text:
\c gptransfer_filespace_test

DROP TABLE t2;

\c template1

DROP DATABASE gptransfer_filespace_test;

DROP TABLESPACE ts_test;

DROP FILESPACE fs;


text:
package io.wcm.caravan.hal.comparison.impl.embedded.steps;

import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;

import java.util.List;
import java.util.function.Function;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.databind.node.ObjectNode;

import io.wcm.caravan.hal.comparison.HalComparisonContext;
import io.wcm.caravan.hal.comparison.HalComparisonStrategy;
import io.wcm.caravan.hal.comparison.HalDifference;
import io.wcm.caravan.hal.comparison.impl.context.HalComparisonContextImpl;
import io.wcm.caravan.hal.comparison.impl.difference.HalDifferenceListBuilder;
import io.wcm.caravan.hal.comparison.impl.embedded.EmbeddedProcessingStep;
import io.wcm.caravan.hal.comparison.impl.matching.MatchingAlgorithm;
import io.wcm.caravan.hal.comparison.impl.matching.MatchingResult;
import io.wcm.caravan.hal.comparison.impl.matching.SimpleIdMatchingAlgorithm;
import io.wcm.caravan.hal.resource.HalResource;

/**
 * Determines if embedded resources have been added/removed/reordered, and ensures that the following steps
 * will only find pairs of matching expected/actual resources in their lists.
 */
public class EmbeddedAdditionRemovalReorderingDetection implements EmbeddedProcessingStep {

  private final DefaultIdProvider defaultIdProvider = new DefaultIdProvider();

  private final HalComparisonStrategy strategy;

  /**
   * @param strategy that defines equivalence for specific hal resources
   */
  public EmbeddedAdditionRemovalReorderingDetection(HalComparisonStrategy strategy) {
    this.strategy = strategy;
  }

  @Override
  public List<HalDifference> apply(HalComparisonContextImpl context, List<HalResource> expected, List<HalResource> actual) {

    MatchingResult<HalResource> matchingResult = applyMatchingAlgorithm(context, expected, actual);

    // collect the re-ordering, addition and removal differences
    HalDifferenceListBuilder diffs = findDifferences(context, expected, actual, matchingResult);

    // all following processing steps should only process the embedded resources that were successfully
    // matched (and re-ordered), so the given lists will be completely replaced with the ones from the
    // matching result
    replaceItems(expected, matchingResult.getMatchedExpected());
    replaceItems(actual, matchingResult.getMatchedActual());

    return diffs.build();
  }

  private MatchingResult<HalResource> applyMatchingAlgorithm(HalComparisonContext context, List<HalResource> expected, List<HalResource> actual) {

    Function<HalResource, String> idProvider = defaultIfNull(strategy.getIdProvider(context), defaultIdProvider);

    MatchingAlgorithm<HalResource> algorithm = new SimpleIdMatchingAlgorithm<HalResource>(idProvider);

    return algorithm.findMatchingItems(expected, actual);
  }

  private HalDifferenceListBuilder findDifferences(HalComparisonContextImpl context, List<HalResource> expected, List<HalResource> actual,
      MatchingResult<HalResource> matchingResult) {

    HalDifferenceListBuilder diffs = new HalDifferenceListBuilder(context);
    String relation = context.getLastRelation();
    boolean reorderingRequired = matchingResult.areMatchesReordered();

    if (reorderingRequired) {
      String msg = "The embedded " + relation + " resources have a different order in the actual resource";
      diffs.reportReorderedEmbedded(msg, expected, actual);
    }

    for (HalResource removed : matchingResult.getRemovedExpected()) {
      String msg = "An embedded " + relation + getResourceTitle(removed) + "is missing in the actual resource";
      diffs.reportMissingEmbedded(msg, removed, expected.indexOf(removed));
    }

    for (HalResource added : matchingResult.getAddedActual()) {
      String msg = "An additional embedded " + relation + getResourceTitle(added) + "is present in the actual resource";
      diffs.reportAdditionalEmbedded(msg, added, actual.indexOf(added));
    }

    return diffs;
  }

  private static String getResourceTitle(HalResource hal) {
    ObjectNode removedJson = hal.getModel();
    String title = StringUtils.defaultIfEmpty(removedJson.path("title").asText(), removedJson.path("name").asText());
    String label = StringUtils.isNotBlank(title) ? " '" + title + "' " : " ";
    return label;
  }

  private static void replaceItems(List<HalResource> original, List<HalResource> remaining) {
    original.clear();

    original.addAll(remaining);
  }

  /**
   * If {@link HalComparisonStrategy#getIdProvider(HalComparisonContext)} is not implemented by the consumer,
   * the default behaviour is to identify embedded resources by their title property
   */
  static class DefaultIdProvider implements Function<HalResource, String> {

    @Override
    public String apply(HalResource resource) {
      return resource.getModel().path("title").asText();
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.hawkular.alerts</groupId>
    <artifactId>hawkular-alerts-actions-plugins</artifactId>
    <version>2.0.0.Final-SNAPSHOT</version>
  </parent>

  <artifactId>hawkular-alerts-actions-elasticsearch</artifactId>
  <packaging>jar</packaging>

  <name>Hawkular Alerting: Action Elasticsearch Plugin</name>

  <dependencies>

    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>rest</artifactId>
      <version>${version.org.elasticsearch.client}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.bazaarvoice.jolt</groupId>
      <artifactId>jolt-core</artifactId>
      <version>${version.com.bazaarvoice.jolt}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-actions-tests</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>


text:
var todoList = [];
var choice = prompt('What would you like to do?');

// add Todo in option 1
function addTodos() {
  todoList[todoList.length] = prompt('What would you like to add?');
  console.log(todoList);
}

// this is called by forEach in option 2
function printList(x, i) {
  console.log(i + ': ' + x);
}

// lists Todos in option 2
function listTodos() {
  var status = [];
  if (!todoList[0]) {
    console.log(`Your Todo list is empty`);
  } else {
    console.log(`***********************`);
    todoList.forEach(printList);
    console.log(`***********************`);
  }
}

while (choice !== '5') {
  if (choice === '1') {
    addTodos();
  } else if (choice === '2') {
    listTodos();
  } else if (choice === '3') {
    var cutItem = prompt('Index of item to delete');
    todoList.splice(cutItem, 1);
    console.log('Deleted Todo' + cutItem);
  } else if (choice === '4') {
    todoList = [];
    console.log('Todo list empty');
  }
  choice = prompt('What would you like to do now?');
}


text:
require 'mongo'
require 'time'

module Metricity
  module Server
    module Backends
      # MongoDB
      class Mongodb
        include Mongo

        def initialize(options)
          @options = options
          setup_connection
          check_indexes
        end

        def insert(object)
          time = convert_time(object['time'])
          item = @coll.find_one(type: 'memory_usage', timestamp_hourly: time)

          if item
            @coll.update({ timestamp_hourly: time, type: 'memory_usage' },
                         update_object(object))
          else
            @coll.insert(timestamp_hourly: time, type: object['type'],
                         objects: insert_object(object))
          end
        end

        def retrieve(type, time_from, time_to, range = 'minutes')
          data = @coll.find('type' => type,
                            'timestamp_hourly' =>
                            { '$gte' => time_from, '$lte' => time_to })
                       .sort('timestamp_hourly')

          results = []
          convert_series(data, range).each do |key, val|
            results.push(name: key, data: val)
          end
          results
        end

        def remove_all(type)
          @coll.remove('type' => type)
        end

        private

        def convert_series(data, range)
          tmp_data = {}
          data.each do |row|
            stamp = row['timestamp_hourly']
            row['objects'].each do |series|
              tmp_data[series[0]] = [] unless tmp_data[series[0]]
              if %w(minutes seconds).include?(range)
                tmp_data[series[0]].push(*convert_all(stamp, series))
              else
                tmp_data[series[0]].push(convert_samples(stamp, series))
              end
            end
          end
          tmp_data
        end

        def convert_samples(stamp, series)
          val = (series[1]['total_samples'] /
                 series[1]['num_samples']).to_i
          time = (convert_time(stamp).to_i.to_s + '000').to_i
          [time, val]
        end

        def convert_all(stamp, series)
          tmp_values = []
          series[1]['values'].each do |minutes, seconds|
            seconds.each do |second, val|
              time = convert_time(stamp, minutes.to_i, second.to_i)
              time = (time.to_i.to_s + '000').to_i
              tmp_values.push([time, val])
            end
          end
          tmp_values
        end

        def update_object(object)
          set = {}
          inc = {}
          object['objects'].each do |obj|
            set['objects.' + obj.first.to_s + '.values.' +
              object['time'].min.to_s + '.' + object['time'].sec.to_s] = obj[1]
            inc['objects.' + obj.first.to_s + '.num_samples'] = 1
            inc['objects.' + obj.first.to_s + '.total_samples'] = obj[1]
          end
          { '$set' => set, '$inc' => inc }
        end

        def insert_object(object)
          objects = {}
          object['objects'].each do |obj|
            objects = objects.merge(
              obj.first.to_s => {
                num_samples: 1, total_samples: obj[1],
                values: { object['time'].min.to_s => {
                  object['time'].sec.to_s => obj[1] } }
              })
          end
          objects
        end

        def convert_time(time, minutes = 0, seconds = 0)
          Time.utc(time.year,
                   time.month,
                   time.day,
                   time.hour,
                   minutes,
                   seconds)
        end

        def setup_connection
          Log.message('Connecting to MongoDB..') if @options[:verbose]
          @client = MongoClient.new
          @db = @client['metricity']
          @coll = @db['metrics']
          rescue Mongo::ConnectionFailure
            Log.message('Could not connect to MongoDB, is it running?', 'halt')
        end

        def check_indexes
          unless @db.index_information('metrics')['timestamp_hourly_index']
            Log.message('Index created for metrics on timestamp_hourly.')
            @coll.create_index('timestamp_hourly',
                               name: 'timestamp_hourly_index')
          end
        end
      end
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Trans. Br. mycol. Soc. 72(2): 334 (1979)

#### Original name
Linotexis burmanica Thaung

### Remarks
null


text:
package com.google.cloud.spring.pubsub.support.converter;

import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders;
import com.google.pubsub.v1.PubsubMessage;
import java.util.Collections;
import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.skyscreamer.jsonassert.JSONAssert;

/**
 * Tests for the Jackson message converter.
 *
 * @since 1.1
 */
class JacksonPubSubMessageConverterTests {

  private JacksonPubSubMessageConverter converter =
      new JacksonPubSubMessageConverter(new ObjectMapper());

  @Test
  void testString() throws JSONException {
    String str = "test 123";

    PubsubMessage pubsubMessage = this.converter.toPubSubMessage(str, null);

    JSONAssert.assertEquals("\"test 123\"", pubsubMessage.getData().toStringUtf8(), true);

    Object o = this.converter.fromPubSubMessage(pubsubMessage, String.class);

    assertThat(o).as("verify that deserialized object is equal to the original one").isEqualTo(str);
  }

  @Test
  void testPojo() throws JSONException {
    Contact contact = new Contact("Thomas", "Edison", 8817);

    PubsubMessage pubsubMessage = this.converter.toPubSubMessage(contact, null);

    JSONAssert.assertEquals(
        "{\"firstName\":\"Thomas\",\"lastName\":\"Edison\",\"zip\":8817}",
        pubsubMessage.getData().toStringUtf8(),
        true);

    Object o = this.converter.fromPubSubMessage(pubsubMessage, Contact.class);

    assertThat(o)
        .as("verify that deserialized object is equal to the original one")
        .isEqualTo(contact);
  }

  @Test
  void testToPubSubMessageWithNullPayload() throws JSONException {
    PubsubMessage pubsubMessage = this.converter.toPubSubMessage(null, null);
    assertThat(pubsubMessage).isNotNull();
    assertThat(pubsubMessage.getAttributesCount()).isZero();
  }

  @Test
  void testToPubSubMessageWithOrderingKeyHeader() throws JSONException {
    PubsubMessage pubsubMessage =
        this.converter.toPubSubMessage(
            null, Collections.singletonMap(GcpPubSubHeaders.ORDERING_KEY, "key1"));
    assertThat(pubsubMessage).isNotNull();
    assertThat(pubsubMessage.getOrderingKey()).isEqualTo("key1");
    assertThat(pubsubMessage.getAttributesCount()).isZero();
  }

  @Test
  void testToPubSubMessageWitHeader() throws JSONException {
    PubsubMessage pubsubMessage =
        this.converter.toPubSubMessage(null, Collections.singletonMap("custom-header", "val1"));
    assertThat(pubsubMessage).isNotNull();
    assertThat(pubsubMessage.getOrderingKey()).isEmpty();
    assertThat(pubsubMessage.getAttributesCount()).isOne();
    assertThat(pubsubMessage.getAttributesMap()).containsEntry("custom-header", "val1");
  }

  /** A test class containing data to test conversions. */
  static class Contact {
    String firstName;

    String lastName;

    int zip;

    public String getFirstName() {
      return this.firstName;
    }

    public void setFirstName(String firstName) {
      this.firstName = firstName;
    }

    public String getLastName() {
      return this.lastName;
    }

    public void setLastName(String lastName) {
      this.lastName = lastName;
    }

    public int getZip() {
      return this.zip;
    }

    public void setZip(int zip) {
      this.zip = zip;
    }

    Contact() {}

    Contact(String firstName, String lastName, int zip) {
      this.firstName = firstName;
      this.lastName = lastName;
      this.zip = zip;
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {

        return false;
      }
      Contact contact = (Contact) o;
      return this.zip == contact.zip
          && java.util.Objects.equals(this.firstName, contact.firstName)
          && java.util.Objects.equals(this.lastName, contact.lastName);
    }

    @Override
    public int hashCode() {
      return java.util.Objects.hash(this.firstName, this.lastName, this.zip);
    }
  }
}


text:
/* global AccountsAdmin */
"use strict";

Meteor.publish('roles', function (){
	return Meteor.roles.find({});
});

var positiveInteger = Match.Where(function(x) {
  check(x, Match.Integer);
  return x >= 0;
});

// var plainString = Match.Where(function(x) {
//   check(x, String);
//   return !!x.match(/^\w*$/);
// });

Meteor.publish('filteredUsers', function(options) {
  var self = this;
  check(options, Match.ObjectIncluding({
    filter: String,
    skip: Match.OneOf(positiveInteger, undefined, null),
    sort: Match.OneOf(Object, undefined, null)
    // sort: Match.OneOf(Match.ObjectIncluding({ direction: Match.OneOf(1, -1), key: String }), null, undefined)
  }));

  return AccountsAdmin.filteredUserQuery(self.userId, options);
});


text:
Store::Application.routes.draw do |map|
  resources :orders
  root :to => "orders#index"
end


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

namespace NuPattern.Runtime.Guidance
{
    /// <summary>
    /// Required attribute that guidance extensions must apply to register themselves
    /// with the guidance extension runtime.
    /// </summary>
    /// <remarks>
    /// This attribute must be applied at two locations: one is the
    /// class implementing the <see cref="IGuidanceExtension"/>, and the other
    /// is as an assembly-level attribute on all projects that
    /// collectively make up a guidance extension (i.e. commands libraries, etc.).
    /// </remarks>
    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
    public class GuidanceExtensionAttribute : Attribute, IGuidanceExtensionMetadata
    {
        private static readonly char[] FileNameInvalidChars = Path.GetInvalidFileNameChars();
        private string defaultName;

        /// <summary>
        /// Creates a new instance of the <see cref="GuidanceExtensionAttribute"/> class.
        /// </summary>
        public GuidanceExtensionAttribute(string extensionId)
        {
            this.ExtensionId = extensionId;
            this.DefaultName = RemoveInvalidFileChars(extensionId);
        }

        /// <summary>
        /// The guidance extension identifier.
        /// </summary>
        public string ExtensionId { get; private set; }

        /// <summary>
        /// Default name for instances of this guidance extension.
        /// </summary>
        public string DefaultName
        {
            get { return defaultName; }
            set { defaultName = RemoveInvalidFileChars(value); }
        }

        private static string RemoveInvalidFileChars(string name)
        {
            return new string(name.Where(c => !FileNameInvalidChars.Contains(c)).ToArray());
        }
    }
}


text:
using System;
using DataExplorer.Presentation.Core.Canvas.Items;

namespace DataExplorer.Presentation.Tests.Core.Canvas.Items
{
    public class FakeCanvasItem : CanvasItem
    {
        public override VisualItem Draw()
        {
            throw new NotImplementedException();
        }
    }
}


text:
"""A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
"""

# XXX The timefunc and delayfunc should have been defined as methods
# XXX so you can define new kinds of schedulers using subclassing
# XXX instead of having to define a module or class just to hold
# XXX the global state of your particular time and delay functions.

import time
import heapq
from collections import namedtuple
try:
    import threading
except ImportError:
    import dummy_threading as threading
from time import monotonic as _time

__all__ = ["scheduler"]

class Event(namedtuple('Event', 'time, priority, action, argument, kwargs')):
    def __eq__(s, o): return (s.time, s.priority) == (o.time, o.priority)
    def __lt__(s, o): return (s.time, s.priority) <  (o.time, o.priority)
    def __le__(s, o): return (s.time, s.priority) <= (o.time, o.priority)
    def __gt__(s, o): return (s.time, s.priority) >  (o.time, o.priority)
    def __ge__(s, o): return (s.time, s.priority) >= (o.time, o.priority)

_sentinel = object()

class scheduler:

    def __init__(self, timefunc=_time, delayfunc=time.sleep):
        """Initialize a new instance, passing the time and delay
        functions"""
        self._queue = []
        self._lock = threading.RLock()
        self.timefunc = timefunc
        self.delayfunc = delayfunc

    def enterabs(self, time, priority, action, argument=(), kwargs=_sentinel):
        """Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        """
        if kwargs is _sentinel:
            kwargs = {}
        event = Event(time, priority, action, argument, kwargs)
        with self._lock:
            heapq.heappush(self._queue, event)
        return event # The ID

    def enter(self, delay, priority, action, argument=(), kwargs=_sentinel):
        """A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        """
        time = self.timefunc() + delay
        return self.enterabs(time, priority, action, argument, kwargs)

    def cancel(self, event):
        """Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        """
        with self._lock:
            self._queue.remove(event)
            heapq.heapify(self._queue)

    def empty(self):
        """Check whether the queue is empty."""
        with self._lock:
            return not self._queue

    def run(self, blocking=True):
        """Execute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        """
        # localize variable access to minimize overhead
        # and to improve thread safety
        lock = self._lock
        q = self._queue
        delayfunc = self.delayfunc
        timefunc = self.timefunc
        pop = heapq.heappop
        while True:
            with lock:
                if not q:
                    break
                time, priority, action, argument, kwargs = q[0]
                now = timefunc()
                if time > now:
                    delay = True
                else:
                    delay = False
                    pop(q)
            if delay:
                if not blocking:
                    return time - now
                delayfunc(time - now)
            else:
                action(*argument, **kwargs)
                delayfunc(0)   # Let other threads run

    @property
    def queue(self):
        """An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        """
        # Use heapq to sort the queue rather than using 'sorted(self._queue)'.
        # With heapq, two events scheduled at the same time will show in
        # the actual order they would be retrieved.
        with self._lock:
            events = self._queue[:]
        return list(map(heapq.heappop, [events]*len(events)))


text:
using System;
using System.Collections.Generic;
using System.Linq;
using LeagueSharp;
using LeagueSharp.Common;
using SharpDX;
using Support.Evade;
using Support.Util;
using ActiveGapcloser = Support.Util.ActiveGapcloser;
using SpellData = LeagueSharp.SpellData;

namespace Support.Plugins
{
    public class Corki : PluginBase
    {
        public Corki()
        {
            Q = new Spell(SpellSlot.Q, 825f);
            E = new Spell(SpellSlot.E, 600f);
            R = new Spell(SpellSlot.R, 1300f);

            Q.SetSkillshot(0.3f, 120f, 1000f, false, SkillshotType.SkillshotCircle);
            E.SetSkillshot(0f, (float)(45 * Math.PI / 180), 1500, false, SkillshotType.SkillshotCone);
            R.SetSkillshot(0.2f, 40f, 2000f, true, SkillshotType.SkillshotLine);
        }

        public override void OnUpdate(EventArgs args)
        {
            if (ComboMode)
            {
                if (Q.CastCheck(Target, "ComboQ"))
                {
                    Q.Cast(Target);
                }
                if (E.CastCheck(Target, "ComboE"))
                {
                    E.Cast(Target);
                }

                if (R.CastCheck(Target, "ComboR"))
                {
                    R.Cast(Target);
                }
            }

            if (HarassMode)
            {
                if (E.CastCheck(Target, "HarassE"))
                {
                    E.Cast(Target);
                }
            }
        }

        public override void ComboMenu(Menu config)
        {
            config.AddBool("ComboQ", "Use Q", true);
            config.AddBool("ComboE", "Use E", true);
            config.AddBool("ComboR", "Use R", true);
        }

        public override void HarassMenu(Menu config)
        {
            config.AddBool("HarassQ", "Use Q", true);
            config.AddBool("HarassE", "Use E", true);
            config.AddBool("HarassR", "Use R", true);
        }

    }
}


text: little text-based rpg in batch


text:
<?php
require_once("include/adminheader.php");
require_once("../nano.php");
$obj = new Nano();
$categories = $obj->fetchdata(' categories ','',' order by cate_id desc ','');
if(isset($_POST['save']) && empty($_POST['cate_id'])){
	if(!empty($_POST['name'])){
		$cate = $obj->insertcategory($_POST['name'],$_POST['description'],$_POST['status'],$_POST['parent']);

		$status = 'success';
		header("Location: categories.php?status=".$status);

	}else{
		$status = 'error';
		header("Location: categories.php?status=".$status);
	}
}

if(isset($_POST['save']) && !empty($_POST['cate_id'])){
	if(!empty($_POST['name'])){
		$updatecate = $obj->updaterec("categories",array('name'=>$_POST['name'],'description'=>$_POST['description'],'status'=>$_POST['status'],'parentid'=>$_POST['parent']),' where cate_id = '.$_POST['cate_id'],NULL);
	if($updatecate){
		$status = 'success';
		header("Location: categories.php?status=".$status);
	}else{
		$status = 'error';
		header("Location: categories.php?status=".$status);
	}

	}else{
		$status = 'error';
		header("Location: categories.php?status=".$status);
	}
}
if(isset($_REQUEST['cateid'])){
	$caterecord = $obj->fetchdata(' categories ',' where cate_id = '.$_REQUEST['cateid'],'','');
	if(sizeof($caterecord) > 0){

		$cate_id = $caterecord[0]['cate_id'];
		$parentselected = $caterecord[0]['parentid'];
		$catename = $caterecord[0]['name'];
		$description = $caterecord[0]['description'];
		$status = $caterecord[0]['status'];
	}
}
?>
<link href="assets/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" />

Categories

            <?php
			if(isset($_REQUEST['status']) && $_REQUEST['status'] == 'success'){
				?>

                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
					Category Added

                <?php
			}
			if(isset($_REQUEST['status']) && $_REQUEST['status'] == 'error'){
				?>

                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
					Please enter complete detail of category

                <?php
			}
			if(isset($_REQUEST['status']) && $_REQUEST['status'] == 'delsuccess'){
				?>

                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
					Category Deleted

                <?php
			}
			?>

                            Add Category

                                    <form role="form" method="post">
                                    <input type="hidden" name="cate_id" value="<?=(isset($cate_id)) ? $cate_id : ""?>" />

                                            Parent Category
                                            <select name="parent" class="form-control">
                                            <option value="0">--Itself Parent--</option>
                                            <?php
											$parent_categories = $obj->fetchdata(' categories ','',' order by name ','');
											foreach($parent_categories as $row){
												?>
                                                <option value="<?=$row['cate_id']?>" <?=(isset($parentselected) && $parentselected == $row['cate_id']) ? "selected='selected'" : "";?>><?=$row['name']?></option>
                                                <?php
											}
											?>
                                            </select>

                                            Name
                                            <input type="text" name="name" class="form-control" value="<?=(isset($catename)) ? $catename : ""?>">

                                            Description
                                            <textarea name="description" class="form-control" rows="3"><?=(isset($description)) ? $description : ""?></textarea>

                                            Status
                                            <select name="status" class="form-control">
                                                <option value="1" <?=(isset($status) && $status == 1) ? "selected='selected'" : ""?>>Active</option>
                                                <option value="0" <?=(isset($status) && $status == 0) ? "selected='selected'" : ""?>>Block</option>
                                            </select>

                                        <input type="submit" name="save" class="btn btn-primary" value="Save">
                                        <button type="reset" class="btn btn-success">Reset Button</button>

                                    </form>

                                         Categories listing

                                                        Name
                                                        Description
                                                        Parent
                                                        Status
                                                        Action

                                                <?php
												if(sizeof($categories) > 0){
													$colr = '';
													$no = 1;
													foreach($categories as $cat){
														if($no%2 == 0){
															$colr = 'odd gradeX';
														}else{
															$colr = 'even gradeC';
														}
														$parent = $obj->fetchdata(' categories ',' where cate_id = '.$cat['parentid'],'','');
														?>
                                                         <tr class="<?=$colr;?>">
                                                            <?=$cat['name']?>
                                                            <?=$cat['description']?>
                                                            <?=($cat['parentid'] > 0) ? $parent[0]['name'] : "Itsel parent";?>
                                                            <?=($cat['status'] == 1) ? "Active" : "Block";?>

                                                             <a href="categories.php?cateid=<?=$cat['cate_id']?>"><button type="button" class="btn btn-success btn-circle"></button>

                            <a href="catedelete.php?id=<?=$cat['cate_id'];?>" onclick=" return confirm('Are you sure want to delete this ?')"><button type="button" class="btn btn-warning btn-circle"></button>

                                                        <?php
														$no++;
													}
												}
												?>

   <?php
require_once("include/footer.php");
?>


text:
require 'spec_helper'

describe Saorin::Dumpable do
  describe '#to_msgpack' do
    it { expect(Saorin::Dumpable.instance_methods).to include(:to_msgpack) }
  end
end


text:
package com.caffinc.hermes.web

import org.json4s.{DefaultFormats, Formats}
import org.scalatra.ScalatraServlet
import org.scalatra.swagger.{ApiInfo, NativeSwaggerBase, Swagger}

class ResourcesApp(implicit val swagger: Swagger) extends ScalatraServlet with NativeSwaggerBase {
  implicit override val jsonFormats: Formats = DefaultFormats
}

class HermesSwagger extends Swagger("2.0", "0.1", new ApiInfo("Hermes API", "Hermes API", "", "", "", ""))


text:
import d3 from 'd3';
import dataJoinUtil from '../util/dataJoin';
import {noop} from '../util/fn';
import xyBase from './xyBase';

export default function() {

    var decorate = noop;

    var base = xyBase();

    var lineData = d3.svg.line()
        .defined(base.defined)
        .x(base.x)
        .y(base.y);

    var dataJoin = dataJoinUtil()
        .selector('path.line')
        .element('path')
        .attr('class', 'line');

    var line = function(selection) {

        selection.each(function(data, index) {

            var path = dataJoin(this, [data]);
            path.attr('d', lineData);

            decorate(path, data, index);
        });
    };

    line.decorate = function(x) {
        if (!arguments.length) {
            return decorate;
        }
        decorate = x;
        return line;
    };

    d3.rebind(line, base, 'xScale', 'xValue', 'yScale', 'yValue');
    d3.rebind(line, dataJoin, 'key');
    d3.rebind(line, lineData, 'interpolate', 'tension');

    return line;
}


text:
function User() {
    //Attributes declaration
    this.nickname;
    this.user_score;
    this.firstname;
    this.lastname;
    this.email;
    this.password;
    this.postalcode;

    //Methods declaration
    this.construct = function (nickname, user_score, firstname, lastname, email, password, postalcode){
        this.setNickname(nickname);
        this.setUser_score(user_score);
        this.setFirstname(firstname);
        this.setLastname(lastname);
        this.setEmail(email);
        this.setPassword(password);
        this.setPostalcode(postalcode);
    };

    // Getter and setter
    this.setNickname = function (nickname) {
        this.nickname = nickname;
    };
    this.setUser_score = function (user_score) {
        this.user_score = user_score;
    };
    this.setFirstname = function (firstname) {
        this.firstname = firstname;
    };
    this.setLastname = function (lastname) {
        this.lastname = lastname;
    };
    this.setEmail = function (email) {
        this.email = email;
    };
    this.setPassword = function (password) {
        this.password = password;
    };
    this.setPostalcode = function (postalcode) {
        this.postalcode = postalcode;
    };

    this.getNickname = function () {
        return this.nickname;
    };
    this.getUser_score = function () {
        return this.user_score;
    };
    this.getFirstname = function () {
        return this.firstname;
    };
    this.getLastname = function () {
        return this.lastname;
    };
    this.getEmail = function () {
        return this.email;
    };
    this.getPassword = function () {
        return this.password;
    };
    this.getPostalcode = function () {
        return this.postalcode;
    };

    /*this.arrayToString = function (arrayReviewObj)
    {
        var reviewString = "";
        $.each(arrayReviewObj, function (index, review) {
            reviewString += "stock number " + (index + 1) + ":" + review.toString() + "\n";
        });
        return reviewString;

    };

    this.toString = function ()
    {
        var reviewString = "REVIEW - ID=" + this.getId() + " RATE=" + this.getRate() + " OPINION=" + this.getOpinion();
        reviewString += " EMAIL=" + this.getEmail();
        return reviewString;
    };*/
} // END User class


text:
package com.jonatantierno.trellotimer.trellorequests;

import com.google.api.client.auth.oauth2.Credential;
import com.jonatantierno.trellotimer.CredentialFactory;
import com.jonatantierno.trellotimer.StatusStore;
import com.jonatantierno.trellotimer.model.Item;
import com.jonatantierno.trellotimer.model.ListType;

import java.io.IOException;
import java.util.List;

import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;

/**
 * Performs the connections to the Trello API via Retrofit.
 * Created by jonatan on 15/04/15.
 */
public class TTConnections {
    private static final String BASE_TRELLO_URL = "https://api.trello.com";

    private final StatusStore store;

    /**
     * Public constructor
     * @param statusStore store
     */
    public TTConnections(StatusStore statusStore) {
        store = statusStore;
    }

    public void getBoards(final CredentialFactory credentialFactory, final TTCallback<List<Item>> callback){
        new Thread(new Runnable(){
            @Override
            public void run() {
                Credential credential = getCredential(credentialFactory, callback);

                RestAdapter boardRestAdapter = buildAdapter();
                GetAllBoardsSrv getAllBoardsSrv = boardRestAdapter.create(GetAllBoardsSrv.class);

                getAllBoardsSrv.getBoards(CredentialFactory.CLIENT_ID, credential.getAccessToken(), new Callback<List<Item>>() {
                    @Override
                    public void success(List<Item> list, Response response) {
                        callback.success(list);
                    }

                    @Override
                    public void failure(RetrofitError error) {
                        callback.failure(error.getCause());
                    }
                });
            }
        }).start();
    }

    public void getLists(final CredentialFactory credentialFactory, final TTCallback<List<Item>> callback) {
        new Thread(new Runnable(){
            @Override
            public void run() {
                Credential credential = getCredential(credentialFactory, callback);

                RestAdapter boardRestAdapter = buildAdapter();
                GetAllListsSrv getAllListsSrv = boardRestAdapter.create(GetAllListsSrv.class);

                final String boardId = store.getBoardId();

                assert boardId != null;

                getAllListsSrv.getLists(CredentialFactory.CLIENT_ID, credential.getAccessToken(), boardId, new Callback<List<Item>>() {
                    @Override
                    public void success(List<Item> list, Response response) {
                        callback.success(list);
                    }

                    @Override
                    public void failure(RetrofitError error) {
                        callback.failure(error.getCause());
                    }
                });
            }
        }).start();
    }

    public void getTasks(final ListType listType, final CredentialFactory credentialFactory, final TTCallback<List<Item>> callback) {
        new Thread(new Runnable(){
            @Override
            public void run() {
                Credential credential = getCredential(credentialFactory, callback);

                RestAdapter boardRestAdapter = buildAdapter();
                GetTasksSrv getTasksSrv = boardRestAdapter.create(GetTasksSrv.class);

                final String listId = store.getListId(listType);

                assert listId != null;

                getTasksSrv.getCards(CredentialFactory.CLIENT_ID, credential.getAccessToken(), listId, new Callback<List<Item>>() {
                    @Override
                    public void success(List<Item> list, Response response) {
                        callback.success(list);
                    }

                    @Override
                    public void failure(RetrofitError error) {
                        callback.failure(error.getCause());
                    }
                });
            }
        }).start();
    }

    public void moveToList(final String cardId, final ListType listType, final CredentialFactory credentialFactory, final TTCallback<List<Item>> callback) {
        new Thread(new Runnable(){
            @Override
            public void run() {
                Credential credential = getCredential(credentialFactory, callback);

                RestAdapter boardRestAdapter = buildAdapter();
                MoveToListSrv srv = boardRestAdapter.create(MoveToListSrv.class);

                final String listId = store.getListId(listType);

                assert listId != null;

                srv.moveToList(CredentialFactory.CLIENT_ID, credential.getAccessToken(), cardId, listId, new Callback<Void>() {
                    @Override
                    public void success(Void v, Response response2) {
                        callback.success(null);
                    }

                    @Override
                    public void failure(RetrofitError error) {
                        callback.failure(error);
                    }
                });
            }
        }).start();
    }

    public void addComment(final String cardId, final String comment, final CredentialFactory credentialFactory, final TTCallback<List<Item>> callback) {
        new Thread(new Runnable(){
            @Override
            public void run() {
                Credential credential = getCredential(credentialFactory, callback);

                RestAdapter boardRestAdapter = buildAdapter();
                AddCommentSrv srv = boardRestAdapter.create(AddCommentSrv.class);

                srv.addComment(CredentialFactory.CLIENT_ID, credential.getAccessToken(), cardId, comment, new Callback<Void>() {
                    @Override
                    public void success(Void v, Response response2) {
                        callback.success(null);
                    }

                    @Override
                    public void failure(RetrofitError error) {
                        callback.failure(error);
                    }
                });
            }
        }).start();
    }

    private Credential getCredential(CredentialFactory credentialFactory, TTCallback<List<Item>> callback) {
        Credential credential = null;
        try {
            credential = credentialFactory.getCredential();
        } catch (IOException e) {
            callback.failure(e);
        }
        assert credential !=null;
        return credential;
    }

    private RestAdapter buildAdapter() {
        return new RestAdapter.Builder().setEndpoint(BASE_TRELLO_URL).build();
    }

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Solicitud_aprobada_pasajes extends CI_Controller {

	function __construct(){
		parent::__construct();
		$this->load->model('observaciones_pasajes_model');
	}

	public function index(){
		$this->load->view('templates/header');
		$this->load->view('pasajes/solicitud_aprobada_pasajes');
		$this->load->view('templates/footer');
	}

	public function tabla_observaciones(){
		$this->load->view('pasajes/aprobada_pasajes/tabla_aprobada_pasajes');
	}

}
?>


text: Tut ils umans naschan libers ed eguals en dignitad ed en dretgs. Els èn dotads cun raschun e conscienza e duain agir in vers l'auter en spiert da fraternitad.


text:
'use strict';

var should = require('should'),
    request = require('supertest'),
    app = require('../../server'),
    mongoose = require('mongoose'),
    User = mongoose.model('User'),
    Article = mongoose.model('Article'),
    agent = request.agent(app);

/**
 * Globals
 */
var credentials, user, article;

/**
 * Article routes tests
 */
describe('Youtrack projects integration tests ', function() {
    beforeEach(function(done) {
       /* // Create user credentials
        credentials = {
            username: 'username',
            password: 'password'
        };

        // Create a new user
        user = new User({
            firstName: 'Full',
            lastName: 'Name',
            displayName: 'Full Name',
            email: 'test@test.com',
            username: credentials.username,
            password: credentials.password,
            provider: 'local'
        });

        // Save a user to the test db and create new article
        user.save(function() {
            article = {
                title: 'Article Title',
                content: 'Article Content'
            };

            done();
        });*/

        done();
    });

    it('should be able to get a list of project from youtrack', function(done) {
        // Create new article model instance

            // Request projects
            request(app).get('/projects')
                .end(function(req, res) {
                    // Set assertion
                    res.body.should.be.an.Array;

                    // Call the assertion callback
                    done();
                });

    });

    afterEach(function(done) {
        /*User.remove().exec();
        Article.remove().exec();*/
        done();
    });
});


text:
require 'spec_helper'

describe DpllSolver::Heuristics::MostFrequentLiteral do
  let(:var1) { DpllSolver::Formulas::Variable.new("x1") }
  let(:var2) { DpllSolver::Formulas::Variable.new("x2") }
  let(:lit1) { DpllSolver::Formulas::Literal.new(var1, true)}
  let(:n_lit1) { DpllSolver::Formulas::Literal.new(var1, false)}
  let(:lit2) { DpllSolver::Formulas::Literal.new(var2, true)}
  let(:c1) { Set.new([DpllSolver::Formulas::Clause.new(lit1, lit2), DpllSolver::Formulas::Clause.new(lit1)])}
  let(:c2) { Set.new([DpllSolver::Formulas::Clause.new(lit1, lit2), DpllSolver::Formulas::Clause.new(n_lit1)])}
  let(:c3) { Set.new([DpllSolver::Formulas::Clause.new(n_lit1, lit2), DpllSolver::Formulas::Clause.new(n_lit1)])}

  it 'should return the most frequent literal in clause set' do
    expect{ DpllSolver::Heuristics::MostFrequentLiteral.choose_literal(Set.new)}.to raise_error
    expect(DpllSolver::Heuristics::MostFrequentLiteral.choose_literal(c1)).to eql lit1
    expect{ DpllSolver::Heuristics::MostFrequentLiteral.choose_literal(c2)}.not_to raise_error
    expect(DpllSolver::Heuristics::MostFrequentLiteral.choose_literal(c3)).to eql n_lit1
  end
end


text:
Minecraft - Rastrack
Martin O'Hanlon (martin@ohanlonweb.com)
http://www.stuffaboutcode.com
-------------------------------------------------------------------------------

A program which parses data from rastrack and creates raspberries on the
 Ordnance Survey minecraft map
http://http://www.stuffaboutcode.com/2013/09/minecraft-ordnance-survey-map-rastrack.html

------------------------------------------------------------------------------

Version history
0.1 - first beta release

-------------------------------------------------------------------------------


text:
@interface Employee : Party

@end


text:
<!doctype html>

        {% block head %}

        <link href="/static/css/bootstrap.min.css" rel="stylesheet">

        <link href="/static/css/clean-blog.min.css" rel="stylesheet">

        <link href="/static/css/font-awesome.min.css" rel="stylesheet" type="text/css">
        <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

        <link href="/static/css/main.css" rel="stylesheet">

        <meta charset="utf-8">

        <title>{% block title %}Computer Geekery{% endblock %}</title>
        {% endblock %}

        {% block header %}
            {% set active_page = active_page|default('') %}

Computer Geekery

                                A Blog for Software Engineering Musings

        {% endblock %}

        {% block navigation %}
            {% include 'navigation.html' %}
        {% endblock %}

            {% block content %}
            {% endblock %}

                {% block footer %}

Copyright © Computer Geekery 2017

                {% endblock %}

        {% block javascript_libraries %}

        {% endblock %}

        {% block page_js %}
        {% endblock %}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>airconsole-test</title>

  <link rel="stylesheet" href="css/main.css">


text:
'use strict';

var invariant = require('invariant');

/**
 * Return the lowest common ancestor of A and B, or null if they are in
 * different trees.
 */
function getLowestCommonAncestor(instA, instB) {
  invariant('_nativeNode' in instA, 'getNodeFromInstance: Invalid argument.');
  invariant('_nativeNode' in instB, 'getNodeFromInstance: Invalid argument.');

  var depthA = 0;
  for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
    depthA++;
  }
  var depthB = 0;
  for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
    depthB++;
  }

  // If A is deeper, crawl up.
  while (depthA - depthB > 0) {
    instA = instA._nativeParent;
    depthA--;
  }

  // If B is deeper, crawl up.
  while (depthB - depthA > 0) {
    instB = instB._nativeParent;
    depthB--;
  }

  // Walk in lockstep until we find a match.
  var depth = depthA;
  while (depth--) {
    if (instA === instB) {
      return instA;
    }
    instA = instA._nativeParent;
    instB = instB._nativeParent;
  }
  return null;
}

/**
 * Return if A is an ancestor of B.
 */
function isAncestor(instA, instB) {
  invariant('_nativeNode' in instA, 'isAncestor: Invalid argument.');
  invariant('_nativeNode' in instB, 'isAncestor: Invalid argument.');

  while (instB) {
    if (instB === instA) {
      return true;
    }
    instB = instB._nativeParent;
  }
  return false;
}

/**
 * Return the parent instance of the passed-in instance.
 */
function getParentInstance(inst) {
  invariant('_nativeNode' in inst, 'getParentInstance: Invalid argument.');

  return inst._nativeParent;
}

/**
 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
 */
function traverseTwoPhase(inst, fn, arg) {
  var path = [];
  while (inst) {
    path.push(inst);
    inst = inst._nativeParent;
  }
  var i;
  for (i = path.length; i-- > 0;) {
    fn(path[i], false, arg);
  }
  for (i = 0; i < path.length; i++) {
    fn(path[i], true, arg);
  }
}

module.exports = {
  isAncestor: isAncestor,
  getLowestCommonAncestor: getLowestCommonAncestor,
  getParentInstance: getParentInstance,
  traverseTwoPhase: traverseTwoPhase,
};


text:
export function assert (condition, message) {
  if (!condition) {
    throw new Error(`[Apify] ${message}`)
  }
}

export function warn (condition, message) {
  if (process.env.NODE_ENV !== 'production' && !condition) {
    typeof console !== 'undefined' && console.warn(`[Apify] ${message}`)
  }
}


text:
<?php

namespace DvsaMotApi\Controller;

use DvsaCommon\Auth\Assertion\RefuseToTestAssertion;
use DvsaCommon\Auth\MotAuthorisationServiceInterface;
use DvsaCommon\Date\DateUtils;
use DvsaCommon\Dto\Common\MotTestDto;
use DvsaCommon\Dto\Site\VehicleTestingStationDto;
use DvsaCommon\Enum\SiteContactTypeCode;
use DvsaCommon\Utility\ArrayUtils;
use DvsaCommonApi\Controller\AbstractDvsaRestfulController;
use DvsaCommonApi\Model\ApiResponse;
use DvsaCommonApi\Transaction\TransactionAwareInterface;
use DvsaCommonApi\Transaction\TransactionAwareTrait;
use DvsaDocument\Service\Document\DocumentService;
use DvsaMotApi\Service\CertificateCreationService;
use OrganisationApi\Service\Mapper\PersonMapper;
use OrganisationApi\Service\OrganisationService;
use SiteApi\Service\SiteService;
use VehicleApi\Service\VehicleService;

/**
 * Class MotTestRefusalController.
 */
class MotTestRefusalController extends AbstractDvsaRestfulController implements TransactionAwareInterface
{
    use TransactionAwareTrait;

    /**
     * @param array $data
     *
     * @return void|\Zend\View\Model\JsonModel
     */
    public function create($data)
    {
        // ensure data is array.
        $data = (array) $data;

        $identity = $this->getIdentity();

        // Create the input vars from the post data
        $vehicleId = $data['vehicleId'];

        $site = $this->getVtsData($data['siteId']);
        $vts = [
            'name' => '',
            'address' => '',
            'siteNumber' => '',
            'dualLanguage' => false,
        ];
        $organisation = null;

        /** @var MotAuthorisationServiceInterface $authorisationService */
        $authorisationService = $this->getServiceLocator()->get('DvsaAuthorisationService');
        $refuseToTestAssertion = new RefuseToTestAssertion($authorisationService);
        $refuseToTestAssertion->assertGranted($data['siteId']);

        //  --   Get vehicle data    --
        $vehicleService = $this->getServiceLocator()->get(VehicleService::class);
        /** @var \DvsaCommon\Dto\Vehicle\VehicleDto $vehicle */
        $vehicle = $vehicleService->getVehicleDto($vehicleId);

        //  --  Get reason for cancel   --
        $rfrId = ArrayUtils::tryGet($data, 'rfrId');
        $reasonForRefusal = current($this->getCatalog()->getReasonsForRefusal(['id' => $rfrId]));

        //  --  Create the data for the mapper  --
        if ($site) {
            $contact = $site->getContactByType(SiteContactTypeCode::BUSINESS);
            $vts = [
                'name' => $site->getName(),
                'address' => $contact->getAddress()->toArray(),
                'siteNumber' => $site->getSiteNumber(),
                'dualLanguage' => $site->isDualLanguage(),
            ];
            $organisation = $site->getOrganisation();
        }
        $person = $identity->getPerson();
        $mapperData = (new MotTestDto())
            ->setVehicle($vehicle)
            ->setTester((new PersonMapper())->toDto($person))
            ->setOrganisation($organisation)
            ->setReasonForCancel($reasonForRefusal)
            ->setIssuedDate(DateUtils::nowAsUserDateTime())
            ->setMake($vehicle->getMakeName())
            ->setModel($vehicle->getModelName())
            ->setVehicleTestingStation($vts)
            ->setPrimaryColour($vehicle->getColour())
            ->setSecondaryColour($vehicle->getColourSecondary())
            ->setCountryOfRegistration($vehicle->getCountryOfRegistration())
            ->setVehicleClass($vehicle->getVehicleClass())
            ->setVin($vehicle->getVin())
            ->setRegistration($vehicle->getRegistration())
            ->setMake($vehicle->getMakeName())
            ->setModel($vehicle->getModelName());

        //  -- Create the snapshot  --
        /** @var CertificateCreationService $certificateCreationService */
        $certificateCreationService = $this->getServiceLocator()->get(CertificateCreationService::class);
        $result = $certificateCreationService->createFailCertificate(
            null, $mapperData, $this->getUserId()
        );

        $responseData = [
            'documentId' => $result->getDocument(),
        ];

        return ApiResponse::jsonOk($responseData);
    }

    /**
     * Get the Vehicle Testing Station data.
     *
     * @param int $vtsId the vehicle testing station ID
     *
     * @return VehicleTestingStationDto|false this will return an associative array if VTS exists, false
     *                                        otherwise
     */
    protected function getVtsData($vtsId)
    {
        if (is_int($vtsId) && $vtsId > 0) {
            /** @var SiteService $service */
            $service = $this->getServiceLocator()->get(SiteService::class);

            return $service->getSite($vtsId);
        }

        return false;
    }

    /**
     * @return \DvsaDocument\Service\Document\DocumentService
     */
    protected function getDocumentService()
    {
        $service = $this->getServiceLocator()->get(DocumentService::class);
        return $service;
    }
}


text:
'use strict';

const Async = require('async');
const Lab = require('lab');
const Code = require('code');
const Config = require('../../../config');
const Proxyquire = require('proxyquire');

const lab = exports.lab = Lab.script();
const stub = {
    AdminGroup: {}
};
const Admin = Proxyquire('../../../server/models/admin', {
    './admin-group': stub.AdminGroup
});
const AdminGroup = require('../../../server/models/admin-group');

lab.experiment('Admin Class Methods', () => {

    lab.before((done) => {

        Admin.connect(Config.get('/hapiMongoModels/mongodb'), (err, db) => {

            done(err);
        });
    });

    lab.after((done) => {

        Admin.deleteMany({}, (err, count) => {

            Admin.disconnect();

            done(err);
        });
    });

    lab.test('it returns a new instance when create succeeds', (done) => {

        Admin.create('Ren Höek', (err, result) => {

            Code.expect(err).to.not.exist();
            Code.expect(result).to.be.an.instanceOf(Admin);

            done();
        });
    });

    lab.test('it correctly sets the middle name when create is called', (done) => {

        Admin.create('Stimpson J Cat', (err, admin) => {

            Code.expect(err).to.not.exist();
            Code.expect(admin).to.be.an.instanceOf(Admin);
            Code.expect(admin.name.middle).to.equal('J');

            done();
        });
    });

    lab.test('it returns an error when create fails', (done) => {

        const realInsertOne = Admin.insertOne;
        Admin.insertOne = function () {

            const args = Array.prototype.slice.call(arguments);
            const callback = args.pop();

            callback(Error('insert failed'));
        };

        Admin.create('Stimpy Cat', (err, result) => {

            Code.expect(err).to.be.an.object();
            Code.expect(result).to.not.exist();

            Admin.insertOne = realInsertOne;

            done();
        });
    });

    lab.test('it returns a result when finding by username', (done) => {

        Async.auto({
            admin: function (cb) {

                Admin.create('Ren Höek', cb);
            },
            adminUpdated: ['admin', function (cb, results) {

                const fieldsToUpdate = {
                    $set: {
                        user: {
                            id: '95EP150D35',
                            name: 'ren'
                        }
                    }
                };

                Admin.findByIdAndUpdate(results.admin._id, fieldsToUpdate, cb);
            }]
        }, (err, results) => {

            if (err) {
                return done(err);
            }

            Admin.findByUsername('ren', (err, admin) => {

                Code.expect(err).to.not.exist();
                Code.expect(admin).to.be.an.instanceOf(Admin);

                done();
            });
        });
    });
});

lab.experiment('Admin Instance Methods', () => {

    lab.before((done) => {

        Admin.connect(Config.get('/hapiMongoModels/mongodb'), (err, db) => {

            done(err);
        });
    });

    lab.after((done) => {

        Admin.deleteMany({}, (err, result) => {

            Admin.disconnect();

            done(err);
        });
    });

    lab.test('it returns false when groups are not found', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            }
        });

        Code.expect(admin.isMemberOf('sales')).to.equal(false);

        done();
    });

    lab.test('it returns boolean values for set group memberships', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales',
                support: 'Support'
            }
        });

        Code.expect(admin.isMemberOf('sales')).to.equal(true);
        Code.expect(admin.isMemberOf('support')).to.equal(true);

        done();
    });

    lab.test('it exits early when hydrating groups where groups are missing', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            }
        });

        admin.hydrateGroups((err) => {

            Code.expect(err).to.not.exist();

            done();
        });
    });

    lab.test('it exits early when hydrating groups where hydrated groups exist', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales'
            },
            _groups: {
                sales: new AdminGroup({
                    _id: 'sales',
                    name: 'Sales',
                    permissions: {
                        SPACE_MADNESS: true,
                        UNTAMED_WORLD: false
                    }
                })
            }
        });

        admin.hydrateGroups((err) => {

            Code.expect(err).to.not.exist();

            done();
        });
    });

    lab.test('it returns an error when hydrating groups and find by id fails', (done) => {

        const realFindById = stub.AdminGroup.findById;
        stub.AdminGroup.findById = function (id, callback) {

            callback(Error('find by id failed'));
        };

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales'
            }
        });

        admin.hydrateGroups((err) => {

            Code.expect(err).to.be.an.object();

            stub.AdminGroup.findById = realFindById;

            done();
        });
    });

    lab.test('it successfully hydrates groups', (done) => {

        const realFindById = stub.AdminGroup.findById;
        stub.AdminGroup.findById = function (id, callback) {

            const group = new AdminGroup({
                _id: 'sales',
                name: 'Sales',
                permissions: {
                    SPACE_MADNESS: true,
                    UNTAMED_WORLD: false
                }
            });

            callback(null, group);
        };

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales'
            }
        });

        admin.hydrateGroups((err) => {

            Code.expect(err).to.not.exist();

            stub.AdminGroup.findById = realFindById;

            done();
        });
    });

    lab.test('it exits early when the permission exists on the admin', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            permissions: {
                SPACE_MADNESS: true,
                UNTAMED_WORLD: false
            }
        });

        admin.hasPermissionTo('SPACE_MADNESS', (err, permit) => {

            Code.expect(err).to.not.exist();
            Code.expect(permit).to.equal(true);

            done();
        });
    });

    lab.test('it returns an error when checking permission and hydrating groups fails', (done) => {

        const realHydrateGroups = Admin.prototype.hydrateGroups;
        Admin.prototype.hydrateGroups = function (callback) {

            callback(Error('hydrate groups failed'));
        };

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales'
            }
        });

        admin.hasPermissionTo('SPACE_MADNESS', (err) => {

            Code.expect(err).to.be.an.object();

            Admin.prototype.hydrateGroups = realHydrateGroups;

            done();
        });
    });

    lab.test('it returns correct permission from hydrated group permissions', (done) => {

        const admin = new Admin({
            name: {
                first: 'Ren',
                last: 'Höek'
            },
            groups: {
                sales: 'Sales',
                support: 'Support'
            }
        });

        admin._groups = {
            sales: new AdminGroup({
                _id: 'sales',
                name: 'Sales',
                permissions: {
                    UNTAMED_WORLD: false,
                    WORLD_UNTAMED: true
                }
            }),
            support: new AdminGroup({
                _id: 'support',
                name: 'Support',
                permissions: {
                    SPACE_MADNESS: true,
                    MADNESS_SPACE: false
                }
            })
        };

        Async.auto({
            test1: function (cb) {

                admin.hasPermissionTo('SPACE_MADNESS', cb);
            },
            test2: function (cb) {

                admin.hasPermissionTo('UNTAMED_WORLD', cb);
            }
        }, (err, results) => {

            Code.expect(err).to.not.exist();
            Code.expect(results.test1).to.equal(true);
            Code.expect(results.test2).to.equal(false);

            done(err);
        });
    });
});


text:
import React from 'react';
import axios from 'axios';
import ReactMarkdown from 'react-markdown';
import mediumZoom from 'medium-zoom';

import Layout from '../../components/Layout/index';
import ProjectTitle from '../../components/Work/ProjectTitle';
import EditProject from '../../components/Work/EditProject';
import UILoader from '../../components/Home/UILoader';

class ProjectAir extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      project: {},
      loading: true
    };
    this.fetchProjectDetail = this.fetchProjectDetail.bind(this);
  }

  componentDidMount() {
    this.fetchProjectDetail();
  }

  fetchProjectDetail() {
    axios.get('/api/project/air').then(response => {
      this.setState({ project: response.data, loading: false });
      mediumZoom('.work-detail-wrapper img',{ margin: 70 })
    }).catch(error => {
      this.setState({ loading: false });
    });
  }

  render() {
    const content = this.state.project.content;
    return (
      <Layout title={`Airport Info Repo - Karthik`}>

          <ProjectTitle heading="Airport Info Repo" date="September, 2016" bgColor="bg-air" />

                <UILoader loading={this.state.loading} />
                {content ? <ReactMarkdown source={content} /> : ''}

          <EditProject project={this.state.project} />

      </Layout>
    );
  }
}

export default ProjectAir


text:
layout: post
external_url: http://www.econopoly.ilsole24ore.com/2015/09/01/vuoi-usare-i-bitcoin-ecco-cosa-ne-pensa-il-fisco-in-italia-e-in-europa/?uuid=b4hM5iSm
img: http://www.assob.it/wp-content/uploads/2015/07/il-sole-24.png
membro: Massimo Chiriatti e Stefano capaccioli
ruolo: Responsabili dei rapporti con I media e con le autorità fiscali
---

La natura dirompente sulle criptovalute, tra le quali il bitcoin, innesca una serie di interrogativi sul versante tributario per l'imprenditore che intende usarle.