text:
namespace DepartStoreManagementSystem.UI
{
    partial class frmUser
    {
        /// <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()
        {
            this.dataGridViewUsers = new System.Windows.Forms.DataGridView();
            this.label1 = new System.Windows.Forms.Label();
            this.labelUserID = new System.Windows.Forms.Label();
            this.textBoxUserID = new System.Windows.Forms.TextBox();
            this.textBoxUsername = new System.Windows.Forms.TextBox();
            this.labelUsername = new System.Windows.Forms.Label();
            this.textBoxFullName = new System.Windows.Forms.TextBox();
            this.labelFullName = new System.Windows.Forms.Label();
            this.textBoxEmail = new System.Windows.Forms.TextBox();
            this.labelEmail = new System.Windows.Forms.Label();
            this.textBoxContact = new System.Windows.Forms.TextBox();
            this.labelContact = new System.Windows.Forms.Label();
            this.textBoxPassword = new System.Windows.Forms.TextBox();
            this.labelPassword = new System.Windows.Forms.Label();
            this.labelUserType = new System.Windows.Forms.Label();
            this.comboBoxUserType = new System.Windows.Forms.ComboBox();
            this.buttonSave = new System.Windows.Forms.Button();
            this.buttonDelete = new System.Windows.Forms.Button();
            this.txtSearch = new System.Windows.Forms.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridViewUsers)).BeginInit();
            this.SuspendLayout();
            //
            // dataGridViewUsers
            //
            this.dataGridViewUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridViewUsers.Location = new System.Drawing.Point(385, 107);
            this.dataGridViewUsers.Name = "dataGridViewUsers";
            this.dataGridViewUsers.Size = new System.Drawing.Size(529, 347);
            this.dataGridViewUsers.TabIndex = 0;
            this.dataGridViewUsers.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridViewUsers_RowHeaderMouseClick);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(380, 20);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(152, 25);
            this.label1.TabIndex = 1;
            this.label1.Text = "Manage Users";
            //
            // labelUserID
            //
            this.labelUserID.AutoSize = true;
            this.labelUserID.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelUserID.Location = new System.Drawing.Point(13, 68);
            this.labelUserID.Name = "labelUserID";
            this.labelUserID.Size = new System.Drawing.Size(53, 16);
            this.labelUserID.TabIndex = 2;
            this.labelUserID.Text = "User ID";
            //
            // textBoxUserID
            //
            this.textBoxUserID.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxUserID.Location = new System.Drawing.Point(113, 68);
            this.textBoxUserID.Name = "textBoxUserID";
            this.textBoxUserID.ReadOnly = true;
            this.textBoxUserID.Size = new System.Drawing.Size(209, 22);
            this.textBoxUserID.TabIndex = 3;
            //
            // textBoxUsername
            //
            this.textBoxUsername.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxUsername.Location = new System.Drawing.Point(113, 107);
            this.textBoxUsername.Name = "textBoxUsername";
            this.textBoxUsername.Size = new System.Drawing.Size(209, 22);
            this.textBoxUsername.TabIndex = 5;
            //
            // labelUsername
            //
            this.labelUsername.AutoSize = true;
            this.labelUsername.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelUsername.Location = new System.Drawing.Point(13, 107);
            this.labelUsername.Name = "labelUsername";
            this.labelUsername.Size = new System.Drawing.Size(71, 16);
            this.labelUsername.TabIndex = 4;
            this.labelUsername.Text = "Username";
            //
            // textBoxFullName
            //
            this.textBoxFullName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxFullName.Location = new System.Drawing.Point(113, 149);
            this.textBoxFullName.Name = "textBoxFullName";
            this.textBoxFullName.Size = new System.Drawing.Size(209, 22);
            this.textBoxFullName.TabIndex = 7;
            //
            // labelFullName
            //
            this.labelFullName.AutoSize = true;
            this.labelFullName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelFullName.Location = new System.Drawing.Point(13, 149);
            this.labelFullName.Name = "labelFullName";
            this.labelFullName.Size = new System.Drawing.Size(69, 16);
            this.labelFullName.TabIndex = 6;
            this.labelFullName.Text = "Full Name";
            //
            // textBoxEmail
            //
            this.textBoxEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxEmail.Location = new System.Drawing.Point(113, 188);
            this.textBoxEmail.Name = "textBoxEmail";
            this.textBoxEmail.Size = new System.Drawing.Size(209, 22);
            this.textBoxEmail.TabIndex = 9;
            //
            // labelEmail
            //
            this.labelEmail.AutoSize = true;
            this.labelEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelEmail.Location = new System.Drawing.Point(13, 188);
            this.labelEmail.Name = "labelEmail";
            this.labelEmail.Size = new System.Drawing.Size(42, 16);
            this.labelEmail.TabIndex = 8;
            this.labelEmail.Text = "EMail";
            //
            // textBoxContact
            //
            this.textBoxContact.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxContact.Location = new System.Drawing.Point(113, 224);
            this.textBoxContact.Name = "textBoxContact";
            this.textBoxContact.Size = new System.Drawing.Size(209, 22);
            this.textBoxContact.TabIndex = 11;
            //
            // labelContact
            //
            this.labelContact.AutoSize = true;
            this.labelContact.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelContact.Location = new System.Drawing.Point(13, 230);
            this.labelContact.Name = "labelContact";
            this.labelContact.Size = new System.Drawing.Size(53, 16);
            this.labelContact.TabIndex = 10;
            this.labelContact.Text = "Contact";
            //
            // textBoxPassword
            //
            this.textBoxPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.textBoxPassword.Location = new System.Drawing.Point(113, 271);
            this.textBoxPassword.Name = "textBoxPassword";
            this.textBoxPassword.Size = new System.Drawing.Size(209, 22);
            this.textBoxPassword.TabIndex = 13;
            //
            // labelPassword
            //
            this.labelPassword.AutoSize = true;
            this.labelPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelPassword.Location = new System.Drawing.Point(13, 271);
            this.labelPassword.Name = "labelPassword";
            this.labelPassword.Size = new System.Drawing.Size(68, 16);
            this.labelPassword.TabIndex = 12;
            this.labelPassword.Text = "Password";
            //
            // labelUserType
            //
            this.labelUserType.AutoSize = true;
            this.labelUserType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelUserType.Location = new System.Drawing.Point(13, 316);
            this.labelUserType.Name = "labelUserType";
            this.labelUserType.Size = new System.Drawing.Size(69, 16);
            this.labelUserType.TabIndex = 14;
            this.labelUserType.Text = "UserType";
            //
            // comboBoxUserType
            //
            this.comboBoxUserType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.comboBoxUserType.FormattingEnabled = true;
            this.comboBoxUserType.Items.AddRange(new object[] {
            "Admin",
            "User",
            "Customer",
            "Vendor"});
            this.comboBoxUserType.Location = new System.Drawing.Point(113, 316);
            this.comboBoxUserType.Name = "comboBoxUserType";
            this.comboBoxUserType.Size = new System.Drawing.Size(209, 24);
            this.comboBoxUserType.TabIndex = 15;
            //
            // buttonSave
            //
            this.buttonSave.BackColor = System.Drawing.Color.ForestGreen;
            this.buttonSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonSave.ForeColor = System.Drawing.Color.White;
            this.buttonSave.Location = new System.Drawing.Point(113, 360);
            this.buttonSave.Name = "buttonSave";
            this.buttonSave.Size = new System.Drawing.Size(209, 44);
            this.buttonSave.TabIndex = 16;
            this.buttonSave.Text = "SAVE";
            this.buttonSave.UseVisualStyleBackColor = false;
            this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
            //
            // buttonDelete
            //
            this.buttonDelete.BackColor = System.Drawing.Color.Firebrick;
            this.buttonDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonDelete.ForeColor = System.Drawing.Color.White;
            this.buttonDelete.Location = new System.Drawing.Point(113, 410);
            this.buttonDelete.Name = "buttonDelete";
            this.buttonDelete.Size = new System.Drawing.Size(209, 44);
            this.buttonDelete.TabIndex = 17;
            this.buttonDelete.Text = "DELETE";
            this.buttonDelete.UseVisualStyleBackColor = false;
            this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
            //
            // txtSearch
            //
            this.txtSearch.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtSearch.Location = new System.Drawing.Point(385, 68);
            this.txtSearch.Name = "txtSearch";
            this.txtSearch.Size = new System.Drawing.Size(529, 22);
            this.txtSearch.TabIndex = 18;
            this.txtSearch.TextChanged += new System.EventHandler(this.txtSearch_TextChanged);
            //
            // frmUser
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(926, 481);
            this.Controls.Add(this.txtSearch);
            this.Controls.Add(this.buttonDelete);
            this.Controls.Add(this.buttonSave);
            this.Controls.Add(this.comboBoxUserType);
            this.Controls.Add(this.labelUserType);
            this.Controls.Add(this.textBoxPassword);
            this.Controls.Add(this.labelPassword);
            this.Controls.Add(this.textBoxContact);
            this.Controls.Add(this.labelContact);
            this.Controls.Add(this.textBoxEmail);
            this.Controls.Add(this.labelEmail);
            this.Controls.Add(this.textBoxFullName);
            this.Controls.Add(this.labelFullName);
            this.Controls.Add(this.textBoxUsername);
            this.Controls.Add(this.labelUsername);
            this.Controls.Add(this.textBoxUserID);
            this.Controls.Add(this.labelUserID);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.dataGridViewUsers);
            this.Name = "frmUser";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Users";
            this.Load += new System.EventHandler(this.frmUser_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dataGridViewUsers)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.DataGridView dataGridViewUsers;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label labelUserID;
        private System.Windows.Forms.TextBox textBoxUserID;
        private System.Windows.Forms.TextBox textBoxUsername;
        private System.Windows.Forms.Label labelUsername;
        private System.Windows.Forms.TextBox textBoxFullName;
        private System.Windows.Forms.Label labelFullName;
        private System.Windows.Forms.TextBox textBoxEmail;
        private System.Windows.Forms.Label labelEmail;
        private System.Windows.Forms.TextBox textBoxContact;
        private System.Windows.Forms.Label labelContact;
        private System.Windows.Forms.TextBox textBoxPassword;
        private System.Windows.Forms.Label labelPassword;
        private System.Windows.Forms.Label labelUserType;
        private System.Windows.Forms.ComboBox comboBoxUserType;
        private System.Windows.Forms.Button buttonSave;
        private System.Windows.Forms.Button buttonDelete;
        private System.Windows.Forms.TextBox txtSearch;
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'antd';
import { COLOR_BLOG_CATEGORY, COLOR_LABEL_CATEGORY } from '../../constants/config';

