text:
<?php

return [
    // Breadcrumbs
    'activate' => 'Activeer',
    'adjust_production' => 'Productie aanpassen',
    'cart_and_checkout' => 'Winkelwagen en naar de kassa',
    'change_password' => 'Wachtwoord wijzigen',
    'create_account' => 'Account aanmaken',
    'create_node' => 'Creër knooppunt',
    'create_producer' => 'Creër producent',
    'create_product' => 'Creër product',
    'create_production' => 'Creër productie',
    'create_variant' => 'Creër variant',
    'dashboard' => 'Dashboard',
    'delete' => 'Verwijder',
    'deliveries' => 'Leveringen',
    'delivery_dates' => 'Leverdata',
    'delivery_nodes' => 'Afleverpunten',
    'edit' => 'Bewerken',
    'faq' => 'FAQ',
    'find_nodes' => 'Vind afleverpunten',
    'guests' => 'Gast',
    'guide' => 'Gids',
    'logout' => 'Uitloggen',
    'membership' => 'Lidmaatschap',
    'node_administration' => 'Afleverpunt administratie',
    'nodes' => 'Knooppunten',
    'nodes_you_follow' => 'Afleverpunten die jij volgt',
    'orders' => 'Bestellingen',
    'order' => 'Bestelling',
    'pickups' => 'Afhalingen',
    'producer_administration' => 'Producent administratie',
    'producers' => 'Producenten',
    'products' => 'Product',
    'users' => 'Gebruikers',
    'variants' => 'Varianten',
    'your_user' => 'Jouw gebruiker',
];


text:
package com.lukedeighton.play.validation

import com.lukedeighton.play.mcros
import play.api.data.validation.{Valid, ValidationError, Invalid, Constraint}
import play.api.data.{FormError, Mapping, Form}

import scala.language.experimental.macros

object Forms {
  //ignore import warnings in Intellij - the Macro Bundle works fine!
  def form[T]: Form[T] = macro mcros.FormImpl.formExpr[T]

  //TODO how would you add error overrides per type? - implicit settings? this could be a way to use injector?

  //TODO other macro impls?
  //def form[T](obj: T) = form[T].fill(obj)

  //implicit def toForm[T](request: Request[_]): Form[T] = form[T].bindFromRequest()(request)
}

redpajama_set_name: RedPajamaGithub


text:
// We use contact ids to facilitate warm starting.
var b2ContactPoint = Class.create();
b2ContactPoint.prototype =
{
	position: new b2Vec2(),
	separation: null,
	normalImpulse: null,
	tangentImpulse: null,
	id: new b2ContactID(),
	initialize: function() {
		// initialize instance variables for references
		this.position = new b2Vec2();
		this.id = new b2ContactID();
		//
}};


text:
package templates

import (
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"os"
	"path/filepath"
	"testing"

	kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
	kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
	"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/admit"

	"github.com/openshift/origin/pkg/api/latest"
	osclient "github.com/openshift/origin/pkg/client"
	config "github.com/openshift/origin/pkg/config/api"
	templateregistry "github.com/openshift/origin/pkg/template/registry"
)

func walkJSONFiles(inDir string, fn func(name, path string, data []byte)) error {
	err := filepath.Walk(inDir, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() && path != inDir {
			return filepath.SkipDir
		}
		name := filepath.Base(path)
		ext := filepath.Ext(name)
		if ext != "" {
			name = name[:len(name)-len(ext)]
		}
		if !(ext == ".json" || ext == ".yaml") {
			return nil
		}
		data, err := ioutil.ReadFile(path)
		if err != nil {
			return err
		}
		fn(name, path, data)
		return nil
	})
	return err
}

func TestTemplateTransformationFromConfig(t *testing.T) {
	osMux := http.NewServeMux()
	server := httptest.NewServer(osMux)
	defer server.Close()

	osClient := osclient.NewOrDie(&kclient.Config{Host: server.URL})

	storage := map[string]rest.Storage{
		"templateConfigs": templateregistry.NewREST(),
	}

	interfaces, _ := latest.InterfacesFor(latest.Version)
	handlerContainer := master.NewHandlerContainer(osMux)
	version := apiserver.APIGroupVersion{
		Root:    "/osapi",
		Version: "v1beta1",

		Mapper: latest.RESTMapper,

		Storage: storage,
		Codec:   interfaces.Codec,

		Creater: kapi.Scheme,
		Typer:   kapi.Scheme,
		Linker:  interfaces.MetadataAccessor,

		Admit:   admit.NewAlwaysAdmit(),
		Context: kapi.NewRequestContextMapper(),
	}
	if err := version.InstallREST(handlerContainer); err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	walkJSONFiles("fixtures", func(name, path string, _ []byte) {
		config := &config.Config{}
		err := osClient.RESTClient.Post().Resource("templateConfigs").Body(path).Do().Into(config)
		if err != nil {
			t.Errorf("%q: unexpected error: %v", path, err)
			return
		}
		if len(config.Items) == 0 {
			t.Errorf("%q: no items in config object", path)
			return
		}
		t.Logf("tested %q", path)
	})
}


text:
@interface CYDoDiViewController : BLBackViewController

@end


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

namespace Record_Searcher
{
    static class Program
    {
        public static string DirectoryPath { get; set; }
        public static int normalRange { get; set; }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static int Main(string[] args)
        {
            normalRange = 5;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length > 0 && !string.IsNullOrWhiteSpace(args[0]))
            {
                DirectoryPath = args[0];
            }
            else
            {
                DirectoryPath = Properties.Settings.Default.Directory;
                if (string.IsNullOrWhiteSpace(Program.DirectoryPath))
                {
                    Program.DirectoryPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                    if (!GetBaseDirectory())
                    {
                        //
                        return 1;
                    }
                }
            }
            Application.Run(new AdvancedForm());
           // Application.Run(new Form2(MetroAllowed()));
            return 0;
        }

        public static bool GetBaseDirectory()
        {
            System.Windows.Forms.FolderBrowserDialog dlg = new FolderBrowserDialog();
            dlg.SelectedPath = Program.DirectoryPath;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Program.DirectoryPath = dlg.SelectedPath;
                Properties.Settings.Default.Directory = Program.DirectoryPath;
                Properties.Settings.Default.Save();
                return true;
            }

            return false;
        }
        static bool MetroAllowed()
        {
            OperatingSystem OPSystem = System.Environment.OSVersion;
            if (OPSystem.Version.Major >= 6 && OPSystem.Version.Minor >= 2)
            {
                return true;

            }

            else
            {
                return false;
            }

        }
    }
}


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


text:
<?php

namespace Articulate\IssueBundle\Entities;

use Articulate\IssueBundle\Entities\om\BaseIssuePeer;

class IssuePeer extends BaseIssuePeer
{
}


