text:
package org.flywaydb.core.util.jdbc;

import org.flywaydb.core.api.FlywayException;
import org.flywaydb.core.util.logging.Log;
import org.flywaydb.core.util.logging.LogFactory;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * Spring-like template for executing transactions.
 */
public class TransactionTemplate {
    private static final Log LOG = LogFactory.getLog(TransactionTemplate.class);

    /**
     * The connection for the transaction.
     */
    private final Connection connection;

    /**
     * Whether to roll back the transaction when an exception is thrown.
     */
    private final boolean rollbackOnException;

    /**
     * Creates a new transaction template for this connection.
     *
     * @param connection The connection for the transaction.
     */
    public TransactionTemplate(Connection connection) {
        this(connection, true);
    }

    /**
     * Creates a new transaction template for this connection.
     *
     * @param connection          The connection for the transaction.
     * @param rollbackOnException Whether to roll back the transaction when an exception is thrown.
     */
    public TransactionTemplate(Connection connection, boolean rollbackOnException) {
        this.connection = connection;
        this.rollbackOnException = rollbackOnException;
    }

    /**
     * Executes this callback within a transaction.
     *
     * @param transactionCallback The callback to execute.
     * @return The result of the transaction code.
     */
    public <T> T execute(TransactionCallback<T> transactionCallback) {
        boolean oldAutocommit = true;
        try {
            oldAutocommit = connection.getAutoCommit();
            connection.setAutoCommit(false);
            T result = transactionCallback.doInTransaction();
            connection.commit();
            return result;
        } catch (SQLException e) {
            throw new FlywayException("Unable to commit transaction", e);
        } catch (RuntimeException e) {
            if (rollbackOnException) {
                try {
                    LOG.debug("Rolling back transaction...");
                    connection.rollback();
                    LOG.debug("Transaction rolled back");
                } catch (SQLException se) {
                    LOG.error("Unable to rollback transaction", se);
                }
            } else {
                try {
                    connection.commit();
                } catch (SQLException se) {
                    LOG.error("Unable to commit transaction", se);
                }
            }
            throw e;
        } finally {
            try {
                connection.setAutoCommit(oldAutocommit);
            } catch (SQLException e) {
                LOG.error("Unable to restore autocommit to original value for connection", e);
            }
        }
    }
}


text:
// Generated by CoffeeScript 1.6.3
var app_json, dirs, error, fs, get_plugin_manifest, info, path, plugins, registered, scan, util, _, _ref;

_ = require('lodash');

fs = require('fs');

path = require('path');

util = require('util');

dirs = require('../utils/dirs');

_ref = require('../utils/logger')('utils/plugins'), error = _ref.error, info = _ref.info;

plugins = [];

registered = {};

get_plugin_manifest = function(folder, plugin) {
  var manifest;
  manifest = path.join(folder, 'node_modules', plugin, 'package.json');
  if (fs.existsSync(manifest)) {
    return manifest;
  }
  if (folder === path.join(folder, '..')) {
    return null;
  }
  return get_plugin_manifest(path.join(folder, '..'), plugin);
};

scan = function(folder) {
  var manifest, manifest_path, plugin, pmanifest, pmanifest_path, _results;
  manifest_path = path.join(folder, 'package.json');
  manifest = require(manifest_path);
  _results = [];
  for (plugin in manifest.dependencies) {
    pmanifest_path = get_plugin_manifest(folder, plugin);
    if (pmanifest_path === null) {
      info("dependency '" + plugin + "' not installed, can\'t check if its a plugin");
      continue;
    }
    pmanifest = require(pmanifest_path);
    if (pmanifest.polvo && !registered[pmanifest.name]) {
      registered[pmanifest.name] = true;
      _results.push(plugins.push(require(plugin)));
    } else {
      _results.push(void 0);
    }
  }
  return _results;
};

scan(path.join(dirs.root));

app_json = path.join(dirs.pwd, 'package.json');

if (fs.existsSync(app_json)) {
  scan(dirs.pwd);
} else {
  info('app doesn\'t have a `package.json` file, loading built-in plugins only');
}

module.exports = plugins;

/*
//@ sourceMappingURL=plugins.map
*/

redpajama_set_name: RedPajamaGithub


text:
package com.oldsneerjaw.sleeptimer;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 *

 *     Manages scheduling and cancelling the sleep timer.
 *

 *

 *     Do not instantiate directly. Instead, call {@link #get(Context)} to retrieve an instance.
 *

 *
 * @author Joel Andrews
 */
public class TimerManager {

    private static final String SCHEDULED_TIME_KEY = TimerManager.class.getName() + ".scheduledTime";

    private static ConcurrentMap<String, TimerManager> allInstances = new ConcurrentHashMap<String, TimerManager>();

    private final Context context;
    private final SharedPreferences sharedPreferences;
    private final AlarmManager alarmManager;

    /**
     * Constructs an instance of {@link TimerManager}.
     *
     * @param context The context
     */
    private TimerManager(Context context) {
        this(
                context,
                PreferenceManager.getDefaultSharedPreferences(context),
                (AlarmManager) context.getSystemService(Context.ALARM_SERVICE)
        );
    }

    /**
     * Constructs an instance of {@link TimerManager}. Should not be instantiated directly; call
     * {@link TimerManager#get(Context)} instead.
     *
     * @param context The context
     * @param sharedPreferences The shared preferences to use
     * @param alarmManager The alarm manager to use
     */
    TimerManager(Context context, SharedPreferences sharedPreferences, AlarmManager alarmManager) {
        this.context = context.getApplicationContext();
        this.sharedPreferences = sharedPreferences;
        this.alarmManager = alarmManager;
    }

    /**
     * Gets an instance of this class for the specified context.
     *
     * @param context The context. Must not be null.
     *
     * @return A {@link TimerManager}
     */
    public static TimerManager get(Context context) {
        if (context == null) {
            throw new NullPointerException("Argument context cannot be null");
        }

        String instanceKey = context.getPackageName();

        // A thread safe way of retrieving the TimerManager for the given context if it already exists, or creating
        // a new instance if not
        TimerManager existingInstance = allInstances.putIfAbsent(instanceKey, new TimerManager(context));
        if (existingInstance != null) {
            return existingInstance;
        } else {
            // A TimerManager didn't yet exist for the given context; return the newly created instance
            return allInstances.get(instanceKey);
        }
    }

    /**
     * Sets a timer to pause music playback the given number of hours and minutes in the future.
     * If a timer is already set for the current context, this will replace it.
     *
     * @param hours The number of hours. Must be non-negative.
     * @param minutes The number of minutes. Must be non-negative.
     */
    public void setTimer(int hours, int minutes) {
        if (hours < 0) {
            throw new IllegalArgumentException("Argument hours cannot be negative");
        } else if (minutes < 0) {
            throw new IllegalArgumentException("Argument minutes cannot be negative");
        }

        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.HOUR, hours);
        calendar.add(Calendar.MINUTE, minutes);

        // NOTE: If an alarm has already been set in this context, this intent will automatically replace it
        PendingIntent intent = getAlarmIntent();

        // Using the RTC alarm type means the alarm manager will not wake the device if it is asleep when the time is
        // reached. This is intentional; if the device is asleep, then it means there is no music currently playing
        // and there's no point in waking it up.
        alarmManager.set(AlarmManager.RTC, calendar.getTimeInMillis(), intent);

        // Save the currently scheduled time
        sharedPreferences.edit()
                .putLong(SCHEDULED_TIME_KEY, calendar.getTimeInMillis())
                .commit();
    }

    /**
     * Cancels the timer for the current context. If no timer is currently set, this will do nothing.
     */
    public void cancelTimer() {
        PendingIntent intent = getAlarmIntent();

        alarmManager.cancel(intent);

        sharedPreferences.edit()
                .remove(SCHEDULED_TIME_KEY)
                .commit();
    }

    /**
     * Returns a {@link android.app.PendingIntent} that can be used to create or cancel a pending pause music alarm.
     *
     * @return A {@link android.app.PendingIntent}
     */
    private PendingIntent getAlarmIntent() {
        return PendingIntent.getBroadcast(context, 0, new Intent(context, PauseMusicReceiver.class), 0);
    }

    /**
     * Returns the date and time that the timer is set to expire.
     *
     * @return A {@link Date}, or null if no timer is currently set
     */
    public Date getScheduledTime() {
        if (!sharedPreferences.contains(SCHEDULED_TIME_KEY)) {
            return null;
        }

        long millis = sharedPreferences.getLong(SCHEDULED_TIME_KEY, Long.MIN_VALUE);

        return new Date(millis);
    }
}


text:
package models

import (
	"encoding/json"
	"time"

	"github.com/Unknwon/com"
	"github.com/go-xorm/core"
	"github.com/go-xorm/xorm"
)

// RepoUnit describes all units of a repository
type RepoUnit struct {
	ID          int64
	RepoID      int64    `xorm:"INDEX(s)"`
	Type        UnitType `xorm:"INDEX(s)"`
	Index       int
	Config      core.Conversion `xorm:"TEXT"`
	CreatedUnix int64           `xorm:"INDEX CREATED"`
	Created     time.Time       `xorm:"-"`
}

// UnitConfig describes common unit config
type UnitConfig struct {
}

// FromDB fills up a UnitConfig from serialized format.
func (cfg *UnitConfig) FromDB(bs []byte) error {
	return json.Unmarshal(bs, &cfg)
}

// ToDB exports a UnitConfig to a serialized format.
func (cfg *UnitConfig) ToDB() ([]byte, error) {
	return json.Marshal(cfg)
}

// ExternalWikiConfig describes external wiki config
type ExternalWikiConfig struct {
	ExternalWikiURL string
}

// FromDB fills up a ExternalWikiConfig from serialized format.
func (cfg *ExternalWikiConfig) FromDB(bs []byte) error {
	return json.Unmarshal(bs, &cfg)
}

// ToDB exports a ExternalWikiConfig to a serialized format.
func (cfg *ExternalWikiConfig) ToDB() ([]byte, error) {
	return json.Marshal(cfg)
}

// ExternalTrackerConfig describes external tracker config
type ExternalTrackerConfig struct {
	ExternalTrackerURL    string
	ExternalTrackerFormat string
	ExternalTrackerStyle  string
}

