text:
PLUGIN_PARAMETERS=""

discover_registration () {
	local FILE_NAME
	local PLUGIN_NAME
	local VERSION
	local VISIBLE_VERSION
	local DESCRIPTION
	local MIME_TYPES

	registration_file=$1
	option_prefix=$2

	test -f "${registration_file}" || return 1
	. "${registration_file}"

	test "$VERSION" || return 2
	test "$FILE_NAME" || return 3

	echo "$PLUGIN_PARAMETERS" |grep -- "--${option_prefix}-path=" >/dev/null && return 4

	PLUGIN_PARAMETERS="--${option_prefix}-path=${FILE_NAME} --${option_prefix}-version=${VERSION%%-*} ${PLUGIN_PARAMETERS}"
	return 0
}

# Explicitly set the PATH to that of ENV_SUPATH in /etc/login.defs and unset
# various other variables. (LP: #1045986). This can be removed once AppArmor
# supports environment filtering (LP: #1045985)
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export ENV=
export BASH_ENV=
export CDPATH=
export GLOBIGNORE=
export BASH_XTRACEFD=

if grep -E -w ^Features\\s\*:.\*neon /proc/cpuinfo >/dev/null; then
	export CPU_FEATURE_NEON=1
fi
if grep -E -w ^flags\\s\*:.\*sse /proc/cpuinfo >/dev/null; then
	export CPU_FEATURE_SSE=1
fi
export CPU_FEATURES_TESTED=1

readonly APPNAME=chromium-browser
LIBDIR=/usr/lib/chromium-browser
GDB=/usr/bin/gdb
readonly BUILD_DIST="Ubuntu "
readonly UPSTREAM_VERSION="51.0.2704.106"
if test -x "${LIBDIR}/${UPSTREAM_VERSION}"/chromium-browser; then
	LIBDIR="${LIBDIR}/${UPSTREAM_VERSION}"
fi
readonly LIBDIR

usage () {
  echo "$APPNAME [-h|--help] [-g|--debug] [--temp-profile] [--no-touch-pinch] [options] [URL]"
  echo
  echo "        --verbose               Events logged to stderr."
  echo "        -g or --debug           Start within $GDB"
  echo "        -h or --help            This help screen"
  echo "        --temp-profile          Start with a new and temporary profile"
  echo "        --no-touch-pinch        Disable pinch gestures."
  echo
  echo " Other supported options are:"
  MANWIDTH=80 man chromium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
  echo " See 'man chromium-browser' for more details"
}

# Work around crbug.com/415681
lsmod |grep ^i915\  >/dev/null && export LIBGL_DRI3_DISABLE=1

if [ -f /etc/$APPNAME/default ] ; then
  . /etc/$APPNAME/default
fi

if test -d /etc/$APPNAME/customizations; then
	while read f; do
		. "$f"
	done < <(run-parts --list -- /etc/$APPNAME/customizations)
fi
test -f ~/.chromium-browser.init && . ~/.chromium-browser.init

FLASH_GOOD_PACKAGE="adobe-flashplugin"
if test "$FLASH_GOOD_PACKAGE"; then
	PREVIOUS_CANDIDATE=""
	CANDIDATE="$CHROMIUM_FLAGS"
	while test "$PREVIOUS_CANDIDATE" != "$CANDIDATE"; do  # Strip ppapi-flash-xxxx params off that are outside our known good params, for as long as we still make progress.
		PREVIOUS_CANDIDATE="$CANDIDATE"
		CANDIDATE=$(echo "$CANDIDATE" |sed -e "s,--ppapi-flash-\w*=\S*\s\(.*--ppapi-flash-path=/usr/lib/${FLASH_GOOD_PACKAGE}/libpepflashplayer.so --ppapi-flash-version=\),\1,")
		CANDIDATE=$(echo "$CANDIDATE" |sed -e "s,\(.*--ppapi-flash-path=/usr/lib/${FLASH_GOOD_PACKAGE}/libpepflashplayer.so --ppapi-flash-version=.*\) --ppapi-flash-\w*=\S*,\1,")
	done
	CHROMIUM_FLAGS="$CANDIDATE"
fi

# Prefer user defined CHROMIUM_USER_FLAGS (fron env) over system
# default CHROMIUM_FLAGS (from /etc/$APPNAME/default)
if test -n "$CHROMIUM_USER_FLAGS"; then
	echo "WARNING: \$CHROMIUM_USER_FLAGS is deprecated. Instead, update CHROMIUM_FLAGS in ~/.chromium-browser.init or place configuration for all sers in /etc/$APPNAME/customizations/ ."
	echo "WARNING: Ignoring system flags because \$CHROMIUM_USER_FLAGS is set."
	echo "CHROMIUM_FLAGS=${CHROMIUM_FLAGS}"
	echo "CHROMIUM_USER_FLAGS=${CHROMIUM_USER_FLAGS}"
	CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS}
fi

# FFmpeg needs to know where its libs are located
if [ "Z$LD_LIBRARY_PATH" != Z ] ; then
  LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/libs:$LD_LIBRARY_PATH
else
  LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/libs
fi

export LD_LIBRARY_PATH

# For the Default Browser detection to work, we need to give access
# to xdg-settings if it's not present on the system (ensures that the system
# xdg-utils is recent enough). Also set CHROME_WRAPPER in case xdg-settings is
# not able to do anything useful
if [ ! -e /usr/bin/xdg-settings ] ; then
  export PATH="$LIBDIR:$PATH"
fi
export CHROME_WRAPPER="`readlink -f "$0"`"
export CHROME_DESKTOP=$APPNAME.desktop

# lsb_release is slow so try to source the static file /etc/lsb-release instead
if [ -e /etc/lsb-release ] ; then
  . /etc/lsb-release
fi
# Fall back to lsb_release if we didn't get the information we need
if test -z "${DISTRIB_ID:-}"; then
	DIST=$(lsb_release -si)
	RELEASE=$(lsb_release -sr)
else
	DIST=${DISTRIB_ID}
	RELEASE=${DISTRIB_RELEASE}
fi

# Set CHROME_VERSION_EXTRA visible in the About dialog and in about:version
if [ "$DIST $RELEASE" = "$BUILD_DIST" ] ; then
  export CHROME_VERSION_EXTRA="$DIST $RELEASE"
else
  export CHROME_VERSION_EXTRA="Built on $BUILD_DIST, running on $DIST $RELEASE"
fi

