text:
<?php

namespace Google\Cloud\Logging;

use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Logging\Connection\ConnectionInterface;

/**
 * A sink is used to export log entries outside Stackdriver Logging.
 *
 * Example:
 * ```
 * use Google\Cloud\Logging\LoggingClient;
 *
 * $logging = new LoggingClient();
 *
 * $sink = $logging->sink('my-sink');
 * ```
 */
class Sink
{
    /**
     * @var ConnectionInterface Represents a connection to Stackdriver Logging.
     */
    protected $connection;

    /**
     * @var string The sink's formatted name used in API requests.
     */
    private $formattedName;

    /**
     * @var string The sink's name.
     */
    private $name;

    /**
     * @param ConnectionInterface $connection Represents a connection to Cloud
     *        Logging.
     * @param string $name The sink's name.
     * @param string $projectId The project's ID.
     * @param array $info [optional] The sink's metadata.
     */
    public function __construct(ConnectionInterface $connection, $name, $projectId, array $info = [])
    {
        $this->connection = $connection;
        $this->info = $info;
        $this->formattedName = "projects/$projectId/sinks/$name";
        $this->name = $name;
    }

    /**
     * Check whether or not the sink exists.
     *
     * Example:
     * ```
     * if ($sink->exists()) {
     *     echo 'Sink exists!';
     * }
     * ```
     *
     * @param array $options [optional] Configuration Options
     * @return bool
     */
    public function exists(array $options = [])
    {
        try {
            $this->info($options);
        } catch (NotFoundException $ex) {
            return false;
        }

        return true;
    }

    /**
     * Delete the sink.
     *
     * Example:
     * ```
     * $sink->delete();
     * ```
     *
     * @codingStandardsIgnoreStart
     * @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/delete projects.sinks delete API documentation.
     * @codingStandardsIgnoreEnd
     *
     * @param array $options [optional] Configuration Options.
     */
    public function delete(array $options = [])
    {
        $this->connection->deleteSink($options + [
            'sinkName' => $this->formattedName
        ]);
    }

    /**
     * Update the sink. Please note this will trigger a network request if
     * cached data is not available to perform the update with.
     *
     * Example:
     * ```
     * $sink->update([
     *     'destination' => 'storage.googleapis.com/my-bucket'
     * ]);
     * ```
     *
     * @codingStandardsIgnoreStart
     * @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/update projects.sinks update API documentation.
     * @codingStandardsIgnoreEnd
     *
     * @param array $metadata {
     *     The data to update.
     *
     *     @type string $destination The export destination. Please see
     *           [Exporting Logs With Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs#about_sinks)
     *           for more information and examples.
     *     @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters).
     *     @type string $outputVersionFormat The log entry version to use for
     *           this sink's exported log entries. This version does not have
     *           to correspond to the version of the log entry when it was
     *           written to Stackdriver Logging. May be either `V1` or `V2`.
     * }
     * @param array $options [optional] Configuration Options.
     * @return array
     */
    public function update(array $metadata, array $options = [])
    {
        $options += $metadata;
        $options += $this->info($options);

        return $this->info = $this->connection->updateSink($options + [
            'sinkName' => $this->formattedName
        ]);
    }

    /**
     * Retrieves the sink's details. If no sink data is cached a network
     * request will be made to retrieve it.
     *
     * Example:
     * ```
     * $info = $sink->info();
     * echo $info['destination'];
     * ```
     *
     * @codingStandardsIgnoreStart
     * @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks#resource-logsink LogSink resource API documentation.
     * @codingStandardsIgnoreEnd
     *
     * @param array $options [optional] Configuration Options.
     * @return array
     */
    public function info(array $options = [])
    {
        if (!$this->info) {
            $this->reload($options);
        }

        return $this->info;
    }

    /**
     * Triggers a network request to reload the sink's details.
     *
     * Example:
     * ```
     * $sink->reload();
     * $info = $sink->info();
     * echo $info['destination'];
     * ```
     *
     * @codingStandardsIgnoreStart
     * @see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/get projects.sinks get API documentation.
     * @codingStandardsIgnoreEnd
     *
     * @param array $options [optional] Configuration Options.
     * @return array
     */
    public function reload(array $options = [])
    {
        return $this->info = $this->connection->getSink($options + [
            'sinkName' => $this->formattedName
        ]);
    }

    /**
     * Returns the sink's name.
     *
     * Example:
     * ```
     * echo $sink->name();
     * ```
     *
     * @return string
     */
    public function name()
    {
        return $this->name;
    }
}


text:
define(function(require, exports, module) {
  exports.a = require('./b');
  exports.c = require('./c');
});

redpajama_set_name: RedPajamaGithub


text:
package com.hbsx.purordermanage.Comprehensive;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;

import com.hbsx.purordermanage.ActivityCollector;
import com.hbsx.purordermanage.AgainCheck.AgainCheckMainActivity;
import com.hbsx.purordermanage.Examine.ExamineMainActivity;
import com.hbsx.purordermanage.InputData.InputDataMainActivity;
import com.hbsx.purordermanage.Purchase.SendToProviderActivity;
import com.hbsx.purordermanage.R;
import com.hbsx.purordermanage.RepairPassWordActivity;
import com.hbsx.purordermanage.Request.RequestNoteMainActivity;
import com.hbsx.purordermanage.base.BaseActivity;

import cn.bmob.v3.BmobUser;

/**
 * 组合活动,适用于综合岗,包括订货、购买、验货及录入功能
 * Created by Administrator on 2017/3/5 0005.
 */

public class RequestPurchaseExamineInputActivity extends BaseActivity
        implements View.OnClickListener {
    Toolbar toolbar;
    ImageButton mRequestNote, mSendTo, mExamine, mInput;
    CardView mCheckCard;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_comprehensive);

        toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setTitle("综合功能");
        setSupportActionBar(toolbar);

        initView();
        initEvent();
    }

    private void initEvent() {
        mRequestNote.setOnClickListener(this);
        mSendTo.setOnClickListener(this);
        mExamine.setOnClickListener(this);
        mInput.setOnClickListener(this);
    }

    private void initView() {
        mCheckCard = (CardView) findViewById(R.id.cw_check);
        mCheckCard.setVisibility(View.GONE);
        mRequestNote = (ImageButton) findViewById(R.id.compre_request_note);
        mSendTo = (ImageButton) findViewById(R.id.compre_purchase_order);
        mExamine = (ImageButton) findViewById(R.id.compre_examine_order);
        mInput = (ImageButton) findViewById(R.id.compre_input_order);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.compre_request_note:
                RequestNoteMainActivity.actionStart(RequestPurchaseExamineInputActivity.this);
                break;
            case R.id.compre_purchase_order:
                SendToProviderActivity.actionStart(RequestPurchaseExamineInputActivity.this);
                break;
            case R.id.compre_examine_order:
                ExamineMainActivity.actionStart(RequestPurchaseExamineInputActivity.this);
                break;
            case R.id.compre_input_order:
                InputDataMainActivity.actionStart(RequestPurchaseExamineInputActivity.this);
                break;

        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.repair_password,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.repair_password_btn:
                startActivity(RepairPassWordActivity.class,null,false);
                break;
            case R.id.logout_btn:
                BmobUser.logOut();
                ActivityCollector.finishAll();
                break;
        }
        return true;
    }

    /**
     * 启动
     */
    public static void actionStart(Context mContext) {
        Intent intent = new Intent(mContext, RequestPurchaseExamineInputActivity.class);
        mContext.startActivity(intent);
    }
}


text:
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <OCMock/OCMock.h>

#import "BPLMapViewDetailViewController.h"
#import "BPLMapViewDetailViewModel.h"
#import "BPLLabel.h"
#import "BPLButton.h"
#import "BPLPlacemark.h"
#import "BPLUnitTestHelper.h"
#import "BPLConstants.h"
#import "BPLWikipediaViewController.h"
#import "BPLDetailChooserViewController.h"
#import "BPLStreetViewViewController.h"

@interface BPLMapViewDetailViewControllerTest : XCTestCase

@property (nonatomic) UINavigationController *navigationController;
@property (nonatomic) BPLMapViewDetailViewController *controller;
@property (nonatomic) BPLPlacemark *marker1;

@end

@interface BPLMapViewDetailViewController()

@property (nonatomic, weak) IBOutlet UIScrollView *scrollView;

@property (nonatomic, weak) IBOutlet BPLLabel *occupationLabel;
@property (nonatomic, weak) IBOutlet BPLLabel *addressLabel;
@property (nonatomic, weak) IBOutlet BPLLabel *noteLabel;
@property (nonatomic, weak) IBOutlet BPLLabel *councilAndYearLabel;

@property (nonatomic, weak) IBOutlet BPLButton *streetButton;
@property (nonatomic, weak) IBOutlet BPLButton *wikipediaButton;
@property (nonatomic, weak) IBOutlet BPLButton *moreButton;
@property (nonatomic, weak) IBOutlet BPLButton *directionsButton;

- (IBAction)directionsButtonTapped:(id)sender;
- (void)buttonTappedForPlacemark:(BPLPlacemark *)placemark withAction:(NSString *)action;
- (void)detailChooserViewControllerRowSelected:(NSNotification *)notification;

@end

@implementation BPLMapViewDetailViewControllerTest

- (void)setUp
{
  [super setUp];
  UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  self.controller = [storybord instantiateViewControllerWithIdentifier:BPLMapViewDetailViewControllerStoryboardIdentifier];
  self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.controller];
  __unused id view = (self.controller).view;

  self.marker1 = [BPLUnitTestHelper placemarkWithIdentifier:@"1"];
  BPLMapViewDetailViewModel *model = [[BPLMapViewDetailViewModel alloc] init];
  model.markers = @[self.marker1];

  self.controller.model = model;
}

- (void)testInitialisation
{
  XCTAssertTrue([self.controller.screenName isEqualToString:@"Map Detail Screen"]);

  XCTAssertTrue(self.controller.occupationLabel != nil);
  XCTAssertTrue(self.controller.addressLabel != nil);
  XCTAssertTrue(self.controller.noteLabel != nil);
  XCTAssertTrue(self.controller.councilAndYearLabel != nil);
  XCTAssertTrue(self.controller.streetButton != nil);
  XCTAssertTrue(self.controller.wikipediaButton != nil);
  XCTAssertTrue(self.controller.moreButton != nil);
  XCTAssertTrue(self.controller.directionsButton != nil);
}

- (void)testPlacemarkInitialisation
{
  [self.controller viewWillAppear:YES];

  [self.controller.occupationLabel.text isEqualToString:@"Feature Description 1"];
  [self.controller.councilAndYearLabel.text isEqualToString:@"Council and Year"];

  XCTAssertTrue(self.controller.councilAndYearLabel.hidden == NO);
  XCTAssertTrue(self.controller.noteLabel.hidden == YES);
  XCTAssertTrue(self.controller.moreButton.hidden == YES);
}

