text:
package org.ilrt.mca.domain;

import org.ilrt.mca.Common;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Mike Jones (mike.a.jones@bristol.ac.uk)
 */
public class BaseItem implements Item, Comparable<Item> {

    public BaseItem() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Integer getOrder() {
        return order;
    }

    @Override
    public String getPath() {
        return id.substring(Common.MCA_STUB.length());
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    public String getType() {
        return type;
    }

    @Override
    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<BaseItem> getItems() {
        return items;
    }

    private String id;
    private String label;
    private Integer order = 1;  // set a fallback order
    private String description;
    private String template;
    private String type;
    private String style;
    List<BaseItem> items = new ArrayList<BaseItem>();

    @Override
    public int compareTo(Item item) {
        return this.getOrder().compareTo(item.getOrder());
    }
}


text:
'use strict';

const chai      = require('chai'),
  sinon     = require('sinon'),
  expect    = chai.expect,
  errors    = require('../../lib/errors'),
  Support   = require(__dirname + '/support'),
  Sequelize = Support.Sequelize;

describe(Support.getTestDialectTeaser('Sequelize Errors'), () => {
  describe('API Surface', () => {

    it('Should have the Error constructors exposed', () => {
      expect(Sequelize).to.have.property('Error');
      expect(Sequelize).to.have.property('ValidationError');
      expect(Sequelize).to.have.property('OptimisticLockError');
      const sequelize = new Sequelize('mysql://user:pass@example.com:9821/dbname');
      expect(sequelize).to.have.property('Error');
      expect(sequelize).to.have.property('ValidationError');
      expect(sequelize).to.have.property('OptimisticLockError');
    });

    it('Sequelize Errors instances should be instances of Error', () => {
      const error = new Sequelize.Error();
      const errorMessage = 'error message';
      const validationError = new Sequelize.ValidationError(errorMessage, [
        new errors.ValidationErrorItem('<field name> cannot be null', 'notNull Violation', '<field name>', null),
        new errors.ValidationErrorItem('<field name> cannot be an array or an object', 'string violation', '<field name>', null)
      ]);
      const optimisticLockError = new Sequelize.OptimisticLockError();

      const sequelize = new Sequelize('mysql://user:pass@example.com:9821/dbname');
      const instError = new sequelize.Error();
      const instValidationError = new sequelize.ValidationError();
      const instOptimisticLockError = new sequelize.OptimisticLockError();

      expect(error).to.be.instanceOf(Sequelize.Error);
      expect(error).to.be.instanceOf(Error);
      expect(error).to.have.property('name', 'SequelizeBaseError');

      expect(validationError).to.be.instanceOf(Sequelize.ValidationError);
      expect(validationError).to.be.instanceOf(Error);
      expect(validationError).to.have.property('name', 'SequelizeValidationError');
      expect(validationError.message).to.equal(errorMessage);

      expect(optimisticLockError).to.be.instanceOf(Sequelize.OptimisticLockError);
      expect(optimisticLockError).to.be.instanceOf(Error);
      expect(optimisticLockError).to.have.property('name', 'SequelizeOptimisticLockError');

      expect(instError).to.be.instanceOf(Sequelize.Error);
      expect(instError).to.be.instanceOf(Error);
      expect(instValidationError).to.be.instanceOf(Sequelize.ValidationError);
      expect(instValidationError).to.be.instanceOf(Error);
      expect(instOptimisticLockError).to.be.instanceOf(Sequelize.OptimisticLockError);
      expect(instOptimisticLockError).to.be.instanceOf(Error);
    });

    it('SequelizeValidationError should find errors by path', () => {
      const errorItems = [
        new Sequelize.ValidationErrorItem('invalid', 'type', 'first_name', null),
        new Sequelize.ValidationErrorItem('invalid', 'type', 'last_name', null)
      ];
      const validationError = new Sequelize.ValidationError('Validation error', errorItems);
      expect(validationError).to.have.property('get');
      expect(validationError.get).to.be.a('function');

      const matches = validationError.get('first_name');
      expect(matches).to.be.instanceOf(Array);
      expect(matches).to.have.lengthOf(1);
      expect(matches[0]).to.have.property('message', 'invalid');
    });

    it('SequelizeValidationError should override message property when message parameter is specified', () => {
      const errorItems = [
          new Sequelize.ValidationErrorItem('invalid', 'type', 'first_name', null),
          new Sequelize.ValidationErrorItem('invalid', 'type', 'last_name', null)
        ],
        customErrorMessage = 'Custom validation error message',
        validationError = new Sequelize.ValidationError(customErrorMessage, errorItems);

      expect(validationError).to.have.property('name', 'SequelizeValidationError');
      expect(validationError.message).to.equal(customErrorMessage);
    });

    it('SequelizeValidationError should concatenate an error messages from given errors if no explicit message is defined', () => {
      const errorItems = [
          new errors.ValidationErrorItem('<field name> cannot be null', 'notNull Violation', '<field name>', null),
          new errors.ValidationErrorItem('<field name> cannot be an array or an object', 'string violation', '<field name>', null)
        ],
        validationError = new Sequelize.ValidationError(null, errorItems);

      expect(validationError).to.have.property('name', 'SequelizeValidationError');
      expect(validationError.message).to.match(/notNull Violation: <field name> cannot be null,\nstring violation: <field name> cannot be an array or an object/);
    });

    it('SequelizeDatabaseError should keep original message', () => {
      const orig = new Error('original database error message');
      const databaseError = new Sequelize.DatabaseError(orig);

      expect(databaseError).to.have.property('parent');
      expect(databaseError).to.have.property('original');
      expect(databaseError.name).to.equal('SequelizeDatabaseError');
      expect(databaseError.message).to.equal('original database error message');
    });

    it('ConnectionError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.ConnectionError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeConnectionError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('ConnectionRefusedError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.ConnectionRefusedError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeConnectionRefusedError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('AccessDeniedError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.AccessDeniedError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeAccessDeniedError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('HostNotFoundError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.HostNotFoundError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeHostNotFoundError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('HostNotReachableError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.HostNotReachableError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeHostNotReachableError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('InvalidConnectionError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.InvalidConnectionError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeInvalidConnectionError');
      expect(connectionError.message).to.equal('original connection error message');
    });

    it('ConnectionTimedOutError should keep original message', () => {
      const orig = new Error('original connection error message');
      const connectionError = new Sequelize.ConnectionTimedOutError(orig);

      expect(connectionError).to.have.property('parent');
      expect(connectionError).to.have.property('original');
      expect(connectionError.name).to.equal('SequelizeConnectionTimedOutError');
      expect(connectionError.message).to.equal('original connection error message');
    });
  });

  describe('Constraint error', () => {
    [
      {
        type: 'UniqueConstraintError',
        exception: Sequelize.UniqueConstraintError
      },
      {
        type: 'ValidationError',
        exception: Sequelize.ValidationError
      }
    ].forEach(constraintTest => {

      it('Can be intercepted as ' + constraintTest.type + ' using .catch', function() {
        const spy = sinon.spy(),
          User = this.sequelize.define('user', {
            first_name: {
              type: Sequelize.STRING,
              unique: 'unique_name'
            },
            last_name: {
              type: Sequelize.STRING,
              unique: 'unique_name'
            }
          });

        const record = { first_name: 'jan', last_name: 'meier' };
        return this.sequelize.sync({ force: true }).bind(this).then(() => {
          return User.create(record);
        }).then(() => {
          return User.create(record).catch(constraintTest.exception, spy);
        }).then(() => {
          expect(spy).to.have.been.calledOnce;
        });
      });

    });

    it('Supports newlines in keys', function() {
      const spy = sinon.spy(),
        User = this.sequelize.define('user', {
          name: {
            type: Sequelize.STRING,
            unique: 'unique \n unique'
          }
        });

      return this.sequelize.sync({ force: true }).bind(this).then(() => {
        return User.create({ name: 'jan' });
      }).then(function() {
        // If the error was successfully parsed, we can catch it!
        return User.create({ name: 'jan' }).catch(this.sequelize.UniqueConstraintError, spy);
      }).then(() => {
        expect(spy).to.have.been.calledOnce;
      });
    });

    it('Works when unique keys are not defined in sequelize', function() {
      let User = this.sequelize.define('user', {
        name: {
          type: Sequelize.STRING,
          unique: 'unique \n unique'
        }
      }, { timestamps: false });

      return this.sequelize.sync({ force: true }).bind(this).then(function() {
        // Now let's pretend the index was created by someone else, and sequelize doesn't know about it
        User = this.sequelize.define('user', {
          name: Sequelize.STRING
        }, { timestamps: false });

        return User.create({ name: 'jan' });
      }).then(function() {
        // It should work even though the unique key is not defined in the model
        return expect(User.create({ name: 'jan' })).to.be.rejectedWith(this.sequelize.UniqueConstraintError);
      }).then(function() {
        // And when the model is not passed at all
        return expect(this.sequelize.query('INSERT INTO users (name) VALUES (\'jan\')')).to.be.rejectedWith(this.sequelize.UniqueConstraintError);
      });
    });

    it('adds parent and sql properties', function() {
      const User = this.sequelize.define('user', {
        name: {
          type: Sequelize.STRING,
          unique: 'unique'
        }
      }, { timestamps: false });

      return this.sequelize.sync({ force: true }).bind(this).then(() => {
        return User.create({ name: 'jan' });
      }).then(() => {
        return expect(User.create({ name: 'jan' })).to.be.rejected;
      }).then(function(error) {
        expect(error).to.be.instanceOf(this.sequelize.UniqueConstraintError);
        expect(error).to.have.property('parent');
        expect(error).to.have.property('original');
        expect(error).to.have.property('sql');
      });
    });
  });
});

redpajama_set_name: RedPajamaGithub


text:
describe('Login State', () => {
    it('should pass the dummy test to verify the protractor setup', () => {
        expect(true).toBe(true);
    });
});


text:
echo XXX

exit -1


text:
date:   2021-09-23 18:00:00 -0500
layout: meeting
published: true # changeme to true!!!
title:  "Week 4: Crypto I Meeting"
credit: "Husnain R, Anakin, Nebu, Heassam, Pranav"
slides: "https://sigpwny.github.io/presentation-content/FA2021/04-crypto.pdf"
link-to-assets: "TODO"
goal: "This meeting is meant to teach XSS and SQL"
how-to-run: [
	"Go through the slides, this meeting is designed to be a 15-45 meeting",
	"Do some of the basic demos (cards, RPS)",
	"Help people solve challenges should they need it. Especially ceasar cipher and basic XOr"
]
list-of-topics: [
	"Crypto Fundamentals",
	"Encoding",
	"Symetric and Asymmetric Key encryption",
	"Ceasar Cipher, Old Ciphers",
	"XOR",
	"AES (Symmetric Key)",
	"RSA (Asymmetric Key)"
]
---

Tonight is Crypto, this will teach you crypto fundamentals. We will cover Encoding, the two main different forms of encryption, History of Ciphers, XOR cipher, easy AES and RSA!


text: .oo-ui-icon-link{background-image:url(dist/themes/apex/images/icons/link.svg)}


text:
package spark

import benchmarktest.HDFSFileAppender
import org.junit.Test

class TestHDFSFileAppender {

  @Test
  def test(): Unit = {
    val bufferSize = System.getProperty("bufferSize", "4096")
    val timeBetweenFlushes = System.getProperty("flushInterval", "200")
    val path = Option(System.getProperty("path"))
      .getOrElse(
        throw new RuntimeException("Must specify path")
      )
    val total = System.getProperty("total", "100000")
    val hsync = System.getProperty("hsync", "false").toBoolean
    val appender = new HDFSFileAppender(bufferSize.toInt, timeBetweenFlushes.toLong, path,
      total.toInt)
    val average = (1 to 50).map(appender.appendEvents(_, hsync)).sum / 50
    println("Average write rate over all 50 streams: " + average)
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/write_phrase_gradient_end"/>
    <corners android:radius="@dimen/radius" />
    <padding android:left="10dp" android:right="10dp"/>
</shape>


text:
namespace Oryol {
namespace _priv {

//------------------------------------------------------------------------------
d3d12ShaderFactory::d3d12ShaderFactory() :
isValid(false) {
    // empty
}

//------------------------------------------------------------------------------
d3d12ShaderFactory::~d3d12ShaderFactory() {
    o_assert_dbg(!this->isValid);
}

//------------------------------------------------------------------------------
void
d3d12ShaderFactory::Setup(const gfxPointers& ptrs) {
    o_assert_dbg(!this->isValid);
    this->isValid = true;
    this->pointers = ptrs;
}

//------------------------------------------------------------------------------
void
d3d12ShaderFactory::Discard() {
    o_assert_dbg(this->isValid);
    this->isValid = false;
    this->pointers = gfxPointers();
}

//------------------------------------------------------------------------------
bool
d3d12ShaderFactory::IsValid() const {
    return this->isValid;
}

//------------------------------------------------------------------------------
ResourceState::Code
d3d12ShaderFactory::SetupResource(shader& shd) {
    o_assert_dbg(this->isValid);

    const ShaderLang::Code slang = ShaderLang::HLSL5;
    const ShaderSetup& setup = shd.Setup;

    // set vertex- and pixel-shader bytecode pointers
    d3d12Shader::shaderBlob vsByteCode;
    d3d12Shader::shaderBlob psByteCode;
    const int32 numProgs = setup.NumPrograms();
    for (int32 progIndex = 0; progIndex < numProgs; progIndex++) {
        setup.VertexShaderByteCode(progIndex, slang, vsByteCode.ptr, vsByteCode.size);
        setup.FragmentShaderByteCode(progIndex, slang, psByteCode.ptr, psByteCode.size);
        shd.addShaders(setup.Mask(progIndex), vsByteCode, psByteCode);
    }

    return ResourceState::Valid;
}

//------------------------------------------------------------------------------
void
d3d12ShaderFactory::DestroyResource(shader& shd) {
    o_assert_dbg(this->isValid);
    shd.Clear();
}

} // namespace _priv
} // namespace Oryol


text:
#ifndef _VIVID_RADIO_TX_H_
#define _VIVID_RADIO_TX_H_

ssize_t vivid_radio_tx_write(struct file *, const char __user *, size_t, loff_t *);
unsigned int vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait);

int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a);
int vidioc_s_modulator(struct file *file, void *fh, const struct v4l2_modulator *a);

#endif


text:
(function() {

var checkVersion = Dagaz.Model.checkVersion;

Dagaz.Model.checkVersion = function(design, name, value) {
  if (name != "tile-chess-setup") {
      checkVersion(design, name, value);
  }
}

var getSeed = function() {
  var str = window.location.search.toString();
  var result = str.match(/[?&](seed|sid)=([^&]*)/);
  if (result) {
      return result[2];
  } else {
      return "" + _.random(0, 10000);
  }
}

var getName = function() {
  var str = window.location.pathname.toString();
  var result = str.match(/\/([^.\/]+)\./);
  if (result) {
      return result[1].replace("-board", "").replace("-ai", "");
  } else {
      return str;
  }
}

var badName = function(str) {
  var result = str.match(/[?&]game=([^&*]*)/);
  if (result) {
      return result[1] != getName();
  } else {
      return true;
  }
}

var getCookie = function() {
  var result = localStorage.getItem('dagaz.setup');
  if (result) {
      if (badName(result)) return "";
      return "?setup=" + result;
  } else {
      return "";
  }
}

var getSetup = function(setup) {
  var str = window.location.search.toString();
  if (setup) {
      str = setup;
  }
  var result = str.match(/[?&]setup=([^&]*)/);
  if (result) {
      return result[1];
  } else {
      str = getCookie();
      result = str.match(/[?&]setup=([^&]*)/);
      if (result) {
          return result[1];
      } else {
          return "";
      }
  }
}

var homePositions = function(offset) {
  var r = [];
  for (var i = 0; i < 16; i++) {
      r.push(i + offset);
  }
  return r;
}

var availPositions = function(board) {
  var r = [];
  for (var pos = 0; pos < 64; pos++) {
       if (board.getPiece(pos) === null) {
           r.push(pos);
       }
  }
  return r;
}

var addPieces = function(board, type, cnt, positions) {
  for (var i = 0; i < cnt; i++) {
       var ix = 0;
       if (positions.length > 1) ix = _.random(0, positions.length - 1);
       var pos = positions[ix];
       var player = (pos >= 32) ? 1 : 2;
       var piece = Dagaz.Model.createPiece(type, player);
       board.setPiece(pos, piece);
       positions = _.without(positions, pos);
  }
  return positions;
}

var setup = Dagaz.Model.setup;

Dagaz.Model.setup = function(board, init) {
  if (getSetup(init)) {
      setup(board, init);
      return;
  }
  var seed = getSeed();
  console.log("Seed: " + seed);
  Math.seedrandom(seed);
  var design = Dagaz.Model.design;
  var positions = homePositions(0);
  positions = addPieces(board, 4, 4, positions);
  positions = homePositions(48);
  positions = addPieces(board, 4, 4, positions);
  positions = availPositions(board);
  positions = addPieces(board, 4, 8, positions);
  positions = addPieces(board, 3, 12, positions);
  positions = addPieces(board, 2, 12, positions);
  positions = addPieces(board, 1, 12, positions);
  positions = addPieces(board, 0, 12, positions);
}

})();


text:
@class IOSBooleanArray;
@class IOSByteArray;

#include "J2ObjC_header.h"

@interface OrgApacheHarmonySecurityAsn1BitString : NSObject {
 @public
  IOSByteArray *bytes_;
  jint unusedBits_;
}

- (instancetype)initWithByteArray:(IOSByteArray *)bytes
                          withInt:(jint)unusedBits;

- (instancetype)initWithBooleanArray:(IOSBooleanArray *)values;

- (jboolean)getBitWithInt:(jint)bit;

- (void)setBitWithInt:(jint)bit
          withBoolean:(jboolean)value;

- (IOSBooleanArray *)toBooleanArray;

@end

FOUNDATION_EXPORT BOOL OrgApacheHarmonySecurityAsn1BitString_initialized;
J2OBJC_STATIC_INIT(OrgApacheHarmonySecurityAsn1BitString)

J2OBJC_FIELD_SETTER(OrgApacheHarmonySecurityAsn1BitString, bytes_, IOSByteArray *)

CF_EXTERN_C_BEGIN

FOUNDATION_EXPORT IOSByteArray *OrgApacheHarmonySecurityAsn1BitString_SET_MASK_;
J2OBJC_STATIC_FIELD_GETTER(OrgApacheHarmonySecurityAsn1BitString, SET_MASK_, IOSByteArray *)

FOUNDATION_EXPORT IOSByteArray *OrgApacheHarmonySecurityAsn1BitString_RESET_MASK_;
J2OBJC_STATIC_FIELD_GETTER(OrgApacheHarmonySecurityAsn1BitString, RESET_MASK_, IOSByteArray *)
CF_EXTERN_C_END

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheHarmonySecurityAsn1BitString)

#endif // _OrgApacheHarmonySecurityAsn1BitString_H_


text:
import sys
import os
import json
import subprocess

if (len(sys.argv) != 2):
  print "Usage: get_vm_by_name name"
  exit(-1);

MYDIR=os.path.abspath(os.path.dirname(sys.argv[0]))
HOSTNAME=sys.argv[1]

# Grab all VMs to get their ids
def getAllVMs():
  cmd = [ '/bin/sh', MYDIR + '/list_vms.sh' ]
  output = subprocess.check_output(cmd)
  vms = json.loads(output)['droplets']
  return vms

# get the VM id for name
def getVMId(vms, name):
  details = []
  for vm in vms:
    host = vm['name']
    id = vm['id']
    if host == name:
      return id;
  return -1

vms = getAllVMs()
vmId = getVMId(vms, HOSTNAME);
print vmId


text:
@interface ExtenderDetailViewController : GAITrackedViewController <UIImagePickerControllerDelegate, MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate, UITextFieldDelegate, UIActionSheetDelegate>

@property (weak, nonatomic) IBOutlet UITextField *nameTextfield;
@property (weak, nonatomic) IBOutlet UIImageView *extenderImageView;
@property (weak, nonatomic) IBOutlet UIImageView *backgroundBorderImageView;
@property (weak, nonatomic) IBOutlet UIButton *cameraButton;
@property (weak, nonatomic) IBOutlet UIImageView *detailBackgroundImageView;

@property (strong, nonatomic) UIBarButtonItem *saveButton;
@property (strong, nonatomic) NSData *pngData;

@property (strong, nonatomic) ExtenderInfo *selectedExtender;
@property (strong, nonatomic) SiteInfo  *selectedSite;
@property (weak, nonatomic) NSString *phoneNumber;
@property (weak, nonatomic) NSString *smsOutput;

@property (assign, nonatomic) BOOL isNameChanged;
@property (assign, nonatomic) BOOL isPhotoChanged;

@property (weak, nonatomic) IBOutlet UIButton *updateImageButton;

- (void)saveExtender:(id)sender;

@end


text:
package eu.inloop.lint;

import java.util.Collections;
import java.util.List;

import com.android.tools.lint.checks.infrastructure.LintDetectorTest;
import com.android.tools.lint.detector.api.Detector;
import com.android.tools.lint.detector.api.Issue;

@SuppressWarnings("javadoc")
public class SimpleMethodDetectorTest extends LintDetectorTest {