// FromDB fills up a ExternalTrackerConfig from serialized format.
func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error {
	return json.Unmarshal(bs, &cfg)
}

// ToDB exports a ExternalTrackerConfig to a serialized format.
func (cfg *ExternalTrackerConfig) ToDB() ([]byte, error) {
	return json.Marshal(cfg)
}

// IssuesConfig describes issues config
type IssuesConfig struct {
	EnableTimetracker                bool
	AllowOnlyContributorsToTrackTime bool
}

// FromDB fills up a IssuesConfig from serialized format.
func (cfg *IssuesConfig) FromDB(bs []byte) error {
	return json.Unmarshal(bs, &cfg)
}

// ToDB exports a IssuesConfig to a serialized format.
func (cfg *IssuesConfig) ToDB() ([]byte, error) {
	return json.Marshal(cfg)
}

// BeforeSet is invoked from XORM before setting the value of a field of this object.
func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
	switch colName {
	case "type":
		switch UnitType(Cell2Int64(val)) {
		case UnitTypeCode, UnitTypePullRequests, UnitTypeReleases,
			UnitTypeWiki:
			r.Config = new(UnitConfig)
		case UnitTypeExternalWiki:
			r.Config = new(ExternalWikiConfig)
		case UnitTypeExternalTracker:
			r.Config = new(ExternalTrackerConfig)
		case UnitTypeIssues:
			r.Config = new(IssuesConfig)
		default:
			panic("unrecognized repo unit type: " + com.ToStr(*val))
		}
	}
}

// AfterSet is invoked from XORM after setting the value of a field of this object.
func (r *RepoUnit) AfterSet(colName string, _ xorm.Cell) {
	switch colName {
	case "created_unix":
		r.Created = time.Unix(r.CreatedUnix, 0).Local()
	}
}

// Unit returns Unit
func (r *RepoUnit) Unit() Unit {
	return Units[r.Type]
}

// CodeConfig returns config for UnitTypeCode
func (r *RepoUnit) CodeConfig() *UnitConfig {
	return r.Config.(*UnitConfig)
}

// PullRequestsConfig returns config for UnitTypePullRequests
func (r *RepoUnit) PullRequestsConfig() *UnitConfig {
	return r.Config.(*UnitConfig)
}

// ReleasesConfig returns config for UnitTypeReleases
func (r *RepoUnit) ReleasesConfig() *UnitConfig {
	return r.Config.(*UnitConfig)
}

// ExternalWikiConfig returns config for UnitTypeExternalWiki
func (r *RepoUnit) ExternalWikiConfig() *ExternalWikiConfig {
	return r.Config.(*ExternalWikiConfig)
}

// IssuesConfig returns config for UnitTypeIssues
func (r *RepoUnit) IssuesConfig() *IssuesConfig {
	return r.Config.(*IssuesConfig)
}

// ExternalTrackerConfig returns config for UnitTypeExternalTracker
func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig {
	return r.Config.(*ExternalTrackerConfig)
}

func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) {
	return units, e.Where("repo_id = ?", repoID).Find(&units)
}

func getUnitsByRepoIDAndIDs(e Engine, repoID int64, types []UnitType) (units []*RepoUnit, err error) {
	return units, e.Where("repo_id = ?", repoID).In("`type`", types).Find(&units)
}


text:
<?php
namespace backend\modules\userManagement\components;

use backend\modules\userManagement\UserManagementModule;
use common\models\User;
use Yii;

/**
 * Class GhostNav
 *
 * Show only those items in navigation menu which user can see
 * If item has no "visible" key, than "visible"=>User::canRoute($item['url') will be added
 *
 * @package webvimark\modules\UserManagement\components
 */
class GhostMenu extends \webvimark\modules\UserManagement\components\GhostMenu
{

    public static function getAdminMenu(){

        return [
//            [
//                'label' => ' Dashboard',
//                'url'=>['/'],
//            ],
            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Booking Management',
                'items'=>self::bookingManagementMenuItems(),
            ],
            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' User Management',
                'items'=>self::userManagementMenuItems(),
            ],

            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Site Page Management',
                'items'=>self::sitePageManagementMenuItems(),
            ],

            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' City Management',
                'items'=>self::cityManagementMenuItems(),
            ],
            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Vendor Management',
                'items'=>self::vendorManagementMenuItems(),
            ],

            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Vehicle Management',
                'items'=>self::vehicleManagementMenuItems(),
            ],
            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Document Management',
                'items'=>self::documentManagementMenuItems(),
            ],

            [
                'url'=>'#',
                'submenuTemplate'=> "\n
\n{items}\n
\n",
                'label' => ' Profile Management',
                'items'=>self::profileManagementMenuItems(),
            ],
            [
                'label' => ' ' . UserManagementModule::t('back', 'Logout ('.Yii::$app->user->identity->username.')'),
                'url' => ['/user-management/auth/logout']
            ],
        ];
    }

    /**
     * For User Management Menu Items
     *
     * @return array
     */
    public static function userManagementMenuItems()
    {
        $menu=[
            //User Management
            ['label' => ' ' . UserManagementModule::t('back', 'Users'), 'url' => ['/user-management/user/index']],
            ['label' => ' ' . UserManagementModule::t('back', 'Roles'), 'url' => ['/user-management/role/index']],
            ['label' => ' ' . UserManagementModule::t('back', 'Permissions'), 'url' => ['/user-management/permission/index']],
            ['label' => ' ' . UserManagementModule::t('back', 'Permission groups'), 'url' => ['/user-management/auth-item-group/index']],
            ['label' => ' ' . UserManagementModule::t('back', 'Visit log'), 'url' => ['/user-management/user-visit-log/index']],
        ];

        return $menu;
    }

    /**
     * For User Management Menu Items
     *
     * @return array
     */
    public static function cityManagementMenuItems()
    {
        $menu=[
            //City Management
            ['label' => ' ' . UserManagementModule::t('back', 'States'), 'url' => ['/city-management/state']],
            ['label' => ' ' . UserManagementModule::t('back', 'Cities'), 'url' => ['/city-management/city']],
            ['label' => ' ' . UserManagementModule::t('back', 'Routes'), 'url' => ['/city-management/route']],
            ['label' => ' ' . UserManagementModule::t('back', 'Region'), 'url' => ['/city-management/region']],
        ];

        return $menu;
    }

    /**
     * For Booing Management Menu Items
     *
     * @return array
     */
    public static function bookingManagementMenuItems()
    {
        $menu=[
            //Booking Management
            ['label' => ' ' . UserManagementModule::t('back', 'Bookings'), 'url' => ['/booking-management/booking/index']],
            ['label' => ' ' . UserManagementModule::t('back', 'Booking Type'), 'url' => ['/booking-management/booking-type']],
            ['label' => ' ' . UserManagementModule::t('back', 'Booking Alert'), 'url' => ['/booking-management/booking-alert']],
            ['label' => ' ' . UserManagementModule::t('back', 'Booking Route Rate'), 'url' => ['/booking-management/booking-route-rate']],
        ];
        return $menu;
    }

    /**
     * For Vendor Management Menu Items
     *
     * @return array
     */
    public static function vendorManagementMenuItems()
    {
        $menu=[
            //Vendor Management
            ['label' => ' ' . UserManagementModule::t('back', 'Vendors'), 'url' => ['/vendor-management']],
            ['label' => ' ' . UserManagementModule::t('back', 'Drivers'), 'url' => ['/vendor-management/driver']],
            ['label' => ' ' . UserManagementModule::t('back', 'Vendor Vehicles'), 'url' => ['/vendor-management/vendor-vehicle']],
            ['label' => ' ' . UserManagementModule::t('back', 'Vendor One Way Rates'), 'url' => ['/vendor-management/vendor-one-way-rate']],
            ['label' => ' ' . UserManagementModule::t('back', 'Vendor Round Trip Rates'), 'url' => ['/vendor-management/vendor-round-trip-rate']],

        ];
        return $menu;
    }

    /**
     * For Vehicle Management Menu Items
     *
     * @return array
     */
    public static function vehicleManagementMenuItems()
    {
        $menu=[
            //Vehicle Management
            ['label' => ' ' . UserManagementModule::t('back', 'Vehicle Categories'), 'url' => ['/vehicle-management/vehicle-category']],
            ['label' => ' ' . UserManagementModule::t('back', 'Vehicle Models'), 'url' => ['/vehicle-management/vehicle-model']],
            ['label' => ' ' . UserManagementModule::t('back', 'Vehicles'), 'url' => ['/vehicle-management/vehicle']],
        ];
        return $menu;
    }

    /**
     * For Document Management Menu Items
     *
     * @return array
     */
    public static function documentManagementMenuItems()
    {
        $menu=[
            //Document Management
            ['label' => ' ' . UserManagementModule::t('back', 'Document Types'), 'url' => ['/document-management/document-type']],
            //['label' => ' ' . UserManagementModule::t('back', 'Vehicle Documents'), 'url' => ['/document-management/vehicle-document']],
            //['label' => ' ' . UserManagementModule::t('back', 'Driver Documents'), 'url' => ['/document-management/driver-document']],

        ];
        return $menu;
    }

    /**
     * For Profile Management Menu Items
     *
     * @return array
     */
    public static function profileManagementMenuItems()
    {
        $menu=[
            //Profile Management
            [
                'label' => ' ' . UserManagementModule::t('back', 'My Profile'),
                'url' =>self::getProfileUrl() ,
            ],
            [
                'label' => ' ' . UserManagementModule::t('back', 'My Vehicles'),
                'url' =>['/vendor-profile-management/vehicle/index'],
                'visible'=>User::hasRole('vendor',false)
            ],
            [
                'label' => ' ' . UserManagementModule::t('back', 'My Drivers'),
                'url' =>['/vendor-profile-management/driver/index'],
                'visible'=>User::hasRole('vendor',false)
            ],
            [
                'label' => ' ' . UserManagementModule::t('back', 'My Bookings'),
                'url' =>['/vendor-profile-management/vendor-profile/index'],
                'visible'=>User::hasRole('vendor',false)
            ],

            ['label' => ' ' . UserManagementModule::t('back', 'Change Password'), 'url' => ['/user-management/auth/change-own-password']],

        ];
        return $menu;
    }

    /**
     * For Site Page Management Menu Items
     *
     * @return array
     */
    public static function sitePageManagementMenuItems()
    {
        $menu=[
            ['label' => ' ' . UserManagementModule::t('back', 'Site Pages'), 'url' => ['/site-page-management/site-page']],
        ];
        return $menu;
    }

    /**
     * This function return the current user profile url
     *
     * @return array
     */
    public static function getProfileUrl(){
        if(User::hasRole('vendor',false)){
            return ['/vendor-profile-management/vendor/index'];
        }
        return ['/vendor-profile-management/vendor/index'];

    }

}


