text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AppBundle\AppBundle(),
            new HotelBundle\HotelBundle(),
            new HotelBundle\ReservaBundle\HotelBundleReservaBundle(),
            new HotelBundle\AdminBundle\HotelBundleAdminBundle(),
            new HotelBundle\TascaBundle\HotelBundleTascaBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new HotelBundle\UsuariBundle\HotelBundleUsuariBundle(),
        ];

        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function getRootDir()
    {
        return __DIR__;
    }

    public function getCacheDir()
    {
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
    }

    public function getLogDir()
    {
        return dirname(__DIR__).'/var/logs';
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}


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

<title>WireSurfaceStretch</title>
<meta name="date" content="2017-01-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.drip.spline.multidimensional

Class WireSurfaceStretch

java.lang.Object

org.drip.spline.multidimensional.WireSurfaceStretch

public class WireSurfaceStretch
extends java.lang.Object

WireSurfaceStretch implements a 2D spline surface stretch. It synthesizes this from an array of 1D Span
        instances, each of which is referred to as wire spline in this case.

Author:

Lakshmi Krishnamurthy

Constructor Summary

Constructors

Constructor and Description

WireSurfaceStretch(java.lang.String strName,
                  SegmentCustomBuilderControl scbc,
                  java.util.TreeMap<java.lang.Double,Span> mapWireSpan)

WireSurfaceStretch Constructor

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

double
responseValue(double dblX,
             double dblY)

Compute the Bivariate Surface Response Value

Span
wireSpanXAnchor(double dblXAnchor)

Retrieve the Surface Span Stretch that corresponds to the given X Anchor

Span
wireSpanYAnchor(double dblYAnchor)

Retrieve the Surface Span Stretch that corresponds to the given Y Anchor

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

WireSurfaceStretch

public WireSurfaceStretch(java.lang.String strName,
                          SegmentCustomBuilderControl scbc,
                          java.util.TreeMap<java.lang.Double,Span> mapWireSpan)
                   throws java.lang.Exception

WireSurfaceStretch Constructor

Parameters:

strName - Name

scbc - Segment Custom Builder Control Parameters

mapWireSpan - X-mapped Array of Y Basis Spline Wire Spans

Throws:

java.lang.Exception - Thrown if the Inputs are invalid

Method Detail

responseValue

public double responseValue(double dblX,
                            double dblY)
                     throws java.lang.Exception

Compute the Bivariate Surface Response Value

Parameters:

dblX - X

dblY - Y

Returns:

The Bivariate Surface Response Value

Throws:

java.lang.Exception - Thrown if Inputs are Invalid

wireSpanYAnchor

public Span wireSpanYAnchor(double dblYAnchor)

Retrieve the Surface Span Stretch that corresponds to the given Y Anchor

Parameters:

dblYAnchor - Y Anchor

Returns:

The Surface Span Stretch Instance

wireSpanXAnchor

public Span wireSpanXAnchor(double dblXAnchor)

Retrieve the Surface Span Stretch that corresponds to the given X Anchor

Parameters:

dblXAnchor - X Anchor

Returns:

The Surface Span Stretch Instance

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

redpajama_set_name: RedPajamaGithub


text:
package org.usip.osp.specialfeatures;

import java.util.*;

import javax.persistence.*;

import org.hibernate.annotations.Proxy;
import org.usip.osp.baseobjects.CustomizeableSection;
import org.usip.osp.persistence.MultiSchemaHibernateUtil;
import org.apache.log4j.*;

/**
 * This class represents one specific choice in a set of answers that a player may select. For example,
 * the question might be "Do you want steak, or fish?" There would be one allowable response for steak and
 * another for fish.
 */
/*
 * This file is part of the USIP Open Simulation Platform.

 *
 * The USIP Open Simulation Platform is free software; you can redistribute it and/or
 * modify it under the terms of the new BSD Style license associated with this
 * distribution.

 *
 * The USIP Open Simulation Platform is distributed WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.

 *
 */
@Entity
@Table(name = "ALLOWABLERESPONSES")
@Proxy(lazy = false)
public class AllowableResponse implements Comparable{

	/** Database id of this Simulation. */
	@Id
	@GeneratedValue
	private Long id;

	private Long cust_id;

	private int ar_index = 0;

	private boolean initiallySelected = false;

	private boolean writeChangesToAAR = false;

	/** Words that introduce this choice. */
	@Lob
    private String responseText = ""; //$NON-NLS-1$

	/** If this response has a value associated with it, it is store here. */
	private String specificValue = ""; //$NON-NLS-1$

	@Lob
    private String specificWordsForAAR = ""; //$NON-NLS-1$

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getResponseText() {
		return this.responseText;
	}

	public void setResponseText(String responseText) {
		this.responseText = responseText;
	}

	public String getSpecificValue() {
		return this.specificValue;
	}

	public void setSpecificValue(String specificValue) {
		this.specificValue = specificValue;
	}

	public String getSpecificWordsForAAR() {
		return this.specificWordsForAAR;
	}

	public void setSpecificWordsForAAR(String specificWordsForAAR) {
		this.specificWordsForAAR = specificWordsForAAR;
	}

	public Long getCust_id() {
		return this.cust_id;
	}

	public void setCust_id(Long cust_id) {
		this.cust_id = cust_id;
	}

	public int getIndex() {
		return this.ar_index;
	}

	public void setIndex(int ar_index) {
		this.ar_index = ar_index;
	}

	public int getAr_index() {
		return this.ar_index;
	}

	public void setAr_index(int ar_index) {
		this.ar_index = ar_index;
	}

	public boolean isInitiallySelected() {
		return this.initiallySelected;
	}

	public void setInitiallySelected(boolean initiallySelected) {
		this.initiallySelected = initiallySelected;
	}

	public boolean isWriteChangesToAAR() {
		return this.writeChangesToAAR;
	}

	public void setWriteChangesToAAR(boolean writeChangesToAAR) {
		this.writeChangesToAAR = writeChangesToAAR;
	}

	/**
	 * Information about this set of allowable responses is pulled out of the database for viewing.
	 *
	 * @param cust
	 * @return
	 */
	public static List pullOutArs(CustomizeableSection cust, String schema){

		List returnList = getARsForACustomSection(cust.getId(), schema);

		if ((returnList == null) || (returnList.size() == 0)){
			// If no ids found, just return list of 2 new default style ARs
			returnList = getStarterAllowableResponses(cust, schema);
		}

		return returnList;

	}

	/** Pulls the allowable responses for a custom section out of the database, ordered by ar_index.
	 *
	 * @param cust_id
	 * @param schema
	 * @return
	 */
	public static List getARsForACustomSection(Long cust_id, String schema){

		MultiSchemaHibernateUtil.beginTransaction(schema);

		List returnList = MultiSchemaHibernateUtil.getSession(schema)
				.createQuery("from AllowableResponse where cust_id = '" + cust_id + "' order by ar_index") //$NON-NLS-1$ //$NON-NLS-2$
				.list();

		MultiSchemaHibernateUtil.commitAndCloseTransaction(schema);

		return returnList;

	}

	/** Returns default set of 2 blank responses.
	 *
	 * @param cust
	 * @param schema
	 * @return
	 */
	public static List getStarterAllowableResponses(CustomizeableSection cust, String schema){
		AllowableResponse ar1 = new AllowableResponse();
		ar1.setIndex(1);
		ar1.setResponseText("Choice 1"); //$NON-NLS-1$
		ar1.saveMe(schema);

		AllowableResponse ar2 = new AllowableResponse();
		ar2.setIndex(2);
		ar2.setResponseText("Choice 2"); //$NON-NLS-1$
		ar2.saveMe(schema);

		List returnList = new ArrayList<AllowableResponse>();
		returnList.add(ar1);
		returnList.add(ar2);

		return returnList;
	}

	/** */
	public static AllowableResponse getAdditionalAR(CustomizeableSection cust, String schema){
		GenericVariable gv = GenericVariable.pullOutBaseGV(schema, cust);

		AllowableResponse ar = new AllowableResponse();

		ar.setCust_id(cust.getId());

		List currentList = getARsForACustomSection(cust.getId(),schema);

		ar.setIndex(currentList.size() + 1);

		ar.saveMe(schema);
		return ar;

	}

	/**
	 * Saves this Allowable Response to the database.
	 * @param schema
	 */
	public void saveMe(String schema) {

		MultiSchemaHibernateUtil.beginTransaction(schema);
		MultiSchemaHibernateUtil.getSession(schema).saveOrUpdate(this);
		MultiSchemaHibernateUtil.commitAndCloseTransaction(schema);

	}

	/**
	 *
	 * @param schema
	 * @param sim_id
	 * @return
	 */
	public static AllowableResponse getById(String schema, Long ar_id) {

		MultiSchemaHibernateUtil.beginTransaction(schema);
		AllowableResponse this_ar = (AllowableResponse) MultiSchemaHibernateUtil
				.getSession(schema).get(AllowableResponse.class, ar_id);

		MultiSchemaHibernateUtil.commitAndCloseTransaction(schema);

		return this_ar;

	}

	public static String convertListOfARsToInfoString(List theARs){
		return ""; //$NON-NLS-1$
	}

	/**
	 * Takes a list of allowable responses that has been modified (one of the entries removed
	 * for example) and verifies that the index of each response is in order 1, 2, 3, ...
	 *
	 * @param theARs
	 */
	public static void reOrderAllowableResponses(List theARs){

		// TODO
	}

	@Override
	public int compareTo(Object arg0) {

		try {
			AllowableResponse ar = (AllowableResponse) arg0;
			return this.ar_index - ar.ar_index;

		} catch (Exception e){
			Logger.getRootLogger().debug("Non Allowable Response Object passed into CompareTo"); //$NON-NLS-1$
		}

		return 0;

	}

}


text:
using System;
using System.Windows.Forms;

