/**
 *
 * WARNING! This file was autogenerated by:
 *  _   _ _   _ __   __
 * | | | | | | |\ \ / /
 * | | | | |_| | \ V /
 * | | | |  _  | /   \
 * | |_| | | | |/ /^\ \
 *  \___/\_| |_/\/   \/
 *
 * This file was autogenerated by UnrealHxGenerator using UHT definitions.
 * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it!
 * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix
**/
package unreal;

/**
  Struct that allows for different ways to reference a component.
  If just an Actor is specified, will return RootComponent of that Actor.
**/
@:glueCppIncludes("Classes/Engine/EngineTypes.h")
@:uextern @:ustruct extern class FComponentReference {

  /**
    Name of component property to use
  **/
  @:uproperty public var ComponentProperty : unreal.FName;

  /**
    Pointer to a different Actor that owns the Component.
  **/
  @:uproperty public var OtherActor : unreal.AActor;

}


package http

import (
	"bytes"
	"context"
	"fmt"
	"io"
	"net/http"

	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/plumbing/format/pktline"
	"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp"
	"gopkg.in/src-d/go-git.v4/plumbing/transport"
	"gopkg.in/src-d/go-git.v4/plumbing/transport/internal/common"
	"gopkg.in/src-d/go-git.v4/utils/ioutil"
)

type upSession struct {
	*session
}

func newUploadPackSession(c *http.Client, ep *transport.Endpoint, auth transport.AuthMethod) (transport.UploadPackSession, error) {
	s, err := newSession(c, ep, auth)
	return &upSession{s}, err
}

func (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) {
	return advertisedReferences(s.session, transport.UploadPackServiceName)
}

func (s *upSession) UploadPack(
	ctx context.Context, req *packp.UploadPackRequest,
) (*packp.UploadPackResponse, error) {

	if req.IsEmpty() {
		return nil, transport.ErrEmptyUploadPackRequest
	}

	if err := req.Validate(); err != nil {
		return nil, err
	}

	url := fmt.Sprintf(
		"%s/%s",
		s.endpoint.String(), transport.UploadPackServiceName,
	)

	content, err := uploadPackRequestToReader(req)
	if err != nil {
		return nil, err
	}

	res, err := s.doRequest(ctx, http.MethodPost, url, content)
	if err != nil {
		return nil, err
	}

	r, err := ioutil.NonEmptyReader(res.Body)
	if err != nil {
		if err == ioutil.ErrEmptyReader || err == io.ErrUnexpectedEOF {
			return nil, transport.ErrEmptyUploadPackRequest
		}

		return nil, err
	}

	rc := ioutil.NewReadCloser(r, res.Body)
	return common.DecodeUploadPackResponse(rc, req)
}

// Close does nothing.
func (s *upSession) Close() error {
	return nil
}

func (s *upSession) doRequest(
	ctx context.Context, method, url string, content *bytes.Buffer,
) (*http.Response, error) {

	var body io.Reader
	if content != nil {
		body = content
	}

	req, err := http.NewRequest(method, url, body)
	if err != nil {
		return nil, plumbing.NewPermanentError(err)
	}

	applyHeadersToRequest(req, content, s.endpoint.Host, transport.UploadPackServiceName)
	s.ApplyAuthToRequest(req)

	res, err := s.client.Do(req.WithContext(ctx))
	if err != nil {
		return nil, plumbing.NewUnexpectedError(err)
	}

	if err := NewErr(res); err != nil {
		_ = res.Body.Close()
		return nil, err
	}

	return res, nil
}

func uploadPackRequestToReader(req *packp.UploadPackRequest) (*bytes.Buffer, error) {
	buf := bytes.NewBuffer(nil)
	e := pktline.NewEncoder(buf)

	if err := req.UploadRequest.Encode(buf); err != nil {
		return nil, fmt.Errorf("sending upload-req message: %s", err)
	}

	if err := req.UploadHaves.Encode(buf, false); err != nil {
		return nil, fmt.Errorf("sending haves message: %s", err)
	}

	if err := e.EncodeString("done\n"); err != nil {
		return nil, err
	}

	return buf, nil
}


<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    <style name="edit_AlertDialog_style2" parent="@android:style/Theme.Dialog">

        <item name="android:windowIsFloating">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
        <!-- 是否启用标题栏 -->
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="android:backgroundDimEnabled">true</item>
        <!-- 是否使用背景半透明 -->

    </style>
</resources>


package org.knowm.xchange.bitmex.dto.trade;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.knowm.xchange.dto.Order.IOrderFlags;

public enum BitmexOrderFlags implements IOrderFlags {
  FCIB, // prefer fee in base currency
  FCIQ, // prefer fee in quote currency
  NOMPP, // no market price protection
  POST, // for market maker orders
  VIQC; // volume in quote currency

  private static final Map<String, BitmexOrderFlags> fromString = new HashMap<>();

  static {
    for (BitmexOrderFlags orderFlag : values()) fromString.put(orderFlag.toString(), orderFlag);
  }

  public static BitmexOrderFlags fromString(String orderTypeString) {

    return fromString.get(orderTypeString.toLowerCase());
  }

  @Override
  public String toString() {

    return super.toString().toLowerCase();
  }

  static class BitmexOrderFlagsDeserializer extends JsonDeserializer<Set<BitmexOrderFlags>> {

    @Override
    public Set<BitmexOrderFlags> deserialize(JsonParser jsonParser, DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

      ObjectCodec oc = jsonParser.getCodec();
      JsonNode node = oc.readTree(jsonParser);
      String orderFlagsString = node.textValue();
      Set<BitmexOrderFlags> orderFlags = EnumSet.noneOf(BitmexOrderFlags.class);
      if (!orderFlagsString.isEmpty()) {
        for (String orderFlag : orderFlagsString.split(",")) orderFlags.add(fromString(orderFlag));
      }
      return orderFlags;
    }
  }
}


UPDATE `realmlist` SET `gamebuild`=22498 WHERE `gamebuild`=22423;

ALTER TABLE `realmlist` CHANGE `gamebuild` `gamebuild` int(10) unsigned NOT NULL DEFAULT '22498';


# created by tools/tclZIC.tcl - do not edit

set TZData(:Pacific/Pohnpei) {
    {-9223372036854775808 37972 0 LMT}
    {-2177490772 39600 0 PONT}
}


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="big_large">24sp</dimen>
    <dimen name="large">22sp</dimen>
    <dimen name="big_medium">20sp</dimen>
    <dimen name="medium">18sp</dimen>
    <dimen name="big_small">16sp</dimen>
    <dimen name="small">14sp</dimen>
    <dimen name="micro">12sp</dimen>
</resources>


// Import the PS Move API Package
import io.thp.psmove.*;

PSMove move;

void setup() {
  move = new PSMove(0);
  move.enable_orientation(1); // We need to tell the PSMove object to activate sensor fusion
  move.reset_orientation(); // Set the values of the quaternions to their start values [1, 0, 0, 0]
}

void draw() {
  float [] quat0 = {0.f}, quat1 = {0.f}, quat2 = {0.f}, quat3 = {0.f};

  while (move.poll() != 0) {}

  move.get_orientation(quat0, quat1, quat2, quat3);

  println("quatW = "+quat0[0]+" | quatX = "+quat1[0]+" | quatY = "+quat2[0]+" | quatZ = "+quat3[0]);
}


Hello {{name|raw}},

My name is Vladimir Kobzev. I am knowledge manager of Rizzoma team.
Recently, I have read your article "{{post|raw}}" about new tecnologies in education. I find your point of view very relevant and important to the project our team is working for.

This is the main reason why I am writing you.

Our team created a product — Rizzoma Wiki <http://rizzoma.com/for-education-and-research.html?cv=mc> that provides a first-rate technology for effective group communication and realtime collaboration. Rizzoma is used in different fields. One of them is Live Wiki for Education and Research. The main strength of our project is an opportunity to comment and leave a @mention in any place of a document.

Efficient communication and sharing of information are highly important for the educational process. From this perspective, Rizzoma is a service that can greatly facilitate group projects in Education and Research.

This is an example how a group of biologists uses Rizzoma in their research team work <http://blog.rizzoma.com/2012/05/30/education-process-with-rizzoma/>.

From this perspective, we would appreciate to hear your expert opinion about our project as an e-learning platform.

Enthusiastically,
Vladimir Kobzev,
Rizzoma Squad


#!/bin/sh

sudo apt-get install -y wget
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -

sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y rabbitmq-server

sudo service rabbitmq-server start

until sudo lsof -i:5672; do echo "Waiting for RabbitMQ to start..."; sleep 1; done


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package water.webserver.jetty9

import ai.h2o.sparkling.{H2OConf, H2OContext}
import ai.h2o.sparkling.backend.api.ShutdownServlet
import ai.h2o.sparkling.backend.api.dataframes.DataFramesServlet
import ai.h2o.sparkling.backend.api.h2oframes.H2OFramesServlet
import ai.h2o.sparkling.backend.api.options.OptionsServlet
import ai.h2o.sparkling.backend.api.rdds.RDDsServlet
import ai.h2o.sparkling.backend.api.scalainterpreter.ScalaInterpreterServlet
import org.eclipse.jetty.client.HttpClient
import org.eclipse.jetty.proxy.ProxyServlet.Transparent
import org.eclipse.jetty.security.SecurityHandler
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHandler, ServletHolder, ServletMapping}
import org.eclipse.jetty.util.ssl.SslContextFactory
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler
import water.webserver.iface.{H2OHttpView, LoginType}

class SparklingWaterJettyHelper(hc: H2OContext, conf: H2OConf, h2oHttpView: H2OHttpView)
  extends Jetty9Helper(h2oHttpView) {

  override def createServletContextHandler(): ServletContextHandler = {
    val context = new ServletContextHandler(ServletContextHandler.NO_SECURITY | ServletContextHandler.NO_SESSIONS)
    context.setContextPath(conf.contextPath.getOrElse("/"))
    context.setServletHandler(proxyContextHandler(conf))
    if (conf.isH2OReplEnabled) {
      ScalaInterpreterServlet.register(context, conf, hc)
    }
    RDDsServlet.register(context, conf, hc)
    H2OFramesServlet.register(context, conf, hc)
    DataFramesServlet.register(context, conf, hc)
    ShutdownServlet.register(context, conf, hc)
    OptionsServlet.register(context, conf, hc)
    context
  }

  private def proxyContextHandler(conf: H2OConf): ServletHandler = {
    val handler = new ServletHandler()
    val holder = new ServletHolder(new H2OFlowProxyServlet(conf))
    handler.addServlet(holder)
    val m = new ServletMapping()
    m.setServletName(holder.getName)
    m.setPathSpec("/*")
    handler.addServletMapping(m)
    val ipPort = conf.h2oCluster.get
    holder.setInitParameter("proxyTo", s"${conf.getScheme()}://$ipPort${conf.contextPath.getOrElse("")}")
    holder.setInitParameter("idleTimeout", s"${conf.restApiTimeout}")
    holder.setInitParameter("timeout", s"${conf.restApiTimeout}")
    handler
  }

  class H2OFlowProxyServlet(val conf: H2OConf) extends Transparent {
    override def newHttpClient(): HttpClient = {
      val client = if (conf.jks.isDefined) {
        val sslFactory = createSSLContextFactory(conf)
        new HttpClient(sslFactory)
      } else {
        new HttpClient()
      }
      client.setScheduler(new ScheduledExecutorScheduler(null, true))
      client
    }
  }

  private def createSSLContextFactory(conf: H2OConf) = {
    if (conf.jksPass.isEmpty) {
      throw new RuntimeException("JKS is specified but JKS password is missing!")
    }
    val sslFactory = new SslContextFactory(conf.jks.get)
    sslFactory.setKeyStorePassword(conf.jksPass.get)
    if (conf.jksAlias.isDefined) {
      sslFactory.setCertAlias(conf.jksAlias.get)
    }
    sslFactory
  }

  def startServer(port: Int): Server = {
    val jettyServer = createJettyServer("0.0.0.0", port)
    val context = createServletContextHandler()
    if (h2oHttpView.getConfig.loginType != LoginType.NONE) {
      context.setSecurityHandler(authWrapper(jettyServer).asInstanceOf[SecurityHandler])
    }
    jettyServer.setHandler(context)
    jettyServer.start()
    jettyServer
  }
}