text:
namespace kdoc.Model
{
    public class DocParameter : DocNode
    {
        public string Type { get; private set; }

        public DocParameter(string docId, string name, string type) : base(docId, name)
        {
            Type = type;
        }
    }
}


text:
require 'spec_helper'
require 'active_record'

class PostValidator < ExtractedValidator::Base
  validate :title_for_blank

  def title_for_blank
    add_error('Title must be set!') if title.blank?
  end
end

describe 'Basic usage' do
  subject(:validator) { PostValidator.new(post) }

  let(:post) { Post.new }

  context 'provides validations' do
    it { is_expected.to respond_to :valid? }

    its(:valid?) { is_expected.to be_falsey }
  end
end


text:
export class Genre {
    id: number;
    name: String;
};


text:
RGPVREJ ;BIR/PTD-REMOTE PRIMARY VIEW REJECT (PATIENT) ;10/8/06
 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**44,47,53**;30 Apr 99;Build 2
 ;
 ;Reference to ^XWB2HL7 supported by IA #3144
 ;Reference to ^XWBDRPC supported by IA #3149
 ;
REJ ;Option only available for Primary View Reject exceptions
 ;From within the Exception Handler, for selection, DATA should be defined.
 N RGBDT,RGICN,RGSITE,PTEN,PELV
 I DATA="" W !,"No Exception Data available." Q
 S PTEN=$P(DATA,"^",10) ;IEN IN 991.1
 S PELV=$P(DATA,"^",11) ;IEN IN 991.12
 I $P($G(^RGHL7(991.1,PTEN,1,PELV,0)),"^",3)'=234 S VALMSG="Action is ONLY for PRIMARY VIEW REJECT exceptions!" Q
 I $P($G(^RGHL7(991.1,PTEN,1,PELV,0)),"^",5)=1 S VALMSG="Exception has been PROCESSED; no longer active." Q
 S RGSITE=$P($$SITE^VASITE(),"^",3) I RGSITE="" W !,"No Site Data defined." Q
 S RGICN=$P(DATA,"^",6) I RGICN="" W !,"No ICN defined." Q
 S RGBDT=$P(DATA,"^",3) I RGBDT="" W !,"No Exception Date defined." Q
 S X=RGBDT D ^%DT S RGBDT=Y ;convert Exception Date from external format to internal
 ;
 S VALMBCK="",QUIT=0
 D FULL^VALM1
SEND ;Send a remote query to the MPI for Primary View Reject report
 N RETURN,RESULT,RGEDT,SNTDT
 S RGEDT=$$DT^XLFDT ;End date for report internal format
NOQ ;No previous query exists for this ICN/exception date
 I '$D(^XTMP("RGPVREJ"_RGICN,RGBDT)) D RPC G DISP
 ;
OLDQ ;Query already sent for this ICN/ exception date
 I $D(^XTMP("RGPVREJ"_RGICN,RGBDT)) D
 .S SNTDT=$$FMTE^XLFDT($P(^XTMP("RGPVREJ"_RGICN,RGBDT),"^",2))
 .W !?3,"A query was last sent for this ICN/Exception Date on "_SNTDT
 .S X=$P(SNTDT,"@") D ^%DT S SNTDT=Y ;convert to internal, strip time
 .;Has data returned for existing query?
 .S RETURN(0)=$P(^XTMP("RGPVREJ"_RGICN,RGBDT),"^")
 .D RPCCHK^XWB2HL7(.RESULT,RETURN(0)) I +RESULT(0)=1 D  Q  ;Data has returned
 ..I RGEDT=SNTDT D  ;query was sent 'today', want to use that one?
 ...S DIR("A")="   Do you wish to review that existing query data now? ",DIR(0)="YA"
 ...S DIR("?")="     Enter YES to review the existing query; NO to send a new query"
 ...S DIR("B")="YES" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q  ;up-arrowed out
 ...I Y>0 K DIR Q  ;yes, use existing query
 ...I Y=0 D  Q  ;no, don't use existing, send new query
 ....K ^XTMP("RGPVREJ"_RGICN,RGBDT)
 ....D RPC
 ....K DIR
 ....;
 ..I RGEDT'=SNTDT D  ;query was NOT sent 'today', data may be old, send new query
 ...W !?3,"Previous Query data may be obsolete."
 ...K ^XTMP("RGPVREJ"_RGICN,RGBDT)
 ...D RPC
 .;Data for existing query has NOT returned  **47
 .I +RESULT(0)'=1 D FAIL  ;**53
 ;
DISP ;Display Primary View Reject Data
 I QUIT'=1 D EN^RGEX07(RGICN,RGBDT)
EXIT ;Kill variables and quit
 K CNT,DIR,DIRUT,QUIT,X,Y
 Q
 ;
RPC ;Send the Remote Query
 W !?3,"Sending a Remote Query to the Master Patient Index."
 W !?3,"This will take some time; please be patient."
 D EN1^XWB2HL7(.RETURN,"200M","RG PRIMARY VIEW REJECT",1,RGSITE,RGICN,RGBDT,RGEDT) I RETURN(0)'="" D  Q
 .S ^XTMP("RGPVREJ"_RGICN,0)=$$FMADD^XLFDT(DT,2)_"^"_DT_"^"_"PRIMARY VIEW REJECT"
 .S ^XTMP("RGPVREJ"_RGICN,RGBDT)=RETURN(0)_"^"_$$NOW^XLFDT
 .;Has data returned for this query?
 .S CNT=0 F  S CNT=CNT+1 D RPCCHK^XWB2HL7(.RESULT,RETURN(0)) Q:RESULT(0)  H 2 I CNT>15 Q  ;result(0)=status of handle
 .I +RESULT(0)=1 W !?3,"Query data has returned from the MPI and is available for review."
 .I +RESULT(0)'=1 D FAIL  ;**53
 W !!?3,"Problem with Query: ",RETURN(0)_"^"_$G(RETURN(1))
 S QUIT=1
 D PAUSE^VALM1
 Q
 ;
FAIL ;Status of RPC call - unsuccessful after 30 seconds ;**53
 W !?3,"Your query request has NOT returned data from the MPI after trying for"
 W !?3,"30 seconds. This could be due to network issues. Please try again later."
 K ^XTMP("RGPVREJ"_RGICN,RGBDT)
 S QUIT=1
 D PAUSE^VALM1
 Q
 ;


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=shift_jis">
	<TITLE>Typodermic Fonts Freeware Font End User License Agreement</TITLE>
	<META NAME="GENERATOR" CONTENT="StarOffice 8  (Win32)">
	<META NAME="AUTHOR" CONTENT="Rina Larabie">
	<META NAME="CREATED" CONTENT="20061130;12010000">
	<META NAME="CHANGEDBY" CONTENT="Rina Larabie">
	<META NAME="CHANGED" CONTENT="20061207;15120000">

TYPODERMIC
FONTS FREEWARE FONTS EULA (End User License Agreement) and SOFTWARE
INCLUSION AGREEMENT

TYPODERMIC
FONTS FREEWARE FONTS EULA

The
Typodermic Freeware Fonts in TrueType and PostScript format contained
in this file are free for personal and commercial purposes. No
payment is necessary to use Typodermic Freeware Fonts for personal or
commercial use. If you wish to include Typodermic Freeware Fonts in
software see the SOFTWARE INCLUSION AGREEMENT below.

USAGE

You
can use Typodermic Freeware Fonts on a website but do not combine
fonts into a single archive or alter them in any way. We appreciate
inclusion of the font name and trademark or site URL in credits or
documentation but it is not mandatory.

Some
Typodermic Freeware Fonts may have enhanced and/or expanded families
available for sale at www.typodermic.com.

PAYMENT

Payment
is not required for the use of Typodermic Freeware Fonts unless they
are intended to be included with software. More details
follow.

SUPPORT

Font
installation help is available at http://www.myfonts.com/support.
If you experience problems with any Typodermic font, please visit
www.myfonts.com
to verify you have the latest version. If you download Typodermic
Freeware Fonts from other websites you may get older versions that
have spacing issues, incomplete character sets or technical problems.

SOFTWARE
INCLUSION AGREEMENT

The
SOFTWARE PRODUCT is protected by copyright laws and International
copyright treaties, as well as other intellectual property laws and
treaties. The SOFTWARE PRODUCT is licensed, not sold.

1.
GRANT OF LICENSE. This document grants you the following rights:

-
Installation and Use. You may install and use an unlimited number of
copies of the SOFTWARE PRODUCT. You may copy and distribute unlimited
copies of the SOFTWARE PRODUCT as you receive them, in any medium,
provided that you publish on each copy an appropriate copyright
notice. Keep intact all the notices that refer to this License and
give any other recipients of the fonts a copy of this License along
with the fonts.

2.
LIMITED WARRANTY NO WARRANTIES. Typodermic Fonts expressly disclaims
any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any
related documentation is provided "as is" without warranty
of any kind, either express or implied, including, without
limitation, the implied warranties or merchantability, fitness for a
particular purpose, or non-infringement. The entire risk arising out
of use or performance of the SOFTWARE PRODUCT remains with you.

NO
LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Ray Larabie or
Typodermic Fonts be liable for any damages whatsoever (including,
without limitation, damages for loss of business profits, business
interruption, loss of business information, or any other pecuniary
loss) arising out of the use of or inability to use this product,
even if Typodermic Fonts has been advised of the possibility of such
damages.

3.
MISCELLANEOUS

Should
you have any questions concerning this document or you desire to
contact Typodermic Fonts for any reason, please email
http://www.typodermic.com/about.html.

4.
GOVERNING LAW

This
agreement is governed by the laws of Canada and the province of
British Columbia.


