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

namespace NArray.DeferredExecution.Expressions
{
    public class ScaleOffsetExpression : UnaryMathsExpression
    {
        public new readonly VectorParameterExpression Operand;
        public readonly double Scale;
        public readonly double Offset;

        internal ScaleOffsetExpression(VectorParameterExpression operand, double scale, double offset)
            : base(UnaryElementWiseOperations.ScaleOffset, operand)
        {
            Operand = operand;
            Scale = scale;
            Offset = offset;
        }

        internal override string Prototype()
        {
            if (Offset == 0) return Scale.ToString() + " * {0}";
            else if (Scale == 1) return Offset.ToString() + " + {0}";
            else return Offset.ToString() + " + " + Scale.ToString() + " * {0}";
        }
    }
}


text:
'use strict';

/**
 * Seeds data to database upon migration.
 * @param {sequelize} db - the injected Sequelize instance.
 * @param {object} types - the injected Sequelize DataTypes.
 * @param {Chance} chance - chance utility for generating seed data.
 */
module.exports = function (db, types, chance) {

   // see "seed.example.js" in seeds directory for basic usage.

};

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AccidentalFish.ApplicationSupport.Azure;
using AccidentalFish.ApplicationSupport.Core;
using AccidentalFish.ApplicationSupport.Core.BackoffProcesses;
using AccidentalFish.ApplicationSupport.Core.Components;
using AccidentalFish.ApplicationSupport.Core.Logging;
using AccidentalFish.ApplicationSupport.Core.Policies;
using AccidentalFish.ApplicationSupport.Core.Queues;
using AccidentalFish.ApplicationSupport.DependencyResolver;
using AccidentalFish.ApplicationSupport.Unity;
using Microsoft.Practices.Unity;

namespace BackoffQueueProcessorSample
{
    public class SampleQueueMessage
    {
        public string Text { get; set; }
    }

    class Program
    {
        public const string StorageAccountConnectionString = "UseDevelopmentStorage=true;";
        public const string QueueName = "backoffqueueprocessorsamplequeue";

        static void Main(string[] args)
        {
            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

            // Set up dependencies
            IUnityContainer unityContainer = new UnityContainer();
            IDependencyResolver resolver = new UnityApplicationFrameworkDependencyResolver(unityContainer);
            resolver.UseCore(defaultTraceLoggerMinimumLogLevel: LogLevelEnum.Verbose).UseAzure();

            // Normally these would be injected by the container
            IAzureResourceManager azureResourceManager = resolver.Resolve<IAzureResourceManager>();
            IAsynchronousBackoffPolicy backoffPolicy = resolver.Resolve<IAsynchronousBackoffPolicy>();
            IQueueFactory queueFactory = resolver.Resolve<IQueueFactory>();
            ILoggerFactory loggerFactory = resolver.Resolve<ILoggerFactory>();
            Processor processor = new Processor(backoffPolicy, queueFactory, loggerFactory);

            // Drop some queue items on

            IQueue<SampleQueueMessage> queue = queueFactory.CreateQueue<SampleQueueMessage>(StorageAccountConnectionString, QueueName);
            azureResourceManager.CreateIfNotExists(queue);
            for (int counter = 0; counter < 200; counter++)
            {
                queue.Enqueue(new SampleQueueMessage
                {
                    Text = $"Message {counter}"
                });
            }

            // Start the processor - in a worker role / service this would often be hosted in the ComponentHost (see sample).
            Task.Run(async () => await processor.StartAsync(cancellationTokenSource.Token));

            Console.ReadLine();
            cancellationTokenSource.Cancel();
            Thread.Sleep(TimeSpan.FromMilliseconds(1000));
        }
    }

    public class Processor : BackoffQueueProcessor<SampleQueueMessage>
    {
        private readonly Random _random = new Random();

        public Processor(
            IAsynchronousBackoffPolicy backoffPolicy,
            IQueueFactory queueFactory,
            ILoggerFactory loggerFactory) :
                base(backoffPolicy,
                    queueFactory.CreateAsynchronousQueue<SampleQueueMessage>(Program.StorageAccountConnectionString,
                        Program.QueueName),
                    loggerFactory.CreateLogger())
        {

        }

        protected override async Task<bool> HandleRecievedItemAsync(IQueueItem<SampleQueueMessage> message)
        {
            SampleQueueMessage item = message.Item;
            if (_random.Next(100) < 10)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(500));
                Console.WriteLine("Abandoning queue message - will be placed back on queue");
                return false;
            }

            Console.WriteLine($"Processed queue message {item.Text}");
            return true;
        }

        public override IComponentIdentity ComponentIdentity => new ComponentIdentity("sample.queueprocessor");
    }
}


text:
<?php

namespace NetteDateTimeFields;

use NetteDateTimeFields\Controls;

use Nette\DI;
use Nette\PhpGenerator;
use Nette\Forms\Container;

if (!class_exists('Nette\DI\CompilerExtension')) {
    class_alias('Nette\Config\CompilerExtension', 'Nette\DI\CompilerExtension');
}
if (!class_exists('Nette\PhpGenerator\ClassType')) {
    class_alias('Nette\Utils\PhpGenerator\ClassType', 'Nette\PhpGenerator\ClassType');
}

/**
 * Compiler extension for date and time inputs
 *
 * @author Livio Ribeiro
 * @version 1.0
 * @link http://github.com/livioribeiro/NetteDateTimeFields
 */
class DateTimeFormExtension extends DI\CompilerExtension
{
    public function afterCompile(PhpGenerator\ClassType $class) {
        $initialize = $class->methods['initialize'];
        $initialize->addBody('\NetteDateTimeFields\DateTimeFormExtension::register();');
    }

    public static function register() {
        Container::extensionMethod('addDate', function (Container $container, $name, $label = NULL, $format = NULL, $html5 = FALSE) {
            return $container[$name] = new Controls\DateInput($label, $format, $html5);
        });
        Container::extensionMethod('addTime', function (Container $container, $name, $label = NULL, $format = NULL, $html5 = FALSE) {
            return $container[$name] = new Controls\TimeInput($label, $format, $html5);
        });
        Container::extensionMethod('addDateTime', function (Container $container, $name, $label = NULL, $dateFormat = NULL, $timeFormat = NULL, $separator = NULL, $html5 = FALSE) {
            return $container[$name] = new Controls\DateTimeInput($label, $dateFormat, $timeFormat, $separator, $html5);
        });
    }
}


text:
import unittest

import pickle

import eigen as e3
import sva

class TestSVAPickle(unittest.TestCase):
  def test(self):
    # register custom pickle function
    sva.copy_reg_pickle()

    mv = sva.MotionVecd(e3.Vector6d.Random())
    fv = sva.ForceVecd(e3.Vector6d.Random())
    pt = sva.PTransformd(e3.Quaterniond(e3.Vector4d.Random().normalized()),
                                        e3.Vector3d.Random())
    rb = sva.RBInertiad(3., e3.Vector3d.Random(), e3.Matrix3d.Random())
    ab = sva.ABInertiad(e3.Matrix3d.Random(), e3.Matrix3d.Random(),
                        e3.Matrix3d.Random())

    def test_pickle(v):
      pickled = pickle.dumps(v)
      v2 = pickle.loads(pickled)
      self.assertEqual(v, v2)

    test_pickle(mv)
    test_pickle(fv)
    test_pickle(pt)
    test_pickle(rb)
    test_pickle(ab)


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Web Cinema VR</title>
	<link rel="stylesheet" href="css/style.css">

VR Mode


text:
using Supido.Business.Security;
using Supido.Demo.Model;
using Supido.Demo.Service.DTO;
using System.Linq;
using Telerik.OpenAccess;

namespace Supido.Demo.Service.Security
{
    /// <summary>
    /// Class for the security manager
    /// </summary>
    public class SecurityManager : BaseSecurityManager
    {
        #region - constructors -

        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityManager"/> class.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        public SecurityManager()
            : base(typeof(EntitiesModel), typeof(UserDto), typeof(User))
        {
        }

        #endregion

        #region - Methods from BaseSecurityManager -

        /// <summary>
        /// Gets a user by login and password.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="login">The login.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        protected override object GetUserByLoginPass(OpenAccessContext context, string login, string password)
        {
            return context.GetAll<User>().Where(p => p.Email == login && p.Password == password).FirstOrDefault();
        }

        /// <summary>
        /// Gets the user by identifier.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        protected override object GetUserById(OpenAccessContext context, long userId)
        {
            return context.GetAll<User>().Where(p => p.UserId == userId).FirstOrDefault();
        }

        #endregion
    }
}


text:
@import url('https://fonts.googleapis.com/css?family=Noto+Sans');
/**
 * Do not use earlyaccess/*.css. They don't work locally (no scheme, just // in the .css files)
@import url(http://fonts.googleapis.com/earlyaccess/notosansdevanagari.css);
 * Only use the fonts when they graduate up to fonts.googleapis.com/
 * Noto Sans includes Devanagari, so no need to include that.

.c-output textarea {
  font-family:
    "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Gujarati", "Noto Sans",
    ...
    }
*/

/* Loading local fonts */
@font-face {
  font-family: "MarathiCursiveG";
  src: url("MarathiCursiveG.ttf");
}

@font-face {
  font-family: "Sampradaya";
  src: url("Sampradaya.ttf");
}