    @Override
    protected Detector getDetector() {
        return new SimpleMethodDetector();
    }

    @Override
    protected List<Issue> getIssues() {
        return Collections.singletonList(SimpleMethodDetector.ISSUE);
    }

    public void testCalculateSignal() throws Exception {
        assertEquals("src/test/pkg/SimpleMethodTest.java:6: Warning: Value could be smaller than 0 (but docs says - range is from 0 to N). [UpdateNetwork]\n" +
                "    WifiManager.calculateSignalLevel(-78, 1);\n" +
                "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
                "0 errors, 1 warnings\n",
            lintProject(
                java("src/test/pkg/SimpleMethodTest.java",
                    "package test.pkg;\n" +
                        "import android.net.wifi.WifiManager;\n" +
                        "\n" +
                        "public class WifiManagerTest {\n" +
                        "  public static void test() {\n" +
                        "    WifiManager.calculateSignalLevel(-78, 1);\n" +
                        "}\n" +
                        "}")
            ));
    }

    public void testUpdateNetwork() throws Exception {
        assertEquals("src/test/pkg/SimpleMethodTest.java:6: Warning: Value could be smaller than 0 (but docs says - range is from 0 to N). [UpdateNetwork]\n" +
                "    WifiManager.calculateSignalLevel(-78, 1);\n" +
                "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
                "0 errors, 1 warnings\n",
            lintProject(
                java("src/test/pkg/SimpleMethodTest.java",
                    "package test.pkg;\n" +
                        "import android.net.wifi.WifiManager;\n" +
                        "\n" +
                        "public class WifiManagerTest {\n" +
                        "  public static void test() {\n" +
                        "    WifiManager wifiManager = new WifiManager();\n" +
                        "    wifiManager.updateNetwork(network1);\n" +
                        "}\n" +
                        "}")
            ));
    }