namespace MultiGeoCoder
{
    partial class MainForm
    {
        /// <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.components = new System.ComponentModel.Container();
            this.ExitButton = new System.Windows.Forms.Button();
            this.dataGrid = new System.Windows.Forms.DataGridView();
            this.AddressName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.DataGridContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.CopyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.CutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.PasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.DeleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.MultiAdressLabel = new System.Windows.Forms.Label();
            this.SaveAsTextBox = new System.Windows.Forms.TextBox();
            this.SaveAsPathButton = new System.Windows.Forms.Button();
            this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
            this.SaveAsLabel = new System.Windows.Forms.Label();
            this.RunButton = new System.Windows.Forms.Button();
            this.AddressFieldsLabel = new System.Windows.Forms.Label();
            this.AddressMembersDataGridView = new System.Windows.Forms.DataGridView();
            this.MainSplitContainer = new System.Windows.Forms.SplitContainer();
            this.ChildSplitContainer = new System.Windows.Forms.SplitContainer();
            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
            this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
            this.LocalLabel = new System.Windows.Forms.Label();
            this.LocalComboBox = new System.Windows.Forms.ComboBox();
            this.WorkProgressBar = new System.Windows.Forms.ProgressBar();
            this.AboutButton = new System.Windows.Forms.Button();
            this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
            this.backgroundWorker = new System.ComponentModel.BackgroundWorker();
            this.StopButton = new System.Windows.Forms.Button();
            this.AddressMemberCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
            this.AddressMember = new System.Windows.Forms.DataGridViewTextBoxColumn();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
            this.DataGridContextMenu.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.AddressMembersDataGridView)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit();
            this.MainSplitContainer.Panel1.SuspendLayout();
            this.MainSplitContainer.Panel2.SuspendLayout();
            this.MainSplitContainer.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.ChildSplitContainer)).BeginInit();
            this.ChildSplitContainer.Panel1.SuspendLayout();
            this.ChildSplitContainer.Panel2.SuspendLayout();
            this.ChildSplitContainer.SuspendLayout();
            this.tableLayoutPanel2.SuspendLayout();
            this.tableLayoutPanel3.SuspendLayout();
            this.tableLayoutPanel4.SuspendLayout();
            this.SuspendLayout();
            //
            // ExitButton
            //
            this.ExitButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.ExitButton.Location = new System.Drawing.Point(390, 45);
            this.ExitButton.Name = "ExitButton";
            this.ExitButton.Size = new System.Drawing.Size(40, 20);
            this.ExitButton.TabIndex = 2;
            this.ExitButton.Text = "Exit";
            this.ExitButton.UseVisualStyleBackColor = true;
            this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click);
            //
            // dataGrid
            //
            this.dataGrid.AllowUserToResizeRows = false;
            this.dataGrid.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
            this.dataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.AddressName});
            this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGrid.Location = new System.Drawing.Point(3, 16);
            this.dataGrid.Name = "dataGrid";
            this.dataGrid.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGrid.Size = new System.Drawing.Size(427, 199);
            this.dataGrid.TabIndex = 3;
            this.dataGrid.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGrid_CellMouseClick);
            this.dataGrid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGrid_KeyDown);
            //
            // AddressName
            //
            this.AddressName.ContextMenuStrip = this.DataGridContextMenu;
            this.AddressName.HeaderText = "Address";
            this.AddressName.Name = "AddressName";
            this.AddressName.Width = 70;
            //
            // DataGridContextMenu
            //
            this.DataGridContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.CopyToolStripMenuItem,
            this.CutToolStripMenuItem,
            this.PasteToolStripMenuItem,
            this.DeleteToolStripMenuItem});
            this.DataGridContextMenu.Name = "DataGridContextMenu";
            this.DataGridContextMenu.Size = new System.Drawing.Size(108, 92);
            //
            // CopyToolStripMenuItem
            //
            this.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem";
            this.CopyToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
            this.CopyToolStripMenuItem.Text = "Copy";
            this.CopyToolStripMenuItem.Click += new System.EventHandler(this.CopyToolStripMenuItem_Click);
            //
            // CutToolStripMenuItem
            //
            this.CutToolStripMenuItem.Name = "CutToolStripMenuItem";
            this.CutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
            this.CutToolStripMenuItem.Text = "Cut";
            this.CutToolStripMenuItem.Click += new System.EventHandler(this.CutToolStripMenuItem_Click);
            //
            // PasteToolStripMenuItem
            //
            this.PasteToolStripMenuItem.Name = "PasteToolStripMenuItem";
            this.PasteToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
            this.PasteToolStripMenuItem.Text = "Paste";
            this.PasteToolStripMenuItem.Click += new System.EventHandler(this.PasteToolStripMenuItem_Click);
            //
            // DeleteToolStripMenuItem
            //
            this.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem";
            this.DeleteToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
            this.DeleteToolStripMenuItem.Text = "Delete";
            this.DeleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItem_Click);
            //
            // MultiAdressLabel
            //
            this.MultiAdressLabel.AutoSize = true;
            this.MultiAdressLabel.Location = new System.Drawing.Point(3, 0);
            this.MultiAdressLabel.Name = "MultiAdressLabel";
            this.MultiAdressLabel.Size = new System.Drawing.Size(70, 13);
            this.MultiAdressLabel.TabIndex = 4;
            this.MultiAdressLabel.Text = "Multi Address";
            //
            // SaveAsTextBox
            //
            this.SaveAsTextBox.Cursor = System.Windows.Forms.Cursors.Default;
            this.SaveAsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SaveAsTextBox.Location = new System.Drawing.Point(3, 16);
            this.SaveAsTextBox.Name = "SaveAsTextBox";
            this.SaveAsTextBox.ReadOnly = true;
            this.SaveAsTextBox.Size = new System.Drawing.Size(396, 20);
            this.SaveAsTextBox.TabIndex = 7;
            this.SaveAsTextBox.TextChanged += new System.EventHandler(this.SaveAsTextBox_TextChanged);
            //
            // SaveAsPathButton
            //
            this.SaveAsPathButton.Dock = System.Windows.Forms.DockStyle.Fill;
            this.SaveAsPathButton.Location = new System.Drawing.Point(405, 16);
            this.SaveAsPathButton.Name = "SaveAsPathButton";
            this.SaveAsPathButton.Size = new System.Drawing.Size(25, 20);
            this.SaveAsPathButton.TabIndex = 8;
            this.SaveAsPathButton.Text = "...";
            this.SaveAsPathButton.UseVisualStyleBackColor = true;
            this.SaveAsPathButton.Click += new System.EventHandler(this.SaveAsButton_Click);
            //
            // saveFileDialog
            //
            this.saveFileDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog_FileOk);
            //
            // SaveAsLabel
            //
            this.SaveAsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.SaveAsLabel.AutoSize = true;
            this.SaveAsLabel.Location = new System.Drawing.Point(3, 0);
            this.SaveAsLabel.Name = "SaveAsLabel";
            this.SaveAsLabel.Size = new System.Drawing.Size(58, 13);
            this.SaveAsLabel.TabIndex = 9;
            this.SaveAsLabel.Text = "Save as ...";
            //
            // RunButton
            //
            this.RunButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.RunButton.Location = new System.Drawing.Point(298, 45);
            this.RunButton.Name = "RunButton";
            this.RunButton.Size = new System.Drawing.Size(40, 20);
            this.RunButton.TabIndex = 10;
            this.RunButton.Text = "Run";
            this.RunButton.UseVisualStyleBackColor = true;
            this.RunButton.Click += new System.EventHandler(this.RunButton_Click);
            //
            // AddressFieldsLabel
            //
            this.AddressFieldsLabel.AutoSize = true;
            this.AddressFieldsLabel.Location = new System.Drawing.Point(3, 0);
            this.AddressFieldsLabel.Name = "AddressFieldsLabel";
            this.AddressFieldsLabel.Size = new System.Drawing.Size(122, 13);
            this.AddressFieldsLabel.TabIndex = 11;
            this.AddressFieldsLabel.Text = "Saving Addresses Fields";
            //
            // AddressMembersDataGridView
            //
            this.AddressMembersDataGridView.AllowUserToAddRows = false;
            this.AddressMembersDataGridView.AllowUserToDeleteRows = false;
            this.AddressMembersDataGridView.AllowUserToResizeColumns = false;
            this.AddressMembersDataGridView.AllowUserToResizeRows = false;
            this.AddressMembersDataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
            this.AddressMembersDataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
            this.AddressMembersDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.AddressMembersDataGridView.ColumnHeadersVisible = false;
            this.AddressMembersDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.AddressMemberCheck,
            this.AddressMember});
            this.AddressMembersDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.AddressMembersDataGridView.GridColor = System.Drawing.SystemColors.Window;
            this.AddressMembersDataGridView.Location = new System.Drawing.Point(3, 16);
            this.AddressMembersDataGridView.Name = "AddressMembersDataGridView";
            this.AddressMembersDataGridView.RowHeadersVisible = false;
            this.AddressMembersDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.AddressMembersDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.AddressMembersDataGridView.Size = new System.Drawing.Size(427, 206);
            this.AddressMembersDataGridView.TabIndex = 12;
            //
            // MainSplitContainer
            //
            this.MainSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.MainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
            this.MainSplitContainer.IsSplitterFixed = true;
            this.MainSplitContainer.Location = new System.Drawing.Point(0, 0);
            this.MainSplitContainer.Name = "MainSplitContainer";
            this.MainSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
            //
            // MainSplitContainer.Panel1
            //
            this.MainSplitContainer.Panel1.Controls.Add(this.ChildSplitContainer);
            //
            // MainSplitContainer.Panel2
            //
            this.MainSplitContainer.Panel2.Controls.Add(this.LocalLabel);
            this.MainSplitContainer.Panel2.Controls.Add(this.LocalComboBox);
            this.MainSplitContainer.Panel2.Controls.Add(this.WorkProgressBar);
            this.MainSplitContainer.Panel2.Controls.Add(this.AboutButton);
            this.MainSplitContainer.Panel2.Controls.Add(this.tableLayoutPanel4);
            this.MainSplitContainer.Panel2.Controls.Add(this.ExitButton);
            this.MainSplitContainer.Panel2.Controls.Add(this.RunButton);
            this.MainSplitContainer.Size = new System.Drawing.Size(433, 528);
            this.MainSplitContainer.SplitterDistance = 447;
            this.MainSplitContainer.TabIndex = 14;
            //
            // ChildSplitContainer
            //
            this.ChildSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ChildSplitContainer.Location = new System.Drawing.Point(0, 0);
            this.ChildSplitContainer.Name = "ChildSplitContainer";
            this.ChildSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
            //
            // ChildSplitContainer.Panel1
            //
            this.ChildSplitContainer.Panel1.Controls.Add(this.tableLayoutPanel2);
            //
            // ChildSplitContainer.Panel2
            //
            this.ChildSplitContainer.Panel2.Controls.Add(this.tableLayoutPanel3);
            this.ChildSplitContainer.Size = new System.Drawing.Size(433, 447);
            this.ChildSplitContainer.SplitterDistance = 218;
            this.ChildSplitContainer.TabIndex = 14;
            //
            // tableLayoutPanel2
            //
            this.tableLayoutPanel2.ColumnCount = 1;
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel2.Controls.Add(this.dataGrid, 0, 1);
            this.tableLayoutPanel2.Controls.Add(this.MultiAdressLabel, 0, 0);
            this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
            this.tableLayoutPanel2.RowCount = 2;
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel2.Size = new System.Drawing.Size(433, 218);
            this.tableLayoutPanel2.TabIndex = 0;
            //
            // tableLayoutPanel3
            //
            this.tableLayoutPanel3.ColumnCount = 1;
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel3.Controls.Add(this.AddressMembersDataGridView, 0, 1);
            this.tableLayoutPanel3.Controls.Add(this.AddressFieldsLabel, 0, 0);
            this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel3.Name = "tableLayoutPanel3";
            this.tableLayoutPanel3.RowCount = 2;
            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel3.Size = new System.Drawing.Size(433, 225);
            this.tableLayoutPanel3.TabIndex = 0;
            //
            // LocalLabel
            //
            this.LocalLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.LocalLabel.AutoSize = true;
            this.LocalLabel.Location = new System.Drawing.Point(168, 49);
            this.LocalLabel.Name = "LocalLabel";
            this.LocalLabel.Size = new System.Drawing.Size(58, 13);
            this.LocalLabel.TabIndex = 20;
            this.LocalLabel.Text = "Language:";
            //
            // LocalComboBox
            //
            this.LocalComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.LocalComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.LocalComboBox.FormattingEnabled = true;
            this.LocalComboBox.Location = new System.Drawing.Point(232, 44);
            this.LocalComboBox.Name = "LocalComboBox";
            this.LocalComboBox.Size = new System.Drawing.Size(60, 21);
            this.LocalComboBox.TabIndex = 19;
            //
            // WorkProgressBar
            //
            this.WorkProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.WorkProgressBar.Location = new System.Drawing.Point(29, 44);
            this.WorkProgressBar.Name = "WorkProgressBar";
            this.WorkProgressBar.Size = new System.Drawing.Size(133, 20);
            this.WorkProgressBar.TabIndex = 18;
            //
            // AboutButton
            //
            this.AboutButton.Location = new System.Drawing.Point(3, 45);
            this.AboutButton.Name = "AboutButton";
            this.AboutButton.Size = new System.Drawing.Size(20, 20);
            this.AboutButton.TabIndex = 17;
            this.AboutButton.Text = "?";
            this.AboutButton.UseVisualStyleBackColor = true;
            this.AboutButton.Click += new System.EventHandler(this.AboutButton_Click);
            //
            // tableLayoutPanel4
            //
            this.tableLayoutPanel4.ColumnCount = 2;
            this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel4.Controls.Add(this.SaveAsLabel, 0, 0);
            this.tableLayoutPanel4.Controls.Add(this.SaveAsPathButton, 1, 1);
            this.tableLayoutPanel4.Controls.Add(this.SaveAsTextBox, 0, 1);
            this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top;
            this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel4.Name = "tableLayoutPanel4";
            this.tableLayoutPanel4.RowCount = 2;
            this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
            this.tableLayoutPanel4.Size = new System.Drawing.Size(433, 39);
            this.tableLayoutPanel4.TabIndex = 15;
            //
            // backgroundWorker
            //
            this.backgroundWorker.WorkerReportsProgress = true;
            this.backgroundWorker.WorkerSupportsCancellation = true;
            this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork);
            this.backgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker_ProgressChanged);
            this.backgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker_RunWorkerCompleted);
            //
            // StopButton
            //
            this.StopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.StopButton.Location = new System.Drawing.Point(344, 496);
            this.StopButton.Name = "StopButton";
            this.StopButton.Size = new System.Drawing.Size(40, 20);
            this.StopButton.TabIndex = 21;
            this.StopButton.Text = "Stop";
            this.StopButton.UseVisualStyleBackColor = true;
            this.StopButton.Click += new System.EventHandler(this.StopButton_Click);
            //
            // AddressMemberCheck
            //
            this.AddressMemberCheck.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            this.AddressMemberCheck.HeaderText = "AddressMemberCheck";
            this.AddressMemberCheck.Name = "AddressMemberCheck";
            this.AddressMemberCheck.Resizable = System.Windows.Forms.DataGridViewTriState.False;
            this.AddressMemberCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
            this.AddressMemberCheck.Width = 5;
            //
            // AddressMember
            //
            this.AddressMember.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
            this.AddressMember.HeaderText = "AddressMember";
            this.AddressMember.Name = "AddressMember";
            this.AddressMember.ReadOnly = true;
            this.AddressMember.Width = 5;
            //
            // MainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(433, 528);
            this.Controls.Add(this.StopButton);
            this.Controls.Add(this.MainSplitContainer);
            this.Cursor = System.Windows.Forms.Cursors.Default;
            this.KeyPreview = true;
            this.MinimumSize = new System.Drawing.Size(400, 500);
            this.Name = "MainForm";
            this.Text = "Multi GeoCoder";
            this.Load += new System.EventHandler(this.MainForm_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
            this.DataGridContextMenu.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.AddressMembersDataGridView)).EndInit();
            this.MainSplitContainer.Panel1.ResumeLayout(false);
            this.MainSplitContainer.Panel2.ResumeLayout(false);
            this.MainSplitContainer.Panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).EndInit();
            this.MainSplitContainer.ResumeLayout(false);
            this.ChildSplitContainer.Panel1.ResumeLayout(false);
            this.ChildSplitContainer.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.ChildSplitContainer)).EndInit();
            this.ChildSplitContainer.ResumeLayout(false);
            this.tableLayoutPanel2.ResumeLayout(false);
            this.tableLayoutPanel2.PerformLayout();
            this.tableLayoutPanel3.ResumeLayout(false);
            this.tableLayoutPanel3.PerformLayout();
            this.tableLayoutPanel4.ResumeLayout(false);
            this.tableLayoutPanel4.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion
        private System.Windows.Forms.Button ExitButton;
        private System.Windows.Forms.DataGridView dataGrid;
        private System.Windows.Forms.Label MultiAdressLabel;
        private DataGridViewTextBoxColumn AddressName;
        private ContextMenuStrip DataGridContextMenu;
        private ToolStripMenuItem CopyToolStripMenuItem;
        private ToolStripMenuItem CutToolStripMenuItem;
        private ToolStripMenuItem PasteToolStripMenuItem;
        private ToolStripMenuItem DeleteToolStripMenuItem;
        private TextBox SaveAsTextBox;
        private Button SaveAsPathButton;
        private SaveFileDialog saveFileDialog;
        private Label SaveAsLabel;
        private Button RunButton;
        private Label AddressFieldsLabel;
        private DataGridView AddressMembersDataGridView;
        private SplitContainer MainSplitContainer;
        private SplitContainer ChildSplitContainer;
        private TableLayoutPanel tableLayoutPanel2;
        private TableLayoutPanel tableLayoutPanel3;
        private TableLayoutPanel tableLayoutPanel4;
        private Button AboutButton;
        private System.ComponentModel.BackgroundWorker backgroundWorker;
        private ProgressBar WorkProgressBar;
        private Label LocalLabel;
        private ComboBox LocalComboBox;
        private Button StopButton;
        private DataGridViewCheckBoxColumn AddressMemberCheck;
        private DataGridViewTextBoxColumn AddressMember;
    }
}