.c-output textarea {
  font-family:
    /* "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Gujarati", */
    "Noto Sans", sans-serif,
    "Sampradaya", /* Grantha */
    /* Modi script: put this last, otherwise it is used for other scripts too */
    "MarathiCursiveG"; /* Modi */
  background-color: transparent;
}

.c-input textarea,
.c-output textarea {
  padding: 0.3em; font-size: 1.2em;
  width: 100%;
  height: 11em;
}

.c-output, /* parent that holds the language select dropdown and itrans-output box */
.c-input,
#data-file-form {
  margin-top: 2em; margin-bottom: 1em; padding: 0.5em;
  display: block;
  width: 100%;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
  box-sizing: border-box;
  border-top: 1px dotted;
  border-bottom: 1px dotted;
}
form#i-data {
  margin-top: 5px; margin-bottom: 5px; padding: 0.5em;
  box-sizing: border-box;
  border: 1px dotted;
}

form#i-data label,
form#i-data button {
  margin-left: 1em;
}

.c-hide {
  /* hide this element - input file type, mostly */
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

#i-data-msg {
  color: #600;
  margin-top: 2px; margin-bottom: 2px; padding: 0.5em;
  box-sizing: border-box; border-width: 1px; border-style: dotted;
}

label {padding: 0 1em 0 0; }

label, select { display: inline-block; vertical-align: middle; }

/*
  <button id="..." class="copy-button u-pull-right" type="button">
    <img class="copy-icon" src="images/copy-icon.svg" alt="Copy" title="Copy"/>
  Need src in HTML to have alt and title display correctly
  so don't mention copy-icon.svg in this CSS class.
*/
.copy-button {
  padding: 0;
  border: 0;
}
.copy-icon {
  height: 30px;
  width: 30px;
}

body {
  background-image: url("/images/smil_d3.gif");
}

/* override the padding from skeleton pacakage to have examples cells look tighter */
.i-example-table th,
.i-example-table td {
  padding: 0;
}

/* Later, TODO, if needed:
:lang(sa) {
  font-family: "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans", sans-serif;
}

:lang(ta) {
  font-family: "Noto Sans Tamil", "Noto Sans", sans-serif;
}
*/


text:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "{{site.google_ad_client}}",
    enable_page_level_ads: true
  });
</script>

  <!-- Adsense automatic ad -->
  <script data-ad-client="{{site.google_ad_client}}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.compute.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionUpdateProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Describes a Virtual Machine Extension. */
@Fluent
public final class VirtualMachineExtensionUpdate extends UpdateResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionUpdate.class);

    /*
     * Describes the properties of a Virtual Machine Extension.
     */
    @JsonProperty(value = "properties")
    private VirtualMachineExtensionUpdateProperties innerProperties;

    /**
     * Get the innerProperties property: Describes the properties of a Virtual Machine Extension.
     *
     * @return the innerProperties value.
     */
    private VirtualMachineExtensionUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualMachineExtensionUpdate withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension
     * configuration has not changed.
     *
     * @return the forceUpdateTag value.
     */
    public String forceUpdateTag() {
        return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag();
    }

    /**
     * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension
     * configuration has not changed.
     *
     * @param forceUpdateTag the forceUpdateTag value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withForceUpdateTag(forceUpdateTag);
        return this;
    }

    /**
     * Get the publisher property: The name of the extension handler publisher.
     *
     * @return the publisher value.
     */
    public String publisher() {
        return this.innerProperties() == null ? null : this.innerProperties().publisher();
    }

    /**
     * Set the publisher property: The name of the extension handler publisher.
     *
     * @param publisher the publisher value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withPublisher(String publisher) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withPublisher(publisher);
        return this;
    }

    /**
     * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension".
     *
     * @return the type value.
     */
    public String type() {
        return this.innerProperties() == null ? null : this.innerProperties().type();
    }

    /**
     * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension".
     *
     * @param type the type value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withType(String type) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withType(type);
        return this;
    }

    /**
     * Get the typeHandlerVersion property: Specifies the version of the script handler.
     *
     * @return the typeHandlerVersion value.
     */
    public String typeHandlerVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion();
    }

    /**
     * Set the typeHandlerVersion property: Specifies the version of the script handler.
     *
     * @param typeHandlerVersion the typeHandlerVersion value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withTypeHandlerVersion(typeHandlerVersion);
        return this;
    }

    /**
     * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
     * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
     * redeployed, even with this property set to true.
     *
     * @return the autoUpgradeMinorVersion value.
     */
    public Boolean autoUpgradeMinorVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion();
    }

    /**
     * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
     * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
     * redeployed, even with this property set to true.
     *
     * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion);
        return this;
    }

    /**
     * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the
     * platform if there is a newer version of the extension available.
     *
     * @return the enableAutomaticUpgrade value.
     */
    public Boolean enableAutomaticUpgrade() {
        return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade();
    }

    /**
     * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the
     * platform if there is a newer version of the extension available.
     *
     * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade);
        return this;
    }

    /**
     * Get the settings property: Json formatted public settings for the extension.
     *
     * @return the settings value.
     */
    public Object settings() {
        return this.innerProperties() == null ? null : this.innerProperties().settings();
    }

    /**
     * Set the settings property: Json formatted public settings for the extension.
     *
     * @param settings the settings value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withSettings(Object settings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withSettings(settings);
        return this;
    }

    /**
     * Get the protectedSettings property: The extension can contain either protectedSettings or
     * protectedSettingsFromKeyVault or no protected settings at all.
     *
     * @return the protectedSettings value.
     */
    public Object protectedSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().protectedSettings();
    }

    /**
     * Set the protectedSettings property: The extension can contain either protectedSettings or
     * protectedSettingsFromKeyVault or no protected settings at all.
     *
     * @param protectedSettings the protectedSettings value to set.
     * @return the VirtualMachineExtensionUpdate object itself.
     */
    public VirtualMachineExtensionUpdate withProtectedSettings(Object protectedSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualMachineExtensionUpdateProperties();
        }
        this.innerProperties().withProtectedSettings(protectedSettings);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}


text:
package com.abbcc.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;
import net.sf.json.JSONSerializer;
import net.sf.json.JsonConfig;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.abbcc.common.CommonConst;
import com.abbcc.dao.CategoryDAO;
import com.abbcc.dao.GroupLaymodDao;
import com.abbcc.dao.GroupLayoutDao;
import com.abbcc.dao.GroupLaythemeDao;
import com.abbcc.dao.GroupNavigatorDao;
import com.abbcc.dao.GroupUserdefinedDao;
import com.abbcc.dao.GroupWidthDao;
import com.abbcc.dao.ProductDAO;
import com.abbcc.models.AbcCategory;
import com.abbcc.models.AbcProduct;
import com.abbcc.models.AbcUser;
import com.abbcc.models.GroupLaymod;
import com.abbcc.models.GroupLayout;
import com.abbcc.models.GroupLaytheme;
import com.abbcc.models.GroupNavigator;
import com.abbcc.models.GroupUserdefined;
import com.abbcc.models.GroupWidth;
import com.abbcc.service.GroupLayoutService;
import com.abbcc.springrest.controller.user.site.LayoutController;
import com.abbcc.util.StringUtil;