text:
namespace Sistema_Controle
{
    partial class Solicitacoes
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Solicitacoes));
            this.label1 = new System.Windows.Forms.Label();
            this.txtTotal1 = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.ListaSolicitacoes = new System.Windows.Forms.DataGridView();
            this.txtTotal3 = new System.Windows.Forms.TextBox();
            this.listaAgendadas = new System.Windows.Forms.DataGridView();
            this.OrdemPrioridade = new System.Windows.Forms.RadioButton();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.OrdemPaciente = new System.Windows.Forms.RadioButton();
            this.OrdemData = new System.Windows.Forms.RadioButton();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.imprimirAgendamentos = new System.Windows.Forms.Button();
            this.dtreagenda = new System.Windows.Forms.Label();
            this.dtagenda = new System.Windows.Forms.Label();
            this.dataReagendamento = new System.Windows.Forms.DateTimePicker();
            this.dataFiltroAgenda = new System.Windows.Forms.DateTimePicker();
            this.OrdemNomeAgenda = new System.Windows.Forms.RadioButton();
            this.OrdemDataAgenda = new System.Windows.Forms.RadioButton();
            this.OrdemPrioridadeAgenda = new System.Windows.Forms.RadioButton();
            ((System.ComponentModel.ISupportInitialize)(this.ListaSolicitacoes)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.listaAgendadas)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(224)))), ((int)(((byte)(173)))));
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.label1.Location = new System.Drawing.Point(12, 27);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(1220, 20);
            this.label1.TabIndex = 0;
            this.label1.Text = "Solicitações";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // txtTotal1
            //
            this.txtTotal1.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.txtTotal1.Enabled = false;
            this.txtTotal1.Location = new System.Drawing.Point(1194, 413);
            this.txtTotal1.Name = "txtTotal1";
            this.txtTotal1.Size = new System.Drawing.Size(38, 20);
            this.txtTotal1.TabIndex = 2;
            //
            // label3
            //
            this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.label3.Location = new System.Drawing.Point(16, 413);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(1216, 20);
            this.label3.TabIndex = 6;
            this.label3.Text = "Solicitações Agendadas";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // ListaSolicitacoes
            //
            this.ListaSolicitacoes.AllowUserToAddRows = false;
            this.ListaSolicitacoes.AllowUserToDeleteRows = false;
            this.ListaSolicitacoes.AllowUserToOrderColumns = true;
            this.ListaSolicitacoes.AllowUserToResizeRows = false;
            dataGridViewCellStyle1.BackColor = System.Drawing.Color.White;
            dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black;
            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            this.ListaSolicitacoes.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
            this.ListaSolicitacoes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.ListaSolicitacoes.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
            this.ListaSolicitacoes.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
            this.ListaSolicitacoes.BackgroundColor = System.Drawing.Color.White;
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.ListaSolicitacoes.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
            this.ListaSolicitacoes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White;
            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.ControlLightLight;
            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.ListaSolicitacoes.DefaultCellStyle = dataGridViewCellStyle3;
            this.ListaSolicitacoes.Location = new System.Drawing.Point(12, 118);
            this.ListaSolicitacoes.MultiSelect = false;
            this.ListaSolicitacoes.Name = "ListaSolicitacoes";
            this.ListaSolicitacoes.ReadOnly = true;
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.Desktop;
            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.ListaSolicitacoes.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
            this.ListaSolicitacoes.RowHeadersVisible = false;
            dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;
            dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black;
            this.ListaSolicitacoes.RowsDefaultCellStyle = dataGridViewCellStyle5;
            this.ListaSolicitacoes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.ListaSolicitacoes.Size = new System.Drawing.Size(1220, 289);
            this.ListaSolicitacoes.TabIndex = 31;
            this.ListaSolicitacoes.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.listaComPrioridade_CellDoubleClick);
            this.ListaSolicitacoes.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.listaComPrioridade_CellFormatting);
            //
            // txtTotal3
            //
            this.txtTotal3.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.txtTotal3.Enabled = false;
            this.txtTotal3.Location = new System.Drawing.Point(1194, 813);
            this.txtTotal3.Name = "txtTotal3";
            this.txtTotal3.Size = new System.Drawing.Size(38, 20);
            this.txtTotal3.TabIndex = 8;
            //
            // listaAgendadas
            //
            this.listaAgendadas.AllowUserToAddRows = false;
            this.listaAgendadas.AllowUserToDeleteRows = false;
            this.listaAgendadas.AllowUserToOrderColumns = true;
            this.listaAgendadas.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.listaAgendadas.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
            this.listaAgendadas.BackgroundColor = System.Drawing.Color.White;
            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.listaAgendadas.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
            this.listaAgendadas.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White;
            dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.listaAgendadas.DefaultCellStyle = dataGridViewCellStyle7;
            this.listaAgendadas.Location = new System.Drawing.Point(12, 527);
            this.listaAgendadas.Name = "listaAgendadas";
            this.listaAgendadas.ReadOnly = true;
            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.listaAgendadas.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;
            this.listaAgendadas.RowHeadersVisible = false;
            dataGridViewCellStyle9.BackColor = System.Drawing.Color.White;
            this.listaAgendadas.RowsDefaultCellStyle = dataGridViewCellStyle9;
            this.listaAgendadas.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.listaAgendadas.Size = new System.Drawing.Size(1220, 280);
            this.listaAgendadas.TabIndex = 33;
            this.listaAgendadas.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.listaAgendadas_CellDoubleClick_1);
            this.listaAgendadas.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.listaAgendadas_CellFormatting);
            //
            // OrdemPrioridade
            //
            this.OrdemPrioridade.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemPrioridade.AutoSize = true;
            this.OrdemPrioridade.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemPrioridade.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemPrioridade.Location = new System.Drawing.Point(365, 21);
            this.OrdemPrioridade.Name = "OrdemPrioridade";
            this.OrdemPrioridade.Size = new System.Drawing.Size(98, 24);
            this.OrdemPrioridade.TabIndex = 34;
            this.OrdemPrioridade.Text = "Prioridade";
            this.OrdemPrioridade.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemPrioridade.UseVisualStyleBackColor = true;
            this.OrdemPrioridade.Click += new System.EventHandler(this.OrdemPrioridade_Click);
            //
            // groupBox1
            //
            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox1.Controls.Add(this.OrdemPaciente);
            this.groupBox1.Controls.Add(this.OrdemData);
            this.groupBox1.Controls.Add(this.OrdemPrioridade);
            this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.groupBox1.Location = new System.Drawing.Point(12, 50);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(1220, 62);
            this.groupBox1.TabIndex = 35;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Ordernar Por:";
            //
            // OrdemPaciente
            //
            this.OrdemPaciente.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemPaciente.AutoSize = true;
            this.OrdemPaciente.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemPaciente.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemPaciente.Location = new System.Drawing.Point(733, 21);
            this.OrdemPaciente.Name = "OrdemPaciente";
            this.OrdemPaciente.Size = new System.Drawing.Size(157, 24);
            this.OrdemPaciente.TabIndex = 36;
            this.OrdemPaciente.Text = "Nome do Paciente";
            this.OrdemPaciente.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemPaciente.UseVisualStyleBackColor = true;
            this.OrdemPaciente.Click += new System.EventHandler(this.OrdemPaciente_Click);
            //
            // OrdemData
            //
            this.OrdemData.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemData.AutoSize = true;
            this.OrdemData.Checked = true;
            this.OrdemData.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemData.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemData.Location = new System.Drawing.Point(544, 21);
            this.OrdemData.Name = "OrdemData";
            this.OrdemData.Size = new System.Drawing.Size(166, 24);
            this.OrdemData.TabIndex = 35;
            this.OrdemData.TabStop = true;
            this.OrdemData.Text = "Data de Abertura";
            this.OrdemData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemData.UseVisualStyleBackColor = true;
            this.OrdemData.Click += new System.EventHandler(this.OrdemData_Click);
            //
            // groupBox2
            //
            this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox2.Controls.Add(this.imprimirAgendamentos);
            this.groupBox2.Controls.Add(this.dtreagenda);
            this.groupBox2.Controls.Add(this.dtagenda);
            this.groupBox2.Controls.Add(this.dataReagendamento);
            this.groupBox2.Controls.Add(this.dataFiltroAgenda);
            this.groupBox2.Controls.Add(this.OrdemNomeAgenda);
            this.groupBox2.Controls.Add(this.OrdemDataAgenda);
            this.groupBox2.Controls.Add(this.OrdemPrioridadeAgenda);
            this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.groupBox2.Location = new System.Drawing.Point(12, 439);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(1220, 82);
            this.groupBox2.TabIndex = 36;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Ordernar Por:";
            //
            // imprimirAgendamentos
            //
            this.imprimirAgendamentos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.imprimirAgendamentos.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(224)))), ((int)(((byte)(173)))));
            this.imprimirAgendamentos.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("imprimirAgendamentos.BackgroundImage")));
            this.imprimirAgendamentos.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.imprimirAgendamentos.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.imprimirAgendamentos.ForeColor = System.Drawing.Color.WhiteSmoke;
            this.imprimirAgendamentos.Location = new System.Drawing.Point(1169, 11);
            this.imprimirAgendamentos.Name = "imprimirAgendamentos";
            this.imprimirAgendamentos.Size = new System.Drawing.Size(45, 37);
            this.imprimirAgendamentos.TabIndex = 37;
            this.imprimirAgendamentos.UseVisualStyleBackColor = false;
            this.imprimirAgendamentos.Click += new System.EventHandler(this.imprimirAgendamentos_Click);
            //
            // dtreagenda
            //
            this.dtreagenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.dtreagenda.AutoSize = true;
            this.dtreagenda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtreagenda.ForeColor = System.Drawing.Color.Black;
            this.dtreagenda.Location = new System.Drawing.Point(892, 20);
            this.dtreagenda.Name = "dtreagenda";
            this.dtreagenda.Size = new System.Drawing.Size(190, 20);
            this.dtreagenda.TabIndex = 40;
            this.dtreagenda.Text = "Data de Reagendamento";
            //
            // dtagenda
            //
            this.dtagenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.dtagenda.AutoSize = true;
            this.dtagenda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
            this.dtagenda.ForeColor = System.Drawing.Color.Black;
            this.dtagenda.Location = new System.Drawing.Point(507, 20);
            this.dtagenda.Name = "dtagenda";
            this.dtagenda.Size = new System.Drawing.Size(171, 20);
            this.dtagenda.TabIndex = 39;
            this.dtagenda.Text = "Data de Agendamento";
            //
            // dataReagendamento
            //
            this.dataReagendamento.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.dataReagendamento.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dataReagendamento.Location = new System.Drawing.Point(896, 43);
            this.dataReagendamento.Name = "dataReagendamento";
            this.dataReagendamento.Size = new System.Drawing.Size(297, 22);
            this.dataReagendamento.TabIndex = 38;
            this.dataReagendamento.ValueChanged += new System.EventHandler(this.dataReagendamento_ValueChanged);
            //
            // dataFiltroAgenda
            //
            this.dataFiltroAgenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.dataFiltroAgenda.Location = new System.Drawing.Point(511, 43);
            this.dataFiltroAgenda.Name = "dataFiltroAgenda";
            this.dataFiltroAgenda.Size = new System.Drawing.Size(330, 22);
            this.dataFiltroAgenda.TabIndex = 37;
            this.dataFiltroAgenda.ValueChanged += new System.EventHandler(this.dataFiltroAgenda_ValueChanged);
            //
            // OrdemNomeAgenda
            //
            this.OrdemNomeAgenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemNomeAgenda.AutoSize = true;
            this.OrdemNomeAgenda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemNomeAgenda.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemNomeAgenda.Location = new System.Drawing.Point(329, 35);
            this.OrdemNomeAgenda.Name = "OrdemNomeAgenda";
            this.OrdemNomeAgenda.Size = new System.Drawing.Size(157, 24);
            this.OrdemNomeAgenda.TabIndex = 36;
            this.OrdemNomeAgenda.Text = "Nome do Paciente";
            this.OrdemNomeAgenda.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemNomeAgenda.UseVisualStyleBackColor = true;
            this.OrdemNomeAgenda.Click += new System.EventHandler(this.OrdemNomeAgenda_Click);
            //
            // OrdemDataAgenda
            //
            this.OrdemDataAgenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemDataAgenda.AutoSize = true;
            this.OrdemDataAgenda.Checked = true;
            this.OrdemDataAgenda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemDataAgenda.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemDataAgenda.Location = new System.Drawing.Point(149, 35);
            this.OrdemDataAgenda.Name = "OrdemDataAgenda";
            this.OrdemDataAgenda.Size = new System.Drawing.Size(166, 24);
            this.OrdemDataAgenda.TabIndex = 35;
            this.OrdemDataAgenda.TabStop = true;
            this.OrdemDataAgenda.Text = "Data de Abertura";
            this.OrdemDataAgenda.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemDataAgenda.UseVisualStyleBackColor = true;
            this.OrdemDataAgenda.Click += new System.EventHandler(this.OrdemDataAgenda_Click);
            //
            // OrdemPrioridadeAgenda
            //
            this.OrdemPrioridadeAgenda.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.OrdemPrioridadeAgenda.AutoSize = true;
            this.OrdemPrioridadeAgenda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.OrdemPrioridadeAgenda.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(59)))), ((int)(((byte)(91)))), ((int)(((byte)(93)))));
            this.OrdemPrioridadeAgenda.Location = new System.Drawing.Point(20, 35);
            this.OrdemPrioridadeAgenda.Name = "OrdemPrioridadeAgenda";
            this.OrdemPrioridadeAgenda.Size = new System.Drawing.Size(98, 24);
            this.OrdemPrioridadeAgenda.TabIndex = 34;
            this.OrdemPrioridadeAgenda.Text = "Prioridade";
            this.OrdemPrioridadeAgenda.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.OrdemPrioridadeAgenda.UseVisualStyleBackColor = true;
            this.OrdemPrioridadeAgenda.Click += new System.EventHandler(this.OrdemPrioridadeAgenda_Click);
            //
            // Solicitacoes
            //
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
            this.AutoScroll = true;
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(224)))), ((int)(((byte)(173)))));
            this.ClientSize = new System.Drawing.Size(1244, 851);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.listaAgendadas);
            this.Controls.Add(this.ListaSolicitacoes);
            this.Controls.Add(this.txtTotal3);
            this.Controls.Add(this.txtTotal1);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.label3);
            this.ForeColor = System.Drawing.Color.White;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "Solicitacoes";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Solicitacoes";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            ((System.ComponentModel.ISupportInitialize)(this.ListaSolicitacoes)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.listaAgendadas)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox txtTotal1;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.DataGridView ListaSolicitacoes;
        private System.Windows.Forms.TextBox txtTotal3;
        private System.Windows.Forms.DataGridView listaAgendadas;
        private System.Windows.Forms.RadioButton OrdemPrioridade;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.RadioButton OrdemData;
        private System.Windows.Forms.RadioButton OrdemPaciente;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.RadioButton OrdemNomeAgenda;
        private System.Windows.Forms.RadioButton OrdemDataAgenda;
        private System.Windows.Forms.RadioButton OrdemPrioridadeAgenda;
        private System.Windows.Forms.DateTimePicker dataFiltroAgenda;
        private System.Windows.Forms.Label dtreagenda;
        private System.Windows.Forms.Label dtagenda;
        private System.Windows.Forms.DateTimePicker dataReagendamento;
        private System.Windows.Forms.Button imprimirAgendamentos;
    }
}


