text:
using System;

namespace CocosSharp
{
    public abstract class CCMenuItemLabelBase : CCMenuItem
    {
        CCPoint originalScale;

        #region Properties

        public CCColor3B DisabledColor { get; set; }
        protected CCColor3B ColorBackup { get; set; }

        public override bool Selected
        {
            set
            {
                if(Enabled)
                {
                    base.Selected = value;

                    CCPoint zoomScale = (Selected == true) ? originalScale * 1.2f : originalScale;
                    CCAction zoomAction = new CCScaleTo(0.1f, zoomScale.X, zoomScale.Y);

                    if(Selected && (ZoomActionState == null || ZoomActionState.IsDone))
                    {
                        originalScale.X = ScaleX;
                        originalScale.Y = ScaleY;
                    }

                    if(ZoomActionState !=null)
                    {
                        ZoomActionState.Stop();
                    }

                    ZoomActionState = RunAction(zoomAction);
                }
            }
        }

        #endregion Properties

        #region Constructors

        protected CCMenuItemLabelBase(Action<object> target = null) : base(target)
        {
            originalScale = new CCPoint(1.0f, 1.0f);
            ColorBackup = CCColor3B.White;
            DisabledColor = new CCColor3B(126, 126, 126);
            IsColorCascaded = true;
            IsOpacityCascaded = true;
        }

        #endregion Constructors

        protected void LabelWillChange(CCNode oldValue, CCNode newValue)
        {
            if(newValue != null)
            {
                AddChild(newValue);
                newValue.AnchorPoint = new CCPoint(0, 0);
                ContentSize = newValue.ContentSize;
            }

            if(oldValue != null)
            {
                RemoveChild(oldValue, true);
            }
        }

        public override void Activate()
        {
            if (Enabled)
            {
                StopAllActions();
                ScaleX = originalScale.X;
                ScaleY = originalScale.Y;
                base.Activate();
            }
        }
    }

    #if !WINDOWS_PHONE
    public class CCMenuItemLabel : CCMenuItemLabelBase
    {
        CCLabel label;

        #region Properties

        public CCLabel Label
        {
            get { return label; }
            set
            {
                LabelWillChange(label, value);
                label = value;

                if(label !=null && Window != null)
                    label.Window = Window;
            }
        }

        public override bool Enabled
        {
            get { return base.Enabled; }
            set
            {
                if(base.Enabled != value && label != null)
                {
                    if (!value)
                    {
                        ColorBackup = label.Color;
                        label.Color = DisabledColor;
                    }
                    else
                    {
                        label.Color = ColorBackup;
                    }
                }
                base.Enabled = value;
            }
        }

        public override CCScene Scene
        {
            get { return base.Scene; }
            internal set
            {
                base.Scene = value;

                if (value != null && Label != null)
                {
                    Label.Scene = value;
                }
            }
        }

        #endregion Properties

        #region Constructors

        public CCMenuItemLabel(CCLabel label, Action<object> target = null) : base(target)
        {
            Label = label;
        }

        #endregion Constructors
    }
    #endif

    public class CCMenuItemLabelAtlas : CCMenuItemLabelBase
    {
        CCLabelAtlas labelAtlas;

        #region Properties

        public CCLabelAtlas LabelAtlas
        {
            get { return labelAtlas; }
            set
            {
                LabelWillChange(labelAtlas, value);
                labelAtlas = value;

                if(labelAtlas != null && Window != null)
                    labelAtlas.Window = Window;
            }
        }

        public override bool Enabled
        {
            get { return base.Enabled; }
            set
            {
                if(base.Enabled != value && labelAtlas != null)
                {
                    if (!value)
                    {
                        ColorBackup = labelAtlas.Color;
                        labelAtlas.Color = DisabledColor;
                    }
                    else
                    {
                        labelAtlas.Color = ColorBackup;
                    }
                }
                base.Enabled = value;
            }
        }

        public override CCScene Scene
        {
            get { return base.Scene; }
            internal set
            {
                base.Scene = value;

                if (value != null && LabelAtlas != null)
                {
                    LabelAtlas.Scene = value;
                }
            }
        }

        #endregion Properties

        #region Constructors

        public CCMenuItemLabelAtlas(CCLabelAtlas labelAtlas, Action<object> target = null) : base(target)
        {
            LabelAtlas = labelAtlas;
        }

        public CCMenuItemLabelAtlas(Action<object> target) : this(null, target)
        {
        }

        public CCMenuItemLabelAtlas(string value, string charMapFile, int itemWidth, int itemHeight, char startCharMap,
            ICCUpdatable updatable, Action<object> target)
            : this(new CCLabelAtlas(value, charMapFile, itemWidth, itemHeight, startCharMap), target)
        {
        }

        public CCMenuItemLabelAtlas(string value, string charMapFile, int itemWidth, int itemHeight, char startCharMap)
            : this(value, charMapFile, itemWidth, itemHeight, startCharMap, null, null)
        {
        }

        #endregion Constructors
    }

    public class CCMenuItemLabelTTF : CCMenuItemLabelBase
    {
        CCLabelTtf labelTTF;

        #region Properties

        public CCLabelTtf LabelTTF
        {
            get { return labelTTF; }
            set
            {
                LabelWillChange(labelTTF, value);
                labelTTF = value;

                if(labelTTF != null && Window != null)
                    labelTTF.Window = Window;
            }
        }

        public override bool Enabled
        {
            get { return base.Enabled; }
            set
            {
                if(base.Enabled != value && labelTTF != null)
                {
                    if (!value)
                    {
                        ColorBackup = labelTTF.Color;
                        labelTTF.Color = DisabledColor;
                    }
                    else
                    {
                        labelTTF.Color = ColorBackup;
                    }
                }
                base.Enabled = value;
            }
        }

        public override CCScene Scene
        {
            get { return base.Scene; }
            internal set
            {
                base.Scene = value;

                if (value != null && LabelTTF != null)
                {
                    LabelTTF.Scene = value;
                }
            }
        }

        #endregion Properties

        #region Constructors

        public CCMenuItemLabelTTF(CCLabelTtf labelTTF, Action<object> target = null) : base(target)
        {
            LabelTTF = labelTTF;
        }

        public CCMenuItemLabelTTF(Action<object> target = null) : base(target)
        {

        }

        #endregion Constructors

    }

    public class CCMenuItemLabelBMFont : CCMenuItemLabelBase
    {
        CCLabelBMFont labelBMFont;

        #region Properties

        public CCLabelBMFont LabelBMFont
        {
            get { return labelBMFont; }
            set
            {
                LabelWillChange(labelBMFont, value);
                labelBMFont = value;

                if(labelBMFont != null && Window != null)
                    labelBMFont.Window = Window;
            }
        }

        public override bool Enabled
        {
            get { return base.Enabled; }
            set
            {
                if(base.Enabled != value && labelBMFont != null)
                {
                    if (!value)
                    {
                        ColorBackup = labelBMFont.Color;
                        labelBMFont.Color = DisabledColor;
                    }
                    else
                    {
                        labelBMFont.Color = ColorBackup;
                    }
                }
                base.Enabled = value;
            }
        }

        public override CCScene Scene
        {
            get { return base.Scene; }
            internal set
            {
                base.Scene = value;

                if (value != null && LabelBMFont != null)
                {
                    LabelBMFont.Scene = value;
                }
            }
        }

        #endregion Properties

        #region Constructors

        public CCMenuItemLabelBMFont(CCLabelBMFont labelBMFont, Action<object> target = null) : base(target)
        {
            LabelBMFont = labelBMFont;
        }

        #endregion Constructors

    }
}


text:
function wrapAccessToken(url, accessToken) {
	if (url.indexOf('?') !== -1)
		return url + '&access_token=' + accessToken
	else
		return url + '?access_token=' + accessToken
}

function wrapFilter(url, filter) {
	if (url.indexOf('?') !== -1)
		return url + '&filter=' + filter
	else
		return url + '?filter=' + filter
}

var publisher_url = "http://127.0.0.1:3005/api/";
var coreEngine_url = "http://127.0.0.1:3015/api/";