    public void testAlarmManager() throws Exception {
        assertEquals("No warnings.\n",
            lintProject(
                java("src/test/pkg/SimpleMethodTest.java",
                    "package test.pkg;\n" +
                        "import android.app.AlarmManager;\n" +
                        "import android.app.PendingIntent;\n" +
                        "import android.content.Intent;\n" +
                        "\n" +
                        "public class AlarmManagerTest {" +
                        "public static void test(Context context) {\n" +
                        "    int REQUEST_CODE = 1;\n" +
                        "    Intent serviceIntent = null;\n" +
                        "    PendingIntent pendingIntent = PendingIntent.getService(context, REQUEST_CODE, serviceIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n" +
                        "    AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);\n" +
                        "    int INTERVAL_MIN = 4;\n" +
                        "    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + INTERVAL_MIN, INTERVAL_MIN, pendingIntent);\n" +
                        "}\n" +
                        "}")
            ));
    }

}


text:
using namespace boost::python;
using namespace IECore;
using namespace IECorePython;
using namespace IECoreImage;

namespace IECoreImageBindings
{

void bindImageCropOp()
{
	RunTimeTypedClass<ImageCropOp>()
		.def( init<>() )
	;
}

} // namespace IECoreImageBindings


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.Search.Documents.Indexes.Models
{
    public partial class KnowledgeStoreProjectionSelector : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(ReferenceKeyName))
            {
                writer.WritePropertyName("referenceKeyName");
                writer.WriteStringValue(ReferenceKeyName);
            }
            if (Optional.IsDefined(GeneratedKeyName))
            {
                writer.WritePropertyName("generatedKeyName");
                writer.WriteStringValue(GeneratedKeyName);
            }
            if (Optional.IsDefined(Source))
            {
                writer.WritePropertyName("source");
                writer.WriteStringValue(Source);
            }
            if (Optional.IsDefined(SourceContext))
            {
                writer.WritePropertyName("sourceContext");
                writer.WriteStringValue(SourceContext);
            }
            if (Optional.IsCollectionDefined(Inputs))
            {
                writer.WritePropertyName("inputs");
                writer.WriteStartArray();
                foreach (var item in Inputs)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
        }
    }
}


text:
@interface MainNavigationController : UINavigationController

@property (strong, atomic) Communication* communicator;
@property (strong, atomic) Tester* tester;

@end


text:
package com.github.ccook.gtk.model;

import com.sun.jna.PointerType;

public class GParamSpec extends PointerType {
}


text:
package org.apache.geronimo.security.realm.providers;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.servlet.http.HttpServletRequest;

public class RequestCallbackHandler implements CallbackHandler{

    HttpServletRequest httpRequest;

    public RequestCallbackHandler(HttpServletRequest httpRequest){
        this.httpRequest=httpRequest;
    }

    public void handle(Callback callbacks[]) throws UnsupportedCallbackException{
        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof RequestCallback) {
                RequestCallback rc = (RequestCallback) callback;
                rc.setRequest(httpRequest);
            } else {
                throw new UnsupportedCallbackException(callback);
            }
        }
    }
}


text:
/*	$OpenBSD: varargs.h,v 1.2 2004/01/03 14:55:34 espie Exp $ */
/*
 * Copyright (c) 2003, 2004  Marc espie <espie@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef _VARARGS_H_
#define _VARARGS_H_

#if defined(__GNUC__) && __GNUC__ >= 3
/* These macros implement traditional (non-ANSI) varargs
   for GNU C.  */

#define va_alist  __builtin_va_alist

#define	__va_ellipsis	...

/* ??? We don't process attributes correctly in K&R argument context.  */
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));

/* ??? It would be nice to get rid of the ellipsis here.  It causes
   current_function_varargs to be set in cc1.  */
#define va_dcl		__builtin_va_alist_t __builtin_va_alist; ...

/* Define __gnuc_va_list, just as in stdarg.h.  */

#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif

#define va_start(v)	__builtin_varargs_start((v))
#define va_end		__builtin_va_end
#define va_arg		__builtin_va_arg
#define __va_copy(d,s)	__builtin_va_copy((d),(s))

/* Define va_list from __gnuc_va_list.  */

typedef __gnuc_va_list va_list;

#else
#include <machine/varargs.h>
#endif

#endif /* _VARARGS_H_ */


text:
package com.example.mysms;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.telephony.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class ComposeSMS extends Activity implements OnClickListener {
	static final int PICK_CONTACT = 1;

	Button plusButton;
	Button sendButton;
	String cNumber;
	EditText contactEditText;
	EditText descriptionEditext;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.compose_sms);
		plusButton = (Button) findViewById(R.id.plusButton);
		contactEditText = (EditText) findViewById(R.id.editText);
		descriptionEditext = (EditText) findViewById(R.id.description);
		sendButton  = (Button)findViewById(R.id.sendButton);
		sendButton.setOnClickListener(this);
		plusButton.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.plusButton:
			Intent intent = new Intent(Intent.ACTION_PICK,
					ContactsContract.Contacts.CONTENT_URI);
			startActivityForResult(intent, PICK_CONTACT);
			break;
		case R.id.sendButton:
			if (!cNumber.equals("") && !descriptionEditext.getText().toString().equals("")) {
				SmsManager smsManager = SmsManager.getDefault();
				smsManager.sendTextMessage(cNumber, null, descriptionEditext.getText().toString(), null, null);
		         Toast.makeText(getApplicationContext(), "SMS sent.", Toast.LENGTH_LONG).show();

			}

			break;
		default:
			break;
		}

	}

	@Override
	public void onActivityResult(int reqCode, int resultCode, Intent data) {
		super.onActivityResult(reqCode, resultCode, data);

		switch (reqCode) {
		case (PICK_CONTACT):
			if (resultCode == Activity.RESULT_OK) {

				Uri contactData = data.getData();
				Cursor c = managedQuery(contactData, null, null, null, null);
				if (c.moveToFirst()) {

					String id = c
							.getString(c
									.getColumnIndexOrThrow(ContactsContract.Contacts._ID));

					String hasPhone = c
							.getString(c
									.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));

					if (hasPhone.equalsIgnoreCase("1")) {
						Cursor phones = getContentResolver()
								.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
										null,
										ContactsContract.CommonDataKinds.Phone.CONTACT_ID
												+ " = " + id, null, null);
						phones.moveToFirst();
						cNumber = phones.getString(phones
								.getColumnIndex("data1"));
						System.out.println("number is:" + cNumber);
					}
					String name = c
							.getString(c
									.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));

					contactEditText.setText(name);
				}
			}
			break;
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2009/07/customui" loadImage="LoadImages">
    <ribbon>
        <tabs>
            <tab id="ControlledVocabTab" label="Controlled Vocab">
                <group label="Communicate With Care" id="ControlledVocabButtons" >
                    DLBUTTONPLACHOLDER_DONOTREMOVE
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>


text:
var imagesExtensions = ['.gif', '.jpg', '.jpeg', '.jpe', '.jfif', '.png', '.bmp'];

jQuery().ready(function () {
	// Activate the click
	jQuery('#options_show_images').click(show_images);
});