@Service
public class GroupLayoutServiceImpl extends
		ServiceImpl<GroupLayout, GroupLayoutDao> implements GroupLayoutService {

	@Autowired
	private GroupLaythemeDao groupLaythemeDao;
	@Autowired
	private CategoryDAO categoryDAO;
	@Autowired
	private ProductDAO productDAO;
	@Autowired
	private GroupNavigatorDao navigatorDao;
	@Autowired
	private GroupLaymodDao groupLaymodDao;
	@Autowired
	private GroupWidthDao groupWidthDao;
	@Autowired
	private GroupUserdefinedDao userDefineDao;

	/**  **/
	private Map<String, String> categoryneIdMap;

	/**
	 * 恢复布局
	 */
	@Override
	public void revertLayout(AbcUser user) {
		delLayout(user.getEnterpriseId());
		this.initLayout(user);
	}

	@Override
	public void initLay(AbcUser user) {
		GroupLayout example = new GroupLayout();
		example.setEnterpriseId(user.getEnterpriseId());
		List<GroupLayout> list = dao.findByExample(example);
		if (list.isEmpty()) {
			initLayout(user);
		}
	}

	private void initLayout(AbcUser user) {
		GroupLayout layout = new GroupLayout();
		layout.setEnterpriseId(user.getEnterpriseId());
		layout.setUserId(user.getUserId());
		layout.setCreateTime(new Date());
		layout.setState(CommonConst.STATENORMAL);

		List<GroupLaymod> list = new ArrayList<GroupLaymod>();
		// String path = ServletActionContext.getServletContext().getRealPath(
		// "WEB-INF/classes/deploy/grouplayoutmodules");
		String path = CommonConst.CLASSPATH + "deploy/grouplayoutmodules";
		String initStr = StringUtil.readFromFile(path);
		JSONArray jsonArray = JSONArray.fromObject(initStr);
		JsonConfig jsonConfig = new JsonConfig();
		jsonConfig.setArrayMode(JsonConfig.MODE_OBJECT_ARRAY);
		jsonConfig.setRootClass(GroupLaymod.class);
		GroupLaymod[] lays = (GroupLaymod[]) JSONSerializer.toJava(jsonArray,
				jsonConfig);
		for (GroupLaymod a : lays) {
			a.setLayout(layout);
			list.add(a);
		}
		groupLaymodDao.saveOrUpdateAll(list);
		dao.save(layout);
		initWidth(layout.getLayoutId());
	}

	/**
	 * 列宽
	 */
	private void initWidth(String layoutId) {
		List<GroupWidth> list = new ArrayList<GroupWidth>();
		String path = CommonConst.CLASSPATH + "deploy/groupwidth";
		String initStr = StringUtil.readFromFile(path);
		JSONArray jsonArray = JSONArray.fromObject(initStr);
		JsonConfig jsonConfig = new JsonConfig();
		jsonConfig.setArrayMode(JsonConfig.MODE_OBJECT_ARRAY);
		jsonConfig.setRootClass(GroupWidth.class);
		GroupWidth[] widths = (GroupWidth[]) JSONSerializer.toJava(jsonArray,
				jsonConfig);
		for (GroupWidth a : widths) {
			a.setLayoutId(layoutId);
			list.add(a);
		}
		groupWidthDao.saveOrUpdateAll(list);
	}

	@Override
	public void initNav(AbcUser user) {
		GroupNavigator example = new GroupNavigator();
		example.setEnterpriseId(user.getEnterpriseId());
		List<GroupNavigator> list = navigatorDao.findByExample(example);
		if (list.isEmpty()) {
			initNavigator(user);
		}
	}

	private void initNavigator(AbcUser user) {
		String enterpriseId = user.getEnterpriseId();
		List<GroupNavigator> list = new ArrayList<GroupNavigator>();
		// String path = ServletActionContext.getServletContext().getRealPath(
		// "WEB-INF/classes/deploy/groupnavigator");
		String path = CommonConst.CLASSPATH + "deploy/groupnavigator";
		String initStr = StringUtil.readFromFile(path);
		JSONArray jsonArray = JSONArray.fromObject(initStr);
		JsonConfig jsonConfig = new JsonConfig();
		jsonConfig.setArrayMode(JsonConfig.MODE_OBJECT_ARRAY);
		jsonConfig.setRootClass(GroupNavigator.class);
		GroupNavigator[] navs = (GroupNavigator[]) JSONSerializer.toJava(
				jsonArray, jsonConfig);
		for (GroupNavigator n : navs) {
			n.setEnterpriseId(enterpriseId); // 设置企业标识
			list.add(n);
		}
		navigatorDao.saveOrUpdateAll(list);
	}

	/**
	 * 覆盖布局
	 */
	@Override
	public void layover(GroupLayout layout, List<GroupLaytheme> themeList) {
		this.delLayout(layout.getEnterpriseId());
		dao.save(layout);
		for (GroupLaytheme e : themeList) {
			e.setLayoutId(layout.getLayoutId());
		}
		groupLaythemeDao.saveOrUpdateAll(themeList);
	}

	/**
	 * 覆盖分类与产品信息
	 *
	 * @param categoryList
	 */
	@Override
	public void layoverCategoryAndProduct(List<AbcCategory> categoryList,
			List<AbcProduct> productList) {
		this.delCategoryAndProduct(categoryList.get(0).getEnterpriseId());
		categoryneIdMap = new HashMap<String, String>();
		for (AbcCategory cate : categoryList) {
			String oldId = cate.getCategoryId();
			cate.setCategoryId(null);
			categoryDAO.save(cate);
			String categoryId = cate.getCategoryId(); // 获得生成的标识
			categoryneIdMap.put(oldId, categoryId); // 放入键值对
		}
		for (AbcCategory cate : categoryList) {
			String belongId = cate.getBelongId();
			String newBelongId = categoryneIdMap.get(belongId);
			if (newBelongId != null) {
				cate.setBelongId(newBelongId);
				categoryDAO.update(cate);
			}
		}
		List<String> proudctIdList = new ArrayList<String>();
		for (AbcProduct p : productList) {
			String old = p.getCategory();
			proudctIdList.add(p.getProductId());
			p.setProductId(null);
			p.setCategory(categoryneIdMap.get(old)); // 设置新的类别ID
		}
		productDAO.saveOrUpdateAll(productList);
		this.delAttachRecord(proudctIdList);
	}

	private void delCategoryAndProduct(String enterpriseId) {
		productDAO.bulkUpdate("DELETE FROM AbcProduct WHERE enterpriseId=?",
				enterpriseId);
		categoryDAO.bulkUpdate("DELETE FROM AbcCategory WHERE enterpriseId=?",
				enterpriseId);
	}

	/**
	 * 删除布局
	 *
	 * @param enterpriseId
	 */
	private void delLayout(String enterpriseId) {
		String layoutId = null;
		GroupLayout layout = null;
		GroupLayout example = new GroupLayout();
		example.setEnterpriseId(enterpriseId);
		example.setState(CommonConst.STATENORMAL);
		List<GroupLayout> list = dao.findByExample(example);
		if (!list.isEmpty()) {
			layout = list.get(0);
		}
		if (layout != null) {
			layoutId = layout.getLayoutId();
			dao.bulkUpdate("DELETE FROM GroupLaytheme WHERE layoutId=?",
					layoutId);
			dao.bulkUpdate("DELETE FROM GroupLaymod WHERE layout.layoutId=?",
					layoutId);
			dao.bulkUpdate("DELETE FROM GroupWidth WHERE layoutId=?", layoutId);
			dao.delete(layout);
		}
	}

	private void delAttachRecord(List<String> belongIdList) {
		// 用productDAO,删除attachement记录
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < belongIdList.size(); i++) {
			sb.append("?").append(",");
		}
		if (sb.length() > 0) {
			sb.deleteCharAt(sb.lastIndexOf(","));
		}
		productDAO.bulkUpdate("DELETE FROM AbcAttachment WHERE belongId IN ("
				+ sb.toString() + ")", belongIdList.toArray());
	}

	@Override
	public void cascadeSave(LayoutController handle) {
		// TODO Auto-generated method stub
		GroupLayout gl = handle.getModel();
		gl.setUpdateTime(new Date());
		dao.update(gl);
		List<GroupLaymod> belongList = handle.getLayoutmoduleList();
		String hql = "delete GroupLaymod where page=? and layout.layoutId=?";
		groupLaymodDao
				.bulkUpdate(hql, handle.getBelongPage(), gl.getLayoutId());
		groupLaymodDao.saveOrUpdateAll(setLaymodeNames(handle, belongList));

		GroupLaytheme gltheme = handle.getLaytheme();
		gltheme.setAddTime(new Date());
		groupLaythemeDao.saveOrUpdate(gltheme);

		groupWidthDao.saveOrUpdate(handle.getListWidth());

		if (handle.getUserDefinedList() != null) {
			List<String> list = new ArrayList<String>();
			StringBuilder sb = new StringBuilder();
			list.add(handle.getCurrentUser().getEnterpriseId());
			for (GroupUserdefined g : handle.getUserDefinedList()) {
				if (g.getUserdefinedId() == null) {
					list.add(g.getModuleId());
					sb.append("?").append(",");
				}
			}
			if (sb.length() > 0) {
				sb.deleteCharAt(sb.lastIndexOf(","));
			}
			if (list.size() > 1) {
				hql = "DELETE FROM GroupUserdefined WHERE enterpriseId=? AND moduleId IN ("
						+ sb + ")";
				userDefineDao.bulkUpdate(hql, list.toArray());
			}
			userDefineDao.saveOrUpdateAll(handle.getUserDefinedList());
		}
	}

	@Override
	public void initUser(AbcUser user) {
		this.initNav(user);
		this.initLayout(user);
	}

	/**
	 * 统一模块名称
	 *
	 * @param handle
	 * @param glm
	 * @return
	 */
	private List<GroupLaymod> setLaymodeNames(LayoutController handle,
			List<GroupLaymod> glm) {
		List<GroupLaymod> gnewList = new ArrayList<GroupLaymod>();
		String hql = "from GroupLaymod where page<>? and layout.layoutId=? and module.moduleId=?";
		for (GroupLaymod g : glm) {
			gnewList.add(g);
			if (g.getName() == null
					|| g.getModule().getModuleId().startsWith("user_defined"))
				continue;
			List<GroupLaymod> list = groupLaymodDao.find(hql, handle
					.getBelongPage(), handle.getModel().getLayoutId(), g
					.getModule().getModuleId());
			for (GroupLaymod mod : list) {
				mod.setName(g.getName());
				gnewList.add(mod);
			}
		}

		return gnewList;
	}
}


