text:
'use strict';

/* global ngTouch: false,
  nodeName_: false
*/

/**
 * @ngdoc directive
 * @name ngClick
 * @deprecated
 * sinceVersion="v1.5.0"
 * This directive is deprecated and **disabled** by default.
 * The directive will receive no further support and might be removed from future releases.
 * If you need the directive, you can enable it with the {@link ngTouch.$touchProvider $touchProvider#ngClickOverrideEnabled}
 * function. We also recommend that you migrate to [FastClick](https://github.com/ftlabs/fastclick).
 * To learn more about the 300ms delay, this [Telerik article](http://developer.telerik.com/featured/300-ms-click-delay-ios-8/)
 * gives a good overview.
 *
 * @description
 * A more powerful replacement for the default ngClick designed to be used on touchscreen
 * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending
 * the click event. This version handles them immediately, and then prevents the
 * following click event from propagating.
 *
 * Requires the {@link ngTouch `ngTouch`} module to be installed.
 *
 * This directive can fall back to using an ordinary click event, and so works on desktop
 * browsers as well as mobile.
 *
 * This directive also sets the CSS class `ng-click-active` while the element is being held
 * down (by a mouse click or touch) so you can restyle the depressed element if you wish.
 *
 * @element ANY
 * @param {expression} ngClick {@link guide/expression Expression} to evaluate
 * upon tap. (Event object is available as `$event`)
 *
 * @example
    <example module="ngClickExample" deps="angular-touch.js" name="ng-touch-ng-click">
      <file name="index.html">
        <button ng-click="count = count + 1" ng-init="count=0">
          Increment
        </button>
        count: {{ count }}
      </file>
      <file name="script.js">
        angular.module('ngClickExample', ['ngTouch']);
      </file>
    </example>
 */

var ngTouchClickDirectiveFactory = ['$parse', '$timeout', '$rootElement',
    function($parse, $timeout, $rootElement) {
  var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.
  var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.
  var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click
  var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks.

  var ACTIVE_CLASS_NAME = 'ng-click-active';
  var lastPreventedTime;
  var touchCoordinates;
  var lastLabelClickCoordinates;

  // TAP EVENTS AND GHOST CLICKS
  //
  // Why tap events?
  // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're
  // double-tapping, and then fire a click event.
  //
  // This delay sucks and makes mobile apps feel unresponsive.
  // So we detect touchstart, touchcancel and touchend ourselves and determine when
  // the user has tapped on something.
  //
  // What happens when the browser then generates a click event?
  // The browser, of course, also detects the tap and fires a click after a delay. This results in
  // tapping/clicking twice. We do "clickbusting" to prevent it.
  //
  // How does it work?
  // We attach global touchstart and click handlers, that run during the capture (early) phase.
  // So the sequence for a tap is:
  // - global touchstart: Sets an "allowable region" at the point touched.
  // - element's touchstart: Starts a touch
  // (- touchcancel ends the touch, no click follows)
  // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold
  //   too long) and fires the user's tap handler. The touchend also calls preventGhostClick().
  // - preventGhostClick() removes the allowable region the global touchstart created.
  // - The browser generates a click event.
  // - The global click handler catches the click, and checks whether it was in an allowable region.
  //     - If preventGhostClick was called, the region will have been removed, the click is busted.
  //     - If the region is still there, the click proceeds normally. Therefore clicks on links and
  //       other elements without ngTap on them work normally.
  //
  // This is an ugly, terrible hack!
  // Yeah, tell me about it. The alternatives are using the slow click events, or making our users
  // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular
  // encapsulates this ugly logic away from the user.
  //
  // Why not just put click handlers on the element?
  // We do that too, just to be sure. If the tap event caused the DOM to change,
  // it is possible another element is now in that position. To take account for these possibly
  // distinct elements, the handlers are global and care only about coordinates.

  // Checks if the coordinates are close enough to be within the region.
  function hit(x1, y1, x2, y2) {
    return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;
  }

  // Checks a list of allowable regions against a click location.
  // Returns true if the click should be allowed.
  // Splices out the allowable region from the list after it has been used.
  function checkAllowableRegions(touchCoordinates, x, y) {
    for (var i = 0; i < touchCoordinates.length; i += 2) {
      if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {
        touchCoordinates.splice(i, i + 2);
        return true; // allowable region
      }
    }
    return false; // No allowable region; bust it.
  }

  // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick
  // was called recently.
  function onClick(event) {
    if (Date.now() - lastPreventedTime > PREVENT_DURATION) {
      return; // Too old.
    }

    var touches = event.touches && event.touches.length ? event.touches : [event];
    var x = touches[0].clientX;
    var y = touches[0].clientY;
    // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label
    // and on the input element). Depending on the exact browser, this second click we don't want
    // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label
    // click event
    if (x < 1 && y < 1) {
      return; // offscreen
    }
    if (lastLabelClickCoordinates &&
        lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {
      return; // input click triggered by label click
    }
    // reset label click coordinates on first subsequent click
    if (lastLabelClickCoordinates) {
      lastLabelClickCoordinates = null;
    }
    // remember label click coordinates to prevent click busting of trigger click event on input
    if (nodeName_(event.target) === 'label') {
      lastLabelClickCoordinates = [x, y];
    }

    // Look for an allowable region containing this click.
    // If we find one, that means it was created by touchstart and not removed by
    // preventGhostClick, so we don't bust it.
    if (checkAllowableRegions(touchCoordinates, x, y)) {
      return;
    }

    // If we didn't find an allowable region, bust the click.
    event.stopPropagation();
    event.preventDefault();

    // Blur focused form elements
    if (event.target && event.target.blur) {
      event.target.blur();
    }
  }

  // Global touchstart handler that creates an allowable region for a click event.
  // This allowable region can be removed by preventGhostClick if we want to bust it.
  function onTouchStart(event) {
    var touches = event.touches && event.touches.length ? event.touches : [event];
    var x = touches[0].clientX;
    var y = touches[0].clientY;
    touchCoordinates.push(x, y);

    $timeout(function() {
      // Remove the allowable region.
      for (var i = 0; i < touchCoordinates.length; i += 2) {
        if (touchCoordinates[i] === x && touchCoordinates[i + 1] === y) {
          touchCoordinates.splice(i, i + 2);
          return;
        }
      }
    }, PREVENT_DURATION, false);
  }

  // On the first call, attaches some event handlers. Then whenever it gets called, it creates a
  // zone around the touchstart where clicks will get busted.
  function preventGhostClick(x, y) {
    if (!touchCoordinates) {
      $rootElement[0].addEventListener('click', onClick, true);
      $rootElement[0].addEventListener('touchstart', onTouchStart, true);
      touchCoordinates = [];
    }

    lastPreventedTime = Date.now();

    checkAllowableRegions(touchCoordinates, x, y);
  }

  // Actual linking function.
  return function(scope, element, attr) {
    var clickHandler = $parse(attr.ngClick),
        tapping = false,
        tapElement,  // Used to blur the element after a tap.
        startTime,   // Used to check if the tap was held too long.
        touchStartX,
        touchStartY;

    function resetState() {
      tapping = false;
      element.removeClass(ACTIVE_CLASS_NAME);
    }

    element.on('touchstart', function(event) {
      tapping = true;
      tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement.
      // Hack for Safari, which can target text nodes instead of containers.
      if (tapElement.nodeType === 3) {
        tapElement = tapElement.parentNode;
      }

      element.addClass(ACTIVE_CLASS_NAME);

      startTime = Date.now();

      // Use jQuery originalEvent
      var originalEvent = event.originalEvent || event;
      var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent];
      var e = touches[0];
      touchStartX = e.clientX;
      touchStartY = e.clientY;
    });

    element.on('touchcancel', function(event) {
      resetState();
    });

    element.on('touchend', function(event) {
      var diff = Date.now() - startTime;

      // Use jQuery originalEvent
      var originalEvent = event.originalEvent || event;
      var touches = (originalEvent.changedTouches && originalEvent.changedTouches.length) ?
          originalEvent.changedTouches :
          ((originalEvent.touches && originalEvent.touches.length) ? originalEvent.touches : [originalEvent]);
      var e = touches[0];
      var x = e.clientX;
      var y = e.clientY;
      var dist = Math.sqrt(Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2));

      if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) {
        // Call preventGhostClick so the clickbuster will catch the corresponding click.
        preventGhostClick(x, y);

        // Blur the focused element (the button, probably) before firing the callback.
        // This doesn't work perfectly on Android Chrome, but seems to work elsewhere.
        // I couldn't get anything to work reliably on Android Chrome.
        if (tapElement) {
          tapElement.blur();
        }

        if (!angular.isDefined(attr.disabled) || attr.disabled === false) {
          element.triggerHandler('click', [event]);
        }
      }

      resetState();
    });

    // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click
    // something else nearby.
    element.onclick = function(event) { };

    // Actual click handler.
    // There are three different kinds of clicks, only two of which reach this point.
    // - On desktop browsers without touch events, their clicks will always come here.
    // - On mobile browsers, the simulated "fast" click will call this.
    // - But the browser's follow-up slow click will be "busted" before it reaches this handler.
    // Therefore it's safe to use this directive on both mobile and desktop.
    element.on('click', function(event, touchend) {
      scope.$apply(function() {
        clickHandler(scope, {$event: (touchend || event)});
      });
    });

    element.on('mousedown', function(event) {
      element.addClass(ACTIVE_CLASS_NAME);
    });

    element.on('mousemove mouseup', function(event) {
      element.removeClass(ACTIVE_CLASS_NAME);
    });

  };
}];