want_touch_pinch=1
want_debug=0
want_temp_profile=0
want_verbose=0
while [ $# -gt 0 ]; do
  case "$1" in
    -h | --help | -help )
      usage
      exit 0 ;;
    --verbose )
      want_verbose=1
      shift ;;
    -g | --debug )
      want_debug=1
      shift ;;
    --no-touch-pinch )
      want_touch_pinch=0
      shift ;;
    --temp-profile )
      want_temp_profile=1
      shift ;;
    -- ) # Stop option prcessing
      shift
      break ;;
    * )
      break ;;
  esac
done

discover_registration ${LIBDIR}/pepper/pepper-flash.info ppapi-flash && echo "Pepper Flash detected."

CHROMIUM_FLAGS="${CHROMIUM_FLAGS} ${PLUGIN_PARAMETERS}"

if [ $want_verbose -eq 1 ] ; then
  CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-logging=stderr --v=${want_verbose}"
fi

if [ $want_temp_profile -eq 1 ] ; then
  TEMP_PROFILE=`mktemp -d`
  CHROMIUM_FLAGS="$CHROMIUM_FLAGS --user-data-dir=$TEMP_PROFILE"
fi

if [ $want_touch_pinch -eq 1 ] ; then
  CHROMIUM_FLAGS="$CHROMIUM_FLAGS --enable-pinch"
fi

if [ $want_debug -eq 1 ] ; then
  if [ ! -x $GDB ] ; then
    echo "Sorry, can't find usable $GDB. Please install it."
    exit 1
  fi
  tmpfile=`mktemp /tmp/chromiumargs.XXXXXX` || { echo "Cannot create temporary file" >&2; exit 1; }
  trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
  echo "set args $CHROMIUM_FLAGS ${1+"$@"}" > $tmpfile
  echo "# Env:"
  echo "#     LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
  echo "#                PATH=$PATH"
  echo "#            GTK_PATH=$GTK_PATH"
  echo "# CHROMIUM_USER_FLAGS=$CHROMIUM_USER_FLAGS"
  echo "#      CHROMIUM_FLAGS=$CHROMIUM_FLAGS"
  echo "$GDB $LIBDIR/$APPNAME -x $tmpfile"
  $GDB "$LIBDIR/$APPNAME" -x $tmpfile
  if [ $want_temp_profile -eq 1 ] ; then
    rm -rf $TEMP_PROFILE
  fi
  exit $?
else
  if [ $want_temp_profile -eq 0 ] ; then
    exec $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"
  else
    # we can't exec here as we need to clean-up the temporary profile
    $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"
    rm -rf $TEMP_PROFILE
  fi
fi