text:
//
//  MLNewsDetailImg.h
//  SocererTerminal
//
//  Created by 李明禄 on 15/11/25.
//  Copyright © 2015年 SocererGroup. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MLNewsDetailImg : NSObject

/**图片路径*/
@property (nonatomic, copy) NSString *src;

/**图片尺寸*/
@property (nonatomic, copy) NSString *pixel;

/**图片所处的位置*/
@property (nonatomic, copy) NSString *ref;

- (instancetype)initWithDict:(NSDictionary *)dict;
+ (instancetype)newsDetailImgWithDict:(NSDictionary *)dict;

@end


text:
class InitRoles < ActiveRecord::Migration
  class Role < ActiveRecord::Base
  end

  def self.add_role(sym)
    Role.new(:name => sym.to_s).save!
  end

  def self.remove_role(sym)
    Role.find_by_name(sym.to_s).destroy
  end

  def self.up
    add_role :admin
    add_role :senior
    add_role :clerk
    add_role :herald
    add_role :guest
  end

  def self.down
    remove_role :guest
    remove_role :herald
    remove_role :clerk
    remove_role :senior
    remove_role :admin
  end
end


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

<TITLE>
Extras (Flickr API-1.2 API)
</TITLE>

<META NAME="date" CONTENT="2009-07-24">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.aetrion.flickr.photos

Class Extras

java.lang.Object
  com.aetrion.flickr.photos.Extras

public class Extras
extends java.lang.Object

Extra-attributes for Photo-requests.

Version:

$Id: Extras.java,v 1.12 2009/07/23 20:41:03 x-mago Exp $

Author:

Anthony Eden

Field Summary

static java.util.Set
ALL_EXTRAS

          Set of all extra-arguments.

static java.lang.String
DATE_TAKEN

static java.lang.String
DATE_UPLOAD

static java.lang.String
GEO