$(document).ready(function () {
	var nowTime = Math.floor((new Date).getTime())
	var todayTime = nowTime - 86400000
	var yesterdayTime = todayTime - 86400000
	var lastWeekTime = nowTime - 604800000

	var userId, publisherAccessToken, coreAccessToken
	if (localStorage.getItem('userId'))
		userId = localStorage.getItem('userId')
	else
		return window.location.href = '../AAA/sign-in.html';
	if (localStorage.getItem('publisherAccessToken'))
		publisherAccessToken = localStorage.getItem('publisherAccessToken')
	else
		return window.location.href = '../AAA/sign-in.html';
	if (localStorage.getItem('coreAccessToken'))
		coreAccessToken = localStorage.getItem('coreAccessToken')
	else
		return window.location.href = '../AAA/sign-in.html';

	var accountURLWithAT = wrapAccessToken(publisher_url + 'clients/' + userId, publisherAccessToken)
	var accountURL = wrapFilter(accountURLWithAT, '{"include":["publisherAccount", "applications"]}')
	$.ajax({
		url: accountURL,
		type: "GET",
		success: function (accountResult) {
			localStorage.setItem('publisherCompanyName', accountResult.companyName);
			localStorage.setItem('publisherEmail', accountResult.email);
			var placementURLWithAT = wrapAccessToken(publisher_url + 'placements/getAllPlacements?accountHashId=' + userId, publisherAccessToken)
			var placementFilterURL = wrapFilter(placementURLWithAT, JSON.stringify({
				'where': {
					'clientId': userId
				}
			}))
			$.ajax({
				url: placementFilterURL,
				type: "GET",
				success: function (placementResult) {
					var statisticsURLWithAT = wrapAccessToken(coreEngine_url + 'statistics/getAllStatistics?accountHashId=' + userId, coreAccessToken)
					$.ajax({
						url: statisticsURLWithAT,
						type: "GET",
						success: function (statisticsResult) {
							var transactionURLWithAT = wrapAccessToken(coreEngine_url + 'statistics/getAllTransactions?accountHashId=' + userId + '&isAnnouncer=false', coreAccessToken)
							$.ajax({
								url: transactionURLWithAT,
								type: "GET",
								success: function (transactionResult) {

									var totalApps = 0,
										disableApps = 0,
										enableApps = 0;
									var totalPlacements = 0,
										disablePlacements = 0,
										enablePlacements = 0;
									var todayClicks = 0,
										yesterdayClicks = 0,
										lastWeekClicks = 0;
									var clicks = 0,
										impressions = 0,
										reports = 0,
										revenue = 0;
									var categorySat = 0,
										countrySat = 0,
										languageSat = 0;
									var openTransactions = 0,
										checkoutTransactions = 0;
									var donutDevice = 0,
										donutOS = 0,
										donutConnection = 0,
										donutUserLebl = 0;

									totalApps = accountResult.applications.length
									for (var i = 0; i < totalApps; i++) {
										if (accountResult.applications[i].status === 'Disable')
											disableApps++
										else if (accountResult.applications[i].status === 'Enable')
											enableApps++
									}

									totalPlacements = placementResult.length
									for (var i = 0; i < totalPlacements; i++) {
										if (placementResult[i].status === 'Disable')
											disablePlacements++
										else if (placementResult[i].status === 'Enable')
											enablePlacements++
									}

									clicks = statisticsResult.click.length
									impressions = statisticsResult.view.length
									reports = statisticsResult.report.length
									revenue = accountResult.publisherAccount.credit

									for (var i = 0; i < statisticsResult.click.length; i++) {
										if (statisticsResult.click[i].actionInfo.time < nowTime && statisticsResult.click[i].actionInfo.time > todayTime)
											todayClicks++
										if (statisticsResult.click[i].actionInfo.time < todayTime && statisticsResult.click[i].actionInfo.time > yesterdayTime)
											yesterdayClicks++
										if (statisticsResult.click[i].actionInfo.time < nowTime && statisticsResult.click[i].actionInfo.time > lastWeekTime)
											lastWeekClicks++
									}

									for (var i = 0; i < transactionResult.length; i++) {
										if (transactionResult[i].status === 'Open')
											openTransactions++
										if (transactionResult[i].status === 'Checkout')
											checkoutTransactions++
									}

									$("#userGreeting").html("Welcome, " + accountResult.username.charAt(0).toUpperCase() + accountResult.username.slice(1) + "!");

									$("#today_clicks").html(todayClicks);
									$("#yesterday_clicks").html(yesterdayClicks);
									$("#last_week_clicks").html(lastWeekClicks);

									$("#total_apps").html(totalApps);
									$("#disable_apps").html(disableApps);
									$("#enable_apps").html(enableApps);

									$("#total_placements").html(totalPlacements);
									$("#disable_placements").html(disablePlacements);
									$("#enable_placements").html(enablePlacements);

									$("#publisherUsername").html(accountResult.companyName);
									$("#publisherEmail").html(accountResult.email);

									$("#dashboard_click").attr({
										"data-to": clicks
									});
									$("#dashboard_view").attr({
										"data-to": impressions
									});
									$("#dashboard_report").attr({
										"data-to": reports
									});
									$("#dashboard_revenue").attr({
										"data-to": revenue
									});

									$("#checkoutTransactions").attr({
										"data-to": checkoutTransactions
									});
									$("#openTransactions").attr({
										"data-to": openTransactions
									});

									Morris.Donut({
											element: 'donut_device',
											data: [{
													label: 'Phone',
													value: 100
											}, {
															label: 'Tablet',
															value: 0
													}, {
															label: 'Application',
															value: 0
													}, {
															label: 'Web',
															value: 0
													}],
											colors: ['rgb(233, 30, 99)', 'rgb(0, 188, 212)', 'rgb(255, 152, 0)', 'rgb(0, 150, 136)'],
											formatter: function (y) {
													return y + '%'
											}
									});

									Morris.Donut({
											element: 'donut_os',
											data: [{
													label: 'Android',
													value: 0
											}, {
															label: 'iOS',
															value: 100
													}, {
															label: 'WP',
															value: 0
													}, {
															label: 'HTML',
															value: 0
													}, {
															label: 'Unix',
															value: 0
													}, {
															label: 'Windows',
															value: 0
													}],
											colors: ['rgb(255, 152, 0)', 'rgb(0, 150, 136)', 'rgb(233, 30, 99)', 'rgb(0, 188, 212)', 'rgb(233, 30, 99)', 'rgb(0, 188, 212)'],
											formatter: function (y) {
													return y + '%'
											}
									});

									Morris.Donut({
											element: 'donut_connection',
											data: [{
													label: 'WiFi',
													value: 100
											}, {
															label: 'Cellular',
															value: 0
													}],
											colors: ['rgb(255, 152, 0)', 'rgb(0, 188, 212)'],
											formatter: function (y) {
													return y + '%'
											}
									});

									Morris.Donut({
											element: 'donut_user',
											data: [{
													label: 'General',
													value: 0
											}, {
															label: 'Average',
															value: 100
													}, {
															label: 'Advance',
															value: 0
													}],
											colors: ['rgb(0, 150, 136)', 'rgb(0, 188, 212)', 'rgb(255, 152, 0)'],
											formatter: function (y) {
													return y + '%'
											}
									});

									$('.page-loader-wrapper').fadeOut();
									$('.count-to').countTo();

								},
								error: function (xhr, status, error) {
									$('.page-loader-wrapper').fadeOut();
									alert(xhr.responseText);
								}
							});
						},
						error: function (xhr, status, error) {
							$('.page-loader-wrapper').fadeOut();
							alert(xhr.responseText);
						}
					});
				},
				error: function (xhr, status, error) {
					$('.page-loader-wrapper').fadeOut();
					alert(xhr.responseText);
				}
			});
		},
		error: function (xhr, status, error) {
			$('.page-loader-wrapper').fadeOut();
			alert(xhr.responseText);
		}
	});

	$("#signOutButton").click(function (e) {
		e.preventDefault();
		localStorage.clear()
		return window.location.href = '../AAA/sign-in.html'
	})

	$("#checkoutRedirect").click(function (e) {
		e.preventDefault();
		return window.location.href = 'checkout.html'
	})

	$("#newApplicationRedirect").click(function (e) {
		e.preventDefault();
		return window.location.href = 'application.html#newApplication'
	})

	$("#addPlacementRedirect").click(function (e) {
		e.preventDefault();
		return window.location.href = 'placement.html#addPlacement'
	})

});

redpajama_set_name: RedPajamaGithub


text:
#include "DAP_config.h"
#include "DAP.h"
#include "info.h"
#include "main.h"
#include <string.h>

//**************************************************************************************************
/**
\defgroup DAP_Vendor_Adapt_gr Adapt Vendor Commands
\ingroup DAP_Vendor_gr
@{

The file DAP_vendor.c provides template source code for extension of a Debug Unit with
Vendor Commands. Copy this file to the project folder of the Debug Unit and add the
file to the MDK-ARM project under the file group Configuration.
*/

/** Process DAP Vendor Command and prepare Response Data
\param request   pointer to request data
\param response  pointer to response data
\return          number of bytes in response (lower 16 bits)
                 number of bytes in request (upper 16 bits)
*/
uint32_t DAP_ProcessVendorCommand(const uint8_t *request, uint8_t *response) {
  uint32_t num = (1U << 16) | 1U;

  *response++ = *request;        // copy Command ID

  switch (*request++) {          // first byte in request is Command ID
    case ID_DAP_Vendor0: {
        const char *id_str = info_get_unique_id();
        uint8_t len = strlen(id_str);
        *response++ = len;
        memcpy(response, id_str, len);
        num += (len + 1); // increment response count by ID length + length byte
        break;
    }
    case ID_DAP_Vendor1:  break;
    case ID_DAP_Vendor2:  break;
    case ID_DAP_Vendor3:  break;
    case ID_DAP_Vendor4:  break;
    case ID_DAP_Vendor5:  break;
    case ID_DAP_Vendor6:  break;
    case ID_DAP_Vendor7:  break;
    case ID_DAP_Vendor8: {
        *response = 1;
        if (0 == *request) {
            main_usb_set_test_mode(false);
        } else if (1 == *request) {
            main_usb_set_test_mode(true);
        } else {
            *response = 0;
        }
        num += (1U << 16) | 1U; // increment request and response count each by 1
        break;
    }
    case ID_DAP_Vendor9:  break;
    case ID_DAP_Vendor10: break;
    case ID_DAP_Vendor11: break;
    case ID_DAP_Vendor12: break;
    case ID_DAP_Vendor13: break;
    case ID_DAP_Vendor14: break;
    case ID_DAP_Vendor15: break;
    case ID_DAP_Vendor16: break;
    case ID_DAP_Vendor17: break;
    case ID_DAP_Vendor18: break;
    case ID_DAP_Vendor19: break;
    case ID_DAP_Vendor20: break;
    case ID_DAP_Vendor21: break;
    case ID_DAP_Vendor22: break;
    case ID_DAP_Vendor23: break;
    case ID_DAP_Vendor24: break;
    case ID_DAP_Vendor25: break;
    case ID_DAP_Vendor26: break;
    case ID_DAP_Vendor27: break;
    case ID_DAP_Vendor28: break;
    case ID_DAP_Vendor29: break;
    case ID_DAP_Vendor30: break;
    case ID_DAP_Vendor31: break;
  }

  return (num);
}

///@}


text:
Function Get-PASConnectionComponent {
	[CmdletBinding()]
	param(	)

	BEGIN {

		Assert-VersionRequirement -RequiredVersion 11.5

	}#begin

	PROCESS {

		#Create URL for request
		$URI = "$Script:BaseURI/API/PSM/Connectors"

		#send request to web service
		$result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $Script:WebSession

		if ($null -ne $result.PSMConnectors) {

			$result | Select-Object -ExpandProperty PSMConnectors

		}

	}#process

	END { }#end

}


text:
module KaExtUsers
	class ExtMigration < ActiveRecord::Migration
		def self.connection
			KaExtUsers::Engine::BaseModel.connection
		end
	end
end


