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

namespace LinqToDB.Linq.Builder
{
	using LinqToDB.Expressions;
	using SqlQuery;

	class JoinBuilder : MethodCallBuilder
	{
		protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			if (methodCall.Method.DeclaringType == typeof(LinqExtensions) || !methodCall.IsQueryable("Join", "GroupJoin"))
				return false;

			// other overload for Join
			if (!(methodCall.Arguments[2].Unwrap() is LambdaExpression lambda))
				return false;

			var body = lambda.Body.Unwrap();

			if (body.NodeType == ExpressionType.MemberInit)
			{
				var mi = (MemberInitExpression)body;
				bool throwExpr;

				if (mi.NewExpression.Arguments.Count > 0 || mi.Bindings.Count == 0)
					throwExpr = true;
				else
					throwExpr = mi.Bindings.Any(b => b.BindingType != MemberBindingType.Assignment);

				if (throwExpr)
					throw new NotSupportedException($"Explicit construction of entity type '{body.Type}' in join is not allowed.");
			}

			return true;
		}

		protected override IBuildContext BuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			var isGroup      = methodCall.Method.Name == "GroupJoin";
			var outerContext = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[0], buildInfo.SelectQuery));
			var innerContext = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[1], new SelectQuery()));

			var context  = new SubQueryContext(outerContext);
			innerContext = isGroup ? new GroupJoinSubQueryContext(innerContext) : new SubQueryContext(innerContext);

			var join = isGroup ? innerContext.SelectQuery.WeakLeftJoin() : innerContext.SelectQuery.InnerJoin();
			var sql  = context.SelectQuery;

			sql.From.Tables[0].Joins.Add(join.JoinedTable);

			var selector = (LambdaExpression)methodCall.Arguments[4].Unwrap();

			context.     SetAlias(selector.Parameters[0].Name);
			innerContext.SetAlias(selector.Parameters[1].Name);

			var outerKeyLambda = ((LambdaExpression)methodCall.Arguments[2].Unwrap());
			var innerKeyLambda = ((LambdaExpression)methodCall.Arguments[3].Unwrap());

			var outerKeySelector = outerKeyLambda.Body.Unwrap();
			var innerKeySelector = innerKeyLambda.Body.Unwrap();

			var outerParent = context.     Parent;
			var innerParent = innerContext.Parent;

			var outerKeyContext = new ExpressionContext(buildInfo.Parent, context,      outerKeyLambda);
			var innerKeyContext = new InnerKeyContext  (buildInfo.Parent, innerContext, innerKeyLambda);

			// Make join and where for the counter.
			//
			if (outerKeySelector.NodeType == ExpressionType.New)
			{
				var new1 = (NewExpression)outerKeySelector;
				var new2 = (NewExpression)innerKeySelector;

				for (var i = 0; i < new1.Arguments.Count; i++)
				{
					var arg1 = new1.Arguments[i];
					var arg2 = new2.Arguments[i];

					BuildJoin(builder, join, outerKeyContext, arg1, innerKeyContext, arg2);
				}
			}
			else if (outerKeySelector.NodeType == ExpressionType.MemberInit)
			{
				var mi1 = (MemberInitExpression)outerKeySelector;
				var mi2 = (MemberInitExpression)innerKeySelector;

				for (var i = 0; i < mi1.Bindings.Count; i++)
				{
					if (mi1.Bindings[i].Member != mi2.Bindings[i].Member)
						throw new LinqException($"List of member inits does not match for entity type '{outerKeySelector.Type}'.");

					var arg1 = ((MemberAssignment)mi1.Bindings[i]).Expression;
					var arg2 = ((MemberAssignment)mi2.Bindings[i]).Expression;

					BuildJoin(builder, join, outerKeyContext, arg1, innerKeyContext, arg2);
				}
			}
			else
			{
				BuildJoin(builder, join, outerKeyContext, outerKeySelector, innerKeyContext, innerKeySelector);
			}

			builder.ReplaceParent(outerKeyContext, outerParent);
			builder.ReplaceParent(innerKeyContext, innerParent);

			if (isGroup)
			{
				var inner = (GroupJoinSubQueryContext)innerContext;

				inner.Join               = join.JoinedTable;
				inner.GetSubQueryContext = () =>
					GetSubQueryContext(builder, methodCall, buildInfo, sql,
						innerKeyLambda, outerKeySelector, innerKeySelector, outerKeyContext);

				return new GroupJoinContext(
					buildInfo.Parent, selector, context, inner, methodCall.Arguments[1], outerKeyLambda, innerKeyLambda);
			}

			return new JoinContext(buildInfo.Parent, selector, context, innerContext)
#if DEBUG
			{
				MethodCall = methodCall
			}
#endif
				;
		}

		IBuildContext GetSubQueryContext(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo,
			SelectQuery sql,
			LambdaExpression innerKeyLambda,
			Expression outerKeySelector,
			Expression innerKeySelector,
			IBuildContext outerKeyContext)
		{
			var subQueryContext = builder.BuildSequence(new BuildInfo(buildInfo, methodCall.Arguments[1], new SelectQuery()));

			subQueryContext = new SubQueryContext(subQueryContext);

			var subQueryParent     = subQueryContext.Parent;
			var subQueryKeyContext = new ExpressionContext(buildInfo.Parent, subQueryContext, innerKeyLambda);

			// Process SubQuery.
			//
			var subQuerySql = ((SubQueryContext)subQueryContext).SelectQuery;

			// Make join and where for the counter.
			//
			if (outerKeySelector.NodeType == ExpressionType.New)
			{
				var new1 = (NewExpression)outerKeySelector;
				var new2 = (NewExpression)innerKeySelector;

				for (var i = 0; i < new1.Arguments.Count; i++)
				{
					var arg1 = new1.Arguments[i];
					var arg2 = new2.Arguments[i];

					BuildSubQueryJoin(builder, outerKeyContext, arg1, arg2, subQueryKeyContext, subQuerySql);
				}
			}
			else if (outerKeySelector.NodeType == ExpressionType.MemberInit)
			{
				var mi1 = (MemberInitExpression)outerKeySelector;
				var mi2 = (MemberInitExpression)innerKeySelector;

				for (var i = 0; i < mi1.Bindings.Count; i++)
				{
					if (mi1.Bindings[i].Member != mi2.Bindings[i].Member)
						throw new LinqException($"List of member inits does not match for entity type '{outerKeySelector.Type}'.");

					var arg1 = ((MemberAssignment)mi1.Bindings[i]).Expression;
					var arg2 = ((MemberAssignment)mi2.Bindings[i]).Expression;

					BuildSubQueryJoin(builder, outerKeyContext, arg1, arg2, subQueryKeyContext, subQuerySql);
				}
			}
			else
			{
				BuildSubQueryJoin(builder, outerKeyContext, outerKeySelector, innerKeySelector, subQueryKeyContext, subQuerySql);
			}

			builder.ReplaceParent(subQueryKeyContext, subQueryParent);

			subQuerySql.ParentSelect = sql;
			subQuerySql.Select.Columns.Clear();

			return subQueryContext;
		}

		protected override SequenceConvertInfo Convert(
			ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo, ParameterExpression param)
		{
			return null;
		}

		static void BuildJoin(
			ExpressionBuilder builder,
			SqlFromClause.Join join,
			IBuildContext outerKeyContext, Expression outerKeySelector,
			IBuildContext innerKeyContext, Expression innerKeySelector)
		{
			var predicate = builder.ConvertObjectComparison(
				ExpressionType.Equal,
				outerKeyContext, outerKeySelector,
				innerKeyContext, innerKeySelector);

			if (predicate == null)
			{
				predicate = new SqlPredicate.ExprExpr(
					builder.ConvertToSql(outerKeyContext, outerKeySelector),
					SqlPredicate.Operator.Equal,
					builder.ConvertToSql(innerKeyContext, innerKeySelector));

				predicate = builder.Convert(outerKeyContext, predicate);
			}

			join.JoinedTable.Condition.Conditions.Add(new SqlCondition(false, predicate));
		}

		static void BuildSubQueryJoin(
			ExpressionBuilder           builder,
			IBuildContext outerKeyContext, Expression  outerKeySelector,
			Expression    innerKeySelector,
			IBuildContext subQueryKeyContext, SelectQuery subQuerySelect)
		{
			var predicate = builder.ConvertObjectComparison(
				ExpressionType.Equal,
				outerKeyContext, outerKeySelector,
				subQueryKeyContext, innerKeySelector);

			if (predicate == null)
			{
				predicate = new SqlPredicate.ExprExpr(
					builder.ConvertToSql(outerKeyContext, outerKeySelector),
					SqlPredicate.Operator.Equal,
					builder.ConvertToSql(subQueryKeyContext, innerKeySelector));

				predicate = builder.Convert(outerKeyContext, predicate);
			}

			subQuerySelect.Where.SearchCondition.Conditions.Add(new SqlCondition(false, predicate));
		}

		class InnerKeyContext : ExpressionContext
		{
			public InnerKeyContext(IBuildContext parent, IBuildContext sequence, LambdaExpression lambda)
				: base(parent, sequence, lambda)
			{
			}

			public override SqlInfo[] ConvertToSql(Expression expression, int level, ConvertFlags flags)
			{
				return base
					.ConvertToSql(expression, level, flags)
					.Select(idx =>
					{
						var n = SelectQuery.Select.Add(idx.Sql);

						return new SqlInfo(idx.MemberChain)
						{
							Sql   = SelectQuery.Select.Columns[n],
							Index = n
						};
					})
					.ToArray();
			}
		}

		internal class JoinContext : SelectContext
		{
			public JoinContext(IBuildContext parent, LambdaExpression lambda, IBuildContext outerContext, IBuildContext innerContext)
				: base(parent, lambda, outerContext, innerContext)
			{
			}
		}

		internal class GroupJoinContext : JoinContext
		{
			public GroupJoinContext(
				IBuildContext            parent,
				LambdaExpression         lambda,
				IBuildContext            outerContext,
				GroupJoinSubQueryContext innerContext,
				Expression               innerExpression,
				LambdaExpression         outerKeyLambda,
				LambdaExpression         innerKeyLambda)
				: base(parent, lambda, outerContext, innerContext)
			{
				_innerExpression = innerExpression;
				_outerKeyLambda  = outerKeyLambda;
				_innerKeyLambda  = innerKeyLambda;

				innerContext.GroupJoin = this;
			}

			readonly Expression       _innerExpression;
			readonly LambdaExpression _outerKeyLambda;
			readonly LambdaExpression _innerKeyLambda;
			private  Expression       _groupExpression;

			interface IGroupJoinHelper
			{
				Expression GetGroupJoin(GroupJoinContext context);
			}

			class GroupJoinHelper<TKey,TElement> : IGroupJoinHelper
			{
				public Expression GetGroupJoin(GroupJoinContext context)
				{
					// Convert outer condition.
					//
					var outerParam = Expression.Parameter(context._outerKeyLambda.Body.Type, "o");
					var outerKey   = context._outerKeyLambda.GetBody(context.Lambda.Parameters[0]);

					outerKey = context.Builder.BuildExpression(context, outerKey, false);

					// Convert inner condition.
					//
					var parameters = context.Builder.CurrentSqlParameters
						.Select((p,i) => new { p, i })
						.ToDictionary(_ => _.p.Expression, _ => _.i);
					var paramArray = Expression.Parameter(typeof(object[]), "ps");

					var innerKey = context._innerKeyLambda.Body.Transform(e =>
					{
						if (parameters.TryGetValue(e, out var idx))
						{
							return Expression.Convert(
								Expression.ArrayIndex(paramArray, Expression.Constant(idx)),
								e.Type);
						}

						return e;
					});

					// Item reader.
					//
					var expr = Expression.Call(
						null,
						MemberHelper.MethodOf(() => Queryable.Where(null, (Expression<Func<TElement,bool>>)null)),
						context._innerExpression,
						Expression.Lambda<Func<TElement,bool>>(
							ExpressionBuilder.Equal(context.Builder.MappingSchema, innerKey, outerParam),
							new[] { context._innerKeyLambda.Parameters[0] }));

					var lambda = Expression.Lambda<Func<IDataContext,TKey,object[],IQueryable<TElement>>>(
						Expression.Convert(expr, typeof(IQueryable<TElement>)),
						Expression.Parameter(typeof(IDataContext), "ctx"),
						outerParam,
						paramArray);

					var itemReader = CompiledQuery.Compile(lambda);

					return Expression.Call(
						null,
						MemberHelper.MethodOf(() => GetGrouping(null, null, default, null)),
						new[]
						{
							ExpressionBuilder.QueryRunnerParam,
							Expression.Constant(context.Builder.CurrentSqlParameters),
							outerKey,
							Expression.Constant(itemReader),
						});
				}

				static IEnumerable<TElement> GetGrouping(
					IQueryRunner             runner,
					List<ParameterAccessor>  parameterAccessor,
					TKey                     key,
					Func<IDataContext,TKey,object[],IQueryable<TElement>> itemReader)
				{
					return new GroupByBuilder.GroupByContext.Grouping<TKey,TElement>(key, runner, parameterAccessor, itemReader);
				}
			}

			interface IGroupJoinCallHelper
			{
				Expression GetGroupJoinCall(GroupJoinContext context);
			}

			class GroupJoinCallHelper<T> : IGroupJoinCallHelper
			{
				public Expression GetGroupJoinCall(GroupJoinContext context)
				{
					var expr = Expression.Call(
						null,
						MemberHelper.MethodOf(() => Queryable.Where(null, (Expression<Func<T,bool>>)null)),
						context._innerExpression,
						Expression.Lambda<Func<T,bool>>(
							ExpressionBuilder.Equal(
								context.Builder.MappingSchema,
								context._innerKeyLambda.Body.Unwrap(),
								context._outerKeyLambda.GetBody(context.Lambda.Parameters[0])),
							new[] { context._innerKeyLambda.Parameters[0] }));

					return expr;
				}
			}

			public override Expression BuildExpression(Expression expression, int level, bool enforceServerSide)
			{
				if (ReferenceEquals(expression, Lambda.Parameters[1]))
				{
					if (_groupExpression == null)
					{
						var gtype  = typeof(GroupJoinHelper<,>).MakeGenericType(
							_innerKeyLambda.Body.Type,
							_innerKeyLambda.Parameters[0].Type);

						var helper = (IGroupJoinHelper)Activator.CreateInstance(gtype);

						_groupExpression = helper.GetGroupJoin(this);
					}

					return _groupExpression;
				}

				if (expression != null && expression.NodeType == ExpressionType.Call)
				{
					Expression replaceExpression = null;

					if (level == 0)
					{
						if (expression.Find(Lambda.Parameters[1]) != null)
							replaceExpression = Lambda.Parameters[1];
					}
					else
					{
						var levelExpression = expression.GetLevelExpression(Builder.MappingSchema, level);

						if (levelExpression.NodeType == ExpressionType.MemberAccess)
						{
							var memberExpression = GetMemberExpression(
								((MemberExpression)levelExpression).Member,
								ReferenceEquals(levelExpression, expression),
								levelExpression.Type,
								expression);

							if (memberExpression.Find(Lambda.Parameters[1]) != null)
								replaceExpression = levelExpression;
						}
					}

					if (replaceExpression != null)
					{
						var call   = (MethodCallExpression)expression;
						var gtype  = typeof(GroupJoinCallHelper<>).MakeGenericType(_innerKeyLambda.Parameters[0].Type);
						var helper = (IGroupJoinCallHelper)Activator.CreateInstance(gtype);
						var expr   = helper.GetGroupJoinCall(this);

						expr = call.Transform(e => e == replaceExpression ? expr : e);

						return Builder.BuildExpression(this, expr, enforceServerSide);
					}
				}

				return base.BuildExpression(expression, level, enforceServerSide);
			}
		}

		internal class GroupJoinSubQueryContext : SubQueryContext
		{
			public SqlJoinedTable Join;
			public SelectQuery             CounterSelect;
			public GroupJoinContext        GroupJoin;
			public Func<IBuildContext>     GetSubQueryContext;

			public GroupJoinSubQueryContext(IBuildContext subQuery)
				: base(subQuery)
			{
			}

			public override IBuildContext GetContext(Expression expression, int level, BuildInfo buildInfo)
			{
				if (expression == null)
				{
					if (buildInfo.CreateSubQuery)
					{
						Join.IsWeak = true;
						var queryBuild = GetSubQueryContext();
						//queryBuild.Parent = Context.Parent;
						return queryBuild;
					}

					return this;
				}

				return base.GetContext(expression, level, buildInfo);
			}

			public override IsExpressionResult IsExpression(Expression expression, int level, RequestFor testFlag)
			{
				if (testFlag == RequestFor.GroupJoin && expression == null)
					return IsExpressionResult.True;

				return base.IsExpression(expression, level, testFlag);
			}
		}
	}
}