static java.lang.String
ICON_SERVER

static java.lang.String
KEY_EXTRAS

static java.lang.String
LAST_UPDATE

static java.lang.String
LICENSE

static java.lang.String
MACHINE_TAGS

static java.lang.String
MEDIA

static java.util.Set
MIN_EXTRAS

          Minimal Set of extra-arguments.

static java.lang.String
O_DIMS

static java.lang.String
ORIGINAL_FORMAT

static java.lang.String
OWNER_NAME

static java.lang.String
PATH_ALIAS

static java.lang.String
TAGS

static java.lang.String
URL_L

static java.lang.String
URL_M

static java.lang.String
URL_O

static java.lang.String
URL_S

static java.lang.String
URL_SQ

static java.lang.String
URL_T

static java.lang.String
VIEWS

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

KEY_EXTRAS

public static final java.lang.String KEY_EXTRAS

See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE

See Also:
Constant Field Values

DATE_UPLOAD

public static final java.lang.String DATE_UPLOAD

See Also:
Constant Field Values

DATE_TAKEN

public static final java.lang.String DATE_TAKEN

See Also:
Constant Field Values

OWNER_NAME

public static final java.lang.String OWNER_NAME

See Also:
Constant Field Values

ICON_SERVER

public static final java.lang.String ICON_SERVER

See Also:
Constant Field Values

ORIGINAL_FORMAT

public static final java.lang.String ORIGINAL_FORMAT

See Also:
Constant Field Values

LAST_UPDATE

public static final java.lang.String LAST_UPDATE

See Also:
Constant Field Values

GEO

public static final java.lang.String GEO

See Also:
Constant Field Values

TAGS

public static final java.lang.String TAGS

See Also:
Constant Field Values

MACHINE_TAGS

public static final java.lang.String MACHINE_TAGS

See Also:
Constant Field Values

O_DIMS

public static final java.lang.String O_DIMS

See Also:
Constant Field Values

MEDIA

public static final java.lang.String MEDIA

See Also:
Constant Field Values

VIEWS

public static final java.lang.String VIEWS

See Also:
Constant Field Values

PATH_ALIAS

public static final java.lang.String PATH_ALIAS

See Also:
Constant Field Values

URL_S

public static final java.lang.String URL_S

See Also:
Constant Field Values

URL_SQ

public static final java.lang.String URL_SQ

See Also:
Constant Field Values

URL_T

public static final java.lang.String URL_T

See Also:
Constant Field Values

URL_M

public static final java.lang.String URL_M

See Also:
Constant Field Values

URL_L

public static final java.lang.String URL_L

See Also:
Constant Field Values

URL_O

public static final java.lang.String URL_O

See Also:
Constant Field Values

ALL_EXTRAS

public static final java.util.Set ALL_EXTRAS

Set of all extra-arguments. Used for requesting lists of photos.

See Also:
PoolsInterface.getPhotos(String, String[], Set, int, int),
PandaInterface.getPhotos(com.aetrion.flickr.panda.Panda, Set, int, int),
PeopleInterface.getPublicPhotos(String, Set, int, int),
PhotosetsInterface.getPhotos(String, Set, int, int, int),
PhotosInterface.getContactsPublicPhotos(String, Set, int, boolean, boolean, boolean),
PhotosInterface.getWithGeoData(java.util.Date, java.util.Date, java.util.Date, java.util.Date, int, String, Set, int, int),
PhotosInterface.getWithoutGeoData(java.util.Date, java.util.Date, java.util.Date, java.util.Date, int, String, Set, int, int),
PhotosInterface.recentlyUpdated(java.util.Date, Set, int, int),
SearchParameters.setExtras(Set),
GeoInterface.photosForLocation(GeoData, Set, int, int),
InterestingnessInterface.getList(java.util.Date, Set, int, int),
FavoritesInterface.getList(String, int, int, Set)

MIN_EXTRAS

public static final java.util.Set MIN_EXTRAS

Minimal Set of extra-arguments. Used by convenience-methods
 that request lists of photos.

See Also:
PoolsInterface.getPhotos(String, String[], Set, int, int),
PandaInterface.getPhotos(com.aetrion.flickr.panda.Panda, Set, int, int),
PeopleInterface.getPublicPhotos(String, Set, int, int),
PhotosetsInterface.getPhotos(String, Set, int, int, int),
PhotosInterface.getContactsPublicPhotos(String, Set, int, boolean, boolean, boolean),
PhotosInterface.getWithGeoData(java.util.Date, java.util.Date, java.util.Date, java.util.Date, int, String, Set, int, int),
PhotosInterface.getWithoutGeoData(java.util.Date, java.util.Date, java.util.Date, java.util.Date, int, String, Set, int, int),
PhotosInterface.recentlyUpdated(java.util.Date, Set, int, int),
GeoInterface.photosForLocation(GeoData, Set, int, int),
InterestingnessInterface.getList(java.util.Date, Set, int, int),
FavoritesInterface.getList(String, int, int, Set)

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 2005-2008 Aetrion LLC.  All Rights Reserved.