function show_images(eventObject) {
	// Hide the link
	jQuery('#options_show_images').hide();

	// Change the result visual
	jQuery('#resultLinks').addClass('imagesResult');

	// Transform all the results
	jQuery('#resultLinks li a').each(function (index, Element) {
		var el = jQuery(Element);

		// Get the link and name
		var link = el.attr('href');
		var name = link.substr(link.lastIndexOf('/') + 1);

		// Check the extension and hide the result if not an image
		var dotPosition = name.lastIndexOf('.');
		var isAnImage = false;
		if (dotPosition != -1) {
			var extension = name.substr(dotPosition).toLowerCase();

			if (jQuery.inArray(extension, imagesExtensions) != -1) {
				isAnImage = true;
			}
		}

		if (isAnImage) {
			// Replace the inside with an image of the link + the name of the file
			el.html('
' + name);
		} else {
			// Hide the

			el.parent().hide();
		}
	});
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using IrisCompiler;
using IrisCompiler.BackEnd;
using IrisCompiler.FrontEnd;
using IrisCompiler.Import;
using Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace IrisExtension.ExpressionCompiler
{
    /// <summary>
    /// A subclass of the CompilerContext class to deal with all of the context for the various
    /// types of compilation we need to do in the debugger.
    /// </summary>
    internal class DebugCompilerContext : CompilerContext
    {
        public readonly List<string> FormatSpecifiers = new List<string>();
        public readonly List<DkmClrLocalVariableInfo> GeneratedLocals;
        public readonly InspectionScope Scope;
        public readonly string AssignmentLValue;
        public readonly string ClassName;
        public readonly string MethodName;
        public readonly bool ArgumentsOnly;

        private static uint s_nextClass;

        private InspectionSession _ownedSession;
        private MemoryStream _input;
        private StreamReader _reader;
        private Method _irisMethod;
        private Type _translatorType;
        private uint _nextMethod;

        public DebugCompilerContext(
            InspectionSession ownedSession,
            InspectionScope scope,
            MemoryStream input,
            StreamReader reader,
            Type translatorType,
            string methodName,
            List<DkmClrLocalVariableInfo> generatedLocals,
            string assignmentLValue,
            bool argumentsOnly)
            : this(scope.Session.Importer, reader, CompilationFlags.NoDebug | CompilationFlags.WriteDll)
        {
            _ownedSession = ownedSession;
            _input = input;
            _reader = reader;
            _translatorType = translatorType;
            Scope = scope;
            MethodName = methodName;
            ClassName = string.Format("$.C{0}", s_nextClass++);
            GeneratedLocals = generatedLocals;
            AssignmentLValue = assignmentLValue;
            ArgumentsOnly = argumentsOnly;
        }

        private DebugCompilerContext(Importer importer, StreamReader inputReader, CompilationFlags flags)
            : base("fake.iris", inputReader, importer, new PeEmitter(flags), flags)
        {
        }

        public DkmClrCompilationResultFlags ResultFlags
        {
            get;
            set;
        }

        public Variable[] ParameterVariables
        {
            get
            {
                return _irisMethod.GetParameters();
            }
        }

        public Variable[] LocalVariables
        {
            get
            {
                return Scope.GetLocals().Select(v => v.Variable).ToArray();
            }
        }

        public byte[] GetPeBytes()
        {
            if (ErrorCount == 0)
            {
                Emitter.Flush();
                return ((PeEmitter)Emitter).GetPeBytes();
            }
            else
            {
                return null;
            }
        }

        public void InitializeSymbols()
        {
            ImportedMethod currentMethod = Scope.TryImportCurrentMethod();
            if (currentMethod == null)
                return; // Nothing to evaluate if we can't get the current method

            // Add compiler intrinsics
            AddIntrinsics();

            // Add debugger intrinsics
            // (Not implemented yet)

            // Add globals
            ImportedType type = currentMethod.DeclaringType;
            foreach (ImportedField importedfield in type.GetFields())
            {
                IrisType irisType = importedfield.FieldType;
                if (irisType != IrisType.Invalid)
                    SymbolTable.Add(importedfield.Name, irisType, StorageClass.Global, importedfield);
            }

            // Add methods
            foreach (ImportedMethod importedMethod in type.GetMethods())
            {
                Method method = importedMethod.ConvertToIrisMethod();
                if (IsValidMethod(method))
                    SymbolTable.Add(importedMethod.Name, method, StorageClass.Global, importedMethod);
            }

            // Create symbol for query method and transition the SymbolTable to method scope
            _irisMethod = currentMethod.ConvertToIrisMethod();
            SymbolTable.OpenMethod("$.query", _irisMethod);

            // Add symbols for parameters
            foreach (Variable param in _irisMethod.GetParameters())
                SymbolTable.Add(param.Name, param.Type, StorageClass.Argument);

            // Add symbols for local variables
            foreach (LocalVariable local in Scope.GetLocals())
                SymbolTable.Add(local.Name, local.Type, StorageClass.Local, local.Slot);
        }

        public void GenerateQuery()
        {
            Translator.TranslateInput();
        }

        public string NextMethodName()
        {
            return string.Format("$.M{0}", _nextMethod++);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_reader != null)
                {
                    _reader.Dispose();
                    _reader = null;
                }

                if (_input != null)
                {
                    _input.Dispose();
                    _input = null;
                }

                if (_ownedSession != null)
                {
                    _ownedSession.Dispose();
                    _ownedSession = null;
                }
            }

            base.Dispose(disposing);
        }

        protected override ImportedModule ReferenceMscorlib()
        {
            return Scope.ImportMscorlib();
        }

        protected override ImportedModule ReferenceExternal(string moduleName)
        {
            return Scope.ImportModule(moduleName);
        }

        protected override Translator CreateTranslator()
        {
            return (Translator)Activator.CreateInstance(_translatorType, this);
        }

        private bool IsValidMethod(Method method)
        {
            Function func = method as Function;
            if (func != null && func.ReturnType == IrisType.Invalid)
                return false;

            foreach (Variable param in method.GetParameters())
            {
                if (param.Type == IrisType.Invalid)
                    return false;
            }

            return true;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using FossLock.Core;
using FossLock.Model.Base;

namespace FossLock.Model
{
    /// <summary>
    ///     An object, whose individual versions may be licensed out to customers.
    /// </summary>
    public class Product : NamedEntityBase
    {
        /// <summary>
        ///     The date this product was initially released.
        /// </summary>
        public DateTime ReleaseDate { get; set; }

        /// <summary>
        ///     Any additional notes about this product.
        /// </summary>
        public string Notes { get; set; }

        /// <summary>
        ///     Indicates the type of encryption used when generating license
        ///     files.
        /// </summary>
        public EncryptionType LicenseEncryptionType { get; set; }

        /// <summary>
        ///     Private encryption key generated for whatever EncryptionType was specified.
        /// </summary>
        public string PrivateKey { get; set; }

        /// <summary>
        ///     Public encryption key generated for whatever EncryptionType was specified.
        /// </summary>
        public string PublicKey { get; set; }

        /// <summary>
        ///     Flag enum that indicates the hardware lock properties that will be
        ///     required by default for activation. This may be overridden on an
        ///     individual license.
        /// </summary>
        public LockPropertyType DefaultLockProperties { get; set; }

        /// <summary>
        ///     Indicates whether licensing should fail if any of the required
        ///     hardware identifiers cannot be read.
        /// </summary>
        public bool FailOnNullHardwareIdentifier { get; set; }

        /// <summary>
        ///     Flag enum that indicates the methods in which this license may
        ///     be activated.
        /// </summary>
        public ActivationMethodType PermittedActivationTypes { get; set; }

        /// <summary>
        ///     Indicates the types of expirations permitted for
        ///     new <see cref="License"/>s
        /// </summary>
        public LicenseType PermittedExpirationTypes { get; set; }

        /// <summary>
        ///     Indicates how strict the system will be when activating.
        ///     <see cref="FossLock.Core.VersionLeewayType"/> has additional details.
        /// </summary>
        public VersionLeewayType VersionLeeway { get; set; }

        /// <summary>
        ///     Optional collection of features that may be licensed in
        ///     addition to the main product license.
        /// </summary>
        public virtual ICollection<ProductFeature> Features { get; set; }

        /// <summary>
        ///     A collection of versions of this product, which are actually
        ///     the objects licensed out to customers.
        /// </summary>
        public virtual ICollection<ProductVersion> Versions { get; set; }
    }
}


text:
package gov.nasa.jpf.psyco.interpolation;

import com.google.common.base.Function;
import gov.nasa.jpf.JPF;
import gov.nasa.jpf.constraints.api.ConstraintSolver;
import gov.nasa.jpf.constraints.api.Expression;
import gov.nasa.jpf.constraints.api.InterpolationSolver;
import gov.nasa.jpf.constraints.api.Valuation;
import gov.nasa.jpf.constraints.api.Variable;
import gov.nasa.jpf.constraints.expressions.LogicalOperator;
import gov.nasa.jpf.constraints.expressions.Negation;
import gov.nasa.jpf.constraints.expressions.NumericBooleanExpression;
import gov.nasa.jpf.constraints.expressions.NumericComparator;
import gov.nasa.jpf.constraints.expressions.PropositionalCompound;
import gov.nasa.jpf.constraints.types.BuiltinTypes;
import gov.nasa.jpf.constraints.util.ExpressionUtil;
import gov.nasa.jpf.jdart.constraints.Path;
import gov.nasa.jpf.jdart.constraints.PathState;
import gov.nasa.jpf.jdart.constraints.PostCondition;
import gov.nasa.jpf.psyco.alphabet.SummaryAlphabet;
import gov.nasa.jpf.psyco.alphabet.SymbolicMethodSymbol;
import gov.nasa.jpf.psyco.exceptions.CounterexampleFound;
import gov.nasa.jpf.psyco.filter.ValidQueryFilter;
import gov.nasa.jpf.psyco.learnlib.SymbolicExecutionResult;
import gov.nasa.jpf.psyco.learnlib.SymbolicQueryOutput;
import gov.nasa.jpf.psyco.util.PathUtil;
import gov.nasa.jpf.psyco.util.PsycoProfiler;
import gov.nasa.jpf.psyco.util.SEResultUtil;
import gov.nasa.jpf.util.JPFLogger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.automatalib.automata.transout.MealyMachine;
import net.automatalib.words.Word;

public final class InterpolationUtil {

  private static final JPFLogger logger = JPF.getLogger("psyco");

  private final InterpolationSolver iSolver;
  private final ConstraintSolver cSolver;
  private final Valuation initial;
  private final SummaryAlphabet inputs;
  private final MealyMachine<Object, SymbolicMethodSymbol, ?, SymbolicQueryOutput> model;
  private final InterpolationCache cache;

  public InterpolationUtil(InterpolationSolver iSolver,
          ConstraintSolver cSolver, SummaryAlphabet inputs,
          MealyMachine<Object, SymbolicMethodSymbol, ?, SymbolicQueryOutput> model) {
    this.iSolver = iSolver;
    this.cSolver = cSolver;
    this.inputs = inputs;
    this.model = model;

    this.initial = this.inputs.getInitialValuation();
    this.cache = new InterpolationCache(cSolver);
  }

  /**
   * expands future after a prefix for some depth and computes an interpolant
   * characterizing program states for which the model is conformant after the
   * state reached by the prefix for this depth.
   *
   * @param prefix
   * @param path
   * @param depth
   * @return
   * @throws CounterexampleFound
   */
  public Expression<Boolean> expand(Word<SymbolicMethodSymbol> prefix,
          Word<Path> path, int depth) throws CounterexampleFound {
    List<Expression<Boolean>> interpolants = new ArrayList<>();
    logger.finer("Expanding prefix " + prefix);
    Object state = model.getState(prefix);
    Expression<Boolean> itp = cache.lookup(depth, state,
            InterpolationUtil.asExpression(
                    prefix, path, this.inputs.getInitialValuation()));
    if (itp != null) {
      return itp;
    }

    for (SymbolicMethodSymbol a : this.inputs) {
      itp = expand(prefix, path, a, depth - 1);
      interpolants.add(itp);
    }

    itp = ExpressionUtil.and(interpolants);
    cache.update(depth, state, itp);
    return itp;
  }

  private Expression<Boolean> expand(Word<SymbolicMethodSymbol> prefix,
          Word<Path> path, SymbolicMethodSymbol a, int depth)
          throws CounterexampleFound {

    SymbolicExecutionResult summary = this.inputs.getSummary(a);
    Object state = model.getState(prefix);
    SymbolicQueryOutput out = model.getOutput(state, a);
    Word nextPrefix = prefix.append(a);

    if (!ValidQueryFilter.isValid(nextPrefix)) {
      if (out.equals(SymbolicQueryOutput.ERROR)) {
        return ExpressionUtil.TRUE;
      }
      throw new CounterexampleFound(nextPrefix);
    }

    List<Expression<Boolean>> interpolants = new ArrayList<>();
    for (Path p : summary) {
      // refinement may block complete paths
      if (cSolver.isSatisfiable(p.getPathCondition())
              != ConstraintSolver.Result.SAT) {
        continue;
      }

      Word<Path> nextPath = path.append(p);
      boolean sat = sat(nextPrefix, nextPath);
      boolean conforms = conforms(p, out);
      // found ce?
      if (sat && !conforms) {
        logger.finer("Found counerexample: " + nextPrefix + " : "
                + out + " : " + SymbolicQueryOutput.forPath(p));

        throw new CounterexampleFound(nextPrefix);
      } // found unsat error
      else if (!sat && !conforms) {
        Expression<Boolean> itp
                = interpolate(prefix, path, a, p.getPathCondition());
        interpolants.add(itp);
      } // conforms
      else if (sat && conforms) {
        if (depth > 0 && p.getState().equals(PathState.OK)) {
          Expression<Boolean> itp = expand(nextPrefix, nextPath, depth);
          Expression<Boolean> error
                  = InterpolationUtil.makeErrorCondition(p, itp);
          interpolants.add(interpolate(prefix, path, a, error));
        }
      }
    }

    Expression<Boolean> itp = ExpressionUtil.and(
            interpolants.toArray(new Expression[]{}));
    //assert (cSolver.isSatisfiable(itp) == Result.SAT);
    return itp;
  }

  private boolean sat(Word<SymbolicMethodSymbol> word, Word<Path> path) {
    Path combined = PathUtil.executeSymbolically(
            word, path, this.inputs.getInitialValuation());

    ConstraintSolver.Result sat = cSolver.isSatisfiable(combined.getPathCondition());
    return sat == ConstraintSolver.Result.SAT;
  }

  private boolean conforms(Path p, SymbolicQueryOutput out) {
    return out.equals(SymbolicQueryOutput.forPath(p));
  }

  /**
   * calls the interpolation solver to create an interpolant between (prefix,
   * path) and the unsatisfiable and unconformat paths of a.
   *
   * @param prefix
   * @param path
   * @param a
   * @param unsatUnconformant
   * @param iSolver
   * @param initial
   * @return
   */
  public Expression<Boolean> interpolate(Word<SymbolicMethodSymbol> prefix,
          Word<Path> path, SymbolicMethodSymbol a,
          Expression<Boolean> unsatUnconformant) {

    List<Expression<Boolean>> terms = new ArrayList<>();
    terms.add(asExpression(prefix, path, initial));

    int ppos = 1;
    for (SymbolicMethodSymbol s : prefix) {
      ppos += s.getArity();
    }

    Function<String, String> shift = SEResultUtil.shift(1, ppos, a.getArity());
    unsatUnconformant = ExpressionUtil.renameVars(unsatUnconformant, shift);
    terms.add(unsatUnconformant);

    PsycoProfiler.start("InterpolationSolver");
    List<Expression<Boolean>> itp = iSolver.getInterpolants(terms);
    PsycoProfiler.stop("InterpolationSolver");
    return itp.get(0);
  }

  /**
   * creates an error condition from a path with precondition p and
   * postcondition q and an interpolant over-approximating OK paths after (p,q).
   *
   * Returns: (p and (not (itp[q_r/q_l])))
   *
   * @param p
   * @param itp
   * @return
   */
  public static Expression<Boolean> makeErrorCondition(
          Path p, Expression<Boolean> itp) {

    PostCondition post = p.getPostCondition();
    Map<Variable<?>, Expression<?>> map = new HashMap<>();
    for (Map.Entry<Variable<?>, Expression<?>> e
            : post.getConditions().entrySet()) {
      map.put(e.getKey(), e.getValue());
    }

    Function<Variable<?>, Expression<?>> repl = SEResultUtil.func(map);
    itp = ExpressionUtil.transformVars(itp, repl);

    Expression<Boolean> error = ExpressionUtil.and(
            p.getPathCondition(), new Negation(itp));

    return error;
  }

  /**
   * creates one expression, concatenating and eliminating all references to
   * state variables along the path. State variables may remain from the
   * computed post condition, which is also part of the expression.
   *
   * @param prefix
   * @param path
   * @param initial
   * @return
   */
  public static Expression<Boolean> asExpression(
          Word<SymbolicMethodSymbol> prefix,
          Word<Path> path, Valuation initial) {
    if (prefix.length() < 1) {
      return ExpressionUtil.valuationToExpression(initial);
    }

    Path p = PathUtil.executeSymbolically(prefix, path, initial);
    return ExpressionUtil.and(
            p.getPathCondition(), asExpression(p.getPostCondition()));
  }

  /**
   * turns a post condition into an expression
   *
   * @param post
   * @return
   */
  public static Expression<Boolean> asExpression(PostCondition post) {
    List<Expression<Boolean>> list = new ArrayList<>();
    for (Map.Entry<Variable<?>, Expression<?>> e :
            post.getConditions().entrySet()) {
      list.add(makeEquals(e.getKey(), e.getValue()));
    }
    return ExpressionUtil.and(list.toArray(new Expression[]{}));
  }

  /**
   * creates an equality or equivalence for the arguments
   *
   * @param var
   * @param expr
   * @return
   */
  public static Expression<Boolean> makeEquals(Variable var, Expression expr) {
    if (BuiltinTypes.BOOL.equals(var.getType())) {
      return new PropositionalCompound(
              (Expression<Boolean>) var,
              LogicalOperator.EQUIV,
              (Expression<Boolean>) expr);
    } else {
      return new NumericBooleanExpression(
              (Expression) var,
              NumericComparator.EQ,
              (Expression) expr);
    }
  }

  /**
   * @return the cache
   */
  public InterpolationCache getCache() {
    return cache;
  }

}


text:
<?php declare(strict_types=1);
namespace Imbo\Storage;

use DateTime;
use Imbo\Exception\StorageException;

/**
 * Storage adapter interface
 *
 * This is an interface for storage adapters in Imbo.
 */
interface StorageInterface
{
    /**
     * Store an image
     *
     * This method will receive the binary data of the image and store it somewhere suited for the
     * actual storage adaper. If an error occurs the adapter should throw an
     * Imbo\Exception\StorageException exception.
     *
     * If the image already exists, overwrite it.
     *
     * @param string $user The user which the image belongs to
     * @param string $imageIdentifier The image identifier
     * @param string $imageData The image data to store
     * @throws StorageException
     * @return bool Returns true on success or false on failure
     */
    public function store(string $user, string $imageIdentifier, string $imageData): bool;

    /**
     * Delete an image
     *
     * This method will delete the file associated with $imageIdentifier from the storage medium
     *
     * @param string $user The user which the image belongs to
     * @param string $imageIdentifier Image identifier
     * @throws StorageException
     * @return bool Returns true on success or false on failure
     */
    public function delete(string $user, string $imageIdentifier): bool;

    /**
     * Get image content
     *
     * @param string $user The user which the image belongs to
     * @param string $imageIdentifier Image identifier
     * @throws StorageException
     * @return ?string The binary content of the image, null on failure
     */
    public function getImage(string $user, string $imageIdentifier): ?string;

    /**
     * Get the last modified timestamp
     *
     * @param string $user The user which the image belongs to
     * @param string $imageIdentifier Image identifier
     * @throws StorageException
     * @return DateTime Returns an instance of DateTime, using the UTC timezone
     */
    public function getLastModified(string $user, string $imageIdentifier): DateTime;

    /**
     * Get the current status of the storage
     *
     * This method is used with the status resource.
     *
     * @return bool
     */
    public function getStatus(): bool;

    /**
     * Check if the image already exists
     *
     * @param string $user The user which the image belongs to
     * @param string $imageIdentifier Image identifier
     * @throws StorageException
     * @return bool True if the image exists, false otherwise
     */
    public function imageExists(string $user, string $imageIdentifier): bool;
}


text:
package org.camunda.bpm.bvis.rest.send.service;

import java.util.Date;
import java.util.ArrayList;
import java.util.Collection;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.inject.Named;

import org.camunda.bpm.bvis.ejb.beans.OrderServiceBean;
import org.camunda.bpm.bvis.entities.Customer;
import org.camunda.bpm.bvis.entities.RentalOrder;
import org.camunda.bpm.bvis.rest.send.dto.ContractDetailsDTO;
import org.camunda.bpm.bvis.rest.send.dto.Order;
import org.camunda.bpm.bvis.rest.send.dto.User;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.spi.ResteasyProviderFactory;

@ManagedBean
//@ConversationScoped
@Named
public class SendInquiry {

	private static final String BASE_URI = "http://ec2-52-59-43-126.eu-central-1.compute.amazonaws.com/partner-interface/";

	@EJB
	private OrderServiceBean orderService;

	public String sendInquiry(RentalOrder entityOrder, String processInstanceID) {
		// parse RentalOrder object to Order object (which represents the agreed upon JSON format)
		System.out.println("PARSING SENDING OBJECT");
		User user = parseUser(entityOrder);
		Collection<org.camunda.bpm.bvis.rest.send.dto.Car> cars = parseCars(entityOrder);
		org.camunda.bpm.bvis.rest.send.dto.Insurance insurance = parseInsurance(entityOrder);
		Order order = parseOrder(cars, insurance, user, entityOrder);
		ContractDetailsDTO contractDetails = new ContractDetailsDTO();
		contractDetails.setOrder(order);
		contractDetails.setProcessinstance_id_bvis(processInstanceID);
		System.out.println("SENDING OBJECT SUCCESSFULLY PARSED");

		System.out.println("SENDING PARSED OBJECT ORDER ID: " + contractDetails.getOrder().getOrder_id());
		RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
		ResteasyWebTarget target = new ResteasyClientBuilder().build().target(BASE_URI);
		SendInquiryClient senderClient = target.proxy(SendInquiryClient.class);
		String result = senderClient.sendInquiry(contractDetails);
		return result;
	}

	/**
	 * Helper method that parses a User object out of the RentalOrder
	 * @param order
	 * @return
	 */
	private User parseUser(RentalOrder order) {
		Customer customer = order.getCustomer();
		User user = new User();
		user.setCity(customer.getCity());
		user.setCompany(customer.getCompany());
		user.setCompany_name(customer.getCompanyName());
		user.setCountry(customer.getCountry());
		user.setDate_of_birth(customer.getDateOfBirth());
		user.setEmail(customer.getEmail());
		user.setFirstname(customer.getFirstname());
		user.setHouse_number(customer.getHouseNumber());
		user.setPhone_number(customer.getPhoneNumber());
		user.setPostcode(customer.getPostcode());
		user.setStreet(customer.getStreet());
		user.setSurname(customer.getSurname());
		return user;
	}

	private Collection<org.camunda.bpm.bvis.rest.send.dto.Car> parseCars(RentalOrder order) {
		org.camunda.bpm.bvis.rest.send.dto.Car car = new org.camunda.bpm.bvis.rest.send.dto.Car();
		Collection<org.camunda.bpm.bvis.entities.Car> entityCars = order.getCars();
		ArrayList<org.camunda.bpm.bvis.rest.send.dto.Car> cars = new ArrayList<org.camunda.bpm.bvis.rest.send.dto.Car>();
		for (org.camunda.bpm.bvis.entities.Car entityCar : entityCars) {
			car.setBrand(entityCar.getBrand());
			car.setConstruction_year(entityCar.getConstructionYear());
			car.setFuel_type(entityCar.getFuelType());
			car.setModel(entityCar.getModel());
			car.setPs(entityCar.getPs());
			car.setRegistration_number(entityCar.getRegistrationNumber());
			car.setType(entityCar.getType().toString());
			car.setVehicle_identification_number(entityCar.getVehicleIdentificationNumber());
			cars.add(car);
		}
		return cars;
	}

	private org.camunda.bpm.bvis.rest.send.dto.Insurance parseInsurance(RentalOrder rentalOrder) {
		org.camunda.bpm.bvis.rest.send.dto.Insurance insurance = new org.camunda.bpm.bvis.rest.send.dto.Insurance();
		org.camunda.bpm.bvis.entities.Insurance entityInsurance = rentalOrder.getInsurance();

		// set alternative for insurance == null for testing purposes
		if (entityInsurance == null) {
			insurance.setDeductible(1337);
			insurance.setInsurance_id(1337);
			insurance.setPick_up_date(new Date());
			insurance.setReturn_date(new Date());
			insurance.setType("TestType");
		}
		else {
			insurance.setDeductible(Double.parseDouble(entityInsurance.getDeductible().toString()));
			insurance.setInsurance_id(Integer.parseInt(entityInsurance.getInsuranceID()+""));
			insurance.setPick_up_date(entityInsurance.getPickUpDate());
			insurance.setReturn_date(entityInsurance.getReturnDate());
			insurance.setType(entityInsurance.getType().toString());
		}
		return insurance;
	}

	private Order parseOrder(Collection<org.camunda.bpm.bvis.rest.send.dto.Car> cars,
			org.camunda.bpm.bvis.rest.send.dto.Insurance insurance, User user, RentalOrder rentalOrder) {
		Order order = new Order();
		order.setCar(cars);
		order.setUser(user);
		order.setFleet_rental((cars.size() > 1) ? true : false);
		order.setInquiry_text(rentalOrder.getInquiryText());
		order.setInsurance(insurance);
		order.setOrder_id(Integer.parseInt(rentalOrder.getOrderID()+""));
		order.setRequest_date(rentalOrder.getRequestDate());
		return order;
	}
}


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

class About extends CI_Controller {

	public function index()
	{
		$header_data = array(
			'title' => 'about'
			);
		$navigation_data = array(
			'page' => 'about'
			);
		$this->load->view('commons/header', $header_data);
		$this->load->view('commons/navigation', $navigation_data);
		$this->load->view('about');
		$this->load->view('commons/footer');
	}
}


text:
package network::extreme::snmp::mode::interfaces;

use base qw(snmp_standard::mode::interfaces);

use strict;
use warnings;

sub set_oids_errors {
    my ($self, %options) = @_;

    $self->SUPER::set_oids_errors(%options);
    $self->{oid_ifOutCongDropPkts} = '.1.3.6.1.4.1.1916.1.4.14.1.1'; # extremePortCongDropPkts
}

sub set_counters_errors {
    my ($self, %options) = @_;

    $self->SUPER::set_counters_errors(%options);

    push @{$self->{maps_counters}->{int}},
        { label => 'out-congdropped', filter => 'add_errors', nlabel => 'interface.packets.out.congestion.dropped.count', set => {
                key_values => [ { name => 'outcongdropped', diff => 1 }, { name => 'total_out_packets', diff => 1 }, { name => 'display' }, { name => 'mode_cast' } ],
                closure_custom_calc => $self->can('custom_errors_calc'), closure_custom_calc_extra_options => { label_ref1 => 'out', label_ref2 => 'congdropped' },
                closure_custom_output => $self->can('custom_errors_output'), output_error_template => 'Packets Out Congestion Dropped : %s',
                closure_custom_perfdata => $self->can('custom_errors_perfdata'),
                closure_custom_threshold_check => $self->can('custom_errors_threshold')
            }
        }
    ;
}

sub load_errors {
    my ($self, %options) = @_;

    $self->set_oids_errors();
    $self->{snmp}->load(
        oids => [
            $self->{oid_ifInDiscards}, $self->{oid_ifInErrors},
            $self->{oid_ifOutDiscards}, $self->{oid_ifOutErrors},
            $self->{oid_ifOutCongDropPkts}
        ],
        instances => $self->{array_interface_selected}
    );
}

sub add_result_errors {
    my ($self, %options) = @_;

    $self->{int}->{$options{instance}}->{indiscard} = $self->{results}->{ $self->{oid_ifInDiscards} . '.' . $options{instance} };
    $self->{int}->{$options{instance}}->{inerror} = $self->{results}->{ $self->{oid_ifInErrors} . '.' . $options{instance} };
    $self->{int}->{$options{instance}}->{outdiscard} = $self->{results}->{ $self->{oid_ifOutDiscards} . '.' . $options{instance} };
    $self->{int}->{$options{instance}}->{outerror} = $self->{results}->{ $self->{oid_ifOutErrors} . '.' . $options{instance} };
    $self->{int}->{$options{instance}}->{outcongdropped} = $self->{results}->{ $self->{oid_ifOutCongDropPkts} . '.' . $options{instance} };
}

1;

__END__

=head1 MODE

Check interfaces.

=over 8

=item B<--add-global>

Check global port statistics (By default if no --add-* option is set).

=item B<--add-status>

Check interface status.

=item B<--add-duplex-status>

Check duplex status (with --warning-status and --critical-status).

=item B<--add-traffic>

Check interface traffic.

=item B<--add-errors>

Check interface errors.

=item B<--add-cast>

Check interface cast.

=item B<--add-speed>

Check interface speed.

=item B<--add-volume>

Check interface data volume between two checks (not supposed to be graphed, useful for BI reporting).

=item B<--check-metrics>

If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"').

=item B<--warning-status>

Set warning threshold for status.
Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}

=item B<--critical-status>

Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"').
Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}

=item B<--warning-*> B<--critical-*>

Thresholds.
Can be: 'total-port', 'total-admin-up', 'total-admin-down', 'total-oper-up', 'total-oper-down',
'in-traffic', 'out-traffic', 'in-error', 'in-discard', 'out-congdropped', 'out-error', 'out-discard',
'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast',
'speed' (b/s).

=item B<--units-traffic>

Units of thresholds for the traffic (Default: 'percent_delta') ('percent_delta', 'bps', 'counter').

=item B<--units-errors>

Units of thresholds for errors/discards (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'counter').

=item B<--units-cast>

Units of thresholds for communication types (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'counter').

=item B<--nagvis-perfdata>

Display traffic perfdata to be compatible with nagvis widget.

=item B<--interface>

Set the interface (number expected) ex: 1,2,... (empty means 'check all interface').

=item B<--name>

Allows to use interface name with option --interface instead of interface oid index (Can be a regexp)

=item B<--speed>

Set interface speed for incoming/outgoing traffic (in Mb).

=item B<--speed-in>

Set interface speed for incoming traffic (in Mb).

=item B<--speed-out>

Set interface speed for outgoing traffic (in Mb).

=item B<--force-counters32>

Force to use 32 bits counters (even in snmp v2c and v3). Should be used when 64 bits counters are buggy.

=item B<--reload-cache-time>

Time in minutes before reloading cache file (default: 180).

=item B<--oid-filter>

Choose OID used to filter interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr).