- (void)testPrepareForWikipediaSegue
{
  UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  BPLWikipediaViewController *destinationViewController = [storybord instantiateViewControllerWithIdentifier:@"BPLWikipediaViewController"];

  UIStoryboardSegue *segue = [[UIStoryboardSegue alloc] initWithIdentifier:BPLWikipediaViewControllerSegue source:self.controller destination:destinationViewController];

  id controllerMock = OCMPartialMock(self.controller);
  OCMExpect([controllerMock buttonTappedForPlacemark:self.marker1 withAction:BPLWikipediaButtonPressedEvent]).andForwardToRealObject();

  [controllerMock prepareForSegue:segue sender:self.controller.wikipediaButton];

  OCMVerifyAll(controllerMock);
}

- (void)testPrepareForDetailChooserSegue
{
  UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  BPLDetailChooserViewController *destinationViewController = [storybord instantiateViewControllerWithIdentifier:@"BPLDetailChooserViewController"];

  UIStoryboardSegue *segue = [[UIStoryboardSegue alloc] initWithIdentifier:BPLDetailChooserViewControllerSegue source:self.controller destination:destinationViewController];

  id controllerMock = OCMPartialMock(self.controller);
  OCMExpect([controllerMock buttonTappedForPlacemark:self.marker1 withAction:BPLDetailsButtonPressedEvent]).andForwardToRealObject();

  [controllerMock prepareForSegue:segue sender:self.controller.moreButton];

  OCMVerifyAll(controllerMock);
}

- (void)testPrepareForStreetMapSegue
{
  UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  BPLStreetViewViewController *destinationViewController = [storybord instantiateViewControllerWithIdentifier:@"BPLStreetViewViewController"];

  UIStoryboardSegue *segue = [[UIStoryboardSegue alloc] initWithIdentifier:BPLStreetMapViewControllerSegue source:self.controller destination:destinationViewController];

  id controllerMock = OCMPartialMock(self.controller);
  OCMExpect([controllerMock buttonTappedForPlacemark:self.marker1 withAction:BPLStreetViewButtonPressedEvent]).andForwardToRealObject();

  [controllerMock prepareForSegue:segue sender:self.controller.streetButton];

  OCMVerifyAll(controllerMock);
}

- (void)testDirectionsButton
{
  id controllerMock = OCMPartialMock(self.controller);
  OCMExpect([controllerMock buttonTappedForPlacemark:self.marker1 withAction:BPLDirectionsButtonPressedEvent]).andForwardToRealObject();

  [controllerMock directionsButtonTapped:self.controller.directionsButton];

  OCMVerifyAll(controllerMock);
}

- (void)testDetailRowSelected
{
  BPLPlacemark *one = [BPLUnitTestHelper placemarkWithIdentifier:@"1"];
  BPLPlacemark *two = [BPLUnitTestHelper placemarkWithIdentifier:@"2"];
  BPLPlacemark *three = [BPLUnitTestHelper placemarkWithIdentifier:@"3"];

  self.controller.model.markers = @[one, two, three];

  NSNotification *notification = [[NSNotification alloc] initWithName:BPLDetailChooserViewControllerRowSelected object:@1 userInfo:@{}];

  [self.controller detailChooserViewControllerRowSelected:notification];

  BPLPlacemark *newFirstPlacemark = self.controller.model.markers[0];

  XCTAssertTrue([newFirstPlacemark isEqual:two]);
}

@end


text:
/**
 * Get Icon Lists from ajax function, and append into element html
 * @return {[type]} [description]
 */
$(document).ready(function () {
    //get params
    var paramBy = Belancon.getUrlParameter('by') ? Belancon.getUrlParameter('by') : null;
    var by = paramBy ? paramBy : "newest";
    var paramSearch = Belancon.getUrlParameter('search') ? Belancon.getUrlParameter('search') : null;
    var search = paramSearch ? paramSearch : "";

    //call method to get icon lists
    Icon.getAll(1, by, search);

    Icon.getCart();
    Cart.getAll();

    //if param ready, redirect url with params
    if(paramBy !== null) {
      if(paramSearch !== null) {
        window.history.pushState("", "", BASE_URL + "?by=" + paramBy + "&search=" + search);
      } else {
        window.history.pushState("", "", BASE_URL + "?by=" + paramBy);
      }
    }

    //set active tab panel
    if(by === "newest") {
      $('#tab-newest').addClass('active');
    } else {
      $('#tab-popular').addClass('active');
    }

    /**
     * Action When Search Form Submitted
     */
    $('#form-search-icon').submit(function(e) {
      e.preventDefault();
      var search = $('#search-icon').val().trim();

      if(search.length < 3) {

        /** Message Error */

        var opts = {
          "debug": false,
          "positionClass": "toast-top-right",
          "onclick": null,
          "showDuration": "100",
          "hideDuration": "300",
          "timeOut": "1000",
          "extendedTimeOut": "300",
          "showEasing": "swing",
          "hideEasing": "linear",
          "showMethod": "fadeIn",
          "hideMethod": "fadeOut"
        };
        toastr.error("Gunakan minimal 3 karakter dalam pencarian Icon.", "Warning !", opts);

      } else {
        var url = BASE_URL + "result?search=" + search;
        window.location = url;
      }
    });

    /**
     * Action When Search Form Submitted
     */
    $('#form-search-icon-navbar').submit(function(e) {
      e.preventDefault();
      var search = $('#search-icon-navbar').val().trim();

      if(search.length < 3) {

        /** Message Error */

        var opts = {
          "debug": false,
          "positionClass": "toast-top-right",
          "onclick": null,
          "showDuration": "100",
          "hideDuration": "300",
          "timeOut": "1000",
          "extendedTimeOut": "300",
          "showEasing": "swing",
          "hideEasing": "linear",
          "showMethod": "fadeIn",
          "hideMethod": "fadeOut"
        };
        toastr.error("Gunakan minimal 3 karakter dalam pencarian Icon.", "Warning !", opts);

      } else {
        var url = BASE_URL + "result?search=" + search;
        window.location = url;
      }
    });

    /**
     * Action when tab panel clicked
     */
    $('.btn-filter').click(function() {
      var filter = $(this).attr('data-filter');

      Icon.changefilter(filter);
    });

    /**
     * Action When Button Loadmore clicked
     */
    $(document).on('click', '#btn-load-more', function(){
      var currentUrlString = window.location.href;
      var currentUrlArr = currentUrlString.split("?");
      var currentUrl = currentUrlArr[0];

      var paramBy = Belancon.getUrlParameter('by') ? Belancon.getUrlParameter('by'): null;
      var paramSearch = Belancon.getUrlParameter('search') ? Belancon.getUrlParameter('search') : null;
      var by = paramBy ? paramBy : "newest";
      var search = paramSearch ? paramSearch : "";
      var page = $(this).attr('data-page');

      Icon.getAll(page, by, search);

      if(paramBy) {
        if(paramSearch) {
          window.history.pushState("", "", BASE_URL + "?by=" +by + "&search=" + search);
        } else {
          window.history.pushState("", "", BASE_URL + "?by=" +by);
        }
      }

    });

    /**
     * Action when button add cart clicked
     */
    $(document).on('click', '.btn-add-cart', function(){
      var id = $(this).attr('data-id');
      var name = $(this).attr('data-name');

      Icon.addToCart(id, name);
    });

    /**
     * Action when button remove cart clicked
     */
    $(document).on('click', '.btn-remove-cart', function(){
      var id = $(this).attr('data-id');
      var name = $(this).attr('data-name');

      Icon.removeFromCart(id, name);
    });
});

window.unload = function(e) {

};

"console" in window && console.log("%cHi Developer\nIf you find an error please report  on this page %chttps://belancon.com/bug/\n%cGive your feedback on this page %chttps://belancon.com/feedback/",
  "color: #000000; font-size: 17px; line-height: 2",
  "color: #2bbbad; font-size: 17px; line-height: 2; font-style: normal",
  "color: #000000; font-size: 17px; line-height: 2",
  "color: #2bbbad; font-size: 17px; line-height: 2; font-style: normal");


text: <!-->include end of every post<!-->


text:
<?php

class PPI_Controller_User extends APP_Controller_Application {

	/**
	 * The constructor
	 */
	function __construct() {
		parent::__construct();
	}

	/**
	 * This method is called after the user logs in successfully, it will determine the location
	 * where they are redirected to.
	 *
	 * @return void
	 */
	protected function postLoginRedirect() {
		$oSession = $this->getSession();
		// Do we have a return Url ?
		if( ($returnUrl = $oSession->get('PPI_Login::returnUrl')) !== null) {
			// Remove return url from session
			$oSession->remove('PPI_Login::returnUrl');
			$this->redirect($returnUrl, false);
		}
		$this->redirect('');
	}

	/**
	 * This function cannot be called directly, it must be extended by a child class and then called.
	 *
	 * @return void
	 */
	protected function login() {

		// If they are already logged in
		if($this->isLoggedIn() !== false) {
			$this->postLoginRedirect();
		}

		// Init
		$oUser = new APP_Model_User();
		$oForm = new PPI_Model_Form();
		$oForm->init('user_login', '', 'post');
		$oForm->setFormStructure($oUser->getLoginFormStructure());

		// If they have submitted the login form
		if($oForm->isSubmitted()) {

			$aSubmitValues = $oForm->getSubmitValues();

			// If the login fails lets set an element error
			if($oUser->login($aSubmitValues['email'], $aSubmitValues['password']) === false) {
				$oForm->setElementError('email', 'Login Failed. Please check your credentials and try again.');
			}

			// If login was successfull, redirect to the postLoginRedirect location
			if($oForm->isValidated()) {
				$this->postLoginRedirect();
			}
		}
		// Load our view
		$this->load('user/login', array('formBuilder' => $oForm->getRenderInformation()));
	}