text:
$(document).ready(function() {

	// gets collection names on lists page
	$.ajax({
		url: "/mylists",
		type: 'GET',
		success: function(result) {
			$('#lists').html(result);
		}
	});

	// displays email form on email page
	$.ajax({
		url: "/email.html/form",
		type: 'GET',
		success: function(result) {
			$("#postEmailForm").html(result);
		}
	});

	// POST email ajax request
	$('#postEmailForm').submit(function(){
		var query = "/email/";
		var body = $("#body").val().replace(/\n/g, '
');
		console.log(typeof($('#toList').val()));
		query += $('#toList').val() + "/" + $('#subjectTitle').val()
		 + "/" + body;
		 console.log(query);
		$.ajax({
			url: query,
			type: 'POST',
			success: function(result) {
				$('#alert').append(result);
			}
		});
		return false;
	});

	// PUT ajax request
	$('#putForm').submit(function(){
		var query = "/m2clists/";
		var firstname = $('#putForm .fname').val().charAt(0).toUpperCase() + $('#putForm .fname').val().slice(1);
		var lastname = $('#putForm .lname').val().charAt(0).toUpperCase() + $('#putForm .lname').val().slice(1);
		query += $('#putForm .listName').val().toLowerCase() + "?" + "firstname=" + firstname + "&" +
				 "lastname=" + lastname + "&" + "email=" + $('#putForm .email').val().toLowerCase();
		console.log(query);
		$.ajax({
			url: query,
			type: 'PUT',
			success: function(result) {
				$('#current').html(result);
			}
		});
		return false;
	});

	// GET ajax request
	$('#getForm').submit(function(){
		var query = "/m2clists/";
		query += $('#getForm .listName').val().toLowerCase() + "?" + "email=" + $('#getForm .email').val().toLowerCase();
		$.ajax({
			url: query,
			type: 'GET',
			success: function(result) {
				$('#current').html(result);
			}
		});
		return false;
	});

	// POST (update) ajax request
	$('#postForm').submit(function(){
		var query = "/m2clists/";
		var firstname = $('#putForm .fname').val().charAt(0).toUpperCase() + $('#putForm .fname').val().slice(1);
		var lastname = $('#putForm .lname').val().charAt(0).toUpperCase() + $('#putForm .lname').val().slice(1);
		query += $('#postForm .listName').val() + "/" + $('#postForm .currEmail').val().toLowerCase() + "?" +
				"firstname=" + firstname + "&" + "lastname=" + lastname + "&" +
				"email=" + $('#postForm .email').val().toLowerCase();
		$.ajax({
			url: query,
			type: 'POST',
			success: function(result) {
				$('#update').html(result);
			}
		});
		return false;
	});

	// DELETE contact ajax request
	$('#deleteForm').submit(function(){
		var query = "/m2clists/";
		query += $('#deleteForm .listName').val().toLowerCase() + "?" +
				 "email=" + $('#deleteForm .email').val().toLowerCase();
		$.ajax({
			url: query,
			type: 'DELETE',
			success: function(result) {
				$('#delete').html(result);
			}
		});
		return false;
	});

	// login ajax request
	$('#loginForm').submit(function(){
		var query = "/login/";
		query += $('#username').val().toLowerCase() + "/" + $('#inputPassword').val();
		$.ajax({
			url: query,
			type: 'POST',
			success: function(result) {
				console.log("result: ", result)
				console.log("result.login: ", result.login)
				$('#loginStatus').html(result);
			}
		});
		return false;
	});

	// shows contacts of certain collection on lists page
	$('#lists').click(function(e) {
		var query = "/lists/";
		var listname = $(e.target).closest('div').prop("id");
		query += listname;
		$.ajax({
			url:query,
			type: 'GET',
			success: function(result) {
				$("#" + listname + " span").html(result);
			}
		});
		return false;
	});

	// Grabs 6 most recent pictures of specified hashtag from Instagram
	$("#instaPics").click(function() {
	  var tag = $("#tag").val();
	  try {
	    $.ajax({
	      type: "GET",
	      url: "https://api.instagram.com/v1/tags/" + tag + "/media/recent?client_id=8372b5642ba843e5a225b1291426c9d8&callback=displayPics",
	      jsonp: true,
	      dataType: "jsonp",
	      crossDomain: true
	    });
	    return false;
	  } catch (error) {console.log(error.description);}
	});

});

// callback function for displaying images from instagram
function displayPics(response) {
  var picArray = [];
  for (var i = 0; i < 6; i ++) {
    // parse through response from Ajax request to grab a single image link
    var picString = "";
    picArray += picString;
  }
  // set the images div with new picArray created from Ajax request
  $("#images").html(picArray);
}


text:
#include "stdafx.h"

#include "bigtext.h"

int wmain(int argc, wchar_t **argv)
{
    std::setlocale(LC_CTYPE, "");
    return bigtext::main(argc, argv);
}

namespace bigtext
{
    uintmax_t get_physical_memory_size()
    {
        MEMORYSTATUSEX mem_info;
        mem_info.dwLength = sizeof(mem_info);
        if (GlobalMemoryStatusEx(&mem_info))
        {
            uintmax_t res = static_cast<uintmax_t>(mem_info.ullTotalPhys);
            std::wcout << "\tPhysicalMemorySize\t" << res << std::endl;
#if !_WIN64
            if (res >= 1 << 31) res = 1 << 31;
#endif
            return res;
        }
        return 0;
    }
}


text:
#pragma once
#include <vector>
#include <queue>
#include <string>
#include <climits>
#include <cmath>
#include <stack>
#include <set>
#include <sstream>
#include <algorithm>
using namespace std;

class MinStack {
public:
    stack<int> minStack, stk;
    /** initialize your data structure here. */
    MinStack() {
    }

    void push(int x) {
        stk.push(x);
        if (minStack.empty() || minStack.top() >= x) {
            minStack.push(x);
        }
    }

    void pop() {
        int top = stk.top();
        stk.pop();
        if (top == minStack.top()) {
            minStack.pop();
        }
    }

    int top() {
        return stk.top();
    }

    int getMin() {
        return minStack.top();
    }
};


text:
<?php

namespace Oro\Bundle\NavigationBundle\Event;

use Doctrine\ORM\EntityManager;
use Doctrine\Common\Persistence\ManagerRegistry;

use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

use Oro\Bundle\EntityBundle\Event\OroEventManager;
use Oro\Bundle\NavigationBundle\Entity\Builder\ItemFactory;
use Oro\Bundle\NavigationBundle\Entity\NavigationHistoryItem;
use Oro\Bundle\NavigationBundle\Provider\TitleServiceInterface;
use Oro\Bundle\SecurityBundle\Authentication\Token\OrganizationContextTokenInterface;

class ResponseHistoryListener
{
    /** @var string */
    protected $historyItemFQCN;

    /** @var string */
    protected $userFQCN;

    /** @var string */
    protected $navigationHistoryItemType;

    /** var ItemFactory */
    protected $navItemFactory;

    /** @var SecurityContextInterface */
    protected $securityContext;

    /** @var ManagerRegistry */
    protected $registry;

    /** @var TitleServiceInterface */
    protected $titleService;

    /**
     * @param ItemFactory              $navigationItemFactory
     * @param SecurityContextInterface $securityContext
     * @param ManagerRegistry          $registry
     * @param TitleServiceInterface    $titleService
     */
    public function __construct(
        ItemFactory $navigationItemFactory,
        SecurityContextInterface $securityContext,
        ManagerRegistry $registry,
        TitleServiceInterface $titleService
    ) {
        $this->navItemFactory  = $navigationItemFactory;
        $this->securityContext = $securityContext;
        $this->registry        = $registry;
        $this->titleService    = $titleService;
    }

    /**
     * Process onResponse event, updates user history information
     *
     * @param  FilterResponseEvent $event
     *
     * @return bool|null
     */
    public function onResponse(FilterResponseEvent $event)
    {
        if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
            // Do not do anything
            return null;
        }

        /** @var EntityManager $em */
        $em       = $this->registry->getManagerForClass($this->historyItemFQCN);
        $request  = $event->getRequest();
        $response = $event->getResponse();
        $token    = $this->securityContext->getToken();
        $user     = $organization = null;
        if ($token instanceof TokenInterface) {
            $user = $token->getUser();
        }

        // check if a current request can be added to a history
        if (!$this->canAddToHistory($response, $request, $user)) {
            return false;
        }

        if ($token instanceof OrganizationContextTokenInterface) {
            $organization = $token->getOrganizationContext();
        }

        $postArray = [
            'url'          => $this->prepareUrl($em, $request->getRequestUri()),
            'user'         => $user,
            'organization' => $organization
        ];

        /** @var $historyItem  NavigationHistoryItem */
        $historyItem = $em->getRepository($this->historyItemFQCN)->findOneBy($postArray);

        if (!$historyItem) {
            $routeParameters = $request->get('_route_params');
            unset($routeParameters['id']);

            $entityId = filter_var($request->get('id'), FILTER_VALIDATE_INT);
            if (false !== $entityId) {
                $entityId = (int)$entityId;
            } else {
                $entityId = null;
            }

            $postArray['route']           = $request->get('_route');
            $postArray['routeParameters'] = $routeParameters;
            $postArray['entityId']        = $entityId;

            /** @var $historyItem \Oro\Bundle\NavigationBundle\Entity\NavigationItemInterface */
            $historyItem = $this->navItemFactory->createItem(
                $this->navigationHistoryItemType,
                $postArray
            );
        }

        $historyItem->setTitle($this->titleService->getSerialized());

        // force update
        $historyItem->doUpdate();

        // disable Doctrine events for history item processing
        $eventManager = $em->getEventManager();
        if ($eventManager instanceof OroEventManager) {
            $eventManager->disableListeners('^Oro');
        }

        $em->persist($historyItem);
        $em->flush($historyItem);

        if ($eventManager instanceof OroEventManager) {
            $eventManager->clearDisabledListeners();
        }

        return true;
    }

    /**
     * Is request valid for adding to history
     *
     * @param Response $response
     * @param Request  $request
     * @param          $user
     *
     * @return bool
     */
    private function canAddToHistory(Response $response, Request $request, $user = null)
    {
        $userFQCN = $this->userFQCN;
        $result = ($user instanceof $userFQCN)
            && $response->getStatusCode() === 200
            && $request->getRequestFormat() === 'html'
            && $request->getMethod() === 'GET'
            && (!$request->isXmlHttpRequest()
                || $request->headers->get(ResponseHashnavListener::HASH_NAVIGATION_HEADER));

        if ($result) {
            $route  = $request->get('_route');
            $result = $route[0] !== '_' && $route !== 'oro_default';
        }

        if ($result && $response->headers->has('Content-Disposition')) {
            $contentDisposition = $response->headers->get('Content-Disposition');
            $result             = (strpos($contentDisposition, ResponseHeaderBag::DISPOSITION_INLINE) !== 0)
                && (strpos($contentDisposition, ResponseHeaderBag::DISPOSITION_ATTACHMENT) !== 0);
        }

        return $result;
    }

    /**
     * Make sure url length is not bigger than url field's size
     *
     * @param EntityManager $em
     * @param string $url
     * @return string
     */
    protected function prepareUrl(EntityManager $em, $url)
    {
        $metaData = $em->getClassMetadata($this->historyItemFQCN);
        $urlMeta = $metaData->getFieldMapping('url');
        $length = $urlMeta['length'];

        return substr($url, 0, $length);
    }

    /**
     * @param string $entityFQCN
     */
    public function setHistoryItemEntityFQCN($entityFQCN)
    {
        $this->historyItemFQCN = $entityFQCN;
    }

    /**
     * @param string $entityFQCN
     */
    public function setUserEntityFQCN($entityFQCN)
    {
        $this->userFQCN = $entityFQCN;
    }

    /**
     * @param string $type
     */
    public function setNavigationHistoryItemType($type)
    {
        $this->navigationHistoryItemType = $type;
    }
}


text:
package org.kaazing.gateway.transport.ws.util;

public class WsHandshakeNegotiationException extends Exception {

    public WsHandshakeNegotiationException(String message) {
        super(message);
    }

    /**
     *
     */
    private static final long serialVersionUID = -3893455432423255947L;

}


text:
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/* global window */
import TestRunner from './test-runner';

const DEFAULT_TEST_CASE = {
  name: 'Unnamed interaction test',
  events: [],
  onBeforeEvents: ({deck}) => {},
  onAfterEvents: ({deck, layers, context}) => {}
};

function sleep(timeout) {
  return new Promise(resolve => window.setTimeout(resolve, timeout));
}

export default class InteractionTestRunner extends TestRunner {
  get defaultTestCase() {
    return DEFAULT_TEST_CASE;
  }

  // chain events
  // TODO - switch to async/await
  runTestCase(testCase, onDone) {
    testCase.context = testCase.onBeforeEvents({
      deck: this.deck
    });

    let promise = Promise.resolve();
    for (const event of testCase.events) {
      if (event.wait) {
        promise = promise.then(() => sleep(event.wait));
      } else {
        promise = promise.then(() => window.browserTestDriver_emulateInput(event));
      }
    }
    return promise.then(onDone);
  }

  assert(testCase) {
    testCase.onAfterEvents({
      deck: this.deck,
      layers: this.deck.layerManager.getLayers(),
      context: testCase.context
    });
    this._next();
  }
}


text:
package org.hisp.dhis.organisationunit;

import java.util.List;
import java.util.Set;

/**
 * A number of data integrity tests are solely related to
 * {@link OrganisationUnit}s. They are contained in this interface to avoid
 * duplication.
 *
 * @author Jan Bernitt
 */
public interface OrganisationUnitDataIntegrityProvider
{

    /**
     * Gets all organisation units which are related to each other in a cyclic
     * reference.
     */
    Set<OrganisationUnit> getOrganisationUnitsWithCyclicReferences();

    /**
     * Gets all organisation units with no parents or children.
     */
    List<OrganisationUnit> getOrphanedOrganisationUnits();

    /**
     * Returns all OrganisationUnits which are not a member of any
     * OrganisationUnitGroups.
     *
     * @return all OrganisationUnits which are not a member of any
     *         OrganisationUnitGroups.
     */
    List<OrganisationUnit> getOrganisationUnitsWithoutGroups();

    /**
     * Gets all organisation units which are members of more than one group
     * which enter into an exclusive group set.
     */
    List<OrganisationUnit> getOrganisationUnitsViolatingExclusiveGroupSets();
}