text:
package aip0131

import (
	"github.com/googleapis/api-linter/lint"
	"github.com/googleapis/api-linter/rules/internal/utils"
	"github.com/jhump/protoreflect/desc"
)

var requestNameReference = &lint.FieldRule{
	Name: lint.NewRuleName(131, "request-name-reference"),
	OnlyIf: func(f *desc.FieldDescriptor) bool {
		return isGetRequestMessage(f.GetOwner()) && f.GetName() == "name"
	},
	LintField: utils.LintFieldResourceReference,
}

redpajama_set_name: RedPajamaGithub


text:
package com.quollwriter.ui;

import java.awt.Component;
import java.awt.Point;
import java.awt.Dimension;
import java.awt.event.*;
import java.awt.dnd.*;

import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;

import javax.swing.*;
import javax.swing.border.*;
import javax.swing.tree.*;

import com.quollwriter.data.*;
import com.quollwriter.*;
import com.quollwriter.ui.actionHandlers.*;
import com.quollwriter.ui.components.ActionAdapter;
import com.quollwriter.ui.components.Header;
import com.quollwriter.ui.renderers.*;
import com.quollwriter.events.*;

public class LinkedToAccordionItem extends AccordionItem
{

    private ProjectViewer projectViewer = null;
    private NamedObject object = null;
    private JTree viewTree = null;
    private JTree editTree = null;
    private Box content = null;
    private Box view = null;
    private Box edit = null;
    private JLabel noLinks = null;

    public LinkedToAccordionItem (ProjectViewer pv,
                                  NamedObject   c)
    {

        super (Environment.getUIString (LanguageStrings.linkedto,
                                        LanguageStrings.view,
                                        LanguageStrings.title),
               //"Linked to",
               Constants.LINK_ICON_NAME);

        this.object= c;
        this.projectViewer = pv;

        final LinkedToAccordionItem _this = this;

        this.viewTree = UIUtils.createLinkedToTree (this.projectViewer,
                                                    this.object,
                                                    false);

        this.viewTree.setAlignmentX (Component.LEFT_ALIGNMENT);

        this.content = new Box (BoxLayout.Y_AXIS);

        this.content.setBorder (new EmptyBorder (5, 0, 10, 0));

        this.view = new Box (BoxLayout.Y_AXIS);

        this.noLinks = UIUtils.createClickableLabel (Environment.getUIString (LanguageStrings.linkedto,
                                                                              LanguageStrings.nolinksedit),
                                                    //"<i>No Links set, click to edit.</i>",
                                                     null);

        this.noLinks.setBorder (UIUtils.createPadding (0, 5, 0, 0));

        this.noLinks.addMouseListener (new MouseEventHandler ()
        {

            @Override
            public void handlePress (MouseEvent ev)
            {

                _this.edit ();

            }

        });

        this.view.add (this.noLinks);

        this.noLinks.setVisible (this.object.getLinks ().size () == 0);

        this.view.add (this.viewTree);

        this.edit = new Box (BoxLayout.Y_AXIS);

        this.content.add (this.view);
        this.content.add (this.edit);

        this.edit.setVisible (false);

        this.editTree = UIUtils.createLinkedToTree (this.projectViewer,
                                                    this.object,
                                                    true);

        this.edit.add (this.editTree);

        this.editTree.setMaximumSize (new Dimension (Short.MAX_VALUE,
                                                       Short.MAX_VALUE));

        JButton save = UIUtils.createButton (Constants.SAVE_ICON_NAME,
                                             Constants.ICON_MENU,
                                             String.format (Environment.getUIString (LanguageStrings.linkedto,
                                                                                LanguageStrings.edit,
                                                                                LanguageStrings.buttons,
                                                                                LanguageStrings.save,
                                                                                LanguageStrings.tooltip),
                                                            Environment.getObjectTypeName (this.object)),
                                             //"Click to save the links",
                                             new ActionAdapter ()
                                             {

                                                public void actionPerformed (ActionEvent ev)
                                                {

                                                    _this.save ();

                                                }

                                             });

        JButton cancel = UIUtils.createButton (Constants.CANCEL_ICON_NAME,
                                               Constants.ICON_MENU,
                                               Environment.getUIString (LanguageStrings.linkedto,
                                                                        LanguageStrings.edit,
                                                                        LanguageStrings.buttons,
                                                                        LanguageStrings.cancel,
                                                                        LanguageStrings.tooltip),
                                               //"Click to cancel",
                                               new ActionAdapter ()
                                               {

                                                  public void actionPerformed (ActionEvent ev)
                                                  {

                                                    _this.update (_this.object);

                                                  }

                                               });

        List<JButton> buts = new ArrayList ();

        buts.add (save);
        buts.add (cancel);

        JToolBar tb = UIUtils.createButtonBar (buts);

        tb.setAlignmentX (Component.LEFT_ALIGNMENT);

        Box buttons = new Box (BoxLayout.X_AXIS);
        buttons.setAlignmentX (Component.LEFT_ALIGNMENT);
        buttons.add (Box.createHorizontalGlue ());
        buttons.add (tb);

        buttons.setBorder (new CompoundBorder (new MatteBorder (1,
                                                                0,
                                                                0,
                                                                0,
                                                                UIUtils.getColor ("#dddddd")),
                                               new EmptyBorder (3,
                                                                3,
                                                                3,
                                                                3)));

        this.edit.add (buttons);

        this.edit.setBorder (new EmptyBorder (3, 0, 0, 0));

        Header h = this.getHeader ();

        h.setBorder (new CompoundBorder (new CompoundBorder (new MatteBorder (0, 0, 1, 0, UIUtils.getBorderColor ()),
                                                             new EmptyBorder (0, 0, 3, 0)),
                                         h.getBorder ()));

    }