text:
#ifndef WEBSOCKETPP_EXTENSION_PERMESSAGE_DEFLATE_DISABLED_HPP
#define WEBSOCKETPP_EXTENSION_PERMESSAGE_DEFLATE_DISABLED_HPP

#include <websocketpp/common/cpp11.hpp>
#include <websocketpp/common/system_error.hpp>

#include <websocketpp/http/constants.hpp>
#include <websocketpp/extensions/extension.hpp>

#include <map>
#include <string>
#include <utility>

namespace websocketpp {
namespace extensions {
namespace permessage_deflate {

/// Stub class for use when disabling permessage_deflate extension
/**
 * This class is a stub that implements the permessage_deflate interface
 * with minimal dependencies. It is used to disable permessage_deflate
 * functionality at compile time without loading any unnecessary code.
 */
template <typename config>
class disabled {
    typedef std::pair<lib::error_code,std::string> err_str_pair;

public:
    err_str_pair negotiate(http::attribute_list const & attributes) {
        return make_pair(make_error_code(error::disabled),std::string());
    }

    /// Returns true if the extension is capable of providing
    /// permessage_deflate functionality
    bool is_implemented() const {
        return false;
    }

    /// Returns true if permessage_deflate functionality is active for this
    /// connection
    bool is_enabled() const {
        return false;
    }

    lib::error_code compress(std::string const & in, std::string & out) {
        return make_error_code(error::disabled);
    }

    lib::error_code decompress(uint8_t const * buf, size_t len,
        std::string & out)
    {
        return make_error_code(error::disabled);
    }

    lib::error_code decompress(std::string const & in, std::string & out) {
        return make_error_code(error::disabled);
    }
};

} // namespace permessage_deflate
} // namespace extensions
} // namespace websocketpp

#endif // WEBSOCKETPP_EXTENSION_PERMESSAGE_DEFLATE_DISABLED_HPP


text:
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 04 March 2010 22:59:05
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.Data;
using System.Data.Common;
using System.Collections;

using policyDB.EntityClasses;
using policyDB.FactoryClasses;
using policyDB.CollectionClasses;
using policyDB.HelperClasses;
using policyDB;

using SD.LLBLGen.Pro.ORMSupportClasses;
using SD.LLBLGen.Pro.DQE.SqlServer;

namespace policyDB.DaoClasses
{

	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END

	///
	/// General DAO class for the AttributeValue Entity. It will perform database oriented actions for
	/// a entity of type 'AttributeValueEntity'. This DAO works on an EntityFields object.
	///
	public partial class AttributeValueDAO : DaoBase
	{
		/// CTor
		public AttributeValueDAO() : base(InheritanceInfoProviderSingleton.GetInstance(), new DynamicQueryEngine(), InheritanceHierarchyType.None, "AttributeValueEntity", new AttributeValueEntityFactory())
		{
		}

		/// CTor
		/// <param name="inheritanceInfoProviderToUse">Inheritance info provider to use.</param>
		/// <param name="dqeToUse">Dqe to use.</param>
		/// <param name="typeOfInheritance">Type of inheritance.</param>
		/// <param name="entityName">Name of the entity.</param>
		/// <param name="entityFactory">Entity factory.</param>
		internal AttributeValueDAO(IInheritanceInfoProvider inheritanceInfoProviderToUse, DynamicQueryEngineBase dqeToUse, InheritanceHierarchyType typeOfInheritance, string entityName, IEntityFactory entityFactory) : base(inheritanceInfoProviderToUse, dqeToUse, typeOfInheritance, entityName, entityFactory)
		{
		}