text:
CLASS({
  package: 'foam.u2.md',
  name: 'OverlayDropdown',
  extends: 'foam.u2.Element',

  imports: [
    'document',
    'window',
  ],
  exports: [
    'as dropdown',
  ],

  documentation: 'A popup overlay that grows from the top-right corner of ' +
      'its container. Useful for e.g. "..." overflow menus in action bars. ' +
      'Just $$DOC{ref:".add"} things to this container.',

  properties: [
    {
      type: 'Float',
      name: 'height',
      defaultValue: 0,
      // TODO(braden): Style should react to this property. Remember to guard
      // against negative.
    },
    {
      type: 'Boolean',
      name: 'opened',
      documentation: 'True when the overlay has been commanded to be open. ' +
          'It might still be animating; see $$DOC{ref:".animationComplete"}.',
      defaultValue: false,
    },
    {
      type: 'Boolean',
      name: 'animationComplete',
      documentation: 'True when an animation is running. The overlay hasn\'t ' +
          'really reached the state commanded by $$DOC{ref:".opened"} until ' +
          'this is true.',
      defaultValue: true
    },
    {
      name: 'dropdownE_',
      factory: function() {
        // This needs to be created early so it's safe to add() things to it.
        return this.E('dropdown');
      }
    },
    {
      name: 'addToSelf_',
      defaultValue: false
    },
  ],

  methods: [
    function add() {
      if (this.addToSelf_) this.SUPER.apply(this, arguments);
      else this.dropdownE_.add.apply(this.dropdownE_, arguments);
      return this;
    },
    function open() {
      if (this.opened) return;
      this.height = -1;
      this.opened = true;
      this.animationComplete = false;
    },
    function close() {
      if (!this.opened) return;
      this.height = 0;
      this.opened = false;
    },
    function getFullHeight() {
      if (this.state !== this.LOADED) return;

      var myStyle = this.window.getComputedStyle(this.dropdownE_.el());

      var border = 0;
      ['border-top', 'border-bottom'].forEach(function(name) {
        var math = myStyle[name].match(/^([0-9]+)px/);
        if (match) border += parseInt(match[1]);
      });

      var last = this.dropdownE_.children[this.dropdownE_.children.length - 1];
      var margin = parseInt(this.window.getComputedStyle(last.el())['margin-bottom']);
      if (Number.isNaN(margin)) margin = 0;

      return Math.min(border + last.offsetTop + last.offsetHeight + margin,
          this.document.body.clientHeight - this.dropdownE_.el().getBoundingClientRect().top);
    },
    function initE() {
      this.addToSelf_ = true;
      this.cls(this.myCls('container'));

      this.style({
        display: this.dynamic(function(open) {
          return open ? 'block' : 'none';
        }, this.opened$)
      });

      var overlayStyle = this.dynamic(function(open) {
        return open ? '0' : 'initial';
      }, this.opened$);
      this.start('dropdown-overlay')
          .cls(this.myCls('overlay'))
          .style({
            top: overlayStyle,
            bottom: overlayStyle,
            left: overlayStyle,
            right: overlayStyle
          })
          .on('click', this.onCancel)
          .end();

      this.dropdownE_.cls(this.myCls())
          .cls(this.dynamic(function(open, complete) {
            return open && complete ? this.myCls('open') : '';
          }.bind(this), this.opened$, this.animationComplete$))
          .style({
            height: this.dynamic(function(height) {
              // TODO(braden): Should be able to remove this check; height NaN
              // shouldn't happen.
              console.assert(!Number.isNaN(height), 'Height should not be NaN.');
              return (height < 0 ? this.getFullHeight() : height) + 'px';
            })
          })
          .on('transitionend', this.onTransitionEnd)
          .on('mouseleave', this.onMouseLeave)
          .on('click', this.onClick);

      this.add(this.dropdownE_);

      this.addToSelf_ = false;
    },
  ],

  templates: [
    function CSS() {/*
      ^overlay {
        position: fixed;
        z-index: 1009;
      }

      ^container {
        position: absolute;
        right: 0;
        top: 0;
        z-index: 100;
      }

      ^ {
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
        display: block;
        font-size: 13px;
        font-weight: 400;
        overflow-x: hidden;
        overflow-y: hidden;
        position: absolute;
        right: 3px;
        top: 4px;
        transition: height 0.25s cubic-bezier(0, .3, .8, 1);
        z-index: 1010;
      }

      ^open {
        overflow-y: auto;
      }
    */},
  ],

  listeners: [
    function onCancel() {
      this.close();
    },
    function onTransitionEnd() {
      this.animationComplete = true;
    },
    function onMouseLeave(e) {
      console.assert(e.target === this.dropdownE_.el(),
          'mouseleave should only fire on this, not on children');
      this.close();
    },
    function onClick(e) {
      // Prevent clicks inside the dropdown from closing it.
      // Block them before they reach the overlay.
      e.stopPropagation();
    },
  ]
});


text:
@ECHO OFF
SET BIN_TARGET=%~dp0/../classpreloader/classpreloader/classpreloader.php
php "%BIN_TARGET%" %*


text:
import {useCallback, useState} from '#preact';
import {logger} from '#preact/logger';

export function useLocalStorage<T>(
  key: string,
  defaultValue: T
): readonly [T, (newValue: T) => void] {
  // Keep track of the state locally:
  const [value, setValue] = useState(() => {
    try {
      const json = self.localStorage?.getItem(key);
      return json ? JSON.parse(json) : defaultValue;
    } catch (err) {
      // warning: could not read from local storage
      return defaultValue;
    }
  });

  const storeValue = useCallback(
    (newValue: T) => {
      try {
        const json = JSON.stringify(newValue);
        self.localStorage?.setItem(key, json);
      } catch (err) {
        logger.warn(
          'useLocalStorage',
          'Could not write value to local storage',
          key,
          err
        );
      }
      setValue(newValue);
    },
    [key]
  );

  return [value, storeValue] as const;
}


text:
package sh.jay.xposed.whatsapp;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import static de.robv.android.xposed.XposedHelpers.findMethodsByExactParameters;
import static de.robv.android.xposed.XposedHelpers.findClass;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

import java.util.HashMap;
import java.util.Map;
import java.util.Date;
import java.util.Calendar;

import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.RelativeLayout;

import java.lang.reflect.Method;

/**
 * This hook allows us to disable the ticking time bomb that WhatsApp places
 * within their application.
 *
 * When debugging mode is enabled, the code will log the original expiry time
 * so you can also use this to see what your expiry time is going to be.
 */
public class DisableExpiryCheck implements IXposedHookLoadPackage {
    // Useful package constants.
    private static final String WHATSAPP_APP_CLASS = Utils.WHATSAPP_PACKAGE_NAME + ".App";

    /**
     * This is initially called by the Xposed Framework when we register this
     * android application as an Xposed Module.
     */
    public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
        // This method is called once per package, so we only want to apply hooks to WhatsApp.
        if (Utils.WHATSAPP_PACKAGE_NAME.equals(lpparam.packageName)) {
            Class<?> appClass = findClass(WHATSAPP_APP_CLASS, lpparam.classLoader);
            Method[] getExpiryDateMethods = findMethodsByExactParameters(appClass, Date.class);
            Utils.debug("We found " + getExpiryDateMethods.length + " that look like they return an expiry date.");

            if (getExpiryDateMethods.length == 1) {
                Method getExpiryDateMethod = getExpiryDateMethods[0];
                Utils.debug("Method found: " + getExpiryDateMethod.getName());

                XposedBridge.hookMethod(getExpiryDateMethod, new XC_MethodHook() {
                    @Override
                    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                        Utils.debug("Start of expiry date fetch method");

                        if (!Preferences.hasDisableExpiryCheck()) {
                            Utils.debug("Not disabling the time bomb due to the users preference");
                            return;
                        }

                        Utils.debug("Original expiry date: " + param.getResult());

                        // Let's tell WhatsApp that this version expires this time next year.
                        Calendar expiry = Calendar.getInstance();
                        expiry.add(Calendar.YEAR, 1);
                        param.setResult(expiry.getTime());

                        Utils.debug("New expiry date: " + param.getResult());

                        Utils.debug("End of expiry date fetch method");
                    }
                });
            }
        }
    }
}


text:
'use strict';

import { List } from 'immutable';
import * as d3 from 'd3';
import * as Q from 'q';
import { Class, Instance, isInstanceOf, arraysEqual } from 'immutable-class';
import { Timezone, hour } from 'chronoshift';
import { $, Expression, ExpressionJS, Executor, RefExpression, basicExecutorFactory, Dataset, Datum, Attributes, AttributeInfo, ChainExpression } from 'plywood';
import { makeTitle, listsEqual } from '../../utils/general';
import { Dimension, DimensionJS } from '../dimension/dimension';
import { Measure, MeasureJS } from '../measure/measure';

function dimensionPreference(dimension: Dimension): number {
  if (dimension.type === 'TIME') return 0;
  return 1;
}

function measurePreference(measure: Measure): number {
  if (measure.name === 'count') return 0;
  return 1;
}

function makeUniqueDimensionList(dimensions: Dimension[]): List<Dimension> {
  var seen: Lookup<number> = {};
  return List(dimensions.filter((dimension) => {
    var dimensionName = dimension.name.toLowerCase();
    if (seen[dimensionName]) return false;
    seen[dimensionName] = 1;
    return true;
  }));
}

function makeUniqueMeasureList(measures: Measure[]): List<Measure> {
  var seen: Lookup<number> = {};
  return List(measures.filter((measure) => {
    var measureName = measure.name.toLowerCase();
    if (seen[measureName]) return false;
    seen[measureName] = 1;
    return true;
  }));
}

interface DimensionsMetrics {
  dimensions: List<Dimension>;
  measures: List<Measure>;
  timeAttribute: RefExpression;
  defaultSortOn: string;
}

