text:
package helmreconciler

import (
	"fmt"
	"io"
	"strconv"
	"strings"

	jsonpatch "github.com/evanphx/json-patch/v5"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/kubectl/pkg/scheme"

	"istio.io/istio/operator/pkg/name"
	"istio.io/pkg/log"
)

const (
	// MetadataNamespace is the namespace for mesh metadata (labels, annotations)
	MetadataNamespace = "install.operator.istio.io"
	// OwningResourceName represents the name of the owner to which the resource relates
	OwningResourceName = MetadataNamespace + "/owning-resource"
	// OwningResourceNamespace represents the namespace of the owner to which the resource relates
	OwningResourceNamespace = MetadataNamespace + "/owning-resource-namespace"
	// operatorLabelStr indicates Istio operator is managing this resource.
	operatorLabelStr = name.OperatorAPINamespace + "/managed"
	// operatorReconcileStr indicates that the operator will reconcile the resource.
	operatorReconcileStr = "Reconcile"
	// IstioComponentLabelStr indicates which Istio component a resource belongs to.
	IstioComponentLabelStr = name.OperatorAPINamespace + "/component"
	// istioVersionLabelStr indicates the Istio version of the installation.
	istioVersionLabelStr = name.OperatorAPINamespace + "/version"
	// istioOperatorInstallPrefix indicates the name of resource istiooperators.install.istio.io for Istio operator installation.
	istioOperatorsInstallPrefix = "installed-state"
)

var (
	// TestMode sets the controller into test mode. Used for unit tests to bypass things like waiting on resources.
	TestMode = false

	scope = log.RegisterScope("installer", "installer", 0)
)

func init() {
	// Tree representation and wait channels are an inversion of ComponentDependencies and are constructed from it.
	buildInstallTree()
}

// ComponentTree represents a tree of component dependencies.
type (
	ComponentTree          map[name.ComponentName]any
	componentNameToListMap map[name.ComponentName][]name.ComponentName
)

var (
	// ComponentDependencies is a tree of component dependencies. The semantics are ComponentDependencies[cname] gives
	// the subtree of components that must wait for cname to be installed before starting installation themselves.
	ComponentDependencies = componentNameToListMap{
		name.PilotComponentName: {
			name.CNIComponentName,
			name.IngressComponentName,
			name.EgressComponentName,
		},
		name.IstioBaseComponentName: {
			name.PilotComponentName,
		},
	}

	// InstallTree is a top down hierarchy tree of dependencies where children must wait for the parent to complete
	// before starting installation.
	InstallTree = make(ComponentTree)
)

// buildInstallTree builds a tree from buildInstallTree where parents are the root of each subtree.
func buildInstallTree() {
	// Starting with root, recursively insert each first level child into each node.
	insertChildrenRecursive(name.IstioBaseComponentName, InstallTree, ComponentDependencies)
}

func insertChildrenRecursive(componentName name.ComponentName, tree ComponentTree, children componentNameToListMap) {
	tree[componentName] = make(ComponentTree)
	for _, child := range children[componentName] {
		insertChildrenRecursive(child, tree[componentName].(ComponentTree), children)
	}
}

// InstallTreeString returns a string representation of the dependency tree.
func InstallTreeString() string {
	var sb strings.Builder
	buildInstallTreeString(name.IstioBaseComponentName, "", &sb)
	return sb.String()
}

func buildInstallTreeString(componentName name.ComponentName, prefix string, sb io.StringWriter) {
	_, _ = sb.WriteString(prefix + string(componentName) + "\n")
	if _, ok := InstallTree[componentName].(ComponentTree); !ok {
		return
	}
	for k := range InstallTree[componentName].(ComponentTree) {
		buildInstallTreeString(k, prefix+"  ", sb)
	}
}

// applyOverlay applies an overlay using JSON patch strategy over the current Object in place.
func applyOverlay(current, overlay *unstructured.Unstructured) error {
	cj, err := runtime.Encode(unstructured.UnstructuredJSONScheme, current)
	if err != nil {
		return err
	}

	overlayUpdated := overlay.DeepCopy()
	if strings.EqualFold(current.GetKind(), "service") {
		if err := saveClusterIP(current, overlayUpdated); err != nil {
			return err
		}

		saveNodePorts(current, overlayUpdated)
	}

	uj, err := runtime.Encode(unstructured.UnstructuredJSONScheme, overlayUpdated)
	if err != nil {
		return err
	}
	merged, err := jsonpatch.MergePatch(cj, uj)
	if err != nil {
		return err
	}
	return runtime.DecodeInto(unstructured.UnstructuredJSONScheme, merged, current)
}

// createPortMap returns a map, mapping the value of the port and value of the nodePort
func createPortMap(current *unstructured.Unstructured) map[string]uint32 {
	portMap := make(map[string]uint32)
	svc := &v1.Service{}
	if err := scheme.Scheme.Convert(current, svc, nil); err != nil {
		log.Error(err.Error())
		return portMap
	}
	for _, p := range svc.Spec.Ports {
		portMap[strconv.Itoa(int(p.Port))] = uint32(p.NodePort)
	}
	return portMap
}

// saveNodePorts transfers the port values from the current cluster into the overlay
func saveNodePorts(current, overlay *unstructured.Unstructured) {
	portMap := createPortMap(current)
	ports, _, _ := unstructured.NestedFieldNoCopy(overlay.Object, "spec", "ports")
	portList, ok := ports.([]any)
	if !ok {
		return
	}
	for _, port := range portList {
		m, ok := port.(map[string]any)
		if !ok {
			continue
		}
		if nodePortNum, ok := m["nodePort"]; ok && fmt.Sprintf("%v", nodePortNum) == "0" {
			if portNum, ok := m["port"]; ok {
				if v, ok := portMap[fmt.Sprintf("%v", portNum)]; ok {
					m["nodePort"] = v
				}
			}
		}
	}
}

// saveClusterIP copies the cluster IP from the current cluster into the overlay
func saveClusterIP(current, overlay *unstructured.Unstructured) error {
	// Save the value of spec.clusterIP set by the cluster
	if clusterIP, found, err := unstructured.NestedString(current.Object, "spec",
		"clusterIP"); err != nil {
		return err
	} else if found {
		if err := unstructured.SetNestedField(overlay.Object, clusterIP, "spec",
			"clusterIP"); err != nil {
			return err
		}
	}
	return nil
}

// getIstioOperatorCRName get the Istio operator crd name based on specified revision
func getIstioOperatorCRName(revision string) string {
	name := istioOperatorsInstallPrefix
	if revision == "" || revision == "default" {
		return name
	}
	return name + "-" + revision
}


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

namespace Braintree
{
    public interface IDiscountGateway
    {
        List<Discount> All();
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace mojo {
namespace test {

// Class to help simple threads (with no message loops) in tests.
class SimpleTestThread : public base::DelegateSimpleThread::Delegate {
 public:
  SimpleTestThread();
  ~SimpleTestThread() override;

  // Starts the thread.
  void Start();

  // Joins the thread; this must be called if the thread was started.
  void Join();

  // Note: Subclasses must implement:
  //   virtual void Run() = 0;
  // TODO(vtl): When we stop using |base::DelegateSimpleThread|, this will
  // directly become part of our interface.

 private:
  base::DelegateSimpleThread thread_;

  MOJO_DISALLOW_COPY_AND_ASSIGN(SimpleTestThread);
};

}  // namespace test
}  // namespace mojo

#endif  // MOJO_EDK_TEST_SIMPLE_TEST_THREAD_


text:
namespace atom {

namespace {

const wchar_t kAppUserModelIDFormat[] = L"electron.app.$1";

BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
  DWORD target_process_id = *reinterpret_cast<DWORD*>(param);
  DWORD process_id = 0;

  GetWindowThreadProcessId(hwnd, &process_id);
  if (process_id == target_process_id) {
    SetFocus(hwnd);
    return FALSE;
  }

  return TRUE;
}

}  // namespace

void Browser::Focus() {
  // On Windows we just focus on the first window found for this process.
  DWORD pid = GetCurrentProcessId();
  EnumWindows(&WindowsEnumerationHandler, reinterpret_cast<LPARAM>(&pid));
}

void Browser::AddRecentDocument(const base::FilePath& path) {
  if (base::win::GetVersion() < base::win::VERSION_WIN7)
    return;

  CComPtr<IShellItem> item;
  HRESULT hr = SHCreateItemFromParsingName(
      path.value().c_str(), NULL, IID_PPV_ARGS(&item));
  if (SUCCEEDED(hr)) {
    SHARDAPPIDINFO info;
    info.psi = item;
    info.pszAppID = GetAppUserModelID();
    SHAddToRecentDocs(SHARD_APPIDINFO, &info);
  }
}

void Browser::ClearRecentDocuments() {
  CComPtr<IApplicationDestinations> destinations;
  if (FAILED(destinations.CoCreateInstance(CLSID_ApplicationDestinations,
                                           NULL, CLSCTX_INPROC_SERVER)))
    return;
  if (FAILED(destinations->SetAppID(GetAppUserModelID())))
    return;
  destinations->RemoveAllDestinations();
}

void Browser::SetAppUserModelID(const base::string16& name) {
  app_user_model_id_ = name;
  SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
}

void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
  CComPtr<ICustomDestinationList> destinations;
  if (FAILED(destinations.CoCreateInstance(CLSID_DestinationList)))
    return;
  if (FAILED(destinations->SetAppID(GetAppUserModelID())))
    return;

  // Start a transaction that updates the JumpList of this application.
  UINT max_slots;
  CComPtr<IObjectArray> removed;
  if (FAILED(destinations->BeginList(&max_slots, IID_PPV_ARGS(&removed))))
    return;

  CComPtr<IObjectCollection> collection;
  if (FAILED(collection.CoCreateInstance(CLSID_EnumerableObjectCollection)))
    return;