		///
		/// Retrieves in the calling AttributeValueCollection object all AttributeValueEntity objects which have data in common
		/// with the specified related Entities. If one is omitted, that entity is not used as a filter.
		///
		/// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
		/// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.
		/// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return.
		/// When set to 0, no limitations are specified.</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
		/// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
		/// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
		/// <param name="attributeInstance">AttributeEntity instance to use as a filter for the AttributeValueEntity objects to return</param>
		/// <param name="attributeMatchInstance">DecisionNodeEntity instance to use as a filter for the AttributeValueEntity objects to return</param>
		/// <param name="pageNumber">The page number to retrieve.</param>
		/// <param name="pageSize">The page size of the page to retrieve.</param>
		public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity attributeInstance, IEntity attributeMatchInstance, int pageNumber, int pageSize)
		{
			base.EntityFactoryToUse = entityFactoryToUse;
			IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.AttributeValueEntity);
			IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(attributeInstance, attributeMatchInstance, fieldsToReturn);
			if(filter!=null)
			{
				selectFilter.AddWithAnd(filter);
			}
			return base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
		}

		///
		/// Retrieves entities of the type 'AttributeValueEntity' in a datatable which match the specified filter.
		/// It will always create a new connection to the database.
		///
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.
		/// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return.
		/// When set to 0, no limitations are specified.</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
		/// <param name="selectFilter">A predicate or predicate expression which should be used as filter for the entities to retrieve.</param>
		/// <param name="relations">The set of relations to walk to construct to total query.</param>
		/// <param name="pageNumber">The page number to retrieve.</param>
		/// <param name="pageSize">The page size of the page to retrieve.</param>
		/// <returns>a filled datatable if succeeded, false otherwise</returns>
		public virtual DataTable GetMultiAsDataTable(long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, int pageNumber, int pageSize)
		{
			return base.PerformGetMultiAsDataTableAction(maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, pageNumber, pageSize);
		}

		///
		/// Deletes from the persistent storage all 'AttributeValue' entities which have data in common
		/// with the specified related Entities. If one is omitted, that entity is not used as a filter.
		///
		/// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
		/// <param name="attributeInstance">AttributeEntity instance to use as a filter for the AttributeValueEntity objects to delete</param>
		/// <param name="attributeMatchInstance">DecisionNodeEntity instance to use as a filter for the AttributeValueEntity objects to delete</param>
		/// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
		public int DeleteMulti(ITransaction containingTransaction, IEntity attributeInstance, IEntity attributeMatchInstance)
		{
			IEntityFields fields = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.AttributeValueEntity);
			IPredicateExpression deleteFilter = CreateFilterUsingForeignKeys(attributeInstance, attributeMatchInstance, fields);
			return base.DeleteMulti(containingTransaction, deleteFilter);
		}

		///
		/// Updates all entities of the same type or subtype of the entity entityWithNewValues directly in the persistent storage if they match the filter
		/// supplied in filterBucket. Only the fields changed in entityWithNewValues are updated for these fields. Entities of a subtype of the type
		/// of entityWithNewValues which are affected by the filterBucket's filter will thus also be updated.
		///
		/// <param name="entityWithNewValues">IEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account</param>
		/// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
		/// <param name="attributeInstance">AttributeEntity instance to use as a filter for the AttributeValueEntity objects to update</param>
		/// <param name="attributeMatchInstance">DecisionNodeEntity instance to use as a filter for the AttributeValueEntity objects to update</param>
		/// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
		public int UpdateMulti(IEntity entityWithNewValues, ITransaction containingTransaction, IEntity attributeInstance, IEntity attributeMatchInstance)
		{
			IEntityFields fields = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.AttributeValueEntity);
			IPredicateExpression updateFilter = CreateFilterUsingForeignKeys(attributeInstance, attributeMatchInstance, fields);
			return base.UpdateMulti(entityWithNewValues, containingTransaction, updateFilter);
		}

		///
		/// Determines the connection to use. If transaction to use is null, a new connection is created, otherwise the connection of the transaction is used.
		///
		/// <param name="transactionToUse">Transaction to use.</param>
		/// <returns>a ready to use connection object.</returns>
		protected override IDbConnection DetermineConnectionToUse(ITransaction transactionToUse)
		{
			return DbUtils.DetermineConnectionToUse(transactionToUse);
		}

		///
		/// Creates a new ADO.NET data adapter.
		///
		/// <returns>ready to use ADO.NET data-adapter</returns>
		protected override DbDataAdapter CreateDataAdapter()
		{
			return DbUtils.CreateDataAdapter();
		}

		///
		/// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.
		///
		/// <param name="attributeInstance">AttributeEntity instance to use as a filter for the AttributeValueEntity objects</param>
		/// <param name="attributeMatchInstance">DecisionNodeEntity instance to use as a filter for the AttributeValueEntity objects</param>
		/// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param>
		/// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns>
		private IPredicateExpression CreateFilterUsingForeignKeys(IEntity attributeInstance, IEntity attributeMatchInstance, IEntityFields fieldsToReturn)
		{
			IPredicateExpression selectFilter = new PredicateExpression();

			if(attributeInstance != null)
			{
				selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AttributeValueFieldIndex.AttributeId], ComparisonOperator.Equal, ((AttributeEntity)attributeInstance).Id));
			}
			if(attributeMatchInstance != null)
			{
				selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AttributeValueFieldIndex.AttributeMatchId], ComparisonOperator.Equal, ((DecisionNodeEntity)attributeMatchInstance).Id));
			}
			return selectFilter;
		}

		#region Custom DAO code

		// __LLBLGENPRO_USER_CODE_REGION_START CustomDAOCode
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Included Code

		#endregion
	}
}


text:
@implementation ImageDownloaderBlockingPatch : QCPatch

+ (QCPatchExecutionMode)executionModeWithIdentifier:(id)fp8
{
	return kQCPatchExecutionModeProcessor;
}
+ (BOOL)allowsSubpatchesWithIdentifier:(id)fp8
{
	return NO;
}
+ (QCPatchTimeMode)timeModeWithIdentifier:(id)fp8
{
	return kQCPatchTimeModeNone;
}

- (id)initWithIdentifier:(id)fp8
{
	if( self = [super initWithIdentifier:fp8])
	{
		[inputInterpolation setMaxIndexValue: 1];
	}

	return self;
}

- (BOOL)execute:(id)glContext time:(double)time arguments:(id)arguments
{
	NSDictionary *args = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:[inputURL stringValue]], @"URL",
																	glContext, @"context",
																	[NSNumber numberWithInt:[inputProxyThresholdWidth indexValue] * [inputUseProxyCache booleanValue]], @"width",
																	[NSNumber numberWithInt:[inputInterpolation indexValue] * [inputUseProxyCache booleanValue]], @"interpolate", nil];
	[outputFinished setBooleanValue: FALSE];
	if([inputAsynchronous booleanValue])
	{
		[NSThread detachNewThreadSelector:@selector(_asyncLoadThread:) toTarget:self withObject:args];
	}
	else	// synchronous load
		[self _asyncLoadThread:args];

	return YES;
}