function makeDimensionsMetricsFromAttributes(attributes: Attributes): DimensionsMetrics {
  var dimensionArray: Dimension[] = [];
  var measureArray: Measure[] = [];
  var timeAttribute = $('time');
  var defaultSortOn: string = null;

  if (!attributes['count']) {
    measureArray.push(new Measure({
      name: 'count',
      title: 'Count',
      expression: $('main').count(),
      format: Measure.DEFAULT_FORMAT
    }));
    defaultSortOn = 'count';
  }

  for (let k in attributes) {
    let attribute = attributes[k];
    let type = attribute.type;
    switch (type) {
      case 'TIME':
        dimensionArray.push(Dimension.fromJS({
          name: k,
          type: type
        }));
        break;

      case 'STRING':
        if (attribute.special === 'unique') {
          measureArray.push(Measure.fromJS({
            name: k,
            expression: $('main').countDistinct($(k)).toJS(),
            format: Measure.INTEGER_FORMAT
          }));
        } else {
          dimensionArray.push(Dimension.fromJS({
            name: k,
            type: type
          }));
        }
        break;

      case 'NUMBER':
        measureArray.push(Measure.fromJS({
          name: k
        }));
        break;

      default:
        throw new Error('bad type ' + type);
    }
  }

  dimensionArray.sort((a, b) => {
    var prefDiff = dimensionPreference(a) - dimensionPreference(b);
    if (prefDiff) return prefDiff;
    return a.title.localeCompare(b.title);
  });

  measureArray.sort((a, b) => {
    var prefDiff = measurePreference(a) - measurePreference(b);
    if (prefDiff) return prefDiff;
    return a.title.localeCompare(b.title);
  });

  if (!defaultSortOn && measureArray.length) {
    defaultSortOn = measureArray[0].name;
  }

  return {
    dimensions: List(dimensionArray),
    measures: List(measureArray),
    timeAttribute,
    defaultSortOn
  };
}

export interface DataSourceValue {
  name: string;
  title: string;
  source: string;
  metadataLoaded: boolean;
  loadError: string;

  maxTime?: Date;
  dimensions?: List<Dimension>;
  measures?: List<Measure>;
  timeAttribute?: RefExpression;
  defaultSortOn?: string;

  executor?: Executor;
}

export interface DataSourceJS {
  name: string;
  title: string;
  source: string;

  maxTime?: Date;
  dimensions?: DimensionJS[];
  measures?: MeasureJS[];
  timeAttribute?: string;
  defaultSortOn?: string;
}

var check: Class<DataSourceValue, DataSourceJS>;
export class DataSource implements Instance<DataSourceValue, DataSourceJS> {
  static isDataSource(candidate: any): boolean {
    return isInstanceOf(candidate, DataSource);
  }

  static fromDataFileURL(name: string, title: string, source: string, maxTime: Date): DataSource {
    return new DataSource({
      name,
      title,
      source,
      metadataLoaded: false,
      loadError: null,
      maxTime
    });
  }

  static fromDataArray(name: string, title: string, source: string, maxTime: Date, rawData: any[]): DataSource {
    var mainDataset = Dataset.fromJS(rawData);
    mainDataset.introspect();

    var executor = basicExecutorFactory({
      datasets: {
        main: mainDataset
      }
    });

    var dm = makeDimensionsMetricsFromAttributes(mainDataset.attributes);
    return new DataSource({
      name,
      title,
      source,
      metadataLoaded: true,
      loadError: null,
      maxTime,
      dimensions: dm.dimensions,
      measures: dm.measures,
      timeAttribute: dm.timeAttribute,
      defaultSortOn: dm.defaultSortOn,
      executor
    });
  }

  static fromJS(parameters: DataSourceJS, executor: Executor = null): DataSource {
    var value: DataSourceValue = {
      executor: null,
      name: parameters.name,
      title: parameters.title,
      source: parameters.source || 'default-source',
      metadataLoaded: Boolean(parameters.dimensions && parameters.measures),
      loadError: null
    };
    if (parameters.maxTime) {
      value.maxTime = new Date(<any>parameters.maxTime);
    }
    if (parameters.dimensions) {
      value.dimensions = makeUniqueDimensionList(parameters.dimensions.map(Dimension.fromJS));
      value.measures = makeUniqueMeasureList(parameters.measures.map(Measure.fromJS));
      value.timeAttribute = parameters.timeAttribute ? $(parameters.timeAttribute) : null;
      value.defaultSortOn = parameters.defaultSortOn || value.measures.get(0).name;
    }
    if (executor) {
      value.executor = executor;
    }
    return new DataSource(value);
  }

  public name: string;
  public title: string;
  public source: string;
  public metadataLoaded: boolean;
  public loadError: string;

  public maxTime: Date;
  public dimensions: List<Dimension>;
  public measures: List<Measure>;
  public timeAttribute: RefExpression;
  public defaultSortOn: string;

  public executor: Executor;

  constructor(parameters: DataSourceValue) {
    this.name = parameters.name;
    this.title = parameters.title;
    this.source = parameters.source;
    this.metadataLoaded = parameters.metadataLoaded;
    this.loadError = parameters.loadError;
    if (parameters.maxTime) {
      this.maxTime = parameters.maxTime;
      if (isNaN(this.maxTime.valueOf())) throw new Error('invalid maxTime date');
    } else {
      this.maxTime = null;
    }
    this.dimensions = parameters.dimensions;
    this.measures = parameters.measures;
    this.timeAttribute = parameters.timeAttribute;
    this.defaultSortOn = parameters.defaultSortOn;
    this.executor = parameters.executor;
  }

  public valueOf(): DataSourceValue {
    var value: DataSourceValue = {
      name: this.name,
      title: this.title,
      source: this.source,
      metadataLoaded: this.metadataLoaded,
      loadError: this.loadError
    };
    if (this.maxTime) {
      value.maxTime = this.maxTime;
    }
    if (this.dimensions) {
      value.dimensions = this.dimensions;
      value.measures = this.measures;
      value.timeAttribute = this.timeAttribute;
      value.defaultSortOn = this.defaultSortOn;
    }
    if (this.executor) {
      value.executor = this.executor;
    }
    return value;
  }

  public toJS(): DataSourceJS {
    var js: DataSourceJS = {
      name: this.name,
      title: this.title,
      source: this.source
    };
    if (this.maxTime) {
      js.maxTime = this.maxTime;
    }
    if (this.dimensions) {
      js.dimensions = this.dimensions.toArray().map(dimension => dimension.toJS());
      js.measures = this.measures.toArray().map(measure => measure.toJS());
      js.timeAttribute = this.timeAttribute.name;
      js.defaultSortOn = this.defaultSortOn;
    }
    return js;
  }

  public toJSON(): DataSourceJS {
    return this.toJS();
  }

  public toString(): string {
    return `[DataSource: ${this.name}]`;
  }

  public equals(other: DataSource): boolean {
    return DataSource.isDataSource(other) &&
      this.name === other.name &&
      this.title === other.title &&
      this.source === other.source &&
      listsEqual(this.dimensions, other.dimensions) &&
      listsEqual(this.measures, other.measures) &&
      Boolean(this.timeAttribute) === Boolean(other.timeAttribute) &&
      (!this.timeAttribute || this.timeAttribute.equals(other.timeAttribute)) &&
      this.defaultSortOn === other.defaultSortOn;
  }

  public getMaxTime(): Date {
    var maxTime = this.maxTime;
    if (maxTime) return maxTime;
    return hour.ceil(new Date(), Timezone.UTC);
  }

  public getDimension(dimensionName: string): Dimension {
    dimensionName = dimensionName.toLowerCase(); // Case insensitive
    return this.dimensions.find(dimension => dimension.name.toLowerCase() === dimensionName);
  }

  public getDimensionByExpression(expression: Expression): Dimension {
    return this.dimensions.find(dimension => dimension.expression.equals(expression));
  }

  public getTimeDimension() {
    return this.getDimensionByExpression(this.timeAttribute);
  }

  public isTimeAttribute(ex: Expression) {
    var { timeAttribute } = this;
    return ex.equals(this.timeAttribute);
  }

  public getMeasure(measureName: string): Measure {
    measureName = measureName.toLowerCase(); // Case insensitive
    return this.measures.find(measure => measure.name.toLowerCase() === measureName);
  }

  public getSortMeasure(dimension: Dimension): Measure {
    var sortOn = dimension.sortOn || this.defaultSortOn;
    return this.getMeasure(sortOn);
  }

  public changeDimensions(dimensions: List<Dimension>): DataSource {
    var value = this.valueOf();
    value.dimensions = dimensions;
    return new DataSource(value);
  }

  public loadSource(): Q.Promise<DataSource> {
    var deferred = <Q.Deferred<DataSource>>Q.defer();
    if (this.metadataLoaded) throw new Error('already loaded');
    d3.json(this.source, (err, json) => {
      if (err) {

      } else {
        // Temp hack
        var secInHour = 60 * 60;
        json.forEach((d: Datum, i: number) => {
          d['time'] = new Date(Date.parse(d['time']) + (103 * i % secInHour) * 1000);
        });

        deferred.resolve(DataSource.fromDataArray(this.name, this.title, this.source, this.maxTime, json));
      }
    });
    return deferred.promise;
  }
}
check = DataSource;


text:
Explanation 5. Not every boat has a lifeboat

Did you mean: recursion?

If you enter the phrase "recursion" in Google search, Google will ask you if you meant... exactly the same phrase. This is not a mistake, but a joke of Google programmers who shows the idea of recursion which defines a function that calls itself.


text:
/**
 * Initialisation :
 * -SumoSelect
 * -Colorpicker
 * -jaxButton on save button for modal edit
 * -jaxButton on delete button for modal delete
 */