  for (auto& task : tasks) {
    CComPtr<IShellLink> link;
    if (FAILED(link.CoCreateInstance(CLSID_ShellLink)) ||
        FAILED(link->SetPath(task.program.value().c_str())) ||
        FAILED(link->SetArguments(task.arguments.c_str())) ||
        FAILED(link->SetDescription(task.description.c_str())))
      return;

    if (!task.icon_path.empty() &&
        FAILED(link->SetIconLocation(task.icon_path.value().c_str(),
                                     task.icon_index)))
      return;

    CComQIPtr<IPropertyStore> property_store = link;
    if (!base::win::SetStringValueForPropertyStore(property_store, PKEY_Title,
                                                   task.title.c_str()))
      return;

    if (FAILED(collection->AddObject(link)))
      return;
  }

  // When the list is empty "AddUserTasks" could fail, so we don't check return
  // value for it.
  CComQIPtr<IObjectArray> task_array = collection;
  destinations->AddUserTasks(task_array);
  destinations->CommitList();
}

PCWSTR Browser::GetAppUserModelID() {
  if (app_user_model_id_.empty()) {
    SetAppUserModelID(base::ReplaceStringPlaceholders(
        kAppUserModelIDFormat, base::UTF8ToUTF16(GetName()), nullptr));
  }

  return app_user_model_id_.c_str();
}

std::string Browser::GetExecutableFileVersion() const {
  base::FilePath path;
  if (PathService::Get(base::FILE_EXE, &path)) {
    scoped_ptr<FileVersionInfo> version_info(
        FileVersionInfo::CreateFileVersionInfo(path));
    return base::UTF16ToUTF8(version_info->product_version());
  }

  return ATOM_VERSION_STRING;
}

std::string Browser::GetExecutableFileProductName() const {
  base::FilePath path;
  if (PathService::Get(base::FILE_EXE, &path)) {
    scoped_ptr<FileVersionInfo> version_info(
        FileVersionInfo::CreateFileVersionInfo(path));
    return base::UTF16ToUTF8(version_info->product_name());
  }

  return ATOM_PRODUCT_NAME;
}

}  // namespace atom


text:
DELETE FROM meta WHERE meta_key='schema_version';
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'schema_version', '108');

# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
  VALUES (NULL, 'patch', 'patch_107_108_a.sql|schema_version');


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport"
		<title>CKEditor Example A</title>

		<form method="post">
			<textarea
				name="ckeditor"
				id="ckeditor"
				row="10" cols="80">

				This text will be replaced by
				ckeditor, and will become, by default
				the text used by CKEditor
			</textarea>
            <input type="submit" value="Submit">
		</form>

        <input type="button" id="SaveRequestButton"
            value="Save CKEditor Data as AJAX (response to be shown below)"
        >

        <input type="button" id="clear" value="Clear CKEditor Contents">


text: .nuget/nuget install psake -version 4.0.1.0 -o packages


text:
/*
 * This file is part of Evo2DSim.
 *
 * Evo2DSim is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Evo2DSim is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Evo2DSim.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.vastness.evo2dsim.core.data

import scalax.file.Path
import org.vastness.evo2dsim.core.data.Record.Record

trait Recorder {
  def dir: Path
  def name: String
  def dataHeader: Seq[String]
  def dataRecord: () => Record

  def step(): Unit
  def write(data: Seq[Record]): Unit

  protected def headerToString(row: Seq[String]) = row.mkString(", ")
}

object Recorder {
  def apply(dir: Path, name: String, r: Recordable) = new DirectRecorder(dir, name, r.dataHeader, r.dataRow _)
}


text:
import requests
import json
from solve import solve

r=requests.get('http://172.16.108.157/problem')
problem=r.text.split(' ')
x=int(problem[0])
y=int(problem[1])
print x
print y
print "Solving..."
ans=solve(x,y)
ans="\n".join(ans)
print ans
r=requests.post('http://172.16.108.157/post', {'token': 'sauhor','answer': ans})
print r
print r.text


text:
using Scada.Comm.Channels;
using System;
using System.Collections.Generic;
using System.IO.Ports;

namespace Scada.Comm
{
    /// <summary>
    /// Serial port utilities
    /// <para>Вспомогательные методы для работы с последовательным портом</para>
    /// </summary>
    [Obsolete("Use communication channels")]
    public static class SerialPortUtils
    {
        /// <summary>
        /// Вспомогательный класс соединения через последовательный порт, позволяющий изменять порт
        /// </summary>
        private class AuxSerialConnection : SerialConnection
        {
            /// <summary>
            /// Конструктор
            /// </summary>
            public AuxSerialConnection()
            {
                SerialPort = null;
            }
            /// <summary>
            /// Установить последовательный порт соединения
            /// </summary>
            public void SetSerialPort(SerialPort serialPort)
            {
                SerialPort = serialPort;
            }
        }

        /// <summary>
        /// Сообщение о невозможности отправки данных
        /// </summary>
        public static readonly string WriteDataImpossible;
        /// <summary>
        /// Сообщение о невозможности отправки строк
        /// </summary>
        public static readonly string WriteLineImpossible;
        /// <summary>
        /// Сообщение о невозможности приёма данных
        /// </summary>
        public static readonly string ReadDataImpossible;
        /// <summary>
        /// Сообщение о невозможности приёма строк
        /// </summary>
        public static readonly string ReadLinesImpossible;

        /// <summary>
        /// Соединение через последовательный порт
        /// </summary>
        private static AuxSerialConnection serialConn;

        /// <summary>
        /// Статический конструктор
        /// </summary>
        static SerialPortUtils()
        {
            // инициализция фраз
            if (Localization.UseRussian)
            {
                WriteDataImpossible = "Отправка данных невозможна, т.к. порт не инициализирован";
                WriteLineImpossible = "Отправка строки невозможна, т.к. порт не инициализирован";
                ReadDataImpossible = "Приём данных невозможен, т.к. порт не инициализирован";
                ReadLinesImpossible = "Приём строки невозможен, т.к. порт не инициализирован";
            }
            else
            {
                WriteDataImpossible = "Sending data is impossible because the port is not initialized";
                WriteLineImpossible = "Sending string is impossible because the port is not initialized";
                ReadDataImpossible = "Receiving data is impossible because the port is not initialized";
                ReadLinesImpossible = "Receiving string is impossible because the port is not initialized";
            }

            // создание объекта соединения
            serialConn = new AuxSerialConnection();
        }

        /// <summary>
        /// Записать данные в последовательный порт
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер передаваемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="count">Количество передаваемых байт</param>
        /// <param name="logFormat">Формат вывода данных в журнал</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        public static void WriteToSerialPort(SerialPort serialPort, byte[] buffer, int index, int count,
            CommUtils.ProtocolLogFormats logFormat, out string logText)
        {
            try
            {
                if (serialPort == null)
                {
                    logText = WriteDataImpossible;
                }
                else
                {
                    serialConn.SetSerialPort(serialPort);
                    serialConn.Write(buffer, index, count, logFormat, out logText);
                }
            }
            catch (Exception ex)
            {
                logText = ex.Message;
            }
        }

        /// <summary>
        /// Записать данные в последовательный порт
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер передаваемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="count">Количество передаваемых байт</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        public static void WriteToSerialPort(SerialPort serialPort, byte[] buffer, int index, int count, out string logText)
        {
            WriteToSerialPort(serialPort, buffer, index, count, CommUtils.ProtocolLogFormats.Hex, out logText);
        }

        /// <summary>
        /// Записать строку в последовательный порт
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="text">Записываемая в порт строка</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        public static void WriteLineToSerialPort(SerialPort serialPort, string text, out string logText)
        {
            try
            {
                if (serialPort == null)
                {
                    logText = WriteLineImpossible;
                }
                else
                {
                    serialConn.SetSerialPort(serialPort);
                    serialConn.WriteLine(text, out logText);
                }
            }
            catch (Exception ex)
            {
                logText = ex.Message;
            }
        }

        /// <summary>
        /// Считать данные из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер принимаемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="count">Количество принимаемых байт</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="logFormat">Формат вывода данных в журнал</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Количество считанных байт</returns>
        public static int ReadFromSerialPort(SerialPort serialPort, byte[] buffer, int index, int count,
            int timeout, bool wait /*игнорируется*/, CommUtils.ProtocolLogFormats logFormat, out string logText)
        {
            try
            {
                if (serialPort == null)
                {
                    logText = ReadDataImpossible;
                    return 0;
                }
                else
                {
                    serialConn.SetSerialPort(serialPort);
                    return serialConn.Read(buffer, index, count, timeout, logFormat, out logText);
                }
            }
            catch (Exception ex)
            {
                logText = ex.Message;
                return 0;
            }
        }

        /// <summary>
        /// Считать данные из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер принимаемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="count">Количество принимаемых байт</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Количество считанных байт</returns>
        public static int ReadFromSerialPort(SerialPort serialPort, byte[] buffer, int index, int count,
            int timeout, bool wait /*игнорируется*/, out string logText)
        {
            return ReadFromSerialPort(serialPort, buffer, index, count,
                timeout, wait, CommUtils.ProtocolLogFormats.Hex, out logText);
        }

        /// <summary>
        /// Считать данные из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер принимаемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="maxCount">Максимальное количество принимаемых байт</param>
        /// <param name="stopCode">Байт, означающий окончание считывания данных</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="logFormat">Формат вывода данных в журнал</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Количество считанных байт</returns>
        public static int ReadFromSerialPort(SerialPort serialPort, byte[] buffer, int index, int maxCount,
            byte stopCode, int timeout, bool wait /*игнорируется*/, CommUtils.ProtocolLogFormats logFormat,
            out string logText)
        {
            try
            {
                if (serialPort == null)
                {
                    logText = ReadDataImpossible;
                    return 0;
                }
                else
                {
                    serialConn.SetSerialPort(serialPort);
                    bool stopReceived;
                    return serialConn.Read(buffer, index, maxCount, timeout, new Connection.BinStopCondition(stopCode),
                        out stopReceived, logFormat, out logText);
                }
            }
            catch (Exception ex)
            {
                logText = ex.Message;
                return 0;
            }
        }

        /// <summary>
        /// Считать данные из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="buffer">Буфер принимаемых данных</param>
        /// <param name="index">Начальный индекс в буфере</param>
        /// <param name="maxCount">Максимальное количество принимаемых байт</param>
        /// <param name="stopCode">Байт, означающий окончание считывания данных</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Количество считанных байт</returns>
        public static int ReadFromSerialPort(SerialPort serialPort, byte[] buffer, int index, int maxCount,
            byte stopCode, int timeout, bool wait /*игнорируется*/, out string logText)
        {
            return ReadFromSerialPort(serialPort, buffer, index, maxCount,
                stopCode, timeout, wait, CommUtils.ProtocolLogFormats.Hex, out logText);
        }

        /// <summary>
        /// Считать строки из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="endLine">Строка, при получении которой завершить приём данных</param>
        /// <param name="endFound">Призкак получения завершающей строки</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Считанные из последовательного порта строки</returns>
        public static List<string> ReadLinesFromSerialPort(SerialPort serialPort, int timeout,
            bool wait /*игнорируется*/, string endLine, out bool endFound, out string logText)
        {
            return ReadLinesFromSerialPort(serialPort, timeout, wait,
                string.IsNullOrEmpty(endLine) ? null : new string[] { endLine }, out endFound, out logText);
        }

        /// <summary>
        /// Считать строки из последовательного порта
        /// </summary>
        /// <param name="serialPort">Последовательный порт</param>
        /// <param name="timeout">Таймаут чтения данных, мс</param>
        /// <param name="wait">Ожидать завершения таймаута после окончания чтения</param>
        /// <param name="endLines">Массив строк, при получении которых завершить приём данных</param>
        /// <param name="endFound">Призкак получения завершающей строки</param>
        /// <param name="logText">Строка для вывода в журнал</param>
        /// <returns>Считанные из последовательного порта строки</returns>
        public static List<string> ReadLinesFromSerialPort(SerialPort serialPort, int timeout,
            bool wait /*игнорируется*/, string[] endLines, out bool endFound, out string logText)
        {
            try
            {
                if (serialPort == null)
                {
                    logText = ReadLinesImpossible;
                    endFound = false;
                    return new List<string>();
                }
                else
                {
                    serialConn.SetSerialPort(serialPort);
                    return serialConn.ReadLines(timeout, new Connection.TextStopCondition(endLines),
                        out endFound, out logText);
                }
            }
            catch (Exception ex)
            {
                logText = ex.Message;
                endFound = false;
                return new List<string>();
            }
        }
    }
}