text:
"use strict";

exports.Builder = class Builder {

    constructor() {
        this.jasmineCallback = null;
    }

    forBrowser(callback) {
        this.jasmineCallback = callback;
        this.jasmineCallback('forBrowser');
        return this;
    }

    build() {
        return this;
    }

    quit() {
        this.jasmineCallback('quit');
        return this;
    }
};

exports.By = '';


text:
require File.expand_path('../../../spec_helper', __FILE__)

describe "ARGF.file" do
  before :each do
    @file1 = fixture __FILE__, "file1.txt"
    @file2 = fixture __FILE__, "file2.txt"
  end

  # NOTE: this test assumes that fixtures files have two lines each
  it "returns the current file object on each file" do
    argf [@file1, @file2] do
      result = []
      # returns first current file even when not yet open
      result << @argf.file.path
      result << @argf.file.path while @argf.gets
      # returns last current file even when closed
      result << @argf.file.path
      result.should == [@file1, @file1, @file1, @file2, @file2, @file2]
    end
  end
end


text:
<?php

/**
 * Provides command-line access to the Conduit API.
 *
 * @group workflow
 */
final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {

  public function getWorkflowName() {
    return 'call-conduit';
  }

  public function getCommandSynopses() {
    return phutil_console_format(<<<EOTEXT
      **call-conduit** __method__
EOTEXT
      );
  }

  public function getCommandHelp() {
    return phutil_console_format(<<<EOTEXT
          Supports: http, https
          Allows you to make a raw Conduit method call:

            - Run this command from a working directory.
            - Call parameters are REQUIRED and read as a JSON blob from stdin.
            - Results are written to stdout as a JSON blob.

          This workflow is primarily useful for writing scripts which integrate
          with Phabricator. Examples:

            $ echo '{}' | arc call-conduit conduit.ping
            $ echo '{"phid":"PHID-FILE-xxxx"}' | arc call-conduit file.download
EOTEXT
      );
  }

  public function getArguments() {
    return array(
      '*' => 'method',
    );
  }

  public function shouldShellComplete() {
    return false;
  }

  public function requiresConduit() {
    return true;
  }

  public function requiresAuthentication() {
    return true;
  }

  public function run() {
    $method = $this->getArgument('method', array());
    if (count($method) !== 1) {
      throw new ArcanistUsageException(
        "Provide exactly one Conduit method name.");
    }
    $method = reset($method);

    $params = @file_get_contents('php://stdin');
    $params = json_decode($params, true);
    if (!is_array($params)) {
      throw new ArcanistUsageException(
        "Provide method parameters on stdin as a JSON blob.");
    }

    $error = null;
    $error_message = null;
    try {
      $result = $this->getConduit()->callMethodSynchronous(
        $method,
        $params);
    } catch (ConduitClientException $ex) {
      $error = $ex->getErrorCode();
      $error_message = $ex->getMessage();
      $result = null;
    }

    echo json_encode(array(
      'error'         => $error,
      'errorMessage'  => $error_message,
      'response'      => $result,
    ))."\n";

    return 0;
  }
}


text:
class FeedbackFormResponsesController < ApplicationController
  def new
    set_subjects
    @is_training_module = true if %r{/training/}.match?(@subject)
    @feedback_form_response = FeedbackFormResponse.new
  end

  RESULTS_PER_PAGE = 100
  def index
    check_user_auth { return }
    @page = params['page'].to_i
    @responses = FeedbackFormResponse.order(id: :desc).where.not(body: '')
                                     .limit(RESULTS_PER_PAGE).offset(@page * RESULTS_PER_PAGE)
    render layout: 'admin'
  end

  def show
    check_user_auth { return }
    @response = FeedbackFormResponse.find(params[:id])
    @user = User.find(@response.user_id) if @response.user_id
  end

  def create
    f_response = FeedbackFormResponse.new(form_params)
    f_response.user_id = current_user&.id
    f_response.save
    redirect_to feedback_confirmation_path
  end

  def confirmation; end

  private

  def set_subjects
    @subject = params['subject']
    @main_subject = params['main_subject']

    @has_explicit_subject = true if @subject
    @subject ||= request.referer || params['referer'] || ''
    @main_subject ||= @subject[/(.*) —/, 1] || @subject
  end

  def form_params
    params.require(:feedback_form_response).permit(:body, :subject)
  end

  def check_user_auth
    return if current_user&.admin?
    flash[:notice] = "You don't have access to that page."
    redirect_to root_path
    yield
  end
end


text:
This file is used to list changes made in each version of apple_quicktime_pro.

## 0.1.0:

* Initial release of apple_quicktime_pro
* Current app version: 7.6.6


text:
import {
  BootstrapFormInput,
  FormGroupWithLabel,
  usePropertySetters,
} from '@neinteractiveliterature/litform';
import { ProjectLink } from '../graphqlTypes.generated';
import IconSelect from '../IconSelect';

export type ProjectLinkFormProjectLink = Pick<ProjectLink, 'title' | 'url' | 'icon'>;

export type ProjectLinkFormProps = {
  projectLink: ProjectLinkFormProjectLink;
  onChange: React.Dispatch<React.SetStateAction<ProjectLinkFormProjectLink>>;
};

function ProjectLinkFormFields({ projectLink, onChange }: ProjectLinkFormProps): JSX.Element {
  const [setTitle, setUrl, setIcon] = usePropertySetters(onChange, 'title', 'url', 'icon');

  return (
    <>
      <BootstrapFormInput label="Title" value={projectLink.title} onTextChange={setTitle} />
      <BootstrapFormInput label="URL" value={projectLink.url} onTextChange={setUrl} />
      <FormGroupWithLabel
        label="Icon"
        helpText={
          <>
            Use{' '}
            <a
              href="https://icons.getbootstrap.com/#icons"
              target="_blank"
              rel="noreferrer noopener"
            >
              Bootstrap Icons icon names
            </a>
          </>
        }
      >
        {(id) => <IconSelect id={id} value={projectLink.icon ?? undefined} onChange={setIcon} />}
      </FormGroupWithLabel>
    </>
  );
}

export default ProjectLinkFormFields;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using StopGuessing.DataStructures;
using StopGuessing.EncryptionPrimitives;

namespace StopGuessing.Models
{

    public class ThresholdAndValue
    {
        public double Threshold { get; set; }
        public double Value { get; set; }

        public static double EvaluteAbove(IEnumerable<ThresholdAndValue> thresholdValuePairs, double point,  double defaultResult)
        {
            return thresholdValuePairs.Where(tvp => point >= tvp.Threshold).Select(thresholdValuePair => thresholdValuePair.Value).Concat(new[] {defaultResult}).Max();
        }

        public static double EvaluteBelow(IEnumerable<ThresholdAndValue> thresholdValuePairs, double point, double defaultResult)
        {
            return thresholdValuePairs.Where(tvp => point <= tvp.Threshold).Select(thresholdValuePair => thresholdValuePair.Value).Concat(new[] { defaultResult }).Max();
        }

    }

    public delegate double PasswordPopularityFunction(LoginAttempt attempt);

    public class BlockingAlgorithmOptions
    {
        public int NumberOfRedundantHostsToCacheIPs = 1;
        public int NumberOfRedundantHostsToCachePasswordPopularity = 1;
        public int HeightOfBinomialLadder_H = 48;
        public int BinomialLadderFrequencyThreshdold_T = 44;
        public int NumberOfBitsInBinomialLadderFilter_N = 1 << 29;
        public int NumberOfVirtualNodesForDistributedBinomialLadder = 1 << 10;

        public TimeSpan MinimumBinomialLadderFilterCacheFreshness = new TimeSpan(0,5,0); // Five minutes

        public string PrivateConfigurationKey = "ChangeThisToSomethingUniqueForYourEnvironment";

        public int NumberOfBitsPerShardInBinomialLadderFilter
            => NumberOfBitsInBinomialLadderFilter_N/NumberOfVirtualNodesForDistributedBinomialLadder;

        public int NumberOfFailuresToTrackForGoingBackInTimeToIdentifyTypos = 8;

        public float MaxEditDistanceConsideredATypo { get; set; } = 2f;
        public double PenaltyMulitiplierForTypo { get; set; } = .1d;
        public double PenaltyForInvalidPassword_Beta { get; set; } = 1d;
        public double PenaltyForInvalidAccount_Alpha { get; set; } = 2d; // 2 * PenaltyForInvalidPassword_Beta;

        public double RewardForCorrectPasswordPerAccount_Sigma { get; set; } = 30d;

        public double BlockThresholdPopularPassword_T_base { get; set; } = 50d;

        public double MultiplierIfClientCookieIndicatesPriorSuccessfulLogin_Kappa = 0d;

        public TimeSpan BlockScoreHalfLife = new TimeSpan(12,0,0); // 12 hours

        public uint AgingMembershipSketchTables = 16;
        public uint AgingMembershipSketchTableSize = 128*1024;

        // For tracking popular passwords with a set of frequency trackers
        public uint LengthOfShortestPopularityMeasurementPeriod = 10 * 1000;
        public  uint FactorOfGrowthBetweenPopularityMeasurementPeriods = 10;
        public  int NumberOfPopularityMeasurementPeriods = 4;

        public string DefaultExpensiveHashingFunction { get; set; } = ExpensiveHashFunctionFactory.DefaultFunctionName;
        public int ExpensiveHashingFunctionIterations { get; set; } = ExpensiveHashFunctionFactory.DefaultNumberOfIterations;

        public double AccountCreditLimit { get; set; } = 50d;
        public TimeSpan AccountCreditLimitHalfLife = new TimeSpan(12,0,0); // 12 hours

        /// <summary>
        /// Until we've observed enough failure attempts, we use the following denominator for popularity calculations.
        /// This ensures that a small burst of something rare doesn't look popular when we've only had a few observations.
        /// </summary>
        //public ulong MinDenominatorForPasswordPopularity { get; set; } = 100*1000; // 1 million

        public double PopularityConfidenceLevel { get; set; } = 0.001d; // 1 in 100,000

        public double PhiIfFrequent = 5;
        public double PopularityBasedPenaltyMultiplier_phi(LoginAttempt loginAttempt)
        {
            return loginAttempt.PasswordsHeightOnBinomialLadder >= BinomialLadderFrequencyThreshdold_T ? 5 : 1;
        }