text:
  var nextPage = function(){
    var index = swipeReference.getPos();

    deferredContainer[index + 1] = when.defer();

    if (stWrap.children.item(index + 1).getAttribute('data-timestamp') == timestamp){

      deferredContainer[index + 1].promise.then(
          function(value){
          stWrap.children.item(index + 1).setAttribute('data-active', 'true');
          update(value[0],value[1]);
          }
        );
    }
    else{

      var pagePromise = getPageFromIndex(index + 1);

      when.all([pagePromise, deferredContainer[index + 1].promise])
      .then(
        function(values){
          stWrap.children.item(index + 1).innerHTML = values[0].innerHTML;
          stWrap.children.item(index + 1).setAttribute('data-active', 'true');
          stWrap.children.item(index + 1).setAttribute('data-timestamp', timestamp);
          update(values[1][0],values[1][1]);
        }
      );
    }
  };

  var previousPage = function(){
    var index = swipeReference.getPos();

    deferredContainer[index - 1] = when.defer();

    if (stWrap.children.item(index - 1).getAttribute('data-timestamp') == timestamp){

      deferredContainer[index - 1].promise.then(
          function(value){
          stWrap.children.item(index - 1).setAttribute('data-active', 'true');
          update(value[0],value[1]);
          }
        );
    }
    else{

      var pagePromise = getPageFromIndex(index - 1);

      when.all([pagePromise, deferredContainer[index - 1].promise])
      .then(
        function(values){
          stWrap.children.item(index - 1).innerHTML = values[0].innerHTML;
          stWrap.children.item(index - 1).setAttribute('data-active', 'true');
          stWrap.children.item(index - 1).setAttribute('data-timestamp', timestamp);
          update(values[1][0],values[1][1]);
        }
      );
    }
  };

  var goToPage = function(page){

    deferredContainer[page - 1] = when.defer();

    if (stWrap.children.item(page - 1).getAttribute('data-timestamp') == timestamp){

      swipeReference.slide(page-1);
      deferredContainer[page - 1].promise.then(
          function(value){
            var oldElements = stWrap.querySelectorAll('.st-table-wrap[data-active="true"]');
            [].forEach.call(oldElements, function(value){
              value.setAttribute('data-active', 'false');
              value.setAttribute('data-timestamp', '');
              value.innerHTML = 'placeholder';
            });
            stWrap.children.item(page - 1).setAttribute('data-active', 'true');
            update(value[0],value[1]);
          }
        );
    }
    else{

      getPageFromIndex(page-1).then(
        function(value){
          var oldElements = stWrap.querySelectorAll('.st-table-wrap[data-active="true"]');
            [].forEach.call(oldElements, function(value){
              value.setAttribute('data-active', 'false');
              value.setAttribute('data-timestamp', '');
              value.innerHTML = 'placeholder';
            });
          stWrap.children.item(page-1).innerHTML = value.innerHTML;
          stWrap.children.item(page-1).setAttribute('data-active', 'true');
          stWrap.children.item(page-1).setAttribute('data-timestamp', timestamp);
          return when.resolve();
        }
      ).then(
        function(){
          swipeReference.slide(page-1);
          deferredContainer[page - 1].promise.then(
            function(value){
              update(value[0],value[1]);
            });
        }
      );
    }
  };

  var getPageFromIndex = function(index){

    var dataDeferred = when.defer();
    var table;

    if(sortColumn === undefined){
      makeRequest(
        dataProvider,
        {
          page: index + 1,
          timestamp: timestamp
        },
        dataDeferred.resolver
      );
    }
    else{
      makeRequest(
        dataProvider,
        {
          page: index + 1,
          sortField: sortColumn,
          sortAsc: sortAscending
        },
        dataDeferred.resolver
      );
    }

    table = createTable();

    var tablePromise = dataDeferred.promise.then(
      function(value){
        return fillTable(table, value);
      }
    );

    return tablePromise;
  };


text:
import logging
import math
import random
import string

from nose import tools

from ..core import compat
from ..core import driver
from ..core import exceptions

logger = logging.getLogger(__name__)

class Driver(object):

    def __init__(self, scheme=None, path=None, config=None):
        self.scheme = scheme
        self.path = path
        self.config = config

    # Load the requested driver
    def setUp(self):
        storage = driver.fetch(self.scheme)
        self._storage = storage(self.path, self.config)

    def tearDown(self):
        pass

    def gen_random_string(self, length=16):
        return ''.join([random.choice(string.ascii_uppercase + string.digits)
                        for x in range(length)]).lower()

    def simplehelp(self, path, content, expected, size=0):
        self._storage.put_content(path, content)
        assert self._storage.get_content(path) == expected
        assert self._storage.get_content(path) == expected
        if size:
            assert self._storage.get_size(path) == size

    def unicodehelp(self, path, content, expected):
        self._storage.put_unicode(path, content)
        assert self._storage.get_unicode(path) == expected
        assert self._storage.get_unicode(path) == expected

    def jsonhelp(self, path, content, expected):
        self._storage.put_json(path, content)
        assert self._storage.get_json(path) == expected
        assert self._storage.get_json(path) == expected

    def test_exists_non_existent(self):
        filename = self.gen_random_string()
        assert not self._storage.exists(filename)

    def test_exists_existent(self):
        filename = self.gen_random_string()
        self._storage.put_content(filename, b'')
        assert self._storage.exists(filename)

    # get / put
    def test_write_read_1(self):
        filename = self.gen_random_string()
        content = b'a'
        expected = b'a'
        self.simplehelp(filename, content, expected, len(expected))

    def test_write_read_2(self):
        filename = self.gen_random_string()
        content = b'\xc3\x9f'
        expected = b'\xc3\x9f'
        self.simplehelp(filename, content, expected, len(expected))

    def test_write_read_3(self):
        filename = self.gen_random_string()
        content = u'ß'.encode('utf8')
        expected = b'\xc3\x9f'
        self.simplehelp(filename, content, expected, len(expected))

    def test_write_read_4(self):
        filename = self.gen_random_string()
        content = 'ß'
        if compat.is_py2:
            content = content.decode('utf8')
        content = content.encode('utf8')
        expected = b'\xc3\x9f'
        self.simplehelp(filename, content, expected, len(expected))

    def test_write_read_5(self):
        filename = self.gen_random_string()
        content = self.gen_random_string().encode('utf8')
        expected = content
        self.simplehelp(filename, content, expected, len(expected))

    def test_write_read_6(self):
        filename = self.gen_random_string()
        content = self.gen_random_string(1024 * 1024).encode('utf8')
        expected = content
        self.simplehelp(filename, content, expected, len(expected))

    # get / put unicode
    def test_unicode_1(self):
        filename = self.gen_random_string()
        content = 'a'
        expected = u'a'
        self.unicodehelp(filename, content, expected)

    def test_unicode_2(self):
        filename = self.gen_random_string()
        content = b'\xc3\x9f'.decode('utf8')
        expected = u'ß'
        self.unicodehelp(filename, content, expected)

    def test_unicode_3(self):
        filename = self.gen_random_string()
        content = u'ß'
        expected = u'ß'
        self.unicodehelp(filename, content, expected)

    def test_unicode_4(self):
        filename = self.gen_random_string()
        content = 'ß'
        if compat.is_py2:
            content = content.decode('utf8')
        expected = u'ß'
        self.unicodehelp(filename, content, expected)

    def test_unicode_5(self):
        filename = self.gen_random_string()
        content = self.gen_random_string()
        expected = content
        self.unicodehelp(filename, content, expected)

    def test_unicode_6(self):
        filename = self.gen_random_string()
        content = self.gen_random_string(1024 * 1024)
        expected = content
        self.unicodehelp(filename, content, expected)

    # JSON
    def test_json(self):
        filename = self.gen_random_string()
        content = {u"ß": u"ß"}
        expected = {u"ß": u"ß"}
        self.jsonhelp(filename, content, expected)

    # Removes
    def test_remove_existent(self):
        filename = self.gen_random_string()
        content = self.gen_random_string().encode('utf8')
        self._storage.put_content(filename, content)
        self._storage.remove(filename)
        assert not self._storage.exists(filename)

    def test_remove_folder(self):
        dirname = self.gen_random_string()
        filename1 = self.gen_random_string()
        filename2 = self.gen_random_string()
        content = self.gen_random_string().encode('utf8')
        self._storage.put_content('%s/%s' % (dirname, filename1), content)
        self._storage.put_content('%s/%s' % (dirname, filename2), content)
        self._storage.remove(dirname)
        assert not self._storage.exists(filename1)
        assert not self._storage.exists(filename2)
        assert not self._storage.exists(dirname)
        # Check the lru is ok
        try:
            self._storage.get_content(filename1)
            assert False
        except Exception:
            pass

        try:
            self._storage.get_content(filename2)
            assert False
        except Exception:
            pass

    @tools.raises(exceptions.FileNotFoundError)
    def test_remove_inexistent(self):
        filename = self.gen_random_string()
        self._storage.remove(filename)

    @tools.raises(exceptions.FileNotFoundError)
    def test_read_inexistent(self):
        filename = self.gen_random_string()
        self._storage.get_content(filename)

    @tools.raises(exceptions.FileNotFoundError)
    def test_get_size_inexistent(self):
        filename = self.gen_random_string()
        self._storage.get_size(filename)

    def test_stream(self):
        filename = self.gen_random_string()
        # test 7MB
        content = self.gen_random_string(7).encode('utf8')  # * 1024 * 1024
        # test exists
        io = compat.StringIO(content)
        logger.debug("%s should NOT exists still" % filename)
        assert not self._storage.exists(filename)

        self._storage.stream_write(filename, io)
        io.close()

        logger.debug("%s should exist now" % filename)
        assert self._storage.exists(filename)

        # test read / write
        data = compat.bytes()
        for buf in self._storage.stream_read(filename):
            data += buf

        assert content == data

        # test bytes_range only if the storage backend suppports it
        if self._storage.supports_bytes_range:
            b = random.randint(0, math.floor(len(content) / 2))
            bytes_range = (b, random.randint(b + 1, len(content) - 1))
            data = compat.bytes()
            for buf in self._storage.stream_read(filename, bytes_range):
                data += buf
            expected_content = content[bytes_range[0]:bytes_range[1] + 1]
            assert data == expected_content

        # logger.debug("Content length is %s" % len(content))
        # logger.debug("And retrieved content length should equal it: %s" %
        #              len(data))
        # logger.debug("got content %s" % content)
        # logger.debug("got data %s" % data)

        # test remove
        self._storage.remove(filename)
        assert not self._storage.exists(filename)

    @tools.raises(exceptions.FileNotFoundError)
    def test_stream_read_inexistent(self):
        filename = self.gen_random_string()
        data = compat.bytes()
        for buf in self._storage.stream_read(filename):
            data += buf

    @tools.raises(exceptions.FileNotFoundError)
    def test_inexistent_list_directory(self):
        notexist = self.gen_random_string()
        iterator = self._storage.list_directory(notexist)
        next(iterator)

    # XXX only elliptics return StopIteration for now - though we should
    # return probably that for all
    @tools.raises(exceptions.FileNotFoundError, StopIteration)
    def test_empty_list_directory(self):
        path = self.gen_random_string()
        content = self.gen_random_string().encode('utf8')
        self._storage.put_content(path, content)

        iterator = self._storage.list_directory(path)
        next(iterator)

    def test_list_directory(self):
        base = self.gen_random_string()
        filename1 = self.gen_random_string()
        filename2 = self.gen_random_string()
        fb1 = '%s/%s' % (base, filename1)
        fb2 = '%s/%s' % (base, filename2)
        content = self.gen_random_string().encode('utf8')
        self._storage.put_content(fb1, content)
        self._storage.put_content(fb2, content)
        assert sorted([fb1, fb2]
                      ) == sorted(list(self._storage.list_directory(base)))

    # def test_root_list_directory(self):
    #     fb1 = self.gen_random_string()
    #     fb2 = self.gen_random_string()
    #     content = self.gen_random_string()
    #     self._storage.put_content(fb1, content)
    #     self._storage.put_content(fb2, content)
    #     print(list(self._storage.list_directory()))
    #     assert sorted([fb1, fb2]
    #                   ) == sorted(list(self._storage.list_directory()))

    @tools.raises(exceptions.FileNotFoundError, StopIteration)
    def test_empty_after_remove_list_directory(self):
        base = self.gen_random_string()
        filename1 = self.gen_random_string()
        filename2 = self.gen_random_string()
        fb1 = '%s/%s' % (base, filename1)
        fb2 = '%s/%s' % (base, filename2)
        content = self.gen_random_string().encode('utf8')
        self._storage.put_content(fb1, content)
        self._storage.put_content(fb2, content)

        self._storage.remove(fb1)
        self._storage.remove(fb2)

        iterator = self._storage.list_directory(base)
        next(iterator)

    def test_paths(self):
        namespace = 'namespace'
        repository = 'repository'
        tag = 'sometag'
        image_id = 'imageid'
        p = self._storage.images_list_path(namespace, repository)
        assert not self._storage.exists(p)
        p = self._storage.image_json_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_mark_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_checksum_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_layer_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_ancestry_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_files_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.image_diff_path(image_id)
        assert not self._storage.exists(p)
        p = self._storage.repository_path(namespace, repository)
        assert not self._storage.exists(p)
        p = self._storage.tag_path(namespace, repository)
        assert not self._storage.exists(p)
        p = self._storage.tag_path(namespace, repository, tag)
        assert not self._storage.exists(p)
        p = self._storage.repository_json_path(namespace, repository)
        assert not self._storage.exists(p)
        p = self._storage.repository_tag_json_path(namespace, repository, tag)
        assert not self._storage.exists(p)
        p = self._storage.index_images_path(namespace, repository)
        assert not self._storage.exists(p)
        p = self._storage.private_flag_path(namespace, repository)
        assert not self._storage.exists(p)