# coding=utf-8
# 格式化字符串

"""
Template无疑是一个好东西，可以将字符串的格式固定下来，重复利用。
同时Template也可以让开发人员可以分别考虑字符串的格式和其内容了，无形中减轻了开发人员的压力。
Template属于string中的一个类，所以要使用的话可以用以下方式调用
from string import Template
Template有个特殊标示符$,它具有以下的规则：
它的主要实现方式为$xxx,其中xxx是满足python命名规则的字符串，即不能以数字开头，不能为关键字等
如果$xxx需要和其他字符串接触时，可用{}将xxx包裹起来
"""

import string

values = {'name': 'jumper', 'age': 30}

t = string.Template("""
name    : $name
age     : ${age} years
Escape  : $$
""")

print 'TEMPLATE:', t.substitute(values)


//===--- PropertyTests.swift ----------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019 - 2020 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import XCTest
import ComplexModule
import RealModule

final class PropertyTests: XCTestCase {

  func testProperties<T: Real>(_ type: T.Type) {
    // The real and imaginary parts of a non-finite value should be nan.
    XCTAssertTrue(Complex<T>.infinity.real.isNaN)
    XCTAssertTrue(Complex<T>.infinity.imaginary.isNaN)
    XCTAssertTrue(Complex<T>(.infinity, .nan).real.isNaN)
    XCTAssertTrue(Complex<T>(.nan, 0).imaginary.isNaN)
    // The length of a non-finite value should be infinity.
    XCTAssertEqual(Complex<T>.infinity.length, .infinity)
    XCTAssertEqual(Complex<T>(.infinity, .nan).length, .infinity)
    XCTAssertEqual(Complex<T>(.nan, 0).length, .infinity)
    // The phase of a non-finite value should be nan.
    XCTAssertTrue(Complex<T>.infinity.phase.isNaN)
    XCTAssertTrue(Complex<T>(.infinity, .nan).phase.isNaN)
    XCTAssertTrue(Complex<T>(.nan, 0).phase.isNaN)
    // The length of a zero value should be zero.
    XCTAssertEqual(Complex<T>.zero.length, .zero)
    XCTAssertEqual(Complex<T>(.zero, -.zero).length, .zero)
    XCTAssertEqual(Complex<T>(-.zero,-.zero).length, .zero)
    // The phase of a zero value should be nan.
    XCTAssertTrue(Complex<T>.zero.phase.isNaN)
    XCTAssertTrue(Complex<T>(.zero, -.zero).phase.isNaN)
    XCTAssertTrue(Complex<T>(-.zero,-.zero).phase.isNaN)
  }

  func testProperties() {
    testProperties(Float.self)
    testProperties(Double.self)
    #if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android)
    testProperties(Float80.self)
    #endif
  }

  func testEquatableHashable<T: Real>(_ type: T.Type) {
    // Validate that all zeros compare and hash equal, and all non-finites
    // do too.
    let zeros = [
      Complex<T>( .zero, .zero),
      Complex<T>(-.zero, .zero),
      Complex<T>(-.zero,-.zero),
      Complex<T>( .zero,-.zero)
    ]
    for z in zeros[1...] {
      XCTAssertEqual(zeros[0], z)
      XCTAssertEqual(zeros[0].hashValue, z.hashValue)
    }
    let infs = [
      Complex<T>( .nan,      .nan),
      Complex<T>(-.infinity, .nan),
      Complex<T>(-.ulpOfOne, .nan),
      Complex<T>( .zero,     .nan),
      Complex<T>( .pi,       .nan),
      Complex<T>( .infinity, .nan),
      Complex<T>( .nan,     -.infinity),
      Complex<T>(-.infinity,-.infinity),
      Complex<T>(-.ulpOfOne,-.infinity),
      Complex<T>( .zero,    -.infinity),
      Complex<T>( .pi,      -.infinity),
      Complex<T>( .infinity,-.infinity),
      Complex<T>( .nan,     -.ulpOfOne),
      Complex<T>(-.infinity,-.ulpOfOne),
      Complex<T>( .infinity,-.ulpOfOne),
      Complex<T>( .nan,      .zero),
      Complex<T>(-.infinity, .zero),
      Complex<T>( .infinity, .zero),
      Complex<T>( .nan,      .pi),
      Complex<T>(-.infinity, .pi),
      Complex<T>( .infinity, .pi),
      Complex<T>( .nan,      .infinity),
      Complex<T>(-.infinity, .infinity),
      Complex<T>(-.ulpOfOne, .infinity),
      Complex<T>( .zero,     .infinity),
      Complex<T>( .pi,       .infinity),
      Complex<T>( .infinity, .infinity),
    ]
    for i in infs[1...] {
      XCTAssertEqual(infs[0], i)
      XCTAssertEqual(infs[0].hashValue, i.hashValue)
    }
  }

  func testEquatableHashable() {
    testEquatableHashable(Float.self)
    testEquatableHashable(Double.self)
    #if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android)
    testEquatableHashable(Float80.self)
    #endif
  }

  func testCodable<T: Codable & Real>(_ type: T.Type) throws {
    let encoder = JSONEncoder()
    encoder.nonConformingFloatEncodingStrategy = .convertToString(
      positiveInfinity: "inf",
      negativeInfinity: "-inf",
      nan: "nan")

    let decoder = JSONDecoder()
    decoder.nonConformingFloatDecodingStrategy = .convertFromString(
      positiveInfinity: "inf",
      negativeInfinity: "-inf",
      nan: "nan")

    for expected: Complex<T> in [.zero, .one, .i, .infinity] {
      let data = try encoder.encode(expected)
      // print("*** \(String(decoding: data, as: Unicode.UTF8.self)) ***")
      let actual = try decoder.decode(Complex<T>.self, from: data)
      XCTAssertEqual(actual, expected)
    }
  }

  func testCodable() throws {
    try testCodable(Float32.self)
    try testCodable(Float64.self)
    // Float80 doesn't conform to Codable.
  }
}