	/**
	 * This function cannot be called directly, it must be extended by a child class and then called.
	 *
	 * @return void
	 */
	protected function recover() {
		// Take in the username field, which could be the username or the email.
		// Ship out an email to the user's email address with the activationcode

		$oUser = new UserModel();
		$oForm = new PPI_Model_Form();
		$sTemplate = 'user/recover_step1';
		$sFormName = 'user_recover_step1';

		$oForm->init('user_recover_step1');
		$oForm->setFormStructure($oUser->getRecoverFormStructure());

		// We have submitted the email value, now lets dispatch an email to the relevant place.
		if($oForm->isSubmitted() && $oForm->isValidated()) {

			// Get form values
			$aValues = $oForm->getSubmitValues();

			// Which form are we submitting from? Is it the step1, or step2 ?

			// We are in step 2
			if(PPI_Session::getInstance()->get('recover_user_id') !== null) {

				// Lets grab userid from the session and take in the NEW password the user entered.
				// Update the users record and fire them off to the login page.
				$sPassword = $aValues['password'];

				// We are in step 1
			} else {

				// If the email was valid, and the email was dispatched.
				$aUser = $oUser->getRecord('email = ' . $oUser->quote($aValues['email']));
				if(count($aUser) > 0) {

					if($oUser->sendRecoverEmail($aUser)) {
						$successMessage = 'An email has been dispatched to ' . $aValues['email'] . '. Please remember to check your spam folder.';
						$this->redirect('user/recover/successmsg/' . urlencode($successMessage));

						// The email was errornous
					} else {
						$failureMessage = 'We tried to send out a recovery email to your address but there an error.';
						$this->redirect('user/recover/failuremsg/' . urlencode($failureMessage));
					}

					// User record was not round
				} else {
					$failureMessage = 'That email address was not found in our database, please check your input and try again.';
					$this->redirect('user/recover/failuremsg/' . urlencode($failureMessage));
				}

			}

			// See if we have been sent a code
		} else if($this->oInput->get('recover') != '') {

			// Lookup the user with this code
			$aUser = $oUser->getRecord('recover_code = ' . $oUser->quote($this->oInput->get('recover')));
			if(count($aUser) > 0) {
				$sPrimaryKey = $oUser->getPrimaryKey();

				// Wipe the recovery_code
				$oUser->putRecord(array('recover_code' => '', $sPrimaryKey => $aUser[$sPrimaryKey]));

				// Set the looked up userID in the session so when they submit the "new password" form, we know who they are and can update their password.
				PPI_Session::getInstance()->set('recover_user_id', $aUser['id']);

				// Show them the enter new password screen
				$sTemplate = 'user/recover_step2';
				$sFormName = 'user_recover_step2';
			}

			// Show the user the change password screen now that we know who they are.

			// Show the form to get the user to enter their usernameField value
		}

		// Load our view
		$this->load($sTemplate, array(
			'failuremsg'  => $this->oInput->get('failuremsg'),
			'successmsg'  => $this->oInput->get('successmsg'),
			'formBuilder' => $oForm->getRenderInformation()
		));

	}

	/**
	 * This function cannot be called directly, it must be extended by a child class and then called.
     *
     * @return void
	 */
	protected function register() {

		// If they are already logged in, send them to the postloginredirect location
		if($this->isLoggedIn() === true) {
			$this->postLoginRedirect();
		}
		// Init
		$oForm = new PPI_Model_Form();
		$oUser = new APP_Model_User();
		$oForm->init('user_register', '', 'post');
		$oForm->setFormStructure($oUser->_registerFormStructure);

		// If the form has been submitted and has been validated
		if($oForm->isSubmitted() && $oForm->isValidated()) {

			// Get the info from the form and pass it to the usermodel for insertion
			$oUser->putRecord($oForm->getSubmitValues());

			// Redirect to the login page
			$this->redirect('user/login');

		}

		$this->addStylesheet('formbuilder.css');
		$this->addJavascript('jquery-validate/jquery.validate.min.js');

		// show our registration page
		$this->load('user/register', array('formBuilder' => $oForm->getRenderInformation()));

	}

}


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-getowner-polyfill'
};


text:
<?php

namespace Surfnet\StepupMiddleware\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20200114161618 extends AbstractMigration implements ContainerAwareInterface
{
    /**
     * @var ContainerInterface
     */
    private $container;

    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        // Convert all available institutions occurrences to lower case (type="institution")
        $this->addSql('UPDATE audit_log SET actor_institution=LOWER(actor_institution)');
        $this->addSql('UPDATE audit_log SET identity_institution=LOWER(identity_institution)');
        $this->addSql('UPDATE audit_log SET ra_institution=LOWER(ra_institution)');
        $this->addSql('UPDATE identity SET institution=LOWER(institution)');
        $this->addSql('UPDATE institution_listing SET institution=LOWER(institution)');
        $this->addSql('UPDATE ra_candidate SET institution=LOWER(institution)');
        $this->addSql('UPDATE ra_candidate SET ra_institution=LOWER(ra_institution)');
        $this->addSql('UPDATE ra_listing SET institution=LOWER(institution)');
        $this->addSql('UPDATE ra_listing SET ra_institution=LOWER(ra_institution)');
        $this->addSql('UPDATE ra_second_factor SET institution=LOWER(institution)');
        $this->addSql('UPDATE second_factor_revocation SET institution=LOWER(institution)');
        $this->addSql('UPDATE whitelist_entry SET institution=LOWER(institution)');
        $this->addSql('UPDATE verified_second_factor SET institution=LOWER(institution)');

        // Convert all available configuration institutions occurrences to lower case (type="stepup_configuration_institution")
        $this->addSql('UPDATE allowed_second_factor SET institution=LOWER(institution)');
        $this->addSql('UPDATE configured_institution SET institution=LOWER(institution)');
        $this->addSql('UPDATE institution_authorization SET institution=LOWER(institution)');
        $this->addSql('UPDATE institution_authorization SET institution_relation=LOWER(institution_relation)');
        $this->addSql('UPDATE institution_configuration_options SET institution=LOWER(institution)');
        $this->addSql('UPDATE ra_location SET institution=LOWER(institution)');

        // Convert all GW institutions to lowercase
        $gatewaySchema  = $this->getGatewaySchema();
        $this->addSql(sprintf('UPDATE %s.whitelist_entry SET institution=LOWER(institution)', $gatewaySchema));
        $this->addSql(sprintf('UPDATE %s.second_factor SET institution=LOWER(institution)', $gatewaySchema));
    }

    /**
     * @param Schema $schema
     */
    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs

        $this->throwIrreversibleMigrationException('This migration is irreversible');
    }

    private function getGatewaySchema()
    {
        return $this->container->getParameter('database_gateway_name');
    }
}


text:
module Boson::ArgumentInspector
  extend self

  # Max number of arguments extracted per method with scrape_with_eval
  MAX_ARGS = 10
  # Scrapes non-private methods for argument names and default values.
  # Returns arguments as array of argument arrays with optional default value as a second element.
  # ====Examples:
  #   def meth1(arg1, arg2='val', options={}) -> [['arg1'], ['arg2', 'val'], ['options', {}]]
  #   def meth2(*args) -> [['*args']]
  def scrape_with_eval(meth, klass, object)
    unless %w[initialize].include?(meth.to_s)
      return if class << object; private_instance_methods(true).map {|e| e.to_s } end.include?(meth.to_s)
    end
    params, values, arity, num_args = trace_method_args(meth, klass, object)
    return if local_variables == params # nothing new found
    format_arguments(params, values, arity, num_args)
    rescue Exception
      print_debug_message(klass, meth) if Boson.debug
    ensure
      set_trace_func(nil)
  end

  def print_debug_message(klass, meth) #:nodoc:
    warn "DEBUG: Error while scraping arguments from #{klass.to_s[/\w+$/]}##{meth}: #{$!.message}"
  end

  # process params + values to return array of argument arrays
  def format_arguments(params, values, arity, num_args) #:nodoc:
    params ||= []
    params = params[0,num_args]
    params.inject([[], 0]) do |(a, i), x|
      if Array === values[i]
        [a << ["*#{x}"], i+1]
      else
        if arity < 0 && i >= arity.abs - 1
          [a << [x.to_s, values[i]], i + 1]
        else
          [a << [x.to_s], i+1]
        end
      end
    end.first
  end

  def trace_method_args(meth, klass, object) #:nodoc:
    file = line = params = values = nil
    arity = klass.instance_method(meth).arity
    set_trace_func lambda{|event, file, line, id, binding, classname|
      begin
        if event[/call/] && classname == klass && id == meth
          params = eval("local_variables", binding)
          values = eval("local_variables.map{|x| eval(x.to_s)}", binding)
          throw :done
        end
      rescue Exception
        print_debug_message(klass, meth) if Boson.debug
      end
    }
    if arity >= 0
      num_args = arity
      catch(:done){ object.send(meth, *(0...arity)) }
    else
      num_args = 0
      # determine number of args (including splat & block)
      MAX_ARGS.downto(arity.abs - 1) do |i|
        catch(:done) do
          begin
            object.send(meth, *(0...i))
          rescue Exception
          end
        end
        # all nils if there's no splat and we gave too many args
        next if !values || values.compact.empty?
        k = nil
        values.each_with_index{|x,j| break (k = j) if Array === x}
        num_args = k ? k+1 : i
        break
      end
      args = (0...arity.abs-1).to_a
      catch(:done) do
        args.empty? ? object.send(meth) : object.send(meth, *args)
      end
    end
    set_trace_func(nil)
    return [params, values, arity, num_args]
  end
end


text:
/* -*-  mode: c++; indent-tabs-mode: nil -*- */

/*
  Evaluates the conductivity of surface flow as a function of ponded
  depth and surface slope using Manning's model.

  Authors: Ethan Coon (ecoon@lanl.gov)
*/

#include "manning_conductivity_model.hh"

namespace Amanzi {
namespace Flow {

ManningConductivityModel::ManningConductivityModel(Teuchos::ParameterList& plist)
{
  slope_regularization_ = plist.get<double>("slope regularization epsilon", 1.e-8);
  manning_exp_ = plist.get<double>("Manning exponent");
  depth_max_ = plist.get<double>("maximum ponded depth [m]", 1.e8);
}

double ManningConductivityModel::Conductivity(double depth, double slope, double coef) {
  if (depth <= 0.) return 0.;
  double scaling = coef * std::sqrt(std::max(slope, slope_regularization_));
  return depth * std::pow(std::min(depth, depth_max_), manning_exp_) / scaling;
}

double ManningConductivityModel::DConductivityDDepth(double depth, double slope, double coef) {
  if (depth <= 0.) return 0.;
  double scaling = coef * std::sqrt(std::max(slope, slope_regularization_));
  if (depth > depth_max_) {
    return std::pow(depth_max_, manning_exp_) / scaling;
  } else {
    return std::pow(depth, manning_exp_) * (manning_exp_+1) / scaling;
  }
}

} // namespace
} // namespace


text:
<?php

/**
 * @apiGroup           User
 * @apiName            DeleteUser
 * @api                {delete} /v1/users/:id Delete User
 * @apiDescription     Delete users of any type (Admin, Client...)
 *
 * @apiVersion         1.0.0
 * @apiPermission      Authenticated ['permissions' => 'delete-users', 'roles' => ''] | Resource Owner
 *
 * @apiHeader          {String} accept=application/json
 * @apiHeader          {String} authorization=Bearer
 *
 * @apiParam           {String} id user id
 *
 * @apiSuccessExample  {json}       Success-Response:
 * HTTP/1.1 204 No Content
 * {}
 */