text:
using EspaceClient.BackOffice.Silverlight.ViewModels.GestionClient.DemandeContact;
using EspaceClient.BackOffice.Silverlight.ViewModels.GestionClient.DemandeContact.Tabs.Details;

namespace EspaceClient.BackOffice.Silverlight.ViewModels.ModelBuilders.GestionClient.DemandeContact.Details
{
    public interface IModelBuilderInformation
    {
        InformationViewModel Build(DemandeContactEntityViewModel demandeContactEntityViewModel);
    }
}


text:
using System;
using System.Collections.Generic;

using Xamarin.Forms;

namespace Etherify.LightWallet.Views
{
	public partial class SearchExistentAccountsPage : ContentPage
	{
		public SearchExistentAccountsPage ()
		{
			InitializeComponent ();
		}
	}
}


text:
namespace fl2d {

    //==============================================================
    // Constructor / Destructor
    //==============================================================

    //--------------------------------------------------------------
    flColorSlider::flColorSlider(float width_, bool alphaEnabled) {
        //ofLog() << "[flColorSlider]flColorSlider()";

        _target = this;
        name("flColorSlider");

        float width = width_ - 15;
        float height = 18 + 2;

        //------------------------------------------
        flGraphics* g;
        g = graphics();
//        g->enabledSmoothing(true);
        g->clear();
//        g->lineStyle(1, flDefinition::UI_BORDER_NORMAL_COLOR.getHex());
        if(alphaEnabled) {
            g->drawRect(0, 0, width_, 18 * 4 + 2 * 3);
        } else {
            g->drawRect(0, 0, width_, 18 * 3 + 2 * 2);
        }
        g->endFill();
        //------------------------------------------

        //------------------------------------------
        redSlider = new flSlider(width, 0, 255);
        redSlider->x(0);
        redSlider->y(height * 0);
        redSlider->value(255);
        redSlider->roundEnabled(true);
        redSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(redSlider);
        greenSlider = new flSlider(width, 0, 255);
        greenSlider->x(0);
        greenSlider->y(height * 1);
        greenSlider->value(255);
        greenSlider->roundEnabled(true);
        greenSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(greenSlider);
        blueSlider = new flSlider(width, 0, 255);
        blueSlider->x(0);
        blueSlider->y(height * 2);
        blueSlider->value(255);
        blueSlider->roundEnabled(true);
        blueSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(blueSlider);
        alphaSlider = NULL;
        if(alphaEnabled == true) {
            alphaSlider = new flSlider(width, 0, 255);
            alphaSlider->x(0);
            alphaSlider->y(height * 3);
            alphaSlider->value(255);
            alphaSlider->roundEnabled(true);
            alphaSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
            addChild(alphaSlider);
        }
        //------------------------------------------

        //------------------------------------------
        _hexText = new flTextField();
        _hexText->x(0);
        _hexText->y(0);
        _hexText->width(width);
        _hexText->autoSize(flTextFieldAutoSize::RIGHT);
        _hexText->textColor(0x0);
        _hexText->text("");
        _hexText->mouseEnabled(false);
        //addChild(_hexText);
        //------------------------------------------

        //------------------------------------------
        _redLabel = new flTextField();
        _redLabel->x(width + 3);
        _redLabel->y(height * 0);
        _redLabel->width(15);
        _redLabel->autoSize(flTextFieldAutoSize::CENTER);
        _redLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _redLabel->text("R");
        _redLabel->mouseEnabled(false);
        addChild(_redLabel);
        _greenLabel = new flTextField();
        _greenLabel->x(width + 3);
        _greenLabel->y(height * 1);
        _greenLabel->width(15);
        _greenLabel->autoSize(flTextFieldAutoSize::CENTER);
        _greenLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _greenLabel->text("G");
        _greenLabel->mouseEnabled(false);
        addChild(_greenLabel);
        _blueLabel = new flTextField();
        _blueLabel->x(width + 3);
        _blueLabel->y(height * 2);
        _blueLabel->width(15);
        _blueLabel->autoSize(flTextFieldAutoSize::CENTER);
        _blueLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _blueLabel->text("B");
        _blueLabel->mouseEnabled(false);
        addChild(_blueLabel);
        if(alphaEnabled == true) {
            _alphaLabel = new flTextField();
            _alphaLabel->x(width + 3);
            _alphaLabel->y(height * 3);
            _alphaLabel->width(15);
            _alphaLabel->autoSize(flTextFieldAutoSize::CENTER);
            _alphaLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
            _alphaLabel->text("A");
            _alphaLabel->mouseEnabled(false);
            addChild(_alphaLabel);
        }
        //------------------------------------------

        //------------------------------------------
        _colorValue.r = redSlider->value();
        _colorValue.g = greenSlider->value();
        _colorValue.b = blueSlider->value();
        _colorValue.a = 255;
        if(alphaEnabled == true) {
            _colorValue.a = alphaSlider->value();
        }
        _hexValue = _colorValue.getHex();
        _hexText->text(ofToString(_hexValue));
        //------------------------------------------

        _updateColor();
    }

    //--------------------------------------------------------------
    flColorSlider::flColorSlider(int red, int green, int blue) {
        //ofLog() << "[flColorSlider]flColorSlider()";

        float width = 200 - 15;

        _target = this;
        name("flColorSlider");

        float height = 18 + 2;

        //------------------------------------------
        flGraphics* g;
        g = graphics();
        //        g->enabledSmoothing(true);
        g->clear();
//        g->lineStyle(1, flDefinition::UI_BORDER_NORMAL_COLOR.getHex());
        g->drawRect(0, 0, width, 18 * 3 + 2 * 2);
        g->endFill();
        //------------------------------------------

        //------------------------------------------
        redSlider = new flSlider(width, 0, 255);
        redSlider->x(0);
        redSlider->y(height * 0);
        redSlider->value(red);
        redSlider->roundEnabled(true);
        redSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(redSlider);
        greenSlider = new flSlider(width, 0, 255);
        greenSlider->x(0);
        greenSlider->y(height * 1);
        greenSlider->value(green);
        greenSlider->roundEnabled(true);
        greenSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(greenSlider);
        blueSlider = new flSlider(width, 0, 255);
        blueSlider->x(0);
        blueSlider->y(height * 2);
        blueSlider->value(blue);
        blueSlider->roundEnabled(true);
        blueSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(blueSlider);
        alphaSlider = NULL;
        //------------------------------------------

        //------------------------------------------
        _hexText = new flTextField();
        _hexText->x(0);
        _hexText->y(0);
        _hexText->width(width);
        _hexText->autoSize(flTextFieldAutoSize::RIGHT);
        _hexText->textColor(0x0);
        _hexText->text("");
        _hexText->mouseEnabled(false);
        //addChild(_hexText);
        //------------------------------------------

        //------------------------------------------
        _redLabel = new flTextField();
        _redLabel->x(width + 3);
        _redLabel->y(height * 0);
        _redLabel->width(15);
        _redLabel->autoSize(flTextFieldAutoSize::CENTER);
        _redLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _redLabel->text("R");
        _redLabel->mouseEnabled(false);
        addChild(_redLabel);
        _greenLabel = new flTextField();
        _greenLabel->x(width + 3);
        _greenLabel->y(height * 1);
        _greenLabel->width(15);
        _greenLabel->autoSize(flTextFieldAutoSize::CENTER);
        _greenLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _greenLabel->text("G");
        _greenLabel->mouseEnabled(false);
        addChild(_greenLabel);
        _blueLabel = new flTextField();
        _blueLabel->x(width + 3);
        _blueLabel->y(height * 2);
        _blueLabel->width(15);
        _blueLabel->autoSize(flTextFieldAutoSize::CENTER);
        _blueLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _blueLabel->text("B");
        _blueLabel->mouseEnabled(false);
        addChild(_blueLabel);
        _alphaLabel = NULL;
        //------------------------------------------

        //------------------------------------------
        _colorValue.r = redSlider->value();
        _colorValue.g = greenSlider->value();
        _colorValue.b = blueSlider->value();
        _colorValue.a = 255;
        _hexValue = _colorValue.getHex();
        _hexText->text(ofToString(_hexValue));
        //------------------------------------------

        _updateColor();
    }