text:
namespace RoboticsAnimatSim
{
	namespace Robotics
	{
		namespace RobotIOControls
		{
			namespace Firmata
			{

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

RbFirmataPrismaticServo::RbFirmataPrismaticServo()
{
    m_lpHinge = NULL;
}

RbFirmataPrismaticServo::~RbFirmataPrismaticServo()
{
	try
	{
        //Do not delete because we do not own it.
        m_lpHinge = NULL;
	}
	catch(...)
	{Std_TraceMsg(0, "Caught Error in desctructor of RbFirmataHingeServo\r\n", "", -1, false, true);}
}

void RbFirmataPrismaticServo::SetupIO()
{
}

void RbFirmataPrismaticServo::StepIO(int iPartIdx)
{
}

void RbFirmataPrismaticServo::Initialize()
{
	RobotPartInterface::Initialize();

	m_lpHinge = dynamic_cast<RbHinge *>(m_lpPart);

	//if(!m_lpSim->InSimulation())
	//	InitMotorData();
}

void RbFirmataPrismaticServo::StepSimulation()
{
    RobotPartInterface::StepSimulation();

	//if(m_lpHinge)
	//{
	//	//Here we need to get the set velocity for this motor that is coming from the neural controller, and then make the real motor go that speed.
	//	if(m_lpThisMotorJoint->MotorType() == eJointMotorType::PositionControl || m_lpThisMotorJoint->MotorType() == eJointMotorType::PositionVelocityControl)
	//	{
	//		float fltSetVelocity = m_lpHinge->SetVelocity();
	//		SetGoalVelocity(fltSetVelocity);

	//		if(fltSetVelocity > 0)
	//			SetGoalPosition_FP(m_iMaxPos);
	//		else
	//			SetGoalPosition_FP(m_iMinPos);
	//	}
	//	else
	//	{
	//		float fltSetPosition = m_lpHinge->SetVelocity();
	//		SetGoalPosition(fltSetPosition);
	//		SetMaximumVelocity();
	//	}

	//	float fltActualPosition = GetActualPosition();
	//	float fltActualVelocity = GetActualVelocity();
	//	//float fltTemperature = GetActualTemperatureCelcius();
	//	//float fltVoltage = GetActualVoltage();
	//	//float fltLoad = GetActualLoad();

	//	m_lpHinge->JointPosition(fltActualPosition);
	//	m_lpHinge->JointVelocity(fltActualVelocity);
	//	//m_lpHinge->Temperature(fltTemperature);
	//	//m_lpHinge->Voltage(fltVoltage);
	//	//m_lpHinge->MotorTorqueToAMagnitude(fltLoad);
	//	//m_lpHinge->MotorTorqueToBMagnitude(fltLoad);
	//}
}

			}	//Firmata
		}		//RobotIOControls
	}			// Robotics
}				//RoboticsAnimatSim


text:
require 'test_helper'

class OrganismTest < ActiveSupport::TestCase

  fixtures :organisms,:assays,:models,:bioportal_concepts,:assay_organisms,:studies

  test "assay association" do
    o=organisms(:Saccharomyces_cerevisiae)
    a=assays(:metabolomics_assay)
    assert_equal 1,o.assays.size
    assert o.assays.include?(a)
  end

  test "ncbi_uri" do
    org = Factory(:organism,:bioportal_concept=>Factory(:bioportal_concept))
    assert_equal "http://purl.obolibrary.org/obo/NCBITaxon_2287",org.ncbi_uri

    org = Factory(:organism)

    assert_nil org.ncbi_uri
  end

  test "ncbi_id" do
    org = Factory(:organism,:bioportal_concept=>Factory(:bioportal_concept))
    assert_equal "http://purl.obolibrary.org/obo/NCBITaxon_2287",org.ncbi_uri
    assert_equal 2287,org.ncbi_id
  end

  test "to_rdf" do
    object = Factory(:assay_organism).organism
    object.bioportal_concept = Factory(:bioportal_concept)
    object.save
    rdf = object.to_rdf

    RDF::Reader.for(:rdfxml).new(rdf) do |reader|
      assert reader.statements.count >= 1
      assert_equal RDF::URI.new("http://localhost:3000/organisms/#{object.id}"), reader.statements.first.subject
      assert reader.has_triple? ["http://localhost:3000/organisms/#{object.id}",Seek::Rdf::JERMVocab.NCBI_ID,"http://purl.obolibrary.org/obo/NCBITaxon_2287"]
    end
  end

  test "can_view" do
    o=Factory(:organism)
    assert o.can_view?
    assert o.can_view?(nil)
    assert o.can_view?(Factory(:user))
  end

  test "searchable_terms" do
    o=organisms(:Saccharomyces_cerevisiae)
    assert o.searchable_terms.include?("Saccharomyces cerevisiae")
  end

  test "bioportal_link" do
    o=Factory(:organism,:bioportal_concept=>Factory(:bioportal_concept))
    assert_not_nil o.bioportal_concept,"There should be an associated bioportal concept"
    assert_equal "NCBITAXON",o.ontology_id
    assert_equal "http://purl.obolibrary.org/obo/NCBITaxon_2287",o.concept_uri
  end

  test "assigning terms to organism with no concept by default" do
    o=organisms(:Saccharomyces_cerevisiae)
    assert_equal nil,o.ontology_id
    assert_equal nil,o.concept_uri
    o.ontology_id="NCBITAXON"

    o.concept_uri="abc"
    o.save!
    o=Organism.find(o.id)
    assert_equal "NCBITAXON",o.ontology_id
    assert_equal "abc",o.concept_uri
  end

  test "dependent destroyed" do
    User.with_current_user Factory(:admin) do
      o=organisms(:yeast_with_bioportal_concept)
      concept=o.bioportal_concept
      assert_not_nil BioportalConcept.find_by_id(concept.id)
      o.destroy
      assert_nil BioportalConcept.find_by_id(concept.id)
    end
  end

  test "can_delete?" do
    admin = Factory(:admin)
    non_admin=Factory(:user)
    o=organisms(:yeast)
    assert !o.can_delete?(admin)
    o=organisms(:human)
    assert o.can_delete?(admin)
    assert !o.can_delete?(non_admin)
    o=organisms(:organism_linked_project_only)
    assert !o.can_delete?(admin)
  end

end


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

namespace ARKBreedingStats.uiControls
{
    public partial class TagSelector : UserControl
    {
        private tagStatus status;
        private ToolTip tt;

        public delegate void TagStatusChangedEventHandler();

        public event TagStatusChangedEventHandler OnTagChanged;

        public TagSelector()
        {
            InitializeComponent();
            status = tagStatus.indifferent;
            button1.Text = "○";
            button1.BackColor = SystemColors.Control;
            tt = new ToolTip();
            Disposed += TagSelector_Disposed;
        }

        private void TagSelector_Disposed(object sender, EventArgs e)
        {
            tt.RemoveAll();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (status == tagStatus.indifferent)
                setStatus(tagStatus.include);
            else if (status == tagStatus.include)
                setStatus(tagStatus.exclude);
            else
                setStatus(tagStatus.indifferent);
            OnTagChanged?.Invoke();
        }

        private void setStatus(tagStatus s)
        {
            if (s == tagStatus.include)
            {
                status = tagStatus.include;
                button1.Text = "✓";
                button1.BackColor = Color.LightGreen;
            }
            else if (s == tagStatus.exclude)
            {
                status = tagStatus.exclude;
                button1.Text = "✕";
                button1.BackColor = Color.LightSalmon;
            }
            else
            {
                status = tagStatus.indifferent;
                button1.Text = "○";
                button1.BackColor = SystemColors.Control;
            }
        }

        public tagStatus Status
        {
            get => status;
            set => setStatus(value);
        }

        public string TagName
        {
            get => label1.Text;
            set
            {
                label1.Text = value;
                tt.SetToolTip(label1, value);
            }
        }

        public enum tagStatus
        {
            indifferent,
            include,
            exclude
        }
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/conversation.proto

namespace Google\Cloud\Dialogflow\V2\Conversation;

use UnexpectedValueException;

/**
 * Enumeration of the completion status of the conversation.
 *
 * Protobuf type google.cloud.dialogflow.v2.Conversation.LifecycleState
 */
class LifecycleState
{
    /**
     * Unknown.
     *
     * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0;
     */
    const LIFECYCLE_STATE_UNSPECIFIED = 0;
    /**
     * Conversation is currently open for media analysis.
     *
     * Generated from protobuf enum IN_PROGRESS = 1;
     */
    const IN_PROGRESS = 1;
    /**
     * Conversation has been completed.
     *
     * Generated from protobuf enum COMPLETED = 2;
     */
    const COMPLETED = 2;

    private static $valueToName = [
        self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED',
        self::IN_PROGRESS => 'IN_PROGRESS',
        self::COMPLETED => 'COMPLETED',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }

    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LifecycleState::class, \Google\Cloud\Dialogflow\V2\Conversation_LifecycleState::class);


text:
//-----------------------------------------------------------------------
// <copyright file="DeadLetter.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
//     Copyright (C) 2013-2015 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using Akka.Actor;

namespace Akka.Event
{
    /// <summary>
    /// Class DeadLetter.
    /// </summary>
    public class DeadLetter
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DeadLetter"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="sender">The sender.</param>
        /// <param name="recipient">The recipient.</param>
        public DeadLetter(object message, IActorRef sender, IActorRef recipient)
        {
            Message = message;
            Sender = sender;
            Recipient = recipient;
        }

        /// <summary>
        /// Gets the message.
        /// </summary>
        /// <value>The message.</value>
        public object Message { get; private set; }

        /// <summary>
        /// Gets the recipient.
        /// </summary>
        /// <value>The recipient.</value>
        public IActorRef Recipient { get; private set; }

        /// <summary>
        /// Gets the sender.
        /// </summary>
        /// <value>The sender.</value>
        public IActorRef Sender { get; private set; }