/*
 * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package freemarker.cache;

import static org.junit.Assert.*;

import java.io.IOException;
import java.io.Reader;
import java.net.URL;
import java.util.Locale;

import org.hamcrest.Matchers;
import org.junit.Test;

import freemarker.core.ParseException;
import freemarker.template.Configuration;
import freemarker.template.MalformedTemplateNameException;
import freemarker.template.Template;
import freemarker.template.TemplateNotFoundException;
import freemarker.template.Version;

public class TemplateCacheTest {

    @Test
    public void testCachedException() throws Exception {
        MockTemplateLoader loader = new MockTemplateLoader();
        TemplateCache cache = new TemplateCache(loader, new StrongCacheStorage());
        cache.setDelay(1000L);
        loader.setThrowException(true);
        try {
            cache.getTemplate("t", Locale.getDefault(), "", true);
            fail();
        } catch (IOException e) {
            assertEquals("mock IO exception", e.getMessage());
            assertEquals(1, loader.getFindCount());
            try {
                cache.getTemplate("t", Locale.getDefault(), "", true);
                fail();
            } catch (IOException e2) {
                // Still 1 - returned cached exception
                assertThat(e2.getMessage(),
                        Matchers.allOf(Matchers.containsString("There was an error loading the template on an " +
                        "earlier attempt")));
                assertSame(e, e2.getCause());
                assertEquals(1, loader.getFindCount());
                try {
                    Thread.sleep(1100L);
                    cache.getTemplate("t", Locale.getDefault(), "", true);
                    fail();
                } catch (IOException e3) {
                    // Cache had to retest
                    assertEquals("mock IO exception", e.getMessage());
                    assertEquals(2, loader.getFindCount());
                }
            }
        }
    }

    @Test
    public void testCachedNotFound() throws Exception {
        MockTemplateLoader loader = new MockTemplateLoader();
        TemplateCache cache = new TemplateCache(loader, new StrongCacheStorage(), new Configuration());
        cache.setDelay(1000L);
        cache.setLocalizedLookup(false);
        assertNull(cache.getTemplate("t", Locale.getDefault(), "", true));
        assertEquals(1, loader.getFindCount());
        assertNull(cache.getTemplate("t", Locale.getDefault(), "", true));
        // Still 1 - returned cached exception
        assertEquals(1, loader.getFindCount());
        Thread.sleep(1100L);
        assertNull(cache.getTemplate("t", Locale.getDefault(), "", true));
        // Cache had to retest
        assertEquals(2, loader.getFindCount());
    }

    private static class MockTemplateLoader implements TemplateLoader {
        private boolean throwException;
        private int findCount;

        public void setThrowException(boolean throwException) {
           this.throwException = throwException;
        }

        public int getFindCount() {
            return findCount;
        }

        public void closeTemplateSource(Object templateSource)
                throws IOException {
        }

        public Object findTemplateSource(String name) throws IOException {
            ++findCount;
            if (throwException) {
                throw new IOException("mock IO exception");
            }
            return null;
        }

        public long getLastModified(Object templateSource) {
            return 0;
        }

        public Reader getReader(Object templateSource, String encoding)
                throws IOException {
            return null;
        }

    }

    @Test
    public void testManualRemovalPlain() throws IOException {
        Configuration cfg = new Configuration();
        cfg.setCacheStorage(new StrongCacheStorage());
        StringTemplateLoader loader = new StringTemplateLoader();
        cfg.setTemplateLoader(loader);
        cfg.setTemplateUpdateDelay(Integer.MAX_VALUE);

        loader.putTemplate("1.ftl", "1 v1");
        loader.putTemplate("2.ftl", "2 v1");
        assertEquals("1 v1", cfg.getTemplate("1.ftl").toString());
        assertEquals("2 v1", cfg.getTemplate("2.ftl").toString());

        loader.putTemplate("1.ftl", "1 v2");
        loader.putTemplate("2.ftl", "2 v2");
        assertEquals("1 v1", cfg.getTemplate("1.ftl").toString()); // no change
        assertEquals("2 v1", cfg.getTemplate("2.ftl").toString()); // no change

        cfg.removeTemplateFromCache("1.ftl");
        assertEquals("1 v2", cfg.getTemplate("1.ftl").toString()); // changed
        assertEquals("2 v1", cfg.getTemplate("2.ftl").toString());

        cfg.removeTemplateFromCache("2.ftl");
        assertEquals("1 v2", cfg.getTemplate("1.ftl").toString());
        assertEquals("2 v2", cfg.getTemplate("2.ftl").toString()); // changed
    }

    @Test
    public void testManualRemovalI18ed() throws IOException {
        Configuration cfg = new Configuration();
        cfg.setCacheStorage(new StrongCacheStorage());
        cfg.setLocale(Locale.US);
        StringTemplateLoader loader = new StringTemplateLoader();
        cfg.setTemplateLoader(loader);
        cfg.setTemplateUpdateDelay(Integer.MAX_VALUE);

        loader.putTemplate("1_en_US.ftl", "1_en_US v1");
        loader.putTemplate("1_en.ftl", "1_en v1");
        loader.putTemplate("1.ftl", "1 v1");

        assertEquals("1_en_US v1", cfg.getTemplate("1.ftl").toString());
        assertEquals("1_en v1", cfg.getTemplate("1.ftl", Locale.UK).toString());
        assertEquals("1 v1", cfg.getTemplate("1.ftl", Locale.GERMANY).toString());

        loader.putTemplate("1_en_US.ftl", "1_en_US v2");
        loader.putTemplate("1_en.ftl", "1_en v2");
        loader.putTemplate("1.ftl", "1 v2");
        assertEquals("1_en_US v1", cfg.getTemplate("1.ftl").toString());
        assertEquals("1_en v1", cfg.getTemplate("1.ftl", Locale.UK).toString());
        assertEquals("1 v1", cfg.getTemplate("1.ftl", Locale.GERMANY).toString());

        cfg.removeTemplateFromCache("1.ftl");
        assertEquals("1_en_US v2", cfg.getTemplate("1.ftl").toString());
        assertEquals("1_en v1", cfg.getTemplate("1.ftl", Locale.UK).toString());
        assertEquals("1 v1", cfg.getTemplate("1.ftl", Locale.GERMANY).toString());
        assertEquals("1 v2", cfg.getTemplate("1.ftl", Locale.ITALY).toString());

        cfg.removeTemplateFromCache("1.ftl", Locale.GERMANY);
        assertEquals("1_en v1", cfg.getTemplate("1.ftl", Locale.UK).toString());
        assertEquals("1 v2", cfg.getTemplate("1.ftl", Locale.GERMANY).toString());

        cfg.removeTemplateFromCache("1.ftl", Locale.CANADA);
        assertEquals("1_en v1", cfg.getTemplate("1.ftl", Locale.UK).toString());

        cfg.removeTemplateFromCache("1.ftl", Locale.UK);
        assertEquals("1_en v2", cfg.getTemplate("1.ftl", Locale.UK).toString());
    }

    @Test
    public void testZeroUpdateDelay() throws IOException {
        Configuration cfg = new Configuration();
        cfg.setLocale(Locale.US);
        cfg.setCacheStorage(new StrongCacheStorage());
        StringTemplateLoader loader = new StringTemplateLoader();
        cfg.setTemplateLoader(loader);
        cfg.setTemplateUpdateDelay(0);
        for (int i = 1; i <= 3; i++) {
            loader.putTemplate("t.ftl", "v" + i, i);
            assertEquals("v" + i, cfg.getTemplate("t.ftl").toString());
        }

        loader.putTemplate("t.ftl", "v10", 10);
        assertEquals("v10", cfg.getTemplate("t.ftl").toString());
        loader.putTemplate("t.ftl", "v11", 10); // same time stamp, different content
        assertEquals("v10", cfg.getTemplate("t.ftl").toString()); // still v10
        assertEquals("v10", cfg.getTemplate("t.ftl").toString()); // still v10
    }

    @Test
    public void testIncompatibleImprovementsChangesURLConCaching() throws IOException {
        Version newVersion = Configuration.VERSION_2_3_21;
        Version oldVersion = Configuration.VERSION_2_3_20;

        {
            Configuration cfg = new Configuration(oldVersion);
            cfg.setTemplateUpdateDelay(0);
            final MonitoredClassTemplateLoader templateLoader = new MonitoredClassTemplateLoader();
            assertNull(templateLoader.getURLConnectionUsesCaches());
            cfg.setTemplateLoader(templateLoader);

            assertNull(templateLoader.getLastTemplateSourceModification());
            cfg.getTemplate("test.ftl");
            assertNull(templateLoader.getLastTemplateSourceModification());

            cfg.setIncompatibleImprovements(newVersion);
            assertNull(templateLoader.getLastTemplateSourceModification());
            cfg.getTemplate("test.ftl");
            assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());

            templateLoader.setURLConnectionUsesCaches(Boolean.valueOf(true));
            templateLoader.setLastTemplateSourceModification(null);
            cfg.getTemplate("test.ftl");
            assertNull(templateLoader.getLastTemplateSourceModification());

            templateLoader.setURLConnectionUsesCaches(Boolean.valueOf(false));
            templateLoader.setLastTemplateSourceModification(null);
            cfg.getTemplate("test.ftl");
            assertNull(templateLoader.getLastTemplateSourceModification());

            templateLoader.setURLConnectionUsesCaches(null);
            templateLoader.setLastTemplateSourceModification(null);
            cfg.getTemplate("test.ftl");
            assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());

            templateLoader.setURLConnectionUsesCaches(null);
            cfg.setIncompatibleImprovements(oldVersion);
            templateLoader.setLastTemplateSourceModification(null);
            cfg.getTemplate("test.ftl");
            assertNull(templateLoader.getLastTemplateSourceModification());

            cfg.setTemplateLoader(new MultiTemplateLoader(
                    new TemplateLoader[] { new MultiTemplateLoader(
                                    new TemplateLoader[] { templateLoader }) }));
            cfg.setIncompatibleImprovements(newVersion);
            cfg.getTemplate("test.ftl");
            assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());
        }
    }

    @Test
    public void testWrongEncodingReload() throws IOException {
        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
        cfg.setLocale(Locale.US);

        StringTemplateLoader tl = new StringTemplateLoader();
        tl.putTemplate("utf-8_en.ftl", "<#ftl encoding='utf-8'>Foo");
        tl.putTemplate("utf-8.ftl", "Bar");
        cfg.setTemplateLoader(tl);

        {
            Template t = cfg.getTemplate("utf-8.ftl", "Utf-8");
            assertEquals("utf-8.ftl", t.getName());
            assertEquals("utf-8_en.ftl", t.getSourceName());
            assertEquals("Utf-8", t.getEncoding());
            assertEquals("Foo", t.toString());
        }

        {
            Template t = cfg.getTemplate("utf-8.ftl", "Utf-16");
            assertEquals("utf-8.ftl", t.getName());
            assertEquals("utf-8_en.ftl", t.getSourceName());
            assertEquals("utf-8", t.getEncoding());
            assertEquals("Foo", t.toString());
        }
    }

    @Test
    public void testEncodingSelection() throws IOException {
        Locale hungary = new Locale("hu", "HU");

        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
        cfg.setDefaultEncoding("utf-8");

        StringTemplateLoader tl = new StringTemplateLoader();
        tl.putTemplate("t.ftl", "Foo");
        tl.putTemplate("t_de.ftl", "Vuu");
        tl.putTemplate("t2.ftl", "<#ftl encoding='UTF-16LE'>Foo");
        tl.putTemplate("t2_de.ftl", "<#ftl encoding='UTF-16BE'>Vuu");
        cfg.setTemplateLoader(tl);

        // No locale-to-encoding mapping exists yet:
        {
            Template t = cfg.getTemplate("t.ftl", Locale.GERMANY);
            assertEquals("t.ftl", t.getName());
            assertEquals("t_de.ftl", t.getSourceName());
            assertEquals("utf-8", t.getEncoding());
            assertEquals("Vuu", t.toString());
        }

        cfg.setEncoding(Locale.GERMANY, "ISO-8859-1");
        cfg.setEncoding(hungary, "ISO-8859-2");
        {
            Template t = cfg.getTemplate("t.ftl", Locale.CHINESE);
            assertEquals("t.ftl", t.getName());
            assertEquals("t.ftl", t.getSourceName());
            assertEquals("utf-8", t.getEncoding());
            assertEquals("Foo", t.toString());
        }
        {
            Template t = cfg.getTemplate("t.ftl", Locale.GERMANY);
            assertEquals("t.ftl", t.getName());
            assertEquals("t_de.ftl", t.getSourceName());
            assertEquals("ISO-8859-1", t.getEncoding());
            assertEquals("Vuu", t.toString());
        }
        {
            Template t = cfg.getTemplate("t.ftl", hungary);
            assertEquals("t.ftl", t.getName());
            assertEquals("t.ftl", t.getSourceName());
            assertEquals("ISO-8859-2", t.getEncoding());
            assertEquals("Foo", t.toString());
        }

        // #ftl header overrides:
        {
            Template t = cfg.getTemplate("t2.ftl", Locale.CHINESE);
            assertEquals("t2.ftl", t.getName());
            assertEquals("t2.ftl", t.getSourceName());
            assertEquals("UTF-16LE", t.getEncoding());
            assertEquals("Foo", t.toString());
        }
        {
            Template t = cfg.getTemplate("t2.ftl", Locale.GERMANY);
            assertEquals("t2.ftl", t.getName());
            assertEquals("t2_de.ftl", t.getSourceName());
            assertEquals("UTF-16BE", t.getEncoding());
            assertEquals("Vuu", t.toString());
        }
        {
            Template t = cfg.getTemplate("t2.ftl", hungary);
            assertEquals("t2.ftl", t.getName());
            assertEquals("t2.ftl", t.getSourceName());
            assertEquals("UTF-16LE", t.getEncoding());
            assertEquals("Foo", t.toString());
        }
    }

    @Test
    public void testTemplateNameFormatExceptionAndBackwardCompatibility() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);

        assertNull(cfg.getTemplate("../x", null, null, null, true, true));
        try {
            cfg.getTemplate("../x");
            fail();
        } catch (TemplateNotFoundException e) {
            // expected
        }

        // [2.4] Test it with IcI 2.4

        cfg.setTemplateNameFormat(TemplateNameFormat.DEFAULT_2_4_0);
        try {
            cfg.getTemplate("../x", null, null, null, true, true);
            fail();
        } catch (MalformedTemplateNameException e) {
            // expected
        }
        try {
            cfg.getTemplate("../x");
            fail();
        } catch (MalformedTemplateNameException e) {
            // expected
        }
    }

    private static class MonitoredClassTemplateLoader extends ClassTemplateLoader {

        private Boolean lastTemplateSourceModification;

        public MonitoredClassTemplateLoader() {
            super(TemplateCacheTest.class, "");
        }

        @Override
        public Object findTemplateSource(String name) throws IOException {
            final URL url = getURL(name);
            if (url == null) return null;
            return new SpyingURLTemplateSource(url, getURLConnectionUsesCaches());
        }

        Boolean getLastTemplateSourceModification() {
            return lastTemplateSourceModification;
        }

        void setLastTemplateSourceModification(Boolean lastTemplateSourceModification) {
            this.lastTemplateSourceModification = lastTemplateSourceModification;
        }

        private class SpyingURLTemplateSource extends URLTemplateSource {

            SpyingURLTemplateSource(URL url, Boolean useCaches) throws IOException {
                super(url, useCaches);
            }

            @Override
            void setUseCaches(boolean useCaches) {
                setLastTemplateSourceModification(Boolean.valueOf(useCaches));
                super.setUseCaches(useCaches);
            }

        }

    }

}


#!/bin/bash

if ! git lfs help 1>/dev/null 2>&1 ; then
    echo ''
    echo "You should intall LFS first!"
    echo "Please following instructions on 'http://tapd.oa.com/QB/markdown_wikis/view/#1010110511006951537'"
    exit 1
fi

[ -n "$1" -a -d "$1" ] && cd "$1"

echo "当前目录：$(pwd)"
read -p '确认开启LFS？(Y/N)  ' opt
[[ "${opt}" =~ [Nn] ]] && exit 2

if [ $(git status --short | grep -v 'SubProject/' | wc -l) -gt 0 ]; then
    echo ''
    echo "There're uncommited local modifications:"
    git status --short
    echo "Please commit/stash/reset first."
    exit 3
fi

binary_ext="
*.so
*.zip
*.jsbundle
*.jar
*.dat
*.7z
*.xls
*.xlsx
*.doc
*.docx
*.ttf
*.symbol
*.rar
*.qbs
*.qar
*.mp3
*.mp4
*.gz
*.tar
*.apk
*.aar
*.exe
*.dll
*.arsc
*.bin
*.obj
*.wxapkg
*.hprof
*.trace
*.glsl
*.class
*.dex
"

for ext in ${binary_ext}
do
    git lfs track ${ext}
done

git add .gitattributes
git commit -m 'enable lfs'

echo -e "\n"
echo "LFS is enabled for $(pwd | sed -e 's#/$##' -e 's#.*/##'). Please manually commit following binary files:"
git status --short