text:
Kathy.UI.Input = {

    history: [],

    init: function init() {
        this.bind_events()
    },

    bind_events: function bind_events() {
        var self = this
        this.live('keyup', function(e) {
            self.send_on_enter.call(self, e)
            self.auto_resize.call(self, e)
        })
        return this
    },

    send_on_enter: function send_on_enter(event) {
        var self = Kathy.UI.input
        if (event.which == Kathy.Util.keys.ENTER)
            self.send_message.call(this, event, self)

        else if (event.which == Kathy.Util.keys.UP)
            self.history_up.call(this, self)

        else if (event.which == Kathy.Util.keys.DOWN)
            self.history_down.call(this, self)

        else
            self.buffer = self.val()
    },

    send_message: function send_message(event, self) {
        var message = this.val()
        self.history.push(message.trim())
        self.history_count = 0
        self.buffer = ""

        Kathy.Client.send(message.trim())
        this.val("")
    },

    history_up: function history_up(self) {
        if (self.history_count == self.history.length) return
        var index = (self.history.length - (++self.history_count))
        this.val(self.history[index])
    },

    history_down: function history_down(self) {
        if (self.history_count == 0) {
            this.val(self.buffer)
            return
        }

        var index = (self.history.length - (--self.history_count))
        this.val(self.history[index])
    },

    auto_resize: function auto_resize(event) {
        Kathy.UI.shadow.text(this.val())
        this.height(Kathy.UI.shadow.height())
        Kathy.UI.chatlog.height(Kathy.UI.sizes.chatlog_input - this.height())
    }
}

redpajama_set_name: RedPajamaGithub