        public override string ToString()
        {
            return "DeadLetter from " + Sender + " to " + Recipient + ": <" + Message + ">";
        }
    }
}


text:
from twisted.protocols.amp import Boolean, Integer, String, Float, Command

class Sum(Command):
    arguments = [('a', Integer()),
                 ('b', Integer())]
    response = [('status', Integer())]

class HeartbeatCmd(Command):
    arguments = [('enabled', Boolean())]
    response = [('status', Boolean())]
    requiresAnswer = False

class HaltCmd(Command):
    arguments = []
    response = [('status', Boolean())]
    requiresAnswer = False

class ModeCmd(Command):
    arguments = [('mode', String())]
    response = [('status', String())]
    requiresAnswer = False

class QueryStatus(Command):
    arguments = []
    response = [('fix', Boolean()),
                ('lat', Float()),
                ('lon', Float()),
                ('gps_heading', Float()),
                ('gps_speed', Float()),
                ('altitude', Float()),
                ('num_sat', Integer()),
                ('timestamp', String()),
                ('datestamp', String()),
                ('compass_heading', Float()),
                ('temperature', Float())]

class NavigationCmd(Command):
    arguments = [('speed', Float()), ('heading', Float())]
    response = [('status', Boolean())]
    requiresAnswer = False

class ManualDriveCmd(Command):
    arguments = [('throttle', Float()), ('steering', Float())]
    response = [('status', Boolean())]
    requiresAnswer = False

class CameraCmd(Command):
    arguments = [('camera_cmd', String())]
    response = [('status', Boolean())]
    requiresAnswer = False

class ExitCmd(Command):
    arguments = []
    response = []
    requiresAnswer = False


text:
<?php
class testFreeResetsAllAssociatedClassMethods
{
    function foo() {}
    function bar() {}
}


text:
from swgpy.object import *

def create(kernel):
	result = Tangible()

	result.template = "object/tangible/lair/plumed_rasp/shared_lair_plumed_rasp_forest.iff"
	result.attribute_template_id = -1
	result.stfName("lair_n","plumed_rasp_forest")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.spotify.missinglink.examples</groupId>
  <artifactId>examples-parent</artifactId>
  <version>0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <description>
    Example projects
  </description>

  <modules>
    <module>has-problematic-dependency</module>
    <module>uses-problematic-dependency</module>
  </modules>

  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>


text:
alias ls='ls -F'
alias la='ls -A'
alias ll='ls -lahF'
alias ..='cd ..'

alias plz='sudo $(history -p \!\!)'
alias path='echo -e ${PATH//:/\\\n}'
alias targz='tar xzvf'
alias reload='source ~/.bash_profile'
alias pwdc='pwd | pbcopy'
alias shrugc='echo "¯\_(ツ)_/¯" | pbcopy'
alias shrugcc='echo "¯\\\\\_(ツ)_/¯" | pbcopy'

alias irb="pry"
alias pry="pry --simple-prompt"
alias bx="bundle exec"
alias fs="foreman start --procfile Procfile.local"
alias dk="bx dk"
alias cap="bx cap"
alias rake="bx rake"
alias jekyll="bx jekyll"
alias assert="bx assert"
alias rspec="bx rspec"
alias rubocop="bx rubocop"
alias iassert="time __assert_individually"
alias urlc="urlcheck < ~/.urlcheck_urls"
alias sanford="bx sanford"
alias ardb="bx ardb"
alias dassets="bx dassets"

alias ghost="sudo ghost"
alias ghost-ssh="ghost-ssh"

alias tlog='mkdir -p log; touch log/development.log; tail -f log/development.log'
alias rst='touch tmp/restart.txt'

alias st='subl -n .'

alias readme='test -x `which redcarpet` && test -f ./README.md && redcarpet README.md > ~/.Trash/readme.html && open ~/.Trash/readme.html'

alias til='grep -d recurse -h `date "+%m/%d"` /usr/share/calendar/'


text:
Create New Client

        <form name="createClient_form" class="form-horizontal" data-ng-submit="createClient()" novalidate>

                <fieldset>

                                First Name

                                    <input type="text" data-ng-model="viewModel.client.FirstName" id="FirstName" class="form-control" placeholder="First Name" required>

                                Last Name

                                    <input type="text" data-ng-model="viewModel.client.LastName" id="LastName" class="form-control" placeholder="Last Name" required>

                                Address

                                    <input type="text" data-ng-model="viewModel.client.Address" id="Address" class="form-control" placeholder="Address" required>

                                Email Address

                                    <input type="email" data-ng-model="viewModel.client.EmailAddress" id="EmailAddress" class="form-control" placeholder="Email Address" required>

                                City

                                    <input type="text" data-ng-model="viewModel.client.City" id="City" class="form-control" placeholder="City" required>

                                Phone

                                    <input type="tel" data-ng-model="viewModel.client.Phone" id="Phone" class="form-control" placeholder="Phone" required>

                                State

                                    <select ng-model="viewModel.client.State" ng-options="state.Name for state in viewModel.states" class="form-control" placeholder="State">
                                        <option value='' disabled>-- State --</option>
                                    </select>

                                Zip

                                    <input type="text" data-ng-model="viewModel.client.Zip" id="Zip" class="form-control" placeholder="Zip" required>

                                Secondary Phone

                                    <input type="tel" data-ng-model="viewModel.client.SecondaryPhone" id="SecondaryPhone" class="form-control" placeholder="Secondary Phone" required>

                                Source

                                    <input type="text" data-ng-model="viewModel.client.Source" id="Source" class="form-control" placeholder="Source" required>

                        <input type="submit" class="btn btn-default" value="Submit">

                </fieldset>

        </form>


text:
// ================================================================================
// ==      This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås      ==
// ==                     See tb_core.h for more information.                    ==
// ================================================================================

#ifndef TB_EDITFIELD_H
#define TB_EDITFIELD_H

#include "tb_widgets_common.h"
#include "tb_msg.h"
#include "tb_style_edit.h"

namespace tb {

/** EDIT_TYPE - These types does not restrict input (may change in the future).
	They are just hints for virtual keyboard, so it can show special keys. */
enum EDIT_TYPE {
	EDIT_TYPE_TEXT,
	EDIT_TYPE_SEARCH,
	EDIT_TYPE_PASSWORD,
	EDIT_TYPE_EMAIL,
	EDIT_TYPE_PHONE,
	EDIT_TYPE_URL,
	EDIT_TYPE_NUMBER
};

/** The default content factory for embedded content in TBEditField with styling enabled.

	Creates all that TBTextFragmentContentFactory creates by default,
	and any type of widget from a inline resource string.

	Syntax: <widget xxx> Where xxx is parsed by TBWidgetsReader.

	Example - Create a button with id "hello":

		<widget TBButton: text: "Hello world!" id: "hello">

	Example - Create a image from skin element "Icon48":

		<widget TBSkinImage: skin: "Icon48">
*/

class TBEditFieldContentFactory : public TBTextFragmentContentFactory
{
public:
	class TBEditField *editfield;
	virtual int GetContent(const char *text);
	virtual TBTextFragmentContent *CreateFragmentContent(const char *text, int text_len);
};

/** TBEditFieldScrollRoot - Internal for TBEditField.
	Acts as a scrollable container for any widget created as embedded content. */

class TBEditFieldScrollRoot : public TBWidget
{
private: // May only be used by TBEditField.
	friend class TBEditField;
	TBEditFieldScrollRoot() {}
public:
	virtual void OnPaintChildren(const PaintProps &paint_props);
	virtual void GetChildTranslation(int &x, int &y) const;
	virtual WIDGET_HIT_STATUS GetHitStatus(int x, int y);
};

/** TBEditField is a one line or multi line textfield that is editable or
	read-only. It can also be a passwordfield by calling
	SetEditType(EDIT_TYPE_PASSWORD).

	It may perform styling of text and contain custom embedded content,
	if enabled by SetStyling(true). Disabled by default.
*/

class TBEditField : public TBWidget, private TBStyleEditListener, public TBMessageHandler
{
public:
	// For safe typecasting
	TBOBJECT_SUBCLASS(TBEditField, TBWidget);

	TBEditField();
	~TBEditField();

	/** Get the visible rect (the GetPaddingRect() minus any scrollbars) */
	TBRect GetVisibleRect();

	/** Set if multiple lines should be allowed or not.
		Will also set wrapping (to true if multiline, and false if not). */
	void SetMultiline(bool multiline);
	bool GetMultiline() const { return m_style_edit.packed.multiline_on; }

	/** Set if styling should be enabled or not. Default is disabled. */
	void SetStyling(bool styling);
	bool GetStyling() const { return m_style_edit.packed.styling_on; }

	/** Set if read only mode should be enabled. Default is disabled.
		In read only mode, editing is disabled and caret is hidden.
		The user is still able to focus, select and copy text. */
	void SetReadOnly(bool readonly);
	bool GetReadOnly() const { return m_style_edit.packed.read_only; }

	/** Set to true if the text should wrap if multi line is enabled (See SetMultiline). */
	void SetWrapping(bool wrapping);
	bool GetWrapping() const { return m_style_edit.packed.wrapping; }

	/** Set to true if the preferred size of this editfield should adapt to the
		size of the content (disabled by default).
		If wrapping is enabled, the result is partly dependant on the virtual
		width (See SetVirtualWidth). */
	void SetAdaptToContentSize(bool adapt);
	bool GetAdaptToContentSize() const { return m_adapt_to_content_size; }