    //--------------------------------------------------------------
    flColorSlider::flColorSlider(int red, int green, int blue, int alpha) {
        //ofLog() << "[flColorSlider]flColorSlider()";

        float width = 200 - 15;

        _target = this;
        name("flColorSlider");

        float height = 18 + 2;

        //------------------------------------------
        flGraphics* g;
        g = graphics();
        //        g->enabledSmoothing(true);
        g->clear();
//        g->lineStyle(1, flDefinition::UI_BORDER_NORMAL_COLOR.getHex());
        g->drawRect(0, 0, width, 18 * 4 + 2 * 3);
        g->endFill();
        //------------------------------------------

        //------------------------------------------
        redSlider = new flSlider(width, 0, 255);
        redSlider->x(0);
        redSlider->y(height * 0);
        redSlider->value(red);
        redSlider->roundEnabled(true);
        redSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(redSlider);
        greenSlider = new flSlider(width, 0, 255);
        greenSlider->x(0);
        greenSlider->y(height * 1);
        greenSlider->value(green);
        greenSlider->roundEnabled(true);
        greenSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(greenSlider);
        blueSlider = new flSlider(width, 0, 255);
        blueSlider->x(0);
        blueSlider->y(height * 2);
        blueSlider->value(blue);
        blueSlider->roundEnabled(true);
        blueSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(blueSlider);
        alphaSlider = new flSlider(width, 0, 255);
        alphaSlider->x(0);
        alphaSlider->y(height * 3);
        alphaSlider->value(alpha);
        alphaSlider->roundEnabled(true);
        alphaSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(alphaSlider);
        //------------------------------------------

        //------------------------------------------
        _hexText = new flTextField();
        _hexText->x(0);
        _hexText->y(0);
        _hexText->width(width);
        _hexText->autoSize(flTextFieldAutoSize::RIGHT);
        _hexText->textColor(0x0);
        _hexText->text("");
        _hexText->mouseEnabled(false);
        //addChild(_hexText);
        //------------------------------------------

        //------------------------------------------
        _redLabel = new flTextField();
        _redLabel->x(width + 3);
        _redLabel->y(height * 0);
        _redLabel->width(15);
        _redLabel->autoSize(flTextFieldAutoSize::CENTER);
        _redLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _redLabel->text("R");
        _redLabel->mouseEnabled(false);
        addChild(_redLabel);
        _greenLabel = new flTextField();
        _greenLabel->x(width + 3);
        _greenLabel->y(height * 1);
        _greenLabel->width(15);
        _greenLabel->autoSize(flTextFieldAutoSize::CENTER);
        _greenLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _greenLabel->text("G");
        _greenLabel->mouseEnabled(false);
        addChild(_greenLabel);
        _blueLabel = new flTextField();
        _blueLabel->x(width + 3);
        _blueLabel->y(height * 2);
        _blueLabel->width(15);
        _blueLabel->autoSize(flTextFieldAutoSize::CENTER);
        _blueLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _blueLabel->text("B");
        _blueLabel->mouseEnabled(false);
        addChild(_blueLabel);
        _alphaLabel = new flTextField();
        _alphaLabel->x(width + 3);
        _alphaLabel->y(height * 3);
        _alphaLabel->width(15);
        _alphaLabel->autoSize(flTextFieldAutoSize::CENTER);
        _alphaLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _alphaLabel->text("A");
        _alphaLabel->mouseEnabled(false);
        addChild(_alphaLabel);
        //------------------------------------------

        //------------------------------------------
        _colorValue.r = redSlider->value();
        _colorValue.g = greenSlider->value();
        _colorValue.b = blueSlider->value();
        _colorValue.a = alphaSlider->value();
        _hexValue = _colorValue.getHex();
        _hexText->text(ofToString(_hexValue));
        //------------------------------------------

        _updateColor();
    }

    //--------------------------------------------------------------
    flColorSlider::flColorSlider(float width_, int red, int green, int blue, int alpha) {
        //ofLog() << "[flColorSlider]flColorSlider()";

        _target = this;
        name("flColorSlider");

        float width = width_ - 15;
        float height = 18 + 2;

        //------------------------------------------
        flGraphics* g;
        g = graphics();
        //        g->enabledSmoothing(true);
        g->clear();
//        g->lineStyle(1, flDefinition::UI_BORDER_NORMAL_COLOR.getHex());
        g->drawRect(0, 0, width, 18 * 4 + 2 * 3);
        g->endFill();
        //------------------------------------------

        //------------------------------------------
        redSlider = new flSlider(width, 0, 255);
        redSlider->x(0);
        redSlider->y(height * 0);
        redSlider->value(red);
        redSlider->roundEnabled(true);
        redSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(redSlider);
        greenSlider = new flSlider(width, 0, 255);
        greenSlider->x(0);
        greenSlider->y(height * 1);
        greenSlider->value(green);
        greenSlider->roundEnabled(true);
        greenSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(greenSlider);
        blueSlider = new flSlider(width, 0, 255);
        blueSlider->x(0);
        blueSlider->y(height * 2);
        blueSlider->value(blue);
        blueSlider->roundEnabled(true);
        blueSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(blueSlider);
        alphaSlider = new flSlider(width, 0, 255);
        alphaSlider->x(0);
        alphaSlider->y(height * 3);
        alphaSlider->value(alpha);
        alphaSlider->roundEnabled(true);
        alphaSlider->addEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
        addChild(alphaSlider);
        //------------------------------------------

        //------------------------------------------
        _hexText = new flTextField();
        _hexText->x(0);
        _hexText->y(0);
        _hexText->width(width);
        _hexText->autoSize(flTextFieldAutoSize::RIGHT);
        _hexText->textColor(0x0);
        _hexText->text("");
        _hexText->mouseEnabled(false);
        //addChild(_hexText);
        //------------------------------------------

        //------------------------------------------
        _redLabel = new flTextField();
        _redLabel->x(width + 3);
        _redLabel->y(height * 0);
        _redLabel->width(15);
        _redLabel->autoSize(flTextFieldAutoSize::CENTER);
        _redLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _redLabel->text("R");
        _redLabel->mouseEnabled(false);
        addChild(_redLabel);
        _greenLabel = new flTextField();
        _greenLabel->x(width + 3);
        _greenLabel->y(height * 1);
        _greenLabel->width(15);
        _greenLabel->autoSize(flTextFieldAutoSize::CENTER);
        _greenLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _greenLabel->text("G");
        _greenLabel->mouseEnabled(false);
        addChild(_greenLabel);
        _blueLabel = new flTextField();
        _blueLabel->x(width + 3);
        _blueLabel->y(height * 2);
        _blueLabel->width(15);
        _blueLabel->autoSize(flTextFieldAutoSize::CENTER);
        _blueLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _blueLabel->text("B");
        _blueLabel->mouseEnabled(false);
        addChild(_blueLabel);
        _alphaLabel = new flTextField();
        _alphaLabel->x(width + 3);
        _alphaLabel->y(height * 3);
        _alphaLabel->width(15);
        _alphaLabel->autoSize(flTextFieldAutoSize::CENTER);
        _alphaLabel->textColor(flDefinition::UI_LABEL_NORMAL_COLOR);
        _alphaLabel->text("A");
        _alphaLabel->mouseEnabled(false);
        addChild(_alphaLabel);
        //------------------------------------------

        //------------------------------------------
        _colorValue.r = redSlider->value();
        _colorValue.g = greenSlider->value();
        _colorValue.b = blueSlider->value();
        _colorValue.a = alphaSlider->value();
        _hexValue = _colorValue.getHex();
        _hexText->text(ofToString(_hexValue));
        //------------------------------------------

        _updateColor();
    }

    //--------------------------------------------------------------
    flColorSlider::~flColorSlider() {
        //ofLog() << "[flColorSlider]~flColorSlider()";

		if (redSlider != NULL) {
			removeChild(redSlider);
			redSlider->removeEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
			delete redSlider;
			redSlider = NULL;
		}

		if (greenSlider != NULL) {
			removeChild(greenSlider);
			greenSlider->removeEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
			delete greenSlider;
			greenSlider = NULL;
		}

		if (blueSlider != NULL) {
			removeChild(blueSlider);
			blueSlider->removeEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
			delete blueSlider;
			blueSlider = NULL;
		}

        if(alphaSlider != NULL) {
			removeChild(alphaSlider);
			alphaSlider->removeEventListener(flSliderEvent::CHANGE, this, &flColorSlider::_eventHandler);
            delete alphaSlider;
            alphaSlider = NULL;
        }

		if (_hexText != NULL) {
			removeChild(_hexText);
			delete _hexText;
			_hexText = NULL;
		}

		if (_redLabel != NULL) {
			removeChild(_redLabel);
			delete _redLabel;
			_redLabel = NULL;
		}

		if (_greenLabel != NULL) {
			removeChild(_greenLabel);
			delete _greenLabel;
			_greenLabel = NULL;
		}

		if (_blueLabel != NULL) {
			removeChild(_blueLabel);
			delete _blueLabel;
			_blueLabel = NULL;
		}

		if (_alphaLabel != NULL) {
			removeChild(_alphaLabel);
			delete _alphaLabel;
			_alphaLabel = NULL;
		}

        //------------------------------------------
        _floatColorParam = NULL;
        _colorParam = NULL;
        _listeners.unsubscribeAll();
        //------------------------------------------
    }

    //==============================================================
    // Setup / Update / Draw
    //==============================================================

    //--------------------------------------------------------------
    void flColorSlider::_setup() {
        //ofLog() << "[flColorSlider]setup()";
    }

    //--------------------------------------------------------------
    void flColorSlider::_update() {
        flUIBase::_update();

        _bChangedByOfParm["value"] = false;
		_bChangedByMyself["value"] = false;
    }

    //--------------------------------------------------------------
    void flColorSlider::_draw() {
//        //--------------------------------------
//        float height = 18 + 2;
//        ofPushStyle();
//        ofSetColor(255, 255, 255);
//        flFont::drawString("R", redSlider->width() + 5, height * 0);
//        flFont::drawString("G", redSlider->width() + 5, height * 1);
//        flFont::drawString("B", redSlider->width() + 5, height * 2);
//        ofPopStyle();
//        //--------------------------------------
    }

    //==============================================================
    // Public Method
    //==============================================================

    //--------------------------------------------------------------
    void flColorSlider::label(flTextField* value) {
        _label = value;
        redSlider->label(_label);
        greenSlider->label(_label);
        blueSlider->label(_label);
        if(alphaSlider != NULL) alphaSlider->label(_label);
    }