text:
$(function() {
    function aPost(showConfirm) {
        if (showConfirm && !confirm('Are you sure?')) {
            return;
        }
        var csrfToken = $(this).data('csrf-token'),
            csrfTokenInput = $('<input>')
                .attr('type', 'hidden')
                .attr('name', 'csrfmiddlewaretoken')
                .val(csrfToken);
        $('<form>')
            .attr('action', $(this).attr('href'))
            .attr('method', 'post')
            .append(csrfTokenInput)
            .appendTo($('body'))
            .submit();
    }

    $('*[data-action="confirm-post"]').click(function(e) {
        e.preventDefault();
        aPost.apply(this, [true]);
    });

    $('*[data-action="post"]').click(function(e) {
        e.preventDefault();
        aPost.apply(this, [false]);
    });

    $('*[data-toggle="tooltip"]').tooltip();
});


text:
/* eslint-disable */
import assert from 'assert'
import { transform } from 'babel-standalone'

// SET TO TRUE WHEN QA IS COMPLETE:
export const QA = false;

// ---------------------------- define challenge title ----------------------------
export const challengeTitle = `<span class = 'default'>Challenge: </span>Create a Redux Store`

// ---------------------------- challenge text ----------------------------
export const challengeText = `<span class = 'default'>Intro: </span>_CHALLENGE_TEXT_`

// ---------------------------- challenge instructions ----------------------------
export const challengeInstructions = `<span class = 'default'>Instructions: </span>Create a redux store with the Redux method
createStore() and initalize its state to be 5.`

// ---------------------------- define challenge seed code ----------------------------
export const seedCode =
`// Redux methods are available from a Redux object
// For example: Redux.createStore()
// Define the store here:`

// ---------------------------- define challenge solution code ----------------------------
export const solutionCode =
`const store = Redux.createStore(
	(state = 5) => state
);`

// ---------------------------- define challenge tests ----------------------------

export const executeTests = (code) => {

	const error_0 = 'Your JSX code was transpiled successfully.';
	const error_1 = 'The redux store has a value of 5 for the state.';
	const error_2 = '';
	const error_3 = '';

	let testResults = [
		{
			test: 0,
			status: false,
			condition: error_0
		},
		{
			test: 1,
			status: false,
			condition: error_1
		},
		{
			test: 2,
			status: false,
			condition: error_2
		},
		{
			test: 3,
			status: false,
			condition: error_3
		}
	];

	let es5, store, passed = true;

	// this code hijacks the user input to create an IIFE
	// which returns the store from Redux as an object
	// or whatever you need from the client code
	const prepend = `(function() {`
	const apend = `;\n return store })()`
	const modifiedCode = prepend.concat(code).concat(apend);

	// test 0: try to transpile JSX, ES6 code to ES5 in browser
	try {
		es5 = transform(modifiedCode, { presets: [ 'es2015', 'react' ] }).code;
		testResults[0].status = true;
	} catch (err) {
		passed = false;
		testResults[0].status = false;
	}

	// save the store from redux to test here
	// now you can access the redux store methods
	try {
		store = eval(es5)
	} catch (err) {
		passed = false;
	}

	// test 1:
	try {

		testResults[1].status = true;
	} catch (err) {
		passed = false;
		testResults[1].status = false;
	}

	// test 2:
	try {

		testResults[2].status = true;
	} catch (err) {
		passed = false;
		testResults[2].status = false;
	}

	// test 3:
	try {

		testResults[3].status = true;
	} catch (err) {
		passed = false;
		testResults[3].status = false;
	}

	return {
		passed,
		testResults
	}

}

// liveRender modifies console.log in user input and returns message data -----------------------
export const liveRender = (code) => {

	// this code modifies the user input to return all
	// console.log statements as a message array to be
	// displayed on the client UI
	const prepend = `
	(function() {
		let __Custom__Log = []
		const message = (msg) => __Custom__Log.push(msg);
	`
	const apend = `; return __Custom__Log })();`
	const consoleReplaced = code.replace(/console.log/g, 'message');
	const hijackedCode = prepend.concat(consoleReplaced).concat(apend);

	let evaluatedCode;
	try {
		evaluatedCode = eval(hijackedCode);
	} catch (err) {
		console.log(err);
	}

	return evaluatedCode;

}


text:
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
const _excluded = ["className", "delay", "FabProps", "icon", "id", "open", "TooltipClasses", "tooltipOpen", "tooltipPlacement", "tooltipTitle"];
// @inheritedComponent Tooltip
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { unstable_composeClasses as composeClasses } from '@material-ui/unstyled';
import { emphasize } from '@material-ui/system';
import styled from '../styles/styled';
import useThemeProps from '../styles/useThemeProps';
import Fab from '../Fab';
import Tooltip from '../Tooltip';
import capitalize from '../utils/capitalize';
import speedDialActionClasses, { getSpeedDialActionUtilityClass } from './speedDialActionClasses';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";

const useUtilityClasses = styleProps => {
  const {
    open,
    tooltipPlacement,
    classes
  } = styleProps;
  const slots = {
    fab: ['fab', !open && 'fabClosed'],
    staticTooltip: ['staticTooltip', `tooltipPlacement${capitalize(tooltipPlacement)}`, !open && 'staticTooltipClosed'],
    staticTooltipLabel: ['staticTooltipLabel']
  };
  return composeClasses(slots, getSpeedDialActionUtilityClass, classes);
};