exit 0


'use strict';

const ChangesStream = require('changes-stream');
const path = require('path');
const fs = require('mz/fs');
const urllib = require('urllib');
const streamAwait = require('await-event');
const logger = require('../common/logger');
const config = require('../config');

const db = config.officialNpmReplicate;
const lastSeqFile = path.join(config.dataDir, '.cnpmjs.org.last_seq.txt');
let _STREAM_ID = 0;

// debug: curl -v https://replicate.npmjs.com/_changes?since=9052545

module.exports = function* sync() {
  const pedding = [];
  const since = yield getLastSequence();
  const streamId = _STREAM_ID++;
  let changesCount = 0;
  logger.syncInfo('start changes stream#%d, since: %s', streamId, since);
  const changes = new ChangesStream({
    db,
    since,
    include_docs: false,
  });
  changes.await = streamAwait;
  changes.on('data', change => {
    changesCount++;
    logger.syncInfo('stream#%d get change#%d: %j', streamId, changesCount, change);
    pedding.push(change);
    // syncPackage(change);
  });

  const timer = setInterval(function() {
    for (var i = 0; i < 100; i++) {
      var change = pedding.shift();
      if (!change) {
        break;
      }
      syncPackage(change);
    }
  }, 5000);

  try {
    yield changes.await('error');
  } catch (err) {
    clearInterval(timer);
    // make sure changes steam is destroy
    changes.destroy();
    err.message += `, stream#${streamId}, changesCount#${changesCount}`;
    throw err;
  }
};

function syncPackage(change) {
  const url = `${config.handleSyncRegistry}/${change.id}/sync`;
  // sync upstream and without deps
  urllib.request(`${url}?sync_upstream=true&nodeps=true`, {
    method: 'PUT',
    dataType: 'json',
    timeout: 10000,
  }, (err, data) => {
    if (err) {
      logger.syncInfo('%s:%s PUT %s error: %s, retry after 5s',
        change.seq, change.id, url, err);
      logger.syncError(err);
      setTimeout(() => syncPackage(change), 5000);
    } else {
      saveLastSequence(change.seq);
      logger.syncInfo('%s:%s sync request sent, log: %s/log/%s',
        change.seq, change.id, url, data.logId);
    }
  });
}

function* getLastSequence() {
  let lastSeq;
  if (yield fs.exists(lastSeqFile)) {
    lastSeq = yield fs.readFile(lastSeqFile, 'utf8');
    lastSeq = Number(lastSeq);
  }
  if (!lastSeq) {
    lastSeq = 2649694;
  }
  // const r = yield urllib.request(db, {
  //   dataType: 'json',
  //   timeout: 15000,
  // });
  // logger.syncInfo('get registry info: %j', r.data);
  // if (lastSeq < r.data.update_seq) {
  //   lastSeq = r.data.update_seq;
  // }
  return lastSeq;
}

function saveLastSequence(seq) {
  fs.writeFile(lastSeqFile, String(seq), () => {});
}


declare namespace jdk {
    namespace nashorn {
        namespace internal {
            namespace codegen {
                class FoldConstants$BinaryNodeConstantEvaluator extends jdk.nashorn.internal.codegen.FoldConstants$ConstantEvaluator<jdk.nashorn.internal.ir.BinaryNode> {
                    protected eval(): jdk.nashorn.internal.ir.LiteralNode<any>
                    public static class: java.lang.Class<any>
                }
            }
        }
    }
}


This sheet was inspired by the Palladium Megaverse sheet, but has had several changes for those familiar with that sheet.