    //--------------------------------------------------------------
    void flColorSlider::enabled(bool value) {
        _enabled = value;
        mouseChildren(_enabled);

//        mouseEnabled(_enabled);
        redSlider->enabled(_enabled);
        greenSlider->enabled(_enabled);
        blueSlider->enabled(_enabled);
        if(alphaSlider != NULL) alphaSlider->enabled(_enabled);
    }

    //--------------------------------------------------------------
    ofColor flColorSlider::colorValue() { return _colorValue; }
    void flColorSlider::colorValue(ofColor value, bool dispatch) {
//        ofLog() << "[flColorSlider]colorValue()";

        redSlider->value(value.r, dispatch);
        greenSlider->value(value.g, dispatch);
        blueSlider->value(value.b, dispatch);
        if(alphaSlider != NULL) alphaSlider->value(value.a, dispatch);
    }

    //--------------------------------------------------------------
    int flColorSlider::hexValue() { return _hexValue; }
    void flColorSlider::hexValue(int value, bool dispatch) {
        ofColor tempValue = _colorValue;
        tempValue.setHex(value);

        redSlider->value(tempValue.r, dispatch);
        greenSlider->value(tempValue.g, dispatch);
        blueSlider->value(tempValue.b, dispatch);
        if(alphaSlider != NULL) alphaSlider->value(tempValue.a, dispatch);
    }

    //--------------------------------------------------------------
    int flColorSlider::redValue() { return _colorValue.r; }
    void flColorSlider::redValue(int value, bool dispatch) {
        redSlider->value(value, dispatch);
    }

    //--------------------------------------------------------------
    int flColorSlider::greenValue() { return _colorValue.g; }
    void flColorSlider::greenValue(int value, bool dispatch) {
        greenSlider->value(value, dispatch);
    }

    //--------------------------------------------------------------
    int flColorSlider::blueValue() { return _colorValue.b; }
    void flColorSlider::blueValue(int value, bool dispatch) {
        blueSlider->value(value, dispatch);
    }

    //--------------------------------------------------------------
    int flColorSlider::alphaValue() { return _colorValue.a; }
    void flColorSlider::alphaValue(int value, bool dispatch) {
        if(alphaSlider != NULL) alphaSlider->value(value, dispatch);
    }

    //==============================================================
    // Protected / Private Method
    //==============================================================

    //--------------------------------------------------------------
    void flColorSlider::_dispatchEvent() {
        flColorSliderEvent* colorSliderEvent = new flColorSliderEvent(flColorSliderEvent::CHANGE);
        colorSliderEvent->__color = _colorValue;
        dispatchEvent(colorSliderEvent);
    }

    //--------------------------------------------------------------
    void flColorSlider::_updateColor() {
//        ofLog() << "[flColorSlider]_updateColor()";
        redSlider->barColor(_colorValue);
        greenSlider->barColor(_colorValue);
        blueSlider->barColor(_colorValue);
        if(alphaSlider != NULL) alphaSlider->barColor(_colorValue);
    }

    //==============================================================
    // Protected / Private Event Handler
    //==============================================================

    //--------------------------------------------------------------
    void flColorSlider::_eventHandler(flEvent& event) {
		if (!_enabled) return;
//        ofLog() << "[flColorSlider]_mouseEventHandler(" << event.type() << ")";
//        ofLog() << "[flColorSlider]this          = " << this << "," << ((flDisplayObject*) this)->name();
//        ofLog() << "[flColorSlider]currentTarget = " << event.currentTarget() << "," << ((flDisplayObject*) event.currentTarget())->name();
//        ofLog() << "[flColorSlider]target        = " << event.target() << "," << ((flDisplayObject*) event.target())->name();

        ofColor preValue = _colorValue;

        //------------------------------------------
        //Update value.
        _colorValue.r = redSlider->value();
        _colorValue.g = greenSlider->value();
        _colorValue.b = blueSlider->value();
        if(alphaSlider != NULL) _colorValue.a = alphaSlider->value();
        _hexValue = _colorValue.getHex();
        //------------------------------------------

        //------------------------------------------
        //Update color.
        _updateColor();
        //------------------------------------------

        //------------------------------------------
        if(preValue != _colorValue) {
            _hexText->text(ofToString(_hexValue, _digit));
            _dispatchEvent();

            if(!_bChangedByOfParm["value"]) {
                if(_floatColorParam != NULL) {
                    _bChangedByMyself["value"] = true;
					_floatColorParam->set(_colorValue);
                }
				else if(_colorParam != NULL) {
                    _bChangedByMyself["value"] = true;
                    _colorParam->set(_colorValue);
                }
            }
        }
        //------------------------------------------
    }

}


text:
Who is using Graphite?
======================

Here are some organizations that use Graphite:

* `Brightcove <http://www.brightcove.com>`_ (see http://opensource.brightcove.com/project/Diamond/)
* `Canonical <http://www.canonical.com>`_
* `Datacratic <http://www.datacratic.com>`_
* `Douban <http://www.douban.com>`_
* `Dyn <http://dyn.com/>`_
* `Etsy <http://www.etsy.com/>`_ (see http://codeascraft.etsy.com/2010/12/08/track-every-release/)
* `GitHub <https://github.com>`_
* `Google <http://google-opensource.blogspot.com/2010/09/get-ready-to-rocksteady.html>`_ (opensource Rocksteady project)
* `ImmobilienScout24 <http://www.immobilienscout24.de/>`_
* `Instagram <http://instagram.com/>`_
* `Media Temple <http://mediatemple.net/>`_
* `Orbitz <http://www.orbitz.com/>`_
* `Sears Holdings <http://www.sears.com/>`_
* `SocialTwist <http://www.socialtwist.com>`_
* `Uber <http://uber.com/>`_
* `Vimeo <http://www.vimeo.com>`_
* `Wikimedia Foundation <http://gdash.wikimedia.org/>`_

And many more


text:
@interface HotAddressListSectionHeader () {
    NSUInteger _section;
}

@end

@implementation HotAddressListSectionHeader

- (instancetype)initWithSize:(CGSize)size isHD:(BOOL)hd isHdMonitored:(BOOL)hdMonitored isHDM:(BOOL)hdm isPrivate:(BOOL)isPrivate section:(NSUInteger)section delegate:(NSObject <SectionHeaderPressedDelegate> *)delegate {
    self = [super initWithFrame:CGRectMake(0, 0, size.width, size.height)];
    if (self) {
        self.delegate = delegate;
        _section = section;
        BOOL folded = NO;
        if (delegate && [delegate respondsToSelector:@selector(isSectionFolded:)]) {
            folded = [delegate isSectionFolded:section];
        }
        [self isHD:hd isHdMonitored:hdMonitored isHDM:hdm isPrivate:isPrivate isFolded:folded];
    }
    return self;
}

- (void)isHD:(BOOL)isHD isHdMonitored:(BOOL)isHdMonitored isHDM:(BOOL)isHDM isPrivate:(BOOL)isPrivate isFolded:(BOOL)isFolded {
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    btn.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    [btn setBackgroundImage:[UIImage imageWithColor:[UIColor parseColor:kBackgroundColor]] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageWithColor:[UIColor parseColor:kBackgroundColorPressed]] forState:UIControlStateHighlighted];
    [btn addTarget:self action:@selector(pressed:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:btn];

    UIImageView *ivIndicator = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"list_item_address_group_indicator"]];
    ivIndicator.frame = CGRectMake(kPadding, (self.frame.size.height - ivIndicator.frame.size.height) / 2, ivIndicator.frame.size.width, ivIndicator.frame.size.height);
    if (isFolded) {
        ivIndicator.transform = CGAffineTransformIdentity;
    } else {
        ivIndicator.transform = CGAffineTransformMakeRotation(M_PI_2);
    }
    ivIndicator.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
    [self addSubview:ivIndicator];

    UIImage *typeImage = nil;
    if (isHD || isHdMonitored) {
        typeImage = [UIImage imageNamed:@"address_type_hd"];
    } else if (isHDM) {
        typeImage = [UIImage imageNamed:@"address_type_hdm"];
    } else if (isPrivate) {
        typeImage = [UIImage imageNamed:@"address_type_private"];
    } else {
        typeImage = [UIImage imageNamed:@"address_type_watchonly"];
    }
    UIImageView *ivType = [[UIImageView alloc] initWithImage:typeImage];
    ivType.contentMode = UIViewContentModeCenter;
    ivType.frame = CGRectMake(self.frame.size.width - self.frame.size.height - kPadding, 0, self.frame.size.height, self.frame.size.height);
    ivType.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
    [self addSubview:ivType];

    UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxY(ivIndicator.frame) + kMargin, 0, self.frame.size.width - ivIndicator.frame.size.width - ivType.frame.size.width - kMargin * 2, self.frame.size.height)];
    lbl.backgroundColor = [UIColor clearColor];
    lbl.font = [UIFont systemFontOfSize:kFontSize];
    lbl.textColor = [UIColor parseColor:kTextColor];
    lbl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    if (isHD) {
        lbl.text = NSLocalizedString(@"address_group_hd", nil);
    } else if (isHdMonitored) {
        lbl.text = NSLocalizedString(@"hd_account_cold_address_list_label", nil);
    } else if (isHDM) {
        if ([BTAddressManager instance].hdmKeychain.isInRecovery) {
            lbl.text = NSLocalizedString(@"address_group_hdm_recovery", nil);
        } else {
            lbl.text = NSLocalizedString(@"address_group_hdm_hot", nil);
        }
    } else if (isPrivate) {
        lbl.text = NSLocalizedString(@"Hot Wallet Address", nil);
    } else {
        lbl.text = NSLocalizedString(@"Cold Wallet Address", nil);
    }
    [self addSubview:lbl];

    if (isHDM) {
        UIButton *btnHDMAdd = [[UIButton alloc] initWithFrame:ivType.frame];
        [btnHDMAdd setBackgroundImage:nil forState:UIControlStateNormal];
        [btnHDMAdd setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.1]] forState:UIControlStateHighlighted];
        [btnHDMAdd setImage:[UIImage imageNamed:@"hdm_button_add_address_normal"] forState:UIControlStateNormal];
        [btnHDMAdd addTarget:self action:@selector(hdmAddPressed:) forControlEvents:UIControlEventTouchUpInside];

        CGRect frame = btnHDMAdd.frame;
        frame.origin.x = frame.origin.x - frame.size.width;
        UIButton *btnHDMSeed = [[UIButton alloc] initWithFrame:frame];
        [btnHDMSeed setBackgroundImage:nil forState:UIControlStateNormal];
        [btnHDMSeed setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.1]] forState:UIControlStateHighlighted];
        [btnHDMSeed setImage:[UIImage imageNamed:@"hdm_button_seed_normal"] forState:UIControlStateNormal];
        [btnHDMSeed addTarget:self action:@selector(hdmSeedPressed:) forControlEvents:UIControlEventTouchUpInside];

        [self addSubview:btnHDMAdd];
        [self addSubview:btnHDMSeed];
        ivType.hidden = YES;
    }
}