=item B<--oid-display>

Choose OID used to display interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr).

=item B<--oid-extra-display>

Add an OID to display.

=item B<--display-transform-src>

Regexp src to transform display value.

=item B<--display-transform-dst>

Regexp dst to transform display value.

=item B<--show-cache>

Display cache interface datas.

=back

=cut


text:
package basic

import (
	"github.com/google/gxui"
	"github.com/google/gxui/math"
	"github.com/google/gxui/mixins"
)

func CreateLabel(theme *Theme) gxui.Label {
	l := &mixins.Label{}
	l.Init(l, theme, theme.DefaultFont(), theme.LabelStyle.FontColor)
	l.SetMargin(math.Spacing{L: 3, T: 3, R: 3, B: 3})
	return l
}


text:
' Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Text
Imports Roslyn.Test.Utilities

Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel.CSharp
    Public Class CodeParameterTests
        Inherits AbstractCodeParameterTests

#Region "AddAttribute tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub AddAttribute1()
            Dim code =

class C
{
    void Foo(string $$s)
    {
    }
}

            Dim expected =

class C
{
    void Foo([Out()] string s)
    {
    }
}

            TestAddAttribute(code, expected, New AttributeData With {.Name = "Out"})
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub AddAttribute2()
            Dim code =

class C
{
    void Foo([Out()]string $$s)
    {
    }
}

            Dim expected =