use App\Containers\AppSection\User\UI\API\Controllers\DeleteUserController;
use Illuminate\Support\Facades\Route;

Route::delete('users/{id}', [DeleteUserController::class, 'deleteUser'])
    ->middleware(['auth:api']);


text:
@implementation TrueDiscView

- (BOOL) isOpaque { return NO; }

@end


text:
> Personal preferences for [Sublime Text 3](http://www.sublimetext.com).

## Table of Contents

- [Requirement](#requirement)
- [Installation](#installation)
- [Packages](#packages)
- [Shortcuts](#shortcuts)
- [Screenshot](#screenshot)
- [Resources](#resources)

## Requirement

First you need to install [Package Control](https://packagecontrol.io/installation).

### System requirement

- [Git](https://git-scm.com)
- [Node.js](https://nodejs.org)
- [Ruby](https://www.ruby-lang.org)

#### Node modules

- [grunt-cli](https://www.npmjs.com/package/grunt-cli)
- [gulp](https://www.npmjs.com/package/gulp)
- [csslint](https://www.npmjs.com/package/csslint)

#### Ruby gem

- [scss_lint](https://rubygems.org/gems/scss_lint)

## Installation

```sh
$ git clone https://github.com/antleblanc/sublime-text-3-preferences.git
```

Depending on your OS platform, install preferences in those following folders

**Windows** : `%USERPROFILE%\AppData\Roaming\Sublime Text 3\Packages\User`
**OS X** : `~/Library/Application Support/Sublime Text 3/Packages/User`

## Packages

- [AdvancedNewFile](https://packagecontrol.io/packages/AdvancedNewFile)
- [Alignment](https://packagecontrol.io/packages/Alignment)
- [ApacheConf.tmLanguage](https://packagecontrol.io/packages/ApacheConf.tmLanguage)
- [AutoFileName](https://packagecontrol.io/packages/AutoFileName)
- [Autoprefixer](https://packagecontrol.io/packages/Autoprefixer)
- [BracketHighlighter](https://packagecontrol.io/packages/BracketHighlighter)
- [Color Highlighter](https://packagecontrol.io/packages/Color%20Highlighter)
- [DocBlockr](https://packagecontrol.io/packages/DocBlockr)
- [EditorConfig](https://packagecontrol.io/packages/EditorConfig)
- [Emmet](https://packagecontrol.io/packages/Emmet)
- [GitGutter](https://packagecontrol.io/packages/GitGutter)
- [Grunt](https://packagecontrol.io/packages/Grunt)
- [Gulp](https://packagecontrol.io/packages/Gulp)
- [Jade](https://packagecontrol.io/packages/Jade)
- [Markdown Preview](https://packagecontrol.io/packages/Markdown%20Preview)
- [Nettuts+ Fetch](https://packagecontrol.io/packages/Nettuts%2B%20Fetch)
- [Package Control](https://packagecontrol.io/packages/Package%20Control)
- [PHP-Twig](https://packagecontrol.io/packages/PHP-Twig)
- [PlainTasks](https://packagecontrol.io/packages/PlainTasks)
- [SCSS](https://packagecontrol.io/packages/SCSS)
- [Seti_UI](https://packagecontrol.io/packages/Seti_UI)
- [Smarty](https://packagecontrol.io/packages/Smarty)
- [SublimeLinter](https://packagecontrol.io/packages/SublimeLinter)
- [SublimeLinter-contrib-scss-lint](https://packagecontrol.io/packages/SublimeLinter-contrib-scss-lint)
- [SublimeLinter-csslint](https://packagecontrol.io/packages/SublimeLinter-csslint)
- [SublimeLinter-php](https://packagecontrol.io/packages/SublimeLinter-php)
- [SublimeLinter-phpcs](https://packagecontrol.io/packages/SublimeLinter-phpcs)

## Shortcuts

| Windows          | OS X            | GNU/Linux        | Description   |
| ---------------- | --------------- | ---------------- | ------------- |
| ctrl+alt+f       | alt+shift+f     | n/a              | fetch command |

## Screenshot

![Capture OS X](screenshots/os-x.png)

## Resources

- [Package Control - Syncing](https://packagecontrol.io/docs/syncing)

## License

MIT © [Antoine Leblanc](https://antleblanc.me)


text:
using System.IO;
using System.Security.Cryptography.X509Certificates;

namespace WebHost.Config
{
    static class Certificate
    {
        public static X509Certificate2 Get()
        {
            var assembly = typeof(Certificate).Assembly;
            using (var stream = assembly.GetManifestResourceStream("WebHost.Config.idsrv3test.pfx"))
            {
                return new X509Certificate2(ReadStream(stream), "idsrv3test");
            }
        }

        private static byte[] ReadStream(Stream input)
        {
            byte[] buffer = new byte[16 * 1024];
            using (MemoryStream ms = new MemoryStream())
            {
                int read;
                while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
                {
                    ms.Write(buffer, 0, read);
                }
                return ms.ToArray();
            }
        }
    }
}


text:
ActiveRecord::Schema.define(version: 20161207045554) do

  create_table "comments", force: :cascade do |t|
    t.integer  "incident_id", limit: 4,     null: false
    t.integer  "user_id",     limit: 4,     null: false
    t.text     "comment",     limit: 65535, null: false
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
  end

  add_index "comments", ["incident_id"], name: "index_comments_on_incident_id", using: :btree

  create_table "escalation_series", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.datetime "created_at",               null: false
    t.datetime "updated_at",               null: false
    t.text     "settings",   limit: 65535
  end

  create_table "escalations", force: :cascade do |t|
    t.bigint "escalate_to_id",       limit: 4
    t.integer  "escalate_after_sec",   limit: 4
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
    t.bigint "escalation_series_id", limit: 4
  end

  add_index "escalations", ["escalate_to_id"], name: "index_escalations_on_escalate_to_id", using: :btree
  add_index "escalations", ["escalation_series_id"], name: "index_escalations_on_escalation_series_id", using: :btree

  create_table "incident_events", force: :cascade do |t|
    t.bigint "incident_id", limit: 4
    t.integer  "kind",        limit: 4
    t.text     "text",        limit: 65535
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
    t.text     "info",        limit: 65535
  end

  add_index "incident_events", ["incident_id"], name: "index_incident_events_on_incident_id", using: :btree

  create_table "incidents", force: :cascade do |t|
    t.string   "subject",     limit: 255
    t.text     "description", limit: 65535
    t.bigint "topic_id",    limit: 4
    t.datetime "occured_at"
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
    t.integer  "status",      limit: 4
  end

  add_index "incidents", ["topic_id"], name: "index_incidents_on_topic_id", using: :btree

  create_table "maintenances", force: :cascade do |t|
    t.bigint "topic_id",   limit: 4
    t.datetime "start_time"
    t.datetime "end_time"
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
    t.string   "filter",     limit: 255
  end

  add_index "maintenances", ["topic_id"], name: "index_maintenances_on_topic_id", using: :btree

  create_table "notifier_providers", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.integer  "kind",       limit: 4
    t.text     "settings",   limit: 65535
    t.datetime "created_at",               null: false
    t.datetime "updated_at",               null: false
  end

  create_table "notifiers", force: :cascade do |t|
    t.text     "settings",         limit: 65535
    t.integer  "notify_after_sec", limit: 4
    t.datetime "created_at",                                    null: false
    t.datetime "updated_at",                                    null: false
    t.bigint "user_id",          limit: 4
    t.bigint "provider_id",      limit: 4
    t.bigint "topic_id",         limit: 4
    t.boolean  "enabled",                        default: true
  end

  add_index "notifiers", ["provider_id"], name: "index_notifiers_on_provider_id", using: :btree
  add_index "notifiers", ["topic_id"], name: "index_notifiers_on_topic_id", using: :btree
  add_index "notifiers", ["user_id"], name: "index_notifiers_on_user_id", using: :btree

  create_table "topics", force: :cascade do |t|
    t.string   "name",                 limit: 255
    t.integer  "kind",                 limit: 4
    t.datetime "created_at",                                      null: false
    t.datetime "updated_at",                                      null: false
    t.bigint "escalation_series_id", limit: 4
    t.boolean  "enabled",                          default: true
  end

  add_index "topics", ["escalation_series_id"], name: "index_topics_on_escalation_series_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.datetime "created_at",                                null: false
    t.datetime "updated_at",                                null: false
    t.string   "email",       limit: 255
    t.string   "login_token", limit: 255
    t.boolean  "active",                    default: false
    t.string   "provider",    limit: 255
    t.string   "uid",         limit: 255
    t.text     "credentials", limit: 65535
  end

  add_foreign_key "escalations", "escalation_series"
  add_foreign_key "escalations", "users", column: "escalate_to_id"
  add_foreign_key "incident_events", "incidents"
  add_foreign_key "incidents", "topics"
  add_foreign_key "maintenances", "topics"
  add_foreign_key "notifiers", "notifier_providers", column: "provider_id"
  add_foreign_key "notifiers", "topics"
  add_foreign_key "notifiers", "users"
  add_foreign_key "topics", "escalation_series"
end


text:
package apincer.android.dialog;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.TypedValue;

import apincer.android.library.R;

public class UtilsLibrary {

    static int dpToPixels(Context context, int dp) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dp * scale + 0.5f);
    }

    static Drawable createButtonBackgroundDrawable(@NonNull Context context, int fillColor) {
        int buttonCornerRadius = dpToPixels(context, 2);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            TypedValue v = new TypedValue();
            boolean hasAttribute = context.getTheme().resolveAttribute(R.attr.colorControlHighlight, v, true);
            int rippleColor = hasAttribute ? v.data : Color.parseColor("#88CCCCCC");
            return createButtonBackgroundDrawableLollipop(fillColor, rippleColor, buttonCornerRadius);
        }
        return createButtonBackgroundDrawableBase(fillColor, buttonCornerRadius);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private static Drawable createButtonBackgroundDrawableLollipop(int fillColor, int rippleColor,int cornerRadius) {
        Drawable d = createButtonBackgroundDrawableBase(fillColor, cornerRadius);
        return new RippleDrawable(ColorStateList.valueOf(rippleColor), d, null);
    }

    private static Drawable createButtonBackgroundDrawableBase(int color, int cornerRadius) {
        GradientDrawable d = new GradientDrawable();
        d.setShape(GradientDrawable.RECTANGLE);
        d.setCornerRadius(cornerRadius);
        d.setColor(color);
        return d;
    }

}


text:
`nexthop` is a web application whose sole purpose is to perform HTTP
redirects using 3xx status codes.

To use nexthop, make a request to it using a URL like

    http://nexthop.cc/[code]/[next-hop-url]

And your browser will be redirected to the next hop URL.

The `[code]` may be any of

* 301
* 302
* 303
* 307

The `[next-hop-url]` may be an encoded or unencoded URL, and may contain a
query string.


text:
@interface MyParent : NSObject
- (int)getZero;
@end
@implementation MyParent
- (int)getZero {
    return 0;
}
@end

@interface PublicClass () {
   int value2;
}
@property (readwrite) int value1;
- (void)setValue2:(int)newValue2;
@end

@implementation PublicClass

- (int)getZeroPublic {
    return 0;
}

@synthesize value1;

- (int)value2 {
    return value2;
}
- (void)setValue2:(int)newValue {
    value2 = newValue;
}

- (int)value3 {
    return value3;
}
- (void)setValue3:(int)newValue {
    value3 = newValue;
}

@end

@interface MyClassWithPublicParent : PublicClass
- (int)getZeroPublic;
@end
@implementation MyClassWithPublicParent
- (int)getZeroPublic {
    return 0;
}
@end

// Category overrides a public method.
@interface PublicSubClass (PrvateCat)
  - (int) getZeroPublic;
@end
@implementation PublicSubClass (PrvateCat)
- (int)getZeroPublic {
    return 0;
}
@end

@interface MyClass : MyParent {
  int value;
}
- (int)getZero;
@property int value;
@end

// Since class is private, we assume that it cannot be subclassed.
// False negative: this class is "privately subclassed". this is very rare
// in practice.
@implementation MyClass
+ (int) testTypeFromParam:(MyParent*) p {
  int m = 0;
  int z = [p getZero];
  if (z)
    return 5/m; // false negative
  return 5/[p getZero];// expected-warning {{Division by zero}}
}

// Here only one definition is possible, since the declaration is not visible
// from outside.
+ (int) testTypeFromParamPrivateChild:(MyClass*) c {
  int m = 0;
  int z = [c getZero]; // MyClass overrides getZero to return '1'.
  if (z)
    return 5/m; // expected-warning {{Division by zero}}
  return 5/[c getZero];//no warning
}

- (int)getZero {
    return 1;
}

- (int)value {
  return value;
}

- (void)setValue:(int)newValue {
  value = newValue;
}

// Test ivar access.
- (int) testIvarInSelf {
  value = 0;
  return 5/value; // expected-warning {{Division by zero}}
}

+ (int) testIvar: (MyClass*) p {
  p.value = 0;
  return 5/p.value; // expected-warning {{Division by zero}}
}

// Test simple property access.
+ (int) testProperty: (MyClass*) p {
  int x= 0;
  [p setValue:0];
  return 5/[p value]; // expected-warning {{Division by zero}}
}

@end

// The class is prvate and is not subclassed.
int testCallToPublicAPIInParent(MyClassWithPublicParent *p) {
  int m = 0;
  int z = [p getZeroPublic];
  if (z)
    return 5/m; // no warning
  return 5/[p getZeroPublic];// expected-warning {{Division by zero}}
}

// When the called method is public (due to it being defined outside of main file),
// split the path and analyze both branches.
// In this case, p can be either the object of type MyParent* or MyClass*:
// - If it's MyParent*, getZero returns 0.
// - If it's MyClass*, getZero returns 1 and 'return 5/m' is reachable.
// Declaration is provate, but p can be a subclass (MyClass*).
int testCallToPublicAPI(PublicClass *p) {
  int m = 0;
  int z = [p getZeroPublic];
  if (z)
    return 5/m; // expected-warning {{Division by zero}}
  return 5/[p getZeroPublic];// expected-warning {{Division by zero}}
}

// Even though the method is privately declared in the category, the parent
// declares the method as public. Assume the instance can be subclassed.
int testCallToPublicAPICat(PublicSubClass *p) {
  int m = 0;
  int z = [p getZeroPublic];
  if (z)
    return 5/m; // expected-warning {{Division by zero}}
  return 5/[p getZeroPublic];// expected-warning {{Division by zero}}
}

// Test public property - properties should always be inlined, regardless
// weither they are "public" or private.
int testPublicProperty(PublicClass *p) {
  int x = 0;
  p.value3 = 0;
  if (p.value3 != 0)
    return 5/x;
  return 5/p.value3;// expected-warning {{Division by zero}}
}

int testExtension(PublicClass *p) {
  int x = 0;
  [p setValue2:0];
  if ([p value2] != 0)
    return 5/x; // expected-warning {{Division by zero}}
  return 5/[p value2]; // expected-warning {{Division by zero}}
}

// TODO: we do not handle synthesized properties yet.
int testPropertySynthesized(PublicClass *p) {
  [p setValue1:0];
  return 5/[p value1];
}

// Test definition not available edge case.
@interface DefNotAvailClass : NSObject // expected-note {{receiver is instance of class declared here}}
@end
id testDefNotAvailableInlined(DefNotAvailClass *C) {
  return [C mem]; // expected-warning {{instance method '-mem' not found}}
}
id testDefNotAvailable(DefNotAvailClass *C) {
  return testDefNotAvailableInlined(C);
}


text:
import click

from .comm import pdserver_request

@click.group()
@click.pass_context
def routers(ctx):
    """
    (deprecated) Access router information on the controller.

    These commands are deprecated. Please use the equivalent commands under
    `pdtools cloud --help`.
    """
    ctx.obj['routers_url'] = ctx.obj['pdserver_url'] + "/api/routers"

@routers.command()
@click.pass_context
def list(ctx):
    """
    List routers.
    """
    url = ctx.obj['routers_url']
    result = pdserver_request('GET', url)
    routers = result.json()

    for router in routers:
        print("{} {} {}".format(router['_id'], router['name'], router['online']))

@routers.command()
@click.pass_context
@click.argument('token')
def claim(ctx, token):
    """
    Claim an existing router.
    """
    url = ctx.obj['routers_url'] + '/claim'
    data = {
        'claim_token': token
    }
    result = pdserver_request('POST', url, json=data)
    if result.ok:
        router = result.json()
        print("Claimed router: {}".format(router['name']))
    else:
        print("There was an error claiming the router.")
        print("Please check that your claim token is correct.")

@routers.command()
@click.pass_context
@click.argument('name')
@click.option('--orphaned/--not-orphaned', default=False)
@click.option('--claim', default=None)
def create(ctx, name, orphaned, claim):
    """
    Create a new router.
    """
    url = ctx.obj['routers_url']
    data = {
        'name': name,
        'orphaned': orphaned
    }
    if claim is not None:
        data['claim_token'] = claim
    result = pdserver_request('POST', url, json=data)
    if result.ok:
        router = result.json()

        print("Name: {}".format(router['name']))
        print("ID: {}".format(router['_id']))
        print("Password: {}".format(router['password']))
        print("Claim: {}".format(router['claim_token']))

        print("")
        print("You may use the following command to provision your router:")
        print("pdtools device <address> provision {_id} {password}".format(**router))

@routers.command()
@click.pass_context
@click.argument('router_id')
def delete(ctx, router_id):
    """
    Delete a router.
    """
    url = ctx.obj['routers_url'] + "/" + router_id
    pdserver_request('DELETE', url)


text:
layout: post
title: French exchange student handjob
titleinfo: pornvd
desc: Watch French exchange student handjob. Pornhub is the ultimate xxx porn and sex site.
---

French exchange student handjob

Watch French exchange student handjob. Pornhub is the ultimate xxx porn and sex site.


text:
'use strict';

module.exports = function eslint(grunt) {
  grunt.loadNpmTasks('grunt-eslint');
  return {
    options: {
      configFile: '.eslint'
    },
    target: [
      '!examples/simple/public/bundle.js',
      '!examples/complex/public/bundle.js',
      'examples/**/*.js',
      'lib/**/*.js',
      'index.js'
    ]
  };
};


text:
<title>
The Republican patronage machine
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

READING BETWEEN THE LINES?

The Republican patronage machine

By Lance Selfa | June 2, 2006 | Page 9

WITH EACH new day, more bad political news seems to befall the Bush administration and Republicans in Congress.

Major national opinion polls estimate that only about one-third of Americans support President Bush and the Republicans in Congress. It's gotten so bad that even Ken Mehlman, chair of the Republican National Committee, was said to have told congressional leaders that the GOP could lose 25 seats in the U.S. House, giving the Democrats a majority.

Topping the list of voter concerns driving this discontent with Bush and the GOP is, of course, the war in Iraq. Since early 2005, growing majorities of Americans have told pollsters that they believe the war "wasn't worth it" and that they want to see U.S. troops withdrawn soon.

Added to this are economic issues, from rising gas prices to affordability of health care. A May Washington Post poll showed that 69 percent surveyed believe the nation is "off track.

For these reasons, the same Washington Post poll showed 56 percent of the public preferring a Democratic Congress in November, with three times as many people saying they would use their vote to express opposition to Bush rather than support for him.

Since taking Congress in 1994 and the presidency in 2001, the GOP has managed to exert a pull on politics to the right that has been largely successful, despite governing with fairly slim majorities in Congress. Bush himself lost the popular vote in 2000 and won only 51.1 percent of the vote in 2004, the narrowest re-election victory of a president since 1916.

These are hardly ringing endorsements of Republican tax cuts for the rich, eternal war and corporate welfare from the majority of the American public. Yet the GOP machine has been extremely effective in pushing through its right-wing agenda--despite popular opposition or indifference to the issues that excite the GOP's conservative "base."

One key reason why the GOP has been so effective is the back story to the scandal involving GOP lobbyist Jack Abramoff, who pleaded guilty to a number of federal charges early this year.

Abramoff wouldn't have been in the position to exploit his connections if he wasn't part of the architecture of Republican rule in Washington. Abramoff was a cog in Tom DeLay's (R-Texas) "K-Street Project," a plan to enforce Republican hegemony on the lobbying industry that had a "bipartisan" approach to Congress and the executive branch before the GOP won the Congress in 1994.

As a cost of doing business with the new GOP majority, DeLay and his henchmen demanded that corporations and lobbying firms hire Republican loyalists. Or, in the case of Abramoff's firm, that they funnel their business through the firm of a Republican loyalist.

Abramoff had been a long-time GOP activist from the days when he knew Karl Rove and Grover Norquist, a consigliore of the GOP-linked conservative activist groups as president of Americans for Tax Reform, from their days in the leadership of the College Republicans.

Abramoff's shakedowns of Indian tribes weren't really for services rendered so much as they were used to create a slush fund that made available millions of dollars for the congressional leadership, namely DeLay and Sen. Rick Santorum (R-Pa.), to distribute to Republican politicians in both Houses. In this way, Abramoff worked with DeLay, even sharing staffers, to build the patronage machine that assured that DeLay would almost always have the votes he and his errand boy, House Speaker Dennis Hastert (R-Ill.), needed to pass through the GOP-corporate agenda.

The Center for Responsive Politics estimates that Abramoff-connected money amounts to $55 million spread among 300 members of Congress.

If the Abramoff scandal succeeds in bringing down enough members of the Republican leadership to seriously threaten this patronage machine, then Republican control of the congressional agenda really will be under threat. And, given the near-complete lack of a Democratic opposition, this would be a blow to the GOP that would be entirely self-inflicted.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
package io.joynr.dispatcher.rpc.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface JoynrRpcSubscription {

    // name of the attribute to subscribe to
    String attributeName();

    Class<?> attributeType();
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Introduction - Zend Framework Manual</title>

                    Getting Started Zend_View Placeholders

Getting Started Zend_View Placeholders

                        Programmer's Reference Guide

Basic Placeholder Usage

Introduction

        In the previous chapter, we looked at primarily the
        Two Step View pattern, which allows you to embed individual application views within a
        sitewide layout. At the end of that chapter, however, we discussed some limitations:

                How do you alter the page title?

                How would you inject conditional scripts or stylesheets into the sitewide layout?

                How would you create and render an optional sidebar? What if there was some content
                that was unconditional, and other content that was conditional for the sidebar?

        These questions are addressed in the » Composite
        View design pattern. One approach to that pattern is to provide "hints" or content
        to the sitewide layout. In Zend Framework, this is achieved through specialized view helpers
        called "placeholders." Placeholders allow you to aggregate content, and then render that
        aggregate content elsewhere.

                    Getting Started Zend_View Placeholders

Getting Started Zend_View Placeholders

                        Programmer's Reference Guide

Basic Placeholder Usage

Programmer's Reference Guide

Programmer's Reference Guide

Learning Zend Framework

Getting Started Zend_View Placeholders

Introduction

Basic Placeholder Usage

Standard Placeholders

View Placeholders: Conclusion


text:
package com.dayatang.domain;

import java.io.Serializable;

public interface Entity extends Serializable {

}


text:
- hs sig vs. lh sig
- module and import story
- `inline`

- Binders: If I enter the following specification:
```
{-@ plus :: v1:Sparse a
         -> {v2:Sparse a | spDim v1 == spDim v2}
         -> {v3:Sparse a | spDim v3 == spDim v2 && spDim v3 == spDim v1}
     @-}
```
LH tells me that `v2` is unbound. I feel that it should not be given that I defined `v2` in the second argument to the spec.

* Ch4 refined datatypes p35

  All types should derive `Show` so that a reader following along can try functions in GHCI and get a result printed

* Pattern matching gives you invariants but raw field access doesn't. See Chris's note on 4.6
4.6)I came up with:
```
del :: (Ord a) => a -> BST a -> BST a
del k' t@(Node k l r)
 | k' < k = Node k (del k' l) r
 | k' > k = Node k l (del k' r)
 | otherwise = remv t
 where
  remv :: (Ord a) => BST a -> BST a
  remv (Node _ Leaf Leaf) = Leaf
  remv (Node _ l Leaf) = l
  remv (Node _ Leaf r) = r
  remv (Node _ l r) = Node iSuccE l iSuccR
  where
   iSuccE = mElt $ delMin r
   iSuccR = rest $ delMin r
```
However, LH complains about `iSuccR`. I don't
see why it should have a problem with that
given that `iSuccR` is the rest of the right
tree which is by definition greater than
`iSuccE`, which is the smallest element of the
right tree. I imagine I could walk the entire
right tree to verify this to please LH like I
did with `quickSort`, but I can't imagine that
is the correct answer.

- in addition to the usual syntax:

```
     {-@ unsafeLookup :: n:Nat ->  {v:Vector a | n < (vlen v)} -> a @-}
```

- could we get a "function" syntax:

```
     {-@ unsafeLookup :: n:Nat ->  v:Vector a -> a
         unsafeLookup n v = n < vlen v @-}
```

...or...

```
     {-@ unsafeLookup :: n:Int -> v:Vector a -> a
         unsafeLookup n v = n >= 0 && n < vlen v @-}
```

...or...

```
     {-@ unsafeLookup :: n:Int -> {v:Vector a | n < (vlen v)} -> a
         unsafeLookup n v = n >= 0 @-}
```
- the "function" could take as arguments symbols that were bound
  in the "signature." It could take a partial specification and
  implement additional refinements. It "looks like Haskell" and
  allows the programmer more freedom in how they define their
  refinements


text:
namespace Computers.Core.Manufacturers
{
    using System.Collections.Generic;
    using Models.ComputerTypes;
    using Models.Cpu;
    using Models.HardDrive;
    using Models.LaptopBatery;
    using Models.Ram;
    using Models.VideoCard;

    public class HPComputersFactory : IComputersFactory
    {
        public const string Name = "HP";

        /// <summary>
        /// Create <see cref="PersonalComputer"/>.
        /// </summary>
        /// <returns>New <see cref="PersonalComputer"/></returns>
        public PersonalComputer CreatePersonalComputer()
        {
            return new PersonalComputer(
                new Cpu32(2),
                new Ram(2),
                new[] { new SingleHardDrive(500) },
                new ColorfullVideoCard());
        }

        /// <summary>
        /// Create <see cref="Server"/>.
        /// </summary>
        /// <returns>New <see cref="Server"/></returns>
        public Server CreateServer()
        {
            var hardDrives = new List<HardDrive>
            {
                new RaidArray(new List<HardDrive>
                {
                    new SingleHardDrive(1000),
                    new SingleHardDrive(1000)
                })
            };

            return new Server(new Cpu32(32), new Ram(32), hardDrives, new MonochromeVideoCard());
        }

        /// <summary>
        /// Create <see cref="Laptop"/>.
        /// </summary>
        /// <returns>New <see cref="Laptop"/></returns>
        public Laptop CreateLaptop()
        {
           return new Laptop(
               new Cpu64(2),
               new Ram(4),
               new[] { new SingleHardDrive(500) },
               new ColorfullVideoCard(),
               new LaptopBattery());
        }
    }
}


text:
<form id="{$form.name}" name="{$form.name}">

		{if $form.icon !='' }

		{/if}

		{$form.title}

{$form.description}

			{$form.record_name}

		{foreach item=elem from=$searchPanel}
			{if $elem.label} {$form.elem.label} {/if} {$elem.element}
		{/foreach}

     {foreach item=cell key=elems_name from=$dataPanel.elems}
     	{if $cell.type=='ColumnStyle'}
     		{assign var=row_style_name value=$elems_name}
		{else}
			{if $cell.type=='RowCheckbox'}
				{assign var=th_style value="text-align:left;padding-left:10px;"}
			{else}
				{assign var=th_style value=""}
			{/if}
         {$cell.label}
		{/if}
     {/foreach}

     {assign var=row_counter value=0}
     {foreach item=row from=$dataPanel.data}

     	 {if $row.$row_style_name != ''}
     	 	{assign var=row_style value=$dataPanel.data.$row_counter.$row_style_name}
     	 {else}
     	 	{assign var=row_style value=''}
     	 {/if}

		 {if $form.currentRecordId == $dataPanel.ids[$row_counter]}
         {assign var=default_selected_id value=$dataPanel.ids[$row_counter]}

         {elseif $row_counter == 0 and $form.currentRecordId == ""}
         {assign var=default_selected_id value=$dataPanel.ids[$row_counter]}

          {elseif $row_counter is odd}

         {else}

         {/if}

         {assign var=col_counter value=0}
         {foreach key=name item=cell key=cell_name from=$row}
         	{if $col_counter eq 0}
         		{assign var=col_class value=' class="row_header" '}
         	{else}
         		{assign var=col_class value=' '}
         	{/if}
         	{if $cell_name != $row_style_name}
	            {if $cell != ''}
	              {$cell}
	            {else}

	            {/if}
            {/if}
            {assign var=col_counter value=$col_counter+1}
         {/foreach}

		{assign var=row_counter value=$row_counter+1}

     {/foreach}

{if $navPanel}
   {foreach item=elem from=$navPanel}
   		{if $elem.label} {$elem.label}{/if}
    	{$elem.element}
   {/foreach}
{/if}

			{foreach item=elem from=$actionPanel}
				{$elem.element}
			{/foreach}

</form>


text:
import pytoml

class TomlConfig:
    """docstring for TomlConfig"""
    def __init__(self, contents):
        super().__init__()
        self.raw = pytoml.load(contents)

    def parse(self):
        tests = []
        gconf = {}
        if 'global' in self.raw:
            for key, value in self.raw['global'].items():
                gconf[key] = value
        for rtest in self.raw['tests']:
            try:
                test = parse_test(rtest, gconf)
            except ValueError:
                raise
            tests.append(test)
        return tests

    @staticmethod
    def get_extension():
        return 'toml'

def parse_test(raw, gconf):
    try:
        expected = get_key('expected', raw, gconf, default='')
        if isinstance(expected, str):
            expected = dict(output=expected)
        test = dict(
            program=get_key('program', raw, gconf, mandatory=True),
            name=get_key('name', raw, gconf, default=''),
            arguments=get_key('args', raw, gconf, default=[]),
            expected=expected,
            stdin=get_key('input', raw, gconf),
            timeout=get_key('timeout', raw, gconf, default=15),
            emptyenv=get_key('emptyenv', raw, gconf, default=False),
            env=get_key('env', raw, gconf),
            reference=get_key('ref', raw, gconf),
            type=get_key('type', raw, gconf)
        )
    except ValueError as e:
        raise
    return test

def get_key(key, raw, gconf, mandatory=False, default=None):
    if key in raw:
        return raw[key]
    elif key in gconf:
        return gconf[key]
    else:
        if mandatory is False:
            return default
        else:
            raise ValueError('Missing required key {0}'.format(key))


text:
namespace More.Windows.Controls
{
    using System;
    using System.Windows;

    /// <summary>
    /// Represents the base implementation for an input dialog.
    /// </summary>
    /// <typeparam name="T">The <see cref="Type">type</see> of response.</typeparam>
    public abstract class InputDialog<T> : MessageDialog
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="InputDialog{T}"/> class.
        /// </summary>
        protected InputDialog() => WindowStartupLocation = WindowStartupLocation.CenterScreen;

        /// <summary>
        /// Gets or sets the input dialog response.
        /// </summary>
        /// <value>The input dialog response.</value>
        public virtual T Response { get; protected internal set; }

        /// <summary>
        /// Gets or sets the input dialog default response.
        /// </summary>
        /// <value>The input dialog default response.</value>
        public virtual T DefaultResponse { get; set; }
    }
}


text:
package org.apache.distributedlog;

import static org.apache.distributedlog.LogRecord.MAX_LOGRECORDSET_SIZE;
import static org.apache.distributedlog.LogRecord.MAX_LOGRECORD_SIZE;
import static org.apache.distributedlog.LogRecordSet.COMPRESSED_SIZE_OFFSET;
import static org.apache.distributedlog.LogRecordSet.COUNT_OFFSET;
import static org.apache.distributedlog.LogRecordSet.DECOMPRESSED_SIZE_OFFSET;
import static org.apache.distributedlog.LogRecordSet.HEADER_LEN;
import static org.apache.distributedlog.LogRecordSet.METADATA_COMPRESSION_MASK;
import static org.apache.distributedlog.LogRecordSet.METADATA_OFFSET;
import static org.apache.distributedlog.LogRecordSet.METADATA_VERSION_MASK;
import static org.apache.distributedlog.LogRecordSet.VERSION;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.util.ReferenceCountUtil;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import lombok.extern.slf4j.Slf4j;
import org.apache.distributedlog.exceptions.LogRecordTooLongException;
import org.apache.distributedlog.exceptions.WriteException;
import org.apache.distributedlog.io.CompressionCodec;
import org.apache.distributedlog.io.CompressionCodec.Type;
import org.apache.distributedlog.io.CompressionUtils;

/**
 * {@link ByteBuf} based log record set writer.
 */
@Slf4j
class EnvelopedRecordSetWriter implements LogRecordSet.Writer {

    private final ByteBuf buffer;
    private final List<CompletableFuture<DLSN>> promiseList;
    private final CompressionCodec.Type codec;
    private final int metadata;
    private final int codecCode;
    private int count = 0;
    private ByteBuf recordSetBuffer = null;

    EnvelopedRecordSetWriter(int initialBufferSize,
                             CompressionCodec.Type codec) {
        this.buffer = PooledByteBufAllocator.DEFAULT.buffer(
                Math.max(initialBufferSize, HEADER_LEN),
                MAX_LOGRECORDSET_SIZE);
        this.promiseList = new LinkedList<CompletableFuture<DLSN>>();
        this.codec = codec;
        this.codecCode = codec.code();
        this.metadata = (VERSION & METADATA_VERSION_MASK) | (codecCode & METADATA_COMPRESSION_MASK);
        this.buffer.writeInt(metadata);
        this.buffer.writeInt(0); // count
        this.buffer.writeInt(0); // original len
        this.buffer.writeInt(0); // actual len
    }

    synchronized List<CompletableFuture<DLSN>> getPromiseList() {
        return promiseList;
    }

    @Override
    public synchronized void writeRecord(ByteBuffer record,
                                         CompletableFuture<DLSN> transmitPromise)
            throws LogRecordTooLongException, WriteException {
        int logRecordSize = record.remaining();
        if (logRecordSize > MAX_LOGRECORD_SIZE) {
            throw new LogRecordTooLongException(
                    "Log Record of size " + logRecordSize + " written when only "
                            + MAX_LOGRECORD_SIZE + " is allowed");
        }
        buffer.writeInt(logRecordSize);
        buffer.writeBytes(record);
        ++count;
        promiseList.add(transmitPromise);
    }

    private synchronized void satisfyPromises(long lssn, long entryId, long startSlotId) {
        long nextSlotId = startSlotId;
        for (CompletableFuture<DLSN> promise : promiseList) {
            promise.complete(new DLSN(lssn, entryId, nextSlotId));
            nextSlotId++;
        }
        promiseList.clear();
    }

    private synchronized void cancelPromises(Throwable reason) {
        for (CompletableFuture<DLSN> promise : promiseList) {
            promise.completeExceptionally(reason);
        }
        promiseList.clear();
    }

    @Override
    public int getNumBytes() {
        return buffer.readableBytes();
    }

    @Override
    public synchronized int getNumRecords() {
        return count;
    }

    @Override
    public synchronized ByteBuf getBuffer() {
        if (null == recordSetBuffer) {
            recordSetBuffer = createBuffer();
        }
        return recordSetBuffer.retainedSlice();
    }

    ByteBuf createBuffer() {
        int dataOffset = HEADER_LEN;
        int dataLen = buffer.readableBytes() - HEADER_LEN;

        if (Type.NONE.code() == codecCode) {
            // update count
            buffer.setInt(COUNT_OFFSET, count);
            // update data len
            buffer.setInt(DECOMPRESSED_SIZE_OFFSET, dataLen);
            buffer.setInt(COMPRESSED_SIZE_OFFSET, dataLen);
            return buffer.retain();
        }

        // compression

        CompressionCodec compressor =
                    CompressionUtils.getCompressionCodec(codec);
        ByteBuf uncompressedBuf = buffer.slice(dataOffset, dataLen);
        ByteBuf compressedBuf = compressor.compress(uncompressedBuf, HEADER_LEN);
        compressedBuf.setInt(METADATA_OFFSET, metadata);
        // update count
        compressedBuf.setInt(COUNT_OFFSET, count);
        // update data len
        compressedBuf.setInt(DECOMPRESSED_SIZE_OFFSET, dataLen);
        compressedBuf.setInt(COMPRESSED_SIZE_OFFSET, compressedBuf.readableBytes() - HEADER_LEN);

        return compressedBuf;
    }

    @Override
    public synchronized void completeTransmit(long lssn, long entryId, long startSlotId) {
        satisfyPromises(lssn, entryId, startSlotId);
        buffer.release();
        ReferenceCountUtil.release(recordSetBuffer);
    }

    @Override
    public synchronized void abortTransmit(Throwable reason) {
        cancelPromises(reason);
        buffer.release();
        ReferenceCountUtil.release(recordSetBuffer);
    }
}


text:
from django.conf.urls import url
from .views import TrackingView

urlpatterns = [
    url(r'^$', TrackingView.as_view(), name='tracker'),
]


text:
/**
 *
  Package: MAG - VistA Imaging
  WARNING: Per VHA Directive 2004-038, this routine should not be modified.
  Date Created: May 18, 2009
  Site Name:  Washington OI Field Office, Silver Spring, MD
  Developer:  vhaiswwerfej
  Description:

        ;; +--------------------------------------------------------------------+
        ;; Property of the US Government.
        ;; No permission to copy or redistribute this software is given.
        ;; Use of unreleased versions of this software requires the user
        ;;  to execute a written test agreement with the VistA Imaging
        ;;  Development Office of the Department of Veterans Affairs,
        ;;  telephone (301) 734-0100.
        ;;
        ;; The Food and Drug Administration classifies this software as
        ;; a Class II medical device.  As such, it may not be changed
        ;; in any way.  Modifications to this software may result in an
        ;; adulterated medical device under 21CFR820, the use of which
        ;; is considered to be a violation of US Federal Statutes.
        ;; +--------------------------------------------------------------------+

 */
package gov.va.med.imaging.exchange.enums;

/**
 * Indicates the properties of a Study which should be loaded from a data source.
 *
 *
 * @author vhaiswwerfej
 *
 */
public enum StudyLoadLevel
{
	STUDY_ONLY("Only load the study, no report or images", false, false),
	STUDY_AND_REPORT("Load the study and report, no images", true, false),
	FULL("Fully load the study including the radiology report and the series and images", true, true),
	STUDY_AND_IMAGES("Load the study and the images, no report", false, true);

	final String description;
	final boolean includeReport;
	final boolean includeImages;

	StudyLoadLevel(String description, boolean includeReport, boolean includeImages)
	{
		this.description = description;
		this.includeImages = includeImages;
		this.includeReport = includeReport;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @return the includeReport
	 */
	public boolean isIncludeReport() {
		return includeReport;
	}

	/**
	 * @return the includeImages
	 */
	public boolean isIncludeImages() {
		return includeImages;
	}

	public boolean isFullyLoaded()
	{
		return includeImages && includeReport;
	}

	/**
	 * Updates the study load level to include the report (if not already included). Has no impact on images
	 */
	public static StudyLoadLevel promoteWithReport(StudyLoadLevel studyLoadLevel)
	{
		// if report already included, do nothing
		if(studyLoadLevel.includeReport)
			return studyLoadLevel;
		if(studyLoadLevel == StudyLoadLevel.STUDY_ONLY)
			return StudyLoadLevel.STUDY_AND_REPORT;
		if(studyLoadLevel == StudyLoadLevel.STUDY_AND_IMAGES)
			return StudyLoadLevel.FULL;

		// shouldn't be here but just in case
		return studyLoadLevel;
	}

	/**
	 * Updates the study load level to include the images (if not already included). Has no impact on the report
	 */
	public static StudyLoadLevel promoteWithImages(StudyLoadLevel studyLoadLevel)
	{
		// if report already included, do nothing
		if(studyLoadLevel.includeImages)
			return studyLoadLevel;
		if(studyLoadLevel == StudyLoadLevel.STUDY_ONLY)
			return StudyLoadLevel.STUDY_AND_IMAGES;
		if(studyLoadLevel == StudyLoadLevel.STUDY_AND_REPORT)
			return StudyLoadLevel.FULL;

		// shouldn't be here but just in case
		return studyLoadLevel;
	}
}


text:
require 'active_support/refinements/core_ext/date/acts_like'
require 'active_support/refinements/core_ext/date/calculations'
require 'active_support/refinements/core_ext/date/conversions'
require 'active_support/refinements/core_ext/date/zones'


text:
> Weakmapped error event with a global capture hook

## Install

```
$ npm install --save weak-error
```

## Usage

```js
var WeakError = require('weak-error')
var ErrorEvent = WeakError()
var obj = {}

// listen on only errors broadcasted on `obj`
ErrorEvent.listen(obj, onError)
// listen to all errors
WeakError.onError(onError)

ErrorEvent.broadcast({}, new Error('OH NO'))
//=> OH NO
//=> OH NO

function onError (err.message) {
  console.log(err.message)
}
```

## API

#### `WeakError()` -> `event`

Constructs a [`weakmap-event`](https://github.com/eaze/weakmap-event). The event will work normally, but you can also listen on events globally.

#### `WeakError.onError(listener)` -> `function`

Listen globally on errors. Returns an unlisten function.

##### listener

*Required*
Type: `function`

A listener to call whenever any error is broadcasted, regardless of the key used.

## License

MIT © [Ben Drucker](http://bendrucker.me)


text:
package edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.editor;

import java.io.IOException;

import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.PlatformUI;

import edu.kit.ipd.sdq.kamp.architecture.AbstractArchitectureVersionPersistency;
import edu.kit.ipd.sdq.kamp.model.modificationmarks.AbstractModificationRepository;
import edu.kit.ipd.sdq.kamp.model.modificationmarks.editor.AbstractChangePropagationAction;
import edu.kit.ipd.sdq.kamp.propagation.AbstractChangePropagationAnalysis;
import edu.kit.ipd.sdq.kamp.ui.AbstractDeriveWorkplanAction;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersion;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersionPersistency;
import edu.kit.ipd.sdq.kamp4aps.core.APSChangePropagationAnalysis;

public class ChangePropagationAction extends AbstractChangePropagationAction<APSArchitectureVersion> {

	private ISelection selection;

	@Override
	protected AbstractChangePropagationAnalysis<APSArchitectureVersion> createChangePropagationAnalysis() {
		return new APSChangePropagationAnalysis();
	}

	@Override
	protected AbstractArchitectureVersionPersistency<APSArchitectureVersion> createArchitectureVersionPersistency() {
		return new APSArchitectureVersionPersistency();
	}

	@Override
	public void run(IAction action) {

		PlatformUI.getWorkbench().saveAllEditors(false);
		AbstractArchitectureVersionPersistency<APSArchitectureVersion> architectureVersionPersistency = this.createArchitectureVersionPersistency();

		Object selectedElement = null;
		if (selection instanceof IStructuredSelection) {
			if (((IStructuredSelection)selection).size()==1) {
				selectedElement = ((IStructuredSelection)selection).getFirstElement();
			}
		}

		if (selectedElement != null) {
			if (selectedElement instanceof AbstractModificationRepository) {
				URI resourceURI = ((AbstractModificationRepository<?,?>)selectedElement).eResource().getURI();
				String fileName = resourceURI.trimFileExtension().lastSegment();
				String folderPathString = resourceURI.trimSegments(1).toPlatformString(false);
				IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(folderPathString));

				APSArchitectureVersion targetversion = null;
				if (folderPathString != null) {
					targetversion = ((APSArchitectureVersionPersistency) architectureVersionPersistency).load(folder, "target");
				}

				if (targetversion != null) {
					//Clear results of previous run and start new run
					targetversion.getModificationMarkRepository().getChangePropagationSteps().clear();
					this.createChangePropagationAnalysis().runChangePropagationAnalysis(targetversion);
					try {
						architectureVersionPersistency.saveModificationMarkFile(folderPathString, fileName, targetversion);
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				}

				if (!targetversion.getModificationMarkRepository().getChangePropagationSteps().isEmpty()) {
					AbstractDeriveWorkplanAction.showMessage("Propagation steps have been added to the tree.");
				} else {
					AbstractDeriveWorkplanAction.showMessage("No propagation steps could be found.");
				}

				PlatformUI.getWorkbench().saveAllEditors(false);
			}
		}
	}

	@Override
	public void selectionChanged(IAction action, ISelection selection) {
		this.selection = selection;
	}

}


text:
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;

namespace Multitouch.Framework.WPF.Native
{
	static class NativeMethods
	{
		/// <summary>
		/// Wrapper around the Winapi POINT type.
		/// </summary>
		[StructLayout(LayoutKind.Sequential)]
		public struct POINT
		{
			/// <summary>
			/// The X Coordinate.
			/// </summary>
			public int X;

			/// <summary>
			/// The Y Coordinate.
			/// </summary>
			public int Y;

			/// <summary>
			/// Creates a new POINT.
			/// </summary>
			/// <param name="x"></param>
			/// <param name="y"></param>
			public POINT(int x, int y)
			{
				this.X = x;
				this.Y = y;
			}

			/// <summary>
			/// Implicit cast.
			/// </summary>
			/// <returns></returns>
			public static implicit operator Point(POINT p)
			{
				return new Point(p.X, p.Y);
			}

			/// <summary>
			/// Implicit cast.
			/// </summary>
			/// <returns></returns>
			public static implicit operator POINT(Point p)
			{
				return new POINT((int)p.X, (int)p.Y);
			}
		}

		[DllImport("user32.dll")]
		private static extern IntPtr WindowFromPoint(POINT Point);

		public static DependencyObject GetWindowAt(Point point)
		{
			DependencyObject reference = null;

			POINT p = point;
			IntPtr hwnd = WindowFromPoint(p);
			HwndSource hwndSource = HwndSource.FromHwnd(hwnd);
			Visual rootVisual = hwndSource.RootVisual;
			HitTestResult result = VisualTreeHelper.HitTest(rootVisual, point);
			if (result != null)
				reference = result.VisualHit;
			return reference;
		}

		[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
		public static extern int GetSystemMetrics(int nIndex);

		[DllImport("user32.dll")]
		public static extern IntPtr GetMessageExtraInfo();
	}
}


text:
package indexfakes

import (
	"sync"

	"github.com/cloudfoundry/bosh-cli/releasedir/index"
)

type FakeIndex struct {
	FindStub        func(name, version string) (string, string, error)
	findMutex       sync.RWMutex
	findArgsForCall []struct {
		name    string
		version string
	}
	findReturns struct {
		result1 string
		result2 string
		result3 error
	}
	AddStub        func(name, version, path, sha1 string) (string, string, error)
	addMutex       sync.RWMutex
	addArgsForCall []struct {
		name    string
		version string
		path    string
		sha1    string
	}
	addReturns struct {
		result1 string
		result2 string
		result3 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeIndex) Find(name string, version string) (string, string, error) {
	fake.findMutex.Lock()
	fake.findArgsForCall = append(fake.findArgsForCall, struct {
		name    string
		version string
	}{name, version})
	fake.recordInvocation("Find", []interface{}{name, version})
	fake.findMutex.Unlock()
	if fake.FindStub != nil {
		return fake.FindStub(name, version)
	} else {
		return fake.findReturns.result1, fake.findReturns.result2, fake.findReturns.result3
	}
}

func (fake *FakeIndex) FindCallCount() int {
	fake.findMutex.RLock()
	defer fake.findMutex.RUnlock()
	return len(fake.findArgsForCall)
}

func (fake *FakeIndex) FindArgsForCall(i int) (string, string) {
	fake.findMutex.RLock()
	defer fake.findMutex.RUnlock()
	return fake.findArgsForCall[i].name, fake.findArgsForCall[i].version
}

func (fake *FakeIndex) FindReturns(result1 string, result2 string, result3 error) {
	fake.FindStub = nil
	fake.findReturns = struct {
		result1 string
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeIndex) Add(name string, version string, path string, sha1 string) (string, string, error) {
	fake.addMutex.Lock()
	fake.addArgsForCall = append(fake.addArgsForCall, struct {
		name    string
		version string
		path    string
		sha1    string
	}{name, version, path, sha1})
	fake.recordInvocation("Add", []interface{}{name, version, path, sha1})
	fake.addMutex.Unlock()
	if fake.AddStub != nil {
		return fake.AddStub(name, version, path, sha1)
	} else {
		return fake.addReturns.result1, fake.addReturns.result2, fake.addReturns.result3
	}
}

func (fake *FakeIndex) AddCallCount() int {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return len(fake.addArgsForCall)
}

func (fake *FakeIndex) AddArgsForCall(i int) (string, string, string, string) {
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return fake.addArgsForCall[i].name, fake.addArgsForCall[i].version, fake.addArgsForCall[i].path, fake.addArgsForCall[i].sha1
}

func (fake *FakeIndex) AddReturns(result1 string, result2 string, result3 error) {
	fake.AddStub = nil
	fake.addReturns = struct {
		result1 string
		result2 string
		result3 error
	}{result1, result2, result3}
}

func (fake *FakeIndex) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.findMutex.RLock()
	defer fake.findMutex.RUnlock()
	fake.addMutex.RLock()
	defer fake.addMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeIndex) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ index.Index = new(FakeIndex)


text:
<?php

namespace Banana\BodyBuilder;

/**
 * Abstract class WidgetsGroupAbstract
 *
 * @package Banana\BodyBuilder
 * @author  Vasily Oksak <voksak@gmail.com>
 */
abstract class WidgetsGroupAbstract extends WidgetAbstract
{

    /** @var WidgetInterface[] */
    protected $widgets = [];

    /**
     * @param string $position
     * @param WidgetInterface $widget
     *
     * @return $this
     */
    public function addWidget($position, WidgetInterface $widget)
    {
        $this->widgets[$position] = $widget;
        $widget->setContext($this->getContext())
            ->setAssets($this->getAssets())
            ->setElementsFactory($this->getElementsFactory());
        return $this;
    }

    /**
     * @param string $position
     *
     * @return WidgetInterface|null
     */
    public function getWidget($position)
    {
        if ($this->hasWidget($position)) {
            return $this->widgets[(string)$position];
        }
        return null;
    }

    /**
     * @param string $position
     *
     * @return bool
     */
    public function hasWidget($position)
    {
        return isset($this->widgets[(string)$position]);
    }

    /**
     * @param \Banana\BodyBuilder\Rendering\Structure\LayoutInterface $layout
     *
     * @return void
     */
    protected function buildLayout(Rendering\Structure\LayoutInterface $layout)
    {
        parent::buildLayout($layout);
        foreach ($this->getWidgets() as $position => $widget) {
            $layout->includeLayout($position, $widget->getLayout());
        }
    }

    /**
     * @return WidgetInterface[]
     */
    public function getWidgets()
    {
        return $this->widgets;
    }

}


text:
package com.jamesgoodwin.foursquareclient;

import android.support.v7.widget.AppCompatRatingBar;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.jamesgoodwin.R;
import com.jamesgoodwin.foursquareclient.model.Venue;

class VenueViewHolder extends RecyclerView.ViewHolder implements VenueView {

    private final TextView venueNameText;
    private final TextView descriptionText;
    private final AppCompatRatingBar ratingBar;

    private final VenuePresenter venuePresenter;

    VenueViewHolder(View itemView, VenuePresenter venuePresenter) {
        super(itemView);
        this.venueNameText = (TextView) itemView.findViewById(R.id.venueNameText);
        this.descriptionText = (TextView) itemView.findViewById(R.id.descriptionText);
        this.ratingBar = (AppCompatRatingBar) itemView.findViewById(R.id.ratingBar);
        this.venuePresenter = venuePresenter;
    }

    void setVenue(Venue venue) {
        venuePresenter.showVenue(venue, this);
    }

    @Override
    public void showRating(float rating) {
        this.ratingBar.setRating(rating);
    }

    @Override
    public void showVenueName(String venueName) {
        this.venueNameText.setText(venueName);
    }

    @Override
    public void showVenueAddress(String address) {
        this.descriptionText.setText(address);
    }

}