text:
(function (scope) {
	scope.Model = Polymer({

		is:"mm-model",

		properties: {
			_sync:{
				type:StrandLib.Sync,
				value:function() {
					return new StrandLib.Sync();
				}
			},
			_model:{
				type:StrandLib.Model,
				value:function() {
					return new StrandLib.Model(null, null, this._sync);
				}
			},
			collection:{
				type:Strand.Collection,
				value:null,
			},
			adapter:{
				type:String,
				value:"Sync",
			},
			defaults:{
				type:Object,
				value: function() {
					return {};
				}
			}
		},

		behaviors:[
			StrandTraits.DomSyncable
		],

		ready:function() {
			this.linkPaths("_model.data","data");
			this.linkPaths("data","_model.data");
		},

		init: function(data) {
			this._model.init(data || this.defaults);
		},

		adapterChanged: function(oldAdapter, newAdapter) {
			if (typeof newAdapter === "string" && window[newAdapter]) {
				this.adapterInstance = new window[newAdapter]();
				this.adapterInstance.target = this;
				this.adapterInstance.auto = this.auto;
			}
		},

		autoChanged: function(oldAuto, newAuto) {
			if (this.adapterInstance)
				this.adapterInstance.auto = newAuto;
		},

		save: function() {
			return this.connection.post();
		},

		update: function() {
			return this.connection.put();
		},

		fetch: function() {
			return this.connection.get();
		},

		destroy: function() {
			return this.connection.delete();
		},

		clear: function() {
			this._model.clear();
		},

		getData: function(path) {
			return this._model.get(path);
		},

		setData: function(path, value) {
			this._model.set(path, value);
		},

		toJSON: function() {
			return this._model.toJSON();
		},

		get connection() {
			return this._model.connection;
		},

		//proxy accessors to _model.data

		get mId() {
			return this._model.mId;
		},

		get cId() {
			return this._model.cId;
		},

		set mId(i) {
			this._model.mId = i;
		},

		set cId(i) {
			this._model.cId = i;
		},

		get data() {
			return this._model.data;
		},

		set data(i) {
			this._model.data = i;
			this.fire("data-changed");
		}

	});
})(window.Strand = window.Strand || {});


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

<title>org.springframework.transaction (Spring Framework 4.3.3.RELEASE API)</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Spring Framework

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.springframework.transaction

Exception hierarchy for Spring's transaction infrastructure,
 independent of any specific transaction management system.

See: Description

Interface Summary

Interface
Description

PlatformTransactionManager

This is the central interface in Spring's transaction infrastructure.

SavepointManager

Interface that specifies an API to programmatically manage transaction
 savepoints in a generic fashion.

TransactionDefinition

Interface that defines Spring-compliant transaction properties.

TransactionStatus

Representation of the status of a transaction.

Exception Summary

Exception
Description

CannotCreateTransactionException

Exception thrown when a transaction can't be created using an
 underlying transaction API such as JTA.

HeuristicCompletionException

Exception that represents a transaction failure caused by a heuristic
 decision on the side of the transaction coordinator.

IllegalTransactionStateException

Exception thrown when the existence or non-existence of a transaction
 amounts to an illegal state according to the transaction propagation
 behavior that applies.

InvalidIsolationLevelException

Exception that gets thrown when an invalid isolation level is specified,
 i.e.

InvalidTimeoutException

Exception that gets thrown when an invalid timeout is specified,
 that is, the specified timeout valid is out of range or the
 transaction manager implementation doesn't support timeouts.

NestedTransactionNotSupportedException

Exception thrown when attempting to work with a nested transaction
 but nested transactions are not supported by the underlying backend.

NoTransactionException

Exception thrown when an operation is attempted that
 relies on an existing transaction (such as setting
 rollback status) and there is no existing transaction.

TransactionException

Superclass for all transaction exceptions.

TransactionSuspensionNotSupportedException

Exception thrown when attempting to suspend an existing transaction
 but transaction suspension is not supported by the underlying backend.

TransactionSystemException

Exception thrown when a general transaction system error is encountered,
 like on commit or rollback.

TransactionTimedOutException

Exception to be thrown when a transaction has timed out.

TransactionUsageException

Superclass for exceptions caused by inappropriate usage of
 a Spring transaction API.

UnexpectedRollbackException

Thrown when an attempt to commit a transaction resulted
 in an unexpected rollback.

Package org.springframework.transaction Description

Exception hierarchy for Spring's transaction infrastructure,
 independent of any specific transaction management system.
 Contains transaction manager, definition, and status interfaces.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Spring Framework

Prev Package

Next Package

Frames

No Frames

All Classes

redpajama_set_name: RedPajamaGithub


text:
namespace BrakePedal
{
    public class SimpleThrottleKey : IThrottleKey
    {
        public SimpleThrottleKey(params object[] values)
        {
            Values = values;
        }

        public object[] Values { get; private set; }
    }
}


text:
package com.airbnb.aerosolve.training

import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactory
import org.junit.Test
import org.apache.spark.SparkContext

class ScoreCalibratorTest {
  val log = LoggerFactory.getLogger("ScoreCalibratorTest")

  def makeConfigBatch: String = {
    """
      |model_config {
      |  iterations : 500
      |  learning_rate : 10.0
      |  rate_decay : 0.95
      |  tolerance : 0.00001
      |}
    """.stripMargin
  }

  def makeConfigSGD: String = {
    """
      |model_config {
      |  iterations : 500
      |  learning_rate : 0.1
      |  rate_decay : 0.95
      |  num_bags : 10
      |  tolerance : 0.0001
      |}
    """.stripMargin
  }

  @Test
  def testScoreCalibrator(): Unit = {
    // generate random number in the range of (min_score, max_score) as scores
    val num = 30000
    val a = -1.5
    val b = 2

    val r = new scala.util.Random(num * 2)
    // generate random number in the range (0, 1)
    val data = Array.fill(num)(r.nextDouble())
    val prob = data.map(x => 1.0 / (1.0 + math.exp(- a - b * x))) // probability of being positive
    val trainData = data.zip(prob).map(x => (x._1, if (r.nextDouble() <= x._2) true else false))

    var sc = new SparkContext("local", "ScoreCaliboratorTest")

    try {
      testScoreCalibratorRun(sc, trainData, "SGD", a, b)
      testScoreCalibratorRun(sc, trainData, "Batch", a, b)
    }
    finally {
      sc.stop
      sc = null
      // To avoid Akka rebinding to the same port,
      // since it doesn't unbind immediately on shutdown
      System.clearProperty("spark.master.port")
    }
  }

  def testScoreCalibratorRun(sc : SparkContext,
                             trainData : Array[(Double, Boolean)],
                             trainType : String,
                             offset : Double,
                             slope : Double): Unit = {

    val trainRDD = sc.parallelize(trainData)
    val config = trainType match {
      case "Batch" => ConfigFactory.parseString(makeConfigBatch)
      case "SGD" => ConfigFactory.parseString(makeConfigSGD)
    }

    val result = trainType match {
      case "Batch" => ScoreCalibrator.trainBatchMLE(config.getConfig("model_config"), trainData)
      case "SGD" => ScoreCalibrator.trainSGD(config.getConfig("model_config"), trainRDD)
      }

    assert(result.nonEmpty)

    log.info("offset = %f, slope = %f".format(result(0), result(1)))
    val errorOffset = math.abs(offset - result(0))
    val errorSlope = math.abs(slope - result(1))
    log.info("Absolute error: offset %f, slope %f".format(errorOffset, errorSlope))
    log.info("Relative error: offset %f, slope %f".format(errorOffset / math.abs(offset), errorSlope / math.abs(slope)))
    assert(errorOffset / math.abs(offset) < 0.1 && errorSlope / math.abs(slope) < 0.1)
    }
}


text:
from iptest.assert_util import skiptest
skiptest("win32", "cli64", "posix")
from iptest.cominterop_util import *

import System

#------------------------------------------------------------------------------
#--GLOBALS

#------------------------------------------------------------------------------
#--TESTS
def test_cp18225():
    com_obj_cmd = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Command"))
    com_obj_cmd.CommandTimeout = 50
    AreEqual(com_obj_cmd.CommandTimeout, 50)

    com_obj_conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection"))
    com_obj_conn.CommandTimeout = 40
    AreEqual(com_obj_conn.CommandTimeout, 40)

#------------------------------------------------------------------------------
run_com_test(__name__, __file__)


text:
page_type: sample
products:
- office-sp
languages:
- javascript
- csharp
extensions:
  contentType: samples
  technologies:
  - Add-ins
  createdDate: 1/1/2016 12:00:00 AM
---
# Making out of the box Seattle master responsive #

### Summary ###
Demonstrate how to update out of the box seattle.master user expirience responsive without a need to modify the master page as such, but rather to take advantage of the AlternateCssUrl property in Web level. Responsive CSS design has been done by Heather Solomon and you can read more information about the CSS details from following blog post.