    public void update (NamedObject o)
    {

        this.object = o;

        this.updateTree ();

    }

    private void save ()
    {

        // Get all the link items from the tree.
        DefaultTreeModel dtm = (DefaultTreeModel) this.editTree.getModel ();

        Set s = new HashSet ();

        try
        {

            UIUtils.getSelectedObjects ((DefaultMutableTreeNode) dtm.getRoot (),
                                        this.object,
                                        s);

        } catch (Exception e)
        {

            Environment.logError ("Unable to get objects to link to for: " +
                                  this.object,
                                  e);

            UIUtils.showErrorMessage (this.projectViewer,
                                      Environment.getUIString (LanguageStrings.linkedto,
                                                               LanguageStrings.save,
                                                               LanguageStrings.actionerror));
                                      //"An internal error has occurred.\n\nUnable to add/edit object.");

            return;

        }

        // Save the links
        try
        {

            this.projectViewer.saveLinks (this.object,
                                          s);

        } catch (Exception e)
        {

            Environment.logError ("Unable to save links: " +
                                  this.object,
                                  e);

            UIUtils.showErrorMessage (this.projectViewer,
                                      Environment.getUIString (LanguageStrings.linkedto,
                                                               LanguageStrings.save,
                                                               LanguageStrings.actionerror));
                                      //"An internal error has occurred.\n\nUnable to save links.");

            return;

        }

        java.util.Set<NamedObject> otherObjects = this.object.getOtherObjectsInLinks ();

        this.projectViewer.refreshObjectPanels (otherObjects);

        this.updateTree ();

    }

    private void edit ()
    {

        if (this.edit.isVisible ())
        {

            this.save ();

            return;

        }

        this.setContentVisible (true);

        this.editTree.setModel (UIUtils.getLinkedToTreeModel (this.projectViewer,
                                                              this.object,
                                                              true));

        UIUtils.expandPathsForLinkedOtherObjects (this.editTree,
                                                  this.object);

        this.view.setVisible (false);
        this.edit.setVisible (true);
        this.getHeaderControls ().setVisible (false);

        this.validate ();
        this.repaint ();

        UIUtils.scrollIntoView (this);

    }

    public void updateTree ()
    {

        this.getHeaderControls ().setVisible (true);

        this.noLinks.setVisible (this.object.getLinks ().size () == 0);

        UIUtils.scrollIntoView (this);

        this.viewTree.setModel (UIUtils.getLinkedToTreeModel (this.projectViewer,
                                                              this.object,
                                                              false));

        UIUtils.expandAllNodesWithChildren (this.viewTree);

        this.edit.setVisible (false);
        this.view.setVisible (true);
        this.validate ();
        this.repaint ();

    }

    public JComponent getContent ()
    {

        return this.content;

    }

    @Override
    public void init ()
    {

        super.init ();

        final LinkedToAccordionItem _this = this;

        ActionListener action = new ActionAdapter ()
        {

            public void actionPerformed (ActionEvent ev)
            {

                _this.edit ();

            }

        };

        List<JButton> conts = new ArrayList ();

        conts.add (UIUtils.createButton (Constants.EDIT_ICON_NAME,
                                         Constants.ICON_SIDEBAR,
                                         String.format (Environment.getUIString (LanguageStrings.linkedto,
                                                                                LanguageStrings.view,
                                                                                LanguageStrings.buttons,
                                                                                LanguageStrings.edit,
                                                                                LanguageStrings.tooltip),
                                                        Environment.getObjectTypeName (this.object)),
                                         //"Click to edit",
                                         action));

        this.setHeaderControls (UIUtils.createButtonBar (conts));

        UIUtils.expandAllNodesWithChildren (this.viewTree);
/*
        this.setMaximumSize (new Dimension (Short.MAX_VALUE,
                                         this.getPreferredSize ().height));
  */
        //this.setMaximumSize (this.getPreferredSize ());

    }

    @Override
    public void fillHeaderPopupMenu (JPopupMenu m,
                                     MouseEvent ev)
    {

        final LinkedToAccordionItem _this = this;

        ActionListener action = new ActionAdapter ()
        {

            public void actionPerformed (ActionEvent ev)
            {

                _this.edit ();

            }

        };

        m.add (UIUtils.createMenuItem (Environment.getUIString (LanguageStrings.linkedto,
                                                                LanguageStrings.headerpopupmenu,
                                                                LanguageStrings.items,
                                                                LanguageStrings.edit),
                                                                //"Edit",
                                       Constants.EDIT_ICON_NAME,
                                       action));

    }

}


text:
* Fixed click events #65

## v1.7.6
* Fixed libxmljs fail

## v1.7.5
* Fixed html breaking

## v1.7.4
* Fixed doctype removing by the `iconizeHtml` method

## v1.7.3
* Fixed sprite multirendering (https://github.com/outpunk/grunt-evil-icons/issues/1)
* Fixed multiple icon classes (#57)

## v1.7.2
* Fixed ruby gem

## v1.7.1
* Crisp fix for non-retina screens, thanks to [@Ser-Gen]

## v1.7.0
* Added brand colors for social icons

## v1.6.0
* Added camera, Odnoklassniki, Soundcloud, Tumblr, Youtube, Vimeo and Skype icons

## v1.5.0
* Added iconizeHtml method to the NPM package

## v1.4.0
* Added credit card, like and trophy icons

## v1.3.0
* Added Linkedin and Instagram icons
* Fixed spinners animation performance (Thanks to [@legomushroom])

## v1.2.0
* Fixed cart icon
* Styles moved to assets/css.

## v1.1.0
* Sinatra support (Thanks to [@aderyabin])
* Spinners' animation improvement (Thanks to [@fliptheweb])

## v1.0.2
* Smoothed icon shapes
* Switched from svg_optimizer to svgo

## v1.0.1
* Bugfixes in npm

## v1.0.0
* First public release

[@aderyabin]:     https://github.com/aderyabin
[@fliptheweb]:    https://github.com/fliptheweb
[@legomushroom]:  https://github.com/legomushroom
[@Ser-Gen]:       https://github.com/Ser-Gen


text:
An airdrop clone

# AVATAR

Drop an image to your own bubble at the bottom. PeerDrop will persist this at `~/avatar/`

![image](https://cloud.githubusercontent.com/assets/170145/25565945/3aaed0e0-2dd1-11e7-8960-4e29b5ae6274.png)

# BUILD

## Linux

`npm run build-linux` builds deb/zip packages

### System Dependencies

#### Arch Linux

* graphicsmagick
* libicns (AUR)

## Mac

`npm run build-mac` builds app/dmg/zip packages

# RUN
To run the app, use the bin in the `node_modules` directory.

```bash
./node_modules/.bin/electron ./index.js
```

or run with nodemon to restart on changes

```bash
./node_modules/.bin/nodemon ./node_modules/.bin/electron ./index.js
```

which is also wrapped with

```bash
npm start
```


text:
package org.apache.mxnet.infer

import java.io.File
import java.nio.file.{Files, Paths}
import java.util

import org.apache.mxnet.module.Module
import org.apache.mxnet.{Context, DType, DataDesc, NDArray, Shape}
import org.mockito.Matchers._
import org.mockito.Mockito
import org.scalatest.{BeforeAndAfterAll, FunSuite}
import org.slf4j.LoggerFactory

import scala.io

class ClassifierSuite extends FunSuite with BeforeAndAfterAll {

  private val logger = LoggerFactory.getLogger(classOf[Predictor])

  var modelPath = ""

  var synFilePath = ""

  def createTempModelFiles(): Unit = {
    val tempDirPath = System.getProperty("java.io.tmpdir")
    logger.info("tempDirPath: %s".format(tempDirPath))

    val modelDirPath = tempDirPath + File.separator + "model"
    val synPath = tempDirPath + File.separator + "synset.txt"
    val synsetFile = new File(synPath)
    synsetFile.createNewFile()
    val lines: util.List[String] = util.Arrays.
      asList("class1 label1", "class2 label2", "class3 label3", "class4 label4")
    val path = Paths.get(synPath)
    Files.write(path, lines)

    this.modelPath = modelDirPath
    this.synFilePath = synsetFile.getCanonicalPath
    logger.info("modelPath: %s".format(this.modelPath))
    logger.info("synFilePath: %s".format(this.synFilePath))
  }

  override def beforeAll() {
    createTempModelFiles
  }

  override def afterAll() {
    new File(synFilePath).delete()
  }

  class MyClassyPredictor(val modelPathPrefix: String,
                          override val inputDescriptors: IndexedSeq[DataDesc])
    extends Predictor(modelPathPrefix, inputDescriptors, epoch = Some(0)) {

    override def loadModule(): Module = mockModule

    val getIDescriptor: IndexedSeq[DataDesc] = iDescriptors
    val getBatchSize: Int = batchSize
    val getBatchIndex: Int = batchIndex

    lazy val mockModule: Module = Mockito.mock(classOf[Module])
  }

  class MyClassifier(modelPathPrefix: String,
                     protected override val inputDescriptors: IndexedSeq[DataDesc])
    extends Classifier(modelPathPrefix, inputDescriptors, Context.cpu(), Some(0)) {

    override def getPredictor(): MyClassyPredictor = {
      Mockito.mock(classOf[MyClassyPredictor])
    }
    def getSynset(): IndexedSeq[String] = synset
  }

  test("ClassifierSuite-getSynsetFilePath") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val testClassifer = new MyClassifier(modelPath, inputDescriptor)

    assertResult(this.synFilePath) {
      testClassifer.synsetFilePath
    }
  }

  test("ClassifierSuite-readSynsetFile") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val testClassifer = new MyClassifier(modelPath, inputDescriptor)

    assertResult(io.Source.fromFile(this.synFilePath).getLines().toList) {
      testClassifer.getSynset()
    }
  }

  test("ClassifierSuite-flatArray-topK") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputData = Array.fill[Float](12)(1)

    val predictResult : IndexedSeq[Array[Float]] =
      IndexedSeq[Array[Float]](Array(.98f, 0.97f, 0.96f, 0.99f))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(predictResult).when(testClassifier.predictor)
      .predict(any(classOf[IndexedSeq[Array[Float]]]))

    val result: IndexedSeq[(String, Float)] = testClassifier.
          classify(IndexedSeq(inputData), topK = Some(10))

    assertResult(predictResult(0).sortBy(-_)) {
      result.map(_._2).toArray
    }

  }

  test("ClassifierSuite-flatFloat64Array-topK") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputData = Array.fill[Double](12)(1d)

    val predictResult : IndexedSeq[Array[Double]] =
      IndexedSeq[Array[Double]](Array(.98d, 0.97d, 0.96d, 0.99d))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(predictResult).when(testClassifier.predictor)
      .predict(any(classOf[IndexedSeq[Array[Double]]]))

    val result: IndexedSeq[(String, Double)] = testClassifier.
      classify(IndexedSeq(inputData), topK = Some(10))

    assert((result(0)_2).getClass == 1d.getClass)

    assertResult(predictResult(0).sortBy(-_)) {
      result.map(_._2).toArray
    }

  }

  test("ClassifierSuite-flatArrayInput") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputData = Array.fill[Float](12)(1)

    val predictResult : IndexedSeq[Array[Float]] =
      IndexedSeq[Array[Float]](Array(.98f, 0.97f, 0.96f, 0.99f))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(predictResult).when(testClassifier.predictor)
      .predict(any(classOf[IndexedSeq[Array[Float]]]))

    val result: IndexedSeq[(String, Float)] = testClassifier.
          classify(IndexedSeq(inputData))

    assertResult(predictResult(0)) {
      result.map(_._2).toArray
    }
  }

  test("ClassifierSuite-flatArrayFloat64Input") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputData = Array.fill[Double](12)(1d)

    val predictResult : IndexedSeq[Array[Double]] =
      IndexedSeq[Array[Double]](Array(.98d, 0.97d, 0.96d, 0.99d))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(predictResult).when(testClassifier.predictor)
      .predict(any(classOf[IndexedSeq[Array[Double]]]))

    val result: IndexedSeq[(String, Double)] = testClassifier.
      classify(IndexedSeq(inputData))

    assert((result(0)_2).getClass == 1d.getClass)

    assertResult(predictResult(0)) {
      result.map(_._2).toArray
    }
  }

  test("ClassifierSuite-NDArray1InputWithoutTopK") {
    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputDataShape = Shape(1, 3, 2, 2)
    val inputData = NDArray.ones(inputDataShape)
    val predictResult: IndexedSeq[Array[Float]] =
      IndexedSeq[Array[Float]](Array(.98f, 0.97f, 0.96f, 0.99f))

    val predictResultND: NDArray = NDArray.array(predictResult.flatten.toArray, Shape(1, 4))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(IndexedSeq(predictResultND)).when(testClassifier.predictor)
      .predictWithNDArray(any(classOf[IndexedSeq[NDArray]]))

    val result: IndexedSeq[IndexedSeq[(String, Float)]] = testClassifier.
          classifyWithNDArray(IndexedSeq(inputData))

    assert(predictResult.size == result.size)

    for(i <- predictResult.indices) {
      assertResult(predictResult(i)) {
        result(i).map(_._2).toArray
      }
    }
  }

  test("ClassifierSuite-NDArray3InputWithTopK") {

    val inputDescriptor = IndexedSeq[DataDesc](new DataDesc("data", Shape(2, 3, 2, 2)))
    val inputDataShape = Shape(3, 3, 2, 2)
    val inputData = NDArray.ones(inputDataShape)

    val predictResult: IndexedSeq[Array[Float]] =
      IndexedSeq[Array[Float]](Array(.98f, 0.97f, 0.96f, 0.99f),
        Array(.98f, 0.97f, 0.96f, 0.99f), Array(.98f, 0.97f, 0.96f, 0.99f))

    val predictResultND: NDArray = NDArray.array(predictResult.flatten.toArray, Shape(3, 4))

    val testClassifier = new MyClassifier(modelPath, inputDescriptor)

    Mockito.doReturn(IndexedSeq(predictResultND)).when(testClassifier.predictor)
      .predictWithNDArray(any(classOf[IndexedSeq[NDArray]]))

    val result: IndexedSeq[IndexedSeq[(String, Float)]] = testClassifier.
          classifyWithNDArray(IndexedSeq(inputData), topK = Some(10))

    assert(predictResult.size == result.size)

    for(i <- predictResult.indices) {
      assertResult(predictResult(i).sortBy(-_)) {
        result(i).map(_._2).toArray
      }
    }
  }

}