- (void)pressed:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(sectionHeaderPressed:)]) {
        [self.delegate sectionHeaderPressed:_section];
    }
}

- (void)hdmAddPressed:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(hdmAddPressed)]) {
        [self.delegate hdmAddPressed];
    }
}

- (void)hdmSeedPressed:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(hdmSeedPressed)]) {
        [self.delegate hdmSeedPressed];
    }
}

@end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <title>Bdferr's post on Simple</title>
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="/spring2014/css/syntax.css">
    <link rel="stylesheet" type="text/css" href="/spring2014/css/monokai.css">
    <link rel="stylesheet" type="text/css" href="/spring2014/css/xq-light.css">
    <link rel="stylesheet" type="text/css" href="/spring2014/css/codemirror.css">

    <link rel="stylesheet" href="/spring2014/css/main.css">
    <link rel="shortcut icon" href="/spring2014/favicon.ico">

    <svg style="position: absolute; top: 0; right: 0; border: 0; z-index:15;" version="1.1" pointer-events="none" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"  width="135px" height="135px" viewBox="0 0 135 135" enable-background="new 0 0 135 135" xml:space="preserve">

        <polygon opacity="00" fill="purple" stroke="#000000" stroke-miterlimit="10" points="135,0 0,0 135,135 " />

    </svg>

SILShack Spring 2014

                    syllabus

                    schedule

                    exercises

                    how-to

                    people

                    feedback

                    music

                    console

Bdferr's post on Simple

by

        	Brendan Ferreri-Hanberry

23 Feb 2014

After beginning this assignment in class on Wednesday, I foolishly re-did one of the commands today in Nitrous,
namely "git clone https://github.com/silshack/simplehack.git," which gave me the error message
"fatal: destination path 'simplehack' already exists and is not an empty directory."
After this, I simply proceeded with the instructions on smartypants' blog, starting from "cd simplehack."
"Git status" confirmed that I had already done the next two steps
in the same box as cd simplehack on smartypants' blog,
so I proceeded with git add . and git commit –m "Created config."
I had already configured my blog, simply accepting defaults in response to several prompts
which I did not know anything about.

My first attempt at ./setupenv1.sh gave me an error message:
"-bash: ./setupenv1.sh: No such file or directory."
However, just as I was about to cast "Summon Grant," I noticed a "trouble" heading on smartypants' blog.
After following its instructions to do "git pull origin master," I did not have any further difficulties
with these setup files.

At first, I attempted to load https://silshack-bdferr.herokuapp.com/ while the last setup file was still being processed
and got an error message; apparently "git push heroku master," at least in this case,
takes quite a while to complete. Now, though, it works!

Next, I wondered if I could embed a video in a blog post on Simple, so I cast "Summon Grant."
Grant explained that there was a standard code for embedding a video, so I consulted the search engine Startpage.com
for information on how to do this. I used Startpage instead of Google because Startpage
at least claims to make more of an effort to protect privacy, e.g. by not recording IP addresses.
I found instructions here
and followed them for the Youtube version of one of my favorite albums. This was not a video in the proper sense,
but there seems to be nothing preventing people from simply uploading studio albums to Youtube
and providing a still image as the "video." I hope this is not a copyright violation.

I also decided to use basic markdown, including italics, lists, and links, in the post.
I was sad to see that the markdown for unordered lists seems to simply indent each item,
rather than producing a bulleted list. I found that this did not give the impression of a list,
but gave the impression that I simply did not know how to use indentation properly.
The same was true of the html <ul> tag, so I switched to an ordered list.

Finally, inspired by Chunxi's pictures of China, I decided to add entertaining images to my blog post.
You can see the final product here.

	Brendan is an MSIS student from Virginia. In his free time, he writes articles about drug policy at ssdp.org/about/blog-contributors/brendan-ferreri-hanberry/ and at the-libertarian.co.uk, where he serves as an editor. Find Brendan Ferreri-Hanberry on Twitter, Github, and on the web.

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

                        INLS 560 - "Programming for Information Professionals"

                        Another silshack by @hauspoor & friends

                        This page was generated on


text:
<?php

declare(strict_types=1);

use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAt;
use Faker\Generator as Faker;

/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(EntityWithAcceptedAt::class, function (Faker $faker) {
    return [
        'name' => $faker->word,
        'accepted_at' => null,
    ];
});


text:
package org.wildfly.swarm.cdi.beanvalidation.test;

import javax.validation.constraints.NotNull;

public class Book {
    private long id;

    @Isbn(message = "ISBN must be set to a valid value")
    private String isbn;

    @NotNull(message = "Title must be set")
    private String title;

    @NotNull(message = "Author must be set")
    private String author;

    public Book(long id, String isbn, String title, String author) {
        this.id = id;
        this.isbn = isbn;
        this.title = title;
        this.author = author;
    }

    public long getId() {
        return id;
    }

    public String getIsbn() {
        return isbn;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }
}


text:
import olympia.core.logger
from olympia import amo
from olympia.search.utils import floor_version

log = olympia.core.logger.getLogger('z.compat')

# This is a list of dictionaries that we should generate compat info for.
# main: the app version we're generating compat info for.
# versions: version numbers to show in comparisons.
# previous: the major version before :main.

if amo.FIREFOX.latest_version:
    # We only generate compatibility info for the last 8 major versions.
    latest_version = int(float(floor_version(amo.FIREFOX.latest_version)))
    FIREFOX_COMPAT = [{
        'main': floor_version(v),
        'versions': (floor_version(v),
                     floor_version(v) + 'a2',
                     floor_version(v) + 'a1'),
        'previous': floor_version(v - 1)
    } for v in range(latest_version, latest_version - 9, -1)]
else:
    # Why don't you have `product_details` like the rest of us?
    log.warning('You are missing `product_details`. '
                'Run `python manage.py update_product_details` now.')

    FIREFOX_COMPAT = {}


text:
package com.lachesis.mnis.core.mybatis.mapper;

import java.util.List;

import com.lachesis.mnis.core.bloodPressMonitor.entity.PatBloodPressMonitor;

public interface BloodPressMonitorMapper {
	/**
	 * 查询血压监测信息
	 * @param press
	 * @return
	 */
	public List<PatBloodPressMonitor> selectBloodPressList(PatBloodPressMonitor press);

	/**
	 * 查询血压监测信息
	 * @param press
	 * @return
	 */
	public PatBloodPressMonitor selectBloodPress(PatBloodPressMonitor press);

	/**
	 * 保存血压监测信息
	 * @param press
	 * @return
	 */
	public void insertBloodPressMonitor(PatBloodPressMonitor press);

	/**
	 * 修改血压监测信息
	 * @param press
	 * @return
	 */
	public void updateBloodPressById(PatBloodPressMonitor press);
}


text:
package debop4s.data.common

/**
 * JDBC Driver Class 명칭
 */
object JdbcDrivers {

  val DATASOURCE_CLASS_H2: String = "org.h2.jdbcx.JdbcDataSource"
  val DRIVER_CLASS_H2: String = "org.h2.Driver"
  val DIALECT_H2: String = "org.hibernate.dialect.H2Dialect"

  val DATASOURCE_CLASS_HSQL: String = "org.hsqldb.jdbc.JDBCDataSource"
  val DRIVER_CLASS_HSQL: String = "org.hsqldb.jdbcDriver"
  val DIALECT_HSQL: String = "org.hibernate.dialect.HSQLDialect"

  val DATASOURCE_CLASS_MYSQL: String = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
  val DRIVER_CLASS_MYSQL: String = "com.mysql.jdbc.Driver"
  val DIALECT_MYSQL: String = "org.hibernate.dialect.MySQL5InnoDBDialect"

  val DRIVER_CLASS_MARIADB: String = "org.mariadb.jdbc.Driver"

  val DATASOURCE_CLASS_POSTGRESQL: String = "org.postgresql.ds.PGSimpleDataSource"
  val DRIVER_CLASS_POSTGRESQL: String = "org.postgresql.Driver"
  val DIALECT_POSTGRESQL: String = "org.hibernate.dialect.PostgreSQL82Dialect"
}


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

namespace ShaderEditorApp.Model.Editor.CSharp
{
	// Simple helper for working with Task<> objects via reflection.
	class TaskReflectionHelper
	{
		private readonly PropertyInfo _resultProperty;

		public TaskReflectionHelper(Type type)
		{
			_resultProperty = typeof(Task<>).MakeGenericType(type).GetProperty("Result");
		}

		public object GetResult(Task t) => _resultProperty.GetValue(t);
	}

	// Simple helper for working with Task<T> objects via reflection.
	class TaskReflectionHelper<T> : TaskReflectionHelper
	{
		public TaskReflectionHelper()
			: base(typeof(T))
		{ }

		public new T GetResult(Task t) => (T)base.GetResult(t);
	}

}