        public double PopularityBasedThresholdMultiplier_T_multiplier(LoginAttempt loginAttempt)
        {
            return loginAttempt.PasswordsHeightOnBinomialLadder >= BinomialLadderFrequencyThreshdold_T ? 1 : 100;
        }

    }
}


text:
package leetcode;

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

/**
 * https://leetcode.com/problems/path-sum-ii/
 */
public class Problem113 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public List<List<Integer>> pathSum(TreeNode root, int sum) {
        List<List<Integer>> result = new ArrayList<>();
        if (root == null) {
            return result;
        }
        List<Path> paths = new ArrayList<>();
        pathSum(root, 0, new ArrayList<>(), paths);
        for (Path path : paths) {
            if (path.sum == sum) {
                result.add(path.path);
            }
        }
        return result;
    }

    private static class Path {
        int sum;
        List<Integer> path;

        public Path(int sum, List<Integer> path) {
            this.sum = sum;
            this.path = path;
        }
    }

    private void pathSum(TreeNode node, int sum, List<Integer> path, List<Path> paths) {
        if (node == null) {
            paths.add(new Path(sum, path));
            return;
        }
        List<Integer> newPath = new ArrayList<>(path);
        newPath.add(node.val);
        if (node.left == null && node.right == null) {
            pathSum(node.left, sum + node.val, newPath, paths);
            return;
        }
        if (node.left != null) {
            pathSum(node.left, sum + node.val, newPath, paths);
        }
        if (node.right != null) {
            pathSum(node.right, sum + node.val, newPath, paths);
        }
    }
}


text:
var sessionRestore = {
	save: function () {
		requestIdleCallback(function () {
			var data = {
				version: 2,
				state: JSON.parse(JSON.stringify(tabState)),
			}

			//save all tabs that aren't private

			for (var i = 0; i < data.state.tasks.length; i++) {
				data.state.tasks[i].tabs = data.state.tasks[i].tabs.filter(function (tab) {
					return !tab.private;
				});
			}

			localStorage.setItem("sessionrestoredata", JSON.stringify(data));
		}, {
			timeout: 2250
		});
	},
	restore: function () {
		var data = localStorage.getItem("sessionrestoredata");

		//first run, show the tour
		if (!data) {

			tasks.setSelected(tasks.add()); //create a new task

			var newTab = currentTask.tabs.add({
				url: "https://palmeral.github.io/min/tour"
			});
			addTab(newTab, {
				enterEditMode: false,
			});
			return;
		}

		console.log(data);

		data = JSON.parse(data);

		localStorage.setItem("sessionrestoredata", "");

		//the data isn't restorable
		if ((data.version && data.version != 2) || (data.state && data.state.tasks && data.state.tasks.length == 0)) {

			tasks.setSelected(tasks.add());

			addTab(currentTask.tabs.add(), {
				leaveEditMode: false //we know we aren't in edit mode yet, so we don't have to leave it
			});
			return;
		}

		//restore the tabs

		var selectedTask = data.state.tasks.filter(function (item) {
			return item.id == data.state.selectedTask;
		});

		data.state.tasks.forEach(function (task) {
			//restore the task item
			var taskItem = tasks.get(tasks.add(task.name, task.id));

			//restore the tabs within the task
			task.tabs.forEach(function (tab) {
				taskItem.tabs.add(tab);
			});
		});

		switchToTask(data.state.selectedTask);

		if (isEmpty(currentTask.tabs)) {
			enterEditMode(currentTask.tabs.getSelected());
		}
	}
}

//TODO make this a preference

sessionRestore.restore();

setInterval(sessionRestore.save, 12500);


text:
typedef enum  {NO_TYPE=0, INT_TYPE, FLOAT_TYPE, BOOL_TYPE, STRING_TYPE, VOID_TYPE, CLASS_TYPE, DOUBLE_TYPE, ARRAY_TYPE}
base_data_type_t;

typedef struct data_type{
	base_data_type_t base_type;
	char* class_name;
	int n_dimensions;
	int* dimensions;
	base_data_type_t array_type;
} data_type_t;

#define HASH_BUCKETS 8
typedef ght_hash_table_t hash_t;

typedef struct {
    int stack_offset, depth;
    char *label;
    data_type_t type;
} symbol_t;

typedef struct {
	char* label;
	data_type_t return_type;
	int nArguments;
	data_type_t* argument_types;
} function_symbol_t;

typedef struct {
	int size;
	hash_t* symbols;
	hash_t* functions;
} class_symbol_t;

char* symbol_to_string(symbol_t* symbol);
char* type_to_string(data_type_t type);
char* function_symbol_to_string(function_symbol_t* fun_symbol);
void function_add(char* key, function_symbol_t* value);
function_symbol_t* function_get(char* key);
void class_add(char *key, class_symbol_t* value);
class_symbol_t* class_get(char* key);
void class_insert_field(char* class_name, char* key, symbol_t* value);
void class_insert_method(char* class_name, char* key, function_symbol_t* value);
function_symbol_t* class_get_method(char* class_name, char* key);
symbol_t* class_get_symbol(char* class_name, char* key);
void symtab_init ( void );
void symtab_finalize ( void );

int strings_add ( char *str );
void strings_output ( FILE *stream );

void scope_add ( void );
void scope_remove ( void );

void symbol_insert ( char *key, symbol_t *value );
symbol_t *symbol_get ( char *key );

#endif


text:
<?php
	session_start();
?>

<!DOCTYPE html>

		<meta charset="UTF-8">
		<title>SocialMap</title>
		<link rel="stylesheet" type="text/css" href="style.css">
		<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />

SocialMap

				<?php
					if(isset($_SESSION['id'])){
						echo "

Home

Profile

							  <form action='includes/logout.inc.php' class='logoutForm'>
							  <button>Log Out</button></form>
";
					}
					else{
						$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
						if (strpos($url, 'error=empty') !== false){
							echo "
Fill out all fields!
";
						}
						else if (strpos($url, 'error=username') !== false){
							echo "
Username already exists!
";
						}
						echo "<form action='includes/login.inc.php' method='POST' class='loginForm'>
						<input type='text' name='username' placeholder='Username'>
						<input type='text' name='password' placeholder='Password'>
						<button type='submit'>Log In</button></form>";

						echo "
<form action='includes/signup.inc.php' method='POST' class='signupForm'>
								<input type='text' name='firstName' placeholder='First Name'>

								<input type='text' name='lastName' placeholder='Last Name'>

								<input type='text' name='username' placeholder='Username'>

								<input type='text' name='password' placeholder='Password'>

								<button type='submit'>SIGN UP</button></form>
";

						echo "

Welcome to SocialMap! Please Login or create an account.

";
					}
				?>


text:
package org.spongepowered.common.mixin.core.world.gen.populators;

import com.flowpowered.math.vector.Vector3i;
import com.google.common.base.Objects;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenSpikes;
import org.spongepowered.api.util.weighted.VariableAmount;
import org.spongepowered.api.world.Chunk;
import org.spongepowered.api.world.gen.PopulatorType;
import org.spongepowered.api.world.gen.PopulatorTypes;
import org.spongepowered.api.world.gen.populator.EnderCrystalPlatform;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Random;

@Mixin(WorldGenSpikes.class)
public class MixinWorldGenSpikes implements EnderCrystalPlatform {

    @Shadow private Block baseBlockRequired;

    private double probability;
    private VariableAmount height;
    private VariableAmount radius;

    @Inject(method = "<init>(Lnet/minecraft/block/Block;)V", at = @At("RETURN") )
    public void onConstructed(Block block, CallbackInfo ci) {
        this.probability = 0.2;
        this.radius = VariableAmount.baseWithRandomAddition(1, 4);
        this.height = VariableAmount.baseWithRandomAddition(6, 32);
    }

    @Override
    public PopulatorType getType() {
        return PopulatorTypes.ENDER_CRYSTAL_PLATFORM;
    }

    @Override
    public void populate(Chunk chunk, Random random) {
        World world = (World) chunk.getWorld();
        Vector3i min = chunk.getBlockMin();
        BlockPos chunkPos = new BlockPos(min.getX(), min.getY(), min.getZ());
        int x, z;
        if (random.nextDouble() < this.probability) {
            x = random.nextInt(16) + 8;
            z = random.nextInt(16) + 8;
            generate(world, random, world.getTopSolidOrLiquidBlock(chunkPos.add(x, 0, z)));
        }
    }

    /**
     * @author Deamon - December 12th, 2015 TODO I believe this can be done
     * @reason purely with injections as no code needs to be removed. Or possible
     * redirects
     */
    @Overwrite
    public boolean generate(World worldIn, Random rand, BlockPos position) {
        if (worldIn.isAirBlock(position) && worldIn.getBlockState(position.down()).getBlock() == this.baseBlockRequired) {
            // BEGIN sponge
//            int yHeight = rand.nextInt(32) + 6;
            int yHeight = this.height.getFlooredAmount(rand);
//            int rad = rand.nextInt(4) + 1;
            int rad = this.radius.getFlooredAmount(rand);
            // END sponge
            int k;
            int l;
            int i1;
            int j1;

            for (k = position.getX() - rad; k <= position.getX() + rad; ++k) {
                for (l = position.getZ() - rad; l <= position.getZ() + rad; ++l) {
                    i1 = k - position.getX();
                    j1 = l - position.getZ();

                    if (i1 * i1 + j1 * j1 <= rad * rad + 1
                            && worldIn.getBlockState(new BlockPos(k, position.getY() - 1, l)).getBlock() != this.baseBlockRequired) {
                        return false;
                    }
                }
            }

            for (k = position.getY(); k < position.getY() + yHeight && k < 256; ++k) {
                for (l = position.getX() - rad; l <= position.getX() + rad; ++l) {
                    for (i1 = position.getZ() - rad; i1 <= position.getZ() + rad; ++i1) {
                        j1 = l - position.getX();
                        int k1 = i1 - position.getZ();

                        if (j1 * j1 + k1 * k1 <= rad * rad + 1) {
                            worldIn.setBlockState(new BlockPos(l, k, i1), Blocks.obsidian.getDefaultState(), 2);
                        }
                    }
                }
            }

            EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(worldIn);
            // BEGIN sponge
            // add one to the height to fix MC bug if the EnderCrystal removing
            // the bedrock block
            entityendercrystal.setLocationAndAngles(position.getX() + 0.5F, position.getY() + yHeight + 1,
                    position.getZ() + 0.5F, rand.nextFloat() * 360.0F, 0.0F);
//            entityendercrystal.setLocationAndAngles((double) ((float) position.getX() + 0.5F), (double) (position.getY() + yHeight),
//                    (double) ((float) position.getZ() + 0.5F), rand.nextFloat() * 360.0F, 0.0F);
            // END sponge
            worldIn.spawnEntityInWorld(entityendercrystal);
            worldIn.setBlockState(position.up(yHeight), Blocks.bedrock.getDefaultState(), 2);
            return true;
        }
        return false;
    }