### Roll Template
- The roll template is based on one written by Jakob and referenced here:  [A Better Default Template](https://app.roll20.net/forum/permalink/6792597/)
- This sheet has a roll template that is called by &{template:custom}.
- You specify a color with {{color=black}}.  Available colors are black, brown, blue, red, grey, yellow, green, teal, orange, pine, ice, violet, sun, and wine.  The reason for that many color options is to be able to use different colors for different types of magic.
- The sheet uses black, brown, yellow, red, blue, green, and grey for various rolls.
- You can specify both a title and subtitle as {{title=Desired Title}} and {{subtitle=Desired Subtitle}}
- Any rolls or inline macros can be assigned the same as the default Roll20 template.
- There is a description section that is called as {{desc=Desired Description}}.  This section will honor line breaks making larger descriptions or even simple table options possible.
- If a description is used, it must always be the last section displayed.
- The roll template is built to change the pink "chat menu" buttons into blue text with no box.
- Because I like to apply circumstantial bonuses and penalties to skills, I do not have skill or stat rolls set up to show success or failure.  Instead it will show the roll and the target number.

### Menu Roll Template
- You can also call the template as &{template:menu}.
- The main difference is that the description section will display all text centered, bold, and in italics.  I use this for all chat menus. Details on creating chat menus can be found in the Stupid Roll20 Tricks thread on the forums: [Chat Menus](https://app.roll20.net/forum/permalink/5927072/)

### Roll Template Example
This example is the macro I use for the healer ability Healing Touch.
```
&{template:custom} {{color=sun}} {{title=**@{character_name}**}} {{subtitle=Healing Touch}} {{ISP=[[8]]}} {{Healing=[[2d6+2]]}} {{desc=By the laying of hands and force of will, the healer can heal the pain and effects of burns, cuts, bruises, broken bones, etc. The healing touch works only on others (not self) and can be done as often as once every other melee until I.S. P. are used up.}}
```

### Auto Calculated Stat Bonuses
- I.Q. bonuses are auto calculated and displayed at the top of the Skills tab.  Any bonus is subtracted from the percentile roll in the OCC, Elective, and Secondary skill sections.
- M.A. bonus to trust and intimidate is autocalculated and displayed in the light blue section.
- P.S. bonus to damage is autocalulated and displayed on the Combat Tab under Hand to Hand Combat skill.  This will be included in any damage roll from the melee attack section of the Statistics tab.
- P.P. bonuses to parry and dodge are autocalculated and displayed on the Combat Tab under Hand to Hand Combat skill.  This will be included in rolling Dodge in the light blue section of the Statistics tab, or rolling parry in the Melee Attacks section of the Statistics tab.
- P.B. bonuses to charm and impress are autocalculated and displayed in the light blue section.
- Spd. is autocalculated to rough miles per hour and displayed in the gold section.  It also calculates movement per action in case people are using that 2E mechanic.
- Saving throw bonuses from M.E. and P.E. are autocalculated and displayed below the rolls in the Saving Throw section of the combat tab.  They are included in the calculation of the rolls.

### Stat Rolls
- The stat rolls are set up to roll 2 numbers.  The first is a d20, and the second is d100.
- The "Perception" roll in the light blue section of the Basic tab is basically a d20 stat check.  It takes the average (rounded down) of the I.Q. and M.E. for a target number. Since perception doesn't exist in 1E, this was my personal solution.  Use it or ignore it as you wish.

### Extra Attributes
- The right hand column of the Basic tab has quite a list of things there.  This is all to facilitate the creation of macros and being able to link tokens easily to different resources.
- Hit Points = @{character_hp}
- A.R. = @{character_ar}
- S.D.C. = @{character_sdc}
- Psion Level = @{psi_level}
- Psion I.S.P. = @{character_pisp}
- Heal I.S.P. = @{character_hisp}
- Caster Level = @{caster_level}
- Daily Casts = @{character_casts}
- Spell Str = @{spell_strength}
- Ward Level = @{ward_level}
- Daily Wards = @{ward_casts}
- Ward Str = @{ward_strength}
- Circle Level = @{circle_level}
- Circle Str = @{circle_strength}

### Extra Movement
- I included this to be used in case of a character having a common secondary mode of travel such as a mount, spell, or magic item.
- This repeating section does not autocalculate values.  You can temporarily change the Spd attribute to get all the different calculated values to enter manually.

### Melee Attacks
- This repeating section will pull in any bonuses found under the Hand to Hand Combat skill, including P.S. or P.P. bonuses.  This also includes changing the critical strike threshold if it is changed there.  Weapon proficiency bonuses will need to be added manually.
- Any info entered into notes will be displayed using the description part of the roll template, but will not appear at all if left blank.

### Ranged and Spell Attacks
- This repeating section pulls nothing from anywhere, except for the Ranged Critical Strike which can change in the case of Longbowmen.
- All other info is entered manually and makes for a good place to place some magic and psionic abilities in addition to ranged weapon attacks, such as Mental Bolt of Force or Ball Lightning.

### Initiative
- The built in Initiative macro adds 80 to the d20 dice roll.  This is to facilitate use of an API script that can add multiple instances of a token on the tracker, reducing the initiative value by 20 for each additional entry.  Since multiple actions are not clumped all together as with D&D, the extra room for spreading out multiple attacks I have found useful.

### Skill Rolls
- As mentioned earlier, any bonus for an exceptional I.Q. will be subtracted from rolls in the OCC, Elective, and Secondary Skills sections.
- The rolls will roll the percentage and display the target number of your skill.
- Any notes about the skills will be displayed in the description part of the template.
- The mystic skills section is intended for druid class rolls, deducing circle invocations, detecting illusions, and other magical type class skills that have a percentile roll.
- Since I am not sure the I.Q. bonus should apply for some of these types of skills, that bonus is not automatically applied in the Mystic skills section.

### Recommended API
- If you have access to the API, I highly recommend the use of 2 API scripts.
- [Universal Chat Menus on Roll20 Forums](https://app.roll20.net/forum/permalink/7474530/)
- [Initiative Duplicator on Roll20 Forums](https://app.roll20.net/forum/permalink/6817748/)

### Universal Chat Menu Macro Example for Skills
```
!chatmenu @{selected|character_id} {template:menu} {{color=green}} {{title=**@{selected|character_name}**}}{{subtitle=**Complete Skill List**}} {{desc=CHATMENU}} --title:OCC Skills --separator:~ --repeating_skillocc|skill_name|occskill --title:Elective Skills --separator:~ --repeating_skillelective|skill_name|electiveskill --title:Secondary Skills --separator:~ --repeating_skillsecondary|skill_name|secondaryskill --title:Mystic Skills --separator:~ --repeating_skillmystic|skill_name|mysticskill
```

### Initiative Duplicator Macro Example
```
!dup-turn ?{How many attacks?|}
```

### Disclaimer
Palladium Fantasy 1E has been around a long while.  It is from an era where house rules were not frowned upon, but encouraged.  As such, I have tried to put enough options in this sheet to allow for creativity.  I am a definite novice at html, css, or anything else that has gone into this sheet, so any major revisions for automation may be beyond me.  It is in the current state due to the generous help of the Roll20 forum community.  As K.S. would say, Game On!


import React from 'react'
import './RepoDetailsDesktopLayout.css'
import './RepoDetails.css'
import { Row, InputGroup, FormControl, Button, Spinner, OverlayTrigger, Tooltip } from 'react-bootstrap/'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faStopCircle } from '@fortawesome/free-solid-svg-icons';

const RepoDetailsDesktopLayout = (props) => {

  return (
    <Row>
      <InputGroup>
        <InputGroup.Prepend>
          <OverlayTrigger
            placement="bottom"
            delay={{ show: 100 }}
            overlay={<Tooltip>Tip: you can paste any GitHub URL or string in the format of "username/repo"</Tooltip>}
          >
            <InputGroup.Text>Repo Details</InputGroup.Text>
          </OverlayTrigger>
        </InputGroup.Prepend>
        <FormControl
          ref={props.userName}
          placeholder="Username"
          aria-label="Username"
          onKeyPress={props.handleKeyPress}
          onPaste={props.handlePaste}
        />
        <InputGroup.Prepend>
          <InputGroup.Text>/</InputGroup.Text>
        </InputGroup.Prepend>
        <FormControl
          ref={props.repoName}
          placeholder="Repo name"
          aria-label="Repo name"
          onKeyPress={props.handleKeyPress}
          onPaste={props.handlePaste}
        />
        {!props.loadInProgress ?
        <Button
          className="RepoDetailsDesktopLayout-goButton"
          type="button"
          onClick={props.onGoClick}>Go!
        </Button>
        :
        <div>
          <Button
            className="RepoDetailsDesktopLayout-loadingButton"
            type="button"
            disabled>
              <Spinner
                as="span"
                animation="border"
                size="sm"
                role="status"
                aria-hidden="true"
            /> Loading...
          </Button>
          <Button className="RepoDetails-stopButton" onClick={props.onStopClick}>
            <FontAwesomeIcon icon={faStopCircle} />
          </Button>
        </div>
        }
      </InputGroup>
    </Row>
  )
}

export default RepoDetailsDesktopLayout


/*
 This Software is provided under the Zope Public License (ZPL) Version 2.1.

 Copyright (c) 2009, 2010 by the mingw-w64 project

 See the AUTHORS file for the list of contributors to the mingw-w64 project.

 This license has been certified as open source. It has also been designated
 as GPL compatible by the Free Software Foundation (FSF).

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

   1. Redistributions in source code must retain the accompanying copyright
      notice, this list of conditions, and the following disclaimer.
   2. Redistributions in binary form must reproduce the accompanying
      copyright notice, this list of conditions, and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
   3. Names of the copyright holders must not be used to endorse or promote
      products derived from this software without prior written permission
      from the copyright holders.
   4. The right to distribute this software or to use it for any purpose does
      not give you the right to use Servicemarks (sm) or Trademarks (tm) of
      the copyright holders.  Use of them is covered by separate agreement
      with the copyright holders.
   5. If any files are modified, you must cause the modified files to carry
      prominent notices stating that you changed the files and the date of
      any change.

 Disclaimer

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

#define _NEW_COMPLEX_FLOAT 1
#include "acosh.def.h"


[name]
Options to set fixed fonts

[options]
fixed CR
fixedbold CY
fixeditalic CW
fixedbolditalic CX

[input]
=head1 FIXED FONTS

C<foo B<bar I<baz>> I<bay>>

[output]
.SH "FIXED FONTS"
.IX Header "FIXED FONTS"
\&\f(CR\*(C`foo \f(CYbar \f(CXbaz\f(CY\f(CR \f(CWbay\f(CR\*(C'\fR


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "DOMTypeInfoImpl.hpp"
#include "DOMDocumentImpl.hpp"
#include <xercesc/framework/psvi/PSVIItem.hpp>
#include <xercesc/framework/psvi/XSTypeDefinition.hpp>

XERCES_CPP_NAMESPACE_BEGIN

/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedElement;
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdNotValidatedAttribute;
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedCDATAAttribute(XMLUni::fgInfosetURIName, XMLUni::fgCDATAString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefsString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITYAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntityString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITIESAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntitiesString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokenString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokensString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNOTATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNotationString);
/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENUMERATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEnumerationString);

DOMTypeInfoImpl::DOMTypeInfoImpl(const XMLCh* namespaceUri/*=0*/, const XMLCh* name/*=0*/)
: fBitFields(0),
  fTypeName(name),
  fTypeNamespace(namespaceUri),
  fMemberTypeName(0),
  fMemberTypeNamespace(0),
  fDefaultValue(0),
  fNormalizedValue(0)
{
    // by setting the fBitField to 0 we are also setting:
    //  - [validity]=VALIDITY_NOTKNOWN
    //  - [validitation attempted]=VALIDATION_NONE
    //  - [schema specified]=false
}

DOMTypeInfoImpl::DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI)
: fBitFields(0),
  fTypeName(0),
  fTypeNamespace(0),
  fMemberTypeName(0),
  fMemberTypeNamespace(0),
  fDefaultValue(0),
  fNormalizedValue(0)
{
    setNumericProperty(DOMPSVITypeInfo::PSVI_Validity,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validity));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Nil,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Nil));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous));
    setNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified,
        sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified));

    setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name)));
    setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace)));
    setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name)));
    setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace)));
    setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default)));
    setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value,
        ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value)));
}

const XMLCh* DOMTypeInfoImpl::getTypeName() const {
    // if it's a DTD, return the data that was stored
    if(!getNumericProperty(PSVI_Schema_Specified))
        return fTypeName;
    // if [validity] is "invalid" or "notKnown", the {target namespace} and {name} properties of the declared type if available, otherwise null.
    if(!getNumericProperty(PSVI_Validity))
        return fTypeName;
    if(fMemberTypeName)
        return fMemberTypeName;
    return fTypeName;
}

const XMLCh* DOMTypeInfoImpl::getTypeNamespace() const {
    // if it's a DTD, return the data that was stored
    if(!getNumericProperty(PSVI_Schema_Specified))
        return fTypeNamespace;
    // if [validity] is "invalid" or "notKnown", the {target namespace} and {name} properties of the declared type if available, otherwise null.
    if(!getNumericProperty(PSVI_Validity))
        return fTypeNamespace;
    if(fMemberTypeName)     // we check on the name, as the URI can be NULL
        return fMemberTypeNamespace;
    return fTypeNamespace;
}

bool DOMTypeInfoImpl::isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods) const
{
    // if it's a DTD, return false
    if(!getNumericProperty(PSVI_Schema_Specified))
        return false;
    if(XMLString::equals(typeNamespaceArg, getTypeNamespace()) && XMLString::equals(typeNameArg, getTypeName()))
        return true;
    // TODO: need a pointer to the Grammar object
    return false;
}

const XMLCh* DOMTypeInfoImpl::getStringProperty(PSVIProperty prop) const {
    switch(prop)
    {
    case PSVI_Type_Definition_Name:             return fTypeName;
    case PSVI_Type_Definition_Namespace:        return fTypeNamespace;
    case PSVI_Member_Type_Definition_Name:      return fMemberTypeName;
    case PSVI_Member_Type_Definition_Namespace: return fMemberTypeNamespace;
    case PSVI_Schema_Default:                   return fDefaultValue;
    case PSVI_Schema_Normalized_Value:          return fNormalizedValue;
    default:                                    assert(false); /* it's not a string property */
    }
    return 0;
}

int DOMTypeInfoImpl::getNumericProperty(PSVIProperty prop) const {
    switch(prop)
    {
    case PSVI_Validity:                         return (PSVIItem::VALIDITY_STATE)(fBitFields & 0x0003);
    case PSVI_Validation_Attempted:             return (PSVIItem::ASSESSMENT_TYPE)((fBitFields >> 2) & 0x0003);
    case PSVI_Type_Definition_Type:             return (fBitFields & (1 << 5))?XSTypeDefinition::COMPLEX_TYPE:XSTypeDefinition::SIMPLE_TYPE;
    case PSVI_Type_Definition_Anonymous:        return (fBitFields & (1 << 6))?true:false;
    case PSVI_Nil:                              return (fBitFields & (1 << 7))?true:false;
    case PSVI_Member_Type_Definition_Anonymous: return (fBitFields & (1 << 8))?true:false;
    case PSVI_Schema_Specified:                 return (fBitFields & (1 << 9))?true:false;
    default:                                    assert(false); /* it's not a numeric property */
    }
    return 0;
}