text:
Solutions for [Advent of Code 2015](http://adventofcode.com/).

## Usage Note

These solutions make use of ES2015 syntax, which may or may not be fully supported in your version of Node. To be safe, it's best to run these solutions through [Babel](https://babeljs.io/). For example:

```sh
$ babel-node days/day1.js
```

redpajama_set_name: RedPajamaGithub


text:
package at.ac.ait.dme.video_batch;

import java.io.OutputStream;

import org.apache.hadoop.io.compress.CompressionOutputStream;

abstract public class AVOutputStream extends CompressionOutputStream {

    protected AVOutputStream(OutputStream out) {
        super(out);
    }

    abstract public boolean writePacket( AVPacket packet );

}


text:
using System;
using System.Linq;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Configs;
using Xunit;

namespace BenchmarkDotNet.IntegrationTests
{
    internal static class BenchmarkTestExecutor
    {
        /// <summary>
        /// Runs Benchmarks with the most simple config (SingleRunFastConfig)
        /// combined with any benchmark config applied to TBenchmark (via an attribute)
        /// By default will verify if every benchmark was successfully executed
        /// </summary>
        /// <typeparam name="TBenchmark">type that defines Benchmarks</typeparam>
        /// <param name="config">Optional custom config to be used instead of the default</param>
        /// <param name="fullValidation">Optional: disable validation (default = true/enabled)</param>
        /// <returns>The summary from the benchmark run</returns>
        internal static Reports.Summary CanExecute<TBenchmark>(IConfig config = null, bool fullValidation = true)
        {
            return CanExecute(typeof(TBenchmark), config, fullValidation);
        }

        /// <summary>
        /// Runs Benchmarks with the most simple config (SingleRunFastConfig)
        /// combined with any benchmark config applied to Type (via an attribute)
        /// By default will verify if every benchmark was successfully executed
        /// </summary>
        /// <param name="type">type that defines Benchmarks</param>
        /// <param name="config">Optional custom config to be used instead of the default</param>
        /// <param name="fullValidation">Optional: disable validation (default = true/enabled)</param>
        /// <returns>The summary from the benchmark run</returns>
        internal static Reports.Summary CanExecute(Type type, IConfig config = null, bool fullValidation = true)
        {
            // Add logging, so the Benchmark execution is in the TestRunner output (makes Debugging easier)
            if (config == null)
            {
                config = new SingleRunFastConfig()
                             .With(DefaultConfig.Instance.GetLoggers().ToArray())
                             .With(DefaultConfig.Instance.GetColumns().ToArray());
            }

            // Make sure we ALWAYS conbine the Config (default or passed in) with any Config applied to the Type/Class
            var summary = BenchmarkRunner.Run(type, BenchmarkConverter.GetFullConfig(type, config));

            if (fullValidation)
            {
                Assert.False(summary.HasCriticalValidationErrors, "The \"Summary\" should have NOT \"HasCriticalValidationErrors\"");
                Assert.True(summary.Reports.Any(), "The \"Summary\" should contain at least one \"BenchmarkReport\" in the \"Reports\" collection");
                Assert.True(summary.Reports.All(r => r.ExecuteResults.Any(er => er.FoundExecutable && er.Data.Any())),
                            "All reports should have at least one \"ExecuteResult\" with \"FoundExecutable\" = true and at least one \"Data\" item");
                Assert.True(summary.Reports.All(report => report.AllMeasurements.Any()),
                            "All reports should have at least one \"Measurement\" in the \"AllMeasurements\" collection");
            }

            return summary;
        }
    }
}


text:
/**
 *
 */
package ie.ibuttimer.pmat.util;

import android.content.Context;
import android.content.res.Configuration;

/**
 * Utility class providing access to various configuration related functions.
 * @author Ian Buttimer
 *
 */
public class DeviceConfiguration {

	/**
	 *
	 */
	public DeviceConfiguration() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * Helper method to determine if the device has a particular screen size. For
	 * example, 10" tablets are extra-large.
	 */
	private static boolean isScreenSize(Context context, int size) {
		return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= size;
	}

	/**
	 * Helper method to determine if the device has an extra-large screen, i.e. at least 960dp x 720dp. For
	 * example, 10" tablets are extra-large.
	 */
	public static boolean isXLargeScreen(Context context) {
		return isScreenSize(context, Configuration.SCREENLAYOUT_SIZE_XLARGE);
	}

	/**
	 * Helper method to determine if the device has an large screen, i.e. at least 640dp x 480dp. For
	 * example, 10" tablets are extra-large.
	 */
	public static boolean isLargeScreen(Context context) {
		return isScreenSize(context, Configuration.SCREENLAYOUT_SIZE_LARGE);
	}

	/**
	 * Helper method to determine if the device has an large screen, i.e. at least 470dp x 320dp. For
	 * example, 10" tablets are extra-large.
	 */
	public static boolean isNormalScreen(Context context) {
		return isScreenSize(context, Configuration.SCREENLAYOUT_SIZE_NORMAL);
	}

	/**
	 * Helper method to determine if the device has an small screen, i.e. at least 426dp x 320dp. For
	 * example, 10" tablets are extra-large.
	 */
	public static boolean isSmallScreen(Context context) {
		return isScreenSize(context, Configuration.SCREENLAYOUT_SIZE_SMALL);
	}

}


text:
template <typename TAlphabet>
int computeLocalScore(seqan::String<TAlphabet> const & subText, seqan::String<TAlphabet> const & pattern)
{
    int localScore = 0;
    for (unsigned i = 0; i < seqan::length(pattern); ++i)
	if (subText[i] == pattern[i])
	    ++localScore;

	return localScore;
}

template <typename TAlphabet>
seqan::String<int> computeScore(seqan::String<TAlphabet> const & text, seqan::String<TAlphabet> const & pattern)
{
    seqan::String<int> score;
    seqan::resize(score, seqan::length(text) - seqan::length(pattern) + 1);

    for (unsigned i = 0; i < length(score); ++i) {
	seqan::String<char> t = infix(text, i, i + seqan::length(pattern));
	score[i] = computeLocalScore(t, pattern);
    }

    return score;
}

template <typename TScore>
void print(seqan::String<TScore> const & score){
    for (unsigned i = 0; i < seqan::length(score); ++i)
	std::cout << score[i] << " ";
    std::cout << std::endl;
}

int main()
{
    seqan::String<char> text = "This is an awesome tutorial to get to now SeqAn!";
    seqan::String<char> pattern = "tutorial";
    seqan::String<int> score = computeScore(text, pattern);
    print(score);
    return 0;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Taabus.Data;
using Taabus.External;
using Taabus.UserInterface;

namespace Taabus
{
    interface ITaabusController
    {
        ExpansionDescription[] ExpansionDescriptions { get; set; }
        string[] Selection { get; set; }
        Server[] Servers { get; set; }
        External.Item[] Items { get; set; }
        string ProjectName { get; }
        void OnOpen();
        void Exit();
    }

    interface IExternalIdProvider
    {
        int Id(Internalizer.IItem parent);
    }

    interface IDataColumn
    {
        string Name { get; }
    }

    interface IColumnsAndDataProvider
    {
        IEnumerable<IDataColumn> Columns { get; }
        IEnumerable<DataRecord> Data { get; }
    }
}


text:
package com.dove.samples;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;

import com.dove.ui.SwipeableItemView;

public class SListItemView extends FrameLayout implements SwipeableItemView {
    private final static String TAG = SListItemView.class.getSimpleName();

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

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

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

    private void init(Context context) {
        addView(View.inflate(context, R.layout.slv_item, null));
    }

    @Override
    public float getMinAllowScrollDistance() {
        return 150;
    }

    @Override
    public SwipeableView getSwipeableView() {
        return SwipeableView.from(this);
    }

    @Override
    public boolean canChildBeDismissed() {
        return true;
    }

    @Override
    public void dimiss() {
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        final boolean res = super.onInterceptTouchEvent(ev);
        Log.d(TAG, "onInterceptTouchEvent " + ev.getAction() + " := " + res);
        return res;
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        // TODO Auto-generated method stub
        final boolean res = super.onTouchEvent(ev);
        Log.d(TAG, "onTouchEvent " + ev.getAction() + " := " + res);
        return true;
    }
}


text:
/* $Id: MinFunction.java 1328963 2012-04-22 20:09:42Z gadams $ */

package org.apache.fop.fo.expr;

import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.properties.Property;

/**
 * Class for managing the "min" Number Function. See Sec. 5.10.1 in the XSL-FO
 * standard.
 */
public class MinFunction extends FunctionBase {

    /** {@inheritDoc} */
    public int getRequiredArgsCount() {
        return 2;
    }

    /** {@inheritDoc} */
    public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException {
        Numeric n1 = args[0].getNumeric();
        Numeric n2 = args[1].getNumeric();
        if (n1 == null || n2 == null) {
            throw new PropertyException("Non numeric operands to min function");
        }
        return (Property) NumericOp.min(n1, n2);
       }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Netplanetes.Analytics.Lookups.DocoDocoJp
{
    internal static class DocoocoJpConstants
    {
        // root element name
        public const string Docodoco = "docodoco";

        // element names of success result.
        public const string Ip = "ip";
        public const string ContinentCode = "continentcode";
        public const string CountryCode = "countrycode";
        public const string CountryAName = "countryaname";
        public const string CountryJName = "countryjname";
        public const string PrefCode = "prefcode";
        public const string RegionCode = "regioncode";
        public const string PrefAName = "prefaname";
        public const string PrefJName = "prefjname";
        public const string PrefLatitude = "preflatitude";
        public const string PrefLongtude = "preflongtude";
        public const string PrefCF = "prefcf";
        public const string CityCode = "citycode";
        public const string CityAName = "cityaname";
        public const string CityJName = "cityjname";
        public const string CityLatitude = "citylatitude";
        public const string CityLongtude = "citylongtude";
        public const string CityCF = "citycf";
        public const string BCFlag = "bcflag";
        public const string OrgCode = "orgcode";
        public const string OrgOfficeCode = "orgofficecode";
        public const string OrgIndependentCode = "orgindependentcode";
        public const string OrgName = "orgname";
        public const string OrgPrefCode = "orgprefcode";
        public const string OrgCityCode = "orgcitycode";
        public const string OrgZipCode = "orgzipcode";
        public const string OrgAliress = "orgaliress";
        public const string OrgTel = "orgtel";
        public const string OrgFax = "orgfax";
        public const string OrgIpoType = "orgipotype";
        public const string OrgDate = "orgdate";
        public const string OrgCapitalCode = "orgcapitalcode";
        public const string OrgEmployeesCode = "orgemployeescode";
        public const string OrgGrossCode = "orggrosscode";
        public const string OrgPresclassent = "orgpresclassent";
        public const string OrgIndustrialCategoryL = "orgIndustrialcategoryl";
        public const string OrgIndustrialCategoryM = "orgIndustrialcategorym";
        public const string OrgIndustrialCategoryS = "orgIndustrialcategorys";
        public const string OrgIndustrialCategoryT = "orgIndustrialcategoryt";
        public const string OrgDomainName = "orgcomainname";
        public const string OrgDomainType = "orgdomaintype";
        public const string LineCode = "linecode";
        public const string LineJName = "linejname";
        public const string LineCF = "linecf";
        public const string TimeZone = "timezone";
        public const string TelCode = "telcode";
        public const string StockTickerNumber = "stocktickernumber";
        public const string DomainName = "domainname";
        public const string DomainType = "domaintype";

        // element names of fail result.
        public const string Status = "status";
        public const string Message = "message";

    }
}


text:
import os
from django.utils import simplejson
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import users, prospective_search, memcache
from datetime import datetime
import time

import auth
import models
import channels
import stats
import timestamp

import logging

class ConnectedPage(webapp.RequestHandler):
    def post(self, name="Chrome"):
        self.response.headers.add_header("Access-Control-Allow-Origin", "*")
        user = auth.getCurrentUser()
        device = None
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            try:
                device = models.getDevice("%s/%s" % (user.email(), name))
            except:
                device = models.DeviceData(user=user_data, name=name).save()
            last_links = models.getUnreadLinks(device)
            channel = channels.Channel(device.address, False)
            for link in last_links:
                channel.queueLink(link)
            channel.send()
            stats.record("user_connected",
                    simplejson.dumps({"user": user.email()}))
            self.response.out.write(device.address)

class MainPage(webapp.RequestHandler):
    def get(self):
        user = auth.getCurrentUser()
        name = "Web"
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            try:
                device = models.getDevice("%s/%s" % (user.email(), name))
            except models.DeviceDoesNotExistError:
                device = models.DeviceData(user=user_data, name=name).save()
            over_quota = False
            try:
                channel = channels.Channel(device.address,
                        override_quota=user_data.immune())
                channel_token = channel.token
            except channels.OverQuotaError:
                over_quota = True
                channel_token = 'overquota'
            template_values = {
                'channel_id': channel_token,
                'device': device.address,
                'device_name': device.name,
                'devices': user_data.getDevices(),
                'over_quota': over_quota
            }
            path = os.path.join(os.path.dirname(__file__),
                'devlinks_index.html')
            self.response.out.write(template.render(path, template_values))
        else:
            self.redirect(users.create_login_url(self.request.uri))

class AddLinkPage(webapp.RequestHandler):
    def post(self):
        self.response.headers.add_header("Access-Control-Allow-Origin", "*")
        user = auth.getCurrentUser()
        response = {}
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            name = self.request.get('name')
            if not name:
                name = "Chrome"
            try:
                device = models.getDevice("%s/%s" % (user.email(), name))
            except models.DeviceDoesNotExistError:
                device = models.DeviceData(name=name, user=user_data).save()
            receiver = None
            if self.request.get("receiver"):
                try:
                    receiver = models.getDevice("%s/%s" % (user.email(),
                      self.request.get("receiver")))
                except models.DeviceDoesNotExistError:
                    receiver = models.DeviceData(
                        name=self.request.get("receiver"),
                        user=user_data).save()
            if receiver == None:
                receiver = device
            link = models.LinkData(url=self.request.get('link'),
                sender=device, receiver=receiver).save()
            if models.getQuota().amount >= models.getStats(
                    'channels').count or user_data.immune():
                channel = channels.Channel(receiver.address, False)
                channel.sendLink(link)
                response['code'] = 200
                response['link'] = link.url
            else:
                response['code'] = 503
                response['link'] = link.url
        else:
            response['code'] = 401
            response['link'] = self.request.get('link')
        self.response.out.write(simplejson.dumps(response))

class TokenPage(webapp.RequestHandler):
    def get(self, name=False):
        self.response.headers.add_header("Access-Control-Allow-Origin", "*")
        user = auth.getCurrentUser()
        response = {}
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            if not name:
                name = "Chrome"
            try:
                device = models.getDevice("%s/%s" % (user.email(), name))
            except models.DeviceDoesNotExistError:
                device = models.DeviceData(user=user_data, name=name).save()
            try:
                channel = channels.Channel(device.address,
                        override_quota=user_data.immune())
                response['token'] = channel.token
                if channel.cached:
                    response['code'] = 304
                else:
                    response['code'] = 200
            except channels.OverQuotaError:
                response['code'] = 503
                response['token'] = 'overquota'
                response['message'] = "Server is over quota."
        else:
            response['code'] = 401
            response['message'] = 'Not logged in.'
        self.response.out.write(simplejson.dumps(response))

class MarkAsReadHandler(webapp.RequestHandler):
    def post(self, json=False):
        self.response.headers.add_header("Access-Control-Allow-Origin", "*")
        json = self.request.get('links')
        if json != False:
            sent_data = simplejson.loads(json)
            for link in sent_data:
                link_data = models.getLink(link)
                link_data.markRead()

class SetQuotaHandler(webapp.RequestHandler):
    def get(self):
        quota = models.getQuota()
        logging.info("Quota: %s" % quota)
        cur_quota = 0
        if type(quota) == type(db.Key()):
            cur_quota = quota.amount
        vars = {
                'current': cur_quota
        }
        logging.debug(quota.amount)
        path = os.path.join(os.path.dirname(__file__), 'quota.html')
        self.response.out.write(template.render(path, vars))

    def post(self):
        quota = self.request.POST['quota']
        newQuota = models.updateQuota(quota)
        self.response.out.write("Quota updated to %s channels." %
                newQuota.amount)

class SubscribeHandler(webapp.RequestHandler):
    def get(self):
        path = os.path.join(os.path.dirname(__file__), 'subscribe.html')
        self.response.out.write(template.render(path, {}))

    def post(self):
        event = self.request.POST['event']
        datapoint = self.request.POST['datapoint']
        subscription_id = models.StatsSubscription(event=event,
            datapoint=datapoint).put()
        prospective_search.subscribe(stats.StatsRecord, 'event:%s' % event,
            subscription_id)
        self.response.out.write("Subscribed the datapoint %s to %s events." %
            (datapoint, event))

class StatsHandler(webapp.RequestHandler):
    def post(self):
        record = prospective_search.get_document(self.request)
        record_value = simplejson.loads(record.value)
        subscriber_keys = map(db.Key, self.request.get_all('id'))
        subscribers = db.get(subscriber_keys)
        datapoints = []
        stats_json = []
        for subscriber_key, subscriber in zip(subscriber_keys, subscribers):
            if not subscriber:
                prospective_search.unsubscribe(stats.StatsRecord,
                    subscriber_key)
            else:
                datapoints.append(models.getStats(subscriber.datapoint,
                    record.timestamp, duration='day'))
                datapoints.append(models.getStats(subscriber.datapoint,
                    record.timestamp, duration='hour'))
        for datapoint in datapoints:
            if datapoint.datapoint == 'active_users':
                try:
                    user = models.getUser(record_value['user'], False)
                except models.UserDoesNotExistError:
                    continue
                last_seen = user.last_seen
                new_last_seen = timestamp.now()
                if datapoint.duration == "day":
                    last_seen = last_seen.replace(hour=0, minute=0, second=0,
                            microsecond=0)
                    new_last_seen = new_last_seen.replace(hour=0, minute=0,
                            second=0, microsecond=0)
                if last_seen < new_last_seen:
                    user.updateLastSeen(new_last_seen)
                    user.save()
                else:
                    continue
            if datapoint.datapoint == 'quota':
                datapoint.count = models.getQuota().amount
            else:
                datapoint.increment()
            json = {'datapoint': datapoint.datapoint, 'value': datapoint.count,
                    'date': datapoint.date.strftime("%D, %M %d %y"),
                    'datestamp': int(time.mktime(
                        datapoint.date.date().timetuple())) * 1000,
                    'hour': datapoint.date.hour}
            if datapoint.duration == "day":
                json['hour'] = "total"
            stats_json.append(json)
        db.put(datapoints)
        push = channels.Channel("stats@2cloudproject.com/Web", False)
        push.message = {"stats": stats_json}
        push.send()
        logging.debug(simplejson.dumps(stats_json))

class StatsDashboard(webapp.RequestHandler):
    def get(self):
        user = users.User('stats@2cloudproject.com')
        try:
            user_data = models.getUser(user)
        except models.UserDoesNotExistError:
            user_data = models.UserData(user=user).save()
        try:
            device = models.getDevice("%s/%s" % (user.email(), "Web"))
        except models.DeviceDoesNotExistError:
            device = models.DeviceData(user=user_data,
                    name="Web").save()
        channel = channels.Channel(device.address, override_quota=True)
        path = os.path.join(os.path.dirname(__file__), 'dashboard.html')
        stats_data = models.StatsData.all().order("-date").fetch(1000)
        template_values = {
                'channel_id': channel.token,
                'stats': {}
        }
        stats = template_values['stats']
        for datapoint in stats_data:
            datestamp = int(time.mktime(
                datapoint.date.date().timetuple()) * 1000)
            hour = datapoint.date.hour
            if datestamp not in stats:
                stats[datestamp] = {
                        'datestamp': datestamp,
                        'date': datapoint.date,
                        'datapoints': {}
                    }
            if datapoint.datapoint not in stats[datestamp]['datapoints']:
                stats[datestamp]['datapoints'][datapoint.datapoint] = {
                        'datapoint': datapoint.datapoint,
                        'values': {}
                    }
            point_id = "%s" % hour
            if datapoint.duration == "day":
                point_id = "total"
            dp = datapoint.datapoint
            stats[datestamp]['datapoints'][dp]['values'][point_id] = {
                    'datapoint': datapoint.datapoint,
                    'datestamp': datestamp,
                    'hour':      hour,
                    'count':     int(datapoint.count),
                    'duration':  datapoint.duration
            }
        template_values['stats'] = stats
        logging.info(template_values)
        self.response.out.write(template.render(path, template_values))

class StatsInit(webapp.RequestHandler):
    def get(self, duration='hour'):
        datapoints = ['registrations', 'links', 'opened_links', 'channels',
                'devices', 'connections', 'active_users', 'quota', 'payments']
        for datapoint in datapoints:
            datapoint = models.getStats(datapoint, duration=duration)

class QuotaCountdown(webapp.RequestHandler):
    def get(self):
        stamp = timestamp.now()
        reset = stamp.replace(day=stamp.day + 1, hour=0, minute=0, second=0,
                microsecond=0)
        countdown = reset - stamp
        response = {}
        response['readable'] = str(countdown)
        response['seconds'] = countdown.seconds + (countdown.days * 24 * 3600)
        self.response.out.write(simplejson.dumps(response))

class PaymentNotificationHandler(webapp.RequestHandler):
    def post(self):
        user = auth.getCurrentUser()
        response = {}
        if user:
            try:
                user_data = models.getUser(user)
            except models.UserDoesNotExistError:
                user_data = models.UserData(user=user).save()
            payment_data = models.PaymentData(date=timestamp.now(),
                    user=user_data, item=self.request.get("item_id"),
                    order_number=self.request.get("order_number"),
                    status="unconfirmed")
            payment_data.save()

class CheckTimeHandler(webapp.RequestHandler):
    def get(self):
        self.response.out.write(simplejson.dumps({
            "code": 200,
            "timestamp": int(time.mktime(datetime.now().timetuple())) * 1000
        }))

class ClearCacheHandler(webapp.RequestHandler):
    def get(self):
        memcache.flush_all()
        self.response.out.write("Cache cleared.")

application = webapp.WSGIApplication([
        ('/', MainPage),
        ('/links/add', AddLinkPage),
        ('/links/mark_read', MarkAsReadHandler),
        ('/channels/connected', ConnectedPage),
        ('/channels/connected/([^/]*)', ConnectedPage),
        ('/channels/get', TokenPage),
        ('/channels/get/(.*)', TokenPage),
        ('/stats/subscribe', SubscribeHandler),
        ('/stats/dashboard', StatsDashboard),
        ('/stats/init/(.*)', StatsInit),
        ('/quota/countdown', QuotaCountdown),
        ('/quota/set', SetQuotaHandler),
        ('/_ah/prospective_search', StatsHandler),
        ('/payments/notification', PaymentNotificationHandler),
        ('/cache/clear', ClearCacheHandler),
        ('/util/time', CheckTimeHandler)
        ], debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()


text:
require "ml_ratiosolve/version"
require 'ml_ratiosolve/ml_ratiosolve'
require 'ml_ratiosolve/error_bootstrapping'

module MLRatioSolveBin

  def self.go(opts)
    n_starts = opts[:n_starts]
    n_iter = opts[:n_iter]
    n_for_bootstrap = opts[:n_bootstrap]
    tol = opts[:tol]
    ci_level = opts[:ci_level]
    norm_index = opts[:norm_index]

    MLRatioSolve.set_skip_indices(opts[:skip])

    x = nil

    if opts[:stdin] then
      x = MLRatioSolve.read_data_from_io(STDIN)
    else
      x = MLRatioSolve.read_data_from_file(opts[:file])
    end

    if opts[:quiet] then
      MLRatioSolve.quiet_mode(true)
    end

    n_gammas_to_fit = x.shape[1] - 1

    best = MLRatioSolve.grid_multiple_iters(n_starts, n_gammas_to_fit, n_iter, x, tol)

    puts "Best solution found: "
    puts "mu: #{best[:mu]/best[:mu][norm_index]}"
    puts "sig: #{best[:sig2].map{ |e| Math.sqrt(e)/best[:mu][norm_index] }.to_s}"
    puts "gamma: #{best[:gamma]}"
    puts "log l: #{best[:l]}"

    puts "Error estimate:"
    puts MLRatioSolve.ml_sem_estimate(best, norm_index)

    #sim_results = ErrorBootstrapping.estimate_with_gen_data(n_for_bootstrap, best, x, n_iter, tol)
    #ci_lower, ci_upper = ErrorBootstrapping.bootstrap_ci(sim_results, ci_level)
    # puts "boostrapped #{ci_level*100}% confidence interval: "
    # puts ci_lower.to_a.join(", ")
    # puts ci_upper.to_a.join(", ")
  end

end


text:
<resources>
    <string name="app_name">Firebase Options</string>
</resources>


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmWinnysVideoRental
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
        Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.miExit = New System.Windows.Forms.ToolStripMenuItem()
        Me.ToolsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.miAddVideo = New System.Windows.Forms.ToolStripMenuItem()
        Me.miRemoveVideo = New System.Windows.Forms.ToolStripMenuItem()
        Me.miTotalFees = New System.Windows.Forms.ToolStripMenuItem()
        Me.lblAvailable = New System.Windows.Forms.Label()
        Me.lblRented = New System.Windows.Forms.Label()
        Me.lstAvailable = New System.Windows.Forms.ListBox()
        Me.lstRented = New System.Windows.Forms.ListBox()
        Me.btnRent = New System.Windows.Forms.Button()
        Me.btnReturn = New System.Windows.Forms.Button()
        Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
        Me.tsslLastAction = New System.Windows.Forms.ToolStripStatusLabel()
        Me.tsslSpacer = New System.Windows.Forms.ToolStripStatusLabel()
        Me.tsslAuthor = New System.Windows.Forms.ToolStripStatusLabel()
        Me.MenuStrip1.SuspendLayout()
        Me.StatusStrip1.SuspendLayout()
        Me.SuspendLayout()
        '
        'MenuStrip1
        '
        Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.ToolsToolStripMenuItem})
        Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
        Me.MenuStrip1.Name = "MenuStrip1"
        Me.MenuStrip1.Size = New System.Drawing.Size(361, 24)
        Me.MenuStrip1.TabIndex = 0
        Me.MenuStrip1.Text = "MenuStrip1"
        '
        'FileToolStripMenuItem
        '
        Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.miExit})
        Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
        Me.FileToolStripMenuItem.Size = New System.Drawing.Size(35, 20)
        Me.FileToolStripMenuItem.Text = "&File"
        '
        'miExit
        '
        Me.miExit.Name = "miExit"
        Me.miExit.ShortcutKeys = CType((System.Windows.Forms.Keys.Alt Or System.Windows.Forms.Keys.F4), System.Windows.Forms.Keys)
        Me.miExit.Size = New System.Drawing.Size(132, 22)
        Me.miExit.Text = "E&xit"
        '
        'ToolsToolStripMenuItem
        '
        Me.ToolsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.miAddVideo, Me.miRemoveVideo, Me.miTotalFees})
        Me.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem"
        Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(44, 20)
        Me.ToolsToolStripMenuItem.Text = "&Tools"
        '
        'miAddVideo
        '
        Me.miAddVideo.Name = "miAddVideo"
        Me.miAddVideo.ShortcutKeys = System.Windows.Forms.Keys.F9
        Me.miAddVideo.Size = New System.Drawing.Size(167, 22)
        Me.miAddVideo.Text = "&Add Video"
        '
        'miRemoveVideo
        '
        Me.miRemoveVideo.Name = "miRemoveVideo"
        Me.miRemoveVideo.ShortcutKeys = System.Windows.Forms.Keys.F10
        Me.miRemoveVideo.Size = New System.Drawing.Size(167, 22)
        Me.miRemoveVideo.Text = "&Remove Video"
        '
        'miTotalFees
        '
        Me.miTotalFees.Name = "miTotalFees"
        Me.miTotalFees.ShortcutKeys = System.Windows.Forms.Keys.F11
        Me.miTotalFees.Size = New System.Drawing.Size(167, 22)
        Me.miTotalFees.Text = "Total &Fees"
        '
        'lblAvailable
        '
        Me.lblAvailable.AutoSize = True
        Me.lblAvailable.Location = New System.Drawing.Point(67, 39)
        Me.lblAvailable.Name = "lblAvailable"
        Me.lblAvailable.Size = New System.Drawing.Size(50, 13)
        Me.lblAvailable.TabIndex = 1
        Me.lblAvailable.Text = "&Available"
        '
        'lblRented
        '
        Me.lblRented.AutoSize = True
        Me.lblRented.Location = New System.Drawing.Point(248, 39)
        Me.lblRented.Name = "lblRented"
        Me.lblRented.Size = New System.Drawing.Size(42, 13)
        Me.lblRented.TabIndex = 3
        Me.lblRented.Text = "&Rented"
        '
        'lstAvailable
        '
        Me.lstAvailable.FormattingEnabled = True
        Me.lstAvailable.Location = New System.Drawing.Point(12, 68)
        Me.lstAvailable.Name = "lstAvailable"
        Me.lstAvailable.Size = New System.Drawing.Size(160, 95)
        Me.lstAvailable.TabIndex = 2
        '
        'lstRented
        '
        Me.lstRented.FormattingEnabled = True
        Me.lstRented.Location = New System.Drawing.Point(189, 68)
        Me.lstRented.Name = "lstRented"
        Me.lstRented.Size = New System.Drawing.Size(160, 95)
        Me.lstRented.TabIndex = 4
        '
        'btnRent
        '
        Me.btnRent.Location = New System.Drawing.Point(55, 178)
        Me.btnRent.Name = "btnRent"
        Me.btnRent.Size = New System.Drawing.Size(75, 23)
        Me.btnRent.TabIndex = 5
        Me.btnRent.Text = "R&ent"
        Me.btnRent.UseVisualStyleBackColor = True
        '
        'btnReturn
        '
        Me.btnReturn.Location = New System.Drawing.Point(232, 178)
        Me.btnReturn.Name = "btnReturn"
        Me.btnReturn.Size = New System.Drawing.Size(75, 23)
        Me.btnReturn.TabIndex = 6
        Me.btnReturn.Text = "Ret&urn"
        Me.btnReturn.UseVisualStyleBackColor = True
        '
        'StatusStrip1
        '
        Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsslLastAction, Me.tsslSpacer, Me.tsslAuthor})
        Me.StatusStrip1.Location = New System.Drawing.Point(0, 217)
        Me.StatusStrip1.Name = "StatusStrip1"
        Me.StatusStrip1.Size = New System.Drawing.Size(361, 22)
        Me.StatusStrip1.SizingGrip = False
        Me.StatusStrip1.TabIndex = 7
        Me.StatusStrip1.Text = "StatusStrip1"
        '
        'tsslLastAction
        '
        Me.tsslLastAction.Name = "tsslLastAction"
        Me.tsslLastAction.Size = New System.Drawing.Size(0, 17)
        '
        'tsslSpacer
        '
        Me.tsslSpacer.Name = "tsslSpacer"
        Me.tsslSpacer.Size = New System.Drawing.Size(247, 17)
        Me.tsslSpacer.Spring = True
        '
        'tsslAuthor
        '
        Me.tsslAuthor.Name = "tsslAuthor"
        Me.tsslAuthor.Size = New System.Drawing.Size(99, 17)
        Me.tsslAuthor.Text = "PA 6 by Winston W"
        '
        'frmWinnysVideoRental
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(361, 239)
        Me.Controls.Add(Me.StatusStrip1)
        Me.Controls.Add(Me.btnReturn)
        Me.Controls.Add(Me.btnRent)
        Me.Controls.Add(Me.lstRented)
        Me.Controls.Add(Me.lstAvailable)
        Me.Controls.Add(Me.lblRented)
        Me.Controls.Add(Me.lblAvailable)
        Me.Controls.Add(Me.MenuStrip1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.MainMenuStrip = Me.MenuStrip1
        Me.MaximizeBox = False
        Me.Name = "frmWinnysVideoRental"
        Me.Text = "Winny's Video Rental"
        Me.MenuStrip1.ResumeLayout(False)
        Me.MenuStrip1.PerformLayout()
        Me.StatusStrip1.ResumeLayout(False)
        Me.StatusStrip1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
    Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents miExit As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ToolsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents miAddVideo As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents miRemoveVideo As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents miTotalFees As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents lblAvailable As System.Windows.Forms.Label
    Friend WithEvents lblRented As System.Windows.Forms.Label
    Friend WithEvents lstAvailable As System.Windows.Forms.ListBox
    Friend WithEvents lstRented As System.Windows.Forms.ListBox
    Friend WithEvents btnRent As System.Windows.Forms.Button
    Friend WithEvents btnReturn As System.Windows.Forms.Button
    Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip
    Friend WithEvents tsslLastAction As System.Windows.Forms.ToolStripStatusLabel
    Friend WithEvents tsslSpacer As System.Windows.Forms.ToolStripStatusLabel
    Friend WithEvents tsslAuthor As System.Windows.Forms.ToolStripStatusLabel

End Class


text:
@interface BPButton : UIButton

@end


text:
/* generated from Designfiles Public by generate_data_designfles */
require ('wh.compat.base');
/*! REQUIRE: wh.compat.base !*/

(function($) { //mootools wrapper

$wh.DownloadManager = new Class(
{ Implements: [Events,Options]
, started: false
, destroyed: false
, cookieinterval: null

, initialize:function(url, options)
  {
    this.url=url;
    this.setOptions(options);

    this.downloadid=(Math.random().toString().substr(2)) + (++$wh.DownloadManager.dlid);
    this.cookiename="wh-download-" + this.downloadid;
  }
, destroy:function()
  {
    if(this.dlframe)
      this.dlframe.dispose();
    this.destroyed=true;
  }
, startDownload:function()
  {
    if(this.started)
      return;

    this.started = true;
    var dlurl = this.url + (this.url.indexOf('?')==-1 ? '?' : '&') + 'wh-download=' + this.downloadid;
    this.dlframe = new Element("iframe", {styles: {"display":"none"}
                                         ,src: dlurl
                                         ,events: {"load": this.onDownloadFrameLoad.bind(this)
                                                  }
                                         });
    this.dlframe.store("failurehandler", this.onDownloadFailure.bind(this));
    document.body.appendChild(this.dlframe);
    this.cookieinterval=window.setInterval(this.cookieCheck.bind(this), 100);
  }
, cookieCheck:function()
  {
    var data = Cookie.read(this.cookiename);
    if(!data)
      return;

    Cookie.dispose(this.cookiename);
    window.clearInterval(this.cookieinterval);

    if(this.destroyed)
      return;

    this.fireEvent("start", {target:this});
  }
, onDownloadFrameLoad:function(event)
  {
    console.log("frameloaded", event)
  }
, onDownloadFailure:function(errorinfo)
  {
    window.clearInterval(this.cookieinterval);
    if(this.destroyed)
      return;

    this.fireEvent("fail", {target:this, errorinfo: errorinfo});
  }
});

$wh.DownloadManager.dlid=0;
$wh.DownloadManager.__failurecallback = function(iframe, data)
{
  $(iframe).retrieve("failurehandler")(data);
}

})(document.id); //end mootools wrapper


text:
namespace autofill {

AutofillVirtualCardEnrollmentInfoBarDelegateMobile::
    AutofillVirtualCardEnrollmentInfoBarDelegateMobile(
        VirtualCardEnrollBubbleController*
            virtual_card_enroll_bubble_controller)
    : ConfirmInfoBarDelegate(),
      virtual_card_enroll_bubble_controller_(
          virtual_card_enroll_bubble_controller) {}

AutofillVirtualCardEnrollmentInfoBarDelegateMobile::
    ~AutofillVirtualCardEnrollmentInfoBarDelegateMobile() {
  if (!had_user_interaction_)
    OnInfobarClosed(PaymentsBubbleClosedReason::kNotInteracted);
}

// static
AutofillVirtualCardEnrollmentInfoBarDelegateMobile*
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::FromInfobarDelegate(
    infobars::InfoBarDelegate* delegate) {
  return delegate->GetIdentifier() ==
                 AUTOFILL_VIRTUAL_CARD_ENROLLMENT_INFOBAR_DELEGATE_MOBILE
             ? static_cast<AutofillVirtualCardEnrollmentInfoBarDelegateMobile*>(
                   delegate)
             : nullptr;
}

std::u16string
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetDescriptionText() const {
  return virtual_card_enroll_bubble_controller_->GetExplanatoryMessage();
}

std::u16string
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetLearnMoreLinkText()
    const {
  return virtual_card_enroll_bubble_controller_->GetLearnMoreLinkText();
}

const gfx::ImageSkia*
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetIssuerIcon() const {
  return virtual_card_enroll_bubble_controller_
      ->GetVirtualCardEnrollmentFields()
      .card_art_image;
}

std::u16string
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetCardLabel() const {
  return virtual_card_enroll_bubble_controller_
      ->GetVirtualCardEnrollmentFields()
      .credit_card.CardIdentifierStringForAutofillDisplay();
}

LegalMessageLines
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetGoogleLegalMessage()
    const {
  return virtual_card_enroll_bubble_controller_
      ->GetVirtualCardEnrollmentFields()
      .google_legal_message;
}

LegalMessageLines
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetIssuerLegalMessage()
    const {
  return virtual_card_enroll_bubble_controller_
      ->GetVirtualCardEnrollmentFields()
      .issuer_legal_message;
}

void AutofillVirtualCardEnrollmentInfoBarDelegateMobile::OnInfobarLinkClicked(
    GURL url,
    VirtualCardEnrollmentLinkType link_type) {
  virtual_card_enroll_bubble_controller_->OnLinkClicked(link_type, url);
}

infobars::InfoBarDelegate::InfoBarIdentifier
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetIdentifier() const {
  return AUTOFILL_VIRTUAL_CARD_ENROLLMENT_INFOBAR_DELEGATE_MOBILE;
}

int AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetIconId() const {
  return IDR_AUTOFILL_GOOGLE_PAY_WITH_DIVIDER;
}

std::u16string
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetMessageText() const {
  return virtual_card_enroll_bubble_controller_->GetWindowTitle();
}

int AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetButtons() const {
  return BUTTON_OK | BUTTON_CANCEL;
}

std::u16string
AutofillVirtualCardEnrollmentInfoBarDelegateMobile::GetButtonLabel(
    InfoBarButton button) const {
  if (button == BUTTON_OK)
    return virtual_card_enroll_bubble_controller_->GetAcceptButtonText();
  if (button == BUTTON_CANCEL)
    return virtual_card_enroll_bubble_controller_->GetDeclineButtonText();
  NOTREACHED() << "Unsupported button label requested.";
  return std::u16string();
}

void AutofillVirtualCardEnrollmentInfoBarDelegateMobile::InfoBarDismissed() {
  OnInfobarClosed(PaymentsBubbleClosedReason::kCancelled);
  virtual_card_enroll_bubble_controller_->OnDeclineButton();
}

bool AutofillVirtualCardEnrollmentInfoBarDelegateMobile::Cancel() {
  OnInfobarClosed(PaymentsBubbleClosedReason::kCancelled);
  virtual_card_enroll_bubble_controller_->OnDeclineButton();
  return true;
}

bool AutofillVirtualCardEnrollmentInfoBarDelegateMobile::Accept() {
  OnInfobarClosed(PaymentsBubbleClosedReason::kAccepted);
  virtual_card_enroll_bubble_controller_->OnAcceptButton();
  return true;
}

void AutofillVirtualCardEnrollmentInfoBarDelegateMobile::OnInfobarClosed(
    PaymentsBubbleClosedReason closed_reason) {
  DCHECK(!had_user_interaction_);

  virtual_card_enroll_bubble_controller_->OnBubbleClosed(closed_reason);
  had_user_interaction_ = true;
}

}  // namespace autofill


text:
/** @file vtkCudaFunctionPolygonReader.h
 *
 *  @brief Header file defining a reader for polygonal TF objects
 *
 *  @author John Stuart Haberl Baxter (Dr. Peters' Lab (VASST) at Robarts Research Institute)
 *  @note First documented on December 14, 2011
 *
 */
#ifndef VTKCUDAFUNCTIONPOLYGONREADER_H
#define VTKCUDAFUNCTIONPOLYGONREADER_H

#include "vtkCudaCommonExport.h"

#include "vtkCudaFunctionPolygon.h"
#include <string>
#include <list>

/**
 *  @brief Class that writes function polygons to file in a set format
 *  @see vtkCudaFunctionPolygon vtkCudaFunctionPolygonReader
 *
 */
class vtkCudaCommonExport vtkCudaFunctionPolygonReader : public vtkObject
{
public:
  static vtkCudaFunctionPolygonReader* New();
  vtkTypeMacro( vtkCudaFunctionPolygonReader, vtkObject );

  void SetFileName( const std::string& filename );
  void Read();
  void Clear();
  vtkCudaFunctionPolygon* GetOutput( unsigned int n );
  size_t GetNumberOfOutputs();

protected:
  vtkCudaFunctionPolygonReader();
  ~vtkCudaFunctionPolygonReader();

  vtkCudaFunctionPolygon* readTFPolygon();

  std::list<vtkCudaFunctionPolygon*> objects;
  std::string filename;
  bool fileNameSet;

  std::ifstream* file;
};
#endif


text:
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------------------------------------------

using System;

namespace Microsoft.PSharp.LanguageServices.Rewriting.CSharp
{
    /// <summary>
    /// Attribute for custom C# rewriting pass.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public sealed class RewritingPassDependencyAttribute : Attribute
    {
        /// <summary>
        /// Pass dependencies.
        /// </summary>
        internal Type[] Dependencies;

        /// <summary>
        /// Initializes a new instance of the <see cref="RewritingPassDependencyAttribute"/> class.
        /// </summary>
        public RewritingPassDependencyAttribute(params Type[] dependencies)
        {
            this.Dependencies = dependencies;
        }
    }
}


text:
import { h, FunctionalComponent } from '@stencil/core';

import type { INameJSON } from '../../crypto/name';
import { l10n } from '../../utils';

import { RowTitle, RowValue } from './row';

interface ISubjectNameProps {
  name: INameJSON[];
}

export const SubjectName: FunctionalComponent<ISubjectNameProps> = (props) => {
  const { name } = props;

  return [
    <RowTitle
      value={l10n.getString('subjectName')}
    />,
    name.map((n) => (
      <RowValue
        name={n.name || n.type}
        value={n.value}
      />
    )),
  ];
};