const SpeedDialActionFab = styled(Fab, {
  name: 'MuiSpeedDialAction',
  slot: 'Fab',
  skipVariantsResolver: false,
  overridesResolver: (props, styles) => {
    const {
      styleProps
    } = props;
    return _extends({}, styles.fab, !styleProps.open && styles.fabClosed);
  }
})(({
  theme,
  styleProps
}) => _extends({
  margin: 8,
  color: theme.palette.text.secondary,
  backgroundColor: theme.palette.background.paper,
  '&:hover': {
    backgroundColor: emphasize(theme.palette.background.paper, 0.15)
  },
  transition: `${theme.transitions.create('transform', {
    duration: theme.transitions.duration.shorter
  })}, opacity 0.8s`,
  opacity: 1
}, !styleProps.open && {
  opacity: 0,
  transform: 'scale(0)'
}));
const SpeedDialActionStaticTooltip = styled('span', {
  name: 'MuiSpeedDialAction',
  slot: 'StaticTooltip',
  overridesResolver: (props, styles) => {
    const {
      styleProps
    } = props;
    return _extends({}, styles.staticTooltip, !styleProps.open && styles.staticTooltipClosed, styles[`tooltipPlacement${capitalize(styleProps.tooltipPlacement)}`]);
  }
})(({
  theme,
  styleProps
}) => ({
  position: 'relative',
  display: 'flex',
  alignItems: 'center',
  [`& .${speedDialActionClasses.staticTooltipLabel}`]: _extends({
    transition: theme.transitions.create(['transform', 'opacity'], {
      duration: theme.transitions.duration.shorter
    }),
    opacity: 1
  }, !styleProps.open && {
    opacity: 0,
    transform: 'scale(0.5)'
  }, styleProps.tooltipPlacement === 'left' && {
    transformOrigin: '100% 50%',
    right: '100%',
    marginRight: 8
  }, styleProps.tooltipPlacement === 'right' && {
    transformOrigin: '0% 50%',
    left: '100%',
    marginLeft: 8
  })
}));
const SpeedDialActionStaticTooltipLabel = styled('span', {
  name: 'MuiSpeedDialAction',
  slot: 'StaticTooltipLabel',
  overridesResolver: (props, styles) => styles.staticTooltipLabel
})(({
  theme
}) => _extends({
  position: 'absolute'
}, theme.typography.body1, {
  backgroundColor: theme.palette.background.paper,
  borderRadius: theme.shape.borderRadius,
  boxShadow: theme.shadows[1],
  color: theme.palette.text.secondary,
  padding: '4px 16px',
  wordBreak: 'keep-all'
}));
const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(inProps, ref) {
  const props = useThemeProps({
    props: inProps,
    name: 'MuiSpeedDialAction'
  });

  const {
    className,
    delay = 0,
    FabProps = {},
    icon,
    id,
    open,
    TooltipClasses,
    tooltipOpen: tooltipOpenProp = false,
    tooltipPlacement = 'left',
    tooltipTitle
  } = props,
        other = _objectWithoutPropertiesLoose(props, _excluded);

  const styleProps = _extends({}, props, {
    tooltipPlacement
  });

  const classes = useUtilityClasses(styleProps);
  const [tooltipOpen, setTooltipOpen] = React.useState(tooltipOpenProp);

  const handleTooltipClose = () => {
    setTooltipOpen(false);
  };

  const handleTooltipOpen = () => {
    setTooltipOpen(true);
  };

  const transitionStyle = {
    transitionDelay: `${delay}ms`
  };

  const fab = /*#__PURE__*/_jsx(SpeedDialActionFab, _extends({
    size: "small",
    className: clsx(classes.fab, className),
    tabIndex: -1,
    role: "menuitem",
    styleProps: styleProps
  }, FabProps, {
    style: _extends({}, transitionStyle, FabProps.style),
    children: icon
  }));

  if (tooltipOpenProp) {
    return /*#__PURE__*/_jsxs(SpeedDialActionStaticTooltip, _extends({
      id: id,
      ref: ref,
      className: classes.staticTooltip,
      styleProps: styleProps
    }, other, {
      children: [/*#__PURE__*/_jsx(SpeedDialActionStaticTooltipLabel, {
        style: transitionStyle,
        id: `${id}-label`,
        className: classes.staticTooltipLabel,
        styleProps: styleProps,
        children: tooltipTitle
      }), /*#__PURE__*/React.cloneElement(fab, {
        'aria-labelledby': `${id}-label`
      })]
    }));
  }

  if (!open && tooltipOpen) {
    setTooltipOpen(false);
  }

  return /*#__PURE__*/_jsx(Tooltip, _extends({
    id: id,
    ref: ref,
    title: tooltipTitle,
    placement: tooltipPlacement,
    onClose: handleTooltipClose,
    onOpen: handleTooltipOpen,
    open: open && tooltipOpen,
    classes: TooltipClasses
  }, other, {
    children: fab
  }));
});
process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes
/* remove-proptypes */
= {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit the d.ts file and run "yarn proptypes"     |
  // ----------------------------------------------------------------------

  /**
   * Override or extend the styles applied to the component.
   */
  classes: PropTypes.object,

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * Adds a transition delay, to allow a series of SpeedDialActions to be animated.
   * @default 0
   */
  delay: PropTypes.number,

  /**
   * Props applied to the [`Fab`](/api/fab/) component.
   * @default {}
   */
  FabProps: PropTypes.object,

  /**
   * The icon to display in the SpeedDial Fab.
   */
  icon: PropTypes.node,

  /**
   * This prop is used to help implement the accessibility logic.
   * If you don't provide this prop. It falls back to a randomly generated id.
   */
  id: PropTypes.string,

  /**
   * If `true`, the component is shown.
   */
  open: PropTypes.bool,

  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: PropTypes.object,

  /**
   * `classes` prop applied to the [`Tooltip`](/api/tooltip/) element.
   */
  TooltipClasses: PropTypes.object,

  /**
   * Make the tooltip always visible when the SpeedDial is open.
   * @default false
   */
  tooltipOpen: PropTypes.bool,

  /**
   * Placement of the tooltip.
   * @default 'left'
   */
  tooltipPlacement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),

  /**
   * Label to display in the tooltip.
   */
  tooltipTitle: PropTypes.node
} : void 0;
export default SpeedDialAction;


text:
InputPointerManager Properties
==============================

Properties
==========

<colgroup>
<col width="30%" />
<col width="60%" />
</colgroup>

Name
Description

KinectEngagementManager
Gets the IKinectEngagementManager object associated with the input pointer manager.

See also
========

#### Reference

[InputPointerManager Class](../InputPointerManager_Class.md)
 [Microsoft.Kinect.Toolkit.Input Namespace](../../Kinect.Toolkit.Input.md)


text:
chef-server-12 CHANGELOG
================================

This file is used to list changes made in each version of the chef-server-12 cookbook.

0.1.2
-----
- Salim Afiune - Added encrypted data bag and specs

0.1.0
-----
- Salim Afiune - Initial release of chef-server-12

- - -
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.

The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.


text:
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta

class AccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """AccessLevel."""

    NONE = "None"
    READ = "Read"

class CachingTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the caching requirements. :code:`<br>`:code:`<br>` Possible values are:
    :code:`<br>`:code:`<br>` **None** :code:`<br>`:code:`<br>` **ReadOnly**
    :code:`<br>`:code:`<br>` **ReadWrite** :code:`<br>`:code:`<br>` Default: **None for Standard
    storage. ReadOnly for Premium storage**.
    """

    NONE = "None"
    READ_ONLY = "ReadOnly"
    READ_WRITE = "ReadWrite"

class DiskCreateOption(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """This enumerates the possible sources of a disk's creation."""

    EMPTY = "Empty"
    ATTACH = "Attach"
    FROM_IMAGE = "FromImage"
    IMPORT = "Import"
    COPY = "Copy"
    RESTORE = "Restore"

class DiskCreateOptionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies how the virtual machine should be created.:code:`<br>`:code:`<br>` Possible values
    are::code:`<br>`:code:`<br>` **Attach** \u2013 This value is used when you are using a
    specialized disk to create the virtual machine.:code:`<br>`:code:`<br>` **FromImage** \u2013
    This value is used when you are using an image to create the virtual machine. If you are using
    a platform image, you also use the imageReference element described above. If you are using a
    marketplace image, you  also use the plan element previously described.
    """

    FROM_IMAGE = "FromImage"
    EMPTY = "Empty"
    ATTACH = "Attach"

class IntervalInMins(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Interval value in minutes used to create LogAnalytics call rate logs."""

    THREE_MINS = "ThreeMins"
    FIVE_MINS = "FiveMins"
    THIRTY_MINS = "ThirtyMins"
    SIXTY_MINS = "SixtyMins"

class IPVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Available from Api-Version 2017-03-30 onwards, it represents whether the specific
    ipconfiguration is IPv4 or IPv6. Default is taken as IPv4.  Possible values are: 'IPv4' and
    'IPv6'.
    """

    I_PV4 = "IPv4"
    I_PV6 = "IPv6"

class MaintenanceOperationResultCodeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The Last Maintenance Operation Result Code."""

    NONE = "None"
    RETRY_LATER = "RetryLater"
    MAINTENANCE_ABORTED = "MaintenanceAborted"
    MAINTENANCE_COMPLETED = "MaintenanceCompleted"

class OperatingSystemStateTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The OS State."""

    GENERALIZED = "Generalized"
    SPECIALIZED = "Specialized"

class OperatingSystemTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The operating system of the osDiskImage."""

    WINDOWS = "Windows"
    LINUX = "Linux"

class ProtocolTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the protocol of listener. :code:`<br>`:code:`<br>` Possible values are: :code:`<br>`\
    **http** :code:`<br>`:code:`<br>` **https**.
    """

    HTTP = "Http"
    HTTPS = "Https"

class ProximityPlacementGroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the type of the proximity placement group. :code:`<br>`:code:`<br>` Possible values
    are: :code:`<br>`:code:`<br>` **Standard** : Co-locate resources within an Azure region or
    Availability Zone. :code:`<br>`:code:`<br>` **Ultra** : For future use.
    """

    STANDARD = "Standard"
    ULTRA = "Ultra"

class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned'
    includes both an implicitly created identity and a set of user assigned identities. The type
    'None' will remove any identities from the virtual machine.
    """

    SYSTEM_ASSIGNED = "SystemAssigned"
    USER_ASSIGNED = "UserAssigned"
    SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned"
    NONE = "None"

class RollingUpgradeActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The last action performed on the rolling upgrade."""

    START = "Start"
    CANCEL = "Cancel"

class RollingUpgradeStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Code indicating the current status of the upgrade."""

    ROLLING_FORWARD = "RollingForward"
    CANCELLED = "Cancelled"
    COMPLETED = "Completed"
    FAULTED = "Faulted"

class SettingNames(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the name of the setting to which the content applies. Possible values are:
    FirstLogonCommands and AutoLogon.
    """

    AUTO_LOGON = "AutoLogon"
    FIRST_LOGON_COMMANDS = "FirstLogonCommands"

class SnapshotStorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The sku name."""

    STANDARD_LRS = "Standard_LRS"
    PREMIUM_LRS = "Premium_LRS"
    STANDARD_ZRS = "Standard_ZRS"

class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The level code."""

    INFO = "Info"
    WARNING = "Warning"
    ERROR = "Error"

class StorageAccountTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the storage account type for the managed disk. Possible values are: Standard_LRS,
    Premium_LRS, and StandardSSD_LRS.
    """

    STANDARD_LRS = "Standard_LRS"
    PREMIUM_LRS = "Premium_LRS"
    STANDARD_SSD_LRS = "StandardSSD_LRS"

class UpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`<br />`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You  control the application
    of updates to virtual machines in the scale set. You do this by using the manualUpgrade
    action.:code:`<br />`:code:`<br />` **Automatic** - All virtual machines in the scale set are
    automatically updated at the same time.
    """

    AUTOMATIC = "Automatic"
    MANUAL = "Manual"
    ROLLING = "Rolling"