void DOMTypeInfoImpl::setStringProperty(PSVIProperty prop, const XMLCh* value) {
    switch(prop)
    {
    case PSVI_Type_Definition_Name:             fTypeName=value; break;
    case PSVI_Type_Definition_Namespace:        fTypeNamespace=value; break;
    case PSVI_Member_Type_Definition_Name:      fMemberTypeName=value; break;
    case PSVI_Member_Type_Definition_Namespace: fMemberTypeNamespace=value; break;
    case PSVI_Schema_Default:                   fDefaultValue=value; break;
    case PSVI_Schema_Normalized_Value:          fNormalizedValue=value; break;
    default:                                    assert(false); /* it's not a string property */
    }
}

void DOMTypeInfoImpl::setNumericProperty(PSVIProperty prop, int value) {
    switch(prop)
    {
    case PSVI_Validity:                         fBitFields |= (value & 0x0003); break;
    case PSVI_Validation_Attempted:             fBitFields |= ((value & 0x0003) << 2); break;
    case PSVI_Type_Definition_Type:             fBitFields |= (value==XSTypeDefinition::COMPLEX_TYPE)?(1 << 5):0; break;
    case PSVI_Type_Definition_Anonymous:        fBitFields |= (value!=0)?(1 << 6):0; break;
    case PSVI_Nil:                              fBitFields |= (value!=0)?(1 << 7):0; break;
    case PSVI_Member_Type_Definition_Anonymous: fBitFields |= (value!=0)?(1 << 8):0; break;
    case PSVI_Schema_Specified:                 fBitFields |= (value!=0)?(1 << 9):0; break;
    default:                                    assert(false); /* it's not a numeric property */
    }
}

XERCES_CPP_NAMESPACE_END
/**
 * End of file DOMTypeInfo.cpp
 */


pcntl
Jason Greene, Arnaud Le Blanc


import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CmsConfig, provideDefaultConfig, UrlModule } from '@spartacus/core';
import { CarouselModule, MediaModule } from '@spartacus/storefront';
import { AttributesModule } from './directives/attributes/attributes.module';
import { MerchandisingCarouselComponent } from './merchandising-carousel/merchandising-carousel.component';

@NgModule({
  imports: [
    CommonModule,
    AttributesModule,
    CarouselModule,
    MediaModule,
    RouterModule,
    UrlModule,
  ],
  providers: [
    provideDefaultConfig(<CmsConfig>{
      cmsComponents: {
        MerchandisingCarouselComponent: {
          component: MerchandisingCarouselComponent,
        },
      },
    }),
  ],
  declarations: [MerchandisingCarouselComponent],
  entryComponents: [MerchandisingCarouselComponent],
  exports: [MerchandisingCarouselComponent],
})
export class MerchandisingCarouselCmsModule {}


# ALSA soundcard-configuration
config SND_TIMER
	tristate

config SND_PCM
	tristate
	select SND_TIMER if SND_PCM_TIMER

config SND_PCM_ELD
	bool

config SND_PCM_IEC958
	bool

config SND_DMAENGINE_PCM
	tristate

config SND_HWDEP
	tristate

config SND_SEQ_DEVICE
	tristate

config SND_RAWMIDI
	tristate
	select SND_SEQ_DEVICE if SND_SEQUENCER != n

config SND_COMPRESS_OFFLOAD
	tristate

config SND_JACK
	bool

# enable input device support in jack layer
config SND_JACK_INPUT_DEV
	bool
	depends on SND_JACK
	default y if INPUT=y || INPUT=SND

config SND_OSSEMUL
	bool "Enable OSS Emulation"
	select SOUND_OSS_CORE
	help
	  This option enables the build of OSS emulation layer.

config SND_MIXER_OSS
	tristate "OSS Mixer API"
	depends on SND_OSSEMUL
	help
	  To enable OSS mixer API emulation (/dev/mixer*), say Y here
	  and read <file:Documentation/sound/alsa/OSS-Emulation.txt>.

	  Many programs still use the OSS API, so say Y.

	  To compile this driver as a module, choose M here: the module
	  will be called snd-mixer-oss.

config SND_PCM_OSS
	tristate "OSS PCM (digital audio) API"
	depends on SND_OSSEMUL
	select SND_PCM
	help
	  To enable OSS digital audio (PCM) emulation (/dev/dsp*), say Y
	  here and read <file:Documentation/sound/alsa/OSS-Emulation.txt>.

	  Many programs still use the OSS API, so say Y.

	  To compile this driver as a module, choose M here: the module
	  will be called snd-pcm-oss.

config SND_PCM_OSS_PLUGINS
	bool "OSS PCM (digital audio) API - Include plugin system"
	depends on SND_PCM_OSS
        default y
	help
          If you disable this option, the ALSA's OSS PCM API will not
          support conversion of channels, formats and rates. It will
          behave like most of new OSS/Free drivers in 2.4/2.6 kernels.

config SND_PCM_TIMER
	bool "PCM timer interface" if EXPERT
	default y
	help
	  If you disable this option, pcm timer will be unavailable, so
	  those stubs that use pcm timer (e.g. dmix, dsnoop & co) may work
	  incorrectlly.

	  For some embedded devices, we may disable it to reduce memory
	  footprint, about 20KB on x86_64 platform.

config SND_HRTIMER
	tristate "HR-timer backend support"
	depends on HIGH_RES_TIMERS
	select SND_TIMER
	help
	  Say Y here to enable HR-timer backend for ALSA timer.  ALSA uses
	  the hrtimer as a precise timing source. The ALSA sequencer code
	  also can use this timing source.

	  To compile this driver as a module, choose M here: the module
	  will be called snd-hrtimer.

config SND_DYNAMIC_MINORS
	bool "Dynamic device file minor numbers"
	help
	  If you say Y here, the minor numbers of ALSA device files in
	  /dev/snd/ are allocated dynamically.  This allows you to have
	  more than 8 sound cards, but requires a dynamic device file
	  system like udev.

	  If you are unsure about this, say N here.

config SND_MAX_CARDS
	int "Max number of sound cards"
	range 4 256
	default 32
	depends on SND_DYNAMIC_MINORS
	help
	  Specify the max number of sound cards that can be assigned
	  on a single machine.

config SND_SUPPORT_OLD_API
	bool "Support old ALSA API"
	default y
	help
	  Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
	  or older).

config SND_PROC_FS
        bool "Sound Proc FS Support" if EXPERT
        depends on PROC_FS
        default y
        help
          Say 'N' to disable Sound proc FS, which may reduce code size about
          9KB on x86_64 platform.
          If unsure say Y.

config SND_VERBOSE_PROCFS
	bool "Verbose procfs contents"
	depends on SND_PROC_FS
	default y
	help
	  Say Y here to include code for verbose procfs contents (provides
          useful information to developers when a problem occurs).  On the
          other side, it makes the ALSA subsystem larger.

config SND_VERBOSE_PRINTK
	bool "Verbose printk"
	help
	  Say Y here to enable verbose log messages.  These messages
	  will help to identify source file and position containing
	  printed messages.

	  You don't need this unless you're debugging ALSA.

config SND_DEBUG
	bool "Debug"
	help
	  Say Y here to enable ALSA debug code.

config SND_DEBUG_VERBOSE
	bool "More verbose debug"
	depends on SND_DEBUG
	help
	  Say Y here to enable extra-verbose debugging messages.

	  Let me repeat: it enables EXTRA-VERBOSE DEBUGGING messages.
	  So, say Y only if you are ready to be annoyed.

config SND_PCM_XRUN_DEBUG
	bool "Enable PCM ring buffer overrun/underrun debugging"
	default n
	depends on SND_DEBUG && SND_VERBOSE_PROCFS
	help
	  Say Y to enable the PCM ring buffer overrun/underrun debugging.
	  It is usually not required, but if you have trouble with
	  sound clicking when system is loaded, it may help to determine
	  the process or driver which causes the scheduling gaps.

config SND_VMASTER
	bool

config SND_DMA_SGBUF
	def_bool y
	depends on X86

source "sound/core/seq/Kconfig"


//
//  ResolverScopeValueTests.swift
//  ResolverTests
//
//  Created by Michael Long on 3/30/18.
//  Copyright © 2018 com.hmlong. All rights reserved.
//

import XCTest
@testable import Resolver

class ResolverScopeValueTests: XCTestCase {

    var resolver: Resolver!

    override func setUp() {
        super.setUp()
        resolver = Resolver()
    }

    override func tearDown() {
        super.tearDown()
    }

    func testResolverScopeGraph() {
        resolver.register { XYZValue() }
        resolver.register { XYZValueService( self.resolver.optional(), self.resolver.optional() ) }
        let service: XYZValueService? = resolver.optional()
        XCTAssertNotNil(service)
        XCTAssertNotNil(service?.value1)
        XCTAssertNotNil(service?.value2)
        if let s1 = service?.value1, let s2 = service?.value2 {
            XCTAssert(s1.id != s2.id)
        } else {
            XCTFail("values not resolved")
        }
    }

    func testResolverScopeShared() {
        resolver.register { XYZValue() }.scope(Resolver.shared)
        var value1: XYZValue? = resolver.optional()
        var value2: XYZValue? = resolver.optional()
        XCTAssertNotNil(value1)
        XCTAssertNotNil(value2)
        // value types will not be shared since weak references do not apply
        if let s1 = value1, let s2 = value2 {
            XCTAssert(s1.id != s2.id)
        } else {
            XCTFail("values not shared")
        }
        let oldID = value1?.id ?? UUID()
        // Release and try again
        value1 = nil
        value2 = nil
        if let newValue: XYZValue = resolver.optional() {
            XCTAssert(newValue.id != oldID)
        } else {
            XCTFail("newValue not resolved")
        }
    }

    func testResolverScopeApplication() {
        resolver.register { XYZValue() }.scope(Resolver.application)
        let value1: XYZValue? = resolver.optional()
        let value2: XYZValue? = resolver.optional()
        XCTAssertNotNil(value1)
        XCTAssertNotNil(value2)
        if let s1 = value1, let s2 = value2 {
            XCTAssert(s1.id == s2.id)
        } else {
            XCTFail("values not cached")
        }
    }

    func testResolverScopeCached() {
        resolver.register { XYZValue() }.scope(Resolver.cached)
        let value1: XYZValue? = resolver.optional()
        let value2: XYZValue? = resolver.optional()
        XCTAssertNotNil(value1)
        XCTAssertNotNil(value2)
        if let s1 = value1, let s2 = value2 {
            XCTAssert(s1.id == s2.id)
        } else {
            XCTFail("values not cached")
        }
        let oldID = value1?.id ?? UUID()
        // Reset and try again
        Resolver.cached.reset()
        if let newService: XYZValue = resolver.optional() {
            XCTAssert(newService.id != oldID)
        } else {
            XCTFail("newService not resolved")
        }

    }

    func testResolverScopeUnique() {
        resolver.register { XYZValue() }.scope(Resolver.unique)
        let value1: XYZValue? = resolver.optional()
        let value2: XYZValue? = resolver.optional()
        XCTAssertNotNil(value1)
        XCTAssertNotNil(value2)
        if let s1 = value1, let s2 = value2 {
            XCTAssert(s1.id != s2.id)
        } else {
            XCTFail("values not resolved")
        }
    }

}