text:
@class IDEEditorArea;

@interface IDEWorkspaceWindowController : NSWindowController

@property(readonly) IDEEditorArea *editorArea;

@end


text:
/*
 * This software is distributed under BSD 3-clause license (see LICENSE file).
 *
 * Authors: Soeren Sonnenburg, Evan Shelhamer
 */

#include <shogun/lib/common.h>
#include <shogun/distance/CanberraWordDistance.h>
#include <shogun/features/Features.h>
#include <shogun/features/StringFeatures.h>
#include <shogun/io/SGIO.h>

using namespace shogun;

CanberraWordDistance::CanberraWordDistance()
: StringDistance<uint16_t>()
{
	SG_DEBUG("CCanberraWordDistance created")
}

CanberraWordDistance::CanberraWordDistance(
	const std::shared_ptr<StringFeatures<uint16_t>>& l, const std::shared_ptr<StringFeatures<uint16_t>>& r)
: StringDistance<uint16_t>()
{
	SG_DEBUG("CCanberraWordDistance created")

	init(l, r);
}

CanberraWordDistance::~CanberraWordDistance()
{
	cleanup();
}

bool CanberraWordDistance::init(std::shared_ptr<Features> l, std::shared_ptr<Features> r)
{
	return StringDistance<uint16_t>::init(l,r);
}

void CanberraWordDistance::cleanup()
{
}

float64_t CanberraWordDistance::compute(int32_t idx_a, int32_t idx_b)
{
	int32_t alen, blen;
	bool free_avec, free_bvec;

	uint16_t* avec=(std::static_pointer_cast<StringFeatures<uint16_t>>(lhs))->
		get_feature_vector(idx_a, alen, free_avec);
	uint16_t* bvec=(std::static_pointer_cast<StringFeatures<uint16_t>>(rhs))->
		get_feature_vector(idx_b, blen, free_bvec);

	float64_t result=0;

	int32_t left_idx=0;
	int32_t right_idx=0;

	while (left_idx < alen && right_idx < blen)
	{
		uint16_t sym=avec[left_idx];
		if (avec[left_idx]==bvec[right_idx])
		{
			int32_t old_left_idx=left_idx;
			int32_t old_right_idx=right_idx;

			while (left_idx< alen && avec[left_idx]==sym)
				left_idx++;

			while (right_idx< blen && bvec[right_idx]==sym)
				right_idx++;

			result +=
				Math::abs((float64_t)
					((left_idx-old_left_idx)-(right_idx-old_right_idx)))/
				((float64_t)
					((left_idx-old_left_idx) + (right_idx-old_right_idx)));
		}
		else if (avec[left_idx]<bvec[right_idx])
		{
			result++;

			while (left_idx< alen && avec[left_idx]==sym)
				left_idx++;
		}
		else
		{
			sym=bvec[right_idx];
			result++;

			while (right_idx< blen && bvec[right_idx]==sym)
				right_idx++;
		}
	}

	while (left_idx < alen)
	{
		uint16_t sym=avec[left_idx];
		result++;

		while (left_idx< alen && avec[left_idx]==sym)
			left_idx++;
	}

	while (right_idx < blen)
	{
		uint16_t sym=bvec[right_idx];
		result++;

		while (right_idx< blen && bvec[right_idx]==sym)
			right_idx++;
	}
	(std::static_pointer_cast<StringFeatures<uint16_t>>(lhs))->
		free_feature_vector(avec, idx_a, free_avec);
	(std::static_pointer_cast<StringFeatures<uint16_t>>(rhs))->
		free_feature_vector(bvec, idx_b, free_bvec);

	return result;
}


text:
package grpc_zap_test

import (
	"context"
	"time"

	"github.com/grpc-ecosystem/go-grpc-middleware"
	"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
	"github.com/grpc-ecosystem/go-grpc-middleware/tags"
	"github.com/grpc-ecosystem/go-grpc-middleware/tags/zap"
	pb_testproto "github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"google.golang.org/grpc"
)

var (
	zapLogger  *zap.Logger
	customFunc grpc_zap.CodeToLevel
)

// Initialization shows a relatively complex initialization sequence.
func Example_initialization() {
	// Shared options for the logger, with a custom gRPC code to log level function.
	opts := []grpc_zap.Option{
		grpc_zap.WithLevels(customFunc),
	}
	// Make sure that log statements internal to gRPC library are logged using the zapLogger as well.
	grpc_zap.ReplaceGrpcLogger(zapLogger)
	// Create a server, make sure we put the grpc_ctxtags context before everything else.
	_ = grpc.NewServer(
		grpc_middleware.WithUnaryServerChain(
			grpc_ctxtags.UnaryServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)),
			grpc_zap.UnaryServerInterceptor(zapLogger, opts...),
		),
		grpc_middleware.WithStreamServerChain(
			grpc_ctxtags.StreamServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)),
			grpc_zap.StreamServerInterceptor(zapLogger, opts...),
		),
	)
}

// Initialization shows an initialization sequence with the duration field generation overridden.
func Example_initializationWithDurationFieldOverride() {
	opts := []grpc_zap.Option{
		grpc_zap.WithDurationField(func(duration time.Duration) zapcore.Field {
			return zap.Int64("grpc.time_ns", duration.Nanoseconds())
		}),
	}

	_ = grpc.NewServer(
		grpc_middleware.WithUnaryServerChain(
			grpc_ctxtags.UnaryServerInterceptor(),
			grpc_zap.UnaryServerInterceptor(zapLogger, opts...),
		),
		grpc_middleware.WithStreamServerChain(
			grpc_ctxtags.StreamServerInterceptor(),
			grpc_zap.StreamServerInterceptor(zapLogger, opts...),
		),
	)
}

// Simple unary handler that adds custom fields to the requests's context. These will be used for all log statements.
func ExampleExtract_unary() {
	_ = func(ctx context.Context, ping *pb_testproto.PingRequest) (*pb_testproto.PingResponse, error) {
		// Add fields the ctxtags of the request which will be added to all extracted loggers.
		grpc_ctxtags.Extract(ctx).Set("custom_tags.string", "something").Set("custom_tags.int", 1337)

		// Extract a single request-scoped zap.Logger and log messages. (containing the grpc.xxx tags)
		l := ctx_zap.Extract(ctx)
		l.Info("some ping")
		l.Info("another ping")
		return &pb_testproto.PingResponse{Value: ping.Value}, nil
	}
}

func Example_initializationWithDecider() {
	opts := []grpc_zap.Option{
		grpc_zap.WithDecider(func(fullMethodName string, err error) bool {
			// will not log gRPC calls if it was a call to healthcheck and no error was raised
			if err == nil && fullMethodName == "foo.bar.healthcheck" {
				return false
			}

			// by default everything will be logged
			return true
		}),
	}

	_ = []grpc.ServerOption{
		grpc_middleware.WithStreamServerChain(
			grpc_ctxtags.StreamServerInterceptor(),
			grpc_zap.StreamServerInterceptor(zap.NewNop(), opts...)),
		grpc_middleware.WithUnaryServerChain(
			grpc_ctxtags.UnaryServerInterceptor(),
			grpc_zap.UnaryServerInterceptor(zap.NewNop(), opts...)),
	}
}