- (QCImage *)requestImage:(NSURL *)url proxyWidth:(int)width interpolation:(int)interpolate properties:(NSMutableDictionary*)properties
{
	QCImage *outImage = nil;
	BOOL usingProxy = FALSE;	// we track this for enabling/disabling colorcorrection (cached versions are already corrected, otherwise they aren't)

		NSError *error=nil;
		NSData *data;
		if(width)	// proxy stuff
		{
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Proxy path");
			// look for on-disk proxy
			NSData *urlData = [[url absoluteString] dataUsingEncoding: NSUTF8StringEncoding];
			unsigned char digest[20];	// 160 bits of sha digest
			CC_SHA1([urlData bytes], [urlData length], digest);
			NSString *proxyFile = [NSString stringWithFormat:
				@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x-%i-%i.png",
				//@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x-%i.jpg",
				digest[0],digest[1],digest[2],digest[3],digest[4],
				digest[5],digest[6],digest[7],digest[8],digest[9],
				digest[10],digest[11],digest[12],digest[13],digest[14],
				digest[15],digest[16],digest[17],digest[18],digest[19], width, interpolate];
			NSString *proxyExifFile = [NSString stringWithFormat:@"%@.exif", proxyFile];	// blahblah-width-int.png.exif

			NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];

			cachePath = [cachePath stringByAppendingPathComponent:
					[[NSBundle bundleForClass:[self class]] bundleIdentifier]];

			// typically, this only happens once ever -- so we can reliably expect if to fail all of the time.
			//   tell GCC about it for slightly better reordering/hinting
			NSFileManager *defaultManager = [NSFileManager defaultManager];
			if( __builtin_expect([defaultManager fileExistsAtPath: cachePath] == NO, 0) )
			{	// no cache folder, make it
				//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Creating Cache folder [%@]", cachePath);
				[defaultManager createDirectoryAtPath: cachePath attributes:nil];
			}
			NSString *cacheImagePath = [cachePath stringByAppendingPathComponent: proxyFile];
			NSString *cacheExifPath = [cachePath stringByAppendingPathComponent: proxyExifFile];
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Proxy file: %@", cacheImagePath);
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Proxy EXIF file: %@", cacheExifPath);
			if([defaultManager fileExistsAtPath: cacheImagePath] == NO)
			{
				//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  No Proxy file...  inspecting size...");
				data = [NSData dataWithContentsOfURL: url];

				// get EXIF info stuff
				{
					if([data length])
					{
						CGImageSourceRef isr = CGImageSourceCreateWithData((CFDataRef)data, nil);
						if(isr)
						{
							//NSLog(@"isr exists!");
							CFDictionaryRef d = CGImageSourceCopyPropertiesAtIndex(isr, 0, nil);
							[properties addEntriesFromDictionary:(NSDictionary *)d];
							if (d)
								CFRelease(d);
							CFRelease(isr);
						}
						else
						{
							//NSLog(@"isr fail!");
						}
					}

					//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  EXIF Properties: %@", properties);
					NSString *error;
					NSData *exifData = [NSPropertyListSerialization
										dataFromPropertyList: properties
										format: kCFPropertyListBinaryFormat_v1_0
										errorDescription: &error];
					[exifData writeToFile: cacheExifPath atomically: NO];
				}

				CIImage *sourceImage = [[CIImage alloc] initWithData: data];
				CIFilter *scale;
				//if([sourceImage size].width > width)	// resize if it's big enough
				if([sourceImage extent].size.width > width)	// resize if it's big enough
				{
					//float aspect = [sourceImage extent].size.width / [sourceImage extent].size.height;
					if(interpolate)	// lanczos scaling -- nice, but slower (also introduces a 1-pixel border sometimes?)
					{
						scale = [CIFilter filterWithName:@"CILanczosScaleTransform"];
						[scale setValue: sourceImage forKey:@"inputImage"];
						[scale setValue: [NSNumber numberWithDouble:width/[sourceImage extent].size.width] forKey:@"inputScale"];
						[scale setValue: [NSNumber numberWithDouble: 1.0] forKey:@"inputAspectRatio"];
						//outImage = [[QCImage alloc] initWithCIImage: [scale valueForKey:@"outputImage"] options:nil];
					}
					else	// affine scaling -- bilinear maybe?
					{
						NSAffineTransform *transform = [NSAffineTransform transform];
						[transform scaleBy: width/[sourceImage extent].size.width ];
						scale = [CIFilter filterWithName:@"CIAffineTransform"];
						[scale setValue: sourceImage forKey:@"inputImage"];
						[scale setValue: transform forKey:@"inputTransform"];
						//outImage = [[QCImage alloc] initWithCIImage:[scale valueForKey:@"outputImage"] options:nil];
					}
					outImage = [[QCImage alloc] initWithCIImage:[scale valueForKey:@"outputImage"] options:nil];

					[outImage setMetadata:url forKey:@"dataURL" shouldForward:NO];
					[outImage setMetadata:[NSNumber numberWithUnsignedInt:[data length]] forKey:@"dataSize" shouldForward:NO];
					// Passing the image through CoreImage cooks the colorspace -- go figure.  This makes it match again...
					[outImage setMetadata:[NSNumber numberWithBool: FALSE] forKey:@"disableColorMatching" shouldForward:NO];
					[outImage setMetadata:[NSNumber numberWithInt:0] forKey:@"textureTarget" shouldForward:YES];
					[outImage setMetadata:[NSNumber numberWithInt:0] forKey:@"textureLevels" shouldForward:YES];
					[self saveCIImage: [scale valueForKey:@"outputImage"] toFile: cacheImagePath];
					[sourceImage release];
					return outImage;
				}
				[sourceImage release];
				//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Proxy Handling Completed.");
			}
			else	// proxy file exists, just load that.
			{
				//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Found proxy file.  Using as data source...");
				data = [NSData dataWithContentsOfFile: cacheImagePath];
				// load cached exif info, if any
				NSString *error;
				NSData *exifFileData = [[NSData alloc] initWithContentsOfFile: cacheExifPath];
				[properties addEntriesFromDictionary:
					[NSPropertyListSerialization
						propertyListFromData: exifFileData
						mutabilityOption: NSPropertyListImmutable
						format: NULL
						errorDescription: &error]];
				[exifFileData release];

				usingProxy = TRUE;
			}
		}
		else	// non-proxied version.  use raw url data
		{
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Non-Proxy Path");
			data = [NSData dataWithContentsOfURL: url];

			if([data length])
			{
				// read EXIF info
				CGImageSourceRef isr = CGImageSourceCreateWithData((CFDataRef)data, nil);
				if(isr)
				{
					if(CGImageSourceGetCount(isr)>0)
					{
						//NSLog(@"isr2 exists!");
						CFDictionaryRef d = CGImageSourceCopyPropertiesAtIndex(isr, 0, nil);
						[properties addEntriesFromDictionary: (NSDictionary*)d];
						if (d)
							CFRelease(d);
					}
					CFRelease(isr);
				}
			}
			else
			{
				//NSLog(@"isr2 fail");
			}
		}

		if(![data length])
		{
//			NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  NSData: len %08x",[data length]);
//			NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  NSError: %08x",error);

			NSBundle *thisBundle=[NSBundle bundleForClass:[self class]];
			NSString *path=[thisBundle pathForResource:@"bad" ofType:@"png"];
			if(!path)
			{
				NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  can't find bad.png");
				return NO;
			}
			//NSURL *errorURL=[NSURL fileURLWithPath:path];
			data=[NSData dataWithContentsOfFile: path options:0 error:&error];
		}

		{
			//NSAssert(data,@"ImageDownloaderBlockingCache::requestImageUsingCache()  data == 0");
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  Creating QCImage...");
			outImage=[[QCImage alloc] initWithData:data options:nil];
			if(!outImage)
			{
				NSString *path=[[NSBundle bundleForClass:[self class]] pathForResource:@"bad" ofType:@"png"];
				data=[NSData dataWithContentsOfFile: path options:0 error:&error];
				outImage=[[QCImage alloc] initWithData:data options:nil];
			}
			[outImage setMetadata:url forKey:@"dataURL" shouldForward:NO];
			[outImage setMetadata:[NSNumber numberWithUnsignedInt:[data length]] forKey:@"dataSize" shouldForward:NO];
			if(usingProxy)	// cached versions don't need color matching
				[outImage setMetadata:[NSNumber numberWithBool:TRUE] forKey:@"disableColorMatching" shouldForward:NO];
			[outImage setMetadata:[NSNumber numberWithInt:0] forKey:@"textureTarget" shouldForward:YES];
			[outImage setMetadata:[NSNumber numberWithInt:0] forKey:@"textureLevels" shouldForward:YES];
			//NSAssert(outImage,@"ImageDownloaderBlockingCache::requestImageUsingCache()  outImage == 0");

			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache()  QCImage Created (0x%08x)",outImage);

			// cast is to silence a gcc warning -- initWithImage conflicts with a CoreImage message
			//NSLog(@"ImageDownloaderBlockingCache::requestImageUsingCache(%@)  estimated size: %lu",url,[c estimatedSize]);

		}

	return outImage;
}

- (void) saveCIImage:(CIImage*)img toFile:(NSString*)file
{
	NSBitmapImageRep *bmp = [[NSBitmapImageRep alloc]
		//					 initWithCIImage: img];	// leopard-only.  kills rest of this function :)
		initWithBitmapDataPlanes: NULL
		pixelsWide: [img extent].size.width//newSize.width
		pixelsHigh: [img extent].size.height//newSize.height
		bitsPerSample: 8
		samplesPerPixel: 4
		hasAlpha: YES
		isPlanar: NO
		colorSpaceName: NSDeviceRGBColorSpace
		bytesPerRow: 0
		bitsPerPixel: 0];

	// Create an NSGraphicsContext that draws into the NSBitmapImageRep. (This capability is new in Tiger.)
	NSGraphicsContext *nsContext = [NSGraphicsContext
		graphicsContextWithBitmapImageRep: bmp];

	// Save the previous graphics context and state, and make our bitmap context current.
	[NSGraphicsContext saveGraphicsState];
	[NSGraphicsContext setCurrentContext: nsContext];

	// Get a CIContext from the NSGraphicsContext, and use it to draw the CIImage into the NSBitmapImageRep.
	CGPoint point;
	point.x = 0;
	point.y = 0;
	[[nsContext CIContext] drawImage: img atPoint: point fromRect: [img extent]];

	// Restore the previous graphics context and state.
	[NSGraphicsContext restoreGraphicsState];

	 [[bmp representationUsingType: NSPNGFileType properties: nil]
		writeToFile: file atomically:NO];
	[bmp release];
}

-(void)_asyncLoadThread:(NSDictionary*)context
{
	NSAutoreleasePool *pool = [NSAutoreleasePool new];
	NSURL *url = [context objectForKey:@"URL"];

	NSMutableDictionary *properties = [[NSMutableDictionary alloc] init];
	QCImage *image;

	image = [self requestImage: url
			        proxyWidth: [[context objectForKey:@"width"] intValue]
			     interpolation: [[context objectForKey:@"interpolate"] intValue]
				    properties: properties];

	QCStructure *exif = [[QCStructure alloc] initWithDictionary: properties];
	[outputEXIFData setStructureValue: exif];
	[exif release];
	[properties release];

	[outputImage setImageValue:image];
	[image release];
	[outputFinished setBooleanValue: TRUE];

	[pool drain];
}

@end


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="liulx.l03service.MainActivity" >

    <Button
        android:id="@+id/btnStartService"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="开始服务" />

    <Button
        android:id="@+id/btnStopService"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="21dp"
        android:text="结束服务" />

    <Button
        android:id="@+id/btnBindService"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="绑定服务" />

    <Button
        android:id="@+id/btnUnbindService"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="解除绑定" />

    <Button
        android:id="@+id/btnGetCurrentNumber"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="获取数字" />

</LinearLayout>


text:
<?php

namespace Torann\LaravelRepository\Traits;

use Closure;
use Carbon\Carbon;
use Illuminate\Cache\CacheManager;
use Illuminate\Database\Eloquent\Model;

trait Cacheable
{
    /**
     * Cache instance
     *
     * @var CacheManager
     */
    protected static $cache = null;

    /**
     * Flush the cache after create/update/delete events.
     *
     * @var bool
     */
    protected $eventFlushCache = false;

    /**
     * Global lifetime of the cache.
     *
     * @var int
     */
    protected $cacheMinutes = 60;

    /**
     * Set cache manager.
     *
     * @param CacheManager $cache
     */
    public static function setCacheInstance(CacheManager $cache)
    {
        self::$cache = $cache;
    }

    /**
     * Get cache manager.
     *
     * @return CacheManager
     */
    public static function getCacheInstance()
    {
        if (self::$cache === null) {
            self::$cache = app('cache');
        }

        return self::$cache;
    }

    /**
     * Determine if the cache will be skipped
     *
     * @return bool
     */
    public function skippedCache()
    {
        return config('repositories.cache_enabled', false) === false
            || app('request')->has(config('repositories.cache_skip_param', 'skipCache')) === true;
    }