#name: C6X arch attribute merging, c67x c67x+
#as: -mlittle-endian
#ld: -r -melf32_tic6x_le
#source: attr-arch-c67x.s
#source: attr-arch-c67x+.s
#readelf: -A

Attribute Section: c6xabi
File Attributes
  Tag_ISA: C67x\+


/*
 * Copyright Red Hat Inc. and/or its affiliates and other contributors
 * as indicated by the authors tag. All rights reserved.
 *
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
 * of the GNU General Public License version 2.
 *
 * This particular file is subject to the "Classpath" exception as provided in the
 * LICENSE file that accompanied this code.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT A
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License,
 * along with this distribution; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 */
@noanno
class MethodWhileConditionListIsIs() {
    Boolean m(Anything x, Anything y) {
        while (is Integer x1=x, is Integer y1=y) {
            return x1 == y1;
        }
        return false;
    }
    Boolean synthetic(Anything x, Anything y) {
        while (is Integer x, is Integer y) {
            return x == y;
        }
        return false;
    }
    Boolean mElseIf(Anything x, Anything y) {
        while (is Integer x1=x, is Integer y1=y) {
            return x1 == y1;
        }
        return false;
    }
}


use sha2::{Digest, Sha256};
use std::env;
use std::fs;
use std::io::{self, Read};

const BUFFER_SIZE: usize = 1024;

/// Print digest result as hex string and name pair
fn print_result(sum: &[u8], name: &str) {
    for byte in sum {
        print!("{:02x}", byte);
    }
    println!("\t{}", name);
}

/// Compute digest value for given `Reader` and print it
/// On any error simply return without doing anything
fn process<D: Digest + Default, R: Read>(reader: &mut R, name: &str) {
    let mut sh = D::default();
    let mut buffer = [0u8; BUFFER_SIZE];
    loop {
        let n = match reader.read(&mut buffer) {
            Ok(n) => n,
            Err(_) => return,
        };
        sh.update(&buffer[..n]);
        if n == 0 || n < BUFFER_SIZE {
            break;
        }
    }
    print_result(&sh.finalize(), name);
}

fn main() {
    let args = env::args();
    // Process files listed in command line arguments one by one
    // If no files provided process input from stdin
    if args.len() > 1 {
        for path in args.skip(1) {
            if let Ok(mut file) = fs::File::open(&path) {
                process::<Sha256, _>(&mut file, &path);
            }
        }
    } else {
        process::<Sha256, _>(&mut io::stdin(), "-");
    }
}


SELECT
	Department.NAME AS Department,
	Employee.NAME AS Employee,
	Salary
FROM
	Employee,
	Department
WHERE
	Employee.DepartmentId = Department.Id
	AND ( Employee.DepartmentId, Salary )
    IN (SELECT DepartmentId, max( Salary )
        FROM Employee
        GROUP BY DepartmentId )


import pandas as pd
from datetime import datetime
import requests
from urllib.request import urlopen
import json

def stock_data(ticker, period="max", interval="1d", start=None, end=None):
    """
    Description
    ----
    Gives information about the profile of a company which includes
    i.a. beta, company description, industry and sector.

    Input
    ----
    ticker (string)
        The company ticker (for example: "URTH")
    period (string)
        The range of the data (default = "max"), this can hold the following
        periods: "1d","5d","1mo","3mo","6mo","1y","2y","5y","10y","ytd","max"
    interval (string)
        The frequency of the data (default = "1d"), this can hold the
        following intervals: "1m", "2m", "5m", "15m","30m","60m",
        "90m", "1h", "1d", "5d", "1wk", "1mo", "3mo".
        Note that an interval less than 1h can only hold a period 1mo or less."
    start (string)
        The start date in the format %Y-%m-%d. Choose either start/end
        or period.
    end (string)
        The end date in the format %Y-%m-%d. Choose either start/end
        or period.

    Output
    ----
    data (dataframe)
        Data with dates in rows and the quotes in columns.
    """
    parameters = {"interval": interval}

    if start is None or end is None:
        parameters['range'] = period
    else:
        start_timestamp = int(datetime.strptime(start, '%Y-%m-%d').timestamp())
        end_timestamp = int(datetime.strptime(end, '%Y-%m-%d').timestamp())
        parameters["period1"] = start_timestamp
        parameters["period2"] = end_timestamp

    url = "https://query1.finance.yahoo.com/v8/finance/chart/" + ticker

    try:
        data = requests.get(url=url, params=parameters)
        data_json = data.json()['chart']['result'][0]
    except TypeError:
        raise TypeError("No data available. Please check if you have a "
                        "valid period and/or interval." + '\n' +
                        "Note that an interval less than 1h can only "
                        "hold a period of 1mo or less.")

    timestamp = data_json['timestamp']
    dates = []
    for ts in timestamp:
        if interval in ['1m', '2m', '5m', '15m',
                        '30m', '60m', '90m', '1h']:
            dates.append(datetime.fromtimestamp(int(ts)))
        else:
            dates.append(datetime.fromtimestamp(int(ts)).date())

    indicators = data_json['indicators']['quote'][0]
    try:
        indicators.update(data_json['indicators']['adjclose'][0])
    except Exception as e:
        print("Data for " + str(e) + " could not be included.")

    return pd.DataFrame(indicators, index=dates)

def stock_data_detailed(ticker, api_key, begin="1792-05-17", end=None):
    """
    Description
    ----
    Gives complete information about the company's stock which includes open, high,
    low, close, adjusted close, volume, unadjusted volume, change, change percent,
    volume weighted average price, label and change over time.

    This function only allows company tickers and is limited to the companies found
    by calling available_companies() from the details module.

    Input
    ----
    ticker (string)
        The company ticker (for example: "FIZZ")
    api_key (string)
        The API Key obtained from https://financialmodelingprep.com/developer/docs/
    begin (string)
        Begin date in the format %Y-%m-%d.
        Default is the beginning of the Stock Market: 1792-05-17.
    end (string)
        End date in the format %Y-%m-%d.
        Default is the current date.

    Output
    ----
    data (dataframe)
        Data with the date in the rows and the variables in the columns.
    """
    response = urlopen("https://financialmodelingprep.com/api/v3/historical-price-full/" +
                       ticker + "?from=" + str(begin) + "&to=" + str(end) + "&apikey=" + api_key)
    data = json.loads(response.read().decode("utf-8"))

    if 'Error Message' in data:
        raise ValueError(data['Error Message'])

    try:
        data_json = data['historical']
    except KeyError:
        raise ValueError("No data available. Please note this function "
                         "only takes a specific selection of companies." + '\n' +
                         "See: FundamentalAnalysis.available_companies()")

    data_formatted = {}
    for value in data_json:
        date = value['date']
        del value['date']
        data_formatted[date] = value
    data_formatted = pd.DataFrame(data_formatted).T

    return data_formatted


// Windows/Synchronization.cpp

#include "StdAfx.h"

#include "Synchronization.h"

namespace NWindows {
namespace NSynchronization {

}}


.\"	$OpenBSD: htonl.3,v 1.5 2019/02/13 07:02:09 jmc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: February 13 2019 $
.Dt HTONL 3
.Os
.Sh NAME
.Nm htonl ,
.Nm htons ,
.Nm ntohl ,
.Nm ntohs
.Nd convert values between host and network byte orderings
.Sh SYNOPSIS
.In arpa/inet.h
.Ft uint32_t
.Fn htonl "uint32_t host32"
.Ft uint16_t
.Fn htons "uint16_t host16"
.Ft uint32_t
.Fn ntohl "uint32_t net32"
.Ft uint16_t
.Fn ntohs "uint16_t net16"
.Sh DESCRIPTION
These routines convert 16 and 32-bit quantities between different
byte orderings.
.Pp
The
.Fn htonl
and
.Fn htons
functions convert quantities from host to network byte order while the
.Fn ntohl
and
.Fn ntohs
functions convert in the other direction.
.Pp
The last letter
.Pf ( Sq s
or
.Sq l )
is a mnemonic
for the traditional names for such quantities,
.Li short
and
.Li long ,
respectively.
Today, the C concept of
.Li short
and
.Li long
integers need not coincide with this traditional misunderstanding.
On machines which have a byte order which is the same as the network
order, routines are defined as null macros.
.Pp
These routines are most often used in conjunction with Internet
addresses and ports as returned by
.Xr gethostbyname 3
and
.Xr getservent 3 .
.Sh SEE ALSO
.Xr gethostbyname 3 ,
.Xr getservent 3 ,
.Xr htobe64 3
.Sh STANDARDS
The
.Fn htonl ,
.Fn htons ,
.Fn ntohl ,
and
.Fn ntohs
functions conform to
.St -p1003.1 .
.Sh HISTORY
These functions appeared in
.Bx 4.2 .
.Sh BUGS
On the alpha, amd64, i386, and some mips and arm architectures,
bytes are handled backwards from most everyone else in the world.
This is not expected to be fixed in the near future.


/*
 * load_current_sense.c
 *
 *  Created on: 10.03.2017.
 *      Author: milan
 */

#include "load_current_sense.h"
#include "analog.h"
#include "nv.h"
#include "time_count.h"
#include "power_source.h"

#define ID_T_POLY_COEFF_VDG_START 	240
#define ID_T_POLY_COEFF_VDG_END 	800
#define ID_T_POLY_COEFF_VDG_INC 	10
#define ID_T_POLY_COEFF_LEN 		(((int16_t)ID_T_POLY_COEFF_VDG_END - ID_T_POLY_COEFF_VDG_START) / ID_T_POLY_COEFF_VDG_INC + 1)

// Table of poly coefficients of approximated PMOS drain current dependence on temperature and drain to gate voltage
						 	 	 	 	  //{-0.0188,-0.0191,-0.0185,-0.0175,-0.0161,-0.0144,-0.0125,-0.0103,-0.008,-0.0055,-0.0029,0.0001,0.003,0.0058,0.0086,0.011,0.0135,0.0158,0.0173,0.0189,0.0198,0.0203,0.0199,0.019,0.0173,0.015,0.0113,0.0068,0.0011,-0.0056,-0.0137,-0.0231,-0.0339,-0.0463,-0.0603,-0.0763,-0.0938,-0.1126,-0.1336,-0.1558,-0.1802,-0.1558,-0.1558};