export default class TagCard extends React.Component {
  constructor() {
    super();
    this.getTagSum = this.getTagSum.bind(this);
  }
  getTagSum(issues) {
    const tagList = [];
    const tagHash = {};
    for (let i = 0; i < issues.length; i += 1) {
      const labels = issues[i].labels;
      for (let j = 0; j < labels.length; j += 1) {
        if (labels[j].color !== COLOR_BLOG_CATEGORY && labels[j].color !== COLOR_LABEL_CATEGORY) {
          const tag = labels[j].name;
          if (tagHash[tag] === undefined) {
            tagHash[tag] = true;
            const tagTemp = { tag, sum: 1 };
            tagList.push(tagTemp);
          } else {
            for (let k = 0; k < tagList.length; k += 1) {
              if (tagList[k].tag === tag) {
                tagList[k].sum += 1;
              }
            }
          }
        }
      }
    }
    return tagList;
  }
  render() {
    const tagList = this.getTagSum(this.props.issues).sort((a, b) => b.sum - a.sum).map(
      item =>
{item.tag}{item.sum}
);
    return (

<Icon type="bars" /> 统计

            {tagList}

    );
  }
}

TagCard.defaultProps = {
  issues: null,
};

TagCard.propTypes = {
  issues: PropTypes.array,
};

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://openprovenance.org/model/opmPrinterConfig">

  <graphName>PROV</graphName>

  <processes displayValue="true">
    <process value="http://process.org/add1ToAll" display="add1ToAll"/>
    <process value="http://process.org/split"     display="split"/>
    <process value="http://process.org/plus1"     display="+1"/>
    <process value="http://process.org/cons"      display="cons"/>
    <process value="http://process.org/fry"       display="fry"/>
    <process value="http://process.org/bake"      display="bake"/>
    <process value="http://process.org/badBake"   display="badBake"/>
  </processes>

  <artifacts displayValue="true">
    <artifact value="2 eggs"       display="two eggs"/>
  </artifacts>

  <agents displayValue="true">
  </agents>

  <edges default="filled">
    <edge type="org.openprovenance.model.Used"            style="filled"/>
    <edge type="org.openprovenance.model.WasGeneratedBy"  style="filled"/>
    <edge type="org.openprovenance.model.WasControlledBy" style="filled"/>
    <edge type="org.openprovenance.model.WasDerivedFrom"  style="filled"/>
    <edge type="org.openprovenance.model.WasTriggeredBy"  style="filled"/>

    <edge type="org.openprovenance.model.UsedStar"            style="dashed"/>
    <edge type="org.openprovenance.model.WasGeneratedByStar"  style="dashed"/>
    <edge type="org.openprovenance.model.WasDerivedFromStar"  style="dashed"/>
    <edge type="org.openprovenance.model.WasTriggeredByStar"  style="dashed"/>
  </edges>

  <accounts defaultAccount="black" defaultColor="black">
    <account name="orange"      color="red"/>
  </accounts>

</configuration>


text:
local Cosy = require "cosy"

--[[
Cosy.configure_server ("cosyverif.io", {
  www       = "www.cosyverif.io",
  rest      = "rest.cosyverif.io",
  websocket = "ws.cosyverif.io",
  username  = "alban",
  password  = "toto",
})
--]]

local model = Cosy.resource ("cosyverif.io/philosophers")
model.number = 0

-- Graph types:
model.vertex_type     = Cosy.new_type ()
model.link_type       = Cosy.new_type ()
Cosy.hide (model.vertex_type)
Cosy.hide (model.link_type)

-- Petri net types:
model.place_type      = Cosy.new_type (model.vertex_type)
model.transition_type = Cosy.new_type (model.vertex_type)
model.arc_type        = Cosy.new_type (model.link_type)
Cosy.hide (model.place_type)
Cosy.hide (model.transition_type)

function Cosy.is_place (x)
  return model.place_type < x
end

function Cosy.is_transition (x)
  return model.transition_type < x
end

function Cosy.is_arc (x)
  return model.arc_type < x
end

-- Philosophers types:
model.think_type = Cosy.new_type (model.place_type)
Cosy.set_position (model.think_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance = 300,
  }
end)
model.wait_type = Cosy.new_type (model.place_type)
Cosy.set_position (model.wait_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance = 200,
  }
end)
model.eat_type = Cosy.new_type (model.place_type)
Cosy.set_position (model.eat_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance = 100,
  }
end)
model.fork_type = Cosy.new_type (model.place_type)
Cosy.set_position (model.fork_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i * 1.5,
    distance = 250,
  }
end)
model.left_type = Cosy.new_type (model.transition_type)
Cosy.set_position (model.left_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance = 250,
  }
end)
model.right_type = Cosy.new_type (model.transition_type)
Cosy.set_position (model.right_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance = 150,
  }
end)
model.release_type = Cosy.new_type (model.transition_type)
Cosy.set_position (model.release_type, function (x)
  local n = model.number ()
  local i = x.i ()
  return i and "${angle}:${distance}" % {
    angle    = 360 / n * i,
    distance =  50,
  }
end)

function Cosy.create (source, link_type, target_type, data)
  ignore (link_type, target_type)
  local place_type      = model.place_type
  local transition_type = model.transition_type
  local arc_type        = model.arc_type
  if place_type < source then
    model [#model + 1] = Cosy.new_instance (transition_type, data)
  elseif transition_type < source then
    model [#model + 1] = Cosy.new_instance (place_type, data)
  else
    assert (false)
  end
  model [#model + 1] = Cosy.new_instance (arc_type, {
    source = source,
    target = target,
  })
  return model [#model - 1]
end

local function add (model)
  model.number = model.number () + 1
  local number = model.number ()
  print ("Adding philosopher ${number}." % {
    number = number
  })
  local name      = "#${n}" % { n = number }
  local next_name = "#${n}" % { n = 1      }
  -- Compute useful things:
  local wait_next
  local fork_next
  for _, place in pairs (model) do
    if model.wait_type < place
    and place.i () == 1 then
      wait_next = place
    elseif model.fork_type < place
    and place.i () == 1 then
      fork_next = place
    end
  end
  -- Places:
  local think = Cosy.insert (model, Cosy.new_instance (model.think_type, {
    name    = name .. " is thinking",
    marking = true,
    i       = number,
  }))
  local wait = Cosy.insert (model, Cosy.new_instance (model.wait_type, {
    name    = name .. " is waiting",
    marking = false,
    i       = number,
  }))
  local eat = Cosy.insert (model, Cosy.new_instance (model.eat_type, {
    name    = name .. " is eating",
    marking = false,
    i       = number,
  }))
  local fork = Cosy.insert (model, Cosy.new_instance (model.fork_type, {
    name    = name .. "'s fork",
    marking = true,
    i       = number,
  }))
  -- Transitions:
  local left = Cosy.insert (model, Cosy.new_instance (model.left_type, {
    name = name .. " takes his fork",
    i    = number,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = think,
    target = left,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = fork,
    target = left,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = left,
    target = wait,
  }))
  local right = Cosy.insert (model, Cosy.new_instance (model.right_type, {
    name = name .. " takes " .. next_name .. "'s fork",
    i    = number,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = wait,
    target = right,
  }))
  Cosy.new_instance (model.arc_type, {
    source = wait_next,
    target = right,
  })
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = right,
    target = eat,
  }))
  local release = Cosy.insert (model, Cosy.new_instance (model.release_type, {
    name = name .. " releases forks",
    i    = number,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = eat,
    target = release,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = release,
    target = think,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = release,
    target = fork,
  }))
  Cosy.insert (model, Cosy.new_instance (model.arc_type, {
    source = release,
    target = fork_next,
  }))
  -- Arcs that pointed to the first philosophers must also
  -- be updated:
  for _, arc in pairs (model) do
    if Cosy.is_arc (arc)
    and Cosy.is (Cosy.source (arc), model.release_type)
    and Cosy.is (Cosy.target (arc), model.fork_type)
    and Cosy.source (arc).i == number - 1
    and Cosy.target (arc).i == 1 then
      arc.target = fork
    elseif Cosy.is_arc (arc)
    and Cosy.is (Cosy.source (arc), model.wait_type)
    and Cosy.is (Cosy.target (arc), model.right_type)
    and Cosy.source (arc).i == 1
    and Cosy.target (arc).i == number - 1 then
      arc.source = wait
    end
  end
end

model.button_type = Cosy.new_type (model.transition_type)
model.insert = Cosy.new_instance (model.button_type, {
  name = "+1"
})
model.stop   = Cosy.new_instance (model.button_type, {
  name = "stop"
})

-- Add two philosophers:
add (model)
add (model)

Cosy.on_write( function (target)
  if model.insert <= target and Cosy.is_selected (model.insert) then
    Cosy.deselect (model.insert)
    add (model)
  elseif model.stop <= target and Cosy.is_selected (model.stop) then
    Cosy.remove (model.insert)
    Cosy.remove (model.stop)
    Cosy.stop ()
  end
end)


text:
drop database if exists Users;

create database if not exists Users;

use Users;

drop table if exists tbl_Users;