	/** The virtual width is only used if the size is adapting to content size
		(See SetAdaptToContentSize) and wrapping is enabled.
		The virtual width will be used to layout the text and see which resulting
		width and height it takes up. The width that is actually used depends on
		the content. It is also up to the the layouter to decide if the size
		should be respected or not. The default is 250. */
	void SetVirtualWidth(int virtual_width);
	int GetVirtualWidth() const { return m_virtual_width; }

	/** Get the TBStyleEdit object that contains more functions and settings. */
	TBStyleEdit *GetStyleEdit() { return &m_style_edit; }

	/** Set the edit type that is a hint for virtual keyboards about what the
		content should be. */
	void SetEditType(EDIT_TYPE type);
	EDIT_TYPE GetEditType() { return m_edit_type; }

	/** Support custom skin condition properties. Currently supported properties are:
		"edit-type", matching those of EDIT_TYPE.
		"multiline", matching 1 if multiline mode is enabled.
		"readonly", matching 1 if readonly mode is enabled. */
	virtual bool GetCustomSkinCondition(const TBSkinCondition::CONDITION_INFO &info);

	/** Set which alignment the text should have if the space
		given when painting is larger than the text.
		This changes the default for new blocks, as wel as the currently selected blocks or the block
		of the current caret position if nothing is selected. */
	void SetTextAlign(TB_TEXT_ALIGN align) { m_style_edit.SetAlign(align); }
	TB_TEXT_ALIGN GetTextAlign() { return m_style_edit.align; }

	virtual bool SetText(const char *text) { return m_style_edit.SetText(text, TB_CARET_POS_BEGINNING); }
	virtual bool GetText(TBStr &text) { return m_style_edit.GetText(text); }
	using TBWidget::GetText; ///< Make all versions in base class available.

	using TBWidget::Invalidate; ///< Make Invalidate in base class available.

	/** Set the text and also specify if the caret should be positioned at the beginning
		or end of the text. */
	bool SetText(const char *text, TB_CARET_POS pos)
											{ return m_style_edit.SetText(text, pos); }
	/** Set the text of the given length and also specify if the caret should be positioned
		at the beginning or end of the text. */
	bool SetText(const char *text, int text_len, TB_CARET_POS pos = TB_CARET_POS_BEGINNING)
											{ return m_style_edit.SetText(text, text_len, pos); }

	/** Set the placeholder text. It will be visible only when the textfield is empty. */
	virtual bool SetPlaceholderText(const char *text) { return m_placeholder.SetText(text); }
	virtual bool GetPlaceholderText(TBStr &text) { return m_placeholder.GetText(text); }

	virtual void ScrollTo(int x, int y);
	virtual TBWidget::ScrollInfo GetScrollInfo();
	virtual TBWidget *GetScrollRoot() { return &m_root; }

	virtual bool OnEvent(const TBWidgetEvent &ev);
	virtual void OnPaint(const PaintProps &paint_props);
	virtual void OnPaintChildren(const PaintProps &paint_props);
	virtual void OnInflate(const INFLATE_INFO &info);
	virtual void OnAdded();
	virtual void OnFontChanged();
	virtual void OnFocusChanged(bool focused);
	virtual void OnResized(int old_w, int old_h);
	virtual TBWidget *GetContentRoot() { return &m_root; }

	virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);

	virtual void OnMessageReceived(TBMessage *msg);
private:
	TBScrollBar m_scrollbar_x;
	TBScrollBar m_scrollbar_y;
	TBWidgetString m_placeholder;
	EDIT_TYPE m_edit_type;
	TBEditFieldScrollRoot m_root;
	TBEditFieldContentFactory m_content_factory;
	TBStyleEdit m_style_edit;
	bool m_adapt_to_content_size;
	int m_virtual_width;
	void UpdateScrollbarVisibility(bool multiline);

	// == TBStyleEditListener =======================
	virtual void OnChange();
	virtual bool OnEnter();
	virtual void Invalidate(const TBRect &rect);
	virtual void DrawString(int32 x, int32 y, TBFontFace *font, const TBColor &color, const char *str, int32 len);
	virtual void DrawRect(const TBRect &rect, const TBColor &color);
	virtual void DrawRectFill(const TBRect &rect, const TBColor &color);
	virtual void DrawTextSelectionBg(const TBRect &rect);
	virtual void DrawContentSelectionFg(const TBRect &rect);
	virtual void DrawCaret(const TBRect &rect);
	virtual void Scroll(int32 dx, int32 dy);
	virtual void UpdateScrollbars();
	virtual void CaretBlinkStart();
	virtual void CaretBlinkStop();
};

}; // namespace tb

#endif // TB_EDITFIELD_H


text:
/**
 * @author Andrew Lalis
 * Contains all relevant handlers for Commands, and the commands themselves.
 * Reactions are also handled here as if they were commands.
 */
package handiebot.command;


text:
title: Displaying pop-ups above other content in Feathers
author: Josh Tynjala

---
# Displaying pop-ups above other content in Feathers

Feathers includes a [`PopUpManager`](../api-reference/feathers/core/PopUpManager.html) that allows you to display content above the rest of your application. It provides options to make the pop-up modal and to center it on screen. You can customize the modal overlay to create any display object to block interaction with the content below the modal pop-up. You can even customize where pop-ups will appear on the display list.

If the [focus management](focus.html) is enabled, modal pop-ups will be given their own focus manager so that focus cannot be given to components below the modal overlay.

## Adding pop-ps