    /**
     * Get Cache key for the method
     *
     * @param string $method
     * @param mixed  $args
     * @param string $tag
     *
     * @return string
     */
    public function getCacheKey($method, $args = null, $tag = '')
    {
        // Sort through arguments
        foreach ($args as &$a) {
            if ($a instanceof Model) {
                $a = get_class($a) . '|' . $a->getKey();
            }
        }

        // Create hash from arguments and query
        $args = serialize($args) . serialize($this->getScopeQuery());

        return sprintf(
            '%s-%s@%s-%s',
            config('app.locale'),
            $tag,
            $method,
            md5($args)
        );
    }

    /**
     * Get an item from the cache, or store the default value.
     *
     * @param string   $method
     * @param array    $args
     * @param \Closure $callback
     * @param int      $time
     *
     * @return mixed
     */
    public function cacheCallback($method, $args, Closure $callback, $time = null)
    {
        // Cache disabled, just execute query & return result
        if ($this->skippedCache() === true) {
            return call_user_func($callback);
        }

        // Use the called class name as the tag
        $tag = get_called_class();

        return self::getCacheInstance()->tags(['repositories', $tag])->remember(
            $this->getCacheKey($method, $args, $tag),
            $this->getCacheExpiresTime($time),
            $callback
        );
    }

    /**
     * Flush the cache for the given repository.
     *
     * @return bool
     */
    public function flushCache()
    {
        // Cache disabled, just ignore this
        if ($this->eventFlushCache === false || config('repositories.cache_enabled', false) === false) {
            return false;
        }

        // Use the called class name as the tag
        $tag = get_called_class();

        return self::getCacheInstance()->tags(['repositories', $tag])->flush();
    }

    /**
     * Return the time until expires in minutes.
     *
     * @param int $time
     *
     * @return int
     */
    protected function getCacheExpiresTime($time = null)
    {
        if ($time === self::EXPIRES_END_OF_DAY) {
            return class_exists(Carbon::class)
                ? round(Carbon::now()->secondsUntilEndOfDay() / 60)
                : $this->cacheMinutes;
        }

        return $time ?: $this->cacheMinutes;
    }
}


text:
package org.apache.hadoop.hdfs.server.namenode.snapshot;

import java.util.List;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
import org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo;
import org.apache.hadoop.hdfs.server.namenode.INode;
import org.apache.hadoop.hdfs.server.namenode.INode.BlocksMapUpdateInfo;
import org.apache.hadoop.hdfs.server.namenode.INodeFile;
import org.apache.hadoop.hdfs.server.namenode.INodeFileAttributes;
import org.apache.hadoop.hdfs.server.namenode.Quota;

/**
 * Feature for file with snapshot-related information.
 */
@InterfaceAudience.Private
public class FileWithSnapshotFeature implements INode.Feature {
  private final FileDiffList diffs;
  private boolean isCurrentFileDeleted = false;

  public FileWithSnapshotFeature(FileDiffList diffs) {
    this.diffs = diffs != null? diffs: new FileDiffList();
  }

  public boolean isCurrentFileDeleted() {
    return isCurrentFileDeleted;
  }

  /**
   * We need to distinguish two scenarios:
   * 1) the file is still in the current file directory, it has been modified
   *    before while it is included in some snapshot
   * 2) the file is not in the current file directory (deleted), but it is in
   *    some snapshot, thus we still keep this inode
   * For both scenarios the file has snapshot feature. We set
   * {@link #isCurrentFileDeleted} to true for 2).
   */
  public void deleteCurrentFile() {
    isCurrentFileDeleted = true;
  }

  public FileDiffList getDiffs() {
    return diffs;
  }

  /** @return the max replication factor in diffs */
  public short getMaxBlockRepInDiffs() {
    short max = 0;
    for(FileDiff d : getDiffs()) {
      if (d.snapshotINode != null) {
        final short replication = d.snapshotINode.getFileReplication();
        if (replication > max) {
          max = replication;
        }
      }
    }
    return max;
  }

  boolean changedBetweenSnapshots(INodeFile file, Snapshot from, Snapshot to) {
    int[] diffIndexPair = diffs.changedBetweenSnapshots(from, to);
    if (diffIndexPair == null) {
      return false;
    }
    int earlierDiffIndex = diffIndexPair[0];
    int laterDiffIndex = diffIndexPair[1];

    final List<FileDiff> diffList = diffs.asList();
    final long earlierLength = diffList.get(earlierDiffIndex).getFileSize();
    final long laterLength = laterDiffIndex == diffList.size() ? file
        .computeFileSize(true, false) : diffList.get(laterDiffIndex)
        .getFileSize();
    if (earlierLength != laterLength) { // file length has been changed
      return true;
    }

    INodeFileAttributes earlierAttr = null; // check the metadata
    for (int i = earlierDiffIndex; i < laterDiffIndex; i++) {
      FileDiff diff = diffList.get(i);
      if (diff.snapshotINode != null) {
        earlierAttr = diff.snapshotINode;
        break;
      }
    }
    if (earlierAttr == null) { // no meta-change at all, return false
      return false;
    }
    INodeFileAttributes laterAttr = diffs.getSnapshotINode(
        Math.max(Snapshot.getSnapshotId(from), Snapshot.getSnapshotId(to)),
        file);
    return !earlierAttr.metadataEquals(laterAttr);
  }

  public String getDetailedString() {
    return (isCurrentFileDeleted()? "(DELETED), ": ", ") + diffs;
  }

  public Quota.Counts cleanFile(final INodeFile file, final int snapshotId,
      int priorSnapshotId, final BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes, final boolean countDiffChange)
      throws QuotaExceededException {
    if (snapshotId == Snapshot.CURRENT_STATE_ID) {
      // delete the current file while the file has snapshot feature
      if (!isCurrentFileDeleted()) {
        file.recordModification(priorSnapshotId);
        deleteCurrentFile();
      }
      collectBlocksAndClear(file, collectedBlocks, removedINodes);
      return Quota.Counts.newInstance();
    } else { // delete the snapshot
      priorSnapshotId = getDiffs().updatePrior(snapshotId, priorSnapshotId);
      return diffs.deleteSnapshotDiff(snapshotId, priorSnapshotId, file,
          collectedBlocks, removedINodes, countDiffChange);
    }
  }

  public void clearDiffs() {
    this.diffs.clear();
  }

  public Quota.Counts updateQuotaAndCollectBlocks(INodeFile file,
      FileDiff removed, BlocksMapUpdateInfo collectedBlocks,
      final List<INode> removedINodes) {
    long oldDiskspace = file.diskspaceConsumed();
    if (removed.snapshotINode != null) {
      short replication = removed.snapshotINode.getFileReplication();
      short currentRepl = file.getBlockReplication();
      if (currentRepl == 0) {
        oldDiskspace = file.computeFileSize(true, true) * replication;
      } else if (replication > currentRepl) {
        oldDiskspace = oldDiskspace / file.getBlockReplication() * replication;
      }
    }

    collectBlocksAndClear(file, collectedBlocks, removedINodes);

    long dsDelta = oldDiskspace - file.diskspaceConsumed();
    return Quota.Counts.newInstance(0, dsDelta);
  }

  /**
   * If some blocks at the end of the block list no longer belongs to
   * any inode, collect them and update the block list.
   */
  private void collectBlocksAndClear(final INodeFile file,
      final BlocksMapUpdateInfo info, final List<INode> removedINodes) {
    // check if everything is deleted.
    if (isCurrentFileDeleted() && getDiffs().asList().isEmpty()) {
      file.destroyAndCollectBlocks(info, removedINodes);
      return;
    }
    // find max file size.
    final long max;
    if (isCurrentFileDeleted()) {
      final FileDiff last = getDiffs().getLast();
      max = last == null? 0: last.getFileSize();
    } else {
      max = file.computeFileSize();
    }

    collectBlocksBeyondMax(file, max, info);
  }

  private void collectBlocksBeyondMax(final INodeFile file, final long max,
      final BlocksMapUpdateInfo collectedBlocks) {
    final BlockInfo[] oldBlocks = file.getBlocks();
    if (oldBlocks != null) {
      //find the minimum n such that the size of the first n blocks > max
      int n = 0;
      for(long size = 0; n < oldBlocks.length && max > size; n++) {
        size += oldBlocks[n].getNumBytes();
      }

      // starting from block n, the data is beyond max.
      if (n < oldBlocks.length) {
        // resize the array.
        final BlockInfo[] newBlocks;
        if (n == 0) {
          newBlocks = BlockInfo.EMPTY_ARRAY;
        } else {
          newBlocks = new BlockInfo[n];
          System.arraycopy(oldBlocks, 0, newBlocks, 0, n);
        }

        // set new blocks
        file.setBlocks(newBlocks);

        // collect the blocks beyond max.
        if (collectedBlocks != null) {
          for(; n < oldBlocks.length; n++) {
            collectedBlocks.addDeleteBlock(oldBlocks[n]);
          }
        }
      }
    }
  }
}


text:
console.log('© hirata 2018');

///////////////////////////////////////////////
// go top
///////////////////////////////////////////////
! function(){

    var elm = document.getElementById('gotop');

    window.addEventListener('scroll', function(){
        if( window.pageYOffset > 200 ) elm.classList.add('show');
        else elm.classList.remove('show');
    }, false);

    elm.addEventListener('click', function(){

        var cosParameter = window.scrollY / 2,
            scrollCount = 0,
            oldTimestamp = performance.now();

        function step (newTimestamp) {
            scrollCount += Math.PI / ( 600 / (newTimestamp - oldTimestamp));
            if (scrollCount >= Math.PI) window.scrollTo(0, 0);
            if (window.scrollY === 0) return;
            window.scrollTo(0, Math.round(cosParameter + cosParameter * Math.cos(scrollCount)));
            oldTimestamp = newTimestamp;
            window.requestAnimationFrame(step);
        }
        window.requestAnimationFrame(step);

    }, false);

}();