class C
{
    void Foo([Foo()][Out()]string s)
    {
    }
}

            TestAddAttribute(code, expected, New AttributeData With {.Name = "Foo"})
        End Sub
#End Region

#Region "DefaultValue tests"
        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub DefaultValue()
            Dim code =

class C
{
    void M(string $$s = "Foo") { }
}

            TestDefaultValue(code, """Foo""")
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub DefaultValue_ExternalCodeParameter_NoDefaultValue()
            Dim code =

class C : System.Console
{
    void M(string $$s = "Foo") { }
}

            TestElement(code,
                        Sub(codeParameter)
                            Dim method = TryCast(codeParameter.Parent, EnvDTE80.CodeFunction2)
                            Assert.NotNull(method)

                            Dim containingType = TryCast(method.Parent, EnvDTE80.CodeClass2)
                            Assert.NotNull(containingType)

                            Dim baseType = TryCast(containingType.Bases.Item(1), EnvDTE80.CodeClass2)
                            Assert.NotNull(baseType)

                            Dim [overloads] = CType(baseType.Members.Item("WriteLine"), EnvDTE80.CodeFunction2).Overloads
                            Dim method2 = CType([overloads].Item(2), EnvDTE80.CodeFunction2)
                            Dim defaultValue = CType(method2.Parameters.Item(1), EnvDTE80.CodeParameter2).DefaultValue
                        End Sub)

        End Sub