text:
/// <reference path="../../../../../../../../node_modules/@types/angular/index.d.ts" />
(function() {
    'use strict';

    angular.module('capacityApp')
        .controller('LabelListController', LabelListController);

    LabelListController.$inject = ['$location', 'Label', '$uibModal', '$route', '$scope', 'Paging', '$http'];

    /**
     * @param {ng.ILocationService} $location
     * @param {ng.ui.bootstrap.IModalService} $uibModal
     * @param {ng.route.IRouteService} $route
     * @constructor
     */
    function LabelListController($location, Label, $uibModal, $route, $scope, Paging, $http) {
        /* jshint validthis: true */
        var vm = this;

        vm.paging = Paging.pager();

        vm.add = add;
        vm.remove = remove;

        activate();

        function activate() {
            vm.paging.predicate = 'name';
            vm.paging.factory = Label;
            $scope.$watch('search', function() {
                vm.paging.currentPage = 1;
                vm.paging.loadData();
            });
        }

        function add() {
            $location.path('/labels/new');
        }

        function remove(label) {
            $http.get('rest/label/deletable/' + label.id).then(function(cascadeDeletes) {
                $uibModal.open({
                    templateUrl: 'appframework/controller/confirm.html',
                    controller: 'ConfirmController',
                    controllerAs: 'vm',
                    resolve: {
                        entityname: function() { return label.name; },
                        cascadeDeletes: function() { return cascadeDeletes.data; },
                        okCallback: function() {
                            return function() {
                                label.$delete(function() {
                                    $route.reload();
                                });
                            };
                        }
                    }
                });
            });
        }

    }
})();


text:
using std::swap;

RenderTarget::~RenderTarget()
{
}

RenderTarget::RenderTarget(RenderTarget&& rhs)
    : mFrameBuffer(std::move(rhs.mFrameBuffer))
    , mTexture(std::move(rhs.mTexture))
    , mRenderBuffer(std::move(rhs.mRenderBuffer))
    , mRTvao(0)
    , mRTvbo(0)
{
    swap(mRTvao, rhs.mRTvao);
    swap(mRTvbo, rhs.mRTvbo);
}

RenderTarget const& RenderTarget::operator=(RenderTarget&& rhs)
{
    free();
    mFrameBuffer = std::move(rhs.mFrameBuffer);
    mTexture = std::move(rhs.mTexture);
    mRenderBuffer = std::move(rhs.mRenderBuffer);
    swap(mRTvao, rhs.mRTvao);
    swap(mRTvbo, rhs.mRTvbo);
    return *this;
}

void RenderTarget::init(bool multisampled)
{
    mRTprog.create("../shaders/render_target/rt.vert", "../shaders/render_target/rt.frag");
    CHECK(mRTprog, "Error creating render target shader program", return;);

    if (!multisampled)
    {
        GLfloat quadVertices[] = {
            // Positions   // TexCoords
            -1.0f, 1.0f, 0.0f, 1.0f,
            -1.0f, -1.0f, 0.0f, 0.0f,
            1.0f, -1.0f, 1.0f, 0.0f,

            -1.0f, 1.0f, 0.0f, 1.0f,
            1.0f, -1.0f, 1.0f, 0.0f,
            1.0f, 1.0f, 1.0f, 1.0f
        };
        glGenVertexArrays(1, &mRTvao);
        glGenBuffers(1, &mRTvbo);
        glBindVertexArray(mRTvao);
        glBindBuffer(GL_ARRAY_BUFFER, mRTvbo);
        glBufferData(GL_ARRAY_BUFFER, sizeof(quadVertices), &quadVertices, GL_STATIC_DRAW);
        glEnableVertexAttribArray(0);
        glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (GLvoid*)0);
        glEnableVertexAttribArray(1);
        glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (GLvoid*)(2 * sizeof(GLfloat)));
        glBindVertexArray(0);
    }
}

void RenderTarget::size(glm::ivec2 const& sz, std::uint8_t multiSamples)
{
    if (!mFrameBuffer)
        mFrameBuffer.reset(new FrameBuffer);

    mTexture.reset(new Texture);
    if (multiSamples == 0)
        mTexture->create(sz.x, sz.y, InternalFormat::Color);
    else
        mTexture->createMulti(sz.x, sz.y, InternalFormat::Color, multiSamples);
    mFrameBuffer->attach(*mTexture);

    mRenderBuffer.reset(new RenderBuffer);
    if (multiSamples == 0)
        mRenderBuffer->create(sz.x, sz.y, InternalFormat::Depth);
    else
        mRenderBuffer->createMulti(sz.x, sz.y, InternalFormat::Depth, multiSamples);

    mFrameBuffer->attach(*mRenderBuffer);
    CHECK(mFrameBuffer->isComplete(), "Error: FrameBuffer is not complete", );
    mFrameBuffer->unbind();
}

void RenderTarget::draw(glm::ivec2 const& low_left, glm::ivec2 const& size)
{
    if (mRTvao)
    {
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
        mRTprog.use();
        glBindVertexArray(mRTvao);
        mTexture->active(0);
        glDrawArrays(GL_TRIANGLES, 0, 6);
        glBindVertexArray(0);
        //glDisableVertexAttribArray(0);
    }
    else // multisampled
    {
        glBindFramebuffer(GL_READ_FRAMEBUFFER, *mFrameBuffer);
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
        glBlitFramebuffer(0, 0, mTexture->size().x, mTexture->size().y, low_left.x, low_left.y, size.x, size.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);
    }
}

FrameBuffer& RenderTarget::fb()
{
    assert(mFrameBuffer && "FrameBuffer is null in RenderTarget");
    return *mFrameBuffer;
}

Texture& RenderTarget::tex()
{
    assert(mTexture && "Texture is null in RenderTarget");
    return *mTexture;
}

RenderBuffer& RenderTarget::rendbuf()
{
    assert(mRenderBuffer && "RenderBuffer is null in RenderTarget");
    return *mRenderBuffer;
}

void RenderTarget::free()
{
    mFrameBuffer.reset();
    mTexture.reset();
    mRenderBuffer.reset();
    mRTprog.free();
    if (mRTvbo)
    {
        glDeleteBuffers(1, &mRTvbo);
        mRTvbo = 0;
    }
    if (mRTvao)
    {
        glDeleteVertexArrays(1, &mRTvao);
        mRTvao = 0;
    }
}


text:
package org.relib.http.request;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.relib.http.HandleRequest;

/**
 * Handles building the response for a void {@link HandleRequest} return value.
 *
 * <p>
 * Does nothing.
 *
 * @author Troy Histed
 */
class ResponseGeneratorForVoid implements ResponseGenerator {

	/**
	 * {@inheritDoc}
	 */
	public void generateResponse(HttpServletRequest request, HttpServletResponse response, Object value) {
		// Do nothing.
	}

}


text:
if defined?(Crust)
  Crust.configure do |config|
    config.host   = ENV['COREOS_HOST']
    config.ssh    = {keys: '/home/ubuntu/.ssh/id_rsa'}
  end
end

if defined?(Git)
  class Git
    def run! cmd
      cmd
    end
    class Runner
      def run cmd
        cmd
      end
    end
  end
end


text:
<?php

/**
 * Class ActionScheduler_Store
 * @codeCoverageIgnore
 */
abstract class ActionScheduler_Store {
	const STATUS_COMPLETE = 'complete';
	const STATUS_PENDING  = 'pending';
	const STATUS_RUNNING  = 'in-progress';
	const STATUS_FAILED   = 'failed';
	const STATUS_CANCELED = 'canceled';

	/** @var ActionScheduler_Store */
	private static $store = NULL;

	/**
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date Optional Date of the first instance
	 *        to store. Otherwise uses the first date of the action's
	 *        schedule.
	 *
	 * @return string The action ID
	 */
	abstract public function save_action( ActionScheduler_Action $action, DateTime $scheduled_date = NULL );

	/**
	 * @param string $action_id
	 *
	 * @return ActionScheduler_Action
	 */
	abstract public function fetch_action( $action_id );

	/**
	 * @param string $hook
	 * @param array $params
	 * @return string ID of the next action matching the criteria
	 */
	abstract public function find_action( $hook, $params = array() );

	/**
	 * @param array $query
	 * @return array The IDs of actions matching the query
	 */
	abstract public function query_actions( $query = array() );

	/**
	 * Get a count of all actions in the store, grouped by status
	 *
	 * @return array
	 */
	abstract public function action_counts();