    @Override
    public double getSpawnProbability() {
        return this.probability;
    }

    @Override
    public void setSpawnProbability(double p) {
        this.probability = p;
    }

    @Override
    public VariableAmount getHeight() {
        return this.height;
    }

    @Override
    public void setHeight(VariableAmount height) {
        this.height = height;
    }

    @Override
    public VariableAmount getRadius() {
        return this.radius;
    }

    @Override
    public void setRadius(VariableAmount radius) {
        this.radius = radius;
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("Type", "EnderCrystalPlatform")
                .add("Chance", this.probability)
                .add("Height", this.height)
                .add("Radius", this.radius)
                .toString();
    }

}


text:
using System;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
using FlaUI.Core.Shapes;
using FlaUI.Core.WindowsAPI;

namespace FlaUI.Core.Overlay
{
    public class OverlayRectangleWindow : Window
    {
        public OverlayRectangleWindow(Rectangle rectangle, Color color, int durationInMs)
        {
            AutomationProperties.SetAutomationId(this, "FlaUIOverlayWindow");
            AutomationProperties.SetName(this, "FlaUIOverlayWindow");
            AllowsTransparency = true;
            WindowStyle = WindowStyle.None;
            Topmost = true;
            ShowActivated = false;
            ShowInTaskbar = false;
            Background = Brushes.Transparent;
            Top = rectangle.Top;
            Left = rectangle.Left;
            Width = rectangle.Width;
            Height = rectangle.Height;
            var borderBrush = new SolidColorBrush(color);
            borderBrush.Freeze();
            Content = new Border { BorderThickness = new Thickness(2), BorderBrush = borderBrush };
            StartCloseTimer(TimeSpan.FromMilliseconds(durationInMs));
        }

        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            // Make the window click-thru
            SetWindowTransparent();
        }

        private void SetWindowTransparent()
        {
            var hwnd = new WindowInteropHelper(this).Handle;
            var extendedStyle = User32.GetWindowLong(hwnd, WindowLongParam.GWL_EXSTYLE);
            User32.SetWindowLong(hwnd, WindowLongParam.GWL_EXSTYLE, extendedStyle | WindowStyles.WS_EX_TRANSPARENT);
        }

        private void StartCloseTimer(TimeSpan closeTimeout)
        {
            var timer = new DispatcherTimer {Interval = closeTimeout};
            timer.Tick += TimerTick;
            timer.Start();
        }

        private void TimerTick(object sender, EventArgs e)
        {
            var timer = (DispatcherTimer)sender;
            timer.Tick -= TimerTick;
            timer.Stop();
            Close();
        }
    }
}


text:
<?php

namespace PHPExiftool\Driver\Tag\XMPXmpDM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class CameraModel extends AbstractTag
{

    protected $Id = 'cameraModel';

    protected $Name = 'CameraModel';

    protected $FullName = 'XMP::xmpDM';

    protected $GroupName = 'XMP-xmpDM';

    protected $g0 = 'XMP';

    protected $g1 = 'XMP-xmpDM';

    protected $g2 = 'Image';

    protected $Type = 'string';

    protected $Writable = true;

    protected $Description = 'Camera Model';
}


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

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CodeGeneration;
using Microsoft.CodeAnalysis.Formatting;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.FxCopAnalyzers.Design
{
    /// <summary>
    /// CA1012: Abstract classes should not have public constructors
    /// </summary>
    [ExportCodeFixProvider(CA1012DiagnosticAnalyzer.RuleId, LanguageNames.CSharp, LanguageNames.VisualBasic), Shared]
    public sealed class CA1012CodeFixProvider : CodeFixProviderBase
    {
        public sealed override ImmutableArray<string> GetFixableDiagnosticIds()
        {
            return ImmutableArray.Create(CA1012DiagnosticAnalyzer.RuleId);
        }

        protected sealed override string GetCodeFixDescription(Diagnostic diagnostic)
        {
            return FxCopFixersResources.AbstractTypesShouldNotHavePublicConstructorsCodeFix;
        }

        private static SyntaxNode GetDeclaration(ISymbol symbol)
        {
            return (symbol.DeclaringSyntaxReferences.Length > 0) ? symbol.DeclaringSyntaxReferences[0].GetSyntax() : null;
        }

        internal override Task<Document> GetUpdatedDocumentAsync(Document document, SemanticModel model, SyntaxNode root, SyntaxNode nodeToFix, Diagnostic diagnostic, CancellationToken cancellationToken)
        {
            var classSymbol = (INamedTypeSymbol)model.GetDeclaredSymbol(nodeToFix);
            var instanceConstructors = classSymbol.InstanceConstructors.Where(t => t.DeclaredAccessibility == Accessibility.Public).Select(t => GetDeclaration(t)).Where(d => d != null).ToList();
            var generator = SyntaxGenerator.GetGenerator(document);
            var newRoot = root.ReplaceNodes(instanceConstructors, (original, rewritten) => generator.WithAccessibility(original, Accessibility.Protected));
            return Task.FromResult(document.WithSyntaxRoot(newRoot));
        }
    }
}


text:
namespace omaha {

// Class: CertInfo
//
// CertInfo holds all sensible details of a certificate. During verification of
// a signature, one CertInfo object is made for each certificate encountered in
// the signature.
class CertInfo {
 public:
  // certificate issuing company name e.g. "Google Inc".
  CString issuing_company_name_;

  // a company may own multiple certificates.
  // so this tells which dept owns this certificate.
  CString issuing_dept_name_;

  // trust-authority (or trust-provider) name. e.g. "Verisign, Inc.".
  CString trust_authority_name_;

  // SHA-1 hash of the certificate's raw bytes. This is the value that is
  // displayed by the operating system in the certificate's details.
  CString thumbprint_;

  // SHA-256 hash of the certificate subject's public key.
  CString public_key_hash_;

  // validity period start-date
  FILETIME not_valid_before_;

  // validity period end-date
  FILETIME not_valid_after_;

  // CERT_CONTEXT structure, defined by Crypto API, contains all the info about
  // the certificate.
  const CERT_CONTEXT *cert_context_;

  explicit CertInfo(const CERT_CONTEXT* given_cert_context);

  ~CertInfo();

  // IsValidNow() functions returns true if this certificate is valid at this
  // moment, based on the validity period specified in the certificate.
  bool IsValidNow() const;

  // AsString() is a utility function that's used for printing CertInfo details.
  CString AsString() const {
    CString cert_info_str =
        _T("Issuing Company: \"") + issuing_company_name_ +
        _T("\"  Dept: \"") + issuing_dept_name_ +
        _T("\"  Trust Provider: \"") + trust_authority_name_ +
        _T("\"  Valid From: \"") + this->FileTimeToString(&not_valid_before_) +
        _T("\"  Valid To: \"") + this->FileTimeToString(&not_valid_after_) +
        _T("\"");
    return cert_info_str;
  }

  // FileTimeToString() is just a convenience function to print FILETIME.
  static CString FileTimeToString(const FILETIME* ft);

  // Given a cerificate context, this function extracts the subject/signee
  // company name and its dept name(orgnanizational-unit-name, as they call it).
  // Optionally, you could also retrieve trust-authority name.
  static bool ExtractIssuerInfo(const CERT_CONTEXT* cert_context,
                                CString* orgn_name,
                                CString* orgn_dept_name,
                                CString* trust_authority = NULL);

  static bool ExtractThumbprint(const CERT_CONTEXT* cert_context,
                                CString* thumbprint);

  static bool ExtractPublicKeyHash(const CERT_CONTEXT* cert_context,
                                   CString* public_key_hash);

 private:
  // Extracts the specified field from the certificate. Only the first value for
  // the field is extracted if multiple values are present. Returns true if
  // the field is extracted successfully. Returns false if an error occurred
  // during the extraction or the field was not found.
  static bool ExtractField(const CERT_CONTEXT* cert_context,
                           const char* field_name,
                           CString* field_value);
};

// CertList is a container for a list of certificates. It is used to hold all
// the certificates found in the signature of a signed file. In addition, it
// also provides interface to fetch certificates matching to a particular
// criterion.
//
// Internally, CertList contains basically a vector of CertInfo* pointers.
// The only reason why CertList is created as opposed to simply putting all
// the certificates in a vector<CertInfo*> is to avoid memory-leaks. CertList
// contains a list of CertInfo pointers and users don't have to worry about
// freeing those pointers. On the other hand, if you use vector<CertInfo>
// instead, it results in unwanted copying of CertInfo objects around.
class CertList {
 public:
  // Constructor
  CertList() {}

  // Destructor
  ~CertList() {
    for (unsigned int inx = 0; inx < cert_list_.size(); ++inx)
      delete cert_list_[inx];
    cert_list_.clear();
  }

  // size() returns the number of certificates in this CertList
  size_t size() const {
    return cert_list_.size();
  }

  // AddCertificate() is used to add a certificate to CertList.
  // NOTE that once a certificate is added, CertList takes ownership of that
  // CertInfo object.
  void AddCertificate(CertInfo* cert) {
    cert_list_.push_back(cert);
  }

  // FindFirstCert() finds the first certificate that exactly matches the given
  // criteria. If allow_test_variant is true, the company name will also be
  // deemed valid if it equals company_name_to_match + " (TEST)".
  void FindFirstCert(const CertInfo** result_cert_info,
                     const CString &company_name_to_match,
                     const CString &orgn_unit_to_match,
                     const CString &trust_authority_to_match,
                     bool allow_test_variant,
                     bool check_cert_is_valid_now) const;