///////////////////////////////////////////////
// toggle menu
///////////////////////////////////////////////
! function(){

    var menu = {
        button : document.getElementById('menuButton'),
        box : document.getElementsByClassName('menu')[0]
    };
    var search = {
        button : document.getElementById('searchButton'),
        box : document.getElementsByClassName('search')[0]
    };
    var mask = document.getElementById('mask');
    var viewFlag = 0;

    // target を展開して、hideを隠す関数
    function toggleMenu( target, hide ){

        if( target.button.classList.contains('on') ){
            target.button.classList.remove('on');
            target.box.style.setProperty('--height',0);
            mask.style.display = 'none';
            viewFlag = 0;
        }else{
            target.button.classList.add('on');
            hide.button.classList.remove('on');
            hide.box.style.setProperty('--height',0);
            target.box.style.setProperty('--height',target.box.scrollHeight+'px');
            mask.style.display = 'block';
            viewFlag = 1;
        }

        return;

    }

    menu.button.addEventListener( 'click', function(){
        toggleMenu( menu, search );
    }, false );

    search.button.addEventListener( 'click', function(){
        toggleMenu( search, menu );
        setTimeout( function(){
            search.box.querySelector('input').focus();
        }, 300 );
    }, false );

    // 展開したメニューを全て隠す
    function hideAll() {
        if( !viewFlag ) return;
        menu.button.classList.remove('on');
        search.button.classList.remove('on');
        menu.box.style.setProperty('--height',0);
        search.box.style.setProperty('--height',0);
        mask.style.display = 'none';
        return;
    }
    mask.addEventListener('click', hideAll, false );
    window.addEventListener('scroll', hideAll, false );

    // 隠れたメニューがPC幅になったときに消えたままなのを防ぐ
    window.addEventListener('resize', function(){
        if( window.innerWidth >= 1280 ){
            menu.box.style.setProperty('--height',0);
            search.box.style.setProperty('--height',0);
        }
    }, false );

}();

///////////////////////////////////////////////
// search
///////////////////////////////////////////////
! function(){

    var elm = document.getElementById('search__box');

    elm.addEventListener('keydown', function(){
        if(window.event.keyCode==13)
            window.open('https://www.google.co.jp/search?q=site:hirata.blog+' + elm.value );
    }, false);

}();

///////////////////////////////////////////////
// pager
///////////////////////////////////////////////
! function(){

    var elm = document.getElementById('pager__select');

    if(!elm) return false;

    elm.addEventListener('change', function(){
        location.href = this.value;
    }, false);

}();

///////////////////////////////////////////////
// scroll reveal GH PAGESだと挙動が安定しないので、いったんOFF
///////////////////////////////////////////////
// ! function(){
//
//     var elm = document.querySelectorAll('#posts li');
//
//     // 画面内の要素をhide
//
//     // すでに画面内にある要素を表示
//     [].forEach.call( elm, function(elm){
//
//         var elmTop = elm.getBoundingClientRect().top + document.body.scrollTop;
//
//         if ( window.pageYOffset > elmTop - window.outerHeight*3/4 ){
//             elm.style.opacity = 1;
//             elm.style.transform = 'translateY(0)';
//         }
//
//     });
//
//     // スクロールして画面内に入った要素を表示
//     window.addEventListener('scroll', function(){
//
//         [].forEach.call( elm, function(elm){
//
//             var elmTop = elm.getBoundingClientRect().top + document.body.scrollTop;
//
//             if ( window.pageYOffset > elmTop - window.outerHeight*3/4 )
//                 elm.classList.add('inview');
//
//         });
//
//     }, false);
//
// }();

///////////////////////////////////////////////
// fix viewport more than 1920px width
///////////////////////////////////////////////
! function(){

    var elm = document.querySelector('meta[name=viewport]');

    if( window.innerWidth > 1920 )
        elm.setAttribute('content','width=1920');

}();


text:
#ifndef UMINTL_TOOLS_EXCEPTION_HPP
#define UMINTL_TOOLS_EXCEPTION_HPP

#include <exception>
#include <string>

namespace umintl{

namespace exceptions{

/** @brief Exception class in the case of incompatible parameters*/
class incompatible_parameters : public std::exception
{
public:
  incompatible_parameters() : message_() {}
  incompatible_parameters(std::string message) : message_("UMinTL: Incompatible supplied parameters: " + message) {}
  virtual const char* what() const throw() { return message_.c_str(); }
  virtual ~incompatible_parameters() throw() {}
private:
  std::string message_;
};

}

}
#endif


text:
const AuthenticationController = require('./controllers/authentication');
const UserController = require('./controllers/user');
const ChatController = require('./controllers/chat');
const CommunicationController = require('./controllers/communication');
const StripeController = require('./controllers/stripe');
const express = require('express');
const passport = require('passport');
const ROLE_MEMBER = require('./constants').ROLE_MEMBER;
const ROLE_CLIENT = require('./constants').ROLE_CLIENT;
const ROLE_OWNER = require('./constants').ROLE_OWNER;
const ROLE_ADMIN = require('./constants').ROLE_ADMIN;

const passportService = require('./config/passport');

// Middleware to require login/auth
const requireAuth = passport.authenticate('jwt', { session: false });
const requireLogin = passport.authenticate('local', { session: false });

module.exports = function (app) {
  // Initializing route groups
  const apiRoutes = express.Router(),
    authRoutes = express.Router(),
    userRoutes = express.Router(),
    chatRoutes = express.Router(),
    payRoutes = express.Router(),
    communicationRoutes = express.Router();

  //= ========================
  // Auth Routes
  //= ========================

  // Set auth routes as subgroup/middleware to apiRoutes
  apiRoutes.use('/auth', authRoutes);

  // Registration route
  authRoutes.post('/register', AuthenticationController.register);

  // Login route
  authRoutes.post('/login', requireLogin, AuthenticationController.login);

  // Password reset request route (generate/send token)
  authRoutes.post('/forgot-password', AuthenticationController.forgotPassword);

  // Password reset route (change password using token)
  authRoutes.post('/reset-password/:token', AuthenticationController.verifyToken);

  //= ========================
  // User Routes
  //= ========================

  // Set user routes as a subgroup/middleware to apiRoutes
  apiRoutes.use('/user', userRoutes);

  // View user profile route
  userRoutes.get('/:userId', requireAuth, UserController.viewProfile);

  // Test protected route
  apiRoutes.get('/protected', requireAuth, (req, res) => {
    res.send({ content: 'The protected test route is functional!' });
  });

  apiRoutes.get('/admins-only', requireAuth, AuthenticationController.roleAuthorization(ROLE_ADMIN), (req, res) => {
    res.send({ content: 'Admin dashboard is working.' });
  });

  //= ========================
  // Chat Routes
  //= ========================

  // Set chat routes as a subgroup/middleware to apiRoutes
  apiRoutes.use('/chat', chatRoutes);

  // View messages to and from authenticated user
  chatRoutes.get('/', requireAuth, ChatController.getConversations);

  // Retrieve single conversation
  chatRoutes.get('/:conversationId', requireAuth, ChatController.getConversation);

  // Send reply in conversation
  chatRoutes.post('/:conversationId', requireAuth, ChatController.sendReply);

  // Start new conversation
  chatRoutes.post('/new/:recipient', requireAuth, ChatController.newConversation);

  //= ========================
  // Payment Routes
  //= ========================
  apiRoutes.use('/pay', payRoutes);

  // Webhook endpoint for Stripe
  payRoutes.post('/webhook-notify', StripeController.webhook);

  // Create customer and subscription
  payRoutes.post('/customer', requireAuth, StripeController.createSubscription);

  // Update customer object and billing information
  payRoutes.put('/customer', requireAuth, StripeController.updateCustomerBillingInfo);

  // Delete subscription from customer
  payRoutes.delete('/subscription', requireAuth, StripeController.deleteSubscription);

  // Upgrade or downgrade subscription
  payRoutes.put('/subscription', requireAuth, StripeController.changeSubscription);

  // Fetch customer information
  payRoutes.get('/customer', requireAuth, StripeController.getCustomer);

  //= ========================
  // Communication Routes
  //= ========================
  apiRoutes.use('/communication', communicationRoutes);

  // Send email from contact form
  communicationRoutes.post('/contact', CommunicationController.sendContactForm);

  // Set url for API group routes
  app.use('/api', apiRoutes);
};


text:
class AddListarToGbasePermissions < ActiveRecord::Migration
  def change
    add_column :gbase_permissions, :listar, :boolean
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Aquilegia coerulea E. James

### Remarks
null


text:
package org.trustedanalytics.id;

@FunctionalInterface
public interface JobIdSupplier {
    String get(String name);
}


text:
package bnsantos.com.analytics.example.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Spinner;
import android.widget.Toast;

import bnsantos.com.analytics.example.AnalyticsSettingsDialog;
import bnsantos.com.analytics.example.Constants;
import bnsantos.com.analytics.example.R;