	/**
	 * @param string $action_id
	 */
	abstract public function cancel_action( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function delete_action( $action_id );

	/**
	 * @param string $action_id
	 *
	 * @return DateTime The date the action is schedule to run, or the date that it ran.
	 */
	abstract public function get_date( $action_id );

	/**
	 * @param int      $max_actions
	 * @param DateTime $before_date Claim only actions schedule before the given date. Defaults to now.
	 * @param array    $hooks       Claim only actions with a hook or hooks.
	 * @param string   $group       Claim only actions in the given group.
	 *
	 * @return ActionScheduler_ActionClaim
	 */
	abstract public function stake_claim( $max_actions = 10, DateTime $before_date = null, $hooks = array(), $group = '' );

	/**
	 * @return int
	 */
	abstract public function get_claim_count();

	/**
	 * @param ActionScheduler_ActionClaim $claim
	 */
	abstract public function release_claim( ActionScheduler_ActionClaim $claim );

	/**
	 * @param string $action_id
	 */
	abstract public function unclaim_action( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function mark_failure( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function log_execution( $action_id );

	/**
	 * @param string $action_id
	 */
	abstract public function mark_complete( $action_id );

	/**
	 * @param string $action_id
	 *
	 * @return string
	 */
	abstract public function get_status( $action_id );

	/**
	 * @param string $action_id
	 * @return mixed
	 */
	abstract public function get_claim_id( $action_id );

	/**
	 * @param string $claim_id
	 * @return array
	 */
	abstract public function find_actions_by_claim_id( $claim_id );

	/**
	 * @param string $comparison_operator
	 * @return string
	 */
	protected function validate_sql_comparator( $comparison_operator ) {
		if ( in_array( $comparison_operator, array('!=', '>', '>=', '<', '<=', '=') ) ) {
			return $comparison_operator;
		}
		return '=';
	}

	/**
	 * Get the time MySQL formated date/time string for an action's (next) scheduled date.
	 *
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date (optional)
	 * @return string
	 */
	protected function get_scheduled_date_string( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) {
		$next = null === $scheduled_date ? $action->get_schedule()->next() : $scheduled_date;
		if ( ! $next ) {
			throw new InvalidArgumentException( __( 'Invalid schedule. Cannot save action.', 'action-scheduler' ) );
		}
		$next->setTimezone( new DateTimeZone( 'UTC' ) );

		return $next->format( 'Y-m-d H:i:s' );
	}

	/**
	 * Get the time MySQL formated date/time string for an action's (next) scheduled date.
	 *
	 * @param ActionScheduler_Action $action
	 * @param DateTime $scheduled_date (optional)
	 * @return string
	 */
	protected function get_scheduled_date_string_local( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) {
		$next = null === $scheduled_date ? $action->get_schedule()->next() : $scheduled_date;
		if ( ! $next ) {
			throw new InvalidArgumentException( __( 'Invalid schedule. Cannot save action.', 'action-scheduler' ) );
		}

		ActionScheduler_TimezoneHelper::set_local_timezone( $next );
		return $next->format( 'Y-m-d H:i:s' );
	}

	/**
	 * @return array
	 */
	public function get_status_labels() {
		return array(
			self::STATUS_COMPLETE => __( 'Complete', 'action-scheduler' ),
			self::STATUS_PENDING  => __( 'Pending', 'action-scheduler' ),
			self::STATUS_RUNNING  => __( 'In-progress', 'action-scheduler' ),
			self::STATUS_FAILED   => __( 'Failed', 'action-scheduler' ),
			self::STATUS_CANCELED => __( 'Canceled', 'action-scheduler' ),
		);
	}

	public function init() {}

	/**
	 * @return ActionScheduler_Store
	 */
	public static function instance() {
		if ( empty(self::$store) ) {
			$class = apply_filters('action_scheduler_store_class', 'ActionScheduler_wpPostStore');
			self::$store = new $class();
		}
		return self::$store;
	}

	/**
	 * Get the site's local time.
	 *
	 * @deprecated 2.1.0
	 * @return DateTimeZone
	 */
	protected function get_local_timezone() {
		_deprecated_function( __FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()' );
		return ActionScheduler_TimezoneHelper::get_local_timezone();
	}
}


text:
package org.flowninja.webapp.collector.generic;

public class DummyTest {
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="ExDoc v0.18.3">
    <title>Annon.Configuration.Matcher – annon_api v0.16.2</title>
    <link rel="stylesheet" href="dist/app-091c05798a.css" />

<button class="sidebar-button sidebar-toggle">

  Toggle Sidebar
</button>
<button class="sidebar-button night-mode-toggle">

  Toggle Theme
</button>

        annon_api

        v0.16.2

  <form class="sidebar-search" action="search.html">
    <button type="submit" class="search-button">

    </button>
    <input name="q" type="text" id="search-list" class="search-input" placeholder="Search" aria-label="Search" autocomplete="off" />
  </form>

Pages

Modules

        annon_api v0.16.2
        Annon.Configuration.Matcher

This module is responsible for configuration lookups for each request.

              Link to this section

            Summary

      Functions

    child_spec(arg)

Returns a specification to start this module under a supervisor

    config_change(pid \\ __MODULE__)

Notifies cache adapter about configuration change

    init(config)

Initializes matcher state

    match_request(pid \\ __MODULE__, scheme, method, host, port, path)

Returns API and associated Plugins by a request parameters

    start_link(opts, name \\ __MODULE__)

              Link to this section

            Functions

      Link to this function

    child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

      Link to this function

    config_change(pid \\ __MODULE__)

Notifies cache adapter about configuration change.

      Link to this function

    init(config)

Initializes matcher state.

It accepts two options:

adapter - cache adapter.

cache_space - unique cache space key if multiple matcher processes are started.

      Link to this function

    match_request(pid \\ __MODULE__, scheme, method, host, port, path)

Returns API and associated Plugins by a request parameters.

This function receives adapter by casting GenServer and applies
match in calling process context to reduce single-process bottleneck.

Adapter should expect their match functions to be read-concurrent from other processes.

      Link to this function

    start_link(opts, name \\ __MODULE__)

            Built using
            ExDoc (v0.18.3),

            designed by
            Friedel Ziegelmayer.


text:
=========

Pure C json-based usermode (fuse) filesystem


text:
/*******************************************************************************
**  DAVE App Name : IO002       App Version: 1.0.30
**  This file is generated by DAVE, User modification to this file will be    **
**  overwritten at the next code generation.                                  **
*******************************************************************************/

/*CODE_BLOCK_BEGIN[IO002_Conf.c]*/
/*******************************************************************************
 Copyright (c) 2013, Infineon Technologies AG                                 **
 All rights reserved.                                                         **
                                                                              **
 Redistribution and use in source and binary forms, with or without           **
 modification,are permitted provided that the following conditions are met:   **
                                                                              **
 *Redistributions of source code must retain the above copyright notice,      **
 this list of conditions and the following disclaimer.                        **
 *Redistributions in binary form must reproduce the above copyright notice,   **
 this list of conditions and the following disclaimer in the documentation    **
 and/or other materials provided with the distribution.                       **
 *Neither the name of the copyright holders nor the names of its contributors **
 may be used to endorse or promote products derived from this software without**
 specific prior written permission.                                           **
                                                                              **
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"  **
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE    **
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   **
 ARE  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE   **
 LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR         **
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF         **
 SUBSTITUTE GOODS OR  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS    **
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN      **
 CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)       **
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE   **
 POSSIBILITY OF SUCH DAMAGE.                                                  **
                                                                              **
 To improve the quality of the software, users are encouraged to share        **
 modifications, enhancements or bug fixes with Infineon Technologies AG       **
 dave@infineon.com).                                                          **
                                                                              **
********************************************************************************
**                                                                            **
**                                                                            **
** PLATFORM : Infineon XMC4000/XMC1000 Series                                 **
**                                                                            **
** COMPILER : Compiler Independent                                            **
**                                                                            **
** AUTHOR   : App Developer                                                   **
**                                                                            **
** MAY BE CHANGED BY USER [yes/no]: Yes                                       **
**                                                                            **
** MODIFICATION DATE : Jan 1, 2014                                           **
**                                                                            **
**                                                                            **
*******************************************************************************/
/**
 * @file   IO002_Conf.c
 *
 * @brief  Configuration file generated based on UI settings
 *         of IO002 App
 */
/* Revision History
 * 1. Jan 2013 v1.0.12  Ported to XMC1000 Devices, MISRA errors fixed.
 * 2. Oct 2013 v1.0.24  Updated for separating static and dynamic code.
 * 3. Jan1,2014 v1.0.26 Updated the file to fix the instance removal numbering issue
 * 4. Jan06,2014 v1.0.28 Updated the issue with port 14 pad register access.
 */

/*******************************************************************************
 ** INCLUDE FILES                                                             **
 ******************************************************************************/
#include "../../inc/IO002/IO002.h"

const IO002_HandleType IO002_Handle0 = {
  .PortNr   = 2U , /* Mapped Port */
  .PortPin  = 5U,   /* Mapped Pin */
  .OMR_PS = 0U,/* omr_ps value*/
  .PDR_PD = 0U,/* pdr_pd value*/
  .HW_SEL = 0U,/* IO002_irwHWControl value */
  .IOCR_PCR = 0U,/* iocr_pcr value*/
  .IOCR_PCR2 = 4U,/* IO002_inputchardummy value*/
  .IOCR_PO = 0U,/* iocr_po value*/
  .IOCR = 0U,/* iocr_po value left shifted by 3*/
  .IOCR_OE = 0U,/* iocr_oe value*/
  .PHCR_EN = 1U,/* IO002_erwPadHysteresis value*/
  .PHCR0_MSK = PORT2_PHCR0_PH5_Msk,/*Hysteresis control 0 mask*/

  .PortRegs = (PORTS_TypeDef*)PORT2_BASE, /* Port Base Address*/

  .pdr0_ptr = 0,
  .pdr1_ptr = 0

};

const IO002_HandleType * IO002_HandleArr[IO002_NUM_INSTANCES] =
{

	&IO002_Handle0
};

/*CODE_BLOCK_END*/


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

tesseract
    4.0.0-beta.1-59-g2cc4

FCOORD Member List

This is the complete list of members for FCOORD, including all inherited members.

angle() const	FCOORD	inline

angle_from_direction(uint8_t direction)	FCOORD	static

binary_angle_plus_pi(double angle)	FCOORD	static

FCOORD()	FCOORD	inline

FCOORD(float xvalue, float yvalue)	FCOORD	inline

FCOORD(ICOORD icoord)	FCOORD	inline

from_direction(uint8_t direction)	FCOORD

length() const	FCOORD	inline

nearest_pt_on_line(const FCOORD &line_point, const FCOORD &dir_vector) const	FCOORD

normalise()	FCOORD

operator!(const FCOORD &)	FCOORD	friend

operator!=(const FCOORD &other)	FCOORD	inline

operator%(const FCOORD &, const FCOORD &)	FCOORD	friend

operator*(const FCOORD &, const FCOORD &)	FCOORD	friend

operator*(const FCOORD &, float)	FCOORD	friend

operator*(float, const FCOORD &)	FCOORD	friend

operator*=(FCOORD &, float)	FCOORD	friend

operator+(const FCOORD &, const FCOORD &)	FCOORD	friend

operator+=(FCOORD &, const FCOORD &)	FCOORD	friend

operator-(const FCOORD &)	FCOORD	friend

operator-(const FCOORD &, const FCOORD &)	FCOORD	friend

operator-=(FCOORD &, const FCOORD &)	FCOORD	friend

operator/(const FCOORD &, float)	FCOORD	friend

operator/=(FCOORD &, float)	FCOORD	friend

operator==(const FCOORD &other)	FCOORD	inline

pt_to_pt_dist(const FCOORD &pt) const	FCOORD	inline

pt_to_pt_sqdist(const FCOORD &pt) const	FCOORD	inline

rotate(const FCOORD vec)	FCOORD	inline

set_x(float xin)	FCOORD	inline

set_y(float yin)	FCOORD	inline

sqlength() const	FCOORD	inline

to_direction() const	FCOORD

unrotate(const FCOORD &vec)	FCOORD	inline

x() const	FCOORD	inline

y() const	FCOORD	inline

Generated on Wed Mar 28 2018 20:00:43 for tesseract by

     1.8.13


text:
module Lexile
  module Api
    class Books < Resource
      api_model Lexile::Book

      def show id
        response_json = @client.get( "#{Lexile.api_version}/#{ api_model.api_path }/#{id}" )
        api_model.parse( response_json )
      end

      def find( query_params )
        Lexile::Api::PageList.new( @client, api_model,  query_params ).to_results_list
        #response_json = @client.get( "#{ api_model.api_path }", query_params )
        #api_model.parse( response_json )
      end

      def find_by_isbn13 isbn13
        self.find( {"ISBN13" => isbn13 })
      end

      def find_by_title title
        self.find( {"title__contains" => title } )
      end

    end
  end
end


text:
use strict;
use CXGN::Page;
use CXGN::Page::FormattingHelpers qw / page_title_html /;

my $page = CXGN::Page->new();
$page->header();
my $title = page_title_html("Coffee Bioinformatics Lab/ National Coffee Research Center/ Chinchina Colombia");

print <<HTML;

Featured Lab

$title

CENICAFE Bioinformatics lab as of November 2006:
From Left to Right: Alvaro Gaitan and Marco Cristancho, Bioinformatics Analysts; Andres Chalarca, Carlos Orozco, and Luis Rivera, Bioinformatics developers

CENICAFE is the National Coffee Research Center located in Chinchina, Colombia. As part of its research, CENICAFE embarked in 2004 on a major project to study the genome of the species Coffea arabica and a major component of this research is the development of a Bioinformatics platform.

Our Bioinformatics group has worked in close collaboration with Dr. Lukas Mueller at Cornell University and Dr. Robin Buell at The Institute for Genomic Research-TIGR for the development of the platform. The system implemented several new tools and databases for the analysis of other organisms sequence data such as fungi and insects, based on SGN and TIGR database developments and implementation of several of their sequence analyses tools.

The Bioinformatics platform includes a Laboratory Integrated Management System (LIMS), the implementation of wEMBOSS, home-developed perl tools for data analysis, InterproScan for annotation of sequence domains, and the implementation of wBLAST and wNetBLAST among other tools available. As mentioned above, databases have been developed based on SGN and TIGR schemas for ESTs, Molecular Markers and BAC sequences storage and analysis, and the system is based on the postgresQL relational database, the use of perl scripts for the manipulation of data, the Apache Web server with the mod_perl integrated perl interpreter, and the servers run the Debian distribution of the GNU/Linux operating system.

Some of the major milestones of the coffee genome project at Cenicafe include to date (Nov 2006) the construction of over 15 coffee cDNA libraries (containing tissue specific, methyl filtrated, differential and normalized libraries), the sequencing and assembly of 50.000 ESTs, construction of an 9X coverage BAC library,  access to 80.000 BAC-end sequences, and development of coffee genome functional studies including Microarrays, Real Time-PCR and proteomics.

We are currently implementing in the system a coffee germplasm resource database developed at Cenicafe's Coffee Breeding Department, a proteomics platform, a NIRs database, a coffee map visualization system and a Microarray database.

Our group's website is available at http://bioinformatics.cenicafe.org/.

CENICAFE is carrying out the study of the genomes of three organisms: coffee (red), the coffee berry borer (black), and the fungus Beauveria bassiana (white). By studying the three genomes the whole picture of their interactions is emerging.

HTML

$page->footer();


text:
package runes

//go:generate go run generate_runes.go

type String []rune

func (xs String) String() string { return string(xs) }


text:
import React, { Component, PropTypes } from 'react';
import injectSheet from 'react-jss';
import _uniq from 'lodash/uniq';
import _without from 'lodash/without';
import Textfield from 'react-mdl/lib/Textfield';
import Button from 'react-mdl/lib/Button';
import { Chip } from 'react-mdl/lib/Chip';
import { units } from 'funong-common/lib/appConstants';
import { isQuantityInvalid, isPriceInvalid } from 'funong-common/lib/utils/validationUtils';
import { Dialog } from 'modules/common/dialog';
import styles from 'modules/common/styles';

const EMPTY = {
  name: '',
  params: [],
  unit: '',
  price: '',
  minimum: '',
};

class SpecsDialog extends Component {
  static propTypes = {
    close: PropTypes.func.isRequired,
    onSubmit: PropTypes.func.isRequired,
    spec: PropTypes.object,
    useMinimum: PropTypes.bool,
    isDefault: PropTypes.bool.isRequired,
    classes: PropTypes.object.isRequired,
  }
  constructor(props) {
    super(props);
    const { spec = EMPTY, useMinimum } = this.props;
    if (useMinimum) {
      this.state = { name: props.isDefault ? '默认' : spec.name, params: spec.params, price: spec.price.toString(), unit: spec.unit, minimum: spec.minimum.toString(), newParam: '' };
    } else {
      this.state = { name: props.isDefault ? '默认' : spec.name, params: spec.params, price: spec.price.toString(), unit: spec.unit, newParam: '' };
    }
  }
  onNewParamChanged = (e) => {
    this.setState({ newParam: e.target.value });
  }
  onNameChanged = (e) => {
    this.setState({ name: e.target.value });
  }
  onMinimumChanged = (e) => {
    this.setState({ minimum: e.target.value });
  }
  onPriceChanged = (e) => {
    this.setState({ price: e.target.value });
  }
  onUnitChanged = (unit) => {
    this.setState({ unit });
  }
  onSubmit = () => {
    const { onSubmit, useMinimum } = this.props;
    const { name, params, price, unit, minimum } = this.state;
    if (useMinimum) {
      onSubmit({ name, params, price: Number(price), unit, minimum: Number(minimum) });
    } else {
      onSubmit({ name, params, price: Number(price), unit });
    }
  }
  addSpecParam = (e) => {
    e.preventDefault();
    const newParam = this.state.newParam.trim();
    const { params } = this.state;
    this.setState({ newParam: '', params: _uniq([...params, newParam]) });
  }
  removeSpecParam = (param) => {
    const { params } = this.state;
    this.setState({ params: _without(params, param) });
  }
  render() {
    const { close, isDefault, spec, classes, useMinimum } = this.props;
    const { name, params, price, unit, minimum, newParam } = this.state;
    const error = {
      name: name.trim() === '' && '必填',
      params: params.length === 0 && '必填',
      price: isPriceInvalid(price) || null,
      unit: unit.trim() === '' && '必填',
      minimum: (useMinimum && isQuantityInvalid(minimum)) || null,
    };
    return (
      <Dialog
        show onHide={close}
        onCancel={close}
        title={spec ? '修改规格' : '新规格'}
        fixedHeight
        scrollableContent={

            {
              isDefault ?

默认
 :

                  <Textfield
                    label="名称" name="_specName" floatingLabel required
                    onChange={this.onNameChanged} value={name}
                  />

            }

              {error.params && 尚无任何参数}
              {params.map((param, i) => (<Chip key={i} onClose={() => this.removeSpecParam(param)}>{param}</Chip>))}

              <Textfield
                label="添加新规格参数" name="_specParameter" floatingLabel
                onChange={this.onNewParamChanged} value={newParam} required={!!error.params}
              />
              <Button
                colored onClick={this.addSpecParam}
                disabled={newParam.trim() === '' || params.indexOf(newParam.trim()) >= 0}
              >
                {params.indexOf(newParam.trim()) >= 0 ? '重复' : '添加'}
              </Button>

              <Textfield
                label="价格" name="_price" floatingLabel type="number" required style={{ flex: 1 }}
                onChange={this.onPriceChanged} value={price} error={price === '' ? null : error.price}
              />
              <Textfield
                label="单位" name="_unit" floatingLabel required style={{ marginLeft: 16, width: 80 }}
                onChange={(e) => { e.preventDefault(); this.onUnitChanged(e.target.value); }}
                onFocus={(e) => { e.preventDefault(); this.setState({ showUnits: true }); }}
                onBlur={(e) => { e.preventDefault(); this.setState({ showUnits: false }); }}
                value={unit}
              />

            <div className={`material-transition ${classes.params}`}>
              {units.map((u, i) => <Button key={i} colored onClick={(e) => { e.preventDefault(); this.setState({ unit: u }); }}>{u}</Button>)}

            {useMinimum && (

                <Textfield
                  label="最小批发量(金额)" name="_priceMinCount" floatingLabel type="number" required
                  onChange={this.onMinimumChanged} value={minimum} error={minimum === '' ? null : error.minimum}
                />

            )}

        }
        submit={{
          onSubmit: (e) => { e.preventDefault(); this.onSubmit(); },
          disabled: (!!error.name || !!error.params || !!error.price || !!error.unit || !!error.minimum),
        }}
      />
    );
  }
}

const layout = {
  maxWidth: '100%',
  rowGutter: 24,
};
export default injectSheet({
  title: {
    maxWidth: layout.maxWidth,
    margin: '24px auto 16px',
    display: 'flex',
    alignItems: 'center',
  },
  line: {
    marginTop: layout.rowGutter,
    display: 'flex',
    flexWrap: 'wrap',
    width: '100%',
    alignItems: 'center',
    margin: '0 auto',
    maxWidth: layout.maxWidth,
    '& > .mdl-textfield': {
      flex: 1,
    },
  },
  priceLine: {
    display: 'flex',
    width: '100%',
    justifyContent: 'center',
    alignItems: 'center',
    margin: '0 auto',
    maxWidth: layout.maxWidth,
  },
  params: {
    maxWidth: layout.maxWidth,
    overflow: 'hidden',
    display: 'flex',
    flexWrap: 'wrap',
    margin: '0 auto',
  },
  tableButtons: {
    width: 64,
    height: 24,
    '& > div': {
      display: 'inline-block',
    },
  },
  tableInlineButton: {
    position: 'relative',
    width: 32,
    height: 24,
    '& > button': {
      position: 'absolute',
      left: 0,
      top: -4,
    },
  },
})(SpecsDialog);


text:
#ifndef BOOST_PHOENIX_CORE_EXPRESSION_HPP
#define BOOST_PHOENIX_CORE_EXPRESSION_HPP

#include <boost/phoenix/core/limits.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/phoenix/core/as_actor.hpp>
#include <boost/phoenix/core/detail/expression.hpp>
#include <boost/phoenix/core/domain.hpp>
#include <boost/proto/domain.hpp>
#include <boost/proto/make_expr.hpp>
#include <boost/proto/transform/pass_through.hpp>

namespace boost { namespace phoenix
{
    template <typename Expr> struct actor;

#ifdef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
    #include <boost/phoenix/core/detail/cpp03/expression.hpp>
#else
    template <template <typename> class Actor, typename Tag, typename... A>
    struct expr_ext;

    // This filter cuts arguments of a template pack after a first void.
    // It is necessary because the interface can be used in C++03 style.
    template <typename Tag, typename... A>
    struct expr_impl;

    // Helper template. Used to store filtered argument types.
    template <typename... A>
    struct expr_arg_types {};

    template <typename Tag, typename... A>
    struct expr_impl<Tag, expr_arg_types<A...>> : expr_ext<actor, Tag, A...> {};

    template <typename Tag, typename... A, typename... T>
    struct expr_impl<Tag, expr_arg_types<A...>, void, T...> : expr_ext<actor, Tag, A...> {};

    template <typename Tag, typename... A, typename H, typename... T>
    struct expr_impl<Tag, expr_arg_types<A...>, H, T...> : expr_impl<Tag, expr_arg_types<A..., H>, T...> {};

    template <typename Tag, typename... A>
    struct expr : expr_impl<Tag, expr_arg_types<>, A...> {};

    template <template <typename> class Actor, typename Tag, typename... A>
    struct expr_ext
        : proto::transform<expr_ext<Actor, Tag, A...>, int>
    {
        typedef
            typename proto::result_of::make_expr<
                Tag
              , phoenix_default_domain //proto::basic_default_domain
              , typename proto::detail::uncvref<A>::type...
            >::type
        base_type;

        typedef Actor<base_type> type;

        typedef typename proto::nary_expr<Tag, A...>::proto_grammar proto_grammar;

        static type make(A const&... a)
        { //?? actor or Actor??
            //Actor<base_type> const e =
            actor<base_type> const e =
            {
                proto::make_expr<Tag, phoenix_default_domain>(a...)
            };
            return e;
        }

        template<typename Expr, typename State, typename Data>
        struct impl
            : proto::pass_through<expr_ext>::template impl<Expr, State, Data>
        {};

        typedef Tag proto_tag;
    };
#endif
}}

#endif


text:
package org.jhotdraw.samples.svg;

import org.jhotdraw.draw.io.InputFormat;
import org.jhotdraw.draw.io.ImageOutputFormat;
import org.jhotdraw.draw.io.ImageInputFormat;
import org.jhotdraw.io.BoundedRangeInputStream;
import java.applet.AppletContext;
import org.jhotdraw.draw.*;
import org.jhotdraw.gui.*;
import org.jhotdraw.util.*;

import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.MatteBorder;
import org.jhotdraw.samples.svg.figures.*;
import org.jhotdraw.samples.svg.io.*;
import org.jhotdraw.samples.svg.gui.*;

/**
 * This is the base class for concrete implementations of SVG drawing
 * applets.
 *

 * The base class loads and saves drawings asynchronously and handles
 * errors. The actual data transmission and the editing of drawings
 * is the responsibility of the subclasses.
 *

 * FIXME - Applet must offer to save file locally, if uploading to server
 * failed.
 *

 * FIXME - Applet must save changes locally and reload them, if the user
 * navigated out of the page and back again, without saving the changes.
 *
 * @author Werner Randelshofer
 * @version $Id: SVGApplet.java 615 2010-01-16 17:23:12Z rawcoder $
 */
public class SVGApplet extends JApplet {

    private SVGDrawingPanel drawingComponent;
    /**
     * Lazily initialized in method getVersion();
     */
    private String version;
    private long start;

    public SVGApplet() {
        setBackground(Color.WHITE);
        start = System.currentTimeMillis();
        setName("JHotDraw SVG Applet " + getClass().getPackage().getImplementationVersion());
        ((JComponent) getContentPane()).setBorder(new MatteBorder(new Insets(1, 1, 1, 1), new Color(0xa5a5a5)));
        //ResourceBundleUtil.setVerbose(true);
    }

    /**
     * Same as Applet.getParameter() but doesn't throw a
     * NullPointerException when used without an Applet context.
     */
    @Override
    public String getParameter(String name) {
        try {
            return super.getParameter(name);
        } catch (NullPointerException e) {
            return null;
        }
    }

    /**
     * Same as Applet.getParameter() but doesn't throw a
     * NullPointerException when used without an Applet context.
     */
    public String getParameter(String name, String defaultValue) {
        try {
            String value = super.getParameter(name);
            return (value == null) ? defaultValue : value;
        } catch (NullPointerException e) {
            return defaultValue;
        }
    }

    /**
     * Displays a progress indicator and then invokes loadDrawing
     * on a worker thread. Displays the drawing panel when done successfully.
     * Displays an error message when done unsuccessfully.
     *
     * @see #loadDrawing
     */
    @Override
    public final void init() {
        // set the language of the applet
        if (getParameter("Locale") != null) {
            Locale.setDefault(new Locale(getParameter("Locale")));
        }

        final ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.samples.svg.Labels");

        // Set look and feel
        // -----------------
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Throwable e) {
            // Do nothing.
            // If we can't set the desired look and feel, UIManager does
            // automaticaly the right thing for us.
        }

        // Set our own popup factory, because the one that comes with Mac OS X
        // creates translucent popups which is not useful for color selection
        // using pop menus.
        try {
            PopupFactory.setSharedInstance(new PopupFactory());
        } catch (Throwable e) {
            // If we can't set the popup factory, we have to use what is there.
        }

        // Display a progress indicator while we are loading the drawing
        // ----------------------------------------------------------
        Container c = getContentPane();
        final ProgressIndicator progress = new ProgressIndicator(
                getName(), labels.getString("progressInitializing"));
        c.add(progress);
        progress.revalidate();

        // Load the drawing using a worker thread
        // --------------------------------------
        new Worker() {

            protected Object construct() throws Exception {
                Thread t = new Thread() {

                    @Override
                    public void run() {
                        drawingComponent = createDrawingComponent();
                    }
                };
                t.start();
                progress.setNote(labels.getString("progressLoading"));
                Object drawing = loadDrawing(progress);
                progress.setNote(labels.getString("progressOpeningEditor"));
                progress.setIndeterminate(true);
                t.join();
                return drawing;
            }

            protected void done(Object result) {
                Container c = getContentPane();
                c.setLayout(new BorderLayout());
                c.removeAll();
                c.add(drawingComponent.getComponent());
                initComponents();
                if (result != null) {
                    if (result instanceof Drawing) {
                        setDrawing((Drawing) result);
                    } else if (result instanceof Throwable) {
                        setDrawing(createDrawing());
                        getDrawing().add(new SVGTextFigure(result.toString()));
                        ((Throwable) result).printStackTrace();
                    }
                }
                drawingComponent.revalidate();
            }

            protected void failed(Throwable result) {
                Container c = getContentPane();
                c.setLayout(new BorderLayout());
                c.removeAll();
                Throwable error = (Throwable) result;
                error.printStackTrace();
                String message = (error.getMessage() == null) ? error.toString() : error.getMessage();
                MessagePanel mp = new MessagePanel(
                        UIManager.getIcon("OptionPane.errorIcon"),
                        labels.getFormatted("messageLoadFailed", htmlencode(getParameter("DrawingURL")), htmlencode(message)));
                c.add(mp);
                mp.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent evt) {
                        if (evt.getActionCommand().equals("close")) {
                            close();
                        }
                    }
                });
                mp.revalidate();
            }

            protected void finished() {
                long end = System.currentTimeMillis();
                System.out.println("AbstractDrawingApplet startup latency:" + (end - start));
            }
        }.start();
    }

    /**
     * Sets the drawing on the drawing panel.
     */
    private void setDrawing(Drawing d) {
        drawingComponent.setDrawing(d);
    }

    /**
     * Gets the drawing from the drawing panel.
     */
    private Drawing getDrawing() {
        return drawingComponent.getDrawing();
    }

    /**
     * Gets the version of the applet.
     */
    public String getVersion() {
        if (version == null) {
            BufferedReader r = null;
            try {
                InputStream resource = SVGApplet.class.getResourceAsStream("version.txt");
                r = new BufferedReader(new InputStreamReader(resource, "UTF-8"));
                version = r.readLine();
            } catch (IOException e) {
                version = "unknown";
            } catch (NullPointerException e) {
                version = "unknown";
            } finally {
                if (r != null) {
                    try {
                        r.close();
                    } catch (IOException e) {
                        // suppress
                    }
                }
            }
        }
        return version;
    }

    /**
     * Returns information about the applet.
     */
    @Override
    public String getAppletInfo() {
        return getName() +
                "\nVersion " + getVersion() +
                "\n\nCopyright 1996-2010 (c) by the original authors of JHotDraw and all its contributors" +
                "\nThis software is licensed under LGPL or" +
                "\nCreative Commons 2.5 BY";
    }

    /**
     * Creates the drawing.
     */
    /**
     * Creates the drawing.
     */
    protected Drawing createDrawing() {
        DefaultDrawing drawing = new DefaultDrawing();
        drawing.addInputFormat(new SVGZInputFormat());
        drawing.addInputFormat(new ImageInputFormat(new SVGImageFigure()));
        drawing.addOutputFormat(new SVGOutputFormat());
        drawing.addOutputFormat(new SVGZOutputFormat());
        drawing.addOutputFormat(new ImageOutputFormat());
        drawing.addOutputFormat(new ImageOutputFormat("JPG", "Joint Photographics Experts Group (JPEG)", "jpg", BufferedImage.TYPE_INT_RGB));
        drawing.addOutputFormat(new ImageOutputFormat("BMP", "Windows Bitmap (BMP)", "bmp", BufferedImage.TYPE_BYTE_INDEXED));
        return drawing;
    }

    /**
     * Creates the drawing component.
     */
    protected SVGDrawingPanel createDrawingComponent() {
        SVGDrawingPanel p = new SVGDrawingPanel();
        DefaultDrawingEditor editor = new DefaultDrawingEditor();
        p.setEditor(new DefaultDrawingEditor());

        return p;
    }

    protected SVGDrawingPanel getDrawingComponent() {
        return drawingComponent;
    }

    @Override
    public String[][] getParameterInfo() {
        return new String[][]{
                    {"data", "String", "the data to be displayed by this applet."},
                    {"datafile", "URL", "an URL to a file containing the data to be displayed by this applet."}};
    }

    /**
     * Loads the drawing.
     * By convention this method is invoked on a worker thread.
     *
     * @param progress A ProgressIndicator to inform the user about the progress
     * of the operation.
     * @return The Drawing that was loaded.
     */
    protected Drawing loadDrawing(ProgressIndicator progress) throws IOException {
        Drawing drawing = createDrawing();
        if (getParameter("datafile") != null) {
            ByteArrayOutputStream buf = new ByteArrayOutputStream();
            URL url = new URL(getDocumentBase(), getParameter("datafile"));
            URLConnection uc = url.openConnection();

            // Disable caching. This ensures that we always request the
            // newest version of the drawing from the server.
            // (Note: The server still needs to set the proper HTTP caching
            // properties to prevent proxies from caching the drawing).
            if (uc instanceof HttpURLConnection) {
                ((HttpURLConnection) uc).setUseCaches(false);
            }

            // Read the data into a buffer
            int contentLength = uc.getContentLength();
            InputStream in = uc.getInputStream();
            try {
                if (contentLength != -1) {
                    in = new BoundedRangeInputStream(in);
                    ((BoundedRangeInputStream) in).setMaximum(contentLength + 1);
                    progress.setProgressModel((BoundedRangeModel) in);
                    progress.setIndeterminate(false);
                }
                BufferedInputStream bin = new BufferedInputStream(in);
                bin.mark(512);

                // Read the data using all supported input formats
                // until we succeed
                final ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.samples.svg.Labels");
                IOException formatException = null;
                for (InputFormat format : drawing.getInputFormats()) {
                    try {
                        bin.reset();
                    } catch (IOException e) {
                        uc = url.openConnection();
                        in = uc.getInputStream();
                        in = new BoundedRangeInputStream(in);
                        ((BoundedRangeInputStream) in).setMaximum(contentLength + 1);
                        progress.setProgressModel((BoundedRangeModel) in);
                        bin = new BufferedInputStream(in);
                        bin.mark(512);
                    }
                    try {
                        bin.reset();
                        format.read(bin, drawing, true);
                        formatException = null;
                        break;
                    } catch (IOException e) {
                        formatException = e;
                    }
                }
                if (formatException != null) {
                    throw formatException;
                }
            } finally {
                in.close();
            }
        }
        return drawing;
    }

    /**
     * Closes the applet. This method can be implemented by invoking
     * getAppletContext().showDocument(...).
     */
    protected void close() {
        AppletContext appletContext;
        try {
            appletContext = getAppletContext();
        } catch (Throwable e) {
            appletContext = null;
        }

        if (appletContext == null) {
            System.exit(0);
        } else {
            try {
                appletContext.showDocument(new URL(getDocumentBase(), getParameter("PageURL")));
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
            }

        }
    }

    /**
     * Escapes all '<', '>' and '&' characters in a string.
     * @param str A String.
     * @return HTMlEncoded String.
     */
    private static String htmlencode(String str) {
        if (str == null) {
            return "";
        } else {
            StringBuilder buf = new StringBuilder();
            for (char ch : str.toCharArray()) {
                switch (ch) {
                    case '<':
                        buf.append("<");
                        break;

                    case '>':
                        buf.append(">");
                        break;

                    case '&':
                        buf.append("&");
                        break;

                    default:

                        buf.append(ch);
                        break;

                }

            }
            return buf.toString();
        }

    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                JFrame f = new JFrame("JHotDraw SVG Sample Applet");
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                SVGApplet a = new SVGApplet();
                f.getContentPane().add(a);
                a.init();
                f.setSize(500, 300);
                f.setVisible(true);
                a.start();
            }
        });
    }

    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Inicio extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->library('tmdb');
    }

    public function index()
    {
        $data_view['result'] = $this->tmdb->search_people('Arnold Schwarzenegger');
        $this->load->view('inicio/index.php', $data_view);
    }

}