#End Region

#Region "FullName tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub FullName()
            Dim code =

class C
{
    void Foo(string $$s)
    {
    }
}

            TestFullName(code, "s")
        End Sub

#End Region

#Region "Kind tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub Kind()
            Dim code =

class C
{
    void Foo(string $$s)
    {
    }
}

            TestKind(code, EnvDTE.vsCMElement.vsCMElementParameter)
        End Sub

#End Region

#Region "ParameterKind tests"
        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_None()
            Dim code =

class C
{
    void Foo(string $$s)
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindNone)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_Ref()
            Dim code =

class C
{
    void Foo(ref string $$s)
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindRef)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_Out()
            Dim code =

class C
{
    void Foo(out string $$s)
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindOut)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_ParamArray()
            Dim code =

class C
{
    void Foo(params string[] $$s)
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindParamArray)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_Optional()
            Dim code =

class C
{
    void Foo(string $$s = "Foo")
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindOptional)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub ParameterKind_OptionalAndRef()
            Dim code =

class C
{
    void Foo(ref string $$s = "Foo")
    {
    }
}

            TestParameterKind(code, EnvDTE80.vsCMParameterKind.vsCMParameterKindOptional Or EnvDTE80.vsCMParameterKind.vsCMParameterKindRef)
        End Sub
#End Region

#Region "Parent tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub Parent1()
            Dim code =

class C
{
    void M(string $$s)
    {
    }
}

            TestParent(code, IsElement("M", kind:=EnvDTE.vsCMElement.vsCMElementFunction))
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub Parent2()
            Dim code =

delegate void Foo(int $$i);

            TestParent(code, IsElement("Foo", kind:=EnvDTE.vsCMElement.vsCMElementDelegate))
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub Parent3()
            Dim code =

class C
{
    int this[int $$i]
    {
        get { return 0; }
    }
}

            TestParent(code, IsElement("this", kind:=EnvDTE.vsCMElement.vsCMElementProperty))
        End Sub

#End Region

#Region "Type tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub Type1()
            Dim code =

class C
{
    public void Foo(int i$$ = 0) { }
}

            TestTypeProp(code,
                         New CodeTypeRefData With {
                             .AsString = "int",
                             .AsFullName = "System.Int32",
                             .CodeTypeFullName = "System.Int32",
                             .TypeKind = EnvDTE.vsCMTypeRef.vsCMTypeRefInt
                         })
        End Sub

#End Region

#Region "Set ParameterKind tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_In()
            Dim code =

class C
{
    void M(out string $$s) { }
}

            Dim expected =

class C
{
    void M(string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindIn)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_None()
            Dim code =

class C
{
    void M(out string $$s) { }
}

            Dim expected =

class C
{
    void M(string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindNone)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_Out()
            Dim code =

class C
{
    void M(ref string $$s) { }
}

            Dim expected =

class C
{
    void M(out string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindOut)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_Ref()
            Dim code =

class C
{
    void M(string $$s) { }
}

            Dim expected =

class C
{
    void M(ref string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindRef)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_Params()
            Dim code =

class C
{
    void M(string[] $$s) { }
}

            Dim expected =

class C
{
    void M(params string[] s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindParamArray)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_ParamsInvalid()
            Dim code =

class C
{
    void M(string $$s) { }
}

            Dim expected =

class C
{
    void M(string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindParamArray, ThrowsArgumentException(Of EnvDTE80.vsCMParameterKind)())
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_Optional()
            Dim code =

class C
{
    void M(string $$s) { }
}

            Dim expected =

class C
{
    void M(ref string s) { }
}

            TestSetParameterKind(code,
                                 expected,
                                 EnvDTE80.vsCMParameterKind.vsCMParameterKindRef Or EnvDTE80.vsCMParameterKind.vsCMParameterKindOptional)
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetParameterKind_Same()
            Dim code =

class C
{
    void M(out string $$s) { }
}

            Dim expected =

class C
{
    void M(out string s) { }
}

            TestSetParameterKind(code, expected, EnvDTE80.vsCMParameterKind.vsCMParameterKindOut)
        End Sub

#End Region

#Region "Set DefaultValue tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetDefaultValue()
            Dim code =

class C
{
    void M(string $$s) { }
}

            Dim expected =

class C
{
    void M(string s = "Foo") { }
}

            TestSetDefaultValue(code, expected, """Foo""")
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetDefaultValue_ReplaceExisting()
            Dim code =

class C
{
    void M(string $$s = "Bar") { }
}

            Dim expected =

class C
{
    void M(string s = "Foo") { }
}

            TestSetDefaultValue(code, expected, """Foo""")
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetDefaultValue_None()
            Dim code =

class C
{
    void M(string $$s = "Bar") { }
}

            Dim expected =

class C
{
    void M(string s) { }
}

            TestSetDefaultValue(code, expected, "")
        End Sub

#End Region

#Region "Set Type tests"

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetType1()
            Dim code =

class C
{
    public void Foo(int $$i) { }
}

            Dim expected =

class C
{
    public void Foo(byte?[,] i) { }
}

            TestSetTypeProp(code, expected, "byte?[,]")
        End Sub

        <ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.CodeModel)>
        Public Sub SetType2()
            Dim code =

delegate void Foo(int $$i) { }

            Dim expected =

delegate void Foo(byte?[,] i) { }

            TestSetTypeProp(code, expected, "byte?[,]")
        End Sub

#End Region

        Protected Overrides ReadOnly Property LanguageName As String
            Get
                Return LanguageNames.CSharp
            End Get
        End Property

    End Class
End Namespace


text:
<md-grid-list
  md-cols-sm="3" md-cols-md="5" md-cols-gt-md="6"
   md-row-height="1:1"
  md-gutter="8px" class="board" >

  <md-grid-tile data-ng-repeat="card in cards" class="card">

  </md-grid-tile>

</md-grid-list>

         joueur en train de jouer : {{currentPlayer.identity.name}}

name: {{player.identity.name}}, paire trouvée: {{player.numberOfRoundFound}}


text:
import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;

import org.junit.Before;
import org.junit.Test;

public class StringSetTest {

	private StringSet set;

	@Before
	public void createSet() {
		set = new StringSet();
	}

	@Test
	public void addTest() {
		assertEquals("count should return 0, because there is no elemenet", 0,
				set.count());
		set.add("newString");
		assertEquals("count should return 1", 1, set.count());
		set.add("newString");
		assertEquals("count should return 1", 1, set.count());
	}

	@Test
	public void removeTest() {
		set.add("newString");
		assertTrue(set.remove("newString"));

	}