text:
1. [Raspberry Pi: Run ASP.NET Core on Startup](https://carlos.mendible.com/2017/03/26/raspberry-pi-run-aspnet-core-on-startup/)
1. [Using React, Redux and Webpack with Dotnet Core to build a modern web frontend](https://medium.com/@MaartenSikkema/using-react-redux-and-webpack-with-dotnet-core-to-build-a-modern-web-frontend-7e2d091b3ba)
1. [ASP.NET Core SynchronizationContext](http://blog.stephencleary.com/2017/03/aspnetcore-synchronization-context.html)

## Tooling & Libraries

1. [Report from the battlefield #10 - fuck-up with AutoMapper](http://www.michalkomorowski.com/2017/03/report-from-battlefield-10-fuck-up-with.html)
1. [Open sourcing the MSTest Test Framework](https://blogs.msdn.microsoft.com/bharry/2017/03/28/open-sourcing-the-mstest-test-framework/)
1. [DevExtreme - Real World Patterns - Orchestrating Microservices](https://community.devexpress.com/blogs/oliver/archive/2017/03/28/devextreme-real-world-patterns-orchestrating-microservices.aspx)
1. [Shutting down CodePlex](https://blogs.msdn.microsoft.com/bharry/2017/03/31/shutting-down-codeplex/)

## Architecture & Databases

1. [SOLID Is OOP for Dummies](http://www.yegor256.com/2017/03/28/solid.html)
1. [Building Better Entity Framework Applications](https://www.simple-talk.com/dotnet/net-development/building-better-entity-framework-applications/)
1. [SQL Server On Linux: Core-minidumps and Breakpad](https://blogs.msdn.microsoft.com/bobsql/2017/03/27/sql-server-on-linux-core-minidumps-and-breakpad/)
1. [Want unlimited scale and performance? This is where to start](https://indexoutofrange.com/Want-unlimited-scale-and-performanceThis-is-where-to-start/)
1. [A reusable ApiController Adapter](http://blog.ploeh.dk/2017/03/30/a-reusable-apicontroller-adapter/)

## Programming Languages

1. [TypeScript's New Release Cadence](https://blogs.msdn.microsoft.com/typescript/2017/03/27/typescripts-new-release-cadence/)
1. [Why I hate Roslyn](http://www.michalkomorowski.com/2017/03/why-i-hate-roslyn.html)
1. [Building a security testing service with F# - William Blum](https://www.youtube.com/watch?v=ZVvcWIjbbhk&feature=youtu.be)
1. [A Comprehensive Look at F# 4.1](https://www.infoq.com/articles/FSharp-4.1)

## Runtime

1. [Tiered Compilation step 1](https://github.com/dotnet/coreclr/pull/10478)
1. [Advanced GC Internals Documentation](https://github.com/dotnet/coreclr/issues/10529)
1. [The .NET IL Interpreter](http://mattwarren.org/2017/03/30/The-.NET-IL-Interpreter/)
1. [Tracing Runtime Events in .NET Core on Linux](http://blogs.microsoft.co.il/sasha/2017/03/30/tracing-runtime-events-in-net-core-on-linux/)

## Other

1. [Gravitational Wave Kicks Monster Black Hole Out of Galactic Core](https://www.nasa.gov/feature/goddard/2017/gravitational-wave-kicks-monster-black-hole-out-of-galactic-core)
1. [ThoughtWorks Technology Radar Vol. 16](https://www.thoughtworks.com/radar)
1. [Studio Ghibli API (v1.0.1)](https://ghibliapi.herokuapp.com/#)


text:
class VolumeMappingController < ApplicationController
  include Mixins::GenericListMixin
  include Mixins::GenericShowMixin
  include Mixins::GenericSessionMixin
  include Mixins::BreadcrumbsMixin
  include Mixins::GenericFormMixin
  include Mixins::GenericButtonMixin

  before_action :check_privileges
  before_action :get_session_data
  after_action :cleanup_action
  after_action :set_session_data

  def new
    assert_privileges("volume_mapping_new")

    @in_a_form = true
    if params[:storage_manager_id]
      @storage_manager = find_record_with_rbac(ExtManagementSystem, params[:storage_manager_id])
    end
    drop_breadcrumb(:name => _("Define New %{table}") % {:table => ui_lookup(:table => table_name)},
                    :url  => "/#{controller_name}/new")
  end

  def show
    if params[:id].nil?
      @breadcrumbs.clear
    end
    super
  end

  private

  def textual_group_list
    [%i[properties], %i[tags]]
  end
  helper_method :textual_group_list

  def set_session_data
    session[:layout] = @layout
  end

  def breadcrumbs_options
    {
      :breadcrumbs => [
        {:title => _("Storage")},
        {:title => _("Volume Mappings"), :url => controller_url},
      ],
    }
  end

  menu_section "volume_mapping"

  feature_for_actions "#{controller_name}_show_list", *ADV_SEARCH_ACTIONS
  feature_for_actions "#{controller_name}_show_list", :download_data
  feature_for_actions "#{controller_name}_show", :download_summary_pdf

  toolbar :volume_mapping, :volume_mappings

  def specific_buttons(pressed)
    case pressed
    when 'volume_mapping_new'
      javascript_redirect(:action => 'new')
    else
      return false
    end
    true
  end
end


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.03.23 at 01:49:06 PM CET
//

package org.sdmx.resources.sdmxml.schemas.v2_0.structure;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * MetadataStructureDefinitionsType describes one or more metadata structure definitions.
 *
 *
Java class for MetadataStructureDefinitionsType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="MetadataStructureDefinitionsType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="MetadataStructureDefinition" type="{http://www.SDMX.org/resources/SDMXML/schemas/v2_0/structure}MetadataStructureDefinitionType" maxOccurs="unbounded"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MetadataStructureDefinitionsType", propOrder = {
    "metadataStructureDefinition"
})
public class MetadataStructureDefinitionsType {

    @XmlElement(name = "MetadataStructureDefinition", required = true)
    protected List<MetadataStructureDefinitionType> metadataStructureDefinition;

    /**
     * Gets the value of the metadataStructureDefinition property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the metadataStructureDefinition property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getMetadataStructureDefinition().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link MetadataStructureDefinitionType }
     *
     *
     */
    public List<MetadataStructureDefinitionType> getMetadataStructureDefinition() {
        if (metadataStructureDefinition == null) {
            metadataStructureDefinition = new ArrayList<MetadataStructureDefinitionType>();
        }
        return this.metadataStructureDefinition;
    }

}


text:
<?php

$regionIds = array("cn-hangzhou","cn-beijing","cn-qingdao","cn-hongkong","cn-shanghai","us-west-1","cn-shenzhen","ap-southeast-1");
$productDomains =array(
	new ProductDomain("ROS", "ros.aliyuncs.com"),
	new ProductDomain("Dm", "dm.aliyuncs.com"),
	new ProductDomain("Bss", "bss.aliyuncs.com"),
	new ProductDomain("Ecs", "ecs.aliyuncs.com"),
	new ProductDomain("Oms", "oms.aliyuncs.com"),
	new ProductDomain("Rds", "rds.aliyuncs.com"),
	new ProductDomain("BatchCompute", "batchCompute.aliyuncs.com"),
	new ProductDomain("Slb", "slb.aliyuncs.com"),
	new ProductDomain("Oss", "oss-cn-hangzhou.aliyuncs.com"),
	new ProductDomain("OssAdmin", "oss-admin.aliyuncs.com"),
	new ProductDomain("Sts", "sts.aliyuncs.com"),
	new ProductDomain("Yundun", "yundun-cn-hangzhou.aliyuncs.com"),
	new ProductDomain("Risk", "risk-cn-hangzhou.aliyuncs.com"),
	new ProductDomain("Drds", "drds.aliyuncs.com"),
	new ProductDomain("M-kvstore", "m-kvstore.aliyuncs.com"),
	new ProductDomain("Ram", "ram.aliyuncs.com"),
	new ProductDomain("Cms", "metrics.aliyuncs.com"),
	new ProductDomain("Crm", "crm-cn-hangzhou.aliyuncs.com"),
	new ProductDomain("Ocs", "pop-ocs.aliyuncs.com"),
	new ProductDomain("Ots", "ots-pop.aliyuncs.com"),
	new ProductDomain("Dqs", "dqs.aliyuncs.com"),
	new ProductDomain("Location", "location.aliyuncs.com"),
	new ProductDomain("Ubsms", "ubsms.aliyuncs.com"),
	new ProductDomain("Drc", "drc.aliyuncs.com"),
	new ProductDomain("Ons", "ons.aliyuncs.com"),
	new ProductDomain("Aas", "aas.aliyuncs.com"),
	new ProductDomain("Ace", "ace.cn-hangzhou.aliyuncs.com"),
	new ProductDomain("Dts", "dts.aliyuncs.com"),
	new ProductDomain("R-kvstore", "r-kvstore-cn-hangzhou.aliyuncs.com"),
	new ProductDomain("PTS", "pts.aliyuncs.com"),
	new ProductDomain("Alert", "alert.aliyuncs.com"),
	new ProductDomain("Push", "cloudpush.aliyuncs.com"),
	new ProductDomain("Emr", "emr.aliyuncs.com"),
	new ProductDomain("Cdn", "cdn.aliyuncs.com"),
	new ProductDomain("COS", "cos.aliyuncs.com"),
	new ProductDomain("CF", "cf.aliyuncs.com"),
	new ProductDomain("Ess", "ess.aliyuncs.com")
	);
$endpoint = new Endpoint("cn-hangzhou", $regionIds, $productDomains);
$endpoints = array($endpoint);
EndpointProvider::setEndpoints($endpoints);


text:
Events in Altair
===

The event system in Altair is a tad more powerful than any event system you're used to. That is because this version
is backed by [underscore-query](https://github.com/davidgtonge/underscore-query). This powerful query engine gives us
the ability to trigger event listeners selectively.

    /**
     * Altair has 2 ways to set listeners, the chain'able way is .on(eventName, query).then(...
     */
    this.on('altair:Jarvis::DID_GESTURE', { 'gesture.type': 'the-force' }).then(function (e) {

        //the device that triggered the gesture
        var device = e.get('device');

    });

    /**
     * The normal normal way is on(eventName, callback, query)
     */
    this.on('altair:Jarvis::DID_GESTURE', function (e) {

        //the device that triggered the gesture
        var device = e.get('device');

    }, { 'gesture.type': 'the-force' });

The examples above are powerful because it shows how to hook into any device that could possibly emit "the-force" gesture.
To see all the ways you can query, use the link to underscore-query above (Note: ignore the chain'able API, you will not
be writing much code for event listeners, you will be setting them up inside your config/listeners.json.

Using the Emitter
==

The Emitter is a simple mixin that will give your component all the pieces it needs to be a 1st class event dispatching
citizen.


text:
package com.yrg.ecokitchen.cards;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yrg.ecokitchen.R;
import com.yrg.ecokitchen.models.Institutions;

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

public class RecyclerAdapter extends RecyclerView.Adapter<CardHolder> {

    private List<Institutions> institutions;
    private RecyclerClickListener listener;

    public RecyclerAdapter(List<Institutions> palettes, RecyclerClickListener cl) {
        this.listener = cl;
        this.institutions = new ArrayList<>();
        this.institutions.addAll(palettes);
    }

    @Override
    public CardHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View item = LayoutInflater.
                from(viewGroup.getContext()).
                inflate(R.layout.institution_card, viewGroup, false);

        return new CardHolder(item, listener);
    }

    @Override
    public void onBindViewHolder(CardHolder cardHolder, int i) {
        Institutions institution = institutions.get(i);
        cardHolder.name.setText(institution.getName());
        cardHolder.address.setText(institution.getAddress());
        cardHolder.image.setImageResource(R.drawable.card_default);
    }

    @Override
    public int getItemCount() {
        return institutions.size();
    }

    public void updateList(List<Institutions> newlist) {
        institutions.clear();
        institutions.addAll(newlist);
        this.notifyDataSetChanged();
    }
}


text:
package com.intellij.openapi.localVcs;

public interface UpToDateLineNumberProvider {
  int ABSENT_LINE_NUMBER = -1;

  int getLineNumber(int currentNumber);
}


text:
package internal

import (
	"bytes"
	"io"
	"os"
	"time"
)

const BAILOUT_TIME = 1 * time.Second
const BAILOUT_MESSAGE = `Ginkgo detected an issue while intercepting output.

When running in parallel, Ginkgo captures stdout and stderr output
and attaches it to the running spec.  It looks like that process is getting
stuck for this suite.

This usually happens if you, or a library you are using, spin up an external
process and set cmd.Stdout = os.Stdout and/or cmd.Stderr = os.Stderr.  This
causes the external process to keep Ginkgo's output interceptor pipe open and
causes output interception to hang.

Ginkgo has detected this and shortcircuited the capture process.  The specs
will continue running after this message however output from the external
process that caused this issue will not be captured.

You have several options to fix this.  In preferred order they are:

1. Pass GinkgoWriter instead of os.Stdout or os.Stderr to your process.
2. Ensure your process exits before the current spec completes.  If your
process is long-lived and must cross spec boundaries, this option won't
work for you.
3. Pause Ginkgo's output interceptor before starting your process and then
resume it after.  Use PauseOutputInterception() and ResumeOutputInterception()
to do this.
4. Set --output-interceptor-mode=none when running your Ginkgo suite.  This will
turn off all output interception but allow specs to run in parallel without this
issue.  You may miss important output if you do this including output from Go's
race detector.

More details on issue #851 - https://github.com/onsi/ginkgo/issues/851
`

/*
The OutputInterceptor is used by to
intercept and capture all stdin and stderr output during a test run.
*/
type OutputInterceptor interface {
	StartInterceptingOutput()
	StartInterceptingOutputAndForwardTo(io.Writer)
	StopInterceptingAndReturnOutput() string

	PauseIntercepting()
	ResumeIntercepting()

	Shutdown()
}

type NoopOutputInterceptor struct{}

func (interceptor NoopOutputInterceptor) StartInterceptingOutput()                      {}
func (interceptor NoopOutputInterceptor) StartInterceptingOutputAndForwardTo(io.Writer) {}
func (interceptor NoopOutputInterceptor) StopInterceptingAndReturnOutput() string       { return "" }
func (interceptor NoopOutputInterceptor) PauseIntercepting()                            {}
func (interceptor NoopOutputInterceptor) ResumeIntercepting()                           {}
func (interceptor NoopOutputInterceptor) Shutdown()                                     {}

type pipePair struct {
	reader *os.File
	writer *os.File
}

func startPipeFactory(pipeChannel chan pipePair, shutdown chan interface{}) {
	for {
		//make the next pipe...
		pair := pipePair{}
		pair.reader, pair.writer, _ = os.Pipe()
		select {
		//...and provide it to the next consumer (they are responsible for closing the files)
		case pipeChannel <- pair:
			continue
		//...or close the files if we were told to shutdown
		case <-shutdown:
			pair.reader.Close()
			pair.writer.Close()
			return
		}
	}
}

type interceptorImplementation interface {
	CreateStdoutStderrClones() (*os.File, *os.File)
	ConnectPipeToStdoutStderr(*os.File)
	RestoreStdoutStderrFromClones(*os.File, *os.File)
	ShutdownClones(*os.File, *os.File)
}

type genericOutputInterceptor struct {
	intercepting bool

	stdoutClone *os.File
	stderrClone *os.File
	pipe        pipePair

	shutdown           chan interface{}
	emergencyBailout   chan interface{}
	pipeChannel        chan pipePair
	interceptedContent chan string

	forwardTo         io.Writer
	accumulatedOutput string

	implementation interceptorImplementation
}

func (interceptor *genericOutputInterceptor) StartInterceptingOutput() {
	interceptor.StartInterceptingOutputAndForwardTo(io.Discard)
}

func (interceptor *genericOutputInterceptor) StartInterceptingOutputAndForwardTo(w io.Writer) {
	if interceptor.intercepting {
		return
	}
	interceptor.accumulatedOutput = ""
	interceptor.forwardTo = w
	interceptor.ResumeIntercepting()
}

func (interceptor *genericOutputInterceptor) StopInterceptingAndReturnOutput() string {
	if interceptor.intercepting {
		interceptor.PauseIntercepting()
	}
	return interceptor.accumulatedOutput
}

func (interceptor *genericOutputInterceptor) ResumeIntercepting() {
	if interceptor.intercepting {
		return
	}
	interceptor.intercepting = true
	if interceptor.stdoutClone == nil {
		interceptor.stdoutClone, interceptor.stderrClone = interceptor.implementation.CreateStdoutStderrClones()
		interceptor.shutdown = make(chan interface{})
		go startPipeFactory(interceptor.pipeChannel, interceptor.shutdown)
	}

	// Now we make a pipe, we'll use this to redirect the input to the 1 and 2 file descriptors (this is how everything else in the world is tring to log to stdout and stderr)
	// we get the pipe from our pipe factory.  it runs in the background so we can request the next pipe while the spec being intercepted is running
	interceptor.pipe = <-interceptor.pipeChannel

	interceptor.emergencyBailout = make(chan interface{})

	//Spin up a goroutine to copy data from the pipe into a buffer, this is how we capture any output the user is emitting
	go func() {
		buffer := &bytes.Buffer{}
		destination := io.MultiWriter(buffer, interceptor.forwardTo)
		copyFinished := make(chan interface{})
		reader := interceptor.pipe.reader
		go func() {
			io.Copy(destination, reader)
			reader.Close() // close the read end of the pipe so we don't leak a file descriptor
			close(copyFinished)
		}()
		select {
		case <-copyFinished:
			interceptor.interceptedContent <- buffer.String()
		case <-interceptor.emergencyBailout:
			interceptor.interceptedContent <- ""
		}
	}()

	interceptor.implementation.ConnectPipeToStdoutStderr(interceptor.pipe.writer)
}

func (interceptor *genericOutputInterceptor) PauseIntercepting() {
	if !interceptor.intercepting {
		return
	}
	// first we have to close the write end of the pipe.  To do this we have to close all file descriptors pointing
	// to the write end.  So that would be the pipewriter itself, and FD #1 and FD #2 if we've Dup2'd them
	interceptor.pipe.writer.Close() // the pipewriter itself

	// we also need to stop intercepting. we do that by reconnecting the stdout and stderr file descriptions back to their respective #1 and #2 file descriptors;
	// this also closes #1 and #2 before it points that their original stdout and stderr file descriptions
	interceptor.implementation.RestoreStdoutStderrFromClones(interceptor.stdoutClone, interceptor.stderrClone)

	var content string
	select {
	case content = <-interceptor.interceptedContent:
	case <-time.After(BAILOUT_TIME):
		/*
			By closing all the pipe writer's file descriptors associated with the pipe writer's file description the io.Copy reading from the reader
			should eventually receive an EOF and exit.

			**However**, if the user has spun up an external process and passed in os.Stdout/os.Stderr to cmd.Stdout/cmd.Stderr then the external process
			will have a file descriptor pointing to the pipe writer's file description and it will not close until the external process exits.

			That would leave us hanging here waiting for the io.Copy to close forever.  Instead we invoke this emergency escape valve.  This returns whatever
			content we've got but leaves the io.Copy running.  This ensures the external process can continue writing without hanging at the cost of leaking a goroutine
			and file descriptor (those these will be cleaned up when the process exits).

			We tack on a message to notify the user that they've hit this edgecase and encourage them to address it.
		*/
		close(interceptor.emergencyBailout)
		content = <-interceptor.interceptedContent + BAILOUT_MESSAGE
	}

	interceptor.accumulatedOutput += content
	interceptor.intercepting = false
}

func (interceptor *genericOutputInterceptor) Shutdown() {
	interceptor.PauseIntercepting()

	if interceptor.stdoutClone != nil {
		close(interceptor.shutdown)
		interceptor.implementation.ShutdownClones(interceptor.stdoutClone, interceptor.stderrClone)
		interceptor.stdoutClone = nil
		interceptor.stderrClone = nil
	}
}

/* This is used on windows builds but included here so it can be explicitly tested on unix systems too */
func NewOSGlobalReassigningOutputInterceptor() OutputInterceptor {
	return &genericOutputInterceptor{
		interceptedContent: make(chan string),
		pipeChannel:        make(chan pipePair),
		shutdown:           make(chan interface{}),
		implementation:     &osGlobalReassigningOutputInterceptorImpl{},
	}
}

type osGlobalReassigningOutputInterceptorImpl struct{}

func (impl *osGlobalReassigningOutputInterceptorImpl) CreateStdoutStderrClones() (*os.File, *os.File) {
	return os.Stdout, os.Stderr
}

func (impl *osGlobalReassigningOutputInterceptorImpl) ConnectPipeToStdoutStderr(pipeWriter *os.File) {
	os.Stdout = pipeWriter
	os.Stderr = pipeWriter
}

func (impl *osGlobalReassigningOutputInterceptorImpl) RestoreStdoutStderrFromClones(stdoutClone *os.File, stderrClone *os.File) {
	os.Stdout = stdoutClone
	os.Stderr = stderrClone
}

func (impl *osGlobalReassigningOutputInterceptorImpl) ShutdownClones(_ *os.File, _ *os.File) {
	//noop
}


text:
date: 2016-09-15T00:00:00Z
tags:
- app store
- apps
- ios
title: Retiring old apps
---

With the release of iOS 10 and the need to update iOS apps to suit, I have
decided it is time to retire some of my lesser-performing apps as it is not
worth the effort required to maintain them.

At the moment, the following iOS apps are no longer available:

* A Knight's Move
* Dice Pass
* Pic-a-POD
* Quick Score - Tennis

For the first three listed there, the Mac versions are still available:

* [A Knight's Move for Mac][1]
* [Dice Pass for Mac][2]
* [Pic-a-POD for Mac][3]

If you bought any of these apps and would like a promo code for the Mac version,
send me a screen shot of the app running on your iPhone or iPad and I will send
you a code.

[1]: https://itunes.apple.com/app/a-knights-move/id533321133
[2]: https://itunes.apple.com/app/dice-pass/id997688302
[3]: https://itunes.apple.com/app/pic-a-pod/id477909802


text:
include_recipe 'yum-ius'
include_recipe 'yum-epel'

%w(gcc python27 python27-devel python27-pip).each do |pkg|
  package pkg
end

group 'chef' do
  action :create
end

user 'chef' do
  action :create
  gid 'chef'
end

python_webapp 'tutorial_c' do
  path nil
  requirements_file 'special_requirements.txt'

  django_migrate false
  django_collectstatic false

  repository 'https://github.com/osuosl/python-test-apps.git'

  config_template nil
  revision 'cookbook_test' # TODO: set this to nil
end


text:
package com.sys1yagi.swipe.core.entity.swipe;

/**
 * Created by toshihiro-yagi on 15/12/16.
 */
public class SwipeVoice {
}


text:
/*
/ * main_desktop.cpp
 *
 *  Created on: Dec 17, 2016
 *      Author: sebastian
 */

#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "cartoon.h"
#include "skin.h"

using namespace cv;
using namespace std;

void initWebCam(VideoCapture &videoCapture, int cameraNumber) {
	try {
		videoCapture.open(cameraNumber);
	} catch(cv::Exception &e){

	}
	if (!videoCapture.isOpened()) {
		cerr << "ERROR: Couldn't access the camera or video" << endl;
		exit(1);
	}
	cout << "Loaded camera " << cameraNumber << "." << endl;

}
void captureCamera(int argc, char** argv){
	int cameraNumber = 0;
	if (argc > 1) {
		cameraNumber = atoi(argv[1]);
	}

	VideoCapture camera;
	initWebCam(camera, cameraNumber);

	camera.set(CV_CAP_PROP_FRAME_WIDTH, 640);
	camera.set(CV_CAP_PROP_FRAME_HEIGHT, 480);

	while (true) {
		Mat cameraFrame;
		camera >> cameraFrame;
		if (cameraFrame.empty()) {
			cerr << "ERROR: Couln't grab camera frame." << endl;
			exit(1);
		}

		Mat displayedFrame = Mat(cameraFrame.size(), CV_8UC3);

		//cartoonifyImage(cameraFrame, displayedFrame);
		hideSkin(cameraFrame, displayedFrame);

		imshow("Original", cameraFrame);
		imshow("Hidden skin", displayedFrame);

		char keypress = cv::waitKey(20);
		if (keypress == 27) {
			break;
		}
	}

}

void captureImage(int argc, char** argv) {
	if (argc != 2) {
		cerr << "ERROR: No image passed" << endl;
		exit(1);
	}

	Mat image = imread(argv[1], CV_LOAD_IMAGE_COLOR);
	if (!image.data) {
		cerr << "ERROR: No image data." << endl;
		exit(1);
	}

	imshow("Original", image);

	Mat displayedFrame;
	displayedFrame = Mat(image.size(), CV_8UC3);

//	cartoonifyImage(image, displayedFrame);
	hideSkin(image, displayedFrame);

	imshow("Hidden skin", displayedFrame);

	while(char(waitKey(1) != 'q')){}

}

int main (int argc, char** argv) {
	captureImage(argc, argv);
//	captureCamera(argc, argv);

	return 0;
}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/splash_rl"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".SplashActivity" >

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/menubg"
        android:scaleType="fitXY"
        android:text="@string/hello_world" />

</RelativeLayout>


text:
package cz.metacentrum.perun.scim;

import cz.metacentrum.perun.core.api.PerunSession;

import static cz.metacentrum.perun.scim.api.SCIMDefaults.BASE_PATH;
import static cz.metacentrum.perun.scim.api.SCIMDefaults.GROUPS_PATH;
import static cz.metacentrum.perun.scim.api.SCIMDefaults.RESOURCE_TYPES_PATH;
import static cz.metacentrum.perun.scim.api.SCIMDefaults.SCHEMAS_PATH;
import static cz.metacentrum.perun.scim.api.SCIMDefaults.SERVICE_PROVIDER_CONFIGS_PATH;
import static cz.metacentrum.perun.scim.api.SCIMDefaults.USERS_PATH;

import cz.metacentrum.perun.scim.api.exceptions.SCIMException;
import cz.metacentrum.perun.scim.api.endpoints.GroupResourceEndpointController;
import cz.metacentrum.perun.scim.api.endpoints.ResourceTypesEndpointController;
import cz.metacentrum.perun.scim.api.endpoints.SchemasEndpointController;
import cz.metacentrum.perun.scim.api.endpoints.ServiceProviderConfigsEndpointController;
import cz.metacentrum.perun.scim.api.endpoints.UserResourceEndpointController;

import javax.ws.rs.core.Response;

import org.springframework.stereotype.Component;

/**
 * SCIM protocol
 * <p>
 * SCIM (System for Cross-domain Identity Management) is a protocol for
 * cross-domain access to information about users and groups. With SCIM protocol
 * it is possible to create/update/get/delete resources. Currently only get
 * methods are supported.
 *
 * @author Sona Mastrakova <sona.mastrakova@gmail.com>
 * @date 08.10.2016
 */
@Component
public class SCIM {

	public Response process(PerunSession session, String path, String params) throws SCIMException {

		if (session.getPerunPrincipal().getUser() == null) {
			throw new SCIMException("invalid_user");
		}

		if (path.contains(BASE_PATH + USERS_PATH)) {
			UserResourceEndpointController controller = new UserResourceEndpointController(session);
			String[] pathArray = path.split(BASE_PATH + USERS_PATH);
			String userId = pathArray[1];

			if (userId != null) {
				return controller.getUser(userId.replaceAll("/", ""));
			} else {
				throw new SCIMException("invalid_request");
			}
		}

		if (path.contains(BASE_PATH + GROUPS_PATH)) {
			GroupResourceEndpointController controller = new GroupResourceEndpointController(session);
			String[] pathArray = path.split(BASE_PATH + GROUPS_PATH);
			String groupId = pathArray[1];

			if (groupId != null) {
				return controller.getGroup(groupId.replaceAll("/", ""));
			} else {
				throw new SCIMException("invalid_request");
			}
		}

		if (path.contains(BASE_PATH + SERVICE_PROVIDER_CONFIGS_PATH)) {
			ServiceProviderConfigsEndpointController controller = new ServiceProviderConfigsEndpointController();

			return controller.getServiceProviderConfigs();
		}

		if (path.contains(BASE_PATH + RESOURCE_TYPES_PATH)) {
			ResourceTypesEndpointController controller = new ResourceTypesEndpointController();

			return controller.getResourceTypes();
		}

		if (path.contains(BASE_PATH + SCHEMAS_PATH)) {
			SchemasEndpointController controller = new SchemasEndpointController();

			return controller.getSchemas();
		}

		// else
		throw new SCIMException("invalid_request");
	}
}


text:
set -x
set -e

export RPMBUILD=$PWD/build/slicebase-$(uname -i)
export TMPBUILD=$PWD/build/tmp

# NOTE: for each non-comment line
grep -v "^#" slice-tags.list | \
while read slicetag repo slicename ; do

    # NOTE: remove old slice dir, if present
    test -d $slicename && rm -rf $slicename

    # NOTE: checkout repo
    git clone --recursive $repo $slicename

    # NOTE: set slice-specific source & build dirs
    export SOURCE_DIR=$PWD/$slicename
    export BUILD_DIR=/home/$slicename

    pushd $SOURCE_DIR
        # NOTE: checkout the specific slicetag
        git checkout --quiet $slicetag

        # NOTE: perform build & pass 'export'd vars through environment
        ./package/slicebuild.sh $slicename
    popd
done


text:
/**
 * Contains implementation of a class EmulatedCamera that encapsulates
 * functionality common to all version 3.0 emulated camera devices.  Instances
 * of this class (for each emulated camera) are created during the construction
 * of the EmulatedCameraFactory instance.  This class serves as an entry point
 * for all camera API calls that defined by camera3_device_ops_t API.
 */

//#define LOG_NDEBUG 0
#define LOG_TAG "EmulatedCamera3_Camera"
#include <cutils/log.h>

#include "EmulatedCamera3.h"
#include "system/camera_metadata.h"

namespace android {

/**
 * Constructs EmulatedCamera3 instance.
 * Param:
 *  cameraId - Zero based camera identifier, which is an index of the camera
 *      instance in camera factory's array.
 *  module - Emulated camera HAL module descriptor.
 */
EmulatedCamera3::EmulatedCamera3(int cameraId,
        struct hw_module_t* module):
        EmulatedBaseCamera(cameraId,
                CAMERA_DEVICE_API_VERSION_3_0,
                &common,
                module),
        mStatus(STATUS_ERROR)
{
    common.close = EmulatedCamera3::close;
    ops = &sDeviceOps;

    mCallbackOps = NULL;

    mVendorTagOps.get_camera_vendor_section_name =
            EmulatedCamera3::get_camera_vendor_section_name;
    mVendorTagOps.get_camera_vendor_tag_name =
            EmulatedCamera3::get_camera_vendor_tag_name;
    mVendorTagOps.get_camera_vendor_tag_type =
            EmulatedCamera3::get_camera_vendor_tag_type;
    mVendorTagOps.parent = this;
}

/* Destructs EmulatedCamera3 instance. */
EmulatedCamera3::~EmulatedCamera3() {
}

/****************************************************************************
 * Abstract API
 ***************************************************************************/

/****************************************************************************
 * Public API
 ***************************************************************************/

status_t EmulatedCamera3::Initialize() {
    ALOGV("%s", __FUNCTION__);

    mStatus = STATUS_CLOSED;
    return NO_ERROR;
}

/****************************************************************************
 * Camera API implementation
 ***************************************************************************/

status_t EmulatedCamera3::connectCamera(hw_device_t** device) {
    ALOGV("%s", __FUNCTION__);
    if (device == NULL) return BAD_VALUE;

    if (mStatus != STATUS_CLOSED) {
        ALOGE("%s: Trying to open a camera in state %d!",
                __FUNCTION__, mStatus);
        return INVALID_OPERATION;
    }

    *device = &common;
    mStatus = STATUS_OPEN;
    return NO_ERROR;
}

status_t EmulatedCamera3::closeCamera() {
    mStatus = STATUS_CLOSED;
    return NO_ERROR;
}

status_t EmulatedCamera3::getCameraInfo(struct camera_info* info) {
    return EmulatedBaseCamera::getCameraInfo(info);
}

/****************************************************************************
 * Camera Device API implementation.
 * These methods are called from the camera API callback routines.
 ***************************************************************************/

status_t EmulatedCamera3::initializeDevice(
        const camera3_callback_ops *callbackOps) {
    if (callbackOps == NULL) {
        ALOGE("%s: NULL callback ops provided to HAL!",
                __FUNCTION__);
        return BAD_VALUE;
    }

    if (mStatus != STATUS_OPEN) {
        ALOGE("%s: Trying to initialize a camera in state %d!",
                __FUNCTION__, mStatus);
        return INVALID_OPERATION;
    }

    mCallbackOps = callbackOps;
    mStatus = STATUS_READY;

    return NO_ERROR;
}

status_t EmulatedCamera3::configureStreams(
        camera3_stream_configuration *streamList) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return INVALID_OPERATION;
}

status_t EmulatedCamera3::registerStreamBuffers(
        const camera3_stream_buffer_set *bufferSet) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return INVALID_OPERATION;
}

const camera_metadata_t* EmulatedCamera3::constructDefaultRequestSettings(
        int type) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return NULL;
}

status_t EmulatedCamera3::processCaptureRequest(
        camera3_capture_request *request) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return INVALID_OPERATION;
}

/** Custom tag query methods */

const char* EmulatedCamera3::getVendorSectionName(uint32_t tag) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return NULL;
}

const char* EmulatedCamera3::getVendorTagName(uint32_t tag) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return NULL;
}

int EmulatedCamera3::getVendorTagType(uint32_t tag) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return -1;
}

/** Debug methods */

void EmulatedCamera3::dump(int fd) {
    ALOGE("%s: Not implemented", __FUNCTION__);
    return;
}

/****************************************************************************
 * Protected API. Callbacks to the framework.
 ***************************************************************************/

void EmulatedCamera3::sendCaptureResult(camera3_capture_result_t *result) {
    mCallbackOps->process_capture_result(mCallbackOps, result);
}

void EmulatedCamera3::sendNotify(camera3_notify_msg_t *msg) {
    mCallbackOps->notify(mCallbackOps, msg);
}

/****************************************************************************
 * Private API.
 ***************************************************************************/

/****************************************************************************
 * Camera API callbacks as defined by camera3_device_ops structure.  See
 * hardware/libhardware/include/hardware/camera3.h for information on each
 * of these callbacks. Implemented in this class, these callbacks simply
 * dispatch the call into an instance of EmulatedCamera3 class defined by the
 * 'camera_device3' parameter, or set a member value in the same.
 ***************************************************************************/

EmulatedCamera3* getInstance(const camera3_device_t *d) {
    const EmulatedCamera3* cec = static_cast<const EmulatedCamera3*>(d);
    return const_cast<EmulatedCamera3*>(cec);
}

int EmulatedCamera3::initialize(const struct camera3_device *d,
        const camera3_callback_ops_t *callback_ops) {
    EmulatedCamera3* ec = getInstance(d);
    return ec->initializeDevice(callback_ops);
}

int EmulatedCamera3::configure_streams(const struct camera3_device *d,
        camera3_stream_configuration_t *stream_list) {
    EmulatedCamera3* ec = getInstance(d);
    return ec->configureStreams(stream_list);
}

int EmulatedCamera3::register_stream_buffers(
        const struct camera3_device *d,
        const camera3_stream_buffer_set_t *buffer_set) {
    EmulatedCamera3* ec = getInstance(d);
    return ec->registerStreamBuffers(buffer_set);
}

int EmulatedCamera3::process_capture_request(
        const struct camera3_device *d,
        camera3_capture_request_t *request) {
    EmulatedCamera3* ec = getInstance(d);
    return ec->processCaptureRequest(request);
}

const camera_metadata_t* EmulatedCamera3::construct_default_request_settings(
        const camera3_device_t *d, int type) {
    EmulatedCamera3* ec = getInstance(d);
    return ec->constructDefaultRequestSettings(type);
}

void EmulatedCamera3::get_metadata_vendor_tag_ops(const camera3_device_t *d,
        vendor_tag_query_ops_t *ops) {
    ops->get_camera_vendor_section_name = get_camera_vendor_section_name;
    ops->get_camera_vendor_tag_name = get_camera_vendor_tag_name;
    ops->get_camera_vendor_tag_type = get_camera_vendor_tag_type;
}

const char* EmulatedCamera3::get_camera_vendor_section_name(
        const vendor_tag_query_ops_t *v,
        uint32_t tag) {
    EmulatedCamera3* ec = static_cast<const TagOps*>(v)->parent;
    return ec->getVendorSectionName(tag);
}

const char* EmulatedCamera3::get_camera_vendor_tag_name(
        const vendor_tag_query_ops_t *v,
        uint32_t tag) {
    EmulatedCamera3* ec = static_cast<const TagOps*>(v)->parent;
    return ec->getVendorTagName(tag);
}

int EmulatedCamera3::get_camera_vendor_tag_type(
        const vendor_tag_query_ops_t *v,
        uint32_t tag)  {
    EmulatedCamera3* ec = static_cast<const TagOps*>(v)->parent;
    return ec->getVendorTagType(tag);
}

void EmulatedCamera3::dump(const camera3_device_t *d, int fd) {
    EmulatedCamera3* ec = getInstance(d);
    ec->dump(fd);
}

int EmulatedCamera3::close(struct hw_device_t* device) {
    EmulatedCamera3* ec =
            static_cast<EmulatedCamera3*>(
                reinterpret_cast<camera3_device_t*>(device) );
    if (ec == NULL) {
        ALOGE("%s: Unexpected NULL camera3 device", __FUNCTION__);
        return BAD_VALUE;
    }
    return ec->closeCamera();
}

camera3_device_ops_t EmulatedCamera3::sDeviceOps = {
    EmulatedCamera3::initialize,
    EmulatedCamera3::configure_streams,
    EmulatedCamera3::register_stream_buffers,
    EmulatedCamera3::construct_default_request_settings,
    EmulatedCamera3::process_capture_request,
    EmulatedCamera3::get_metadata_vendor_tag_ops,
    EmulatedCamera3::dump
};

}; /* namespace android */


text:
google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Task');
        data.addColumn('number', 'Hours per Day');
        data.addRows([
          ['Work',    11],
          ['Eat',      2],
          ['Commute',  2],
          ['Watch TV', 2],
          ['Sleep',    7]
        ]);

        var options = {
          title: '',

		  colors: ['#6e8da7', '#74b6e2'], /*FOR GRAPH COLORS*/

		  height:'400',

		  legendTextStyle: {color:'#5c5c5c'}, /*FOR RIGHT TEXT*/

		  tooltip: {textStyle: {color: '#5c5c5c', fontSize:'15'}, showColorCode: true}, /*TOOL TIP OPTIONS*/

		  titleTextStyle: {color: '#5c5c5c', fontName:'arial', fontSize:'15'}, /*FOR TITLE COLOR , FONT AND FONT SIZE*/

		  chartArea:{left:0,top:30,width:"82%",height:"320"}

        };

        var chart = new google.visualization.PieChart(document.getElementById('pie-chart'));
        chart.draw(data, options);
      }


text:
enum {
    StandardSectionIndex,
    AbbreviatedConjunctionSectionIndex,
    NoSerialDelimeterSectionIndex,
    DataStyleSectionIndex,
} ArrayFormatterViewControllerSectionIndexes;

@interface ArrayFormatterViewController ()
@property (readwrite, nonatomic, retain) NSArray *examples;
@end

@implementation ArrayFormatterViewController
@synthesize examples = _examples;

- (id)init {
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (!self) {
        return nil;
    }

    self.title = NSLocalizedString(@"Array Formatter", nil);

    NSMutableArray *mutableExamples = [NSMutableArray array];
    [mutableExamples addObject:[NSArray arrayWithObjects:@"John Lennon", @"Paul McCartney", @"George Harrison", @"Ringo Starr", nil]];
    [mutableExamples addObject:[NSArray arrayWithObjects:@"Bertrand Russel", @"Baruch de Spinoza", @"John Rawls", nil]];
    [mutableExamples addObject:[NSArray arrayWithObjects:@"Friedrich Hayek", @"John Maynard Keynes", nil]];
    [mutableExamples addObject:[NSArray arrayWithObjects:@"Kurt Vonnegut", nil]];
    self.examples = [NSArray arrayWithArray:mutableExamples];

    return self;
}

+ (NSString *)formatterDescription {
    return NSLocalizedString(@"Think of this as a production-ready alternative to NSArray -componentsJoinedByString:. TTTArrayFormatter comes with internationalization baked-in, and provides a concise API that allows you to configure for any edge cases.", nil);
}

#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 4;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [self.examples count];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    switch (section) {
        case AbbreviatedConjunctionSectionIndex:
            return NSLocalizedString(@"Abbreviated Conjunction", nil);
        case NoSerialDelimeterSectionIndex:
            return NSLocalizedString(@"No Serial Delimiter (Oxford Comma)", nil);
        case DataStyleSectionIndex:
            return NSLocalizedString(@"Data Style", nil);
        default:
            return nil;
    }
}

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
    static TTTArrayFormatter *_arrayFormatter = nil;
    if (!_arrayFormatter) {
        _arrayFormatter = [[TTTArrayFormatter alloc] init];
    }

    [_arrayFormatter setArrayStyle:TTTArrayFormatterSentenceStyle];
    [_arrayFormatter setUsesSerialDelimiter:YES];
    [_arrayFormatter setUsesAbbreviatedConjunction:NO];

    switch (indexPath.section) {
        case StandardSectionIndex:
            break;
        case AbbreviatedConjunctionSectionIndex:
            [_arrayFormatter setUsesAbbreviatedConjunction:YES];
            break;
        case NoSerialDelimeterSectionIndex:
            [_arrayFormatter setUsesSerialDelimiter:NO];
            break;
        case DataStyleSectionIndex:
            [_arrayFormatter setArrayStyle:TTTArrayFormatterDataStyle];
            break;
    }

    cell.textLabel.font = [UIFont systemFontOfSize:14];
    cell.textLabel.numberOfLines = 3;

    NSArray *example = [self.examples objectAtIndex:indexPath.row];
    cell.textLabel.text = [_arrayFormatter stringFromArray:example];
}

@end


text:
<?xml version="1.0"?>
<!--

-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\View" name="shipment_tracking" template="order/tracking/view.phtml"/>
    </body>
</page>


text:
{{#view Ember.Button
    target="parentView"
    action="new@CRESOURCE@"
    classNames="btn btn-primary"
    }}

    New
{{/view}}

{{#view Ember.Button
    target="parentView" action="del@CRESOURCE@"
    classNames="btn btn-danger"
    disabledBinding="@APP@.@RESOURCE@sController.hasSelected"
    }}

    Delete
{{/view}}

{{#view Ember.TextField
    classNames="search-query"
    valueBinding="searchQuery"
    placeholder="search..."}}
{{/view}}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.apiman</groupId>
    <artifactId>apiman-manager-api</artifactId>
    <version>2.0.1-SNAPSHOT</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <artifactId>apiman-manager-api-war-wildfly8</artifactId>
  <packaging>war</packaging>
  <name>apiman-manager-api-war-wildfly8</name>

  <dependencies>
    <!-- The base WAR being extended -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-manager-api-war</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-manager-api-war</artifactId>
      <classifier>classes</classifier>
      <scope>provided</scope>
    </dependency>

    <!-- Project dependencies not included in the base WAR -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-manager-api-ispn</artifactId>
    </dependency>

    <!-- Project dependencies in the base WAR but that are also directly used -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>apiman-manager-api-core</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Spec libs -->
    <dependency>
      <groupId>org.jboss.spec.javax.servlet</groupId>
      <artifactId>jboss-servlet-api_3.0_spec</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>
    <finalName>apiman</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <overlays>
            <overlay>
              <groupId>${project.groupId}</groupId>
              <artifactId>apiman-manager-api-war</artifactId>
            </overlay>
          </overlays>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
using System;
using System.Net;

#if !PocketPC

namespace libsecondlife.Capabilities
{
    public class CapsListener
    {
    }
}

#endif


text:
<?php

class status extends CI_Model {

	public function __construct() {
		$this->load->database();
	}

	public function insert_status($data){
		$this->db->insert("status",$data);
	}

	public function insert_sets($data){
		$this->db->insert("sets",$data);
	}

	public function insert_status_groups($data){
		$this->db->insert("set_status_groups",$data);
	}

	public function delete_status($id){
		$this->db->where("id",$id);
		$this->db->delete("status");
	}

	public function delete_sets($id){
		$this->db->where("id",$id);
		$this->db->delete("sets");
	}

	public function get_all_sets(){
		$query = $this->db->get("sets");
		$data['data'] = $query->result();
		return $data;
	}

	public function get_all_status(){
		$query = $this->db->get("status");
		return $query->result_array();
	}

}


text:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Nano.Engine.Graphics.Sprites;
using Nano.Engine.IO.Input;

namespace Nano.Engine.Cameras
{
    /// <summary>
    /// simple 2D camera class
    /// </summary>
    public class Camera2D : ICamera
	{
		#region member data

		Vector2 m_Position;
		float m_Zoom;
        float m_Rotation;

		Rectangle m_ViewportRectangle;
        Matrix m_Transform;

		#endregion

		#region properties

		public Vector2 Position
		{
			get { return m_Position; }
            set { m_Position = value; }
		}

		public float Zoom
		{
			get { return m_Zoom; }
            set { m_Zoom = value; }
		}

		public Matrix Transformation
		{
            get { return m_Transform; }
            set { m_Transform = value; }
		}

        public float Rotation
        {
            get { return m_Rotation; }
            set { m_Rotation = value; }
        }

        public Matrix InverseTransform
        {
            get
            {
                return Matrix.Invert(m_Transform);
            }
        }

        public Rectangle ViewportRectangle
        {
            get
            {
                return new Rectangle(
                    m_ViewportRectangle.X,
                    m_ViewportRectangle.Y,
                    m_ViewportRectangle.Width,
                    m_ViewportRectangle.Height);
            }
        }
		#endregion

		public Camera2D(Rectangle viewportRect)
		{
			m_ViewportRectangle = viewportRect;
            m_Zoom = 1.0f;
		}

		public Camera2D(Rectangle viewportRect, Vector2 position)
		{
			m_ViewportRectangle = viewportRect;
			m_Position = position;
            m_Zoom = 1.0f;
		}

        public void Update()
        {
            m_Zoom = MathHelper.Clamp(m_Zoom, 0.0f, 10.0f);

            m_Rotation = MathHelper.WrapAngle(m_Rotation);

            m_Transform = Matrix.CreateRotationZ(m_Rotation) *
                          Matrix.CreateScale(new Vector3(m_Zoom,m_Zoom,1)) *
                          Matrix.CreateTranslation(new Vector3(-m_Position, 0f));
		}
	}
}


text:
package com.sun.speech.freetts;

/**
 * Thrown by an UtteranceProcessor if any errors
 * are encountered while processing an Utterance.
 */
public class ProcessException extends Exception {

    /**
     * Class constructor.
     *
     * @param s the reason why the exception was thrown
     */
    public ProcessException(String s) {
        super(s);
    }
}


text:
 /*
  * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * - added Native Language Support
  * Sun Mar 21 1999 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  * - fixed strerr(errno) in gettext calls
  */

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <termios.h>

#include "c.h"
#include "cyclades.h"
#include "strutils.h"

#if 0
# ifndef XMIT
#  include <linux/version.h>
#  if LINUX_VERSION_CODE > 66056
#   define XMIT
#  endif
# endif
#endif

#include "xalloc.h"
#include "nls.h"
/* Until it gets put in the kernel, toggle by hand. */
#undef XMIT

struct cyclades_control {
	struct cyclades_monitor c;
	int cfile;
	int maxmax;
	double maxtran;
	double maxxmit;
	unsigned long threshold_value;
	unsigned long timeout_value;
};
struct cyclades_control *cmon;
int cmon_index;

static int global_argc, global_optind;
static char ***global_argv;

#define mvtime(tvpto, tvpfrom)  (((tvpto)->tv_sec = (tvpfrom)->tv_sec),(tvpto)->tv_usec = (tvpfrom)->tv_usec)

static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
	fprintf(out, USAGE_HEADER);
	fprintf(out, _(" %s [options] <tty> [...]\n"), program_invocation_short_name);
	fprintf(out, USAGE_OPTIONS);
	fprintf(out, _(" -s, --set-threshold <num>          set interruption threshold value\n"));
	fprintf(out, _(" -g, --get-threshold                display current threshold value\n"));
	fprintf(out, _(" -S, --set-default-threshold <num>  set default threshold value\n"));
	fprintf(out, _(" -t, --set-flush <num>              set flush timeout to value\n"));
	fprintf(out, _(" -G, --get-glush                    display default flush timeout value\n"));
	fprintf(out, _(" -T, --set-default-flush <num>      set the default flush timeout to value\n"));
	fprintf(out, _(" -q, --stats                        display statistics about the tty\n"));
	fprintf(out, _(" -i, --interval <seconds>           gather statistics every <seconds> interval\n"));
	fprintf(out, USAGE_SEPARATOR);
	fprintf(out, USAGE_HELP);
	fprintf(out, USAGE_VERSION);
	fprintf(out, USAGE_MAN_TAIL("cytune(8)"));

	exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}

static inline double dtime(struct timeval *tvpnew, struct timeval *tvpold)
{
	double diff;
	diff = (double)tvpnew->tv_sec - (double)tvpold->tv_sec;
	diff += ((double)tvpnew->tv_usec - (double)tvpold->tv_usec) / 1000000;
	return diff;
}

static void summary(int sig)
{
	struct cyclades_control *cc;
	int argc, local_optind;
	char **argv;
	int i;

	argc = global_argc;
	argv = *global_argv;
	local_optind = global_optind;

	if (sig > 0) {
		for (i = local_optind; i < argc; i++) {
			cc = &cmon[cmon_index];
			warnx(_("File %s, For threshold value %lu, Maximum characters in fifo were %d,\n"
				"and the maximum transfer rate in characters/second was %f"),
			      argv[i], cc->threshold_value, cc->maxmax,
			      cc->maxtran);
		}
		exit(EXIT_SUCCESS);
	}
	cc = &cmon[cmon_index];
	if (cc->threshold_value > 0 && sig != -1) {
		warnx(_("File %s, For threshold value %lu and timrout value %lu, Maximum characters in fifo were %d,\n"
			"and the maximum transfer rate in characters/second was %f"),
		      argv[cmon_index + local_optind], cc->threshold_value,
		      cc->timeout_value, cc->maxmax, cc->maxtran);
	}
	cc->maxmax = 0;
	cc->maxtran = 0.0;
	cc->threshold_value = 0;
	cc->timeout_value = 0;
}

void query_tty_stats(int argc, char **argv, int interval, int numfiles,
		     unsigned long *threshold_value,
		     unsigned long *timeout_value)
{
	struct cyclades_monitor cywork;
	struct timeval lasttime, thistime;
	struct timezone tz = { 0, 0 };
	int i;
	double diff;
	double xfer_rate;
#ifdef XMIT
	double xmit_rate;
#endif

	cmon = xmalloc(sizeof(struct cyclades_control) * numfiles);

	if (signal(SIGINT, summary) ||
	    signal(SIGQUIT, summary) || signal(SIGTERM, summary))
		err(EXIT_FAILURE, _("cannot set signal handler"));
	if (gettimeofday(&lasttime, &tz))
		err(EXIT_FAILURE, _("gettimeofday failed"));

	for (i = optind; i < argc; i++) {
		cmon_index = i - optind;
		cmon[cmon_index].cfile = open(argv[i], O_RDONLY);
		if (cmon[cmon_index].cfile == -1)
			err(EXIT_FAILURE, _("cannot open %s"), argv[i]);
		if (ioctl
		    (cmon[cmon_index].cfile, CYGETMON, &cmon[cmon_index].c))
			err(EXIT_FAILURE, _("cannot issue CYGETMON on %s"),
			    argv[i]);
		summary(-1);
		if (ioctl
		    (cmon[cmon_index].cfile, CYGETTHRESH, &threshold_value))
			err(EXIT_FAILURE, _("cannot get threshold for %s"),
			    argv[i]);
		if (ioctl(cmon[cmon_index].cfile, CYGETTIMEOUT, &timeout_value))
			err(EXIT_FAILURE, _("cannot get timeout for %s"),
			    argv[i]);
	}
	while (1) {
		sleep(interval);

		if (gettimeofday(&thistime, &tz))
			err(EXIT_FAILURE, _("gettimeofday failed"));
		diff = dtime(&thistime, &lasttime);
		mvtime(&lasttime, &thistime);

		for (i = optind; i < argc; i++) {
			cmon_index = i - optind;
			if (ioctl(cmon[cmon_index].cfile, CYGETMON, &cywork))
				err(EXIT_FAILURE,
				    _("cannot issue CYGETMON on %s"), argv[i]);
			if (ioctl
			    (cmon[cmon_index].cfile, CYGETTHRESH,
			     &threshold_value))
				err(EXIT_FAILURE,
				    _("cannot get threshold for %s"), argv[i]);
			if (ioctl
			    (cmon[cmon_index].cfile, CYGETTIMEOUT,
			     &timeout_value))
				err(EXIT_FAILURE,
				    _("cannot get timeout for %s"), argv[i]);

			xfer_rate = cywork.char_count / diff;
#ifdef XMIT
			xmit_rate = cywork.send_count / diff;
#endif
			if ((*threshold_value) !=
			    cmon[cmon_index].threshold_value
			    || (*timeout_value) !=
			    cmon[cmon_index].timeout_value) {
				summary(-2);
				/* Note that the summary must come before the
				 * setting of threshold_value */
				cmon[cmon_index].threshold_value =
				    (*threshold_value);
				cmon[cmon_index].timeout_value =
				    (*timeout_value);
			} else {
				/* Don't record this first cycle after change */
				if (xfer_rate > cmon[cmon_index].maxtran)
					cmon[cmon_index].maxtran = xfer_rate;
#ifdef XMIT
				if (xmit_rate > cmon[cmon_index].maxxmit)
					cmon[cmon_index].maxxmit = xmit_rate;
#endif
				if (cmon[cmon_index].maxmax < 0 ||
				    cywork.char_max >
				    (unsigned long)cmon[cmon_index].maxmax)
					cmon[cmon_index].maxmax =
					    cywork.char_max;
			}

#ifdef XMIT
			printf(_("%s: %lu ints, %lu/%lu chars; fifo: %lu thresh, %lu tmout, "
				 "%lu max, %lu now\n"), argv[i],
			       cywork.int_count, cywork.char_count,
			       cywork.send_count, *threshold_value,
			       *timeout_value, cywork.char_max,
			       cywork.char_last);
			printf(_("   %f int/sec; %f rec, %f send (char/sec)\n"),
			       cywork.int_count / diff, xfer_rate, xmit_rate);
#else
			printf(_("%s: %lu ints, %lu chars; fifo: %lu thresh, %lu tmout, "
				 "%lu max, %lu now\n"), argv[i],
			       cywork.int_count, cywork.char_count,
			       *threshold_value, *timeout_value, cywork.char_max,
			       cywork.char_last);
			printf(_("   %f int/sec; %f rec (char/sec)\n"),
			       cywork.int_count / diff, xfer_rate);
#endif
			memcpy(&cmon[cmon_index].c, &cywork,
			       sizeof(struct cyclades_monitor));
		}
	}

	free(cmon);
	return;
}

int main(int argc, char **argv)
{
	int query = 0;
	int interval = 1;
	int set = 0;
	int set_val = -1;
	int get = 0;
	int set_def = 0;
	int set_def_val = -1;
	int get_def = 0;
	int set_time = 0;
	int set_time_val = -1;
	int set_def_time = 0;
	int set_def_time_val = -1;
	int errflg = 0;
	int file;
	int numfiles;
	int i;
	unsigned long threshold_value;
	unsigned long timeout_value;

	static const struct option longopts[] = {
		{"set-threshold", required_argument, NULL, 's'},
		{"get-threshold", no_argument, NULL, 'g'},
		{"set-default-threshold", required_argument, NULL, 'S'},
		{"set-flush", required_argument, NULL, 't'},
		{"get-flush", no_argument, NULL, 'G'},
		{"set-default-flush", required_argument, NULL, 'T'},
		{"stats", no_argument, NULL, 'q'},
		{"interval", required_argument, NULL, 'i'},
		{"version", no_argument, NULL, 'V'},
		{"help", no_argument, NULL, 'h'},
		{NULL, 0, NULL, 0}
	};

	/* For signal routine. */
	global_argc = argc;
	global_argv = &argv;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	while ((i =
		getopt_long(argc, argv, "qs:S:t:T:gGi:Vh", longopts,
			    NULL)) != -1) {
		switch (i) {
		case 'q':
			query = 1;
			break;
		case 'i':
			interval =
			    (int)strtoul_or_err(optarg,
						_("Invalid interval value"));
			if (interval < 1) {
				warnx(_("Invalid interval value: %d"),
				      interval);
				errflg++;
			}
			break;
		case 's':
			++set;
			set_val =
			    (int)strtoul_or_err(optarg, _("Invalid set value"));
			if (set_val < 1 || 12 < set_val) {
				warnx(_("Invalid set value: %d"), set_val);
				errflg++;
			}
			break;
		case 'S':
			++set_def;
			set_def_val =
			    (int)strtoul_or_err(optarg,
						_("Invalid default value"));
			if (set_def_val < 0 || 12 < set_def_val) {
				warnx(_("Invalid default value: %d"),
				      set_def_val);
				errflg++;
			}
			break;
		case 't':
			++set_time;
			set_time_val =
			    (int)strtoul_or_err(optarg,
						_("Invalid set time value"));
			if (set_time_val < 1 || 255 < set_time_val) {
				warnx(_("Invalid set time value: %d"),
				      set_time_val);
				errflg++;
			}
			break;
		case 'T':
			++set_def_time;
			set_def_time_val =
			    (int)strtoul_or_err(optarg,
						_("Invalid default time value"));
			if (set_def_time_val < 0 || 255 < set_def_time_val) {
				warnx(_("Invalid default time value: %d"),
				      set_def_time_val);
				errflg++;
			}
			break;
		case 'g':
			++get;
			break;
		case 'G':
			++get_def;
			break;
		case 'V':
			printf(_("%s from %s\n"), program_invocation_short_name,
			       PACKAGE_STRING);
			return EXIT_SUCCESS;
		case 'h':
			usage(stdout);
		default:
			usage(stderr);
		}
	}
	numfiles = argc - optind;

	if (errflg
	    || (numfiles == 0)
	    || (!query && !set && !set_def && !get && !get_def && !set_time && !set_def_time)
	    || (set && set_def)
	    || (set_time && set_def_time)
	    || (get && get_def))
		usage(stderr);

	/* For signal routine. */
	global_optind = optind;

	if (set || set_def) {
		for (i = optind; i < argc; i++) {
			file = open(argv[i], O_RDONLY);
			if (file == -1)
				err(EXIT_FAILURE, _("cannot open %s"), argv[i]);
			if (ioctl(file,
				  set ? CYSETTHRESH : CYSETDEFTHRESH,
				  set ? set_val : set_def_val))
				err(EXIT_FAILURE,
				    _("cannot set %s to threshold %d"), argv[i],
				    set ? set_val : set_def_val);
			close(file);
		}
	}
	if (set_time || set_def_time) {
		for (i = optind; i < argc; i++) {
			file = open(argv[i], O_RDONLY);
			if (file == -1)
				err(EXIT_FAILURE, _("cannot open %s"), argv[i]);
			if (ioctl(file,
				  set_time ? CYSETTIMEOUT : CYSETDEFTIMEOUT,
				  set_time ? set_time_val : set_def_time_val))
				err(EXIT_FAILURE,
				    _("cannot set %s to time threshold %d"),
				    argv[i],
				    set_time ? set_time_val : set_def_time_val);
			close(file);
		}
	}

	if (get || get_def) {
		for (i = optind; i < argc; i++) {
			file = open(argv[i], O_RDONLY);
			if (file == -1)
				err(EXIT_FAILURE, _("cannot open %s"), argv[i]);
			if (ioctl
			    (file, get ? CYGETTHRESH : CYGETDEFTHRESH,
			     &threshold_value))
				err(EXIT_FAILURE,
				    _("cannot get threshold for %s"), argv[i]);
			if (ioctl
			    (file, get ? CYGETTIMEOUT : CYGETDEFTIMEOUT,
			     &timeout_value))
				err(EXIT_FAILURE,
				    _("cannot get timeout for %s"), argv[i]);
			close(file);
			if (get)
				printf(_("%s: %ld current threshold and %ld current timeout\n"),
					argv[i], threshold_value, timeout_value);
			else
				printf(_("%s: %ld default threshold and %ld default timeout\n"),
					argv[i], threshold_value, timeout_value);
		}
	}

	if (!query)
		return EXIT_SUCCESS;

	query_tty_stats(argc, argv, interval, numfiles, &threshold_value, &timeout_value);

	return EXIT_SUCCESS;
}


text:
import React from "react"
import { computed, action } from "mobx"
import { observer } from "mobx-react"
import Select from "react-select"
import { MapProjectionName, MapProjectionLabels } from "./MapProjections"
import { getStylesForTargetHeight } from "@ourworldindata/utils"

interface ProjectionChooserEntry {
    label: string
    value: MapProjectionName
}

@observer
export class ProjectionChooser extends React.Component<{
    value: string
    onChange: (value: MapProjectionName) => void
}> {
    @action.bound onChange(selected: ProjectionChooserEntry | null): void {
        if (selected) this.props.onChange(selected.value)
    }

    @computed get options(): { value: MapProjectionName; label: string }[] {
        return Object.values(MapProjectionName).map((projectName) => {
            return {
                value: projectName,
                label: MapProjectionLabels[projectName],
            }
        })
    }

    render(): JSX.Element {
        const { value } = this.props

        const style: React.CSSProperties = {
            fontSize: "0.75rem",
            pointerEvents: "auto",
        }

        return (
            <div style={style}>
                <Select
                    options={this.options}
                    onChange={this.onChange}
                    value={this.options.find((opt) => opt.value === value)}
                    menuPlacement="bottom"
                    components={{
                        IndicatorSeparator: null,
                    }}
                    styles={getStylesForTargetHeight(22)}
                    isSearchable={false}
                />
            </div>
        )
    }
}


text:
package com.example;

import org.assertj.core.api.BDDAssertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJsonTesters;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.cloud.contract.stubrunner.StubFinder;
import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner;
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerPort;
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties;
import org.springframework.http.MediaType;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * @author Marcin Grzejszczak
 */
@SpringBootTest(webEnvironment = WebEnvironment.MOCK)
@AutoConfigureMockMvc
@AutoConfigureJsonTesters
// example of usage with fixed port

@AutoConfigureStubRunner(stubsMode = StubRunnerProperties.StubsMode.LOCAL, ids = "com.example:beer-api-producer-advanced")

@DirtiesContext
public class GrumpyBartenderControllerTest extends AbstractTest {

	@Autowired MockMvc mockMvc;
	@Autowired GrumpyBartenderController controller;
	@Autowired StubFinder stubFinder;

	@StubRunnerPort("beer-api-producer-advanced") int producerPort;

	@BeforeEach
	public void setupPort() {
		// either one or the other option

		int portFromStubFinder = this.stubFinder.findStubUrl("beer-api-producer-advanced").getPort();

		int port2 = this.producerPort;
		BDDAssertions.then(portFromStubFinder).isEqualTo(port2);
		this.controller.port = portFromStubFinder;
	}

	@Test public void should_fail_to_sell_beer() throws Exception {

		this.mockMvc.perform(MockMvcRequestBuilders.post("/grumpy")
				.contentType(MediaType.APPLICATION_JSON)
				.content(this.json.write(new Person("marcin", 22)).getJson()))
				.andExpect(status().isOk())
				.andExpect(jsonPath("$.whatTheBartenderSaid").value("You're drunk [marcin]. Go home!"))
				.andExpect(jsonPath("$.whatDoWeDo").value("Go to another bar"));

	}

	@Test public void should_sell_beer_to_Josh() throws Exception {

		this.mockMvc.perform(MockMvcRequestBuilders.post("/grumpy")
				.contentType(MediaType.APPLICATION_JSON)
				.content(this.json.write(new Person("starbuxman", 22)).getJson()))
				.andExpect(status().isOk())
				.andExpect(jsonPath("$.whatTheBartenderSaid").value("There you go Josh!"))
				.andExpect(jsonPath("$.whatDoWeDo").value("Enjoy!"));

	}

}


text:
'use strict';

angular.module('core').directive('setsize', ['$window', '$timeout', function($window,$timeout) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {

      var run = function(){
        var right = angular.element(document.getElementById('volunteer_column_right')).height();

        angular.element(document.getElementById('volunteer_column_left')).height(right);
        angular.element(document.getElementById('volunteer_column_middle')).height(right);
      };
      if($window.innerWidth > 775) {
        // console.log('greater than 775 width');
        $timeout(run, 500);
      }
      //use timeout to wait to execute directive after DOM load
      angular.element($window).bind('resize', function() {
        if($window.innerWidth > 775) {
          $timeout(run, 500);
        } else {
          angular.element(document.getElementById('volunteer_column_right')).height('auto');
          angular.element(document.getElementById('volunteer_column_left')).height('auto');
          angular.element(document.getElementById('volunteer_column_middle')).height('auto');
        }
      });

    }
  };
}]);


text:
include_recipe "apt"

apt_repository "passenger" do
  uri "https://oss-binaries.phusionpassenger.com/apt/passenger"
  components ["main"]
  key "561F9B9CAC40B2F7"
end