class UpgradeOperationInvoker(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Invoker of the Upgrade Operation."""

    UNKNOWN = "Unknown"
    USER = "User"
    PLATFORM = "Platform"

class UpgradeState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Code indicating the current status of the upgrade."""

    ROLLING_FORWARD = "RollingForward"
    CANCELLED = "Cancelled"
    COMPLETED = "Completed"
    FAULTED = "Faulted"

class VirtualMachineEvictionPolicyTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the eviction policy for virtual machines in a low priority scale set.
    :code:`<br>`:code:`<br>`Minimum api-version: 2017-10-30-preview.
    """

    DEALLOCATE = "Deallocate"
    DELETE = "Delete"

class VirtualMachinePriorityTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the priority for the virtual machines in the scale set.
    :code:`<br>`:code:`<br>`Minimum api-version: 2017-10-30-preview.
    """

    REGULAR = "Regular"
    LOW = "Low"

class VirtualMachineScaleSetSkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The scale type applicable to the sku."""

    AUTOMATIC = "Automatic"
    NONE = "None"

class VirtualMachineSizeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Specifies the size of the virtual machine. For more information about virtual machine sizes,
    see `Sizes for virtual machines
    <https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json>`_.
    :code:`<br>`:code:`<br>` The available VM sizes depend on region and availability set. For a
    list of available sizes use these APIs:  :code:`<br>`:code:`<br>` `List all available virtual
    machine sizes in an availability set
    <https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes>`_
    :code:`<br>`:code:`<br>` `List all available virtual machine sizes in a region
    <https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list>`_
    :code:`<br>`:code:`<br>` `List all available virtual machine sizes for resizing
    <https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes>`_.
    """

    BASIC_A0 = "Basic_A0"
    BASIC_A1 = "Basic_A1"
    BASIC_A2 = "Basic_A2"
    BASIC_A3 = "Basic_A3"
    BASIC_A4 = "Basic_A4"
    STANDARD_A0 = "Standard_A0"
    STANDARD_A1 = "Standard_A1"
    STANDARD_A2 = "Standard_A2"
    STANDARD_A3 = "Standard_A3"
    STANDARD_A4 = "Standard_A4"
    STANDARD_A5 = "Standard_A5"
    STANDARD_A6 = "Standard_A6"
    STANDARD_A7 = "Standard_A7"
    STANDARD_A8 = "Standard_A8"
    STANDARD_A9 = "Standard_A9"
    STANDARD_A10 = "Standard_A10"
    STANDARD_A11 = "Standard_A11"
    STANDARD_A1_V2 = "Standard_A1_v2"
    STANDARD_A2_V2 = "Standard_A2_v2"
    STANDARD_A4_V2 = "Standard_A4_v2"
    STANDARD_A8_V2 = "Standard_A8_v2"
    STANDARD_A2_M_V2 = "Standard_A2m_v2"
    STANDARD_A4_M_V2 = "Standard_A4m_v2"
    STANDARD_A8_M_V2 = "Standard_A8m_v2"
    STANDARD_B1_S = "Standard_B1s"
    STANDARD_B1_MS = "Standard_B1ms"
    STANDARD_B2_S = "Standard_B2s"
    STANDARD_B2_MS = "Standard_B2ms"
    STANDARD_B4_MS = "Standard_B4ms"
    STANDARD_B8_MS = "Standard_B8ms"
    STANDARD_D1 = "Standard_D1"
    STANDARD_D2 = "Standard_D2"
    STANDARD_D3 = "Standard_D3"
    STANDARD_D4 = "Standard_D4"
    STANDARD_D11 = "Standard_D11"
    STANDARD_D12 = "Standard_D12"
    STANDARD_D13 = "Standard_D13"
    STANDARD_D14 = "Standard_D14"
    STANDARD_D1_V2 = "Standard_D1_v2"
    STANDARD_D2_V2 = "Standard_D2_v2"
    STANDARD_D3_V2 = "Standard_D3_v2"
    STANDARD_D4_V2 = "Standard_D4_v2"
    STANDARD_D5_V2 = "Standard_D5_v2"
    STANDARD_D2_V3 = "Standard_D2_v3"
    STANDARD_D4_V3 = "Standard_D4_v3"
    STANDARD_D8_V3 = "Standard_D8_v3"
    STANDARD_D16_V3 = "Standard_D16_v3"
    STANDARD_D32_V3 = "Standard_D32_v3"
    STANDARD_D64_V3 = "Standard_D64_v3"
    STANDARD_D2_S_V3 = "Standard_D2s_v3"
    STANDARD_D4_S_V3 = "Standard_D4s_v3"
    STANDARD_D8_S_V3 = "Standard_D8s_v3"
    STANDARD_D16_S_V3 = "Standard_D16s_v3"
    STANDARD_D32_S_V3 = "Standard_D32s_v3"
    STANDARD_D64_S_V3 = "Standard_D64s_v3"
    STANDARD_D11_V2 = "Standard_D11_v2"
    STANDARD_D12_V2 = "Standard_D12_v2"
    STANDARD_D13_V2 = "Standard_D13_v2"
    STANDARD_D14_V2 = "Standard_D14_v2"
    STANDARD_D15_V2 = "Standard_D15_v2"
    STANDARD_DS1 = "Standard_DS1"
    STANDARD_DS2 = "Standard_DS2"
    STANDARD_DS3 = "Standard_DS3"
    STANDARD_DS4 = "Standard_DS4"
    STANDARD_DS11 = "Standard_DS11"
    STANDARD_DS12 = "Standard_DS12"
    STANDARD_DS13 = "Standard_DS13"
    STANDARD_DS14 = "Standard_DS14"
    STANDARD_DS1_V2 = "Standard_DS1_v2"
    STANDARD_DS2_V2 = "Standard_DS2_v2"
    STANDARD_DS3_V2 = "Standard_DS3_v2"
    STANDARD_DS4_V2 = "Standard_DS4_v2"
    STANDARD_DS5_V2 = "Standard_DS5_v2"
    STANDARD_DS11_V2 = "Standard_DS11_v2"
    STANDARD_DS12_V2 = "Standard_DS12_v2"
    STANDARD_DS13_V2 = "Standard_DS13_v2"
    STANDARD_DS14_V2 = "Standard_DS14_v2"
    STANDARD_DS15_V2 = "Standard_DS15_v2"
    STANDARD_DS13_4_V2 = "Standard_DS13-4_v2"
    STANDARD_DS13_2_V2 = "Standard_DS13-2_v2"
    STANDARD_DS14_8_V2 = "Standard_DS14-8_v2"
    STANDARD_DS14_4_V2 = "Standard_DS14-4_v2"
    STANDARD_E2_V3 = "Standard_E2_v3"
    STANDARD_E4_V3 = "Standard_E4_v3"
    STANDARD_E8_V3 = "Standard_E8_v3"
    STANDARD_E16_V3 = "Standard_E16_v3"
    STANDARD_E32_V3 = "Standard_E32_v3"
    STANDARD_E64_V3 = "Standard_E64_v3"
    STANDARD_E2_S_V3 = "Standard_E2s_v3"
    STANDARD_E4_S_V3 = "Standard_E4s_v3"
    STANDARD_E8_S_V3 = "Standard_E8s_v3"
    STANDARD_E16_S_V3 = "Standard_E16s_v3"
    STANDARD_E32_S_V3 = "Standard_E32s_v3"
    STANDARD_E64_S_V3 = "Standard_E64s_v3"
    STANDARD_E32_16_V3 = "Standard_E32-16_v3"
    STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3"
    STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3"
    STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3"
    STANDARD_F1 = "Standard_F1"
    STANDARD_F2 = "Standard_F2"
    STANDARD_F4 = "Standard_F4"
    STANDARD_F8 = "Standard_F8"
    STANDARD_F16 = "Standard_F16"
    STANDARD_F1_S = "Standard_F1s"
    STANDARD_F2_S = "Standard_F2s"
    STANDARD_F4_S = "Standard_F4s"
    STANDARD_F8_S = "Standard_F8s"
    STANDARD_F16_S = "Standard_F16s"
    STANDARD_F2_S_V2 = "Standard_F2s_v2"
    STANDARD_F4_S_V2 = "Standard_F4s_v2"
    STANDARD_F8_S_V2 = "Standard_F8s_v2"
    STANDARD_F16_S_V2 = "Standard_F16s_v2"
    STANDARD_F32_S_V2 = "Standard_F32s_v2"
    STANDARD_F64_S_V2 = "Standard_F64s_v2"
    STANDARD_F72_S_V2 = "Standard_F72s_v2"
    STANDARD_G1 = "Standard_G1"
    STANDARD_G2 = "Standard_G2"
    STANDARD_G3 = "Standard_G3"
    STANDARD_G4 = "Standard_G4"
    STANDARD_G5 = "Standard_G5"
    STANDARD_GS1 = "Standard_GS1"
    STANDARD_GS2 = "Standard_GS2"
    STANDARD_GS3 = "Standard_GS3"
    STANDARD_GS4 = "Standard_GS4"
    STANDARD_GS5 = "Standard_GS5"
    STANDARD_GS4_8 = "Standard_GS4-8"
    STANDARD_GS4_4 = "Standard_GS4-4"
    STANDARD_GS5_16 = "Standard_GS5-16"
    STANDARD_GS5_8 = "Standard_GS5-8"
    STANDARD_H8 = "Standard_H8"
    STANDARD_H16 = "Standard_H16"
    STANDARD_H8_M = "Standard_H8m"
    STANDARD_H16_M = "Standard_H16m"
    STANDARD_H16_R = "Standard_H16r"
    STANDARD_H16_MR = "Standard_H16mr"
    STANDARD_L4_S = "Standard_L4s"
    STANDARD_L8_S = "Standard_L8s"
    STANDARD_L16_S = "Standard_L16s"
    STANDARD_L32_S = "Standard_L32s"
    STANDARD_M64_S = "Standard_M64s"
    STANDARD_M64_MS = "Standard_M64ms"
    STANDARD_M128_S = "Standard_M128s"
    STANDARD_M128_MS = "Standard_M128ms"
    STANDARD_M64_32_MS = "Standard_M64-32ms"
    STANDARD_M64_16_MS = "Standard_M64-16ms"
    STANDARD_M128_64_MS = "Standard_M128-64ms"
    STANDARD_M128_32_MS = "Standard_M128-32ms"
    STANDARD_NC6 = "Standard_NC6"
    STANDARD_NC12 = "Standard_NC12"
    STANDARD_NC24 = "Standard_NC24"
    STANDARD_NC24_R = "Standard_NC24r"
    STANDARD_NC6_S_V2 = "Standard_NC6s_v2"
    STANDARD_NC12_S_V2 = "Standard_NC12s_v2"
    STANDARD_NC24_S_V2 = "Standard_NC24s_v2"
    STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2"
    STANDARD_NC6_S_V3 = "Standard_NC6s_v3"
    STANDARD_NC12_S_V3 = "Standard_NC12s_v3"
    STANDARD_NC24_S_V3 = "Standard_NC24s_v3"
    STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3"
    STANDARD_ND6_S = "Standard_ND6s"
    STANDARD_ND12_S = "Standard_ND12s"
    STANDARD_ND24_S = "Standard_ND24s"
    STANDARD_ND24_RS = "Standard_ND24rs"
    STANDARD_NV6 = "Standard_NV6"
    STANDARD_NV12 = "Standard_NV12"
    STANDARD_NV24 = "Standard_NV24"


text:
package com.connect_group.thymeleaf.testing.hamcrest;

import com.connect_group.thymesheet.query.HtmlElement;
import java.util.List;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.thymeleaf.dom.Comment;
import org.thymeleaf.dom.Element;
import org.thymeleaf.dom.Node;
import org.thymeleaf.dom.Text;

public class HasOnlyText extends TypeSafeMatcher<HtmlElement> {

  private final String value;

  public HasOnlyText(String value) {
    this.value = value;
  }

  @Override
  public void describeTo(Description description) {
    description.appendText("has text ").appendValue(value);

  }

  @Override
  public boolean matchesSafely(HtmlElement item) {
    StringBuilder text = new StringBuilder();
    boolean fail = false;

    Element element = item.getElement();
    if (element != null && element.hasChildren()) {
      List<Node> children = element.getChildren();

      for (Node child : children) {
        if (child instanceof Text) {
          text.append(((Text) child).getContent());
        } else if (!(child instanceof Comment)) {
          fail = true;
          break;
        }
      }
    }

    return !fail && text.toString().equals(value);
  }

}


text:
namespace IdentityBase.EntityFramework.UnitTests.Mappers
{
    using IdentityBase.EntityFramework.Mappers;
    using IdentityServer4.Models;
    using Xunit;

    public class PersistedGrantMappersTests
    {
        [Fact]
        public void PersistedGrantAutomapperConfigurationIsValid()
        {
            var model = new PersistedGrant();
            var mappedEntity = model.ToEntity();
            var mappedModel = mappedEntity.ToModel();

            Assert.NotNull(mappedModel);
            Assert.NotNull(mappedEntity);

            PersistedGrantMappers.Mapper.ConfigurationProvider
                .AssertConfigurationIsValid();
        }
    }
}


text:
class AddSpreeFieldsToCustomUserTable < ActiveRecord::Migration
  def change
    add_column :spree_people, :spree_api_key, :string, :limit => 48
    add_column :spree_people, :ship_address_id, :integer
    add_column :spree_people, :bill_address_id, :integer
  end
end


text:
'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var React = require('react');
var StylePropable = require('./mixins/style-propable');
var Transitions = require('./styles/transitions');
var EnhancedSwitch = require('./enhanced-switch');
var RadioButtonOff = require('./svg-icons/toggle/radio-button-unchecked');
var RadioButtonOn = require('./svg-icons/toggle/radio-button-checked');

var RadioButton = React.createClass({
  displayName: 'RadioButton',

  mixins: [StylePropable],

  contextTypes: {
    muiTheme: React.PropTypes.object
  },

  propTypes: {
    iconStyle: React.PropTypes.object,
    labelStyle: React.PropTypes.object,
    onCheck: React.PropTypes.func
  },

  getTheme: function getTheme() {
    return this.context.muiTheme.component.radioButton;
  },

  getStyles: function getStyles() {
    var styles = {
      icon: {
        height: this.getTheme().size,
        width: this.getTheme().size
      },
      target: {
        transition: Transitions.easeOut(),
        position: 'absolute',
        opacity: 1,
        transform: 'scale(1)',
        fill: this.getTheme().borderColor
      },
      fill: {
        position: 'absolute',
        opacity: 1,
        transform: 'scale(0)',
        transformOrigin: '50% 50%',
        transition: Transitions.easeOut(),
        fill: this.getTheme().checkedColor
      },
      targetWhenChecked: {
        opacity: 0,
        transform: 'scale(0)'
      },
      fillWhenChecked: {
        opacity: 1,
        transform: 'scale(1)'
      },
      targetWhenDisabled: {
        fill: this.getTheme().disabledColor
      },
      fillWhenDisabled: {
        fill: this.getTheme().disabledColor
      },
      label: {
        color: this.props.disabled ? this.getTheme().labelDisabledColor : this.getTheme().labelColor
      }
    };

    return styles;
  },

  render: function render() {
    var _props = this.props;
    var onCheck = _props.onCheck;

    var other = _objectWithoutProperties(_props, ['onCheck']);

    var styles = this.getStyles();
    var onStyles = this.mergeAndPrefix(styles.target, this.props.checked && styles.targetWhenChecked, this.props.iconStyle, this.props.disabled && styles.targetWhenDisabled);
    var offStyles = this.mergeAndPrefix(styles.fill, this.props.checked && styles.fillWhenChecked, this.props.iconStyle, this.props.disabled && styles.fillWhenDisabled);

    var radioButtonElement = React.createElement(
      'div',
      null,
      React.createElement(RadioButtonOff, { style: onStyles }),
      React.createElement(RadioButtonOn, { style: offStyles })
    );

    var rippleColor = this.props.checked ? this.getTheme().checkedColor : this.getTheme().borderColor;

    var iconStyle = this.mergeAndPrefix(styles.icon, this.props.iconStyle);

    var labelStyle = this.mergeAndPrefix(styles.label, this.props.labelStyle);

    var enhancedSwitchProps = {
      ref: 'enhancedSwitch',
      inputType: 'radio',
      switched: this.props.checked || false,
      switchElement: radioButtonElement,
      rippleColor: rippleColor,
      iconStyle: iconStyle,
      labelStyle: labelStyle,
      onSwitch: this._handleCheck,
      onParentShouldUpdate: this._handleStateChange,
      labelPosition: this.props.labelPosition ? this.props.labelPosition : 'right'
    };

    return React.createElement(EnhancedSwitch, _extends({}, other, enhancedSwitchProps));
  },

  // Only called when selected, not when unselected.
  _handleCheck: function _handleCheck(e) {
    if (this.props.onCheck) this.props.onCheck(e, this.props.value);
  },

  _handleStateChange: function _handleStateChange() {},

  isChecked: function isChecked() {
    return this.refs.enhancedSwitch.isSwitched();
  },

  // Use RadioButtonGroup.setSelectedValue(newSelectionValue) to set a
  // RadioButton's checked value.
  setChecked: function setChecked(newCheckedValue) {
    this.refs.enhancedSwitch.setSwitched(newCheckedValue);
  },

  getValue: function getValue() {
    return this.refs.enhancedSwitch.getValue();
  }

});

module.exports = RadioButton;


text:
const ANNOTATION_PREFIX = 'Annots';

/**
 * Append PDF Page with annotations.
 *
 * @param {any} pdfWriter - Hummus writer.
 * @param {string|any} sourcePDFPath - The path for the output pdfs or Reader stream.
 * @param {number} pageNumber - page number.
 * @param {any} [options={}] - appendPDFPageFromPDF options
 */
function appendPDFPageFromPDFWithAnnotations(pdfWriter, sourcePDFPath, pageNumber) {
    const cpyCxt = pdfWriter.createPDFCopyingContext(sourcePDFPath);
    const cpyCxtParser = cpyCxt.getSourceDocumentParser();
    const pageDictionary = cpyCxtParser.parsePageDictionary(pageNumber);

    if (!pageDictionary.exists(ANNOTATION_PREFIX)) {
        cpyCxt.appendPDFPageFromPDF(pageNumber);
    } else {
        let reffedObjects;
        pdfWriter.getEvents().once('OnPageWrite', params => {
            params.pageDictionaryContext.writeKey(ANNOTATION_PREFIX);
            reffedObjects = cpyCxt.copyDirectObjectWithDeepCopy(pageDictionary.queryObject(ANNOTATION_PREFIX));
        });

        cpyCxt.appendPDFPageFromPDF(pageNumber);

        if (reffedObjects && reffedObjects.length > 0) {
            cpyCxt.copyNewObjectsForDirectObject(reffedObjects);
        }
    }
}

/**
 * Append PDF Pages with annotations.
 *
 * @param {any} pdfWriter - Hummus writer.
 * @param {string|any} sourcePDFPath - The path for the output pdfs or Reader stream.
 * @param {any} [options={}] - appendPDFPagesFromPDF options
 */
function appendPDFPagesFromPDFWithAnnotations(pdfWriter, sourcePDFPath, options = {}) {
    const cpyCxt = pdfWriter.createPDFCopyingContext(sourcePDFPath);
    const cpyCxtParser = cpyCxt.getSourceDocumentParser();

    if (options.specificRanges && options.specificRanges.length) {
        for (const [start, end] of options.specificRanges) {
            for (let i = start; i <= end; ++i) {
                appendPDFPageFromPDFWithAnnotations(pdfWriter, sourcePDFPath, i);
            }
        }
    } else {
        for (let i = 0; i < cpyCxtParser.getPagesCount(); ++i) {
            appendPDFPageFromPDFWithAnnotations(pdfWriter, sourcePDFPath, i);
        }
    }
}

exports.ANNOTATION_PREFIX = ANNOTATION_PREFIX;
exports.appendPDFPageFromPDFWithAnnotations = appendPDFPageFromPDFWithAnnotations;
exports.appendPDFPagesFromPDFWithAnnotations = appendPDFPagesFromPDFWithAnnotations;


text:
import React from 'react';
import Timeline from 'react-calendar-timeline';
import moment from 'moment';
import 'moment/locale/fr';
import { extendMoment } from 'moment-range';

export default class HolidaysTimeline extends React.Component {

  constructor(props) {
    super(props);
    moment.locale('fr');
  }

  getGroups() {
    const { run } = this.props;
    const groups = [];
    groups.push({
      id: 0,
      title: run.version.name,
    });
    for (const developer of run.developers) {
      groups.push({
        id: developer._id,
        title: `${developer.firstname} ${developer.lastname}`,
      });
    }
    groups.push({
      id: -1,
      title: 'Total',
    });
    return groups;
  }

  getVersionDevelopmentPeriod(run) {
    return {
      id: 'version_period',
      group: 0,
      title: 'Développement',
      start_time: run.version.startDate,
      end_time: run.version.freezeDate,
      className: 'version',
    };
  }

  getVersionFreezePeriod(run) {
    return {
      id: 'freeze_period',
      group: 0,
      title: 'Freeze/Validation',
      start_time: run.version.freezeDate,
      end_time: run.version.endDate,
      className: 'freeze',
    };
  }

  getLegalHolidayDateItem(developer, holiday) {
    const id = `holiday_${developer._id}_${holiday.date}`;
    return {
      id,
      group: developer._id,
      title: holiday.name,
      start_time: moment(holiday.date),
      end_time: moment(holiday.date).endOf('day'),
      className: 'holiday',
    };
  }

  getHolidayDateItem(developer, devHoliday) {
    const id = `devholiday_${developer._id}_${devHoliday.date}`;
    return {
      id,
      group: devHoliday.developerId,
      title: devHoliday.halfDay ? developer.devRatio / 200 : 0,
      start_time: devHoliday.date,
      end_time: moment(devHoliday.date).endOf('day'),
      className: devHoliday.halfDay ? 'halfday' : 'fullday',
    };
  }

  getDevDateItem(developer, day) {
    const id = `devdate_${developer._id}_${day}`;
    return {
      id,
      group: developer._id,
      title: developer.devRatio / 100,
      start_time: day,
      end_time: moment(day).endOf('day'),
      className: 'development',
    };
  }

  findHoliday(day) {
    const { run } = this.props;
    for (const holiday of run.holidays) {
      if (moment(holiday.date).isSame(day, 'day')) {
        return holiday;
      }
    }
    return null;
  }

  findDevHoliday(day, developer) {
    const { run } = this.props;
    for (const devHoliday of run.devHolidays) {
      if (devHoliday.developerId === developer._id && devHoliday.date.isSame(day, 'day')) {
        return devHoliday;
      }
    }
    return null;
  }

  buildTimelineItemAt(developer, day) {
    const legalHoliday = this.findHoliday(day);
    if (legalHoliday != null) {
      return this.getLegalHolidayDateItem(developer, legalHoliday);
    }
    const devHoliday = this.findDevHoliday(day, developer);
    if (devHoliday != null) {
      return this.getHolidayDateItem(developer, devHoliday);
    }
    return this.getDevDateItem(developer, day);
  }

  buildWeekItemBetween(startOfWeek, endOfWeek, actualDevDays, totalDevDays) {
    return {
      id: `week_${startOfWeek}`,
      group: -1,
      title: `${actualDevDays} jours (${totalDevDays})`,
      start_time: startOfWeek,
      end_time: endOfWeek,
      className: 'total-week',
    };
  }

  isNumeric(num) {
    return !isNaN(num);
  }

  getDateItems() {
    const exMoment = extendMoment(moment);
    const { run } = this.props;
    const dateItems = [];

    dateItems.push(this.getVersionDevelopmentPeriod(run));
    dateItems.push(this.getVersionFreezePeriod(run));

    const versionRange = exMoment.range(run.version.startDate, moment(run.version.freezeDate));
    for (const firstWeekDay of versionRange.by('week')) {
      const monday = moment(firstWeekDay).startOf('week');
      const friday = moment(monday).add(4, 'day').endOf('day');

      const startOfWeek = moment(monday).isAfter(run.version.startDate) ? moment(monday) : moment(run.version.startDate);
      const endOfWeek = moment(friday).isAfter(run.version.freezeDate) ? moment(run.version.freezeDate).subtract(1, 'day').endOf('day') : moment(friday);

      const weekRange = exMoment.range(startOfWeek, endOfWeek);
      let actualDevDays = 0;
      let totalDevDays = 0;
      for (const day of weekRange.by('day')) {
        for (const developer of run.developers) {
          const timelineDay = this.buildTimelineItemAt(developer, day);
          if (this.isNumeric(timelineDay.title)) {
            actualDevDays += Number(timelineDay.title);
            totalDevDays += 1;
          }
          dateItems.push(timelineDay);
        }
      }

      dateItems.push(this.buildWeekItemBetween(startOfWeek, endOfWeek, actualDevDays, totalDevDays));
    }
    return dateItems;
  }

  render() {
    return <Timeline groups={this.getGroups()} items={this.getDateItems()} canMove={false} canChangeGroup={false} canResize={false}
              itemHeightRatio={1} defaultTimeStart={moment().startOf('week')}
              defaultTimeEnd={moment().add(2, 'week')}/>;
  }
}

HolidaysTimeline.propTypes = {
  run: React.PropTypes.object,
};


text:
<?xml version="1.1" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="cc.seeed.iot">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <!-- 获取手机的一些基本信息,设备号,版本号等-->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <!-- 主要针对文件上传时对文件的操作,这里有上传头像功能-->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- 日志上报-->
    <uses-permission android:name="android.permission.READ_LOGS" />
    <!-- 主要针对WiFi操作和网络操作使用-->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <!--获取任务信息,这里主要用于用户退出时,完全的退出 -->
    <uses-permission android:name="android.permission.GET_TASKS" />
    <!-- 系统弹窗-->
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <!-- google登录和分享时,获取google账号使用-->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

    <application
        android:name=".App"
        android:allowBackup="true"
        android:icon="@mipmap/logo"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <meta-data
            android:name="AA_DB_NAME"
            android:value="Wio.db" />
        <meta-data
            android:name="AA_DB_VERSION"
            android:value="5" />
        <meta-data
            android:name="AA_MODELS"
            android:value="cc.seeed.iot.webapi.model.Node,cc.seeed.iot.webapi.model.GroverDriver,cc.seeed.iot.ui_setnode.model.PinConfig" />
        <meta-data
            android:name="AA_SERIALIZERS"
            android:value="cc.seeed.iot.util.UtilListSerializer,cc.seeed.iot.util.UtilMapSerializer" />

        <provider
            android:name="com.activeandroid.content.ContentProvider"
            android:authorities="cc.seeed.iot.ap"
            android:enabled="true"
            android:exported="false">
        </provider>

        <activity
            android:name="cc.seeed.iot.ui_main.MainScreenActivity"
            android:launchMode="singleTask"
            android:theme="@style/DrawTheme" />
        <activity android:name=".reserve_file.SetupIotLinkActivity" />
        <activity
            android:name=".activity.SetupDeviceActivity"
            android:launchMode="singleTop" />
        <activity android:name=".reserve_file.SetupIotNodeActivity" />
        <activity
            android:name=".activity.GroveDetailActivity"
            android:launchMode="singleTop" />
        <activity
            android:name=".activity.HelpActivity"
            android:launchMode="singleTop" />
        <activity
            android:name=".activity.PrivacyPolicyActivity"
            android:launchMode="singleTop" />
        <activity
            android:name=".activity.SelectServerActivity"
            android:launchMode="singleTop"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activity.user.BindEmailActivity"
            android:launchMode="singleTop"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activity.user.ResetPwd01Activity"
            android:launchMode="singleTop"
            android:windowSoftInputMode="stateHidden|adjustPan" />
        <activity
            android:name=".activity.user.ResetPwd02Activity"
            android:windowSoftInputMode="stateHidden|adjustPan" />
        <activity
            android:name=".activity.user.ResetPwd03Activity"
            android:windowSoftInputMode="stateHidden|adjustPan" />
        <activity android:name=".activity.add_step.Step01GoReadyActivity" />
        <activity android:name=".activity.add_step.Step03WifiWioListActivity" />
        <activity
            android:name=".activity.add_step.Step02WifiListActivity"
            android:windowSoftInputMode="stateHidden|adjustPan" />
        <activity android:name="cc.seeed.iot.ui_main.AboutActivity" />
        <activity android:name=".activity.GrovesActivity"/>
        <activity android:name=".activity.GroveResultActivity" />
        <activity android:name=".ui_main.WebActivity" />
        <activity android:name=".activity.NodeSettingActivity" />
        <activity android:name="cc.seeed.iot.ui_main.MainSettingActivity" />
        <activity android:name=".web.WebActivity"/>
        <activity android:name=".activity.FeedbackActivity"
            android:windowSoftInputMode="stateHidden|adjustPan"/>
        <activity android:name="cc.seeed.iot.activity.TestActivity"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activity.user.LoginAndRegistActivity"
            android:launchMode="singleTask"
            android:windowSoftInputMode="stateHidden|adjustPan" />
        <!-- launchMode="singleTop" 保证activity在栈顶的唯一性 -->
        <activity
            android:name=".activity.user.ChangePwdActivity"
            android:theme="@style/AppTheme.Dark" />
        <activity
            android:name=".activity.WelcomeActivity"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".activity.add_step.Step04ApConnectActivity" />
        <activity
            android:name="me.nereo.multi_image_selector.MultiImageSelectorActivity"
            android:configChanges="orientation|screenSize"
            android:launchMode="singleTop" />
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <activity
            android:name="com.umeng.socialize.editorpage.ShareActivity"
            android:theme="@style/Theme.UMDefault"
            android:excludeFromRecents="true"/>

        <activity
            android:name="com.umeng.socialize.handler.TwitterWebActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:label="@string/app_name" />

        <meta-data
            android:name="UMENG_APPKEY"
            android:value="5743f121e0f55a156400204c" >
        </meta-data>

        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider636196369868072"
            android:exported="true" />

        <activity
            android:name="com.mob.tools.MobUIShell"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <meta-data
            android:name="UMENG_CHANNEL"
            android:value="${UMENG_CHANNEL_VALUE}" />

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIzaSyDvkYAXcEaUIkSnoP7cBsaZq-9OZHgV6Hw"/>
    </application>

</manifest>


text:
var newBlock = require('./core/lg-new-block.js');

var lgLogic = require('./core/lg-logic');
var lgUtils = require('./core/lg-utilities');

module.exports = function lostRowDecl(css, settings, result) {
  css.walkDecls('lost-row', function lostRowDeclFunction(decl) {
    var declArr = [];
    var lostRow;
    var unit = settings.gridUnit;
    var lostRowRounder = settings.rounder;
    var lostRowGutter = settings.gutter;
    var lostRowFlexbox = settings.flexbox;
    var validUnits = ['%', 'vh'];

    if (decl.value !== 'none') {
      const sanitizedDecl = lgUtils.glueFractionMembers(decl.value);
      declArr = sanitizedDecl.split(' ');
      lostRow = declArr[0];

      if (declArr[1] !== undefined && declArr[1].search(/^\d/) !== -1) {
        lostRowGutter = declArr[1];
      }

      if (declArr.indexOf('flex') !== -1) {
        lostRowFlexbox = 'flex';
      }

      if (declArr.indexOf('no-flex') !== -1) {
        lostRowFlexbox = 'no-flex';
      }

      decl.parent.nodes.forEach(function lostRowRounderFunction(declaration) {
        if (declaration.prop === 'lost-row-rounder') {
          lostRowRounder = declaration.value;

          declaration.remove();
        }
      });

      decl.parent.nodes.forEach(function lostRowGutterFunction(declaration) {
        if (declaration.prop === 'lost-row-gutter') {
          lostRowGutter = declaration.value;

          declaration.remove();
        }
      });

      decl.parent.nodes.forEach(function lostRowFlexboxFunction(declaration) {
        if (declaration.prop === 'lost-row-flexbox') {
          if (declaration.value === 'flex') {
            lostRowFlexbox = 'flex';
          }

          declaration.remove();
        }
      });

      decl.parent.nodes.forEach((declaration) => {
        if (declaration.prop === 'lost-unit') {
          if (lgLogic.validateUnit(declaration.value, validUnits)) {
            unit = declaration.value;
          } else {
            decl.warn(
              result,
              `${declaration.value} is not a valid unit for lost-row`
            );
          }
          declaration.remove();
        }
      });

      decl.cloneBefore({
        prop: 'width',
        value: '100%',
      });

      if (lostRowFlexbox === 'flex') {
        decl.cloneBefore({
          prop: 'flex',
          value: '0 0 auto',
        });
      }

      if (lostRowGutter !== '0') {
        decl.cloneBefore({
          prop: 'height',
          value: lgLogic.calcValue(
            lostRow,
            lostRowGutter,
            lostRowRounder,
            unit
          ),
        });
      } else {
        decl.cloneBefore({
          prop: 'height',
          value: lgLogic.calcValue(
            lostRow,
            lostRowGutter,
            lostRowRounder,
            unit
          ),
        });
      }

      decl.cloneBefore({
        prop: 'margin-bottom',
        value: lostRowGutter,
      });

      newBlock(decl, ':last-child', ['margin-bottom'], [0]);
    } else {
      decl.cloneBefore({
        prop: 'width',
        value: 'auto',
      });

      decl.cloneBefore({
        prop: 'height',
        value: 'auto',
      });

      decl.cloneBefore({
        prop: 'margin-bottom',
        value: '0',
      });
    }

    decl.remove();
  });
};


text:
- auto-linking to the online-help would be extremely cool
- experiment: use images to to post images depending on the host (branch.qlik.com vs. github vs. qliksite.io)
- Gulp
	- Bump
	- Change package.json version automatically
	- Generate qliksite.yml file
	- git add
	- ideally change lastUpdate programmatically
	- rss to tutorial files?
- Assemble
	- find a good solution for co-authors

## Content
- Redo some of the screenshots (especially in the custom properties section)


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

#include "Socket.h"
#include "LinkedList.h"
#include "Clients.h"

/*BE
include "Socket"
include "LinkedList"
include "Clients"
BE*/

typedef unsigned int bool;

#define PRIVATE_PROTOCOL_VERSION 131  /**< protocol version used for noLocal subscriptions */
#define BAD_MQTT_PACKET -4				/**< completion code for an ill-formed packet */

enum msgTypes
{
	CONNECT = 1, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL,
	PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK,
	PINGREQ, PINGRESP, DISCONNECT
};

/**
 * Bitfields for the MQTT header byte.
 */
typedef union
{
	/*unsigned*/ char byte;	/**< the whole byte */
#if defined(REVERSED)
	struct
	{
		unsigned int type : 4;	/**< message type nibble */
		bool dup : 1;			/**< DUP flag bit */
		unsigned int qos : 2;	/**< QoS value, 0, 1 or 2 */
		bool retain : 1;		/**< retained flag bit */
	} bits;
#else
	struct
	{
		bool retain : 1;		/**< retained flag bit */
		unsigned int qos : 2;	/**< QoS value, 0, 1 or 2 */
		bool dup : 1;			/**< DUP flag bit */
		unsigned int type : 4;	/**< message type nibble */
	} bits;
#endif
} Header;

/**
 * Data for a connect packet.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	union
	{
		unsigned char all;	/**< all connect flags */
#if defined(REVERSED)
		struct
		{
            bool username : 1;                      /**< 3.1 user name */
            bool password : 1;                      /**< 3.1 password */
			bool willRetain : 1;		/**< will retain setting */
			unsigned int willQoS : 2;	/**< will QoS value */
			bool will : 1;			/**< will flag */
			bool cleanstart : 1;	/**< cleansession flag */
			int : 1;	/**< unused */
		} bits;
#else
		struct
		{
			int : 1;	/**< unused */
			bool cleanstart : 1;	/**< cleansession flag */
			bool will : 1;			/**< will flag */
			unsigned int willQoS : 2;	/**< will QoS value */
			bool willRetain : 1;		/**< will retain setting */
            bool password : 1;                      /**< 3.1 password */
            bool username : 1;                      /**< 3.1 user name */
		} bits;
#endif
	} flags;	/**< connect flags byte */

	char *Protocol, /**< MQTT protocol name */
		*clientID,	/**< string client id */
        *willTopic,	/**< will topic */
        *willMsg;	/**< will payload */

	int keepAliveTimer;		/**< keepalive timeout value in seconds */
	unsigned char version;	/**< MQTT version number */
	char *username;			/**< 3.1 username value */
	char *password;			/**< 3.1 password value */
} Connect;