public class LoginActivity extends FragmentActivity {
    private Spinner mLoginSpinner;
    private Spinner mCompanySpinner;
    private String mCurrentUser;
    private String mCurrentCompany;
    private CheckBox mMixPanel;
    private CheckBox mFlurry;
    private CheckBox mCountly;
    private CheckBox mLocalytics;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        mLoginSpinner = (Spinner) findViewById(R.id.userSpinner);
        mCompanySpinner = (Spinner) findViewById(R.id.companySpinner);
        ArrayAdapter<CharSequence> usersAdapter = ArrayAdapter.createFromResource(this, R.array.users, android.R.layout.simple_spinner_item);
        ArrayAdapter<CharSequence> companyAdapter = ArrayAdapter.createFromResource(this, R.array.company, android.R.layout.simple_spinner_item);
        usersAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        companyAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mLoginSpinner.setAdapter(usersAdapter);
        mCompanySpinner.setAdapter(companyAdapter);

        mCurrentUser = usersAdapter.getItem(0).toString();
        mCurrentCompany = companyAdapter.getItem(0).toString();

        mLoginSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                mCurrentUser = (String) parent.getItemAtPosition(position);
                Constants.setCurrentUserId(position);
                Constants.setCurrentUser(mCurrentUser);
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });

        mCompanySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                mCurrentCompany = (String) parent.getItemAtPosition(position);
                Constants.setCurrentCompany(mCurrentCompany);
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });

        findViewById(R.id.loginButton).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                login();
            }
        });

        mMixPanel = (CheckBox) findViewById(R.id.checkBoxMixPanel);
        mFlurry = (CheckBox) findViewById(R.id.checkBoxFlurry);
        mCountly = (CheckBox) findViewById(R.id.checkBoxCountly);
        mLocalytics = (CheckBox) findViewById(R.id.checkBoxLocalytics);

        mMixPanel.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Constants.enableMixPanel = isChecked;
            }
        });
        mFlurry.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Constants.enableFlurry = isChecked;
            }
        });
        mCountly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Constants.enableCountly = isChecked;
            }
        });
        mLocalytics.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                Constants.enableLocalytics = isChecked;
            }
        });

        findViewById(R.id.mixPanelImageView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openWebPage("https://mixpanel.com/");
            }
        });
        findViewById(R.id.flurryImageView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openWebPage("https://dev.flurry.com/");
            }
        });
        findViewById(R.id.countlyImageView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openWebPage("https://count.ly/");
            }
        });
        findViewById(R.id.localyticsImageView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                openWebPage("http://www.localytics.com/");
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.login, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        switch (id) {
            case R.id.actionMixPanel:
                showMixPanelConfigDialog();
                return true;
            case R.id.actionFlurry:
                showFlurryConfigDialog();
                return true;
            case R.id.actionContlyKey:
                showCountlyKeyConfigDialog();
                return true;
            case R.id.actionCountlyServer:
                showCountlyServerConfigDialog();
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    private void login() {
        Toast.makeText(this, getString(R.string.login_message, Constants.getCurrentUser()), Toast.LENGTH_SHORT).show();
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
    }

    private void showMixPanelConfigDialog() {
        AnalyticsSettingsDialog analyticsSettingsDialog = new AnalyticsSettingsDialog();
        analyticsSettingsDialog.setMode(AnalyticsSettingsDialog.SettingsMode.MIX_PANEL);
        analyticsSettingsDialog.setTitle(R.string.dialog_mix_panel_title);
        analyticsSettingsDialog.show(getSupportFragmentManager(), "MixPanelConfig");
    }

    private void showFlurryConfigDialog() {
        AnalyticsSettingsDialog analyticsSettingsDialog = new AnalyticsSettingsDialog();
        analyticsSettingsDialog.setMode(AnalyticsSettingsDialog.SettingsMode.FLURRY);
        analyticsSettingsDialog.setTitle(R.string.dialog_flurry_title);
        analyticsSettingsDialog.show(getSupportFragmentManager(), "FlurryConfig");
    }

    private void showCountlyServerConfigDialog() {
        AnalyticsSettingsDialog analyticsSettingsDialog = new AnalyticsSettingsDialog();
        analyticsSettingsDialog.setMode(AnalyticsSettingsDialog.SettingsMode.COUNTLY_SERVER);
        analyticsSettingsDialog.setTitle(R.string.dialog_countly_server_title);
        analyticsSettingsDialog.show(getSupportFragmentManager(), "CountlyServer");
    }

    private void showCountlyKeyConfigDialog() {
        AnalyticsSettingsDialog analyticsSettingsDialog = new AnalyticsSettingsDialog();
        analyticsSettingsDialog.setMode(AnalyticsSettingsDialog.SettingsMode.COUNTLY_KEY);
        analyticsSettingsDialog.setTitle(R.string.dialog_countly_key_title);
        analyticsSettingsDialog.show(getSupportFragmentManager(), "CountlyKey");
    }

    private void openWebPage(String url){
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setData(Uri.parse(url));
        startActivity(i);
    }
}


text:
<?php

namespace DSteiner23\Light;

use DSteiner23\Light\Models\Lights;
use DSteiner23\Light\Models\State;

/**
 * Provides basic light switch functionality
 *
 * Interface LightSwitchInterface
 * @package App\Light
 */
interface LightSwitchInterface
{
    /**
     * Returns the hue communication object
     *
     * @return HueCommunicationInterface
     */
    public function getHueCommunication();

    /**
     * Switch a bulb on (using the default state)
     *
     * @param $id
     * @return bool
     */
    public function switchOn($id);

    /**
     * Switch a bulb off (using the default state)
     *
     * @param $id
     * @return bool
     */
    public function switchOff($id);

    /**
     * Change the state of a bulb
     *
     * @param $id
     * @param $saturation
     * @param $brightness
     * @param $hue
     * @return bool
     */
    public function switchState(
        $id,
        $saturation = State::MAX_SATURATION,
        $brightness = State::MAX_BRIGHTNESS,
        $hue
    );

    /**
     * @return Lights
     */
    public function getLights();
}


text:
<?php

class Mage_Rss_Block_Catalog_Abstract extends Mage_Rss_Block_Abstract
{
    /**
     * Stored price block instances
     * @var array
     */
    protected $_priceBlock = array();

    /**
     * Stored price blocks info
     * @var array
     */
    protected $_priceBlockTypes = array();

    /**
     * Default values for price block and template
     * @var string
     */
    protected $_priceBlockDefaultTemplate = 'catalog/rss/product/price.phtml';
    protected $_priceBlockDefaultType = 'catalog/product_price';

    /**
     * Whether to show "As low as" as a link
     * @var bool
     */
    protected $_useLinkForAsLowAs = true;

    /**
     * Default MAP renderer type
     *
     * @var string
     */
    protected $_mapRenderer = 'msrp_rss';

    /**
     * Return Price Block renderer for specified product type
     *
     * @param string $productTypeId Catalog Product type
     * @return Mage_Core_Block_Abstract
     */
    protected function _getPriceBlock($productTypeId)
    {
        if (!isset($this->_priceBlock[$productTypeId])) {
            $block = $this->_priceBlockDefaultType;
            if (isset($this->_priceBlockTypes[$productTypeId])) {
                if ($this->_priceBlockTypes[$productTypeId]['block'] != '') {
                    $block = $this->_priceBlockTypes[$productTypeId]['block'];
                }
            }
            $this->_priceBlock[$productTypeId] = $this->getLayout()->createBlock($block);
        }
        return $this->_priceBlock[$productTypeId];
    }

    /**
     * Return template for Price Block renderer
     *
     * @param string $productTypeId Catalog Product type
     * @return string
     */
    protected function _getPriceBlockTemplate($productTypeId)
    {
        if (isset($this->_priceBlockTypes[$productTypeId])) {
            if ($this->_priceBlockTypes[$productTypeId]['template'] != '') {
                return $this->_priceBlockTypes[$productTypeId]['template'];
            }
        }
        return $this->_priceBlockDefaultTemplate;
    }

    /**
     * Returns product price html for RSS feed
     *
     * @param Mage_Catalog_Model_Product $product
     * @param bool $displayMinimalPrice Display "As low as" etc.
     * @param string $idSuffix Suffix for HTML containers
     * @return string
     */
    public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix='')
    {
        $type_id = $product->getTypeId();
        if (Mage::helper('catalog')->canApplyMsrp($product)) {
            $type_id = $this->_mapRenderer;
        }

        return $this->_getPriceBlock($type_id)
            ->setTemplate($this->_getPriceBlockTemplate($type_id))
            ->setProduct($product)
            ->setDisplayMinimalPrice($displayMinimalPrice)
            ->setIdSuffix($idSuffix)
            ->setUseLinkForAsLowAs($this->_useLinkForAsLowAs)
            ->toHtml();
    }

    /**
     * Adding customized price template for product type, used as action in layouts
     *
     * @param string $type Catalog Product Type
     * @param string $block Block Type
     * @param string $template Template
     */
    public function addPriceBlockType($type, $block = '', $template = '')
    {
        if ($type) {
            $this->_priceBlockTypes[$type] = array(
                'block' => $block,
                'template' => $template
            );
        }
    }
}