text:
module ActiveStorage::Blob::Representable
  extend ActiveSupport::Concern

  included do
    has_one_attached :preview_image
  end

  # Returns an ActiveStorage::Variant instance with the set of +transformations+ provided. This is only relevant for image
  # files, and it allows any image to be transformed for size, colors, and the like. Example:
  #
  #   avatar.variant(resize_to_limit: [100, 100]).processed.service_url
  #
  # This will create and process a variant of the avatar blob that's constrained to a height and width of 100px.
  # Then it'll upload said variant to the service according to a derivative key of the blob and the transformations.
  #
  # Frequently, though, you don't actually want to transform the variant right away. But rather simply refer to a
  # specific variant that can be created by a controller on-demand. Like so:
  #
  #   <%= image_tag Current.user.avatar.variant(resize_to_limit: [100, 100]) %>
  #
  # This will create a URL for that specific blob with that specific variant, which the ActiveStorage::RepresentationsController
  # can then produce on-demand.
  #
  # Raises ActiveStorage::InvariableError if ImageMagick cannot transform the blob. To determine whether a blob is
  # variable, call ActiveStorage::Blob#variable?.
  def variant(transformations)
    if variable?
      ActiveStorage::Variant.new(self, transformations)
    else
      raise ActiveStorage::InvariableError
    end
  end

  # Returns true if ImageMagick can transform the blob (its content type is in +ActiveStorage.variable_content_types+).
  def variable?
    ActiveStorage.variable_content_types.include?(content_type)
  end

  # Returns an ActiveStorage::Preview instance with the set of +transformations+ provided. A preview is an image generated
  # from a non-image blob. Active Storage comes with built-in previewers for videos and PDF documents. The video previewer
  # extracts the first frame from a video and the PDF previewer extracts the first page from a PDF document.
  #
  #   blob.preview(resize_to_limit: [100, 100]).processed.service_url
  #
  # Avoid processing previews synchronously in views. Instead, link to a controller action that processes them on demand.
  # Active Storage provides one, but you may want to create your own (for example, if you need authentication). Here's
  # how to use the built-in version:
  #
  #   <%= image_tag video.preview(resize_to_limit: [100, 100]) %>
  #
  # This method raises ActiveStorage::UnpreviewableError if no previewer accepts the receiving blob. To determine
  # whether a blob is accepted by any previewer, call ActiveStorage::Blob#previewable?.
  def preview(transformations)
    if previewable?
      ActiveStorage::Preview.new(self, transformations)
    else
      raise ActiveStorage::UnpreviewableError
    end
  end

  # Returns true if any registered previewer accepts the blob. By default, this will return true for videos and PDF documents.
  def previewable?
    ActiveStorage.previewers.any? { |klass| klass.accept?(self) }
  end

  # Returns an ActiveStorage::Preview for a previewable blob or an ActiveStorage::Variant for a variable image blob.
  #
  #   blob.representation(resize_to_limit: [100, 100]).processed.service_url
  #
  # Raises ActiveStorage::UnrepresentableError if the receiving blob is neither variable nor previewable. Call
  # ActiveStorage::Blob#representable? to determine whether a blob is representable.
  #
  # See ActiveStorage::Blob#preview and ActiveStorage::Blob#variant for more information.
  def representation(transformations)
    case
    when previewable?
      preview transformations
    when variable?
      variant transformations
    else
      raise ActiveStorage::UnrepresentableError
    end
  end

  # Returns true if the blob is variable or previewable.
  def representable?
    variable? || previewable?
  end
end


text:
package unleash

import (
	"encoding/json"
	"fmt"
	"os"
)

// Storage is an interface that can be implemented in order to have control over how
// the repository of feature toggles is persisted.
type Storage interface {
	// Init is called to initialize the storage implementation. The backupPath
	// is used to specify the location the data should be stored and the appName
	// can be used in naming.
	Init(backupPath string, appName string)

	// Reset is called after the repository has fetched the feature toggles from the server.
	// If persist is true the implementation of this function should call Persist(). The data
	// passed in here should be owned by the implementer of this interface.
	Reset(data map[string]interface{}, persist bool) error

	// Load is called to load the data from persistent storage and hold it in memory for fast
	// querying.
	Load() error

	// Persist is called when the data in the storage implementation should be persisted to disk.
	Persist() error

	// Get returns the data for the specified feature toggle.
	Get(string) (interface{}, bool)
}

type defaultStorage struct {
	appName string
	path    string
	data    map[string]interface{}
}

func (ds *defaultStorage) Init(backupPath, appName string) {
	ds.appName = appName
	ds.path = fmt.Sprintf("%sunleash-repo-schema-v1-%s.json", backupPath, appName)
	ds.data = map[string]interface{}{}
	ds.Load()
}

func (ds *defaultStorage) Reset(data map[string]interface{}, persist bool) error {
	ds.data = data
	if persist {
		return ds.Persist()
	}
	return nil
}

func (ds *defaultStorage) Load() error {
	if file, err := os.Open(ds.path); err != nil {
		return err
	} else {
		dec := json.NewDecoder(file)
		if err := dec.Decode(&ds.data); err != nil {
			return err
		}
	}
	return nil
}

func (ds *defaultStorage) Persist() error {
	if file, err := os.Create(ds.path); err != nil {
		return err
	} else {
		defer file.Close()
		enc := json.NewEncoder(file)
		if err := enc.Encode(ds.data); err != nil {
			return err
		}
	}
	return nil
}

func (ds defaultStorage) Get(key string) (interface{}, bool) {
	val, ok := ds.data[key]
	return val, ok
}


text:
<!DOCTYPE html >

          <title>Placeholder - org.widok.widgets.Placeholder</title>
          <meta name="description" content="Placeholder - org.widok.widgets.Placeholder" />
          <meta name="keywords" content="Placeholder org.widok.widgets.Placeholder" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.widok.widgets

Placeholder

Related Doc:
            package widgets

        object

        Placeholder

Based upon angular-placeholders (Josh David Miller)

See also

https://github.com/joshdmiller/angular-placeholders

          Linear Supertypes

AnyRef, Any

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

Placeholder

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Type Members

        case class

        Size(width: Int, height: Int) extends Product with Serializable

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        apply(text: String, size: Size, textSize: Int = 10, fillColour: String = "#EEEEEE", textColour: String = "#AAAAAA"): Image

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        calculateTextSize(textSize: Int, size: Size): Int

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        draw(text: String, size: Size, textSize: Int, fillColour: String, textColour: String): String

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
A composer plugin to install third-party PHPCS standards, especially those which
do not use the composer package type.

## Build Status
[![Build Status](https://travis-ci.org/timoschaefer/phpcs-standards-installer.svg)](https://travis-ci.org/timoschaefer/phpcs-standards-installer)

---

## Why?
Because installing PHPCS globally is not always an option, and manually copying
full standard sets or referencing their `ruleset.xml` files by full name is a pain.

Referencing or globally installing a Composer plugin is a walk in the park comparatively.

## How does it work?
By copying/symlinking the code standard directory containing the standard's sniffs to
the PHPCS `Standards` folder it is available to reference like those that ship with PHPCS.

My use case was the installation of [Slevomat Coding Standard](https://github.com/slevomat/coding-standard),
and cherry-picking its sniffs, which becomes really cumbersome. By making it available the sniffs
can be referenced simply by name.

## Installation
You've got the option of either referencing the plugin in your project's `composer.json` file,
causing it to be used for that **project only**:

```json
{
    "require": {
        "ts/phpcs-standards-installer": "^1.0"
    }
}
```

Or installing the plugin globally, in which case it'll be used for every Composer run
without the need to reference the plugin again:
```bash
composer global require "ts/phpcs-standards-installer:^1.0"
```

## Disclaimer
Slapped together within an hour to scratch a personal itch.

## License
Released under the [MIT License](./LICENSE).


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Interactivity;
using System.Windows;
using System.Windows.Input;

namespace Jabbr.WPF.Markup.Triggers
{
    public class InputBindingTrigger : TriggerBase<FrameworkElement>, ICommand
    {
        public InputBinding InputBinding
        {
            get { return (InputBinding)GetValue(InputBindingProperty); }
            set { SetValue(InputBindingProperty, value); }
        }

        public static readonly DependencyProperty InputBindingProperty =
            DependencyProperty.Register("InputBinding", typeof(InputBinding)
            , typeof(InputBindingTrigger)
            , new UIPropertyMetadata(null));

        protected override void OnAttached()
        {
            if (InputBinding != null)
            {
                InputBinding.Command = this;
                AssociatedObject.InputBindings.Add(InputBinding);
            }
            base.OnAttached();
        }

        public bool CanExecute(object parameter)
        {
            // action is anyway blocked by Caliburn at the invoke level
            return true;
        }

        public event EventHandler CanExecuteChanged = delegate { };

        public void Execute(object parameter)
        {
            InvokeActions(parameter);
        }
    }
}


text:
package Paws::Route53::UpdateTrafficPolicyComment;
  use Moose;
  has Comment => (is => 'ro', isa => 'Str', required => 1);
  has Id => (is => 'ro', isa => 'Str', uri_name => 'Id', traits => ['ParamInURI'], required => 1);
  has Version => (is => 'ro', isa => 'Int', uri_name => 'Version', traits => ['ParamInURI'], required => 1);

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'UpdateTrafficPolicyComment');
  class_has _api_uri  => (isa => 'Str', is => 'ro', default => '/2013-04-01/trafficpolicy/{Id}/{Version}');
  class_has _api_method  => (isa => 'Str', is => 'ro', default => 'POST');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Route53::UpdateTrafficPolicyCommentResponse');
  class_has _result_key => (isa => 'Str', is => 'ro');

1;

### main pod documentation begin ###

=head1 NAME

Paws::Route53::UpdateTrafficPolicyComment - Arguments for method UpdateTrafficPolicyComment on Paws::Route53

=head1 DESCRIPTION

This class represents the parameters used for calling the method UpdateTrafficPolicyComment on the
Amazon Route 53 service. Use the attributes of this class
as arguments to method UpdateTrafficPolicyComment.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to UpdateTrafficPolicyComment.

As an example:

  $service_obj->UpdateTrafficPolicyComment(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> Comment => Str

The new comment for the specified traffic policy and version.

=head2 B<REQUIRED> Id => Str

The value of C<Id> for the traffic policy that you want to update the
comment for.

=head2 B<REQUIRED> Version => Int

The value of C<Version> for the traffic policy that you want to update
the comment for.

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method UpdateTrafficPolicyComment in L<Paws::Route53>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE helpset
        PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
        "http://java.sun.com/products/javahelp/helpset_2_0.dtd">

<helpset version="1.0">

    <title>External Code Formatter</title>

    <maps>
        <homeID>ExternalCodeFormatter</homeID>
        <mapref location="Map.xml"/>
    </maps>

    <view>
        <name>TOC</name>
        <label>Table Of Contents</label>
        <type>javax.help.TOCView</type>
        <data>HelpTOC.xml</data>
    </view>

</helpset>


text:
require "anvil"
require "anvil/builder"
require "anvil/engine"
require "anvil/manifest"
require "anvil/version"
require "progress"
require "thor"
require "uri"

class Anvil::CLI < Thor

  map ["-v", "--version"] => :version

  desc "build [SOURCE]", "Build an application"

  method_option :buildpack, :type => :string,  :aliases => "-b", :desc => "Use a specific buildpack"
  method_option :pipeline,  :type => :boolean, :aliases => "-p", :desc => "Pipe build output to stderr and put the slug url on stdout"
  method_option :type,      :type => :string,  :aliases => "-t", :desc => "Build a specific slug type (tgz, deb)"

  def build(source=nil)
    Anvil::Engine.build(source, options)
  rescue Anvil::Builder::BuildError => ex
    error "Build Error: #{ex.message}"
  end

  desc "version", "Display Anvil version"

  def version
    Anvil::Engine.version
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/iReach.iml" filepath="$PROJECT_DIR$/iReach.iml" />
    </modules>
  </component>
</project>