[`PopUpManager.addPopUp()`](../api-reference/feathers/core/PopUpManager.html#addPopUp()) is used to add a display object as a pop up. You must create the display object beforehand:

``` code
var popUp:Image = new Image( texture );
PopUpManager.addPopUp( popUp, true, true );
```

The first argument is simply the pop-up to add. It may be any Starling display object.

The second argument, `isModal`, tells the `PopUpManager` whether the pop-up is modal or not. Modal pop-ups include an overlay that blocks touches and other interaction below the pop-up. Non-modal pop-ups allow you to continue interacting with anything below the pop-up while it is displayed.

`isCentered`, the third argument, tells the `PopUpManager` if it should center the pop-up on the stage or not. If the stage or the pop-up resizes, it will remain centered. The second and third arguments are optional. If omitted, the pop-up will be modal and centered.

A fourth argument, also optional, allows you to pass in a custom factory for the modal overlay. By default, [`PopUpManager.overlayFactory`](../api-reference/feathers/core/PopUpManager.html#overlayFactory) is used to create the overlay, but you can customize it for individual pop-ups, if needed. We'll look at custom overlay factories further below.

## Removing pop-ups

There are two ways to remove pop-ups. The first is by calling [`PopUpManager.removePopUp()`](../api-reference/feathers/core/PopUpManager.html#removePopUp()):

``` code
PopUpManager.removePopUp( popUp, true );
```

The first argument is the pop-up to remove. If the object passed in is not a pop-up, a runtime error will be thrown. The second argument is whether to dispose the pop-up or not.

If you prefer, you may also use the standard [`removeFromParent()`](http://doc.starling-framework.org/core/starling/display/DisplayObject.html#removeFromParent()) function available to all Starling display objects:

``` code
popUp.removeFromParent( true );
```

The `PopUpManager` will automatically detect that the pop-up was removed. If modal, the overlay will be removed too.

## Centering pop-ups

There are two ways to center pop-ups, with different behavior.

The first way to center a pop-up is to pass a value of `true` to the third argument of `PopUpManager.addPopUp()`, named `isCentered`. In this case, the pop-up will be centered immediately when it is added to the display list. Then, if the stage resizes or the pop-up itself resizes, the pop-up will be repositioned in order to remain centered. The pop-up manager can only detect when the pop-up resizes if it is a Feathers component. Normal Starling display objects do not dispatch an appropriate event to indicate if they have been resized.

If you choose not to center a pop-up when you call `PopUpManager.addPopUp()`, you can center it manually by calling [`PopUpManager.centerPopUp()`](../api-reference/feathers/core/PopUpManager.html#centerPopUp()) and passing the pop-up as the only argument. This will center the pop-up only once. If the pop-up resizes or the stage resizes, you will need to call `PopUpManager.centerPopUp()` again to reposition it so that it remains centered.

## Customizing the `PopUpManager`

By customizing [`PopUpManager.overlayFactory`](../api-reference/feathers/core/PopUpManager.html#overlayFactory) you can change the appearance of the modal overlay. By default, this overlay is a fully transparent [`Quad`](http://doc.starling-framework.org/core/starling/display/Quad.html). It will block touches to the content below, but it has no appearance.

If you wanted to use a semi-transparent, colored Quad or another Starling display object for overlays, you can pass in a new `overlayFactory`:

``` code
PopUpManager.overlayFactory = function():DisplayObject
{
    var quad:Quad = new Quad(100, 100, 0x000000);
    quad.alpha = 0.75;
    return quad;
};
```

In the example above, the modal overlay is a black `Quad` with 75% opacity.

As mentioned above, you can customize the modal overlay for a specific pop-up only by passing in a custom overlay factory to [`PopUpManager.addPopUp()`](../api-reference/feathers/core/PopUpManager.html#addPopUp()):

``` code
PopUpManager.addPopUp( popUp, true, true, function():DisplayObject
{
    var quad:Quad = new Quad(100, 100, 0x000000);
    quad.alpha = 0.75;
    return quad;
});
```

You may customize the [`root`](../api-reference/feathers/core/PopUpManager.html#root) property of `PopUpManager`. This is the display object where pop-ups are added. By default, `PopUpManager` adds all pop-ups directly to the Starling stage.

``` code
var popUpContainer:Sprite = new Sprite();
this.stage.addChild( popUpContainer );
PopUpManager.root = popUpContainer;
```

In this case, we move pop-ups into a dedicated container on the stage. This might be useful for ensuring that other content always appears on top of all Feathers content, including the `PopUpManager`.

## Related Links

-   [`feathers.core.PopUpManager` API Documentation](../api-reference/feathers/core/PopUpManager.html)


text:
NS_ASSUME_NONNULL_BEGIN

@interface BNCAppleSearchAds : NSObject

@property (nonatomic, assign, readwrite) BOOL enableAppleSearchAdsCheck;
@property (nonatomic, assign, readwrite) BOOL ignoreAppleTestData;

+ (BNCAppleSearchAds *)sharedInstance;

// Default delay and retry configuration.  ~p90
// typically less than 1s delay, up to 3.5s delay on first app start
- (void)useDefaultAppleSearchAdsConfig;

// Apple suggests a longer delay, however this is detrimental to app launch times
// typically less than 3s delay, up to 14s delay on first app start
- (void)useLongWaitAppleSearchAdsConfig;

// Checks Apple Search Ads and updates preferences
// This method blocks the thread, it should only be called on a background thread.
- (void)checkAppleSearchAdsSaveTo:(BNCPreferenceHelper *)preferenceHelper installDate:(NSDate *)installDate completion:(void (^_Nullable)(void))completion;

@end

NS_ASSUME_NONNULL_END


text:
/**
 * Sample React Native metroUI
 *
 */
'use strict';

var React = require('react-native');
var {
  StyleSheet,
  Text,
  View,
  ListView,
  NavigatorIOS,
} = React;

var ListCellRow = require('./listCellRow');

var metro = React.createClass({
  getInitialState: function() {
    this.state = {
      dataSource: new ListView.DataSource({
        rowHasChanged: (row1, row2) => row1 !== row2,
      }),
    };
    return {
      dataSource: this.getDataSource(this.props.data),
    };
  },

  render: function() {
    var content = <ListView
      contentContainerStyle={styles.list}
      ref="listview"
      dataSource={this.state.dataSource}
      renderRow={this.renderRow}
    />;
    return (
      <View style={styles.container}>
        {content}
      </View>
    );
  },

  renderRow: function (
    listItem: Object,
    sectionID: number | string,
    rowID: number | string,
    highlightRowFunc: (sectionID: ?number | string, rowID: ?number | string) => void,
  ) {
    return (
      <ListCellRow
        imgHeight={150}
        item={listItem}
        navigator={this.props.navigator}
        transStyle={this.props.transStyle}
      />
    );
  },

  getDataSource: function(items: Array<any>): ListView.DataSource {
    return this.state.dataSource.cloneWithRows(items);
  },

});

var styles = StyleSheet.create({
  navigator: {
    flex: 1,
  },
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  list: {
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'column',
    marginTop: 30,
  },
  item: {
      margin: 10,
  },

});

module.exports = metro;


text:
/**
*
*	sound.hpp
*
*	Sound class	-	represents a loaded sound that can be played.
*
*	The constructor requires a Mixer, and the filename. It may throw a
*	std::exception if it cannot find or load the file.
*	Can load WAVE, AIFF, RIFF, OGG, and VOC files.
*
*	Play with play() or playFor(): play(Sound::once) to play it once,
*	or play(Sound::forever) to play it forever, though this isn't
*	usually required with sounds. playFor() allows you to play it for
*	a certain number of milliseconds, after which it stops playing.
*
*	You can set the volume associated with the Sound; a value between
*		0 and 128.
*
*	You can also pause, resime, stop etc, however these will do
*	nothing if this Sound is not playing, and note that if you play
*	a sound while it is still playing, it becomes assigned to a new
*	channel, and so pause() etc only work on the most recent playing
*	version of it; the one that is tied to the channel it is playing on
*
*	Basically, when you play, the sound gets stuck into a channel,
*	in which it plays. If you play it again during this time
*	(withought checking if it isPlaying() still), then a new channel
*	is given the sound samples and starts playing it, allowing you to play
*   the song over itself if you wish. Methods such as Pause() etc,
*	work on the one in this new channel, and the old channel is no longer
*   associated with this Sound object. An alternative implementation may
*   have chosen to open channels up for you, but this implementation is
*   designed as a simple sound.play() system to let the library worry
*   about channels for the majority of cases. For specific cases where
*   channel control is desired, Sound has a group of static methods for
*   channel query. Developer note: Another alternative implementation could have
*   Sound maintain and manage all the channels, or have a Sound object and a
*   PlayingSound object, where playing a Sound generates a PlayingSound bound to
*   a channel. However, such approaches were deemed over the top for the
*   simple user requirements of this library; the most common use cases have been
*   prioritised.
*
*   Sound is a non copyable class. Pass by reference
*	or pointer because you can't copy construct (private)
**/

#if !defined(AAB_AUDEN_SOUND_CLASS)
#define AAB_AUDEN_SOUND_CLASS
#include"mixer.hpp"
#include"audio_connector.hpp"
//#include"../types/smart_ptr.hpp"
#include<string>
#include<memory>
#include<exception>
namespace aab	{
namespace auden	{

/*
	later update might be to allow constructing a Sound from sound
	data held in memory, or even copying of sounds, with a reference
	to the same sound data held between each.
*/

class Sound
{
	private:

		struct Data;
		const std::auto_ptr<Data> data;

		Sound (Sound &);

		bool isChannelValid () const;

	public:

	enum PlayCount
	{
		forever = -1,
		once = 0
	};

	explicit Sound (Mixer &, std::string filename); // aab::test::file_not_found_error, std::runtime_error

	virtual ~Sound ();// throw ();

	int play (PlayCount = once);

	int playFor (int milliseconds, PlayCount = forever);

	void setVolume (int volume_0to128);
	int getVolume ();

	bool isPaused () const;
	bool isPlaying () const;
	void setPlayingPanning(int left0to255, int right0to255); // sets panning for the sound IF it is playing. This is removed when it has stopped playing on that channel.

	void pause ();
	void resume ();
	void stop ();

	static bool isChannelAllocated(const int channel);
	static bool isChannelPaused(const int channel);
	static bool isChannelPlaying(const int channel);
	static void pauseChannel(const int channel);
	static void resumeChannel(const int channel);
	static void stopChannel(const int channel);
	static void pauseAllSounds();
	static void resumeAllSounds();
	static void stopAllSounds();
	static void setMasterVolume(const int volume_0to128);

};

}		//	auden
}		//	aab
#endif	//	AAB_AUDEN_SOUND_CLASS


text:
.. code-block:: csharp

  // Not currently supported by this SDK

.. code-block:: java

  // Not currently supported by this SDK

.. code-block:: javascript

  // Not currently supported by this SDK

.. code-block:: php

  /** @param $member OpenCloud\Image\Resource\Member */
  $member = $image->getMember('{tenantId}');

.. code-block:: python

  # {projectId} is the account ID of the member.
  member = imgs.get_image_member("{imageId}", "{projectId}")

.. code-block:: ruby

  # Not currently supported by this SDK

.. code-block:: sh

  curl -s $ENDPOINT/images/{imageId}/members/{memberId} \
    -H "X-Auth-Token: $TOKEN" \
    -H "Accept: application/json" | python -m json.tool


text:
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#include <video/omapdss.h>
#include <video/omap-panel-data.h>

struct panel_drv_data {
	struct omap_dss_device dssdev;
	struct omap_dss_device *in;
	struct regulator *vcc;

	int data_lines;

	struct omap_video_timings videomode;

	struct gpio_desc *resb_gpio;	/* low = reset active min 20 us */
	struct gpio_desc *ini_gpio;	/* high = power on */
	struct gpio_desc *mo_gpio;	/* low = 480x640, high = 240x320 */
	struct gpio_desc *lr_gpio;	/* high = conventional horizontal scanning */
	struct gpio_desc *ud_gpio;	/* high = conventional vertical scanning */
};

static const struct omap_video_timings sharp_ls_timings = {
	.x_res = 480,
	.y_res = 640,

	.pixelclock	= 19200000,

	.hsw		= 2,
	.hfp		= 1,
	.hbp		= 28,

	.vsw		= 1,
	.vfp		= 1,
	.vbp		= 1,

	.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
	.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
	.data_pclk_edge	= OMAPDSS_DRIVE_SIG_RISING_EDGE,
	.de_level	= OMAPDSS_SIG_ACTIVE_HIGH,
	.sync_pclk_edge	= OMAPDSS_DRIVE_SIG_FALLING_EDGE,
};

#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)

static int sharp_ls_connect(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;
	int r;

	if (omapdss_device_is_connected(dssdev))
		return 0;

	r = in->ops.dpi->connect(in, dssdev);
	if (r)
		return r;

	return 0;
}

static void sharp_ls_disconnect(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	if (!omapdss_device_is_connected(dssdev))
		return;

	in->ops.dpi->disconnect(in, dssdev);
}

static int sharp_ls_enable(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;
	int r;

	if (!omapdss_device_is_connected(dssdev))
		return -ENODEV;

	if (omapdss_device_is_enabled(dssdev))
		return 0;

	if (ddata->data_lines)
		in->ops.dpi->set_data_lines(in, ddata->data_lines);
	in->ops.dpi->set_timings(in, &ddata->videomode);

	if (ddata->vcc) {
		r = regulator_enable(ddata->vcc);
		if (r != 0)
			return r;
	}

	r = in->ops.dpi->enable(in);
	if (r) {
		regulator_disable(ddata->vcc);
		return r;
	}

	/* wait couple of vsyncs until enabling the LCD */
	msleep(50);

	if (ddata->resb_gpio)
		gpiod_set_value_cansleep(ddata->resb_gpio, 1);

	if (ddata->ini_gpio)
		gpiod_set_value_cansleep(ddata->ini_gpio, 1);

	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

	return 0;
}

static void sharp_ls_disable(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	if (!omapdss_device_is_enabled(dssdev))
		return;

	if (ddata->ini_gpio)
		gpiod_set_value_cansleep(ddata->ini_gpio, 0);

	if (ddata->resb_gpio)
		gpiod_set_value_cansleep(ddata->resb_gpio, 0);

	/* wait at least 5 vsyncs after disabling the LCD */

	msleep(100);

	in->ops.dpi->disable(in);

	if (ddata->vcc)
		regulator_disable(ddata->vcc);

	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
}

static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
		struct omap_video_timings *timings)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	ddata->videomode = *timings;
	dssdev->panel.timings = *timings;

	in->ops.dpi->set_timings(in, timings);
}

static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
		struct omap_video_timings *timings)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);

	*timings = ddata->videomode;
}

static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
		struct omap_video_timings *timings)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	return in->ops.dpi->check_timings(in, timings);
}

static struct omap_dss_driver sharp_ls_ops = {
	.connect	= sharp_ls_connect,
	.disconnect	= sharp_ls_disconnect,

	.enable		= sharp_ls_enable,
	.disable	= sharp_ls_disable,

	.set_timings	= sharp_ls_set_timings,
	.get_timings	= sharp_ls_get_timings,
	.check_timings	= sharp_ls_check_timings,

	.get_resolution	= omapdss_default_get_resolution,
};

static int sharp_ls_get_gpio(struct device *dev, int gpio, unsigned long flags,
		  char *desc, struct gpio_desc **gpiod)
{
	struct gpio_desc *gd;
	int r;

	*gpiod = NULL;

	r = devm_gpio_request_one(dev, gpio, flags, desc);
	if (r)
		return r == -ENOENT ? 0 : r;

	gd = gpio_to_desc(gpio);
	if (IS_ERR(gd))
		return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd);

	*gpiod = gd;
	return 0;
}