* Heather Solomon (SharePoint Experts, Inc) - [Making Seattle master responsive](http://blog.sharepointexperience.com/2015/03/making-seattle-master-responsive/)

To make sure the css is rendered correctly on hardware devices a viewport html meta tag needs to be added to the master page. This can be accomplied by using the Search Engine Optimization Settings. Again the master page doesn't need to be edited. More details on this are covered in the following blog post.

* Stefan Bauer (n8d) - [How to add viewport meta without editing the master page](http://www.n8d.at/blog/how-to-add-viewport-meta-without-editing-the-master-page/)

*Notice* - There's more fine tuned and polished responsive UI CSS included in the PnP Partner Pack, which can be accessed from http://aka.ms/OfficeDevPnPPartnerPack.

### Applies to ###
-  Office 365 Multi Tenant (MT) - Classic sites
-  Office 365 Dedicated (D)*
-  SharePoint 2013 on-premises*
-  SharePoint 2016 on-premises*

Experience might be slightly different, but the same thinking and process applies to on-premises as well.

### Solution ###
Solution | Author(s)
---------|----------
Branding.InjectResponsiveCSS | Heather Solomon (**SharePoint Experts, Inc**)

Packaging and remote provisioning with AlternateCSSUrl approach done by Vesa Juvonen, Microsoft
Provisioning of viewport meta tag settings done by Stefan Bauer, n8d

### Version history ###
Version  | Date | Comments
---------| -----| --------
1.3  | November 30th 2016 | Updated to use PnP CSOM Core to be consistent with other responsive samples from PnP
1.2  | November 19th 2015 | Small polishing on the code and adjustments in the documentation
1.1  | May 2nd 2015 | Viewport meta tag added
1.0  | April 26th 2015 | Initial release

### Disclaimer ###
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

----------

# November 2016 Update details #
Below screenshots and the process applies on classic approach. If you use the PnP CSOM Core component available as NuGet package for SharePoint Online, SharePoint 2016 and SharePoint 2013, you can simply run following command in the code. This will apply needed CSS and JS on the site.

```C#
// Get access to source site
using (var ctx = new ClientContext(siteUrl))
{
    ctx.AuthenticationMode = ClientAuthenticationMode.Default;
    ctx.Credentials = new SharePointOnlineCredentials(userName, pwd);

    // Enable Responsive UI in the site - Will apply needed CSS and JS to site
    ctx.Web.EnableResponsiveUI();

    // Disable Responsive UI in the site - Will remove CSS and JS from site.
    // ctx.Web.DisableReponsiveUI();
}
```

# Responsive Experience #
Please check Heather's blog post for detailed information on the CSS design at [http://blog.sharepointexperience.com/2015/03/making-seattle-master-responsive](http://blog.sharepointexperience.com/2015/03/making-seattle-master-responsive/)

Here's three pictures which are showing how the responsive CSS will behave when screen size is adjusted.

![Normal sized team site](http://i.imgur.com/I0PR6Qj.png)

Notice how the left navigation is removed the search box has been relocated.

![Tablet sized team site](http://i.imgur.com/iyAHWFh.png)

Notice how the top navigation is rendered completely differently

![Mobile sized team site](http://i.imgur.com/u9yYn8V.png)

If navigation control is clicked, user is presented the same list of navigation options

![Menu shown after click](http://i.imgur.com/BRtYm79.png)

# Attaching custom css to site #
Attaching the css to the site is two step process. We upload the CSS to some location where it can be used from and then we update the AlternateCssUrl property of the web to the right URL.

Here's the code for uploading css to the site assets library using *FileCreationInformation* object.

```C#
/// <summary>
/// Uploads used CSS and site logo to host web
/// </summary>
/// <param name="web"></param>
    private static void UploadAssetsToHostWeb(Web web)
    {
        // Ensure site asset library exists in case of a publishing web site
        web.Lists.EnsureSiteAssetsLibrary();

        // Instance to site assets
        List assetLibrary = web.Lists.GetByTitle("Site Assets");
        web.Context.Load(assetLibrary, l => l.RootFolder);

        // Get the path to the file which we are about to deploy
        string cssFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "resources/spe-seattle-responsive.css");

        // Use CSOM to upload the file in
        FileCreationInformation newFile = new FileCreationInformation
        {
            Content = System.IO.File.ReadAllBytes(cssFile),
            Url = "spe-seattle-responsive.css",
            Overwrite = true
        };
        Microsoft.SharePoint.Client.File uploadFile = assetLibrary.RootFolder.Files.Add(newFile);
        web.Context.Load(uploadFile);
        web.Context.ExecuteQuery();
    }

```

After the CSS is available, we can just set the AlternateCssUrl property, so that it's taken into use automatically by the site when browsers are accessing it.

```C#
web.AlternateCssUrl = ctx.Web.ServerRelativeUrl + "/SiteAssets/spe-seattle-responsive.css";
web.Update();
web.Context.ExecuteQuery();
```

After setting the CSS Url, the viewport meta tag will be added to the "Search Engine Optimization Settings". This makes sure that the CSS values will be shown correctly on any hardware device.

```C#
    if (allProperties.FieldValues.ContainsKey("seoincludecustommetatagpropertyname")) {
        allProperties["seoincludecustommetatagpropertyname"] = true.ToString();
    }
    // Add value of custom meta tag
    if (allProperties.FieldValues.ContainsKey("seocustommetatagpropertyname"))
    {
        allProperties["seocustommetatagpropertyname"] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" />";
    }
```

<img src="https://telemetry.sharepointpnp.com/pnp/samples/Branding.InjectResponsiveCSS" />


text:
%  chadstyle.sty   Chad Jones, 5/1/08
%
%  Chad's style file for nice paper format.
%  Various ideas for this style are taken from
%    -- Matthias Doepke and Michele Tertilt
%    -- Tony Roberts

\special{papersize=8.5in,11in}
%\usepackage{palatino,amssymb,amsfonts,amsmath,latexsym,setspace}
\usepackage{utopia,amssymb,amsfonts,amsmath,latexsym,setspace}
\usepackage[dvips]{graphicx}
\usepackage{natbib,fancyhdr}


text:
package org.js4ms.ip;

import java.nio.ByteBuffer;
import java.util.logging.Level;

import org.js4ms.common.exception.ParseException;

/**
 * Represents an IP No-Operation Option (Option 1).
 * Typically used to adjust alignment of subsequent options.
 * The Type field has the following value:
 * Copy=1|0, Class=0, Option=1
 *
 * <pre>
 * +-+-+-+-+-+-+-+-+
 * |?|0 0|0 0 0 0 1|
 * +-+-+-+-+-+-+-+-+
 * </pre>
 *
 * @author Gregory Bumgardner (gbumgard)
 */
public final class IPNoOperationOption
                extends IPSingleByteHeaderOption {

    /*-- Inner Classes ------------------------------------------------------*/

    /**
     *
     */
    public static class Parser
                    implements IPHeaderOption.ParserType {

        @Override
        public IPHeaderOption parse(final ByteBuffer buffer) throws ParseException {
            return new IPNoOperationOption(buffer);
        }

        @Override
        public Object getKey() {
            return IPNoOperationOption.OPTION_CODE;
        }
    }

    /*-- Static Variables ---------------------------------------------------*/

    /** */
    public static final int OPTION_CLASS = 0;

    /** */
    public static final int OPTION_NUMBER = 1;

    /** */
    public static final byte OPTION_CODE = OPTION_CLASS | OPTION_NUMBER;

    /*-- Member Functions ---------------------------------------------------*/

    /**
     *
     */
    public IPNoOperationOption() {
        super(OPTION_CODE);

        if (logger.isLoggable(Level.FINER)) {
            logger.finer(this.log.entry("IPNoOperationOption.IPNoOperationOption"));
        }
    }

    /**
     * @param copyFlag
     */
    public IPNoOperationOption(final boolean copyFlag) {
        super(copyFlag, OPTION_CLASS, OPTION_NUMBER);

        if (logger.isLoggable(Level.FINER)) {
            logger.finer(this.log.entry("IPNoOperationOption.IPNoOperationOption", copyFlag));
        }
    }

    /**
     * @param buffer
     */
    public IPNoOperationOption(final ByteBuffer buffer) {
        super(buffer);
        if (logger.isLoggable(Level.FINER)) {
            logger.finer(this.log.entry("IPNoOperationOption.IPNoOperationOption", buffer));
        }
    }

}


text:
package org.medipi.clinical.threshold;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import org.medipi.clinical.dao.AttributeThresholdDAOImpl;
import org.medipi.clinical.dao.DirectMessageTextDAOImpl;
import org.medipi.clinical.dao.RecordingDeviceDataDAOImpl;
import org.medipi.clinical.entities.AttributeThreshold;
import org.medipi.clinical.entities.RecordingDeviceData;
import org.medipi.clinical.logging.MediPiLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @author rick@robinsonhq.com
 */
@Component
public class RelativeInclusiveHighTest implements AttributeThresholdTest {

    private static final String ABSOLUTE_REFERENCE = "__ABSOLUTE_REFERENCE__";
    private static final String UPPER_THRESHOLD_LIMIT = "__UPPER_THRESHOLD_LIMIT__";
    private static final String DATA_VALUE = "__DATA_VALUE__";
    private static final String ATTRIBUTE_UNITS = "__ATTRIBUTE_UNITS__";
    private static final String MEDIPICLINICALALERTPASSEDTESTTEXT = "medipi.clinical.alert.relativeinclusivehightest.passedtesttext";
    private static final String MEDIPICLINICALALERTFAILEDTESTTEXT = "medipi.clinical.alert.relativeinclusivehightest.failedtesttext";
    private static final String MEDIPICLINICALALERTCANTCALCULATETESTTEXT = "medipi.clinical.alert.relativeinclusivehightest.cantcalculatetesttext";

    @Autowired
    private RecordingDeviceDataDAOImpl recordingDeviceDataDAOImpl;

    @Autowired
    private AttributeThresholdDAOImpl attributeThresholdDAOImpl;

    @Autowired
    private DirectMessageTextDAOImpl directMessageTextDAOImpl;

    private Properties properties;
    private AttributeThreshold attributeThreshold;
    private double absoluteReference;
    private double highValue;
    private double dataValue;
    private String attributeUnits = null;

    private String failedTestText = null;
    private String passedTestText = null;
    private String cantCalculateTestText = null;

    /**
     * Initialises the threshold test setting the parameters for its use
     *
     * @param properties properties class
     * @param attributeThreshold to obtain attributes from the DB
     * @throws Exception
     */
    @Override
    public void init(Properties properties, AttributeThreshold attributeThreshold) throws Exception {
        failedTestText = this.directMessageTextDAOImpl.findByDirectMessageTextId(MEDIPICLINICALALERTFAILEDTESTTEXT).getDirectMessageText();
        cantCalculateTestText = this.directMessageTextDAOImpl.findByDirectMessageTextId(MEDIPICLINICALALERTCANTCALCULATETESTTEXT).getDirectMessageText();
        passedTestText = this.directMessageTextDAOImpl.findByDirectMessageTextId(MEDIPICLINICALALERTPASSEDTESTTEXT).getDirectMessageText();

        absoluteReference = getLowValue(attributeThreshold.getThresholdLowValue());
        highValue = getHighValue(attributeThreshold.getThresholdHighValue());

    }

    private double getLowValue(String low) throws Exception {
        try {
            return Double.valueOf(low);
        } catch (NumberFormatException nfe) {
            MediPiLogger.getInstance().log(RelativeInclusiveHighTest.class.getName() + "error", "Error in converting the absolute value to a double " + nfe.getLocalizedMessage());
            System.out.println("Error in converting the absolute value to a double" + nfe.getLocalizedMessage());
            throw new Exception("Error in converting the absolute value to a double");
        }
    }

    private double getHighValue(String high) throws Exception {
        try {
            return Double.valueOf(high);
        } catch (NumberFormatException nfe) {
            MediPiLogger.getInstance().log(RelativeInclusiveHighTest.class.getName() + "error", "Error in converting the high threshold values to a double " + nfe.getLocalizedMessage());
            System.out.println("Error in converting the high threshold values to a double" + nfe.getLocalizedMessage());
            throw new Exception("Error in converting the high threshold values to a double");
        }
    }

    private double getDataValue(String data) throws Exception {
        try {
            return Double.valueOf(data);
        } catch (NumberFormatException nfe) {
            MediPiLogger.getInstance().log(RelativeInclusiveHighTest.class.getName() + "error", "Error in converting the data values to a double " + nfe.getLocalizedMessage());
            System.out.println("Error in converting the data values to a double" + nfe.getLocalizedMessage());
            throw new Exception("Error in converting the data values to a double");
        }
    }

    /**
     * Method to test if a new measurement is in or out of threshold
     *
     * @param rdd data to be tested as part of a RecordingDeviceData object
     * @return returns true if test in within bounds false if test is out of
     * bounds
     */
    @Override
    public Boolean test(RecordingDeviceData rdd) {
        try {
            attributeUnits = rdd.getAttributeId().getAttributeUnits();
            dataValue = Double.valueOf(rdd.getDataValue());

            return (dataValue < absoluteReference + highValue);

        } catch (NumberFormatException nfe) {
            MediPiLogger.getInstance().log(RelativeInclusiveHighTest.class.getName() + "error", "Error in converting the incoming data value to be tested to a double " + nfe.getLocalizedMessage());
            System.out.println("Error in converting the incoming data value to be tested to a double" + nfe.getLocalizedMessage());
            return null;
        } catch (Exception e) {
            MediPiLogger.getInstance().log(RelativeInclusiveHighTest.class.getName() + "error", "Error in testing the simple inclusive high low value: " + e.getLocalizedMessage());
            System.out.println("Error in testing the simple inclusive high low value: " + e.getLocalizedMessage());
            return null;
        }
    }

    /**
     * Method to return a descriptive string taken from the properties file and
     * substituted with values from the measurement data describing a failure
     * condition
     *
     * @return descriptive string of the alert
     */
    @Override
    public List<Double> getThreshold(RecordingDeviceData rdd) throws Exception {
        return getThreshold(rdd.getAttributeId().getAttributeId(), rdd.getPatientUuid().getPatientUuid(), rdd.getDataValueTime(), rdd.getDataValue());
    }

    @Override
    public List<Double> getThreshold(int attributeId, String patientUuid, Date dataValueTime, String dataValue) throws Exception {
        AttributeThreshold at = attributeThresholdDAOImpl.findLatestByAttributeAndPatientAndDate(attributeId, patientUuid, dataValueTime);
        if (at == null) {
            return null;
        } else {
            double low = getLowValue(at.getThresholdLowValue());
            double high = low + getHighValue(at.getThresholdHighValue());
            List<Double> thresholdList = new ArrayList<>();

            thresholdList.add(low);
            thresholdList.add(high);
            return thresholdList;
        }
    }

    /**
     * Method to return a descriptive string taken from the properties file and
     * substituted with values from the measurement data describing a
     * non-failure condition
     *
     * @return descriptive string of the alert
     */
    @Override
    public String getFailedTestText() {
        String response = failedTestText
                .replace(DATA_VALUE, String.valueOf(dataValue))
                .replace(ATTRIBUTE_UNITS, attributeUnits)
                .replace(UPPER_THRESHOLD_LIMIT, String.valueOf(highValue))
                .replace(ABSOLUTE_REFERENCE, String.valueOf(absoluteReference));
        return response;
    }

    @Override
    public String getPassedTestText() {
        String response = passedTestText
                .replace(DATA_VALUE, String.valueOf(dataValue))
                .replace(ATTRIBUTE_UNITS, attributeUnits)
                .replace(UPPER_THRESHOLD_LIMIT, String.valueOf(highValue))
                .replace(ABSOLUTE_REFERENCE, String.valueOf(absoluteReference));
        return response;
    }

    @Override
    public String getCantCalculateTestText() {
        String response = cantCalculateTestText
                .replace(DATA_VALUE, String.valueOf(dataValue))
                .replace(ATTRIBUTE_UNITS, attributeUnits)
                .replace(UPPER_THRESHOLD_LIMIT, String.valueOf(highValue))
                .replace(ABSOLUTE_REFERENCE, String.valueOf(absoluteReference));
        return response;
    }

}


text:
.button_4 {
    background: url("images/nav4.png") no-repeat scroll 0 0 transparent;
    margin-left: 10px;
    padding: 4px 13px 3px;
}
.item {
    padding-left: 3%;
}
.submit_friendships {
    padding-left: 18%;
}


text:
* SVN: Fix checkUpdateNeeded when externals were used (#106, thanks pstanoev)
* SVN: Fix creating tags when subdirectories are used in tagname (#110, thanks kmoens)

### Changes

* COMMON: Added cli option ```release.useAutomaticVersion``` to normalize with the other options. ```gradle.release.useAutomaticVersion``` will be deprecated in the future.

## 2.1.1
##### Released: 2. June 2015

### Bugfixes

* SVN: Fix exception when externals were used (#106, thanks pstanoev)
* SVN: Fix externals not to be detected as uncommited changes

## 2.1.0
##### Released: 29. May 2015

This release contains new features but was also the target of some internal refactorings.
Due to the refactoring one minor breaking change had to be done. See the list below for details and the [upgrade instructions](UPGRADE.md#20-to-21).

### **Breaking Changes**

* GIT: The configuration options are now all contained in the release closure. If you were using one of the options ```requireBranch```, ```pushToRemote``` or ```pushToCurrentBranch``` you need to adjust your config. See [upgrade instructions](UPGRADE.md#20-to-21).

### New Features

* COMMON: New flexible configuration ```tagTemplate``` to specify the name of the tag. (#96)
* COMMON: Refactored the build process during release to run in separate process. This will hopefully resolve all the issues with certain other plugins like the new maven-publish or the bintray plugin.
* COMMON: Added **beforeReleaseBuild** and **afterReleaseBuild** hook, which both run in the same process as the build itself.
* COMMON: Added a convenient way for external adapters to be used instead of the supplied ones. Documentation and example to follow.
* SVN: Allow credentials to be specified
    * Either with commandline parameters ```gradle release -Prelease.svn.username=eric -Prelease.svn.password=secret```
    * Or directly inside your build.gradle: (This is a silly example, don't put your credentials under version control! For security reasons you might want to put variables inside your [users properties](https://gradle.org/docs/current/userguide/build_environment.html) file and reference them in the projects gradle script)

```
release {
    svn {
        username = eric
        password = secret
    }
}
```

### Changes

* COMMON: The SCM adapter is now lazy loaded and does not require an scm to be present during plugin initialization. New task `createScmAdapter` added at the beginning of release, which handles the creation of the correct scm adapter.

### Deprecated Features

* COMMON: The configuration options ```includeProjectNameInTag``` and ```tagPrefix``` are deprecated and will be remove with 3.0. Please migrate to ```tagTemplate```.  See [upgrade instructions](UPGRADE.md#20-to-21). (#96)
* COMMON: Depending on any internal release task like **createReleaseTag** is highly discouraged. Use the **beforeReleaseBuild** or **afterReleaseBuild** tasks. See [upgrade instructions](UPGRADE.md#20-to-21).

## 2.0.2
##### Released: 17. Feb 2015

### Bugfixes

* SVN: Fixed running release plugin without using snapshot versions (#91 #92, thanks mwhipple)

## 2.0.1
##### Released: 11. Feb 2015

### Bugfixes

* GIT: Fixed running release plugin on windows (#90, thanks SanderDN)

## 2.0.0
##### Released: 4. Feb 2015

### New Features

* COMMON: The release version and new version can be supplied as cli parameters (#44, #67, thanks thokuest)
* GIT: Option to disable pushing to remote (#41, #33, thanks szpak)
* GIT: Option to change name of remote to push to

### Changes

* Package of classes had to be changed from ```release```to ```net.researchgate.release```. (This is only relevant if you imported some of the classes directly in your code.)
* COMMON: Better error message if updating of version fails

### Bugfixes

* COMMON: Fixed problems with setting custom versionPropertyFile (#56, #57, #58, thanks jeffastorey)
* GIT: Fixed calling release plugin in sub-project with git repository in parent (#35, thanks szpak)
* GIT: Fixed setting requireBranch to empty string (#40, thanks szpak)
* HG: Only check for incoming and outgoing changes on current branch for Mercurial (#76, thanks litpho)
* SVN: Fixed SVN release on windows (#39, #68, thanks thokuest)
* SVN: Fix creating branch from correct revision (#48)
* SVN: Set proper environment for svn client (#52, #86)


text:
## [1.0.0-beta.3](https://github.com/basvandenberg/angular2-select/compare/1.0.0-beta.2...1.0.0-beta.3) (2017-02-11)

### Breaking changes

- Empty multi-select returns empty array as value instead of empty string (#104).

### Features

- Trigger `noOptionsFound` event if no options found after filter (#73).

### Bug fixes

- Same placeholder styling single and multiple select (#67).
- Prevent selecting option if filter shows 'No results found' (#74).
- Update value after deselecting options that are not present in updated list
  of options (#75).
- Fixed test if new value is different from current value (#76).
- Fixed key handlers, prevent selecting multi-select option when pressing space
  key (#78).
- Hide clear button when nothing is selected (#90).
- Remove padding above option list if filter is disabled (#98).

### Improvements

- Throw `TypeError` when trying to set a non-string or non-Array value.
- For empty multiselect, return empty array instead of empty string (#104).
- Don't force color/highlight styles when not directly set (#97).

## [1.0.0-beta.2](https://github.com/basvandenberg/angular2-select/compare/1.0.0-beta.1...1.0.0-beta.2) (2017-01-12)

### Bug fixes

- Single select returns value as string instead of array (#66).

## [1.0.0-beta.1](https://github.com/basvandenberg/angular2-select/compare/1.0.0-beta.0...1.0.0-beta.1) (2017-01-08)

### Bug fixes

- Removed accidentally included `console.log`'s in published npm package. (#64).

## [1.0.0-beta.0](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.12...1.0.0-beta.0) (2017-01-07)

### Breaking changes

- Changed styling, Sass stylesheet for select and dropdown component instead of the original select2 CSS file.

### Features

- Set background color and text color of highlighted option (#61).
- Set width of select component with `ngStyle` (#59).
- Hide filter if number of options is less than given number (#44).
- Set custom text for 'No results found' (#9).
- Functions `open` and `close` to open/close drop down from ts (#43).
- Disable select component.
- Clear selection function.

### Improvements

- Switched from using [npm](https://www.npmjs.com/) to [yarn](https://yarnpkg.com/) for package management.
- Call `onTouched` when focus on select component (#24).
- Added demo page with examples.
- Simplified HTML structure with more intuitive classes.
- Moved logic to separate option and option-list classes.

### Bug fixes

- Greyed out placeholder text for singe select (#48).
- Close all drop downs on click outside, close drop down when pressing tab key (#58).

## [1.0.0-alpha.12](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.11...1.0.0-alpha.12)

### Breaking changes

- The method `clearSelected` is changed to `clear`.

### Bug fixes

- Trigger `deselected` event on clear single select click (#23).
- Typo fixes.

## [1.0.0-alpha.11](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.10...1.0.0-alpha.11)

- Update to Angular 2.1.0.

## [1.0.0-alpha.10](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.9...1.0.0-alpha.10)

### Bug fixes

- Fix errors in package.json and tsconfig.json ([#18] (https://github.com/basvandenberg/angular2-select/issues/18)).
- Fix empty value multi-select, so that required validator works ([#21] (https://github.com/basvandenberg/angular2-select/issues/21)).
- Fix setting value of single select ([#19] (https://github.com/basvandenberg/angular2-select/issues/19)).

### Improvements

- Set ViewEncapsulation to None to enable style override ([#16] (https://github.com/basvandenberg/angular2-select/issues/16)).

## [1.0.0-alpha.9](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.8...1.0.0-alpha.9) (2016-10-05)

### Bug fixes

- Fix gulp watch task.
- Fix gulp build taks.
- Fix tsconfig, and added types to compilerOptions.
- Fix AoT build, made some variables public.

## [1.0.0-alpha.8](https://github.com/basvandenberg/angular2-select/compare/1.0.0-alpha.7...1.0.0-alpha.8) (2016-10-01)

### Features

- Added ngc/AoT support ([#11] (https://github.com/basvandenberg/angular2-select/pull/11)).

### Bug fixes

- Fix clear selection using form control's setValue function ([#5] (https://github.com/basvandenberg/angular2-select/issues/5)).
- Update current selection when option list is changed ([#6] (https://github.com/basvandenberg/angular2-select/issues/6)).
- Prevent javascript error when list of options is empty ([#7] (https://github.com/basvandenberg/angular2-select/issues/7)).
- Prevent javascript error when clicking the 'No results found' option ([#8] (https://github.com/basvandenberg/angular2-select/issues/8)).


text:
try:
    import os.path
except ImportError:
    pass

import os

def function(self):
    import sys

if a == b:
    import sys

def function2(self):
    if a == b:
        import platform

def function3(self):
    import platform
    import email

import email


text:
import { createStore, applyMiddleware } from "redux";
import reducer from "../reducer";
import thunk from 'redux-thunk'
import createLogger from 'redux-logger'

const store = createStore(reducer, {}, applyMiddleware(thunk, createLogger()));

if (module.hot) {
    module.hot.accept('../reducer', () => {
        const nextRootReducer = require('../reducer')
        store.replaceReducer(nextRootReducer)
    })
}

export default store;


text:
cask "launchcontrol" do
  version "1.50.1"
  sha256 "3bb6ad46e8610b093321f0fc71d7d580f4c3aa6c54ffdb435f1dc8988183b0dc"

  url "https://www.soma-zone.com/download/files/LaunchControl-#{version}.tar.bz2"
  appcast "https://www.soma-zone.com/LaunchControl/a/appcast_update.xml"
  name "LaunchControl"
  desc "Create, manage and debug system- and user services"
  homepage "https://www.soma-zone.com/LaunchControl/"

  auto_updates true

  app "LaunchControl.app"

  uninstall delete:    "/Library/PrivilegedHelperTools/com.soma-zone.LaunchControl.Helper",
            launchctl: "com.soma-zone.LaunchControl.Helper",
            quit:      [
              "com.soma-zone.JobWatch",
              "com.soma-zone.LaunchControl",
              "com.soma-zone.LicenseWindow",
              "com.soma-zone.QuickLaunch",
            ]

  zap trash: [
    "~/Library/Application Support/LaunchControl",
    "~/Library/Caches/com.apple.helpd/Generated/com.soma-zone.LaunchControl.help*",
    "~/Library/Caches/com.apple.helpd/Generated/LaunchControl Help*",
    "~/Library/Caches/com.soma-zone.LaunchControl",
    "~/Library/Preferences/com.soma-zone.LaunchControl.plist",
  ]
end


text:
from collections import defaultdict

guards = defaultdict(int)
mins = defaultdict(list)

a = sorted([_.replace('[','').replace(']','').replace('#','').split() for _ in open('4.in')])

a = [ [int(_[1].split(':')[1])] + _[2:] for _ in a]

current,start = 0, 0

for line in a:
    if 'Guard' in line:
        current = int(line[2])
    elif 'falls'in line:
        start = line[0]
    elif 'wakes'in line:
        end = line[0]
        guards[current]+= end-start
        for i in xrange(start,end):
            mins[i].append(current)

best_guard = max(guards, key=guards.get)
best_minute = max(mins, key=lambda x: mins[x].count(best_guard))

print best_guard*best_minute


text:
#include "Scene.h"
#include "TexQuad.h"

#include <algorithm>
#include <fstream>
#include <sstream>

#include <glm/glm.hpp>
#include <glm/mat4x4.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/string_cast.hpp>
#include <cmath>

#include <png/lodepng.h>

using namespace proto;

Scene::Scene ()
 : zoom(1.0),
   window_width(640.0),
   window_height(480.0),
   do_arrange(false),
   do_mipmap(false),
   uniform_modelview(-1),
   uniform_projection(-1),
   uniform_texture(-1)

{
}

Scene::~Scene ()
{
  Unload ();
}

void Scene::Load ()
{
  // Load Geometry
  float z = 0.0;

  // vert 0
  vertex_array[0] = 1.0;   vertex_array[1] = -1.0;   vertex_array[2] = z;  //xyz
  vertex_array[3] = 1.0;   vertex_array[4] = 0.0;                          //uv
  // vert 1
  vertex_array[5] = 1.0;   vertex_array[6] = 1.0;   vertex_array[7] = z;   //xyz
  vertex_array[8] = 1.0;   vertex_array[9] = 1.0;                          //uv
  // vert 2
  vertex_array[10] = -1.0; vertex_array[11] = 1.0;   vertex_array[12] = z; //xyz
  vertex_array[13] = 0.0;  vertex_array[14] = 1.0;                         //uv
  // vert 3
  vertex_array[15] = -1.0; vertex_array[16] = -1.0;   vertex_array[17] = z;//xyz
  vertex_array[18] = 0.0;  vertex_array[19] = 0.0;                         //uv

  // triangle 1
  index_array[0] = 0;   index_array[1] = 1;   index_array[2] = 2;
  // triangle 2
  index_array[3] = 2;   index_array[4] = 3;   index_array[5] = 0;

  glGenVertexArrays (1, &vao);
  glBindVertexArray (vao);

  glGenBuffers (1, &vertex_vbo);
  glBindBuffer (GL_ARRAY_BUFFER, vertex_vbo);
  glBufferData (GL_ARRAY_BUFFER, sizeof(vertex_array), vertex_array, GL_STATIC_DRAW);

  glEnableVertexAttribArray (vPosition);
  glVertexAttribPointer (vPosition, 3, GL_FLOAT, GL_FALSE, 5*sizeof(GLfloat), 0);

  glEnableVertexAttribArray (vTexCoord);
  glVertexAttribPointer (vTexCoord, 2, GL_FLOAT, GL_FALSE, 5*sizeof(GLfloat), (void*)(3*sizeof(GLfloat)));

  glGenBuffers (1, &index_vbo);
  glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, index_vbo);
  glBufferData (GL_ELEMENT_ARRAY_BUFFER, sizeof(index_array), index_array, GL_STATIC_DRAW);

  // Load shaders
  vertex_shader_source = Util::loadShaderSourceFromFile ("simple.vert");
  fragment_shader_source = Util::loadShaderSourceFromFile ("simple.frag");
  program = glCreateProgram ();
  GLuint vert_shader = 0, frag_shader = 0;
  if (!Util::compileShader (vert_shader, GL_VERTEX_SHADER, vertex_shader_source.c_str()))
    std::cout << "Failed to compile vertex shader" << std::endl;
  if (!Util::compileShader (frag_shader, GL_FRAGMENT_SHADER, fragment_shader_source.c_str()))
    std::cout << "Failed to compile fragment shader" << std::endl;

  glAttachShader (program, vert_shader);
  glAttachShader (program, frag_shader);

  // bind vertex attrib locations prior to linking
  glBindAttribLocation (program, vPosition, "a_position");
  glBindAttribLocation (program, vTexCoord, "a_texcoord");
  if (!Util::linkProgram (program))
    { std::cout << "Failed to link program" << std::endl;
      glDeleteShader (vert_shader);
      glDeleteShader (frag_shader);
      glDeleteProgram (program);
    }

  // get uniform locations
  uniform_modelview = glGetUniformLocation (program, "u_modelView");
  uniform_projection = glGetUniformLocation (program, "u_projection");
  uniform_texture = glGetUniformLocation (program, "u_texture");

  if (uniform_modelview == -1 || uniform_projection == -1 || uniform_texture == -1)
    std::cout << "Failed to get a uniform location for one of the shader params" << std::endl;

  if (vert_shader && frag_shader)
   { glDetachShader (program, vert_shader);
     glDetachShader (program, frag_shader);
     glDeleteShader (vert_shader);
     glDeleteShader (frag_shader);
   }
  else
   { std::cout << "whoops" << std::endl; }

  // setup camera
  float fov = 45.0f;  // in degrees, but glm is expecting radians
  float aspect(window_width/window_height);
  float nearz = 0.01f;
  float farz = 10.0f;
  projection = glm::perspective (glm::radians(fov), aspect, nearz, farz);
  glm::mat4 model (1.0f);
  float x = tanf(M_PI_2 - glm::radians(fov/2.0f));  // cotangent
  view = glm::lookAt (
      glm::vec3 (0.0f, 0.0f, x),    // camera position in world space
      glm::vec3 (0.0f, 0.0f, 0.0f), // looking at the origin
      glm::vec3 (0.0f, 1.0f, 0.0f)  // up vector
  );
  glm::mat4 modelView = view * model;

  // use program and set uniforms
  glUseProgram (program);
  glUniformMatrix4fv (uniform_modelview, 1, GL_FALSE, glm::value_ptr(modelView));
  glUniformMatrix4fv (uniform_projection, 1, GL_FALSE, glm::value_ptr(projection));
  glUniform1i (uniform_texture, GL_TEXTURE0 - GL_TEXTURE0);

  // make texquads
  const size_t num_images = image_paths.size();
  std::cout << "num images " << num_images << " (" << aspect << ")" << std::endl;
  size_t rows = 0, columns = 0;
  if (aspect > 1.0)
   {
     rows = std::max (1.0, std::floor(double(num_images) / double(aspect)));
     columns = std::ceil(double(num_images) / double(rows));
   }
  else if (aspect < 1.0)
   {
     columns = std::max (1.0, std::floor(double(num_images) * double(aspect)));
     rows = std::ceil(double(num_images) / double(columns));
   }
  else
   {
     const size_t root = static_cast<size_t> (std::ceil (std::sqrt (num_images)));
     rows = num_images / root + (num_images % root ? 1 : 0);
     columns = root;
   }
  std::cout << "Geometry: " << columns << " x " << rows << std::endl;

  glm::vec2 starting_scale(1.0f);  // camera set for vertically centered -1 to 1 square
  if (do_arrange)
   {
     size_t maxdim = std::max (rows, columns);
     size_t mindim = std::min (rows, columns);
     if (aspect > 1.0) {
       starting_scale = glm::vec2( std::min( std::floor(aspect) / float(maxdim),
                                             1.0f / float(mindim)) );
     } else {
       starting_scale = glm::vec2( std::min( std::floor(1.0f/aspect) / float(maxdim),
                                             1.0f / float(mindim)) );
     }
   }
  if (aspect < 1.0)
    starting_scale *= aspect;

  std::cout << "Starting scale " <<  glm::to_string (starting_scale) << std::endl;

  if (do_arrange)
   { const float pad = 0.1;
     const float size = 2.0f + pad;  // square -1 -> 1
     glm::vec3 pos(0.0f);
     int i = 0;
     for (float r = float(rows-1)*0.5; r > -float(rows)*0.5; r -= 1.0f)
       { std::cout << "row " << r << std::endl;
         pos.y = size * r;
         for (float c = -float(columns-1)*0.5; c < float(columns)*0.5; c += 1.0f)
            { if (i < num_images)
              { std::cout << "col " << c << std::endl;
                pos.x = size * c;
                std::cout << glm::to_string(pos) << std::endl;
                TexQuad *tq = new TexQuad(image_paths[i],
                                          aspect,
                                          pos,
                                          starting_scale,
                                          do_mipmap,
                                          do_arrange);
                tq -> Setup ();
                tq -> SetViewMatrix (uniform_modelview, view);
                texquads.push_back (tq);
                i++;
              }
           }
       }
   }
  else
   { for (int i = 0; i < image_paths.size(); i++)
      { TexQuad *tq = new TexQuad(image_paths[i],
                                  aspect,
                                  glm::vec3(0.0f),
                                  starting_scale,
                                  do_mipmap,
                                  do_arrange);
        tq -> Setup ();
        tq -> SetViewMatrix (uniform_modelview, view);
        texquads.push_back (tq);
      }
   }
}

void Scene::Unload ()
{
  glDeleteProgram (program);

  glBindVertexArray (vao);
  glDeleteBuffers (1, &vertex_vbo);
  glDeleteBuffers (1, &index_vbo);
  glDeleteVertexArrays (1, &vao);
  glBindVertexArray (0);

  for (int i = 0; i < texquads.size(); i++)
    delete texquads[i];
}

void Scene::Setup ()
{ Load ();
  //glClearColor ( 0.0, 0.0, 0.0, 0.0 );  // uncomment for Windows
  glClearColor ( 0.0, 0.1, 0.2, 0.0 );
  glEnable (GL_DEPTH_TEST);
}

void Scene::Update ()
{
}

void Scene::Draw ()
{ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  for (int i = 0; i < texquads.size(); i++) {
    texquads[i] -> Update ();
    texquads[i] -> Bind ();
    glDrawElements (GL_TRIANGLE_STRIP, sizeof(index_array)/sizeof(index_array[0]), GL_UNSIGNED_SHORT, 0);
    texquads[i] -> Unbind ();
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>BioKiller Idle</title>

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

    <link href="css/styles.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                Toggle navigation

            </button>
            BioKiller Idle

Home

GitHub

Stats

Points:

PPS:

Contamination Chance:

Germs Created:

                            Experiments

                        <button class="btn addMultiplier experiment rat" data-cost="2000" data-add="500" data-name="rat" data-time="60" disabled>
                            Test On Rats

                                + PPS -
                                Cost:  -
                                Time:

                        </button>

                        <button class="btn addMultiplier experiment pig" data-cost="8000" data-add="1100" data-name="pig" data-time="120" disabled>
                            Test On Pigs

                                + PPS -
                                Cost:  -
                                Time:

                        </button>

                        <button class="btn addMultiplier experiment horse" data-cost="25000" data-add="3000" data-name="horse" data-time="240" disabled>
                            Test On Horses

                                + PPS -
                                Cost:  -
                                Time:

                        </button>

                        <button class="btn addMultiplier experiment human" data-cost="100000" data-add="8000" data-name="human" data-time="360" disabled>
                            Test On Humans

                                + PPS -
                                Cost:  -
                                Time:

                        </button>

                            Lab Equipment

Lab equipment helps protect you against contaminations.

CP = Contaminant Protection %

                        <button class="btn addEquipment equipment hazmat" data-cost="10000" data-add="1.2" data-name="hazmat" data-time="230" disabled>
                            Buy HazMat Suit

                                + CP -
                                Cost:  -
                                Delivery Time:

                        </button>

                        <button class="btn addEquipment equipment freezer" data-cost="25000" data-add="1.6" data-name="freezer" data-time="470" disabled>
                            Buy Freezer

                                + CP -
                                Cost:  -
                                Delivery Time:

                        </button>

                        <button class="btn addEquipment equipment janitor" data-cost="100000" data-add="2.2" data-name="janitor" data-time="710" disabled>
                            Hire Janitor

                                + CP -
                                Cost:  -
                                Delivery Time:

                        </button>

                        <button class="btn addEquipment equipment solution" data-cost="220000" data-add="3.1" data-name="solution" data-time="1020" disabled>
                            Buy Organic Cleaning Solution

                                + CP -
                                Cost:  -
                                Delivery Time:

                        </button>

                            Dev

                            <button class="btn addMultiplier reproduce" data-cost="0" data-add="50" data-name="reproduce">Reproduce</button>
                            <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-expanded="false">

                                Toggle Dropdown
                            </button>

x2

x10

                        <button class="btn addPoints">Add Points</button>

                Bio Actions

                <button class="btn addMultiplier dna" data-cost="1" data-add="0.1" data-name="dna" disabled>
                    Test New DNA Strand

                        + PPS -
                        Cost:

                </button>

                <button class="btn addMultiplier strength" data-cost="20" data-add="1" data-name="strength" disabled>
                    Increase Strength

                        + PPS -
                        Cost:

                </button>

                <button class="btn addMultiplier resistance" data-cost="50" data-add="5" data-name="resistance" disabled>
                    Increase Resistance

                        + PPS -
                        Cost:

                </button>

                <button class="btn addMultiplier reproduce" data-cost="500" data-add="20" data-name="reproduce" disabled>
                    Reproduce

                        + PPS -
                        Cost:

                </button>

            <canvas id="evo-canvas" class="evo-canvas" width="640" height="480"></canvas>

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

BioKiller Idle

Hello Doctor.

Welcome to your laboratory. Here is where you will be crafting a designer virus that will take out the entire world population - except yourself.

You'll finally have the peace and quiet you deserve once you finish your latest (and greatest) masterpiece.

To get started, just click the button below and start experimenting with your new BioKiller.

                <button type="button" class="btn btn-primary" data-dismiss="modal">Get Started</button>


text: React examples.


text:
.class Lcom/android/server/NsdService$NativeCallbackReceiver;
.super Ljava/lang/Object;
.source "NsdService.java"

# interfaces
.implements Lcom/android/server/INativeDaemonConnectorCallbacks;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/NsdService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "NativeCallbackReceiver"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/NsdService;

# direct methods
.method constructor <init>(Lcom/android/server/NsdService;)V
    .locals 0

    .prologue
    .line 668
    iput-object p1, p0, Lcom/android/server/NsdService$NativeCallbackReceiver;->this$0:Lcom/android/server/NsdService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onCheckHoldWakeLock(I)Z
    .locals 1
    .param p1, "code"    # I

    .prologue
    .line 674
    const/4 v0, 0x0

    return v0
.end method

.method public onDaemonConnected()V
    .locals 1

    .prologue
    .line 670
    iget-object v0, p0, Lcom/android/server/NsdService$NativeCallbackReceiver;->this$0:Lcom/android/server/NsdService;

    # getter for: Lcom/android/server/NsdService;->mNativeDaemonConnected:Ljava/util/concurrent/CountDownLatch;
    invoke-static {v0}, Lcom/android/server/NsdService;->access$3300(Lcom/android/server/NsdService;)Ljava/util/concurrent/CountDownLatch;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->countDown()V

    .line 671
    return-void
.end method

.method public onEvent(ILjava/lang/String;[Ljava/lang/String;)Z
    .locals 3
    .param p1, "code"    # I
    .param p2, "raw"    # Ljava/lang/String;
    .param p3, "cooked"    # [Ljava/lang/String;

    .prologue
    .line 680
    new-instance v0, Lcom/android/server/NsdService$NativeEvent;

    iget-object v1, p0, Lcom/android/server/NsdService$NativeCallbackReceiver;->this$0:Lcom/android/server/NsdService;

    invoke-direct {v0, v1, p1, p2, p3}, Lcom/android/server/NsdService$NativeEvent;-><init>(Lcom/android/server/NsdService;ILjava/lang/String;[Ljava/lang/String;)V

    .line 681
    .local v0, "event":Lcom/android/server/NsdService$NativeEvent;
    iget-object v1, p0, Lcom/android/server/NsdService$NativeCallbackReceiver;->this$0:Lcom/android/server/NsdService;

    # getter for: Lcom/android/server/NsdService;->mNsdStateMachine:Lcom/android/server/NsdService$NsdStateMachine;
    invoke-static {v1}, Lcom/android/server/NsdService;->access$200(Lcom/android/server/NsdService;)Lcom/android/server/NsdService$NsdStateMachine;

    move-result-object v1

    const v2, 0x6001a

    invoke-virtual {v1, v2, v0}, Lcom/android/server/NsdService$NsdStateMachine;->sendMessage(ILjava/lang/Object;)V

    .line 682
    const/4 v1, 0x1

    return v1
.end method


text:
//Copyright © 2014 Sony Computer Entertainment America LLC. See License.txt.

#include "BoxLightGob.h"

#include "../Renderer/RenderBuffer.h"
#include "../Renderer/Model.h"
#include "../Renderer/LineRenderer.h"
#include "../Renderer/TextureLib.h"
#include "../Renderer/ShapeLib.h"

namespace LvEdEngine
{

BoxLightGob::BoxLightGob()
{
    // creates and registers a box light with the rendering sub-sytem.
    m_light = LightingState::Inst()->CreateBoxLight();
    assert(m_light != NULL);
}

BoxLightGob::~BoxLightGob()
{
    assert(m_light != NULL);
    LightingState::Inst()->DestroyBoxLight(m_light);
    m_light = NULL;
}

void BoxLightGob::SetAmbient(int color)
{
    ConvertColor(color, &m_light->ambient);
}

void BoxLightGob::SetDiffuse(int color)
{
    ConvertColor(color, &m_light->diffuse);
}

void BoxLightGob::SetSpecular(int color)
{
    ConvertColor(color, &m_light->specular);
}
void BoxLightGob::SetDirection(const float3& v)
{
    m_light->dir = normalize(v);
}

float3 BoxLightGob::GetDirection()
{
    return m_light->dir;
}

void BoxLightGob::SetAttenuation(const float3& atten)
{
    m_light->attenuation = float4(atten.x,atten.y,atten.z,1);
}

bool BoxLightGob::GetRenderables(RenderableNodeCollector* collector, RenderContext* context)
{

    if (!IsVisible(context->Cam().GetFrustum())) return false;

    RenderableNode renderable;
    GameObject::SetupRenderable(&renderable,context);
    renderable.mesh = m_mesh;
    renderable.textures[TextureType::DIFFUSE] =  TextureLib::Inst()->GetByName(L"Light.png");

    float3 objectPos = &m_world.M41;
    Camera& cam = context->Cam();
    Matrix billboard = Matrix::CreateBillboard(objectPos,cam.CamPos(),cam.CamUp(),cam.CamLook());

    Matrix scale = Matrix::CreateScale(0.4f);
    renderable.WorldXform = scale * billboard;

    RenderFlagsEnum flags = RenderFlags::Textured;
    collector->Add( renderable, flags, Shaders::BillboardShader );

    if( context->selection.find(GetInstanceId()) != context->selection.end() )
    {
        /* RenderableNode cubeR;
         GameObject::SetupRenderable(&cubeR,context);
         cubeR.mesh = ShapeLibGetMesh( RenderShape::Cube);
         cubeR.SetFlag( RenderableNode::kShadowCaster, false );
         cubeR.SetFlag( RenderableNode::kShadowReceiver, false );
         cubeR.SetFlag( RenderableNode::kNotPickable,true);
         cubeR.diffuse = m_light->diffuse;
         cubeR.diffuse.w = 0.2f;
         RenderFlagsEnum rflags  = (RenderFlagsEnum)(RenderFlags::Lit | RenderFlags::AlphaBlend | RenderFlags::DisableDepthWrite);
         collector->Add( cubeR, rflags, Shaders::TexturedShader );*/
        LineRenderer::Inst()->DrawAABB(m_bounds,float4(1,1,1,1));
    }

    return true;
}

void BoxLightGob::Update(float dt)
{
    UpdateWorldTransform();
    if(m_boundsDirty)
    {
        m_localBounds = AABB(float3(-0.5f,-0.5f,-0.5f),float3(0.5f,0.5f,0.5f));
        UpdateWorldAABB();
    }
    m_light->min = m_bounds.Min();
    m_light->max = m_bounds.Max();
}

};


text:
<?xml version="1.0"?>
<ArrayOfCommand xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Command xsi:type="Ignition">
    <StartTime>167</StartTime>
    <Duration>0.5</Duration>
    <Throttle>96</Throttle>
    <EngineIds>
      <int>0</int>
    </EngineIds>
  </Command>
  <Command xsi:type="Throttle">
    <StartTime>516</StartTime>
    <Duration>30</Duration>
    <TargetThrottle>74.7</TargetThrottle>
  </Command>
  <Command xsi:type="Shutdown">
    <StartTime>546</StartTime>
    <Duration>0.5</Duration>
  </Command>
  <!--<Command xsi:type="Retrograde">
    <StartTime>3000</StartTime>
    <Duration>30000</Duration>
    <InitialAdjustmentTime>60</InitialAdjustmentTime>
  </Command>
  <Command xsi:type="Ignition">
    <StartTime>22800</StartTime>
    <Duration>0.5</Duration>
    <Throttle>40</Throttle>
    <EngineIds>
      <int>0</int>
    </EngineIds>
  </Command>
  <Command xsi:type="Shutdown">
    <StartTime>22810</StartTime>
    <Duration>0.5</Duration>
  </Command>-->
</ArrayOfCommand>


text:
"""
This is a self genrated test created by scaffolding.py.
you will need to fill it up with all your necessities.
Safe hacking :).
"""
from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from ooni.plugoo.tests import ITest, OONITest
from ooni.plugoo.assets import Asset
from ooni.protocols import http
from ooni.utils import log

class httptArgs(usage.Options):
    optParameters = [['urls', 'f', None, 'Urls file'],
                     ['url', 'u', 'http://torproject.org/', 'Test single site'],
                     ['resume', 'r', 0, 'Resume at this index'],
                     ['rules', 'y', None, 'Specify the redirect rules file']]

class httptTest(http.HTTPTest):
    implements(IPlugin, ITest)

    shortName = "httpt"
    description = "httpt"
    requirements = None
    options = httptArgs
    blocking = False

    def testPattern(self, value, pattern, type):
        if type == 'eq':
            return value == pattern
        elif type == 're':
            import re
            if re.match(pattern, value):
                return True
            else:
                return False
        else:
            return None

    def testPatterns(self, patterns, location):
        test_result = False

        if type(patterns) == list:
            for pattern in patterns:
                test_result |= self.testPattern(location, pattern['value'], pattern['type'])
        else:
            test_result |= self.testPattern(location, patterns['value'], patterns['type'])

        return test_result

    def testRules(self, rules, location):
        result = {}
        blocked = False
        for rule, value in rules.items():
            current_rule = {}
            current_rule['name'] = value['name']
            current_rule['patterns'] = value['patterns']
            current_rule['test'] = self.testPatterns(value['patterns'], location)
            blocked |= current_rule['test']
            result[rule] = current_rule
        result['blocked'] = blocked
        return result

    def processRedirect(self, location):
        self.result['redirect'] = None
        try:
            rules_file = self.local_options['rules']
            import yaml
            rules = yaml.load(open(rules_file))
            log.msg("Testing rules %s" % rules)
            redirect = self.testRules(rules, location)
            self.result['redirect'] = redirect
        except TypeError:
            log.msg("No rules file. Got a redirect, but nothing to do.")

    def control(self, experiment_result, args):
        print self.response
        print self.request
        # What you return here ends up inside of the report.
        log.msg("Running control")
        return {}

    def load_assets(self):
        if self.local_options and self.local_options['urls']:
            return {'url': Asset(self.local_options['urls'])}
        else:
            return {}

# We need to instantiate it otherwise getPlugins does not detect it
# XXX Find a way to load plugins without instantiating them.
#httpt = httptTest(None, None, None)


text:
import { VuexModule } from "vuex-module-decorators";
import { Vue } from "nuxt-property-decorator";
import { Store } from "vuex";
import { IMyStore } from "~/src/store/index";
import { IMyService } from "~/src/service";

let $root: Vue;
export const setBaseStoreRootComponent = (r: Vue) => {
  $root = r;
};

let $myStore: IMyStore;
export const setBaseStoreMyStore = (s: IMyStore) => {
  $myStore = s;
};

let $myService: IMyService;
export const setBaseStoreMyService = (s: IMyService) => {
  $myService = s;
};

export class BaseStore extends VuexModule {
  store!: Store<any>;

  get $root(): Vue {
    return $root;
  }

  get $myStore(): IMyStore {
    return $myStore;
  }

  get $myService(): IMyService {
    return $myService;
  }
}


text:
/* Update logo design color to be consistent with the inverse navbar */
.navbar #logo a {
    color: #9d9d9d;
}

.navbar #logo a:hover, .navbar #logo a:active {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 5px #fff, 0 0 8px rgba(255, 255, 255, .6);
}

/* Change the color of the menu links */
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:focus,
.navbar-default .navbar-nav > .open > a:hover,
.dropdown-menu > li > a,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    font-size: 13px;
}

/* Do some changes when the menu is toggled */
@media screen and (max-width: 767px) {
    /* Change size for the sub-sub drop-down menus for better distinction */
    .navbar-default .navbar-nav .open .dropdown-menu > li > ul > li > a {
        font-size: 11px;
    }
}

.navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse {
    max-height: none;
}

/* Change the padding space between each drop-down menu */
.nav > li > a {
    padding: 10px 9px;
}

/* Amend the default minimum height of the navbar */
.navbar {
    min-height: 45px !important;
}

/* Bottom menu */
.bottom_nav {
    float: right;
}

.bottom_nav a {
    text-decoration: underline;
}


text:
        This package contains common interfaces for Version Control Systems such as
        SVN, CVS, etc.

        The implementation of that interfaces it a system-specific deal and all
        implementations are located in the corresponding packages for those concrete
        systems.


text:
#include <debug.h>
#include <string.h>
#include <err.h>
#include <smem.h>
#include <msm_panel.h>
#include <board.h>
#include <qtimer.h>
#include <mipi_dsi.h>
#include <target/display.h>

#include "include/panel.h"
#include "panel_display.h"

/*---------------------------------------------------------------------------*/
/* GCDB Panel Database                                                       */
/*---------------------------------------------------------------------------*/
#include "include/panel_truly_1080p_video.h"
#include "include/panel_truly_1080p_cmd.h"
#include "include/panel_otm1906c_1080p_cmd.h"
#include "include/panel_sharp_1080p_cmd.h"

/*---------------------------------------------------------------------------*/
/* static panel selection variable                                           */
/*---------------------------------------------------------------------------*/
enum {
	TRULY_1080P_VIDEO_PANEL,
	TRULY_1080P_CMD_PANEL,
	OTM1906C_1080P_CMD_PANEL,
	SHARP_1080P_CMD_PANEL,
	UNKNOWN_PANEL
};

uint32_t panel_regulator_settings[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

/*
 * The list of panels that are supported on this target.
 * Any panel in this list can be selected using fastboot oem command.
 */
static struct panel_list supp_panels[] = {
	{"truly_1080p_video", TRULY_1080P_VIDEO_PANEL},
	{"truly_1080p_cmd", TRULY_1080P_CMD_PANEL},
	{"sharp_1080p_cmd", SHARP_1080P_CMD_PANEL},
};

static uint32_t panel_id;

#define TRULY_1080P_PANEL_ON_DELAY 40

int oem_panel_rotation()
{
	return NO_ERROR;
}

int oem_panel_on()
{
	/*
	 *OEM can keep their panel specific on instructions in this
	 *function
	*/
	if (panel_id == OTM1906C_1080P_CMD_PANEL) {
		/* needs extra delay to avoid unexpected artifacts */
		mdelay(OTM1906C_1080P_CMD_PANEL_ON_DELAY);
	} else if (panel_id == TRULY_1080P_CMD_PANEL ||
			panel_id == TRULY_1080P_VIDEO_PANEL) {
		mdelay(TRULY_1080P_PANEL_ON_DELAY);
	}

	return NO_ERROR;
}

int oem_panel_off()
{
	/* OEM can keep their panel specific off instructions
	 * in this function
	 */
	return NO_ERROR;
}

static int init_panel_data(struct panel_struct *panelstruct,
			struct msm_panel_info *pinfo,
			struct mdss_dsi_phy_ctrl *phy_db)
{
	int pan_type = PANEL_TYPE_DSI;

	switch (panel_id) {
	case TRULY_1080P_VIDEO_PANEL:
		panelstruct->paneldata    = &truly_1080p_video_panel_data;
		panelstruct->paneldata->panel_with_enable_gpio = 1;
		panelstruct->panelres     = &truly_1080p_video_panel_res;
		panelstruct->color        = &truly_1080p_video_color;
		panelstruct->videopanel   = &truly_1080p_video_video_panel;
		panelstruct->commandpanel = &truly_1080p_video_command_panel;
		panelstruct->state        = &truly_1080p_video_state;
		panelstruct->laneconfig   = &truly_1080p_video_lane_config;
		panelstruct->paneltiminginfo
			= &truly_1080p_video_timing_info;
		panelstruct->panelresetseq
					 = &truly_1080p_video_panel_reset_seq;
		panelstruct->backlightinfo = &truly_1080p_video_backlight;
		pinfo->mipi.panel_on_cmds
			= truly_1080p_video_on_command;
		pinfo->mipi.num_of_panel_on_cmds
			= TRULY_1080P_VIDEO_ON_COMMAND;
		pinfo->mipi.panel_off_cmds
			= truly_1080p_video_off_command;
		pinfo->mipi.num_of_panel_off_cmds
			= TRULY_1080P_VIDEO_OFF_COMMAND;
		memcpy(phy_db->timing,
			truly_1080p_video_timings, TIMING_SIZE);
		pinfo->mipi.signature 	= TRULY_1080P_VIDEO_SIGNATURE;
		break;
	case TRULY_1080P_CMD_PANEL:
		panelstruct->paneldata    = &truly_1080p_cmd_panel_data;
		panelstruct->paneldata->panel_with_enable_gpio = 1;
		panelstruct->panelres     = &truly_1080p_cmd_panel_res;
		panelstruct->color        = &truly_1080p_cmd_color;
		panelstruct->videopanel   = &truly_1080p_cmd_video_panel;
		panelstruct->commandpanel = &truly_1080p_cmd_command_panel;
		panelstruct->state        = &truly_1080p_cmd_state;
		panelstruct->laneconfig   = &truly_1080p_cmd_lane_config;
		panelstruct->paneltiminginfo
			= &truly_1080p_cmd_timing_info;
		panelstruct->panelresetseq
					 = &truly_1080p_cmd_panel_reset_seq;
		panelstruct->backlightinfo = &truly_1080p_cmd_backlight;
		pinfo->mipi.panel_on_cmds
			= truly_1080p_cmd_on_command;
		pinfo->mipi.num_of_panel_on_cmds
			= TRULY_1080P_CMD_ON_COMMAND;
		pinfo->mipi.panel_off_cmds
			= truly_1080p_cmd_off_command;
		pinfo->mipi.num_of_panel_off_cmds
			= TRULY_1080P_CMD_OFF_COMMAND;
		memcpy(phy_db->timing,
			truly_1080p_cmd_timings, TIMING_SIZE);
		pinfo->mipi.signature 	= TRULY_1080P_CMD_SIGNATURE;
		break;
	case OTM1906C_1080P_CMD_PANEL:
		panelstruct->paneldata    = &otm1906c_1080p_cmd_panel_data;
		panelstruct->paneldata->panel_with_enable_gpio = 1;
		panelstruct->panelres     = &otm1906c_1080p_cmd_panel_res;
		panelstruct->color        = &otm1906c_1080p_cmd_color;
		panelstruct->videopanel   = &otm1906c_1080p_cmd_video_panel;
		panelstruct->commandpanel = &otm1906c_1080p_cmd_command_panel;
		panelstruct->state        = &otm1906c_1080p_cmd_state;
		panelstruct->laneconfig   = &otm1906c_1080p_cmd_lane_config;
		panelstruct->paneltiminginfo
			= &otm1906c_1080p_cmd_timing_info;
		panelstruct->panelresetseq
					 = &otm1906c_1080p_cmd_panel_reset_seq;
		panelstruct->backlightinfo = &otm1906c_1080p_cmd_backlight;
		pinfo->mipi.panel_on_cmds
			= otm1906c_1080p_cmd_on_command;
		pinfo->mipi.num_of_panel_on_cmds
			= OTM1906C_1080P_CMD_ON_COMMAND;
		pinfo->mipi.panel_off_cmds
			= otm1906c_1080p_cmd_off_command;
		pinfo->mipi.num_of_panel_off_cmds
			= OTM1906C_1080P_CMD_OFF_COMMAND;
		memcpy(phy_db->timing,
			otm1906c_1080p_cmd_timings, TIMING_SIZE);
		pinfo->mipi.signature = OTM1906C_1080P_CMD_SIGNATURE;
		break;
	case SHARP_1080P_CMD_PANEL:
		panelstruct->paneldata    = &sharp_1080p_cmd_panel_data;
		panelstruct->panelres     = &sharp_1080p_cmd_panel_res;
		panelstruct->paneldata->panel_with_enable_gpio = 1;
		panelstruct->color        = &sharp_1080p_cmd_color;
		panelstruct->videopanel   = &sharp_1080p_cmd_video_panel;
		panelstruct->commandpanel = &sharp_1080p_cmd_command_panel;
		panelstruct->state        = &sharp_1080p_cmd_state;
		panelstruct->laneconfig   = &sharp_1080p_cmd_lane_config;
		panelstruct->paneltiminginfo
					= &sharp_1080p_cmd_timing_info;
		panelstruct->panelresetseq
					= &sharp_1080p_cmd_panel_reset_seq;
		panelstruct->backlightinfo = &sharp_1080p_cmd_backlight;
		pinfo->mipi.panel_on_cmds
					= sharp_1080p_cmd_on_command;
		pinfo->mipi.num_of_panel_on_cmds
					= SHARP_1080P_CMD_ON_COMMAND;
		pinfo->mipi.panel_off_cmds
			= sharp_1080p_cmd_off_command;
		pinfo->mipi.num_of_panel_off_cmds
			= SHARP_1080P_CMD_OFF_COMMAND;
		memcpy(phy_db->timing,
				sharp_1080p_cmd_timings, TIMING_SIZE);
		break;
	case UNKNOWN_PANEL:
	default:
		memset(panelstruct, 0, sizeof(struct panel_struct));
		memset(pinfo->mipi.panel_on_cmds, 0,
					sizeof(struct mipi_dsi_cmd));
		pinfo->mipi.num_of_panel_on_cmds = 0;
		memset(pinfo->mipi.panel_off_cmds, 0,
					sizeof(struct mipi_dsi_cmd));
		pinfo->mipi.num_of_panel_off_cmds = 0;
		memset(phy_db->timing, 0, TIMING_SIZE);
		pan_type = PANEL_TYPE_UNKNOWN;
		break;
	}
	return pan_type;
}

int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
			struct msm_panel_info *pinfo,
			struct mdss_dsi_phy_ctrl *phy_db)
{
	uint32_t hw_id = board_hardware_id();
	int32_t panel_override_id;

	if (panel_name) {
		panel_override_id = panel_name_to_id(supp_panels,
				ARRAY_SIZE(supp_panels), panel_name);

		if (panel_override_id < 0) {
			dprintf(CRITICAL, "Not able to search the panel:%s\n",
					 panel_name + strspn(panel_name, " "));
		} else if (panel_override_id < UNKNOWN_PANEL) {
			/* panel override using fastboot oem command */
			panel_id = panel_override_id;

			dprintf(INFO, "OEM panel override:%s\n",
					panel_name + strspn(panel_name, " "));
			goto panel_init;
		}
	}

	switch (hw_id) {
	case HW_PLATFORM_MTP:
		panel_id = TRULY_1080P_VIDEO_PANEL;
		break;
	case HW_PLATFORM_SURF:
		panel_id = TRULY_1080P_VIDEO_PANEL;
		break;
	case HW_PLATFORM_QRD:
		panel_id = OTM1906C_1080P_CMD_PANEL;
		break;
	default:
		dprintf(CRITICAL, "Display not enabled for %d HW type\n",
			hw_id);
		return PANEL_TYPE_UNKNOWN;
	}

panel_init:
	/*
	 * Update all data structures after 'panel_init' label. Only panel
	 * selection is supposed to happen before that.
	 */
	memcpy(panel_regulator_settings,
			dcdc_regulator_settings, REGULATOR_SIZE);
	pinfo->pipe_type = MDSS_MDP_PIPE_TYPE_RGB;
	return init_panel_data(panelstruct, pinfo, phy_db);
}


text:
using System.Collections.Generic;
using Org.Apache.Reef.Tang.Examples;
using Org.Apache.Reef.Tang.Implementations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Org.Apache.Reef.Wake.RX;

namespace Org.Apache.Reef.Tang.Test.ClassHierarchy
{
    [TestClass]
    public class TestGeneric
    {
        [ClassInitialize]
        public static void ClassSetup(TestContext context)
        {
            TangImpl.Reset();
        }

        [TestMethod]
        public void TestGenericClassWithT()
        {
            List<string> appDlls = new List<string>();
            appDlls.Add(typeof(GenericArgument<>).Assembly.GetName().Name);
            appDlls.Add(typeof(AbstractObserver<>).Assembly.GetName().Name);
            TangFactory.GetTang().GetClassHierarchy(appDlls.ToArray());
        }
    }
}


text:
package cn.com.jkcq.ble;

import cn.com.jkcq.ble.mocks.MockDeviceAdapter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.com.jkcq.ble.Constants.*;

/**
 * Created by edwardzhou on 2017/7/3.
 */
public class BleManager {
    private static BleManager instance = null;
    private DeviceAdapter adapter = null;
    private Map<String, DeviceDriver> drivers = new HashMap<String, DeviceDriver>();
    private ScannerFactory scannerFactory = null;
    private RealTimeDataListener readTimeDataListener = null;
    private DeviceDriver connectedDriver = null;

    public BleManager() {
        this.resetDefaultAdapter();
    }

    public ScannerFactory getScannerFactory() {
        return this.scannerFactory;
    }

    public void setScannerFactory(ScannerFactory scannerFactory) {
        this.scannerFactory = scannerFactory;
    }

    public DeviceAdapter getAdapter() {
        return this.adapter;
    }

    public void setAdapter(DeviceAdapter adapter) {
        this.adapter = adapter;
    }

    public static BleManager getInstance() {
        if (instance == null) {
            instance = new BleManager();
        }

        return instance;
    }

    public boolean isBlueToothEnabled() {
        return this.adapter.isAdapterEnabled();
    }

    public int scan(ScanListener listener) {
        if (! this.adapter.isAdapterEnabled()) {
           return BLE_R_BLUETOOTH_DISABLED;
        }
        DeviceScanner scanner = this.scannerFactory.getScanner();
        scanner.setListener(listener);
        scanner.start();
        //... do scan...
        return BLE_R_OK;
    }

    public List<DeviceInfo> getDevices() {
        return null;
    }

    public DeviceDriver connectTo(DeviceInfo DeviceInfo) {
        String deviceName = DeviceInfo.deviceName;
//        DeviceDriver driver = this.drivers.get(deviceName);
//
//        return driver;
        this.connectedDriver = this.drivers.get(deviceName);
        return this.connectedDriver;
    }

    public Map<String, DeviceDriver> getSupportedDrivers() {
        return this.drivers;
    }

    public void registerDriver(DeviceDriver device) {
        this.drivers.put(device.getDriverName(), device);
    }

    public void resetDefaultAdapter() {
        this.setAdapter(new MockDeviceAdapter());
    }

    public void setRealTimeDataListener(RealTimeDataListener listener) {
        this.readTimeDataListener = listener;
        this.connectedDriver.setRealTimeDataListener(listener);
    }

    public void sendCommand(String commandName) {
        DeviceCommand command = this.connectedDriver.createCommand(commandName);

        sendCommand(command);
    }

    public void sendCommand(DeviceCommand command) {
        this.connectedDriver.doCommand(command);
    }
}


text:
package scala.meta
package internal.hosts.scalac
package compat

import scala.meta.internal.hosts.scalac.{PluginBase => ScalahostPlugin}
import scala.tools.nsc.{Global => NscGlobal}
import scala.tools.nsc.typechecker.{Analyzer => NscAnalyzer}

trait ParadiseCompat {
  self: ScalahostPlugin =>

  import global._
  import analyzer.{AnalyzerPlugin => NscAnalyzerPlugin, MacroPlugin => NscMacroPlugin}

  def ifNecessaryReenableMacroParadise(oldAnalyzer: NscAnalyzer): Unit = {
    val methAnalyzerPlugins = oldAnalyzer.getClass.getDeclaredMethods.find(_.getName.endsWith("$analyzerPlugins")).head
    val analyzerPlugins = methAnalyzerPlugins.invoke(oldAnalyzer).asInstanceOf[List[NscAnalyzerPlugin]]
    val paradiseAnalyzerPlugin = analyzerPlugins.find(_.getClass.getName == "org.scalamacros.paradise.typechecker.AnalyzerPlugins$AnalyzerPlugin$")
    paradiseAnalyzerPlugin match {
      case Some(paradiseAnalyzerPlugin) =>
        // NOTE: this situation occurs when macro paradise was before scalahost in compiler options
        // this means it has already registered its analyzer and macro plugins in the analyzer that we've just hijacked
        // now we need to recreate those subplugins in the new analyzer
        // the easiest way of doing that is to reinstantiate the paradise plugin
        // its constructor will create and register new subplugins in the new analyzer
        val paradiseClassLoader = paradiseAnalyzerPlugin.getClass.getClassLoader
        val classParadisePlugin = Class.forName("org.scalamacros.paradise.Plugin", true, paradiseClassLoader)
        val ctorParadisePlugin = classParadisePlugin.getConstructors().find(_.getParameterTypes.toList == List(classOf[NscGlobal])).get
        ctorParadisePlugin.newInstance(global)
      case _ =>
        // NOTE: no need to do anything
        // macro paradise is either not in compiler options or will be loaded later
        // in both cases, natural order of events will ensure correct behavior
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
	<ID>d80f652a-6172-44aa-90c5-0dda8f721c9f</ID>
	<IsFullApplication>false</IsFullApplication>
	<Level>Intermediate</Level>
	<Tags>User Interface</Tags>
	<Gallery>true</Gallery>
	<Brief>Shows how to use collection Views in iOS.</Brief>
</SampleMetadata>


text:
import { screen, settings } from '@emeraldwallet/store';
import * as React from 'react';
import { withTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import i18n from '../../i18n';
import Settings from '../SettingsForm';

const TranslatedSettings = withTranslation('translation')(Settings);

export default connect(
  (state: any, ownProps: any) => {
    return {
      currency: (settings.selectors.fiatCurrency(state) || '').toLowerCase(),
      language: i18n.language,
    };
  },
  (dispatch, ownProps) => ({
    goBack: () => {
      dispatch(screen.actions.goBack());
    },

    onSubmit: (data: any) => {
      const newSettings = {
        language: data.language,
        localeCurrency: data.currency
      };
      i18n.changeLanguage(data.language);
      dispatch(settings.actions.updateSettings(newSettings));
    }
  })
)(TranslatedSettings);


text:
require 'spec_helper'

describe Mongo::Auth::SCRAM do
  require_no_x509_auth

  let(:server) do
    authorized_client.cluster.next_primary
  end

  let(:connection) do
    Mongo::Server::Connection.new(server, SpecConfig.instance.test_options)
  end

  let(:cache_mod) { Mongo::Auth::CredentialCache }

  shared_examples_for 'caches scram credentials' do |cache_key|

    it 'caches scram credentials' do
      cache_mod.clear
      expect(cache_mod.store).to be_empty

      expect(login['ok']).to eq(1)

      expect(cache_mod.store).not_to be_empty
      client_key_entry = cache_mod.store.keys.detect do |key|
        key.include?(test_user.password) && key.include?(cache_key)
      end
      expect(client_key_entry).not_to be nil
    end
  end

  context 'when SCRAM-SHA-1 is used' do
    min_server_fcv '3.0'

    before do
      connection.connect!
    end

    describe '#login' do

      context 'when the user is not authorized' do

        let(:user) do
          Mongo::Auth::User.new(
            database: 'driver',
            user: 'notauser',
            password: 'password',
            auth_mech: :scram,
          )
        end

        let(:authenticator) do
          described_class.new(user)
        end

        it 'raises an exception' do
          expect {
            authenticator.login(connection)
          }.to raise_error(Mongo::Auth::Unauthorized)
        end

        context 'when compression is used' do
          require_compression
          min_server_fcv '3.6'

          it 'does not compress the message' do
            expect(Mongo::Protocol::Compressed).not_to receive(:new)
            expect {
              authenticator.login(connection)
            }.to raise_error(Mongo::Auth::Unauthorized)
          end
        end
      end

      context 'when the user is authorized for the database' do

        let(:authenticator) do
          described_class.new(test_user)
        end

        let(:login) do
          authenticator.login(connection).documents[0]
        end

        it 'logs the user into the connection' do
          expect(login['ok']).to eq(1)
        end

        it_behaves_like 'caches scram credentials', :salted_password
        it_behaves_like 'caches scram credentials', :client_key
        it_behaves_like 'caches scram credentials', :server_key
      end
    end
  end

  context 'when SCRAM-SHA-256 is used' do
    min_server_fcv '4.0'

    before do
      connection.connect!
    end

    describe '#login' do

      context 'when the user is not authorized' do

        let(:user) do
          Mongo::Auth::User.new(
            database: 'driver',
            user: 'notauser',
            password: 'password',
            auth_mech: :scram256,
          )
        end

        let(:authenticator) do
          described_class.new(user)
        end

        it 'raises an exception' do
          expect {
            authenticator.login(connection)
          }.to raise_error(Mongo::Auth::Unauthorized)
        end

        context 'when compression is used' do
          require_compression
          min_server_fcv '3.6'

          it 'does not compress the message' do
            expect(Mongo::Protocol::Compressed).not_to receive(:new)
            expect {
              authenticator.login(connection)
            }.to raise_error(Mongo::Auth::Unauthorized)
          end
        end
      end

      context 'when the user is authorized for the database' do

        let(:authenticator) do
          described_class.new(test_user)
        end

        let(:login) do
          authenticator.login(connection).documents[0]
        end

        it 'logs the user into the connection' do
          expect(login['ok']).to eq(1)
        end

        it_behaves_like 'caches scram credentials', :salted_password
        it_behaves_like 'caches scram credentials', :client_key
        it_behaves_like 'caches scram credentials', :server_key
      end
    end
  end
end


text:
const util = require('../../helpers/util.helper');
const db = require('../../helpers/db.helper');
const crypto = require('../../helpers/crypto.helper');

exports.spacesGet = function (req, res, next) {
    /**
     * parameters expected in the args:
     * stewardname (String)
     * namespace (String)
     * authorization (String)
     **/

    var examples = {};

    var request = {};
    request.stewardname = req.swagger.params.stewardname.value;
    request.namespace = req.swagger.params.namespace.value;
    request.publicKey = req.user.publicKey;

    spacesGet(request, function (err, result) {
        res.setHeader('Content-Type', 'application/json');
        if (err) {
            // throw error
            examples['application/json'] = err;
            res.statusCode = util.setStatus(err);
        } else {
            examples['application/json'] = result;
        }
        res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
    });
};

const spacesGet = function(request, spacesGetCallback) {
    db.openmoney_bucket.get('namespaces~' + request.namespace.toLowerCase(), function(err, results) {
        if (err) {
            spacesGetCallback(err,false);
        } else {
            // if (results.value.private) {
            //   var error = {};
            //   error.status = 403;
            //   error.code = 2009;
            //   error.message = 'Cannot add a private namespace.';
            //   spacesGetCallback(error);
            // } else {
              db.stewards_bucket.get("steward_bucket~" + crypto.getHash(request.publicKey), function (err, steward_bucket) {
                  if (err) {
                      spacesGetCallback(err);
                  } else {
                      if(steward_bucket.value.namespaces.indexOf(results.value.id.toLowerCase()) !== -1){
                        spacesGetCallback(null, results.value);
                      } else {
                        steward_bucket.value.namespaces.push(results.value.id.toLowerCase());
                        //add stewards of currency to users stewards list
                        results.value.stewards.forEach(function(steward){
                          if(steward_bucket.value.stewards.indexOf(steward) === -1){
                            steward_bucket.value.stewards.push(steward);
                          }
                        });
                        db.stewards_bucket.replace("steward_bucket~" + crypto.getHash(request.publicKey), steward_bucket.value, {cas: steward_bucket.cas}, function (err, ok) {
                            if (err) {
                                spacesGetCallback(err);
                            } else {
                                spacesGetCallback(null, results.value);
                            }
                        });
                      }
                  }
              });
            // }
        }
    });
};


text:
package com.xruby.compiler.codedom;

import java.util.ArrayList;

public class UnaryOperatorExpression extends Expression {
	private String operator_;
	private Expression left_;

	public UnaryOperatorExpression(String operator, Expression left) {
		operator_ = operator;
		left_ = left;
	}

	public void accept(CodeVisitor visitor) {
		left_.accept(visitor);
		visitor.visitUnaryOperator(operator_);
	}

	public void getFrequentlyUsedIntegers(ArrayList<Integer> result) {
		left_.getFrequentlyUsedIntegers(result);
	}
}


text:
export interface PackageJsonInfo extends PackageInfo {
    main?: string;
    dependencies?: {
        [name: string]: string;
    };
}
export interface PackageInfo {
    name: string;
    version: string;
    dist?: {
        tarball: string;
    };
}


text:
/*! \file LLVMFunctionCallStack.h
	\date Monday September 27, 2010
	\author Gregory Diamos <gregory.diamos@gatech.edu>
	\brief The header file for the LLVMFunctionCallStack class.
*/

#ifndef LLVM_FUNCTION_CALL_STACK_H_INCLUDED
#define LLVM_FUNCTION_CALL_STACK_H_INCLUDED

// Standard Library Includes
#include <vector>

namespace executive
{

/*! \brief A class for managing a call stack for a single PTX thread */
class LLVMFunctionCallStack
{
public:
	void call(unsigned int localSize, unsigned int parameterSize,
		unsigned int functionId, unsigned int resumePoint = -1);
	unsigned int returned();

	void setKernelArgumentMemory(char* memory, unsigned int argumentSize);
	void resizeCurrentLocalMemory(unsigned int size);

	char* localMemory();
	char* parameterMemory();
	char* argumentMemory();

	unsigned int localSize() const;
	unsigned int parameterSize() const;
	unsigned int argumentSize() const;

	unsigned int functionId() const;

private:
	class ParameterAndLocalSize
	{
	public:
		ParameterAndLocalSize(unsigned int localSize,
			unsigned int parameterSize, unsigned int functionId,
			unsigned int resumePoint);

	public:
		unsigned int localSize;
		unsigned int parameterSize;
		unsigned int functionId;
		unsigned int resumePoint;
	};

	typedef std::vector<char> DataVector;
	typedef std::vector<ParameterAndLocalSize> SizeVector;

private:
	DataVector   _stack;
	SizeVector   _sizes;
	char*        _argumentMemory;
	unsigned int _argumentSize;

};

}

#endif


text:
module Resource::Authorize
  extend ActiveSupport::Concern
  included do
    delegate :can?, :can_any?, to: :current_permission
    helper_method :can?, :can_any?
    def current_permission
      @current_permission ||= Permissions.for(current_user)
    end
  private
    def self.authorize(resource = nil, options = {})
      send(:before_action, options.slice(:only, :except, :if, :unless)) do |controller|
        object = instance_variable_get("@#{resource.to_s}") if resource
        unless current_permission.can?(controller.params[:controller], controller.params[:action], object)
          Rails.logger.error "Access denied by #{@current_permission.class.name} to #{object.class.name}(#{object.try(:id).to_s}) in #{controller.params[:controller]}::#{controller.params[:action]}"
          respond_to do |format|
            format.html do
              flash[:danger] = "Access denied"
              redirect_to root_path
            end
            format.json do
              render :json => {:danger => "Access denied"}, :status => 401
            end
          end
        end
      end
    end
  end
end