$(function(){
	//SumoSelect
	$('.sumo-select').SumoSelect();

	//Color picker
	$( ".colorpicker-red, .colorpicker-green, .colorpicker-blue" ).slider({
		orientation: "horizontal",
		range: "min",
		max: 255,
		value: 127,
		//slide: onChangeSlider,
		change: onChangeSlider
	});
	$('.color-input-color-css').change(onChangeInput);

	//jaxButton on save button for modal edit
	$('.button-save-category').jaxButton({
		url:"processing/ajax_edit_category.php",
		getData: function(dataset){
			var form_id = dataset.formId;
			var data = {
							id: $('#'+form_id+'-input-id').val(),
							name: $('#'+form_id+'-input-name').val(),
							description: $('#'+form_id+'-textarea-description').val(),
							color: $('#'+form_id+'_color-css').val()
						};
			return data;
		},
		before: function(dataset){
			noty({text: 'Saving category '+$('#'+dataset.formId+'-input-name').val(), type:'information'});
			return true;
			},
		done: function(dataset, data, textStatus, jqXHR){
			try{
				var json = jQuery.parseJSON(data);
				if(json.hasOwnProperty('errors')){
					console.log(json.errors);
					for(var i in json.errors){
						noty({text: json.errors[i], type:'error'});
					}
				}
				else{
					if(json.hasOwnProperty('redirect')){
						setTimeout(function(){
							document.location.href=json.redirect;
						},750);
					}
					if(json.hasOwnProperty('message')){
						noty({text: json.message, type:'success'});
					}
				}
			}catch(err){
				noty({text: 'Error while parsing json response: '+err, type:'error'});
			}
		}
	});

	//jaxButton on delete button for modal delete
	$('.button-delete-category').jaxButton({
		url:"processing/ajax_delete_category.php",
		getData: function(dataset){
			var form_id = dataset.formId;
			var data = {
							id: $('#'+form_id+'-input-id').val(),
							name: $('#'+form_id+'-input-name').val()
						};
			return data;
		},
		before: function(dataset){
			var form_id = dataset.formId;

				if($('#'+form_id+'-input-name').val().toLowerCase() == $('#'+form_id+'-input-confirm-name').val().toLowerCase()){
					noty({text: 'Deleting category '+$('#'+form_id+'-input-name').val(), type:'information'});
					return true;
				}
				else{
					$('#'+form_id+'-input-confirm-name').val('')
					noty({text: 'Confirmation name is incorrect', type:'warning'});
					return false;
				}

			},
		done: function(dataset, data, textStatus, jqXHR){
			try{
				var json = jQuery.parseJSON(data);
				if(json.hasOwnProperty('errors')){
					console.log(json.errors);
					for(var i in json.errors){
						noty({text: json.errors[i], type:'error'});
					}
				}
				else{
					if(json.hasOwnProperty('redirect')){
						setTimeout(function(){
							document.location.href=json.redirect;
						},750);
					}
					if(json.hasOwnProperty('message')){
						noty({text: json.message, type:'success'});
					}
				}
			}catch(err){
				noty({text: 'Error while parsing json response: '+err, type:'error'});
			}
		}
	});

});

/**
 * Slider change handler :
 * update input, select and swatch
 */
function onChangeSlider(){
	var form_id = this.id.split('_')[0];

	var red = $( "#"+form_id+"_red" ).slider( "value" ),
		green = $( "#"+form_id+"_green" ).slider( "value" ),
		blue = $( "#"+form_id+"_blue" ).slider( "value" );

	var colorHex = "#" + hexFromRGB( red, green, blue );

	if($("#"+form_id+"_color-css").val() != colorHex)
		$('#'+form_id+'_color-css').val(colorHex);

	//Try to select a suggested color if the selected color existe
	if($("#"+form_id+"_select-colorexist option[value='"+colorHex+"']").length > 0){

		if($("#"+form_id+"_select-colorexist").val() != colorHex)
			$("#"+form_id+"_select-colorexist").val(colorHex);
	}
	else{

		if($("#"+form_id+"_select-colorexist").val() != 'no-match')
			$("#"+form_id+"_select-colorexist").val('no-match');
	}

	//Update color preview
	$( "#"+form_id+"_swatch" ).css( "background-color", colorHex );

}

/**
 * Input change handler
 * Update select, slider and swatch
 */
function onChangeInput(){
	var form_id = this.id.split('_')[0];
	var colorHex = $("#"+form_id+"_color-css").val().toLowerCase();

	//Set input to lower case
	if(colorHex != $("#"+form_id+"_color-css").val())
	   $("#"+form_id+"_color-css").val(colorHex); //toLowerCase

	//update slider value
	var colorRgb = hexToRgb(colorHex);
	if(colorRgb){

		if($( "#"+form_id+"_red" ).slider( "value") != colorRgb.r)
			$( "#"+form_id+"_red" ).slider( "value", colorRgb.r );

		if($( "#"+form_id+"_green" ).slider( "value") != colorRgb.g)
			$( "#"+form_id+"_green" ).slider( "value", colorRgb.g );

		if($( "#"+form_id+"_blue" ).slider( "value") != colorRgb.b)
			$( "#"+form_id+"_blue" ).slider( "value", colorRgb.b );
	}

	//Try to select a suggested color if the selected color existe
	if($("#"+form_id+"_select-colorexist option[value='"+colorHex+"']").length > 0){

		if($("#"+form_id+"_select-colorexist").val() != colorHex)
			$("#"+form_id+"_select-colorexist").val(colorHex);
	}
	else{

		if($("#"+form_id+"_select-colorexist").val() != 'no-match')
			$("#"+form_id+"_select-colorexist").val('no-match');
	}

	//Update color preview
	$( "#"+form_id+"_swatch" ).css( "background-color", colorHex );
}

/**
 * Set the color for a form
 * Update input, slider, select and swatch
 * @param {string} colorHex "#000000"
 * @param {string} form_id
 */
function SetColorForForm(colorHex, form_id){
	colorHex = colorHex.toLowerCase();

	//Update input value
	if(colorHex != $("#"+form_id+"_color-css").val())
	   $("#"+form_id+"_color-css").val(colorHex); //toLowerCase

	//update slider value
	var colorRgb = hexToRgb(colorHex);
	if(colorRgb){

		if($( "#"+form_id+"_red" ).slider( "value") != colorRgb.r)
			$( "#"+form_id+"_red" ).slider( "value", colorRgb.r );

		if($( "#"+form_id+"_green" ).slider( "value") != colorRgb.g)
			$( "#"+form_id+"_green" ).slider( "value", colorRgb.g );

		if($( "#"+form_id+"_blue" ).slider( "value") != colorRgb.b)
			$( "#"+form_id+"_blue" ).slider( "value", colorRgb.b );
	}

	//Try to select a suggested color if the selected color existe
	if($("#"+form_id+"_select-colorexist option[value='"+colorHex+"']").length > 0){

		if($("#"+form_id+"_select-colorexist").val() != colorHex)
			$("#"+form_id+"_select-colorexist").val(colorHex);
	}
	else{

		if($("#"+form_id+"_select-colorexist").val() != 'no-match')
			$("#"+form_id+"_select-colorexist").val('no-match');
	}

	//Update color preview
	$( "#"+form_id+"_swatch" ).css( "background-color", colorHex );
}

/**
 * Select change handler
 * Update input, slider and swatch
 *
 * @param  {string} form_id
 */
function onChangeSelect(form_id){

	var colorHex = $("#"+form_id+"_select-colorexist").val().toLowerCase();

	//Update input value
	if($("#"+form_id+"_color-css").val() != colorHex)
		$("#"+form_id+"_color-css").val(colorHex);

	//update slider value
	var colorRgb = hexToRgb(colorHex);
	if(colorRgb){

		if($( "#"+form_id+"_red" ).slider( "value") != colorRgb.r)
			$( "#"+form_id+"_red" ).slider( "value", colorRgb.r );

		if($( "#"+form_id+"_green" ).slider( "value") != colorRgb.g)
			$( "#"+form_id+"_green" ).slider( "value", colorRgb.g );

		if($( "#"+form_id+"_blue" ).slider( "value") != colorRgb.b)
			$( "#"+form_id+"_blue" ).slider( "value", colorRgb.b );
	}

	//Update color preview
	$( "#"+form_id+"_swatch" ).css( "background-color", colorHex );
}

/**
 * Open the modal for a specified if and update the colorpicker values
 * @param  {string} form_id
 */
function openModalEditCategory(form_id, category_id){
	//Populate colorexist option
	if($('#'+form_id+'_select-colorexist').children().length == 0){
		$('#select-colorexist-option option').clone().appendTo('#'+form_id+'_select-colorexist');
		$('#'+form_id+'_select-colorexist').SumoSelect();
	}

	//Set color in input (which will update color in the other field)
	if(form_id == "edit-category-new"){
		//For new form, generate a random color
		colorHex = "#" + hexFromRGB(Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1);
		SetColorForForm(colorHex, form_id);
	}
	else{
		colorHex = $('#category-'+category_id+' .color-td span').html();
		SetColorForForm(colorHex, form_id);
	}

	//Open Modal
	$('#'+form_id).bPopup();
}

/**
 * Close the edit modal for the specified from
 * @param  {string} form_id
 */
function closeModalEditCategory(form_id){
	//Close modal
	$('#'+form_id).bPopup().close();
}

/**
 * Transform a color from rgb to hexadecimal value (without #)
 * @param  {mixed} r
 * @param  {mixed} g
 * @param  {mixed} b
 * @return {string}
 */
function hexFromRGB(r, g, b) {
	var hex = [
		r.toString( 16 ),
		g.toString( 16 ),
		b.toString( 16 )
	];
	$.each( hex, function( nr, val ) {
		if ( val.length === 1 ) {
			hex[ nr ] = "0" + val;
		}
	});
	return hex.join( "" ).toLowerCase();
}

/**
 * Transform a color from hexadecimal value (# optionnal, 6 value aka no ccc) to {r, g b} color
 * @param  {string} hex
 * @return {array}     {r, g, b} or null if the parameter is not a hex color
 */
function hexToRgb(hex) {
    var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
    return result ? {
        r: parseInt(result[1], 16),
        g: parseInt(result[2], 16),
        b: parseInt(result[3], 16)
    } : null;
}


text:
package com.google.cloud.security.privateca.v1.samples;

// [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_CertificatetemplateFieldmask_sync]
import com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient;
import com.google.cloud.security.privateca.v1.CertificateTemplate;
import com.google.protobuf.FieldMask;

public class SyncUpdateCertificateTemplateCertificatetemplateFieldmask {

  public static void main(String[] args) throws Exception {
    syncUpdateCertificateTemplateCertificatetemplateFieldmask();
  }

  public static void syncUpdateCertificateTemplateCertificatetemplateFieldmask() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CertificateAuthorityServiceClient certificateAuthorityServiceClient =
        CertificateAuthorityServiceClient.create()) {
      CertificateTemplate certificateTemplate = CertificateTemplate.newBuilder().build();
      FieldMask updateMask = FieldMask.newBuilder().build();
      CertificateTemplate response =
          certificateAuthorityServiceClient
              .updateCertificateTemplateAsync(certificateTemplate, updateMask)
              .get();
    }
  }
}
// [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_CertificatetemplateFieldmask_sync]