/**
 * Data for a connack packet.
 */
typedef struct
{
	Header header; /**< MQTT header byte */
	char rc; /**< connack return code */
} Connack;

/**
 * Data for a packet with header only.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
} MQTTPacket;

/**
 * Data for a subscribe packet.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	int msgId;		/**< MQTT message id */
	List* topics;	/**< list of topic strings */
	List* qoss;		/**< list of corresponding QoSs */
	int noTopics;	/**< topic and qos count */
} Subscribe;

/**
 * Data for a suback packet.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	int msgId;		/**< MQTT message id */
	List* qoss;		/**< list of granted QoSs */
} Suback;

/**
 * Data for an unsubscribe packet.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	int msgId;		/**< MQTT message id */
	List* topics;	/**< list of topic strings */
	int noTopics;	/**< topic count */
} Unsubscribe;

/**
 * Data for a publish packet.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	char* topic;	/**< topic string */
	int msgId;		/**< MQTT message id */
	char* payload;	/**< binary payload, length delimited */
	int payloadlen;	/**< payload length */
} Publish;

/**
 * Data for one of the ack packets.
 */
typedef struct
{
	Header header;	/**< MQTT header byte */
	int msgId;		/**< MQTT message id */
} Ack;

typedef Ack Puback;
typedef Ack Pubrec;
typedef Ack Pubrel;
typedef Ack Pubcomp;
typedef Ack Unsuback;