  typedef std::vector<CertInfo*> CertInfoList;

 private:
  CertInfoList cert_list_;
};

// ExtractAllCertificatesFromSignature() takes in a signed file, extracts all
// the certificates related to its signature and returns them in a CertList
// object.
void ExtractAllCertificatesFromSignature(const wchar_t* signed_file,
                                         CertList* cert_list);

// Returns true if the subject of the certificate exactly matches the first CN
// name. If the 'allow_test_variant' parameter is true, the function tries to
// match the "subject (TEST)" string.
//
// The function enforces an additional check against the public key of the
// certificate. Pinning to specific public keys mitigates the risk of accepting
// certificates issued by weak CAs. The list of expected hashes to pin the
// certificate to is provided by the optional 'expected_hashes' parameter.
//
// The function can verify that the certificate is valid at the time of the
// call.
HRESULT VerifyCertificate(const wchar_t* signed_file,
                          const wchar_t* subject,
                          bool allow_test_variant,
                          bool check_cert_is_valid_now,
                          const std::vector<CString>* expected_hashes);

// Returns S_OK if a given signed file contains a signature
// that could be successfully verified using one of the trust providers
// IE relies on. This means that, whoever signed the file, they should've signed
// using certificate issued by a well-known (to IE) trust provider like
// Verisign, Inc.
HRESULT VerifyAuthenticodeSignature(const wchar_t* signed_file,
                                    bool allow_network_check);

// Returns true if a given signed file contains a valid signature.
inline bool SignatureIsValid(const wchar_t* signed_file,
                             bool allow_network_check) {
  return VerifyAuthenticodeSignature(signed_file, allow_network_check) == S_OK;
}

// Gets the timestamp for the file's signature.
HRESULT GetSigningTime(const wchar_t* signed_file, SYSTEMTIME* signing_time);

// Verifies that the file was signed within the specified number of days.
HRESULT VerifyFileSignedWithinDays(const wchar_t* signed_file, int days);

}  // namespace omaha

#endif  // OMAHA_BASE_SIGNATUREVALIDATOR_H_


text:
<?php

/* Prevent direct access. */
if (!defined('IN_CMS')) { exit(); }

$sql = 'DROP TABLE IF EXISTS `' . TABLE_PREFIX . 'approved_users_temp`';
$pdo = Record::getConnection();
$pdo->exec($sql);

$sql = 'DROP TABLE IF EXISTS `' . TABLE_PREFIX . 'permission_page`';
$pdo = Record::getConnection();
$pdo->exec($sql);


text:
package com.cloud.legacymodel.communication.command;

import com.cloud.legacymodel.communication.LogLevel;
import com.cloud.legacymodel.communication.LogLevel.Level;

public class UpdateHostPasswordCommand extends Command {

    @LogLevel(Level.Off)
    protected String username;
    @LogLevel(Level.Off)
    protected String newPassword;
    @LogLevel(Level.Off)
    protected String hostIp;

    protected UpdateHostPasswordCommand() {
    }

    public UpdateHostPasswordCommand(final String username, final String newPassword) {
        this(username, newPassword, null);
    }

    public UpdateHostPasswordCommand(final String username, final String newPassword, final String hostIp) {
        this.username = username;
        this.newPassword = newPassword;
        this.hostIp = hostIp;
    }

    public String getNewPassword() {
        return newPassword;
    }

    public String getUsername() {
        return username;
    }

    public String getHostIp() {
        return hostIp;
    }

    @Override
    public boolean executeInSequence() {
        return false;
    }
}


text:
source "$(dirname "${BASH_SOURCE}")/../../hack/lib/init.sh"

os::cleanup::tmpdir
os::util::environment::setup_all_server_vars

function cleanup() {
	return_code=$?
	os::test::junit::generate_report
	os::cleanup::all
	os::util::describe_return_code "${return_code}"
	exit "${return_code}"
}
trap "cleanup" EXIT

os::log::info "Starting server as distinct processes"
os::log::info "`openshift version`"
os::log::info "Server logs will be at:    ${LOG_DIR}/openshift.log"
os::log::info "Test artifacts will be in: ${ARTIFACT_DIR}"
os::log::info "Config dir is:             ${SERVER_CONFIG_DIR}"

# Allow setting $JUNIT_REPORT to toggle output behavior
if [[ -n "${JUNIT_REPORT:-}" ]]; then
	export JUNIT_REPORT_OUTPUT="${LOG_DIR}/raw_test_output.log"
fi

mkdir -p ${LOG_DIR}

os::log::info "Scan of OpenShift related processes already up via ps -ef	| grep openshift : "
ps -ef | grep openshift

mkdir -p "${SERVER_CONFIG_DIR}"
pushd "${SERVER_CONFIG_DIR}"

os::test::junit::declare_suite_start "extended/alternate_certs"

# Make custom CA and server cert
os::cmd::expect_success 'oadm ca create-signer-cert --overwrite=true --cert=master/custom-ca.crt --key=master/custom-ca.key --serial=master/custom-ca.txt --name=my-custom-ca@`date +%s`'
os::cmd::expect_success 'oadm ca create-server-cert --cert=master/custom.crt --key=master/custom.key --hostnames=localhost,customhost.com --signer-cert=master/custom-ca.crt --signer-key=master/custom-ca.key --signer-serial=master/custom-ca.txt'

# Create master/node configs
os::cmd::expect_success "openshift start --master=https://localhost:${API_PORT} --write-config=. --hostname=mynode --etcd-dir=./etcd --certificate-authority=master/custom-ca.crt"

# Don't try this at home.  We don't have flags for setting etcd ports in the config, but we want deconflicted ones.  Use sed to replace defaults in a completely unsafe way
os::util::sed "s/:4001$/:${ETCD_PORT}/g" master/master-config.yaml
os::util::sed "s/:7001$/:${ETCD_PEER_PORT}/g" master/master-config.yaml
# replace top-level namedCertificates config
os::util::sed 's#^  namedCertificates: null#  namedCertificates: [{"certFile":"custom.crt","keyFile":"custom.key","names":["localhost"]}]#' master/master-config.yaml

# Start master
OPENSHIFT_PROFILE=web OPENSHIFT_ON_PANIC=crash openshift start master \
 --config=master/master-config.yaml \
 --loglevel=4 \
&>"${LOG_DIR}/openshift.log" &
OS_PID=$!

# Wait for the server to be up
os::cmd::try_until_success "oc whoami --config=master/admin.kubeconfig"

# Verify the server is serving with the custom and internal CAs, and that the generated ca-bundle.crt works for both
os::cmd::expect_success_and_text "curl -vvv https://localhost:${API_PORT} --cacert master/ca-bundle.crt -s 2>&1" 'my-custom-ca'
os::cmd::expect_success_and_text "curl -vvv https://127.0.0.1:${API_PORT} --cacert master/ca-bundle.crt -s 2>&1" 'openshift-signer'

# Verify kubeconfigs have connectivity to hosts serving with custom and generated certs
os::cmd::expect_success_and_text "oc whoami --config=master/admin.kubeconfig"                                        'system:admin'
os::cmd::expect_success_and_text "oc whoami --config=master/admin.kubeconfig --server=https://localhost:${API_PORT}" 'system:admin'
os::cmd::expect_success_and_text "oc whoami --config=master/admin.kubeconfig --server=https://127.0.0.1:${API_PORT}" 'system:admin'

os::cmd::expect_success_and_text "oc whoami --config=master/openshift-master.kubeconfig"                                        'system:openshift-master'
os::cmd::expect_success_and_text "oc whoami --config=master/openshift-master.kubeconfig --server=https://localhost:${API_PORT}" 'system:openshift-master'
os::cmd::expect_success_and_text "oc whoami --config=master/openshift-master.kubeconfig --server=https://127.0.0.1:${API_PORT}" 'system:openshift-master'

os::cmd::expect_success_and_text "oc whoami --config=node-mynode/node.kubeconfig"                                        'system:node:mynode'
os::cmd::expect_success_and_text "oc whoami --config=node-mynode/node.kubeconfig --server=https://localhost:${API_PORT}" 'system:node:mynode'
os::cmd::expect_success_and_text "oc whoami --config=node-mynode/node.kubeconfig --server=https://127.0.0.1:${API_PORT}" 'system:node:mynode'

os::test::junit::declare_suite_end

kill $OS_PID

popd


text:
namespace Cofoundry.Domain;

/// <summary>
/// Deletes a page and all associated versions permanently.
/// </summary>
public class DeletePageCommand : ICommand, ILoggableCommand
{
    /// <summary>
    /// Database id of the page to delete.
    /// </summary>
    [PositiveInteger]
    [Required]
    public int PageId { get; set; }
}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Password Reset</title>

<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">

<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">

<link rel="stylesheet"
	href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

<link rel="stylesheet"
	href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">

<link rel="stylesheet" href="{{ asset('css/AdminLTE.min.css') }}">

<link rel="stylesheet" href="{{ asset('js/iCheck/square/blue.css') }}">

			AdminLTE

	@if (Session::has('flash_notification.message'))

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

        {{ Session::get('flash_notification.message') }}

	@endif

Reset Password

			<form method="POST" action="{{ url('/password/email') }}">
				{!! csrf_field() !!}