CREATE TABLE tbl_Users (
  userId int(11) NOT NULL AUTO_INCREMENT,
  username varchar(100) DEFAULT NULL,
  password varchar(100) DEFAULT NULL,
  salt varchar(256) DEFAULT NULL,
  PRIMARY KEY (userId),
  UNIQUE KEY username (username)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

CREATE TABLE tbl_Roles (
  roleId int(11) NOT NULL AUTO_INCREMENT,
  role varchar(25) NOT NULL,
  PRIMARY KEY (roleId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE tbl_UserRoles (
  userId int(11) NOT NULL,
  roleId int(11) NOT NULL,
  PRIMARY KEY (userId,roleId),
  KEY roleId (roleId),
  CONSTRAINT tbl_userroles_ibfk_1 FOREIGN KEY (userId) REFERENCES tbl_Users (userId),
  CONSTRAINT tbl_userroles_ibfk_2 FOREIGN KEY (roleId) REFERENCES tbl_Roles (roleId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO tbl_Roles (role)
  VALUES("user"), ("admin");


text:
use strict;
use warnings;

package WWW::Shopify::Model::SmartCollection::Image;
use parent 'WWW::Shopify::Model::NestedItem';

my $fields; sub fields { return $fields; }
BEGIN { $fields = {
	"created_at" =>  new WWW::Shopify::Field::Date(),
	"src" =>  new WWW::Shopify::Field::String::URL::Shopify(),
	"attachment" => new WWW::Shopify::Field::String::Base64()
}; }
sub get_fields { return qw(created_at src); }
sub creation_minimal { return qw(attachment); }
sub creation_filled { return qw(src created_at); }

eval(__PACKAGE__->generate_accessors); die $@ if $@;

1;


text:
from django.db import models

class Point(models.Model):
    id = models.AutoField(primary_key=True)
    lat = models.FloatField()
    lng = models.FloatField()
    state = models.SmallIntegerField(default=0)


text:
"""Utilities for writing tf.Example files."""

import collections

from language.compgen.nqg.model.parser.data import forest_serialization
from language.compgen.nqg.model.parser.data import parsing_utils
from language.compgen.nqg.model.parser.data import tokenization_utils

import tensorflow as tf

def _pad_values(values, padded_length):
  if len(values) > padded_length:
    raise ValueError("length %s is > %s" % (len(values), padded_length))
  for _ in range(len(values), padded_length):
    values.append(0)
  return values

def _create_int_feature(values, padded_length):
  values = _pad_values(values, padded_length)
  feature = tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
  return feature

def get_rule_to_idx_map(rules):
  rule_to_idx_map = {}
  for idx, rule in enumerate(rules):
    rule_to_idx_map[rule] = idx + 1  # Reserve 0 for padding.
  return rule_to_idx_map

def _get_applications(root_node, rule_to_idx_map, token_start_wp_idx,
                      token_end_wp_idx):
  """Returns structures for anchored applications."""
  # Traverse all nodes.
  node_stack = [root_node]
  seen_fingerprints = set()
  # Set of (span_begin, span_end, rule).
  applications = set()
  while node_stack:
    node = node_stack.pop()
    fingerprint = id(node)
    if fingerprint in seen_fingerprints:
      continue
    seen_fingerprints.add(fingerprint)

    if isinstance(node, parsing_utils.AggregationNode):
      for child in node.children:
        node_stack.append(child)
    elif isinstance(node, parsing_utils.RuleApplicationNode):
      for child in node.children:
        node_stack.append(child)
      applications.add((node.span_begin, node.span_end, node.rule))
    else:
      raise ValueError("Unexpected node type.")

  # Map of (span_begin, span_end, rule) to integer idx.
  application_key_to_idx_map = {}

  # Lists of integers.
  application_span_begin = []
  application_span_end = []
  application_rule_idx = []

  # Sort applications to avoid non-determinism.
  applications = sorted(applications)
  for idx, (span_begin, span_end, rule) in enumerate(applications):
    application_key_to_idx_map[(span_begin, span_end, rule)] = idx

    application_span_begin.append(token_start_wp_idx[span_begin])
    # token_end_wp_idx is an *inclusive* idx.
    # span_end is an *exclusive* idx.
    # application_span_end is an *inclusive* idx.
    application_span_end.append(token_end_wp_idx[span_end - 1])
    rule_idx = rule_to_idx_map[rule]
    application_rule_idx.append(rule_idx)

  return (application_key_to_idx_map, application_span_begin,
          application_span_end, application_rule_idx)

def _convert_to_tf_example(example, tokenizer, rules, config, max_sizes=None):
  """Return tf.Example generated for input (source, target)."""
  source = example[0]
  target = example[1]
  tokens = source.split(" ")
  num_tokens = len(tokens)

  # Tokenize.
  (wordpiece_ids, num_wordpieces, token_start_wp_idx,
   token_end_wp_idx) = tokenization_utils.get_wordpiece_inputs(
       tokens, tokenizer)

  # Run chart parser.
  target_node = parsing_utils.get_target_node(source, target, rules)
  if not target_node:
    raise ValueError("No parse returned for target for example: (%s, %s)" %
                     (source, target))
  merged_node = parsing_utils.get_merged_node(source, rules)

  # Get anchored applications.
  rule_to_idx_map = get_rule_to_idx_map(rules)
  (application_key_to_idx_map, application_span_begin, application_span_end,
   application_rule_idx) = _get_applications(merged_node, rule_to_idx_map,
                                             token_start_wp_idx,
                                             token_end_wp_idx)
  num_applications = len(application_span_begin)

  def application_idx_fn(span_begin, span_end, rule):
    return application_key_to_idx_map[(span_begin, span_end, rule)]

  # Get numerator forest.
  (nu_node_type, nu_node_1_idx, nu_node_2_idx, nu_application_idx,
   nu_num_nodes) = forest_serialization.get_forest_lists(
       target_node, num_tokens, application_idx_fn)
  # Get denominator forest.
  (de_node_type, de_node_1_idx, de_node_2_idx, de_application_idx,
   de_num_nodes) = forest_serialization.get_forest_lists(
       merged_node, num_tokens, application_idx_fn)

  # Create features dict.
  features = collections.OrderedDict()
  features["wordpiece_ids"] = _create_int_feature(wordpiece_ids,
                                                  config["max_num_wordpieces"])
  features["num_wordpieces"] = _create_int_feature([num_wordpieces], 1)

  features["application_span_begin"] = _create_int_feature(
      application_span_begin, config["max_num_applications"])
  features["application_span_end"] = _create_int_feature(
      application_span_end, config["max_num_applications"])
  features["application_rule_idx"] = _create_int_feature(
      application_rule_idx, config["max_num_applications"])

  features["nu_node_type"] = _create_int_feature(
      nu_node_type, config["max_num_numerator_nodes"])
  features["nu_node_1_idx"] = _create_int_feature(
      nu_node_1_idx, config["max_num_numerator_nodes"])
  features["nu_node_2_idx"] = _create_int_feature(
      nu_node_2_idx, config["max_num_numerator_nodes"])
  features["nu_application_idx"] = _create_int_feature(
      nu_application_idx, config["max_num_numerator_nodes"])
  features["nu_num_nodes"] = _create_int_feature([nu_num_nodes], 1)

  features["de_node_type"] = _create_int_feature(
      de_node_type, config["max_num_denominator_nodes"])
  features["de_node_1_idx"] = _create_int_feature(
      de_node_1_idx, config["max_num_denominator_nodes"])
  features["de_node_2_idx"] = _create_int_feature(
      de_node_2_idx, config["max_num_denominator_nodes"])
  features["de_application_idx"] = _create_int_feature(
      de_application_idx, config["max_num_denominator_nodes"])
  features["de_num_nodes"] = _create_int_feature([de_num_nodes], 1)

  tf_example = tf.train.Example(features=tf.train.Features(feature=features))

  # Update max sizes.
  if max_sizes is not None:
    max_sizes["num_wordpieces"] = max(max_sizes["num_wordpieces"],
                                      num_wordpieces)
    max_sizes["num_applications"] = max(max_sizes["num_applications"],
                                        num_applications)
    max_sizes["nu_num_nodes"] = max(max_sizes["nu_num_nodes"], nu_num_nodes)
    max_sizes["de_num_nodes"] = max(max_sizes["de_num_nodes"], de_num_nodes)

  return tf_example

class ExampleConverter(object):
  """Converts inputs to tf.Example protos."""

  def __init__(self, rules, tokenizer, config):
    self.rules = rules
    self.tokenizer = tokenizer
    self.config = config
    self.max_sizes = collections.defaultdict(int)

  def convert(self, example):
    """Return tf.Example or Raise."""
    tf_example = _convert_to_tf_example(example, self.tokenizer, self.rules,
                                        self.config, self.max_sizes)
    return tf_example

  def print_max_sizes(self):
    """Print max sizes which is useful for determining necessary padding."""
    print("max_sizes: %s" % self.max_sizes)


text:
package io.dataplay.storm;

import backtype.storm.tuple.Fields;

/**
 * A collection of stream identifiers used for our topology coordination plane.
 * These are used by our coordination bolt to ensure that topologies are only
 * shut down when the last tuple has been handled.
 *
 * @author Michael Krotscheck
 */
public final class Stream {

    /**
     * Get the name of this stream.
     *
     * @return The stream's name
     */
    public String getName() {
        return name;
    }

    /**
     * Get the fields for this stream.
     *
     * @return The stream's fields
     */
    public Fields getFields() {
        return fields;
    }

    /**
     * The name of this stream.
     */
    private final String name;

    /**
     * The fields emitted within this stream.
     */
    private final Fields fields;

    /**
     * Creates a new stream descriptor.
     *
     * @param streamName   The name of the stream.
     * @param streamFields The fields which tuples in this stream will send.
     */
    private Stream(final String streamName, final Fields streamFields) {
        this.name = streamName;
        this.fields = streamFields;
    }

    /**
     * Our bolt management stream.
     */
    public static final Stream BOLT_MANAGEMENT = new Stream("bolt_manager",
            new Fields("command"));

    /**
     * Our generic management stream.
     */
    public static final Stream STATUS = new Stream("worker_status",
            new Fields("componentId", "threadId", "state"));

}


text:
package main.java.com.kensk8er.algorithms.graph;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by kensk8er
 *
 * WeightedDirectedGraph class is a data structure that describes a weighted directed graph.
 */
public class WeightedDirectedGraph extends AbstractGraph {

    private Map<Integer, Map<Integer, Integer>> tailToHeadToLen;

    /**
     * Initialize a WeightedDirectedGraph object from a collection of edges.
     *
     * @param edges  collection of edges
     */
    public WeightedDirectedGraph(Collection<Edge> edges) {
        super();
        this.tailToHeadToLen = new HashMap<>();
        for (Edge edge: edges) {
            this.edges.add(edge);

            int tailNodeId = edge.getTailNodeId();
            if (!this.nodeIds.contains(tailNodeId)) {
                this.nodeIds.add(tailNodeId);
            }

            int headNodeId = edge.getHeadNodeId();
            if (!this.nodeIds.contains(headNodeId)) {
                this.nodeIds.add(headNodeId);
            }

            if (!this.tailToHeadToLen.containsKey(tailNodeId)) {
                this.tailToHeadToLen.put(tailNodeId, new HashMap<>());
            }
            this.tailToHeadToLen.get(tailNodeId).put(headNodeId, edge.getLength());
        }
    }

    /**
     * Return true if the graph has the edge specified by tailNodeId and headNodeId, else false.
     *
     * @param tailNodeId nodeID that an edge points from
     * @param headNodeId nodeID that an edge points to
     * @return true if the graph has the edge, else false
     */
    public boolean hasEdge(int tailNodeId, int headNodeId) {
        if (this.tailToHeadToLen.containsKey(tailNodeId)) {
            if (this.tailToHeadToLen.get(tailNodeId).containsKey(headNodeId)) {
                return true;
            }
        }
        return false;
    }

    /**
     * Return the length of the edge specified by tailNodeId and headNodeId.
     *
     * @param tailNodeId nodeID that an edge points from
     * @param headNodeId nodeID that an edge points to
     * @return the length of the edge
     */
    public int getLen(int tailNodeId, int headNodeId) {
        return this.tailToHeadToLen.get(tailNodeId).get(headNodeId);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Puccinia alatavica Nevod.

### Remarks
null


text:
class Chemtrail::Resource
  attr_reader :id, :type

  def initialize(id, type, properties = nil)
    @id = id
    @type = type
    @properties = Chemtrail::PropertyList.new.merge(properties) if properties
  end

  def to_reference
    { "Ref" => id }
  end

  def properties
    @properties ||= Chemtrail::PropertyList.new
  end

  def to_hash
    {
      id => {
        "Type" => type,
        "Properties" => properties.to_hash
      }
    }
  end
end


text:
package org.tolweb.btol;

import java.io.Serializable;

/**
 * @hibernate.class table="Genes"
 * @author dmandel
 *
 */
public class Gene extends NamedObject implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1883393699489728799L;
	private String drosophilaName;
	private Integer triboliumLength;
	private String synonyms;
	private boolean hidden;
	private boolean important;
	private String abbreviatedName;
	/**
	 * @hibernate.property
	 * @return
	 */
	public String getDrosophilaName() {
		return drosophilaName;
	}
	public void setDrosophilaName(String drosophilaName) {
		this.drosophilaName = drosophilaName;
	}
	/**
	 * @hibernate.property
	 * @return
	 */
	public Integer getTriboliumLength() {
		return triboliumLength;
	}
	public void setTriboliumLength(Integer tribolium) {
		this.triboliumLength = tribolium;
	}
	/**
	 * @hibernate.property
	 * @return
	 */
	public String getSynonyms() {
		return synonyms;
	}
	public void setSynonyms(String synonym) {
		this.synonyms = synonym;
	}
	/**
	 * used for things that aren't really genes but we want them to show up as such
	 * (for now it's the Mitochondrial genome though it may be other things later)
	 * @hibernate.property
	 * @return
	 */
	public boolean getHidden() {
		return hidden;
	}
	public void setHidden(boolean hidden) {
		this.hidden = hidden;
	}
	/**
	 * @hibernate.property
	 * @return
	 */
	public boolean getImportant() {
		return important;
	}
	public void setImportant(boolean primary) {
		this.important = primary;
	}
	/**
	 * @hibernate.property
	 * @return
	 */
	public String getAbbreviatedName() {
		return abbreviatedName;
	}
	public void setAbbreviatedName(String abbreviatedName) {
		this.abbreviatedName = abbreviatedName;
	}
}


text:
namespace offline_pages {

class OfflinerPolicy;
class RequestCoordinatorEventLogger;
class RequestNotifier;
class RequestQueueStore;

class CleanupTaskFactory {
 public:
  CleanupTaskFactory(OfflinerPolicy* policy,
                     RequestNotifier* notifier,
                     RequestCoordinatorEventLogger* event_logger);

  ~CleanupTaskFactory();

  std::unique_ptr<CleanupTask> CreateCleanupTask(RequestQueueStore* store);

 private:
  // Unowned pointer to the Policy
  raw_ptr<OfflinerPolicy> policy_;
  // Unowned pointer to the notifier
  raw_ptr<RequestNotifier> notifier_;
  // Unowned pointer to the EventLogger
  raw_ptr<RequestCoordinatorEventLogger> event_logger_;
};

}  // namespace offline_pages

#endif  // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_CLEANUP_TASK_FACTORY_H_


text:
Carcassone
==========

PHP Implementation of Carcassone's board game.

Rules:
http://zmangames.com/rulebooks/Carcassonne.pdf

List of available tiles:
http://www.ccs.neu.edu/home/matthias/670-s05/Projects/tiles.html

Useful resource:
http://www.ccs.neu.edu/home/matthias/670-s05/Projects/carcassonne.html

AI Algo in Java:
http://www.home.zonnet.nl/ludomaat/pub/carcassonne_paper.pdf


text:
class User < ActiveRecord::Base
  has_many :projects
  attr_accessible :name
end


text:
#if !defined(FUSION_ADAPT_VALUE_TRAITS_05062005_0859)
#define FUSION_ADAPT_VALUE_TRAITS_05062005_0859

#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/value_of.hpp>

namespace boost { namespace fusion { namespace detail
{
    struct adapt_value_traits
    {
        template <typename Iterator>
        struct apply
        {
            typedef typename
                result_of::value_of<typename Iterator::first_type>::type
            type;
        };
    };
}}}

#endif


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>Categories</title>
  <meta property="og:title" content="Categories" />
  <meta name="twitter:title" content="Categories" />
  <meta name="author" content="Kelly Ripple"/>
  <link href='http://kellyripple.com/img/favicon.ico' rel='icon' type='image/x-icon'/>
  <meta property="og:image" content="http://kellyripple.com/img/avatar-icon.png" />
  <meta name="twitter:image" content="http://kellyripple.com/img/avatar-icon.png" />
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@krippleffect" />
  <meta name="twitter:creator" content="@krippleffect" />
  <meta property="og:url" content="http://kellyripple.com/categories/" />
  <meta property="og:type" content="website" />
  <meta property="og:site_name" content="Kelly Ripple" />

  <meta name="generator" content="Hugo 0.39" />
  <link rel="canonical" href="http://kellyripple.com/categories/" />
  <link rel="alternate" href="http://kellyripple.com/categories/index.xml" type="application/rss+xml" title="Kelly Ripple">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <link rel="stylesheet" href="http://kellyripple.com/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  <link rel="stylesheet" href="http://kellyripple.com/css/highlight.min.css" /><link rel="stylesheet" href="http://kellyripple.com/css/codeblock.css" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">

      <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
      <button class="pswp__button pswp__button--share" title="Share"></button>
      <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
      <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

    <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
    </button>
    <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
    </button>

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
        Toggle navigation

      </button>
      Kelly Ripple

              Blog

              Projects

              About

              Tags

Categories

              Kelly Ripple

           •
          2016

             •
            Kelly Ripple

          Hugo v0.39 powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo


text:
package converters

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"log"
	"reflect"
	"regexp"
	"strings"

	"github.com/golang/protobuf/jsonpb"
	"github.com/golang/protobuf/proto"
	"github.com/golang/protobuf/ptypes"
	"github.com/golang/protobuf/ptypes/empty"
	auditpb "google.golang.org/genproto/googleapis/cloud/audit"
	logpb "google.golang.org/genproto/googleapis/logging/v2"

	"cloud.google.com/go/pubsub"
	cev2 "github.com/cloudevents/sdk-go/v2"
	schemasv1 "github.com/google/knative-gcp/pkg/schemas/v1"
)

const (
	parentResourcePattern = `^(:?projects|organizations|billingAccounts|folders)/[^/]+`
)

var (
	jsonpbUnmarshaller = jsonpb.Unmarshaler{
		AllowUnknownFields: true,
		AnyResolver:        resolver(resolveAnyUnknowns),
	}
	jsonpbMarshaler      = jsonpb.Marshaler{}
	parentResourceRegexp *regexp.Regexp
)

func init() {
	var err error
	if parentResourceRegexp, err = regexp.Compile(parentResourcePattern); err != nil {
		log.Fatal(err)
	}
}

// Resolver function type that can be used to resolve Any fields in a jsonpb.Unmarshaler.
type resolver func(turl string) (proto.Message, error)

func (r resolver) Resolve(turl string) (proto.Message, error) {
	return r(turl)
}

type UnknownMsg empty.Empty

func (m *UnknownMsg) ProtoMessage() {
	(*empty.Empty)(m).ProtoMessage()
}

func (m *UnknownMsg) Reset() {
	(*empty.Empty)(m).Reset()
}

func (m *UnknownMsg) String() string {
	return "Unknown message"
}

// Resolves type URLs such as
// type.googleapis.com/google.profile.Person to a proto message
// type. Resolves unknown message types to empty.Empty.
func resolveAnyUnknowns(typeURL string) (proto.Message, error) {
	// Only the part of typeUrl after the last slash is relevant.
	mname := typeURL
	if slash := strings.LastIndex(mname, "/"); slash >= 0 {
		mname = mname[slash+1:]
	}
	mt := proto.MessageType(mname)
	if mt == nil {
		return (*UnknownMsg)(&empty.Empty{}), nil
	}
	return reflect.New(mt.Elem()).Interface().(proto.Message), nil
}

// Log name ref: https://cloud.google.com/logging/docs/audit#viewing_audit_logs
func logActivity(logName string) string {
	parts := strings.Split(logName, "%2F")
	if len(parts) < 2 {
		return ""
	}
	// Could be "activity" or "data_access"
	return parts[1]
}

func convertCloudAuditLogs(ctx context.Context, msg *pubsub.Message) (*cev2.Event, error) {
	entry := logpb.LogEntry{}
	if err := jsonpbUnmarshaller.Unmarshal(bytes.NewReader(msg.Data), &entry); err != nil {
		return nil, fmt.Errorf("failed to decode LogEntry: %w", err)
	}

	parentResource := parentResourceRegexp.FindString(entry.LogName)
	if parentResource == "" {
		return nil, fmt.Errorf("invalid LogName: %q", entry.LogName)
	}
	logActivity := logActivity(entry.LogName)

	// Make a new event and convert the message payload.
	event := cev2.NewEvent(cev2.VersionV1)
	event.SetID(schemasv1.CloudAuditLogsEventID(entry.InsertId, entry.LogName, ptypes.TimestampString(entry.Timestamp)))
	if timestamp, err := ptypes.Timestamp(entry.Timestamp); err != nil {
		return nil, fmt.Errorf("invalid LogEntry timestamp: %w", err)
	} else {
		event.SetTime(timestamp)
	}
	event.SetType(schemasv1.CloudAuditLogsLogWrittenEventType)
	event.SetSource(schemasv1.CloudAuditLogsEventSource(parentResource, logActivity))
	event.SetDataSchema(schemasv1.CloudAuditLogsEventDataSchema)
	event.SetData(cev2.ApplicationJSON, msg.Data)

	switch payload := entry.Payload.(type) {
	case *logpb.LogEntry_ProtoPayload:
		var unpacked ptypes.DynamicAny
		if err := ptypes.UnmarshalAny(payload.ProtoPayload, &unpacked); err != nil {
			return nil, fmt.Errorf("unrecognized proto payload: %w", err)
		}
		switch proto := unpacked.Message.(type) {
		case *auditpb.AuditLog:
			event.SetSubject(schemasv1.CloudAuditLogsEventSubject(proto.ServiceName, proto.ResourceName))
			event.SetExtension(schemasv1.ServiceNameExtension, proto.ServiceName)
			event.SetExtension(schemasv1.MethodNameExtension, proto.MethodName)
			event.SetExtension(schemasv1.ResourceNameExtension, proto.ResourceName)
		default:
			return nil, fmt.Errorf("unhandled proto payload type: %T", proto)
		}
	default:
		return nil, errors.New("non-AuditLog log entry")
	}
	return &event, nil
}


text:
package io.joern.c2cpg.testfixtures

import better.files.File
import io.joern.c2cpg.Config
import io.joern.c2cpg.passes.AstCreationPass
import io.joern.x2cpg.X2Cpg.newEmptyCpg
import io.shiftleft.codepropertygraph.Cpg
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.scalatest.Inside

abstract class AbstractPassTest extends AnyWordSpec with Matchers with Inside {

  protected abstract class Fixture

  protected object AstFixture extends Fixture {
    def apply(code: String, fileName: String = "file.c")(f: Cpg => Unit): Unit = {
      File.usingTemporaryDirectory("c2cpgtest") { dir =>
        val cpg  = newEmptyCpg()
        val file = dir / fileName
        file.write(code)
        val config = Config(inputPath = dir.toString, outputPath = dir.toString())
        new AstCreationPass(cpg, AstCreationPass.SourceFiles, config).createAndApply()
        f(cpg)
        file.delete()
      }
    }

    def createCpg(code: String): Cpg = {
      val cpg = newEmptyCpg()
      File.usingTemporaryDirectory("c2cpgtest") { dir =>
        val file = dir / "file.c"
        file.write(code)
        val config = Config(inputPath = dir.toString, outputPath = dir.toString())
        new AstCreationPass(cpg, AstCreationPass.SourceFiles, config).createAndApply()
      }
      cpg
    }
  }

}


text:
define('tinymce/inlite/alien/EditorSettings', [
	'tinymce/inlite/alien/Type'
], function (Type) {
	var validDefaultOrDie = function (value, predicate) {
		if (predicate(value)) {
			return true;
		}

		throw new Error('Default value doesn\'t match requested type.');
	};

	var getByTypeOr = function (predicate) {
		return function (editor, name, defaultValue) {
			var settings = editor.settings;
			validDefaultOrDie(defaultValue, predicate);
			return name in settings && predicate(settings[name]) ? settings[name] : defaultValue;
		};
	};

	var splitNoEmpty = function (str, delim) {
		return str.split(delim).filter(function (item) {
			return item.length > 0;
		});
	};

	var itemsToArray = function (value, defaultValue) {
		var stringToItemsArray = function (value) {
			return typeof value === 'string' ? splitNoEmpty(value, /[ ,]/) : value;
		};

		var boolToItemsArray = function (value, defaultValue) {
			return value === false ? [ ] : defaultValue;
		};

		if (Type.isArray(value)) {
			return value;
		} else if (Type.isString(value)) {
			return stringToItemsArray(value);
		} else if (Type.isBoolean(value)) {
			return boolToItemsArray(value, defaultValue);
		}

		return defaultValue;
	};

	var getToolbarItemsOr = function (predicate) {
		return function (editor, name, defaultValue) {
			var value = name in editor.settings ? editor.settings[name] : defaultValue;
			validDefaultOrDie(defaultValue, predicate);
			return itemsToArray(value, defaultValue);
		};
	};

	return {
		// TODO: Add Option based getString, getBool if merged with core
		getStringOr: getByTypeOr(Type.isString),
		getBoolOr: getByTypeOr(Type.isBoolean),
		getNumberOr: getByTypeOr(Type.isNumber),
		getHandlerOr: getByTypeOr(Type.isFunction),
		getToolbarItemsOr: getToolbarItemsOr(Type.isArray)
	};
});


text:
InspectorTest.log('Tests that all sessions get exception notifications.');

function connect(contextGroup, num) {
  var session = contextGroup.connect();
  var exceptionId;
  session.Protocol.Runtime.onExceptionThrown(message => {
    InspectorTest.log('From session ' + num);
    InspectorTest.logMessage(message);
    exceptionId = message.params.exceptionDetails.exceptionId;
  });
  session.Protocol.Runtime.onExceptionRevoked(message => {
    InspectorTest.log('From session ' + num);
    InspectorTest.logMessage(message);
    InspectorTest.log('id matching: ' + (message.params.exceptionId === exceptionId));
  });
  return session;
}

(async function test() {
  var contextGroup = new InspectorTest.ContextGroup();
  var session1 = connect(contextGroup, 1);
  var session2 = connect(contextGroup, 2);
  await session1.Protocol.Runtime.enable();
  await session2.Protocol.Runtime.enable();

  InspectorTest.log('Throwing in 2');
  await session2.Protocol.Runtime.evaluate({expression: 'throw "error1";'});

  InspectorTest.log('Throwing in 1');
  await session1.Protocol.Runtime.evaluate({expression: 'throw "error2";'});

  InspectorTest.log('Throwing in setTimeout 1');
  await session1.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { throw "error3"; }, 0)'});
  await InspectorTest.waitForPendingTasks();

  InspectorTest.log('Throwing in setTimeout 2');
  await session2.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { throw "error4"; }, 0)'});
  await InspectorTest.waitForPendingTasks();

  InspectorTest.log('Rejecting in 2');
  await session2.Protocol.Runtime.evaluate({expression: 'var p2; setTimeout(() => { p2 = Promise.reject("error5") }, 0)'});
  await InspectorTest.waitForPendingTasks();
  InspectorTest.log('Revoking in 2');
  await session2.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { p2.catch(()=>{}) }, 0);'});
  await InspectorTest.waitForPendingTasks();

  InspectorTest.log('Rejecting in 1');
  await session1.Protocol.Runtime.evaluate({expression: 'var p1; setTimeout(() => { p1 = Promise.reject("error6")} , 0)'});
  await InspectorTest.waitForPendingTasks();
  InspectorTest.log('Revoking in 1');
  await session1.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { p1.catch(()=>{}) }, 0);'});
  await InspectorTest.waitForPendingTasks();

  InspectorTest.completeTest();
})();


text:
package org.apache.kafka.streams.state;

import org.apache.kafka.common.serialization.ByteArrayDeserializer;
import org.apache.kafka.common.serialization.ByteArraySerializer;
import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.IntegerDeserializer;
import org.apache.kafka.common.serialization.IntegerSerializer;
import org.apache.kafka.common.serialization.LongDeserializer;
import org.apache.kafka.common.serialization.LongSerializer;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.kafka.streams.processor.ProcessorContext;

final class Serdes<K, V> {

    public static <K, V> Serdes<K, V> withBuiltinTypes(String topic, Class<K> keyClass, Class<V> valueClass) {
        Serializer<K> keySerializer = serializer(keyClass);
        Deserializer<K> keyDeserializer = deserializer(keyClass);
        Serializer<V> valueSerializer = serializer(valueClass);
        Deserializer<V> valueDeserializer = deserializer(valueClass);
        return new Serdes<>(topic, keySerializer, keyDeserializer, valueSerializer, valueDeserializer);
    }

    @SuppressWarnings("unchecked")
    static <T> Serializer<T> serializer(Class<T> type) {
        if (String.class.isAssignableFrom(type)) return (Serializer<T>) new StringSerializer();
        if (Integer.class.isAssignableFrom(type)) return (Serializer<T>) new IntegerSerializer();
        if (Long.class.isAssignableFrom(type)) return (Serializer<T>) new LongSerializer();
        if (byte[].class.isAssignableFrom(type)) return (Serializer<T>) new ByteArraySerializer();
        throw new IllegalArgumentException("Unknown class for built-in serializer");
    }

    @SuppressWarnings("unchecked")
    static <T> Deserializer<T> deserializer(Class<T> type) {
        if (String.class.isAssignableFrom(type)) return (Deserializer<T>) new StringDeserializer();
        if (Integer.class.isAssignableFrom(type)) return (Deserializer<T>) new IntegerDeserializer();
        if (Long.class.isAssignableFrom(type)) return (Deserializer<T>) new LongDeserializer();
        if (byte[].class.isAssignableFrom(type)) return (Deserializer<T>) new ByteArrayDeserializer();
        throw new IllegalArgumentException("Unknown class for built-in serializer");
    }

    private final String topic;
    private final Serializer<K> keySerializer;
    private final Serializer<V> valueSerializer;
    private final Deserializer<K> keyDeserializer;
    private final Deserializer<V> valueDeserializer;

    /**
     * Create a context for serialization using the specified serializers and deserializers.
     *
     * @param topic the name of the topic
     * @param keySerializer the serializer for keys; may not be null
     * @param keyDeserializer the deserializer for keys; may not be null
     * @param valueSerializer the serializer for values; may not be null
     * @param valueDeserializer the deserializer for values; may not be null
     */
    public Serdes(String topic,
            Serializer<K> keySerializer, Deserializer<K> keyDeserializer,
            Serializer<V> valueSerializer, Deserializer<V> valueDeserializer) {
        this.topic = topic;
        this.keySerializer = keySerializer;
        this.keyDeserializer = keyDeserializer;
        this.valueSerializer = valueSerializer;
        this.valueDeserializer = valueDeserializer;
    }

    /**
     * Create a context for serialization using the specified serializers and deserializers, or if any of them are null the
     * corresponding {@link ProcessorContext}'s default serializer or deserializer, which
     * must match the key and value types used as parameters for this object.
     *
     * @param topic the name of the topic
     * @param keySerializer the serializer for keys; may be null if the {@link ProcessorContext#keySerializer() default
     *            key serializer} should be used
     * @param keyDeserializer the deserializer for keys; may be null if the {@link ProcessorContext#keyDeserializer() default
     *            key deserializer} should be used
     * @param valueSerializer the serializer for values; may be null if the {@link ProcessorContext#valueSerializer() default
     *            value serializer} should be used
     * @param valueDeserializer the deserializer for values; may be null if the {@link ProcessorContext#valueDeserializer()
     *            default value deserializer} should be used
     * @param context the processing context
     */
    @SuppressWarnings("unchecked")
    public Serdes(String topic,
            Serializer<K> keySerializer, Deserializer<K> keyDeserializer,
            Serializer<V> valueSerializer, Deserializer<V> valueDeserializer,
            ProcessorContext context) {
        this.topic = topic;
        this.keySerializer = keySerializer != null ? keySerializer : (Serializer<K>) context.keySerializer();
        this.keyDeserializer = keyDeserializer != null ? keyDeserializer : (Deserializer<K>) context.keyDeserializer();
        this.valueSerializer = valueSerializer != null ? valueSerializer : (Serializer<V>) context.valueSerializer();
        this.valueDeserializer = valueDeserializer != null ? valueDeserializer : (Deserializer<V>) context.valueDeserializer();
    }

    /**
     * Create a context for serialization using the {@link ProcessorContext}'s default serializers and deserializers, which
     * must match the key and value types used as parameters for this object.
     *
     * @param topic the name of the topic
     * @param context the processing context
     */
    @SuppressWarnings("unchecked")
    public Serdes(String topic,
            ProcessorContext context) {
        this.topic = topic;
        this.keySerializer = (Serializer<K>) context.keySerializer();
        this.keyDeserializer = (Deserializer<K>) context.keyDeserializer();
        this.valueSerializer = (Serializer<V>) context.valueSerializer();
        this.valueDeserializer = (Deserializer<V>) context.valueDeserializer();
    }

    public Deserializer<K> keyDeserializer() {
        return keyDeserializer;
    }

    public Serializer<K> keySerializer() {
        return keySerializer;
    }

    public Deserializer<V> valueDeserializer() {
        return valueDeserializer;
    }

    public Serializer<V> valueSerializer() {
        return valueSerializer;
    }

    public String topic() {
        return topic;
    }

    public K keyFrom(byte[] rawKey) {
        return keyDeserializer.deserialize(topic, rawKey);
    }

    public V valueFrom(byte[] rawValue) {
        return valueDeserializer.deserialize(topic, rawValue);
    }

    public byte[] rawKey(K key) {
        return keySerializer.serialize(topic, key);
    }

    public byte[] rawValue(V value) {
        return valueSerializer.serialize(topic, value);
    }
}


text:
Copyright © 2015, [Alberto Garbui (aka JK)](mailto:alberto.garbui@gmail.com)

Find me on:
[![alt text][1.1]][1]
[![alt text][2.1]][2]
[![alt text][6.1]][6]
[![alt text][7.1]][7]

[1.1]: http://i.imgur.com/tXSoThF.png (twitter)
[2.1]: http://i.imgur.com/P3YfQoD.png (facebook)
[6.1]: http://i.imgur.com/0o48UoR.png (github)
[7.1]: http://i.imgur.com/VlgBKQ9.png (google plus)

[1]: https://twitter.com/albertoajk
[2]: https://www.facebook.com/ajk.alberto
[6]: https://github.com/the-AjK
[7]: https://plus.google.com/u/0/112632073896245208828

## Description

**GT511C3** is a node-js module to control the GT-511C3 fingerprint sensor (also know as **SEN-11792**) through serial port.

<img src="https://raw.githubusercontent.com/the-AjK/GT-511C3/master/GT511-C3.jpg">

Check out the fingerprint sensor datasheet [here](https://github.com/the-AjK/GT-511C3/blob/master/GT-511C3_datasheet_V1_1.pdf) or [download it](https://github.com/the-AjK/GT-511C3/raw/master/GT-511C3_datasheet_V1_1.pdf).

## Repository

[GitHub](https://github.com/the-AjK/GT-511C3)

[NPM](https://www.npmjs.com/package/gt511c3)

## Installation

    $ npm install gt511c3

## Basic usage

```js
var GT511C3 = require('gt511c3');

var fps = new GT511C3('/dev/ttyS1');

fps.init().then(
	function() {
		//init ok
		console.log('firmware version: ' + fps.firmwareVersion);
    	console.log('iso area max: ' + fps.isoAreaMaxSize);
    	console.log('device serial number: ' + fps.deviceSerialNumber);
	},
	function(err) {
		console.log('init err: ' + err);
	}
);
```

## API

### Class GT511C3

  * GT511C3(port [, options]) - constructor

##### GT511C3(port [, options])
Returns a new GT511C3 object that can be used to control the fingerprint sensor.
- port - The serialport name to use.
- options - An object with optional settings

The available optional settings are:
  * baudrate [9600, 19200, 38400, 57600, 115200] - number value of the serialport speed (default 9600 baud)
  * debug - boolean flag, setting it true will make the output more verbose

Example:
```js
var fps = new GT511C3('/dev/ttyS1', {
	baudrate: 115200
	debug: true
});
```

### Global variables and error codes
Device's informations (available after init() or open(EXTRA_INFO) command)
  * firmwareVersion - firmware version of the fingerprint module
  * isoAreaMaxSize - maximum size of ISO CD image
  * deviceSerialNumber - fingerprint module unique serial number

Global variables
  * NO_EXTRA_INFO - to use with open() method
  * EXTRA_INFO - to use with open() method to get full device's informations
  * LED_OFF - to use with ledONOFF() method
  * LED_ON - to use with ledONOFF() method
  * NOT_BEST_IMAGE - to use with captureFinger() method during enrollment procedure
  * BEST_IMAGE - to use with captureFinger() method during identification and verification procedure

Error codes
  * NACK_TIMEOUT
  * NACK_INVALID_BAUDRATE
  * NACK_INVALID_POS
  * NACK_IS_NOT_USED
  * NACK_IS_ALREADY_USED
  * NACK_COMM_ERR
  * NACK_VERIFY_FAILED
  * NACK_IDENTIFY_FAILED
  * NACK_DB_IS_FULL
  * NACK_DB_IS_EMPTY
  * NACK_TURN_ERR
  * NACK_BAD_FINGER
  * NACK_ENROLL_FAILED
  * NACK_IS_NOT_SUPPORTED
  * NACK_DEV_ERR
  * NACK_CAPTURE_CANCELED
  * NACK_INVALID_PARAM
  * NACK_FINGER_IS_NOT_PRESSED

### Methods

  * init()
  * open(extra_info)
  * close()
  * closePort()
  * usbInternalCheck()
  * ledONOFF(led_state)
  * changeBaudRate(baudrate)
  * getEnrollCount()
  * checkEnrolled(ID)
  * enrollStart(ID)
  * enroll1()
  * enroll2()
  * enroll3()
  * isPressFinger()
  * waitFinger(timeout)
  * waitReleaseFinger(timeout)
  * enroll(ID)
  * deleteID(ID)
  * deleteAll()
  * verify(ID)
  * identify()
  * verifyTemplate(ID, template)
  * identifyTemplate(template)
  * captureFinger(image_type)
  * makeTemplate()
  * getImage()
  * getRawImage()
  * getTemplate(ID)
  * setTemplate(ID, template)
  * decodeError(errorCode)

##### init()
Open the serialport and initialize the fingerprint module. Returns a promise.
After the init procedure global variables such as **firmwareVersion**, **isoAreaMaxSize** and **deviceSerialNumber** are available.

Example:
```js
fps.init().then(
  function() {
    //init ok
    console.log('firmware version: ' + fps.firmwareVersion);
    console.log('iso area max: ' + fps.isoAreaMaxSize);
    console.log('device serial number: ' + fps.deviceSerialNumber);
  },
  function(err) {
    console.log('init err: ' + err);
  }
);
```

##### open(extra_info)
Send the **OPEN** command to the fingerprint module. Returns a promise.
- extra_info - specify whether to request extra informations or not. Global variables such as **EXTRA_INFO** or **NO_EXTRA_INFO** may be used.

##### close()
Send the **CLOSE** command to the fingerprint module and close the serial port. Returns a promise.

##### closePort()
Close the serial port. Returns a promise.

##### usbInternalCheck()
Send the **USB_INTERNAL_CHECK** command to the fingerprint module. Returns a promise.

##### ledONOFF(led_state)
Send the **CMOS_LED** command to the fingerprint module. Returns a promise.
- led_state - specify whether to switch the onboard leds on or off. Global variables such as **LED_OFF** or **LED_ON** may be used.

Example:
```js
fps.ledONOFF(fps.LED_ON);
```

##### changeBaudRate(baudrate)
Send the **CHANGE_BAUDRATE** command to the fingerprint module to change the module baudrate, if the command is acknowledged, the serialport baudrate will be updated as well. Returns a promise.
- baudrate - [9600, 19200, 38400, 57600, 115200] - number value of the serialport speed

##### getEnrollCount()
Send the **GET_ENROLL_COUNT** command to the fingerprint module. Returns a promise with the number of enrolled fingerprints in case of success.

Example:
```js
fps.getEnrollCount().then(function(count) {
  console.log("Enrolled fingerprints count: " + count);
});
```

##### checkEnrolled(ID)
Send the **CHECK_ENROLLED** command to the fingerprint module to check if a specified ID is enrolled or not. Returns a promise.
- ID - specify the fingerprint's ID to check [0..199]

##### enrollStart(ID)
Send the **ENROLL_START** command to the fingerprint module to start the enrollment procedure for a specified ID. Returns a promise.
- ID - specify the fingerprint's ID to enroll [0..199]

(note: the onboard leds must be switched ON before sending this command)

##### enroll1()
Send the **ENROLL_1** command to the fingerprint module to execute the first step of the enrollment procedure. Returns a promise.

(note: the onboard leds must be switched ON before sending this command)

##### enroll2()
Send the **ENROLL_2** command to the fingerprint module to execute the second step of the enrollment procedure. Returns a promise.

(note: the onboard leds must be switched ON before sending this command)

##### enroll3()
Send the **ENROLL_3** command to the fingerprint module to execute the third step of the enrollment procedure. Returns a promise.

(note: the onboard leds must be switched ON before sending this command)

##### isPressFinger()
Send the **IS_PRESS_FINGER** command to the fingerprint module to check if a finger is correctly placed on the fingerprint sensor or not. Returns a promise.

(note: the onboard leds must be switched ON before sending this command)

Example:
```js
fps.isPressFinger().then(function() {
  console.log('isPressFinger: pressed!');
}, function(err) {
  console.log('isPressFinger err: ' + fps.decodeError(err));
});
```

##### waitFinger(timeout)
Wait until a finger is correctly placed on the fingerprint sensor. Returns a promise.
- timeout - specify how many ms (milliseconds) to wait before firing a timeout event and reject the promise.

(note: the onboard leds must be switched ON before sending this command)

##### waitReleaseFinger(timeout)
Wait until a finger is removed from the fingerprint sensor. Returns a promise.
- timeout - specify how many ms (milliseconds) to wait before firing a timeout event and reject the promise.

(note: the onboard leds must be switched ON before sending this command)

##### enroll(ID)
Execute a full enrollment procedure for the specified ID. Returns a promise.
- ID - specify the fingerprint's ID to enroll [0..199]

(note: the onboard leds must be switched ON before sending this command)

##### deleteID(ID)
Send the **DELETE_ID** command to the fingerprint module to delete a specified ID. Returns a promise.
- ID - specify the fingerprint's ID to delete [0..199]

##### deleteAll()
Send the **DELETE_ALL** command to the fingerprint module to delete all the 200 IDs. Returns a promise.

##### verify(ID)
Send the **VERIFY** command to the fingerprint module to verify if the finger placed on the fingerprint sensor match the specified ID. Returns a promise.
- ID - specify the fingerprint's ID to verify [0..199]

(note: the onboard leds must be switched ON before sending this command)

Example:
```js
var id = 5;
fps.verify(id).then(function() {
  console.log('verify: ' + id + ' verified!');
}, function(err) {
  console.log('verify err: ' + fps.decodeError(err));
});
```

##### identify()
Send the **IDENTIFY** command to the fingerprint module to identify the finger placed on the fingerprint sensor. Returns a promise, in case of success returns the identified ID.

(note: the onboard leds must be switched ON and a captureFinger() method must be called before sending this command)

Example:
```js
fps.identify().then(function(ID) {
  console.log("identify: ID = " + ID);
}, function(err) {
  console.log("identify err: " + fps.decodeError(err));
});
```

##### verifyTemplate(ID, template)
Send the **VERIFY_TEMPLATE** command to the fingerprint module to verify the supplied template match the specified ID. Returns a promise.
- ID - specify the fingerprint's ID to check [0..199]
- template - 498bytes template to verify (Buffer)

##### identifyTemplate(template)
Send the **IDENTIFY_TEMPLATE** command to the fingerprint module to identify the supplied template. Returns a promise, in case of success returns the matched ID.
- template - 498bytes template to identify (Buffer)

##### captureFinger(image_type)
Send the **CAPTURE_FINGER** command to the fingerprint module. Returns a promise.
- image_type - specify whether to capture the fingerprint at high resolution or not. Global variables such as **BEST_IMAGE** or **NOT_BEST_IMAGE** may be used.

##### makeTemplate()
Send the **MAKE_TEMPLATE** command to the fingerprint module to retrieve the template of the finger placed on the fingerprint sensor. Returns a promise, in case of success returns a 498bytes template Buffer.

##### getImage()
Send the **GET_IMAGE** command to the fingerprint module to retrieve the image of the finger placed on the fingerprint sensor. Returns a promise, in case of success returns a 52116bytes image Buffer.

(note: the onboard leds must be switched ON before sending this command)

##### getRawImage()
Send the **GET_RAW_IMAGE** command to the fingerprint module to retrieve the raw image of the finger placed on the fingerprint sensor. Returns a promise, in case of success returns a 19200bytes image Buffer.

(note: the onboard leds must be switched ON before sending this command)

##### getTemplate(ID)
Send the **GET_TEMPLATE** command to the fingerprint module to retrieve the template that match the specified ID. Returns a promise, in case of success returns a 498bytes template Buffer.
- ID - specify the fingerprint's ID [0..199]

##### setTemplate(ID, template)
Send the **SET_TEMPLATE** command to the fingerprint module to set the template for a specified fingerprint ID. Returns a promise.
- ID - specify the fingerprint's ID [0..199]
- template - 498bytes template (Buffer)

##### decodeError(errorCode)
Returns the string representation of the provided error code.

Example:
```js
console.log(fps.decodeError(fps.NACK_DB_IS_FULL)); //print 'the database is full'
```

## License
GT511C3 - Fingerprint Scanner module
(BSD-3 license)

Copyright © 2015 Alberto Garbui <alberto.garbui@gmail.com>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

-Redistributions of source code must retain the above copyright notice, this list
 of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list
 of conditions and the following disclaimer in the documentation and/or other
 materials provided with the distribution.
-Neither the name of GT511C3 - Fingerprint Scanner module nor the names of its contributors may be
 used to endorse or promote products derived from this software without specific prior
 written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
<?php
  //iniciamos sesión
  session_start();
  //si existe la variable de sesión error la guardamos
  if(isset($_SESSION ['error'])){
    $error=$_SESSION['error'];
  }
  //destruimos la sesión para no poder llegar de manera indirecta a ninguna página posterior a la de login
  session_destroy();
?>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>MyContacts</title>

    <link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

    <link href="css/agency.css" rel="stylesheet">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button>

                        Registrate

Login

                    <?php
                      if(isset($error)){
                        echo "$error";

                      } else{
                        echo "Introduce usuario y contraseña";
                      }
                    ?>

    <form name="Login" action="login.proc.php" onsubmit="return validar();">

            Usuario:<input type="text" class="form-control" id="nombre" name="nombre" placeholder="usuario" onfocus="document.Login.nombre.style.color='';">

            Contraseña:<input type="password" class="form-control" name="password" placeholder="contraseña" onfocus="document.Login.password.style.color='';"/>

              <button class="page-scroll btn btn-xl">Entrar</button>

              ¿No tienes cuenta? Registrate.

    </form>

                    Copyright © Eric y Marc Petit 2017

Contacto

Terms of Use


text:
cGamemode_Derby = inherit(cGamemode);

--[[

]]
-- ///////////////////////////////
-- ///// New 				//////
-- ///// Returns: Object	//////
-- ///////////////////////////////

function cGamemode_Derby:new(...)
    local obj = setmetatable({}, {__index = self});
    if obj.constructor then
        obj:constructor(...);
    end
    return obj;
end

-- ///////////////////////////////
-- ///// onStart     		//////
-- ///// Returns: void		//////
-- ///////////////////////////////

function cGamemode_Derby:onStart()
    -- Reset all Timers
    --[[
    for index, timer in pairs(self.m_tblPlayerContactTimer) do
        if(isTimer(timer)) then
            killTimer(timer)
        end
    end

    local players       = self:getPlayingPlayers()

    for index, player in pairs(players) do
        self.m_tblPlayerContactTimer[player]    = setTimer(self.m_funcOnContactTimerAblauf, self.m_iContactTimerTime, 1, player)
    end--]]
    -- BUGGY DONT WORK

end

-- ///////////////////////////////
-- onPlayerContacttimerAblauf
-- ///// Returns: void		//////
-- ///////////////////////////////

function cGamemode_Derby:onPlayerContacttimerAblauf(uPlayer)
    if(uPlayer) and (isElement(uPlayer)) and (self:isPlayerInGamemode(uPlayer)) then

    end
end

-- ///////////////////////////////
-- ///// Constructor 		//////
-- ///// Returns: void		//////
-- ///////////////////////////////

function cGamemode_Derby:constructor(uMap, ...)
    -- Klassenvariablen --
    -- Kontakttimer --
    self.m_tblPlayerContactTimer        = {}
    self.m_iContactTimerTime            = 60000;        -- Contacttimer Seconds

    -- Funktionen --
    self.m_funcOnContactTimerAblauf     = function(...) self:onPlayerContacttimerAblauf(...) end

    -- Events --
    cGamemode.constructor(self, 1, uMap, ...)

end

-- EVENT HANDLER --


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

namespace FoodRoast
{
    public enum PotatoCookedState { Uncooked, Cooked, Burnt }

    [RequireComponent(typeof(SpriteRenderer), typeof(Collider2D))]
    public class FoodRoast_Potato : MonoBehaviour
    {

        [SerializeField]
        private Vector2 launchVelXRange;
        [SerializeField]
        private Vector2 launchVelYRange;
        [SerializeField]
        private float launchGravity;
        [SerializeField]
        private SpriteRenderer xSpriteRenderer;
        [SerializeField]
        private AudioClip readySound;
        [SerializeField]
        private AudioClip pickSound;
        [SerializeField]
        private AudioClip failSound;
        [SerializeField]
        private Animator rigAnimator;

        bool picked = false;

        private SpriteRenderer _SpriteRenderer;
        public SpriteRenderer SpriteRenderer
        {
            get
            {
                if (_SpriteRenderer == null)
                    _SpriteRenderer = GetComponent<SpriteRenderer>();
                return _SpriteRenderer;
            }
        }

        private void Update()
        {
            if (MicrogameController.instance.getVictoryDetermined() && !MicrogameController.instance.getVictory())
            {
                rigAnimator.SetInteger("State", 2);
                enabled = false;
            }
        }

        private ParticleSystem[] _Particles;
        public ParticleSystem[] Particles
        {
            get
            {
                if (_Particles == null)
                    _Particles = GetComponentsInChildren<ParticleSystem>();
                return _Particles;
            }
        }

        [System.Serializable]
        private struct PotatoSpritePack
        {
            public Sprite[] Pack;
        }

        [Header("Potato Sprites (0 - Uncooked, 1 - Cooked, 2 - Burnt)")]
        [SerializeField]
        private PotatoSpritePack[] PotatoSprites;
        private Sprite GetSprite => PotatoSprites[(int)PotatoCookedState].Pack[PotatoAnimationState];
        private int GetPackLength => PotatoSprites[0].Pack.Length;

        [Header("Animation States")]
        [SerializeField]
        private float StateDuration = 0.33f;
        [SerializeField] private int PotatoAnimationState = 0;
        [ReadOnly] [SerializeField] private PotatoCookedState PotatoCookedState = 0;

        private void Start()
        {
            var rb2d = GetComponent<Collider2D>();
            for (int i = 0; i < transform.parent.childCount; i++)
            {
                var otherCol2d = transform.parent.GetChild(i).GetComponent<Collider2D>();
                if (otherCol2d != rb2d)
                    Physics2D.IgnoreCollision(rb2d, otherCol2d);
            }

            PotatoCookedState = PotatoCookedState.Uncooked;
            StartCoroutine(AnimationCoroutine());
            StartCoroutine(CookingCoroutine());
        }

        private IEnumerator AnimationCoroutine()
        {
            float time = 0;
            while (!MicrogameController.instance.getVictoryDetermined() && !picked)
            {
                SpriteRenderer.sprite = GetSprite;
                while (time < StateDuration)
                {
                    yield return null;
                    time += Time.deltaTime;
                }
                time -= StateDuration;
                PotatoAnimationState = (PotatoAnimationState + 1) % GetPackLength;
            }
        }

        // Timer till cooked potatoes
        private IEnumerator CookingCoroutine()
        {
            yield return new WaitForSeconds(FoodRoast_Controller.Instance.GetCookTime());
            if (!MicrogameController.instance.getVictoryDetermined() && !picked)
                CookedProcedure();
            yield return new WaitForSeconds(FoodRoast_Controller.Instance.GetPotatoBurnTime);
            if (!MicrogameController.instance.getVictoryDetermined() && !picked)
                BurntProcedure();
        }

        // Procedure that turns uncooked to cooked potatoes
        private void CookedProcedure()
        {
            PotatoCookedState = PotatoCookedState.Cooked;
            SpriteRenderer.sprite = GetSprite;

            ChangeParticlesStartColorAlpha(.05f);
            foreach (var particle in Particles)
                particle.Play();

            rigAnimator.SetInteger("State", 1);
            MicrogameController.instance.playSFX(readySound, AudioHelper.getAudioPan(transform.position.x));
        }

        // Procedure that turns uncooked to cooked potatoes
        private void BurntProcedure()
        {
            PotatoCookedState = PotatoCookedState.Burnt;
            SpriteRenderer.sprite = GetSprite;

            ChangeParticlesStartColorAlpha(.4f);
            foreach (var particle in Particles)
                particle.Play();

            rigAnimator.SetInteger("State", 2);
            FoodRoast_VictoryController.Instance.setVictory(false);
            MicrogameController.instance.playSFX(failSound, AudioHelper.getAudioPan(transform.position.x));

        }

        private void ChangeParticlesStartColorAlpha(float alpha)
        {
            foreach (var particle in Particles)
            {
                var main = particle.main;
                var colorStruct = main.startColor;
                var color = colorStruct.color;

                color.a = alpha;
                colorStruct.color = color;
                main.startColor = colorStruct;
            }
        }

        // Procedure when the potato is clicked
        private void OnMouseDown()
        {
            if (MicrogameController.instance.getVictoryDetermined() || picked)
                return;
            if (PotatoCookedState == PotatoCookedState.Cooked)
            {
                Pick(true);
            }
            else if (PotatoCookedState == PotatoCookedState.Uncooked)
            {
                Pick(false);
            }
            foreach (var particle in Particles)
            {
                particle.Stop();
                particle.transform.SetParent(null);
            }

        }

        void Pick(bool isReady)
        {
            picked = true;
            rigAnimator.SetInteger("State", 3);
            if (isReady)
            {
                FoodRoast_Controller.Instance.AddCookedPotato();
                var rb2d = GetComponent<Rigidbody2D>();
                var flingVel = new Vector2(MathHelper.randomRangeFromVector(launchVelXRange), MathHelper.randomRangeFromVector(launchVelYRange));
                rb2d.bodyType = RigidbodyType2D.Dynamic;
                rb2d.velocity = flingVel;
                rb2d.gravityScale = launchGravity;
                MicrogameController.instance.playSFX(pickSound, AudioHelper.getAudioPan(transform.position.x));
            }
            else
            {
                FoodRoast_Controller.Instance.AddUncookedPotato();
                MicrogameController.instance.playSFX(failSound, AudioHelper.getAudioPan(transform.position.x));
                xSpriteRenderer.enabled = true;
            }

        }

        private void OnCollisionEnter2D(Collision2D collision)
        {
            if (collision.collider.name.ToLower().Contains("floor"))
                GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Static;
        }
    }
}


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

<title>Uses of Interface org.myrobotlab.java.ClassInfo</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.myrobotlab.java.ClassInfo

Packages that use ClassInfo

Package
Description

org.myrobotlab.java

Uses of ClassInfo in org.myrobotlab.java

Classes in org.myrobotlab.java that implement ClassInfo

Modifier and Type
Class and Description

class
JavaClassInfo

The instances of this class provides informations about
 class compiled to JVM bytecode.

Methods in org.myrobotlab.java that return ClassInfo

Modifier and Type
Method and Description

ClassInfo
ClassFinder.addClassInfo(java.lang.String cname,
            koala.dynamicjava.tree.TypeDeclaration decl)

Adds a type declaration in the class info list

ClassInfo
JavaClassInfo.getAnonymousDeclaringClass()

Returns the declaring class of an anonymous class or null

ClassInfo
ClassInfo.getAnonymousDeclaringClass()

Returns the declaring class of an anonymous class or null

ClassInfo
JavaClassInfo.getArrayType()

Returns the array type that contains elements of this class

ClassInfo
ClassInfo.getArrayType()

Returns the array type that contains elements of this class

ClassInfo
JavaClassInfo.getComponentType()

Returns the component type of this array type

ClassInfo
ClassInfo.getComponentType()

Returns the component type of this array type

ClassInfo[]
JavaClassInfo.getDeclaredClasses()

Returns the classes and interfaces declared as members
 of the class represented by this ClassInfo object.

ClassInfo[]
ClassInfo.getDeclaredClasses()

Returns the classes and interfaces declared as members
 of the class represented by this ClassInfo object.

ClassInfo
JavaClassInfo.getDeclaringClass()

Returns the declaring class or null

ClassInfo
ClassInfo.getDeclaringClass()

Returns the declaring class or null

ClassInfo[]
MethodInfo.getExceptionTypes()

Returns an array of class infos that represent the types of
 the exceptions declared to be thrown by the underlying method

ClassInfo[]
JavaMethodInfo.getExceptionTypes()

Returns an array of Class infos that represent the types of
 the exceptions declared to be thrown by the underlying method

ClassInfo[]
JavaConstructorInfo.getExceptionTypes()

Returns an array of Class infos that represent the types of
 the exceptions declared to be thrown by the underlying constructor

ClassInfo[]
ConstructorInfo.getExceptionTypes()

Returns an array of class infos that represent the types of
 the exceptions declared to be thrown by the underlying constructor

ClassInfo[]
JavaClassInfo.getInterfaces()

Returns the class infos of the interfaces implemented by
 the class this info represents

ClassInfo[]
ClassInfo.getInterfaces()

Returns the class infos of the interfaces implemented by
 the class this info represents

ClassInfo[]
MethodInfo.getParameterTypes()

Returns an array of class infos that represent the parameter
 types, in declaration order, of the method represented
 by this object

ClassInfo[]
JavaMethodInfo.getParameterTypes()

Returns an array of class infos that represent the parameter
 types, in declaration order, of the method represented
 by this object

ClassInfo[]
JavaConstructorInfo.getParameterTypes()

Returns an array of class infos that represent the parameter
 types, in declaration order, of the constructor represented
 by this object

ClassInfo[]
ConstructorInfo.getParameterTypes()

Returns an array of class infos that represent the parameter
 types, in declaration order, of the constructor represented
 by this object

ClassInfo
MethodInfo.getReturnType()

Returns a Class object that represents the return type
 of the method represented by this object

ClassInfo
JavaMethodInfo.getReturnType()

Returns a Class object that represents the return type
 of the method represented by this object

ClassInfo
JavaClassInfo.getSuperclass()

Returns the class info of the superclass of the class
 represented by this info

ClassInfo
ClassInfo.getSuperclass()

Returns the class info of the superclass of the class
 represented by this info

ClassInfo
JavaFieldInfo.getType()

Returns the type of the underlying field

ClassInfo
FieldInfo.getType()

Returns the type of the underlying field

ClassInfo
ClassFinder.lookupClass(java.lang.String cname)

Loads the class info that match the given name in the source file

ClassInfo
ClassFinder.lookupClass(java.lang.String cname,
           ClassInfo cinfo)

Loads the class info that match the given name in the source file

Methods in org.myrobotlab.java with parameters of type ClassInfo

Modifier and Type
Method and Description

static FieldInfo
ClassInfoUtilities.getField(ClassInfo cl,
        java.lang.String name)

Returns a field with the given name declared in the given
 class or in the superclasses of the given class

static java.util.List
ClassInfoUtilities.getMethods(ClassInfo cl,
          java.lang.String name,
          int params)

Gets all the methods with the given name in the given class or super classes.

static FieldInfo
ClassInfoUtilities.getOuterField(ClassInfo cl,
             java.lang.String name)

Returns a field with the given name declared in one of the outer
 classes of the given class

static boolean
ClassInfoUtilities.isAssignableFrom(ClassInfo c1,
                ClassInfo c2)

Tests whether c1 is assignable from c2.

ClassInfo
ClassFinder.lookupClass(java.lang.String cname,
           ClassInfo cinfo)

Loads the class info that match the given name in the source file

static ConstructorInfo
ClassInfoUtilities.lookupConstructor(ClassInfo cl,
                 ClassInfo[] ac)

Looks for a constructor in the given class or in super classes of this class.

static ConstructorInfo
ClassInfoUtilities.lookupConstructor(ClassInfo cl,
                 ClassInfo[] ac)

Looks for a constructor in the given class or in super classes of this class.

static MethodInfo
ClassInfoUtilities.lookupMethod(ClassInfo cl,
            java.lang.String name,
            ClassInfo[] ac)

Looks for a method in the given class or in super classes of this class.

static MethodInfo
ClassInfoUtilities.lookupMethod(ClassInfo cl,
            java.lang.String name,
            ClassInfo[] ac)

Looks for a method in the given class or in super classes of this class.

static MethodInfo
ClassInfoUtilities.lookupOuterMethod(ClassInfo cl,
                 java.lang.String name,
                 ClassInfo[] ac)

Looks up for a method in an outer classes of this class.

static MethodInfo
ClassInfoUtilities.lookupOuterMethod(ClassInfo cl,
                 java.lang.String name,
                 ClassInfo[] ac)

Looks up for a method in an outer classes of this class.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Create Audit" %}{% endblock %}

{% block main %}
    {% include 'infra_optim/audits/_create.html' %}
{% endblock %}


text:
package me.rerun.karafcxfcamel.camel.beans;

import me.rerun.karafcxfcamel.model.AgePhoneResult;
import me.rerun.karafcxfcamel.model.ConsolidatedSearchResult;
import me.rerun.karafcxfcamel.model.NameEmailResult;
import org.apache.camel.Exchange;
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ResultAggregator implements AggregationStrategy {

    private static Logger logger= LoggerFactory.getLogger(ResultAggregator.class);

    @Override
    public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {

        ConsolidatedSearchResult consolidatedSearchResult=null;
        if (oldExchange==null){
            consolidatedSearchResult=new ConsolidatedSearchResult();
        }
        else{
            consolidatedSearchResult=oldExchange.getIn().getBody(ConsolidatedSearchResult.class);
        }

        NameEmailResult nameEmailResult=newExchange.getIn().getBody(NameEmailResult.class);
        AgePhoneResult agePhoneResult=newExchange.getIn().getBody(AgePhoneResult.class);

        if (nameEmailResult!=null){
            consolidatedSearchResult.setNameEmailResult(nameEmailResult);
        }

        if (agePhoneResult!=null){
            consolidatedSearchResult.setAgePhoneResult(agePhoneResult);
        }

        newExchange.getIn().setBody(consolidatedSearchResult);

        return newExchange;
    }
}


text:
import { ChangeDetectionStrategy, Component, OnInit, ChangeDetectorRef } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {Http, RequestOptions, Headers, Response} from '@angular/http';
import {AuthenticationService, User} from '../authentication.service';
import {ContactService} from './contact.service';
declare var classie: any;
declare var SelectFxJs: any;
declare var inputlabel: any;

@Component({
  moduleId: module.id,
  selector: 'app-contact',
  templateUrl: 'contact.component.html',
  styleUrls: ['contact.component.css']

})
export class ContactComponent  implements OnInit {

	public objet : String = "";
	public message : string;
	private user: User = JSON.parse(localStorage.getItem("user"));
	public successMsg: String;
	public showSubmit: boolean = true;
	public showLoading: boolean = false;
	public showMessage: boolean = false;

	constructor(private ref: ChangeDetectorRef, private contactService: ContactService,
	    private http: Http, private auth: AuthenticationService){
	}

	ngOnInit() {
	  	inputlabel.inputlabelcheck();
	}

	sendMail(){
		this.showSubmit = false;
	    this.showLoading = true;
	    if(this.showLoading) {
			let objet = "Nouveau message envoyé par " + this.user.entreprise.raisonsociale + " depuis l'extranet partenaire";
			let message = this.user.prenom +" " + this.user.nom + " de " + this.user.entreprise.raisonsociale + "a utilisé le formulaire de contact\n";
			message += "\nObjet: " + this.objet;
			message += "\n\nMessage: \n" + this.message;
			this.contactService.sendMail(objet, message).subscribe(
				message => {
					this.showLoading = false;
                    this.successMsg = "Votre message a été bien été transmis à notre équipe";
                    this.showMessage = true;

					this.ref.reattach();
				},
				error => {
					this.showLoading = false;
					this.successMsg = "Une erreur est survenue lors de l'envoi de votre message";
					this.showMessage = true;
					this.showSubmit = true;
					this.ref.reattach();
				},
			);
		}
	}

}