static int sharp_ls_probe_pdata(struct platform_device *pdev)
{
	const struct panel_sharp_ls037v7dw01_platform_data *pdata;
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
	struct omap_dss_device *dssdev, *in;
	int r;

	pdata = dev_get_platdata(&pdev->dev);

	in = omap_dss_find_output(pdata->source);
	if (in == NULL) {
		dev_err(&pdev->dev, "failed to find video source '%s'\n",
				pdata->source);
		return -EPROBE_DEFER;
	}

	ddata->in = in;

	ddata->data_lines = pdata->data_lines;

	dssdev = &ddata->dssdev;
	dssdev->name = pdata->name;

	r = sharp_ls_get_gpio(&pdev->dev, pdata->mo_gpio, GPIOF_OUT_INIT_LOW,
		"lcd MO", &ddata->mo_gpio);
	if (r)
		return r;
	r = sharp_ls_get_gpio(&pdev->dev, pdata->lr_gpio, GPIOF_OUT_INIT_HIGH,
		"lcd LR", &ddata->lr_gpio);
	if (r)
		return r;
	r = sharp_ls_get_gpio(&pdev->dev, pdata->ud_gpio, GPIOF_OUT_INIT_HIGH,
		"lcd UD", &ddata->ud_gpio);
	if (r)
		return r;
	r = sharp_ls_get_gpio(&pdev->dev, pdata->resb_gpio, GPIOF_OUT_INIT_LOW,
		"lcd RESB", &ddata->resb_gpio);
	if (r)
		return r;
	r = sharp_ls_get_gpio(&pdev->dev, pdata->ini_gpio, GPIOF_OUT_INIT_LOW,
		"lcd INI", &ddata->ini_gpio);
	if (r)
		return r;

	return 0;
}

static  int sharp_ls_get_gpio_of(struct device *dev, int index, int val,
	const char *desc, struct gpio_desc **gpiod)
{
	struct gpio_desc *gd;

	*gpiod = NULL;

	gd = devm_gpiod_get_index(dev, desc, index, GPIOD_OUT_LOW);
	if (IS_ERR(gd))
		return PTR_ERR(gd);

	*gpiod = gd;
	return 0;
}

static int sharp_ls_probe_of(struct platform_device *pdev)
{
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
	struct device_node *node = pdev->dev.of_node;
	struct omap_dss_device *in;
	int r;

	ddata->vcc = devm_regulator_get(&pdev->dev, "envdd");
	if (IS_ERR(ddata->vcc)) {
		dev_err(&pdev->dev, "failed to get regulator\n");
		return PTR_ERR(ddata->vcc);
	}

	/* lcd INI */
	r = sharp_ls_get_gpio_of(&pdev->dev, 0, 0, "enable", &ddata->ini_gpio);
	if (r)
		return r;

	/* lcd RESB */
	r = sharp_ls_get_gpio_of(&pdev->dev, 0, 0, "reset", &ddata->resb_gpio);
	if (r)
		return r;

	/* lcd MO */
	r = sharp_ls_get_gpio_of(&pdev->dev, 0, 0, "mode", &ddata->mo_gpio);
	if (r)
		return r;

	/* lcd LR */
	r = sharp_ls_get_gpio_of(&pdev->dev, 1, 1, "mode", &ddata->lr_gpio);
	if (r)
		return r;

	/* lcd UD */
	r = sharp_ls_get_gpio_of(&pdev->dev, 2, 1, "mode", &ddata->ud_gpio);
	if (r)
		return r;

	in = omapdss_of_find_source_for_first_ep(node);
	if (IS_ERR(in)) {
		dev_err(&pdev->dev, "failed to find video source\n");
		return PTR_ERR(in);
	}

	ddata->in = in;

	return 0;
}

static int sharp_ls_probe(struct platform_device *pdev)
{
	struct panel_drv_data *ddata;
	struct omap_dss_device *dssdev;
	int r;

	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
	if (ddata == NULL)
		return -ENOMEM;

	platform_set_drvdata(pdev, ddata);

	if (dev_get_platdata(&pdev->dev)) {
		r = sharp_ls_probe_pdata(pdev);
		if (r)
			return r;
	} else if (pdev->dev.of_node) {
		r = sharp_ls_probe_of(pdev);
		if (r)
			return r;
	} else {
		return -ENODEV;
	}

	ddata->videomode = sharp_ls_timings;

	dssdev = &ddata->dssdev;
	dssdev->dev = &pdev->dev;
	dssdev->driver = &sharp_ls_ops;
	dssdev->type = OMAP_DISPLAY_TYPE_DPI;
	dssdev->owner = THIS_MODULE;
	dssdev->panel.timings = ddata->videomode;
	dssdev->phy.dpi.data_lines = ddata->data_lines;

	r = omapdss_register_display(dssdev);
	if (r) {
		dev_err(&pdev->dev, "Failed to register panel\n");
		goto err_reg;
	}

	return 0;

err_reg:
	omap_dss_put_device(ddata->in);
	return r;
}

static int __exit sharp_ls_remove(struct platform_device *pdev)
{
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
	struct omap_dss_device *dssdev = &ddata->dssdev;
	struct omap_dss_device *in = ddata->in;

	omapdss_unregister_display(dssdev);

	sharp_ls_disable(dssdev);
	sharp_ls_disconnect(dssdev);

	omap_dss_put_device(in);

	return 0;
}

static const struct of_device_id sharp_ls_of_match[] = {
	{ .compatible = "omapdss,sharp,ls037v7dw01", },
	{},
};

MODULE_DEVICE_TABLE(of, sharp_ls_of_match);

static struct platform_driver sharp_ls_driver = {
	.probe = sharp_ls_probe,
	.remove = __exit_p(sharp_ls_remove),
	.driver = {
		.name = "panel-sharp-ls037v7dw01",
		.of_match_table = sharp_ls_of_match,
		.suppress_bind_attrs = true,
	},
};

module_platform_driver(sharp_ls_driver);

MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
MODULE_DESCRIPTION("Sharp LS037V7DW01 Panel Driver");
MODULE_LICENSE("GPL");


text:
export default {
    resource: 'admin.adminPlugins',
    path: '/plugins',
    map() {
        this.route('DiscourseThemes');
    }
};


text:
Required.

Xpath which selects the values that should be plotted.

The radio buttons select the type of data returned by the xpath expression.

If a nodeset is selected, a point for each node that is selected will be plotted.

The label of each point is the name of the element that was selected, the value is the text value.


text:
['developer tools', 'CMS', 'social media', 'the internet of things', 'dashboards', 'food', 'data'].each do |name|
  AppType.create(name: name)
end