has('email') ? ' has-error' : '' }}">
                	<input type="email" class="form-control" name="email" placeholder="E-Mail Address">

                        @if ($errors->has('email'))

                            {{ $errors->first('email') }}

                        @endif

                       <button type="submit" class="btn btn-primary btn-flat">
							Send Password Reset Link
					   </button>

               I already have a membership

               Register a new membership

			</form>


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Overview List (Jsign - Authenticode implementation in Java (Core) 4.2 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Packages

net.jsign

net.jsign.cat

net.jsign.jca

net.jsign.mscab

net.jsign.msi

net.jsign.pe

net.jsign.script

net.jsign.timestamp


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="Source to the Rust file `/home/carter/.cargo/registry/src/github.com-1ecc6299db9ec823/xml-rs-0.1.25/src/lib.rs`.">
    <meta name="keywords" content="rust, rustlang, rust-lang">

    <title>lib.rs.html -- source</title>

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

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options..."
                       type="search">

        </form>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21

//#![warn(missing_doc)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![forbid(non_camel_case_types)]

//! This crate currently provides almost XML 1.0/1.1-compliant pull parser.

#[macro_use]
extern crate bitflags;

pub use reader::EventReader;

pub mod macros;
pub mod name;
pub mod attribute;
pub mod common;
pub mod escape;
pub mod namespace;
pub mod reader;
pub mod writer;
pub mod util;

Keyboard shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

Search tricks

                Prefix searches with a type followed by a colon (e.g.
                fn:) to restrict the search to a given type.

                Accepted types are: fn, mod,
                struct, enum,
                trait, typedef (or
                tdef).

                Search functions by type signature (e.g.
                vec -> usize)


text:
<?php declare(strict_types=1);

namespace GraphQL\Validator\Rules;

use GraphQL\Error\Error;
use GraphQL\Language\AST\BooleanValueNode;
use GraphQL\Language\AST\EnumValueNode;
use GraphQL\Language\AST\FloatValueNode;
use GraphQL\Language\AST\IntValueNode;
use GraphQL\Language\AST\ListValueNode;
use GraphQL\Language\AST\NodeKind;
use GraphQL\Language\AST\NullValueNode;
use GraphQL\Language\AST\ObjectFieldNode;
use GraphQL\Language\AST\ObjectValueNode;
use GraphQL\Language\AST\StringValueNode;
use GraphQL\Language\AST\ValueNode;
use GraphQL\Language\AST\VariableNode;
use GraphQL\Language\Printer;
use GraphQL\Language\Visitor;
use GraphQL\Language\VisitorOperation;
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\LeafType;
use GraphQL\Type\Definition\ListOfType;
use GraphQL\Type\Definition\NonNull;
use GraphQL\Type\Definition\Type;
use GraphQL\Utils\Utils;
use GraphQL\Validator\QueryValidationContext;

/**
 * Value literals of correct type.
 *
 * A GraphQL document is only valid if all value literals are of the type
 * expected at their position.
 */
class ValuesOfCorrectType extends ValidationRule
{
    public function getVisitor(QueryValidationContext $context): array
    {
        return [
            NodeKind::NULL => static function (NullValueNode $node) use ($context): void {
                $type = $context->getInputType();
                if ($type instanceof NonNull) {
                    $typeStr = Utils::printSafe($type);
                    $nodeStr = Printer::doPrint($node);
                    $context->reportError(
                        new Error(
                            "Expected value of type \"{$typeStr}\", found {$nodeStr}.",
                            $node
                        )
                    );
                }
            },
            NodeKind::LST => function (ListValueNode $node) use ($context): ?VisitorOperation {
                // Note: TypeInfo will traverse into a list's item type, so look to the
                // parent input type to check if it is a list.
                $parentType = $context->getParentInputType();
                $type = $parentType === null
                    ? null
                    : Type::getNullableType($parentType);
                if (! $type instanceof ListOfType) {
                    $this->isValidValueNode($context, $node);

                    return Visitor::skipNode();
                }

                return null;
            },
            NodeKind::OBJECT => function (ObjectValueNode $node) use ($context): ?VisitorOperation {
                $type = Type::getNamedType($context->getInputType());
                if (! $type instanceof InputObjectType) {
                    $this->isValidValueNode($context, $node);

                    return Visitor::skipNode();
                }

                // Ensure every required field exists.
                $inputFields = $type->getFields();

                $fieldNodeMap = [];
                foreach ($node->fields as $field) {
                    $fieldNodeMap[$field->name->value] = $field;
                }

                foreach ($inputFields as $inputFieldName => $fieldDef) {
                    if (! isset($fieldNodeMap[$inputFieldName]) && $fieldDef->isRequired()) {
                        $fieldType = Utils::printSafe($fieldDef->getType());
                        $context->reportError(
                            new Error(
                                "Field {$type->name}.{$inputFieldName} of required type {$fieldType} was not provided.",
                                $node
                            )
                        );
                    }
                }

                return null;
            },
            NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) use ($context): void {
                $parentType = Type::getNamedType($context->getParentInputType());
                if (! $parentType instanceof InputObjectType) {
                    return;
                }

                if ($context->getInputType() !== null) {
                    return;
                }

                $suggestions = Utils::suggestionList(
                    $node->name->value,
                    \array_keys($parentType->getFields())
                );
                $didYouMean = \count($suggestions) > 0
                    ? ' Did you mean ' . Utils::quotedOrList($suggestions) . '?'
                    : null;

                $context->reportError(
                    new Error(
                        "Field \"{$node->name->value}\" is not defined by type \"{$parentType->name}\".{$didYouMean}",
                        $node
                    )
                );
            },
            NodeKind::ENUM => function (EnumValueNode $node) use ($context): void {
                $this->isValidValueNode($context, $node);
            },
            NodeKind::INT => function (IntValueNode $node) use ($context): void {
                $this->isValidValueNode($context, $node);
            },
            NodeKind::FLOAT => function (FloatValueNode $node) use ($context): void {
                $this->isValidValueNode($context, $node);
            },
            NodeKind::STRING => function (StringValueNode $node) use ($context): void {
                $this->isValidValueNode($context, $node);
            },
            NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context): void {
                $this->isValidValueNode($context, $node);
            },
        ];
    }

    /**
     * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $node
     */
    protected function isValidValueNode(QueryValidationContext $context, ValueNode $node): void
    {
        // Report any error at the full type expected by the location.
        $locationType = $context->getInputType();
        if ($locationType === null) {
            return;
        }

        $type = Type::getNamedType($locationType);

        if (! $type instanceof LeafType) {
            $typeStr = Utils::printSafe($type);
            $nodeStr = Printer::doPrint($node);
            $context->reportError(
                new Error(
                    "Expected value of type \"{$typeStr}\", found {$nodeStr}.",
                    $node
                )
            );

            return;
        }

        // Scalars determine if a literal value is valid via parseLiteral() which
        // may throw to indicate failure.
        try {
            $type->parseLiteral($node);
        } catch (\Throwable $error) {
            if ($error instanceof Error) {
                $context->reportError($error);
            } else {
                $typeStr = Utils::printSafe($type);
                $nodeStr = Printer::doPrint($node);
                $context->reportError(
                    new Error(
                        "Expected value of type \"{$typeStr}\", found {$nodeStr}; {$error->getMessage()}",
                        $node,
                        null,
                        [],
                        null,
                        $error // Ensure a reference to the original error is maintained.
                    )
                );
            }
        }
    }
}


text:
/*
 * Please see the included README.md file for license terms and conditions.
 */

/* This file is completely optional and not required. */
/* Note the reference that includes it in the index.html file. */

/* Disable certain interactions on touch devices */
/* SOURCE: https://github.com/ftlabs/fastclick/blob/master/examples/input.html */
/* LICENSE: https://github.com/ftlabs/fastclick/blob/master/LICENSE */
body {
    -webkit-touch-callout: none ;
    -webkit-text-size-adjust: none ; -ms-text-size-adjust: none ;
    -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ; user-select: none ;
    -webkit-highlight: none ;
    -webkit-tap-highlight-color: rgba(0,0,0,0) ;
    -webkit-tap-highlight-color: transparent ;      /* For some Androids */
}

/* Recommended for Windows 8 Phone */
/* SOURCE: http://www.excellentwebworld.com/common-problems-solution-for-windows-phone-8-phonegap */
html {
    -ms-touch-action: pan-x ;
}

/* Recommended for Windows 8 Phone */
/* SOURCE: http://www.excellentwebworld.com/common-problems-solution-for-windows-phone-8-phonegap */
body {
    -ms-touch-action: pan-y ;
    -ms-content-zooming: none ;
}

/* allow copy-paste */
input, textarea  {
    -webkit-user-select: text ; -moz-user-select: text ; -ms-user-select: text ; user-select: text ;
}

body {
    /* margin: 0.5rem ; */
    background: white ;
    color: black ;
}

#go{
    width: 100%;
    position: absolute;
    bottom: 0;
    padding: 10px;
    border: 0;
    color: #FFF;
    background: #2ecc71;
}

sup {
    vertical-align: super !important;
    font-size: smaller !important;
}

form[name=lat]{
    margin-top: 50px;
}

form[name=lat] input{
    width: 100%;
    float: left;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #FFF
}


text:
#pragma once

#ifdef _MSC_VER
#include "stdafx.h"
#endif
#include "nsCOMPtr.h"
#include "nsINativeIME.h"

#include "nsIAccessibleDocumentWrapper.h"

#define IME_CONTRACTID "@openqa.org/nativeime;1"
#define IME_CLASSNAME "Firefox OS-level Input Method Editor events"
#define IME_CID { 0xad200211,  0x0e76,  0x4612,  { 0x9c,  0x88,  0x70,  0x86,  0x8c,  0x87,  0xcf,  0xfd } }

class nsNativeIME : public nsINativeIME
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSINATIVEIME

  nsNativeIME();

private:
  virtual ~nsNativeIME();

protected:
  /* additional members */
};


text:
<!DOCTYPE html>
<!--
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/base/unit_scale.html">

<script>
'use strict';

/**
 * @fileoverview Time currentDisplayUnit
 */
tr.exportTo('tr.b', function() {
  var msDisplayMode = {
    scale: 1e-3,
    suffix: 'ms',
    // Compares a < b with adjustments to precision errors.
    roundedLess: function(a, b) {
      return Math.round(a * 1000) < Math.round(b * 1000);
    },
    formatSpec: {
      unitScale: [tr.b.UnitScale.TIME.MILLI_SEC],
      minimumFractionDigits: 3,
    }
  };

  var nsDisplayMode = {
    scale: 1e-9,
    suffix: 'ns',
    // Compares a < b with adjustments to precision errors.
    roundedLess: function(a, b) {
      return Math.round(a * 1000000) < Math.round(b * 1000000);
    },
    formatSpec: {
      unitScale: [tr.b.UnitScale.TIME.NANO_SEC],
      maximumFractionDigits: 0
    }
  };

  var TimeDisplayModes = {
    ns: nsDisplayMode,
    ms: msDisplayMode
  };

  return {
    TimeDisplayModes,
  };
});
</script>