int MQTTPacket_encode(char* buf, int length);
int MQTTPacket_decode(int socket, int* value);
int readInt(char** pptr);
char* readUTF(char** pptr, char* enddata);
char readChar(char** pptr);
void writeChar(char** pptr, char c);
void writeInt(char** pptr, int anInt);
void writeUTF(char** pptr, char* string);

char* MQTTPacket_name(int ptype);

void* MQTTPacket_Factory(int socket, int* error);
int MQTTPacket_send(int socket, Header header, char* buffer, int buflen);
int MQTTPacket_sends(int socket, Header header, int count, char** buffers, int* buflens);

int MQTTPacket_checkVersion(Connect* pack);
void* MQTTPacket_connect(unsigned char aHeader, char* data, int datalen);
void MQTTPacket_freeConnect(Connect* pack);
int MQTTPacket_send_connack(int aRc, int socket, char* clientID);

void* MQTTPacket_header_only(unsigned char aHeader, char* data, int datalen);
int MQTTPacket_send_pingresp(int socket, char* clientID);
int MQTTPacket_send_disconnect(int socket, char* clientID);

void* MQTTPacket_subscribe(unsigned char aHeader, char* data, int datalen);
void MQTTPacket_freeSubscribe(Subscribe* pack, int all);
int MQTTPacket_send_suback(int aRc, int noOfTopics, int* qoss, int socket, char* clientID);
void MQTTPacket_freeSuback(Suback* pack);

void* MQTTPacket_unsubscribe(unsigned char aHeader, char* data, int datalen);
void MQTTPacket_freeUnsubscribe(Unsubscribe* pack);
int MQTTPacket_send_unsuback(int aRc, int socket, char* clientID);

void* MQTTPacket_publish(unsigned char aHeader, char* data, int datalen);
void MQTTPacket_freePublish(Publish* pack);
int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, int socket, char* clientID);
int MQTTPacket_send_puback(int msgid, int socket, char* clientID);
void* MQTTPacket_ack(unsigned char aHeader, char* data, int datalen);

int MQTTPacket_send_pubrec(int msgid, int socket, char* clientID);
int MQTTPacket_send_pubrel(int msgid, int dup, int socket, char* clientID);
int MQTTPacket_send_pubcomp(int msgid, int socket, char* clientID);

void MQTTPacket_free_packet(MQTTPacket* pack);

#if !defined(NO_BRIDGE)
	#include "MQTTPacketOut.h"
#endif

#endif /* MQTTPACKET_H */