static const float a[ID_T_POLY_COEFF_LEN] = {0,0,0,0,0,0,0,0,0,0,0,0,0.0028,0.0031,0.0028,0.0026,0.0024,0.0024,0.0024,0.0024,0.0025,0.0025,0.0026,0.0026,0.0026,0.0026,0.0025,0.0023,0.002,0.0016,-0.0051,-0.0092,-0.0139,-0.0193,-0.0254,-0.0323,-0.0399,-0.0483,-0.0576,-0.0677,-0.0788,-0.0909,-0.104,-0.1181,-0.1311,-0.1458,-0.1612,-0.1774,-0.1945,-0.2123,-0.231,-0.2506,-0.271,-0.2922,-0.3144,-0.3374,-0.3614};
						 	 	 	 	  //{2.1296,2.0782,1.9572,1.8184,1.6645,1.4981,1.3222,1.1398,0.9543,0.7691,0.588,0.3775,0.1915,0.0219,-0.1394,-0.2502,-0.3679,-0.4625,-0.479,-0.4989,-0.4544,-0.3769,-0.2106,0.0011,0.2771,0.6116,1.0613,1.5835,2.1978,2.8995,3.7209,4.6451,5.6802,6.8469,8.1411,9.5966,11.16,12.828,14.671,16.588,18.676,16.588,16.588};
static const float b[ID_T_POLY_COEFF_LEN] = {0.2169,0.1571,0.1201,0.1042,0.1078,0.1295,0.1676,0.2207,0.2872,0.3655,0.4541,0.5514,0.3989,0.4694,0.5615,0.6495,0.7352,0.8204,0.9068,0.9962,1.0904,1.1911,1.3001,1.4193,1.5503,1.695,1.8551,2.0323,2.2286,2.4456,3.0549,3.5263,4.0515,4.6335,5.2757,5.981,6.7528,7.5942,8.5084,9.4986,10.568,11.719,12.957,14.282,15.501,16.858,18.278,19.763,21.312,22.926,24.607,26.354,28.169,30.052,32.004,34.025,36.117};
									      //{-49.855,-47.355,-43.582,-39.622,-35.508,-31.274,-26.956,-22.594,-18.229,-13.905,-9.6695,-4.7774,-0.339,3.8561,8.0158,11.287,14.931,18.354,20.432,22.947,24.503,25.822,25.767,25.318,24.128,22.378,18.922,14.729,9.4428,3.2338,-4.5243,-13.402,-23.5,-35.189,-48.31,-63.502,-79.554,-96.315,-115.23,-134.03,-154.69,-134.05,-134.06};
static const float c[ID_T_POLY_COEFF_LEN] = {-8.2299,-4.4796,-1.6241,0.4295,1.774,2.5026,2.708,2.4833,1.9213,1.115,0.1574,-0.8587,3.632,3.669,4.126,5.003,6.3,8.017,10.154,12.711,15.688,19.085,22.902,27.139,31.796,36.873,42.37,48.287,54.624,61.381,68.558,76.155,84.172,92.609,101.47,110.74,120.44,130.56,141.09,152.05,163.43,175.23,187.44,200.08,217.37,234.16,252.12,271.29,291.73,313.5,336.64,361.2,387.24,414.82,443.99,474.79,507.28};
// ID = a * T^2 + b * T + c
// a = a[index], b = b[index], c = c[index]
// index = (VDG - ID_T_POLY_COEFF_VDG_START) / ID_T_POLY_COEFF_VDG_INC

static int16_t currBuffer[16] = {0};
static uint8_t currBufferInd = 0;

volatile static uint8_t kta;
volatile static uint8_t ktb;

volatile static int16_t resLoadCurrCalib = 0;

uint8_t pow5vIoResLoadCurrentStat[16];

int16_t pow5vIoPMOSLoadCurrent = 0;
int16_t pow5vIoResLoadCurrent = 0;

static float GetRefLoadCurrent() {
	int32_t vdg = 4790 - ((GetSample(POW_DET_SENS_CHN)*aVdd)>>11);//ANALOG_GET_VDG_AVG();
	//vdg *= vdgCalibCoeff * mcuTemperature;
	//vdg >>= 10;
	int16_t i = vdg >= ID_T_POLY_COEFF_VDG_START ? (vdg - ID_T_POLY_COEFF_VDG_START + ID_T_POLY_COEFF_VDG_INC / 2) / ID_T_POLY_COEFF_VDG_INC : 0;
	i = i >= ID_T_POLY_COEFF_LEN ? ID_T_POLY_COEFF_LEN - 1 : i;

	volatile float current = a[i] * mcuTemperature * mcuTemperature + b[i] * mcuTemperature + c[i];
	return current > 0 ? current : 0;
}

static int32_t GetResSenseCurrent(void) {
	volatile int32_t samAvg = GetSampleAverageDiff(0, 1);
	return (samAvg * aVdd * 25) >> 8; // 4096 * 2 * aVdd * 100;
}

int32_t GetLoadCurrent(void) {
	if ( pow5vInDetStatus == POW_5V_IN_DETECTION_STATUS_NOT_PRESENT ) {
		if ( POW_5V_BOOST_EN_STATUS() )  {
			if ((pow5vIoResLoadCurrent - resLoadCurrCalib) < 800 && (pow5vIoResLoadCurrent - resLoadCurrCalib) > -300 )
				return pow5vIoPMOSLoadCurrent;
			else
				return pow5vIoResLoadCurrent - resLoadCurrCalib;
		} else {
			return 0;
		}
	} else {
		return pow5vIoResLoadCurrent - resLoadCurrCalib;
	}
	//return ((currBuffer[0] + currBuffer[1] + currBuffer[2] + currBuffer[3] + currBuffer[4] + currBuffer[5] + currBuffer[6] + currBuffer[7]) >> 3) - resLoadCurrCalib;
	/*uint8_t i;
	int8_t cnt = 0;
	int32_t sum = 0;
	int16_t d = pow5vIoResLoadCurrent < 0 ? - (pow5vIoResLoadCurrent >> 2) : pow5vIoResLoadCurrent >> 2;
	int16_t h = pow5vIoResLoadCurrent + d;
	int16_t r = pow5vIoResLoadCurrent - d;
	for (i=0; i < 16; i++) {
		if (currBuffer[i] < h && currBuffer[i] > r) {
			sum += currBuffer[i];
			cnt ++;
		}
	}

	return cnt ? sum / cnt - resLoadCurrCalib : pow5vIoResLoadCurrent - resLoadCurrCalib;*/
	return pow5vIoResLoadCurrent - resLoadCurrCalib;
}

void MeasurePMOSLoadCurrent(void) {
	pow5vIoPMOSLoadCurrent = ((kta * mcuTemperature + (((uint16_t)ktb) << 8) ) * ((int32_t)(GetRefLoadCurrent()+0.5))) >> 13; //ktNorm * k12 * refCurr
}

void GetCurrStat(uint8_t stat[]) {
	uint8_t i;
	for (i = 0; i < 8; i++) {
		uint16_t ind = (ADC_BUFFER_LENGTH/8) * i;
		int16_t diff = ((ADC_GET_BUFFER_SAMPLE(ind) - ADC_GET_BUFFER_SAMPLE(ind+1)) >> 1) + 8;
		if (diff > 15) diff = 15;
		if (diff < 0) diff = 0;
		stat[diff] ++;
	}
}

void LoadCurrentSenseTask(void) {
	if (AnalogSamplesReady()) {
		volatile int32_t newCurr = GetResSenseCurrent();
		if (newCurr < 3000 && newCurr > -3000) {
			uint8_t i = (currBufferInd++)&0x0F;
			pow5vIoResLoadCurrent -= currBuffer[i] >> 4;
			currBuffer[i] = newCurr;
			pow5vIoResLoadCurrent += currBuffer[i] >> 4;
		}
	}

	/*int32_t sum = 0;
	for (i = 0; i < 16; i++) sum += currBuffer[i];
	pow5vIoResLoadCurrent = sum >> 4;*/

	/*GetCurrStat(pow5vIoResLoadCurrentStat);
	if ( !(i&0x0F) ) {
		uint8_t j;
		uint8_t maxStat = 0;
		volatile int8_t maxInd = 0;
		for (j = 0; j < 16; j++) {
			if (pow5vIoResLoadCurrentStat[j] > maxStat) {
				maxStat = pow5vIoResLoadCurrentStat[j];
				maxInd = j;
			}
			//pow5vIoResLoadCurrentStat[j] = 0;
		}

		int16_t s = 0, cnt = 0;

		for (j = maxInd - 2; j <= (maxInd+2); j++) {
			s += (int16_t)pow5vIoResLoadCurrentStat[j] * j;
			cnt += pow5vIoResLoadCurrentStat[j];
		}
		for (j = 0; j < 16; j++)  pow5vIoResLoadCurrentStat[j] = 0;
		pow5vIoResLoadCurrent = ( (int32_t)(((float)s/cnt)-8) * 2 * aVdd * 25) >> 8;
	}*/
}

static int8_t ReadILoadCalibCoeffs(void) {
	kta = 0; // invalid value
	ktb = 0; // invalid value
	resLoadCurrCalib = 0;

	uint16_t var;
	EE_ReadVariable(VDG_ILOAD_CALIB_KTA_NV_ADDR, &var);
	if ( (((~var)&0xFF) != (var>>8)) ) return 1;
	kta = var&0xFF;

	EE_ReadVariable(VDG_ILOAD_CALIB_KTB_NV_ADDR, &var);
	if ( (((~var)&0xFF) != (var>>8)) ) return 1;
	ktb = var&0xFF;

	EE_ReadVariable(RES_ILOAD_CALIB_ZERO_NV_ADDR, &var);
	if ( (((~var)&0xFF) != (var>>8)) ) return 1;
	//uint8_t c = var&0xFF;
	resLoadCurrCalib = (int16_t)10 * ((int8_t)(var&0xFF));

	return 0;
}

void LoadCurrentSenseInit(void) {
	ReadILoadCalibCoeffs();
}

int8_t CalibrateLoadCurrent(void) {

	resLoadCurrCalib = pow5vIoResLoadCurrent - 51;  // 5.1v/100ohm

	Turn5vBoost(1);
	if (!POW_5V_BOOST_EN_STATUS()) return 1;
	Power5VSetModeLDO();
	DelayUs(1000);

	float ktNorm = 0.0052 * mcuTemperature + 0.9376;
	volatile float curr = GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	DelayUs(10000);
	curr += GetRefLoadCurrent();
	//if ( curr > (4*52) || curr < (52/4) ) return 2;
	float k12 = (float)52 * 8 / (curr * ktNorm); // = k / ktNorm;
	kta = 0.0052 * k12 * 1024 * 8;
	ktb = 0.9376 * k12 * 32;
	EE_WriteVariable(VDG_ILOAD_CALIB_KTA_NV_ADDR, kta | ((uint16_t)~kta<<8));
	EE_WriteVariable(VDG_ILOAD_CALIB_KTB_NV_ADDR, ktb | ((uint16_t)~ktb<<8));

	uint8_t c = resLoadCurrCalib / 10;
	EE_WriteVariable(RES_ILOAD_CALIB_ZERO_NV_ADDR, c | ((uint16_t)~c<<8));
	if (resLoadCurrCalib > 1250 || resLoadCurrCalib < -1250) return 2;

	if ( ReadILoadCalibCoeffs() != 0 ) return 3;

	return 0;
}