	@Test
	public void clearTest() {
		set.add("newString");
		set.add("second string");
		set.clear();
		assertEquals("count should return 0, because set is cleared", 0,
				set.count());

	}

	@Test
	public void countTest() {
		set.add("newString");
		assertEquals("count should return 1", 1, set.count());
		set.add("second string");
		assertEquals("count should return 2", 2, set.count());
		assertTrue(set.remove("newString"));
		assertEquals("count should return 1, because newString is deleted", 1,
				set.count());
		set.clear();
		assertEquals("count should return 0, because set is cleared", 0,
				set.count());

	}

	@Test
	public void containsTest() {
		set.add("newString");
		assertTrue(set.contains("newString"));
		assertFalse(set.contains("aa"));

	}

	@Test
	public void unionTest1() {
		Set<String> s = new HashSet<String>();
		s.add("a");
		set.add("newString");
		set.union(s);
		assertEquals("count should return 2", 2, set.count());

	}

	public void unionTest2() {
		Set<String> s = new HashSet<String>();
		s.add("a");
		s.add("newString");
		set.add("newString");
		set.union(s);
		assertEquals("count should return 2", 2, set.count());

	}

	public void unionTest3() {
		Set<String> s = new HashSet<String>();
		set.union(s);
		assertEquals("count should return 0", 0, set.count());

		set.add("aa");
		assertEquals("count should return 1", 1, set.count());
	}

	@Test
	public void intersectionTest1() {
		Set<String> s = new HashSet<String>();
		s.add("a");
		set.add("a");
		set.intersection(s);
		assertEquals("count should return 1", 1, set.count());

	}

	@Test
	public void intersectionTest2() {
		Set<String> s = new HashSet<String>();
		s.add("a");
		s.add("b");
		set.add("a");
		set.intersection(s);
		assertEquals("count should return 1", 1, set.count());

	}

	@Test
	public void intersectionTest3() {
		Set<String> s = new HashSet<String>();
		set.intersection(s);
		assertEquals("count should return 0", 0, set.count());

		set.add("aa");
		assertEquals("count should return 1", 1, set.count());

	}

	@Test
	public void enumeratorTest1() {
		set.add("elem");
		Enumeration<String> enumer = set.enumerator();
		assertEquals("answer will be elem", "elem", enumer.nextElement());
	}

	@Test
	public void enumeratorTest2() {
		set.add("a");
		set.add("b");
		set.add("c");
		set.add("d");
		Enumeration<String> enumer = set.enumerator();
		ArrayList<String> helper = new ArrayList<String>();
		while (enumer.hasMoreElements())
			helper.add(enumer.nextElement());

		assertEquals("helpers size must be 4", 4, helper.size());
	}

}


text:
/**
 * THIS FILE IS AUTO-GENERATED
 * DON'T MAKE CHANGES HERE
 */
import { parseDependencies } from './dependenciesParse.generated';
import { createHelpClass } from '../../factoriesAny.js';
export var HelpDependencies = {
  parseDependencies: parseDependencies,
  createHelpClass: createHelpClass
};


text:
describe "Application 'sprite-kit-hello-world'" do
  before do
    @app = UIApplication.sharedApplication
  end

  it "has one window" do
    @app.windows.size.should == 1
  end
end


text:
// Copyright (c) Narvalo.Org. All rights reserved. See LICENSE.txt in the project root for license information.

namespace MvpWebForms.Presenters
{
    using System;
    using System.Threading;
    using System.Threading.Tasks;

    using MvpWebForms.Views;
    using Narvalo.Mvp;
    using Narvalo.Mvp.Web;

    public sealed class AsyncTapPresenter : HttpPresenterOf<AsyncModel>
    {
        private static readonly Action s_Thunk = () => Thread.Sleep(10);

        public AsyncTapPresenter(IView<AsyncModel> view)
            : base(view)
        {
            View.Load += Load;
        }

        private void Load(object sender, EventArgs e)
        {
            View.Model.RecordViewLoad();

            AsyncManager.RegisterAsyncTask(InvokeAsync);
        }

        private async Task InvokeAsync()
        {
            View.Model.RecordAsyncStarted();

            await Task.Run(s_Thunk);

            View.Model.RecordAsyncEnded();
        }
    }
}


text:
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import Formsy from 'formsy-react';
import PropTypes from 'prop-types';
import React from 'react';

import HorizontalSelect from '../../ui/forms/HorizontalSelect';
import HorizontalInput from '../../ui/forms/HorizontalInput';

const messages = defineMessages({
  confirm: {
    id: 'TagNodesForm.confirm',
    defaultMessage: 'Tag Nodes'
  },
  cancel: {
    id: 'TagNodesForm.cancel',
    defaultMessage: 'Cancel'
  },
  customProfileLabel: {
    id: 'TagNodesForm.customProfileLabel',
    defaultMessage: 'Custom Profile'
  },
  selectProfileLabel: {
    id: 'TagNodesForm.selectProfileLabel',
    defaultMessage: 'Select Profile'
  },
  noProfileOption: {
    id: 'TagNodesForm.noProfileOption',
    defaultMessage: 'No Profile (Untag)'
  },
  customProfileOption: {
    id: 'TagNodesForm.customProfileOption',
    defaultMessage: 'Specify Custom Profile'
  },
  customProfileDescription: {
    id: 'TagNodesForm.customProfileDescription',
    defaultMessage:
      'Lowercase alphanumeric characters with hyphen as a separator. E.g. "block-storage"'
  },
  customProfileErrorMessage: {
    id: 'TagNodesForm.customProfileErrorMessage',
    defaultMessage: 'You entered characters that are not allowed for this value'
  }
});

class TagNodesForm extends React.Component {
  constructor() {
    super();
    this.state = {
      canSubmit: false,
      showCustomInput: false
    };
  }

  enableButton() {
    this.setState({ canSubmit: true });
  }

  disableButton() {
    this.setState({ canSubmit: false });
  }

  checkSelectedProfile(currentValues, isChanged) {
    if (currentValues.profile === 'custom') {
      this.setState({ showCustomInput: true });
    } else {
      this.setState({ showCustomInput: false });
    }
  }

  handleSubmit(formData, resetForm, invalidateForm) {
    const { customProfile, profile } = formData;
    this.props.onSubmit(profile === 'custom' ? customProfile : profile);
  }

  renderOptions() {
    return this.props.profiles
      .map((profile, index) => <option key={index}>{profile}</option>)
      .concat([
        <option key="spacer1" value="spacer" disabled>
          ──────────
        </option>,
        <option key="noProfile" value="">
          {this.props.intl.formatMessage(messages.noProfileOption)}
        </option>,
        <option key="custom" value="custom">
          {this.props.intl.formatMessage(messages.customProfileOption)}
        </option>
      ]);
  }

  render() {
    const { intl: { formatMessage }, onCancel } = this.props;
    return (
      <Formsy
        ref="tagNodesForm"
        className="form form-horizontal"
        onChange={this.checkSelectedProfile.bind(this)}
        onSubmit={this.handleSubmit.bind(this)}
        onValid={this.enableButton.bind(this)}
        onInvalid={this.disableButton.bind(this)}
      >

          <fieldset>
            <HorizontalSelect
              name="profile"
              title={formatMessage(messages.selectProfileLabel)}
              inputColumnClasses="col-sm-7"
              labelColumnClasses="col-sm-3"
              value=""
            >
              {this.renderOptions()}
            </HorizontalSelect>
            {this.state.showCustomInput ? (
              <HorizontalInput
                name="customProfile"
                title={formatMessage(messages.customProfileLabel)}
                type="text"
                inputColumnClasses="col-sm-7"
                labelColumnClasses="col-sm-3"
                value=""
                validations={{ matchRegexp: /^[0-9a-z]+(-[0-9a-z]+)*$/ }}
                validationError={formatMessage(
                  messages.customProfileErrorMessage
                )}
                description={formatMessage(messages.customProfileDescription)}
                required
              />
            ) : null}
          </fieldset>

          <button
            type="button"
            className="btn btn-default"
            aria-label="Close"
            onClick={onCancel}
          >
            <FormattedMessage {...messages.cancel} />
          </button>
          <button
            className="btn btn-primary"
            disabled={!this.state.canSubmit}
            type="submit"
          >
            <FormattedMessage {...messages.confirm} />
          </button>

      </Formsy>
    );
  }
}
TagNodesForm.propTypes = {
  intl: PropTypes.object.isRequired,
  onCancel: PropTypes.func.isRequired,
  onSubmit: PropTypes.func.isRequired,
  profiles: PropTypes.array.isRequired
};
export default injectIntl(TagNodesForm);


text:
var $                = require('jquery'),
    _                = require('underscore'),
    Backbone         = require('backbone');

var _ListboxItem = Backbone.View.extend({

    tagName: 'li',

    attributes: {
        class: 'base'
    },

    template: JST['ui/controls/listboxItem.html'],

    events: {
        'click': 'handleSelection'
    },

    selected: false,

    initialize: function ( options ) {
        this.$el.hover(this.onMouseOver.bind(this),
                       this.onMouseOut.bind(this));

        if(_.isUndefined(options) || _.isUndefined(options.parentview)) {
            throw new Error('listbox item needs parentview option');
        }

        this.$parentview = options.parentview;
    },

    render: function () {
        this.$el.html(this.template( { display: this.model.get('display') } ) );
    },

    onMouseOver: function (e) {
        this.$el.addClass('hover');
    },

    onMouseOut: function (e) {
        this.$el.removeClass('hover');
    },

    select: function () {
        this.selected = true;
        this.$el.addClass('selected');
    },

    deselect: function () {
        this.selected = false;
        this.$el.removeClass('selected');
    },

    handleSelection: function (e) {
        if(this.selected) {
            this.selected = false;
            this.$el.removeClass('selected');
            this.$parentview.trigger('listbox-item-deselected', {cid: this.cid});
        }
        else {
            this.selected = true;
            this.$el.addClass('selected');
            this.$parentview.trigger('listbox-item-selected', {cid: this.cid});
        }
    }
});

function _create( options ) {
    return new _ListboxItem( options );
}
exports.create = _create;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Zukalia parasitans Höhn.

### Remarks
null