text:
import shutil, os.path, json, subprocess, hashlib, glob
import unittest, logging, sys, lzma, time, platform

successLogo = """
      +----------------------------------+
      |    All test cases have PASSED    |
      +----------------------------------+
"""
resDir = "src/integrationTest/resources"
resDir2 = "src/integrationTest/resources_2"
log = logging.getLogger('TEST')
log.setLevel(logging.DEBUG)
consoleHandler = logging.StreamHandler(sys.stdout)
consoleHandler.setFormatter(logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(name)s - %(message)s',
    datefmt='%Y-%m-%d %H:%M:%S'))
log.addHandler(consoleHandler)

def hashFile(fileName):
    hasher = hashlib.md5()
    with open(fileName, 'rb') as afile:
        buf = afile.read()
        hasher.update(buf)
    return hasher.hexdigest()

def deleteIfExists(inFile):
    if os.path.isfile(inFile):
        log.info("rm %s" % inFile)
        raise
    ## do not delete
    #for i in range(3):
    #    try:
    #        if os.path.isfile(inFile):
    #            log.info("rm %s" % inFile)
    #            os.remove(inFile)
    #        return
    #    except Exception as e:
    #        log.warning("Exception in cleaning up %s" % inFile)
    #        time.sleep(3)

def cleanUp():
    log.info("clean up ...")
    shutil.rmtree("build/unzip_boot", ignore_errors = True)
    [deleteIfExists(item) for item in [
        "boot.img", "boot.img.clear", "boot.img.google", "boot.img.signed", "boot.img.signed2",
        "recovery.img", "recovery.img.clear", "recovery.img.google", "recovery.img.signed", "recovery.img.signed2",
        "vbmeta.img", "vbmeta.img.signed",
        "dtbo.img", "dtbo.img.clear", "dtbo.img.signed", "dtbo.img.signed2",
        "misc.img", "misc.img.new",
        "payload.bin",
        "init_boot.img", "init_boot.img.signed",
        "vendor_boot.img", "vendor_boot.img.clear", "vendor_boot.img.google", "vendor_boot.img.signed", "vendor_boot.img.signed2",
        "boot-debug.img", "boot-debug.img.clear", "boot-debug.img.google",
        "vendor_boot-debug.img", "vendor_boot-debug.img.clear", "vendor_boot-debug.img.google" ]]

def verifySingleJson(jsonFile, func = None):
    log.info("executing %s ..." % jsonFile)
    imgDir = os.path.dirname(jsonFile)
    verifyItems = json.load(open(jsonFile))
    for k, v in verifyItems["copy"].items():
        it = os.path.join(imgDir, k)
        if (os.path.isfile(it)):
            log.info("copy file: %s -> %s" % (os.path.join(imgDir, k), v))
            shutil.copyfile(it, v)
        elif (os.path.isfile(it + ".xz")):
            log.info("extract file: %s -> %s" % (it + ".xz", v))
            decompressXZ(it + ".xz", v)
        else:
            raise
    if sys.platform == "win32":
        gradleWrapper = "gradlew.bat"
    else:
        gradleWrapper = "./gradlew"
    subprocess.check_call(gradleWrapper + " unpack", shell = True)
    if func:
        func()
    subprocess.check_call(gradleWrapper + " pack", shell = True)
    for k, v in verifyItems["hash"].items():
        log.info("%s : %s" % (k, v))
        unittest.TestCase().assertEqual(v, hashFile(k))
    try:
        subprocess.check_call(gradleWrapper + " clear", shell = True)
    except Exception as e:
        pass

def verifySingleDir(inResourceDir, inImageDir):
    resDir = inResourceDir
    imgDir = inImageDir
    log.info("Enter %s ..." % os.path.join(resDir, imgDir))
    jsonFiles = glob.glob(os.path.join(resDir, imgDir) + "/*.json")
    for jsonFile in jsonFiles:
        cleanUp()
        verifySingleJson(jsonFile)
        cleanUp()
    pyFiles = glob.glob(os.path.join(resDir, imgDir) + "/*.py")
    for pyFile in pyFiles:
        cleanUp()
        log.warning("calling %s" % pyFile)
        if sys.platform == "win32":
            theCmd = "python " + pyFile
        else:
            theCmd = pyFile
        subprocess.check_call(theCmd, shell = True)
        cleanUp()
    log.info("Leave %s" % os.path.join(resDir, imgDir))

def decompressXZ(inFile, outFile):
    with lzma.open(inFile) as f:
        file_content = f.read()
        with open(outFile, "wb") as f2:
            f2.write(file_content)

def seekedCopy(inFile, outFile, offset):
    print(inFile + " -> " + outFile)
    with open(inFile, "rb") as reader:
        reader.seek(offset)
        content = reader.read()
        with open(outFile, "wb") as writer:
            writer.write(content)

def main():
    #########################################
    #   resource_1
    #########################################
    # from volunteers
    verifySingleDir(resDir, "recovery_image_from_s-trace")
    verifySingleDir(resDir, "boot_img_from_gesangtome") # android 9, no ramdisk
    verifySingleDir(resDir, "issue_47")
    verifySingleDir(resDir, "issue_52")
    verifySingleDir(resDir, "issue_54")
    # 5.0
    verifySingleDir(resDir, "5.0_fugu_lrx21m")
    # 6.0
    verifySingleDir(resDir, "6.0.0_bullhead_mda89e")
    # 7.0 special boot
    cleanUp()
    #subprocess.check_call("dd if=%s/7.1.1_volantis_n9f27m/boot.img of=boot.img bs=256 skip=1" % resDir, shell = True)
    seekedCopy(os.path.join(resDir, "7.1.1_volantis_n9f27m", "boot.img"), "boot.img", 256)
    verifySingleJson(resDir + "/7.1.1_volantis_n9f27m/boot.json")
    # 7.0 special recovery
    cleanUp()
    #subprocess.check_call("dd if=%s/7.1.1_volantis_n9f27m/recovery.img of=recovery.img bs=256 skip=1" % resDir, shell = True)
    seekedCopy(os.path.join(resDir, "7.1.1_volantis_n9f27m", "recovery.img"), "recovery.img", 256)
    verifySingleJson("%s/7.1.1_volantis_n9f27m/recovery.json" % resDir)
    # 8.0
    verifySingleDir(resDir, "8.0.0_fugu_opr2.170623.027")
    # 9.0 + avb
    verifySingleDir(resDir, "9.0.0_blueline_pq1a.181105.017.a1")
    # Q preview
    verifySingleDir(resDir, "Q_preview_blueline_qpp2.190228.023")
    # 10
    verifySingleDir(resDir, "10.0.0_coral-qq1d.200205.002")
    # 11
    verifySingleDir(resDir, "11.0.0_redfin.rd1a.200810.021.a1")

    #########################################
    #   resource_2
    #########################################
    cleanUp()
    verifySingleJson("%s/issue_59/recovery.json" % resDir2, func = lambda: shutil.rmtree("build/unzip_boot/root", ignore_errors = False))
    # Issue 71: dtbo
    if platform.system() != "Darwin":
        verifySingleDir(resDir2, "issue_71")
        verifySingleDir(resDir2, "issue_71/redfin")
    else:
        log.info("dtbo not fully supported on MacOS, skip testing")
    # Issue 83: init_boot
    verifySingleDir(resDir2, "issue_83")
    # Issue 86: vendor_boot with vrt and board name
    verifySingleDir(resDir2, "issue_86")
    # Issue 88: boot image V4 without boot signature,
    #  and Issue 75: allow duplicated entry in cpio
    verifySingleDir(resDir2, "issue_88")
    # Issue 92: unsigned vendor_boot
    verifySingleDir(resDir2, "issue_91_unsigned_vendor_boot")

    log.info(successLogo)

if __name__ == "__main__":
    # execute only if run as a script
    main()


text:
package org.usfirst.frc.team948.robot.commands;

public interface FieldDimensions {
	// All dimensions are in feet
	public static final double TOTE_TO_SCORING = 4.0;
	public static final double SCORING_WIDTH = (Math.cos(16 * Math.PI / 180) * 2 * 7.125 + 20) / 12;
	public static final double AUTOZONE_WIDTH = 6.5;
	public static final double BIN_TOTE_GROUP_WIDTH = 1.75;
	public static final double BIN_TOTE_GROUP_LENGTH = 4.0;
	public static final double FIELD_WIDTH = 27.0;
	public static final double BIN_TOTE_GROUP_TO_LANDMARK = 8 + 11 / 12.0;
}

redpajama_set_name: RedPajamaGithub


text:
{
    'name': 'Purchase Analytic Plans',
    'version': '1.0',
    'category': 'Purchase Management',
    'description': """
The base module to manage analytic distribution and purchase orders.
====================================================================

Allows the user to maintain several analysis plans. These let you split a line
on a supplier purchase order into several accounts and analytic plans.
    """,
    'author': 'OpenERP SA',
    'website': 'https://www.odoo.com/page/purchase',
    'images': ['images/purchase_analytic_distribution.jpeg'],
    'depends': ['purchase', 'account_analytic_plans'],
    'data': ['purchase_analytic_plans_view.xml'],
    'demo': [],
    'installable': True,
    'auto_install': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


text:
Computer vision with iOS: Tracking faces in live video
------------------------------------------------------------------------

This is the source code that accompanies our [article][1] on how to process live video with OpenCV on iOS devices. Video frames are
captured using the AVFoundation framework and face detection is performed using OpenCV's Haar CascadeClassifier.

[1]: http://aptogo.co.uk


text:
/**
 *
 */
package org.geek.pipe.compoment;

import java.util.HashMap;
import java.util.Map;

/**
 * @author haichuan
 * 2012-1-20
 */
public abstract class UriParserEndpoint implements EndPoint {

	private String uri;
	private Map<String, String> parmeters;

	@Override
	public String getUri() {
		return this.uri;
	}

	@Override
	public void setUri(String uri) {
		this.uri = uri;
		parmeters = parserUriParmeter();
	}

	protected Map<String, String> parserUriParmeter(){
		Map<String, String> result = new HashMap<String, String>();

		return result;
	}

	protected abstract boolean vaildateUri() throws VaildateURIException;

	public Map<String, String> getParmeters() {
		return parmeters;
	}
}


text:
package io.reactivex.internal.operators.single;

import java.util.function.Function;

import io.reactivex.Single;
import io.reactivex.Single.*;
import io.reactivex.disposables.*;

public final class SingleOperatorFlatMap<T, R> implements SingleOperator<R, T> {
    final Function<? super T, ? extends Single<? extends R>> mapper;

    public SingleOperatorFlatMap(Function<? super T, ? extends Single<? extends R>> mapper) {
        this.mapper = mapper;
    }

    @Override
    public SingleSubscriber<? super T> apply(SingleSubscriber<? super R> t) {
        return new SingleFlatMapCallback<>(t, mapper);
    }

    static final class SingleFlatMapCallback<T, R> implements SingleSubscriber<T> {
        final SingleSubscriber<? super R> actual;
        final Function<? super T, ? extends Single<? extends R>> mapper;

        final MultipleAssignmentDisposable mad;

        public SingleFlatMapCallback(SingleSubscriber<? super R> actual,
                Function<? super T, ? extends Single<? extends R>> mapper) {
            this.actual = actual;
            this.mapper = mapper;
            this.mad = new MultipleAssignmentDisposable();
        }

        @Override
        public void onSubscribe(Disposable d) {
            mad.set(d);
        }

        @Override
        public void onSuccess(T value) {
            Single<? extends R> o;

            try {
                o = mapper.apply(value);
            } catch (Throwable e) {
                actual.onError(e);
                return;
            }

            if (o == null) {
                actual.onError(new NullPointerException("The single returned by the mapper is null"));
                return;
            }

            if (mad.isDisposed()) {
                return;
            }

            o.subscribe(new SingleSubscriber<R>() {
                @Override
                public void onSubscribe(Disposable d) {
                    mad.set(d);
                }

                @Override
                public void onSuccess(R value) {
                    actual.onSuccess(value);
                }

                @Override
                public void onError(Throwable e) {
                    actual.onError(e);
                }
            });
        }

        @Override
        public void onError(Throwable e) {
            actual.onError(e);
        }
    }
}


text:
import numpy as np
import pandas as pd
import random as rd
import timeit

from score import calc_score

data = pd.read_csv('../Data/train_users_2.csv', usecols=['id', 'country_destination'])
data.index = data['id']
id_users = pd.unique(data['id'])[:10000]
targets = pd.DataFrame({'country':data.loc[id_users]['country_destination']}, index=id_users)

""" Generating random predictions """
len_preds = 5
country_pool = ['US', 'FR', 'CA', 'GB', 'ES', 'IT', 'PT', 'NL', 'DE', 'AU', 'NDF', 'other']
dict_pred = {}
for id_user in id_users:
    dict_pred[id_user] = rd.sample(country_pool, len_preds)

predictions = pd.DataFrame(dict_pred)
predictions = predictions.T

start = timeit.default_timer()
print calc_score(predictions, targets)
stop = timeit.default_timer()
print 'Calculated in %s seconds.' % (stop - start)


text:
@class AppEngineChannel;

@protocol AppEngineChannelDelegate <NSObject>
@optional
- (void) appEngineChannelDidConnect:(AppEngineChannel *)channel;
- (void) appEngineChannelDidDisconnect:(AppEngineChannel *)channel;
- (void) appEngineChannel:(AppEngineChannel *)channel didReceiveMessage:(NSDictionary *)message;
- (void) appEngineChannel:(AppEngineChannel *)channel didReceiveError:(NSDictionary *)error;
@end

@interface AppEngineChannel : NSObject <UIWebViewDelegate>
- (id)initWithDelegate:(id<AppEngineChannelDelegate>)delegate;
- (void)connectWithToken:(NSString *)token baseURL:(NSURL *)baseURL;
@end


text:
#pragma once
#include <aws/sesv2/SESV2_EXPORTS.h>
#include <aws/sesv2/model/ReviewStatus.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SESV2
{
namespace Model
{

  /**
   *
An object that contains information about your account details
   * review.

See Also:
   AWS
   * API Reference

   */
  class AWS_SESV2_API ReviewDetails
  {
  public:
    ReviewDetails();
    ReviewDetails(Aws::Utils::Json::JsonView jsonValue);
    ReviewDetails& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline const ReviewStatus& GetStatus() const{ return m_status; }

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline void SetStatus(const ReviewStatus& value) { m_statusHasBeenSet = true; m_status = value; }

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline void SetStatus(ReviewStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline ReviewDetails& WithStatus(const ReviewStatus& value) { SetStatus(value); return *this;}

    /**
     *
The status of the latest review of your account. The status can be one of the
     * following:

 PENDING – We have received your appeal
     * and are in the process of reviewing it.

 GRANTED
     * – Your appeal has been reviewed and your production access has been granted.

     *

 DENIED – Your appeal has been reviewed and your
     * production access has been denied.

 FAILED – An
     * internal error occurred and we didn't receive your appeal. You can submit your
     * appeal again.

     */
    inline ReviewDetails& WithStatus(ReviewStatus&& value) { SetStatus(std::move(value)); return *this;}

    /**
     *
The associated support center case ID (if any).

     */
    inline const Aws::String& GetCaseId() const{ return m_caseId; }

    /**
     *
The associated support center case ID (if any).

     */
    inline bool CaseIdHasBeenSet() const { return m_caseIdHasBeenSet; }

    /**
     *
The associated support center case ID (if any).

     */
    inline void SetCaseId(const Aws::String& value) { m_caseIdHasBeenSet = true; m_caseId = value; }

    /**
     *
The associated support center case ID (if any).

     */
    inline void SetCaseId(Aws::String&& value) { m_caseIdHasBeenSet = true; m_caseId = std::move(value); }

    /**
     *
The associated support center case ID (if any).

     */
    inline void SetCaseId(const char* value) { m_caseIdHasBeenSet = true; m_caseId.assign(value); }

    /**
     *
The associated support center case ID (if any).

     */
    inline ReviewDetails& WithCaseId(const Aws::String& value) { SetCaseId(value); return *this;}

    /**
     *
The associated support center case ID (if any).

     */
    inline ReviewDetails& WithCaseId(Aws::String&& value) { SetCaseId(std::move(value)); return *this;}

    /**
     *
The associated support center case ID (if any).

     */
    inline ReviewDetails& WithCaseId(const char* value) { SetCaseId(value); return *this;}

  private:

    ReviewStatus m_status;
    bool m_statusHasBeenSet;

    Aws::String m_caseId;
    bool m_caseIdHasBeenSet;
  };

} // namespace Model
} // namespace SESV2
} // namespace Aws


text:
Brick breaking game in the vein of Atari's *Breakout*.

Control the paddle with the directional keys to keep a ball bouncing against a brick wall until all of the bricks are broken.

High scores are saved to EEPROM and can be saved through Arduboy restarts.


text:
#pragma once
#include <aws/config/ConfigService_EXPORTS.h>
#include <aws/config/ConfigServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace ConfigService
{
namespace Model
{

  /**
   */
  class AWS_CONFIGSERVICE_API DeleteResourceConfigRequest : public ConfigServiceRequest
  {
  public:
    DeleteResourceConfigRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DeleteResourceConfig"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The type of the resource.

     */
    inline const Aws::String& GetResourceType() const{ return m_resourceType; }

    /**
     *
The type of the resource.

     */
    inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }

    /**
     *
The type of the resource.

     */
    inline void SetResourceType(const Aws::String& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; }

    /**
     *
The type of the resource.

     */
    inline void SetResourceType(Aws::String&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); }

    /**
     *
The type of the resource.

     */
    inline void SetResourceType(const char* value) { m_resourceTypeHasBeenSet = true; m_resourceType.assign(value); }

    /**
     *
The type of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceType(const Aws::String& value) { SetResourceType(value); return *this;}

    /**
     *
The type of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceType(Aws::String&& value) { SetResourceType(std::move(value)); return *this;}

    /**
     *
The type of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceType(const char* value) { SetResourceType(value); return *this;}

    /**
     *
Unique identifier of the resource.

     */
    inline const Aws::String& GetResourceId() const{ return m_resourceId; }

    /**
     *
Unique identifier of the resource.

     */
    inline bool ResourceIdHasBeenSet() const { return m_resourceIdHasBeenSet; }

    /**
     *
Unique identifier of the resource.

     */
    inline void SetResourceId(const Aws::String& value) { m_resourceIdHasBeenSet = true; m_resourceId = value; }

    /**
     *
Unique identifier of the resource.

     */
    inline void SetResourceId(Aws::String&& value) { m_resourceIdHasBeenSet = true; m_resourceId = std::move(value); }

    /**
     *
Unique identifier of the resource.

     */
    inline void SetResourceId(const char* value) { m_resourceIdHasBeenSet = true; m_resourceId.assign(value); }

    /**
     *
Unique identifier of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceId(const Aws::String& value) { SetResourceId(value); return *this;}

    /**
     *
Unique identifier of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceId(Aws::String&& value) { SetResourceId(std::move(value)); return *this;}

    /**
     *
Unique identifier of the resource.

     */
    inline DeleteResourceConfigRequest& WithResourceId(const char* value) { SetResourceId(value); return *this;}

  private:

    Aws::String m_resourceType;
    bool m_resourceTypeHasBeenSet = false;

    Aws::String m_resourceId;
    bool m_resourceIdHasBeenSet = false;
  };

} // namespace Model
} // namespace ConfigService
} // namespace Aws


text:
package org.csc.phynixx.sqlquery.db.operations;

import com.querydsl.core.types.Operator;

public class Operators {

	public static final Operator SUB_STRING = new Operator() {

		/**
		 *
		 */
		public static final long serialVersionUID = 8570558787202348726L;

		public String name() {
			return "SUB_STRING";
		}

		public Class<?> getType() {
			return String.class;
		}

	};

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18444
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace PDStat.Properties {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDStat.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap bg {
            get {
                object obj = ResourceManager.GetObject("bg", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
        /// </summary>
        internal static System.Drawing.Icon icon {
            get {
                object obj = ResourceManager.GetObject("icon", resourceCulture);
                return ((System.Drawing.Icon)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to [
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "ワールドイズマイン",
        ///		"RomajiTitle": "Waarudo Izu Main",
        ///		"ENTitle": "World Is Mine"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "ひねくれ者",
        ///		"RomajiTitle": "Hinekure Mono",
        ///		"ENTitle": "The Rebel"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "恋は戦争",
        ///		"RomajiTitle": "Koi wa Sensou",
        ///		"ENTitle": "Love is War"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "その一秒スローモーション",
        ///		"RomajiTitle": "Sono Ichibyuo Slow Motion",
        ///		"ENTitle": "That One Second Slow Motion"
        ///	},
        /// [rest of string was truncated]";.
        /// </summary>
        internal static string PD1Songs {
            get {
                return ResourceManager.GetString("PD1Songs", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to [
        ///	{
        ///		"Mode": "Tutorial",
        ///		"JPTitle": "Ievan Polkka"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "ロミオとシンデレラ",
        ///		"RomajiTitle": "Romeo to Cinderella",
        ///		"ENTitle": "Romeo and Cinderella"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "magnet"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "愛言葉",
        ///		"RomajiTitle": "Ai Kotoba",
        ///		"ENTitle": "Love Words"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "サウンド",
        ///		"RomajiTitle": "sound"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "ココロ",
        ///		"RomajiTitle": "Koko [rest of string was truncated]";.
        /// </summary>
        internal static string PD2Songs {
            get {
                return ResourceManager.GetString("PD2Songs", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to [
        ///	{
        ///		"Mode": "Tutorial",
        ///		"JPTitle": "Ievan Polkka"
        ///	},
        ///	{
        ///		"Mode": "Tutorial",
        ///		"JPTitle": "Ievan Polkka (Extreme)"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "メルト",
        ///		"RomajiTitle": "Melt"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "アカツキアライヴァル",
        ///		"RomajiTitle": "Akatsuki Arrival",
        ///		"ENTitle": "Daybreak Arrival",
        ///		"LocalizedTitle": "Akatsuki Arrival"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "packaged",
        ///		"LocalizedTitle": "Packaged"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": " [rest of string was truncated]";.
        /// </summary>
        internal static string PDF2Songs {
            get {
                return ResourceManager.GetString("PDF2Songs", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to [
        ///	{
        ///		"Mode": "Tutorial",
        ///		"JPTitle": "Ievan Polkka"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "キャットフード",
        ///		"RomajiTitle": "Cat Food"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "秘密警察",
        ///		"RomajiTitle": "Himitsu Keisatsu",
        ///		"ENTitle": "Secret Police"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "メランコリック",
        ///		"RomajiTitle": "Melancholic"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "Weekender Girl"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "タイムマシン",
        ///		"RomajiTitle": "Time Machine"
        ///	},
        ///	{
        /// [rest of string was truncated]";.
        /// </summary>
        internal static string PDFSongs {
            get {
                return ResourceManager.GetString("PDFSongs", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to [
        ///	{
        ///		"Mode": "Tutorial",
        ///		"JPTitle": "Ievan Polkka"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "ねこみみスイッチ",
        ///		"RomajiTitle": "Nekomimi Switch",
        ///		"ENTitle": "Cat Ears Switch"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "孤独の果て",
        ///		"RomajiTitle": "Kodoku no Hate",
        ///		"ENTitle": "End of Solitude"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "Palette"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "SPiCa -39's Giving Day Edition-"
        ///	},
        ///	{
        ///		"Mode": "Default",
        ///		"JPTitle": "Starduster"
        ///	},
        ///	{
        ///		"M [rest of string was truncated]";.
        /// </summary>
        internal static string PDXSongs {
            get {
                return ResourceManager.GetString("PDXSongs", resourceCulture);
            }
        }
    }
}


text:
#include "../objects.h"
#include "../demo_utils.h"
#include <assert.h>
#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <time.h>

typedef enum {
    DOWNLOAD_DIAG_STATE         = 0,
    DOWNLOAD_DIAG_URL           = 1,
    DOWNLOAD_DIAG_ROM_TIME_US   = 2,
    /* begin of transmission time */
    DOWNLOAD_DIAG_BOM_TIME_US   = 3,
    /* end of transmission time */
    DOWNLOAD_DIAG_EOM_TIME_US   = 4,
    /* total number of bytes transmitted between BOM_TIME and EOM_TIME */
    DOWNLOAD_DIAG_TOTAL_BYTES   = 5,
    DOWNLOAD_DIAG_RUN           = 6
} download_diag_res_t;

typedef enum {
    DIAG_STATE_NONE             = 0,
    DIAG_STATE_REQUESTED        = 1,
    DIAG_STATE_COMPLETED        = 2,
    DIAG_STATE_TRANSFER_FAILED  = 3
} download_diag_state_t;

typedef struct {
    avs_time_real_t beg;
    avs_time_real_t end;
    size_t bytes_received;
} download_diag_stats_t;

typedef struct {
    const anjay_dm_object_def_t *def;
    char download_url[1024];
    anjay_download_handle_t dl_handle;
    download_diag_stats_t stats;
    download_diag_state_t state;
} download_diag_repr_t;

static download_diag_repr_t *get_diag(const anjay_dm_object_def_t *const *obj_ptr) {
    assert(obj_ptr);
    return container_of(obj_ptr, download_diag_repr_t, def);
}

static void set_state(anjay_t *anjay,
                      download_diag_repr_t *repr,
                      download_diag_state_t state) {
    (void) anjay;
    if (repr->state != state) {
        repr->state = state;
        anjay_notify_changed(anjay, DEMO_OID_DOWNLOAD_DIAG, 0,
                             DOWNLOAD_DIAG_STATE);
    }
}

static void reset_diagnostic(download_diag_repr_t *repr) {
    memset(repr->download_url, 0, sizeof(repr->download_url));
}

static void update_times(download_diag_repr_t *repr) {
    avs_time_real_t now = avs_time_real_now();
    if (!avs_time_real_valid(repr->stats.beg)) {
        repr->stats.beg = now;
    }
    repr->stats.end = now;
}

static int dl_block_callback(anjay_t *anjay,
                             const uint8_t *data,
                             size_t data_size,
                             const anjay_etag_t *etag,
                             void *user_data) {
    (void) anjay; (void) data; (void) etag;
    download_diag_repr_t *repr = (download_diag_repr_t *) user_data;
    repr->stats.bytes_received += data_size;
    update_times(repr);
    return 0;
}

static void dl_finish_callback(anjay_t *anjay,
                               int result,
                               void *user_data) {
    download_diag_repr_t *repr = (download_diag_repr_t *) user_data;
    update_times(repr);
    if (result) {
        set_state(anjay, repr, DIAG_STATE_TRANSFER_FAILED);
    } else {
        set_state(anjay, repr, DIAG_STATE_COMPLETED);
    }
}

static int diag_download_run(anjay_t *anjay,
                             download_diag_repr_t *repr) {
    if (repr->dl_handle) {
        demo_log(ERROR, "download diagnostic already in progress");
        return -1;
    }

    const anjay_download_config_t config = {
        .url = repr->download_url,
        .on_next_block = dl_block_callback,
        .on_download_finished = dl_finish_callback,
        .user_data = repr
    };
    if (!(repr->dl_handle = anjay_download(anjay, &config))) {
        set_state(anjay, repr, DIAG_STATE_TRANSFER_FAILED);
        demo_log(ERROR, "cannot schedule download diagnostic");
        return -1;
    }
    repr->stats.beg = AVS_TIME_REAL_INVALID;
    repr->stats.end = AVS_TIME_REAL_INVALID;
    repr->stats.bytes_received = 0;
    set_state(anjay, repr, DIAG_STATE_REQUESTED);
    return 0;
}

static int diag_resource_execute(anjay_t *anjay,
                                 const anjay_dm_object_def_t *const *obj_ptr,
                                 anjay_iid_t iid,
                                 anjay_iid_t rid,
                                 anjay_execute_ctx_t *ctx) {
    (void) anjay;
    (void) iid;
    (void) ctx;
    switch ((download_diag_res_t) rid) {
    case DOWNLOAD_DIAG_RUN:
        return diag_download_run(anjay, get_diag(obj_ptr));
    default:
        return ANJAY_ERR_METHOD_NOT_ALLOWED;
    }
    return ANJAY_ERR_NOT_FOUND;
}

static int read_stats_resource(anjay_rid_t rid,
                               download_diag_repr_t *repr,
                               anjay_output_ctx_t *ctx) {
    if (repr->state != DIAG_STATE_COMPLETED) {
        return ANJAY_ERR_INTERNAL;
    }

    int64_t tmp;
    switch ((download_diag_res_t) rid) {
    case DOWNLOAD_DIAG_ROM_TIME_US:
    case DOWNLOAD_DIAG_BOM_TIME_US:
        if (avs_time_real_to_scalar(&tmp, AVS_TIME_US, repr->stats.beg)) {
            return ANJAY_ERR_INTERNAL;
        }
        return anjay_ret_i64(ctx, tmp);
    case DOWNLOAD_DIAG_EOM_TIME_US:
        if (avs_time_real_to_scalar(&tmp, AVS_TIME_US, repr->stats.end)) {
            return ANJAY_ERR_INTERNAL;
        }
        return anjay_ret_i64(ctx, tmp);
    case DOWNLOAD_DIAG_TOTAL_BYTES:
        tmp = INT64_MAX;
        if (repr->stats.bytes_received < INT64_MAX) {
            tmp = (int64_t) repr->stats.bytes_received;
        }
        return anjay_ret_i64(ctx, tmp);
    default:
        return ANJAY_ERR_METHOD_NOT_ALLOWED;
    }
}

static int diag_resource_present(anjay_t *anjay,
                                 const anjay_dm_object_def_t *const *obj_ptr,
                                 anjay_iid_t iid,
                                 anjay_rid_t rid) {
    (void) anjay;
    (void) iid;

    switch (rid) {
    case DOWNLOAD_DIAG_STATE:
    case DOWNLOAD_DIAG_URL:
        return 1;
    case DOWNLOAD_DIAG_ROM_TIME_US:
    case DOWNLOAD_DIAG_BOM_TIME_US:
    case DOWNLOAD_DIAG_EOM_TIME_US:
    case DOWNLOAD_DIAG_TOTAL_BYTES:
        // diagnostic results do not exist when diagnostic is not complete
        return get_diag(obj_ptr)->state == DIAG_STATE_COMPLETED;
    case DOWNLOAD_DIAG_RUN:
        return 1;
    }

    return 0;
}

static int diag_resource_read(anjay_t *anjay,
                              const anjay_dm_object_def_t *const *obj_ptr,
                              anjay_iid_t iid,
                              anjay_rid_t rid,
                              anjay_output_ctx_t *ctx) {
    (void) anjay;
    (void) iid;
    download_diag_repr_t *repr = get_diag(obj_ptr);
    switch ((download_diag_res_t) rid) {
    case DOWNLOAD_DIAG_STATE:
        return anjay_ret_i32(ctx, (int32_t) repr->state);
    case DOWNLOAD_DIAG_URL:
        return anjay_ret_string(ctx, repr->download_url);
    case DOWNLOAD_DIAG_ROM_TIME_US:
    case DOWNLOAD_DIAG_BOM_TIME_US:
    case DOWNLOAD_DIAG_EOM_TIME_US:
    case DOWNLOAD_DIAG_TOTAL_BYTES:
        return read_stats_resource(rid, repr, ctx);
    case DOWNLOAD_DIAG_RUN:
        return ANJAY_ERR_METHOD_NOT_ALLOWED;
    }
    return ANJAY_ERR_NOT_FOUND;
}

static int diag_resource_write(anjay_t *anjay,
                               const anjay_dm_object_def_t *const *obj_ptr,
                               anjay_iid_t iid,
                               anjay_rid_t rid,
                               anjay_input_ctx_t *ctx) {
    (void) anjay;
    (void) obj_ptr;
    (void) iid;
    (void) ctx;
    download_diag_repr_t *repr = get_diag(obj_ptr);
    switch ((download_diag_res_t) rid) {
    case DOWNLOAD_DIAG_URL:
        {
            if (repr->state == DIAG_STATE_REQUESTED) {
                demo_log(ERROR,
                         "Cancelling a diagnostic in progress is not supported");
                return ANJAY_ERR_BAD_REQUEST;
            }
            reset_diagnostic(repr);
            int result = anjay_get_string(ctx, repr->download_url,
                                          sizeof(repr->download_url));
            if (result < 0 || result == ANJAY_BUFFER_TOO_SHORT) {
                reset_diagnostic(repr);
                result = result < 0 ? result : ANJAY_ERR_BAD_REQUEST;
            }
            return result;
        }
    default:
        return ANJAY_ERR_METHOD_NOT_ALLOWED;
    }
    return ANJAY_ERR_NOT_FOUND;
}

static const anjay_dm_object_def_t DOWNLOAD_DIAG = {
    .oid = DEMO_OID_DOWNLOAD_DIAG,
    .supported_rids = ANJAY_DM_SUPPORTED_RIDS(
            DOWNLOAD_DIAG_STATE,
            DOWNLOAD_DIAG_URL,
            DOWNLOAD_DIAG_ROM_TIME_US,
            DOWNLOAD_DIAG_BOM_TIME_US,
            DOWNLOAD_DIAG_EOM_TIME_US,
            DOWNLOAD_DIAG_TOTAL_BYTES,
            DOWNLOAD_DIAG_RUN),
    .handlers = {
        .instance_it = anjay_dm_instance_it_SINGLE,
        .instance_present = anjay_dm_instance_present_SINGLE,
        .resource_present = diag_resource_present,
        .resource_execute = diag_resource_execute,
        .resource_read = diag_resource_read,
        .resource_write = diag_resource_write,
        .transaction_begin = anjay_dm_transaction_NOOP,
        .transaction_validate = anjay_dm_transaction_NOOP,
        .transaction_commit = anjay_dm_transaction_NOOP,
        .transaction_rollback = anjay_dm_transaction_NOOP
    }
};

const anjay_dm_object_def_t **download_diagnostics_object_create(void) {
    download_diag_repr_t *repr = (download_diag_repr_t *)
            calloc(1, sizeof(download_diag_repr_t));
    if (!repr) {
        return NULL;
    }
    repr->def = &DOWNLOAD_DIAG;
    return &repr->def;
}

void download_diagnostics_object_release(const anjay_dm_object_def_t **def) {
    if (def) {
        download_diag_repr_t *repr = get_diag(def);
        assert(!repr->dl_handle);
        free(repr);
    }
}


text:
select * from termfreqs order by key;

drop table if exists termfreqs;


text:
          Sign Up
          Have an account? Log In

        <form novalidate name="signupForm" signup-form>

          <bg-form-error></bg-form-error>

            Email Address

Invalid email address

              <input type="email" name="email" class="inputText-input" placeholder="Email Address" ng-model="user.settings.email.email" bg-input-validator bg-focus-when="true" />

            Password

Invalid password

              <input type="password" name="password" class="inputText-input" placeholder="Password" ng-model="password" bg-password-strength="passwordStrength" on-password-change="checkStrength(passwordStrength)" bg-input-validator />

              It would take {{ passwordStrength.crack_time_display }} to crack this password.

            Password Confirm

Invalid password confirmation

              <input type="password" class="inputText-input" name="passwordConfirm" placeholder="Password Confirm" ng-model="passwordConfirm" bg-input-validator />

            <input type="checkbox" name="terms" ng-model="agreedToTerms">
            I have read and agree to the Terms of Service

            <button type="submit" class="button" name="btn-submit" ng-click="submitSignup()">Sign Up</button>

        </form>

Verify Your Email

An email was sent to: {{ lockedEmail }}

Click on the activation link in the email to verify your email address.


text:
namespace rx
{

TextureStorage11::TextureStorage11(Renderer *renderer, UINT bindFlags)
    : mBindFlags(bindFlags),
      mLodOffset(0),
      mMipLevels(0),
      mTexture(NULL),
      mTextureFormat(DXGI_FORMAT_UNKNOWN),
      mShaderResourceFormat(DXGI_FORMAT_UNKNOWN),
      mRenderTargetFormat(DXGI_FORMAT_UNKNOWN),
      mDepthStencilFormat(DXGI_FORMAT_UNKNOWN),
      mSRV(NULL),
      mTextureWidth(0),
      mTextureHeight(0)
{
    mRenderer = Renderer11::makeRenderer11(renderer);
}

TextureStorage11::~TextureStorage11()
{
}

TextureStorage11 *TextureStorage11::makeTextureStorage11(TextureStorage *storage)
{
    ASSERT(HAS_DYNAMIC_TYPE(TextureStorage11*, storage));
    return static_cast<TextureStorage11*>(storage);
}

DWORD TextureStorage11::GetTextureBindFlags(DXGI_FORMAT format, GLenum glusage, bool forceRenderable)
{
    UINT bindFlags = D3D11_BIND_SHADER_RESOURCE;

    if (d3d11::IsDepthStencilFormat(format))
    {
        bindFlags |= D3D11_BIND_DEPTH_STENCIL;
    }
    else if(forceRenderable || (TextureStorage11::IsTextureFormatRenderable(format) && (glusage == GL_FRAMEBUFFER_ATTACHMENT_ANGLE)))
    {
        bindFlags |= D3D11_BIND_RENDER_TARGET;
    }
    return bindFlags;
}

bool TextureStorage11::IsTextureFormatRenderable(DXGI_FORMAT format)
{
    switch (format)
    {
      case DXGI_FORMAT_R8G8B8A8_UNORM:
      case DXGI_FORMAT_A8_UNORM:
      case DXGI_FORMAT_R32G32B32A32_FLOAT:
#if defined(ANGLE_PLATFORM_WINRT)
      case DXGI_FORMAT_R32G32B32_FLOAT:
#endif //#if defined(ANGLE_PLATFORM_WINRT)
      case DXGI_FORMAT_R16G16B16A16_FLOAT:
      case DXGI_FORMAT_B8G8R8A8_UNORM:
      case DXGI_FORMAT_R8_UNORM:
      case DXGI_FORMAT_R8G8_UNORM:
      case DXGI_FORMAT_R16_FLOAT:
      case DXGI_FORMAT_R16G16_FLOAT:
        return true;
      case DXGI_FORMAT_BC1_UNORM:
      case DXGI_FORMAT_BC2_UNORM:
      case DXGI_FORMAT_BC3_UNORM:
#if !defined(ANGLE_PLATFORM_WINRT)
      case DXGI_FORMAT_R32G32B32_FLOAT:
#endif // #if !defined(ANGLE_PLATFORM_WINRT)
        return false;
      default:
        UNREACHABLE();
        return false;
    }
}

UINT TextureStorage11::getBindFlags() const
{
    return mBindFlags;
}

ID3D11Texture2D *TextureStorage11::getBaseTexture() const
{
    return mTexture;
}

int TextureStorage11::getLodOffset() const
{
    return mLodOffset;
}

bool TextureStorage11::isRenderTarget() const
{
    return (mBindFlags & (D3D11_BIND_RENDER_TARGET | D3D11_BIND_DEPTH_STENCIL)) != 0;
}

bool TextureStorage11::isManaged() const
{
    return false;
}

int TextureStorage11::levelCount()
{
    int levels = 0;
    if (getBaseTexture())
    {
        levels = mMipLevels - getLodOffset();
    }
    return levels;
}

UINT TextureStorage11::getSubresourceIndex(int level, int faceIndex)
{
    UINT index = 0;
    if (getBaseTexture())
    {
        index = D3D11CalcSubresource(level, faceIndex, mMipLevels);
    }
    return index;
}

bool TextureStorage11::updateSubresourceLevel(ID3D11Texture2D *srcTexture, unsigned int sourceSubresource,
                                              int level, int face, GLint xoffset, GLint yoffset,
                                              GLsizei width, GLsizei height, bool mipped)
{
    if (srcTexture)
    {
        // Round up the width and height to the nearest multiple of dimension alignment
        unsigned int dimensionAlignment = d3d11::GetTextureFormatDimensionAlignment(mTextureFormat);
        width = width + dimensionAlignment - 1 - (width - 1) % dimensionAlignment;
        height = height + dimensionAlignment - 1 - (height - 1) % dimensionAlignment;

        D3D11_BOX srcBox;
        srcBox.left = xoffset;
        srcBox.top = yoffset;
        srcBox.right = xoffset + width;
        srcBox.bottom = yoffset + height;
        srcBox.front = 0;
        srcBox.back = 1;

        ID3D11DeviceContext *context = mRenderer->getDeviceContext();

        ASSERT(getBaseTexture());
#if defined(ANGLE_PLATFORM_WINRT)
        if (!mipped)
        {
            D3D11_TEXTURE2D_DESC texDesc;
            mTexture->GetDesc(&texDesc);
            mTexture->Release();
            texDesc.MipLevels = 1;
            HRESULT result = mRenderer->getDevice()->CreateTexture2D(&texDesc, NULL, &mTexture);
            ASSERT(SUCCEEDED(result));
            if (mSRV)
            {
                mSRV->Release();
                mSRV = NULL;
            }
        }
#endif
        context->CopySubresourceRegion(getBaseTexture(), getSubresourceIndex(level + mLodOffset, face),
                                       xoffset, yoffset, 0, srcTexture, sourceSubresource, &srcBox);
        return true;
    }

    return false;
}

void TextureStorage11::generateMipmapLayer(RenderTarget11 *source, RenderTarget11 *dest)
{
    if (source && dest)
    {
        ID3D11ShaderResourceView *sourceSRV = source->getShaderResourceView();
        ID3D11RenderTargetView *destRTV = dest->getRenderTargetView();

        if (sourceSRV && destRTV)
        {
            gl::Rectangle sourceArea;
            sourceArea.x = 0;
            sourceArea.y = 0;
            sourceArea.width = source->getWidth();
            sourceArea.height = source->getHeight();

            gl::Rectangle destArea;
            destArea.x = 0;
            destArea.y = 0;
            destArea.width = dest->getWidth();
            destArea.height = dest->getHeight();

            mRenderer->copyTexture(sourceSRV, sourceArea, source->getWidth(), source->getHeight(),
                                   destRTV, destArea, dest->getWidth(), dest->getHeight(),
                                   GL_RGBA);
        }
    }
}

TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, SwapChain11 *swapchain)
    : TextureStorage11(renderer, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE)
{
    mTexture = swapchain->getOffscreenTexture();
    mSRV = swapchain->getRenderTargetShaderResource();

    for (unsigned int i = 0; i < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
    {
        mRenderTarget[i] = NULL;
    }

    D3D11_TEXTURE2D_DESC texDesc;
    mTexture->GetDesc(&texDesc);
    mMipLevels = texDesc.MipLevels;
    mTextureFormat = texDesc.Format;
    mTextureWidth = texDesc.Width;
    mTextureHeight = texDesc.Height;

    D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
    mSRV->GetDesc(&srvDesc);
    mShaderResourceFormat = srvDesc.Format;

    ID3D11RenderTargetView* offscreenRTV = swapchain->getRenderTarget();
    D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
    offscreenRTV->GetDesc(&rtvDesc);
    mRenderTargetFormat = rtvDesc.Format;
    offscreenRTV->Release();

    mDepthStencilFormat = DXGI_FORMAT_UNKNOWN;
}

TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height)
    : TextureStorage11(renderer, GetTextureBindFlags(gl_d3d11::ConvertTextureFormat(internalformat), usage, forceRenderable))
{
    for (unsigned int i = 0; i < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
    {
        mRenderTarget[i] = NULL;
    }

    DXGI_FORMAT convertedFormat = gl_d3d11::ConvertTextureFormat(internalformat);
    if (mRenderer->getFeatureLevel() < D3D_FEATURE_LEVEL_9_2 && convertedFormat == DXGI_FORMAT_A8_UNORM)
        convertedFormat = DXGI_FORMAT_B8G8R8A8_UNORM;
    if (d3d11::IsDepthStencilFormat(convertedFormat))
    {
        mTextureFormat = d3d11::GetDepthTextureFormat(convertedFormat);
        mShaderResourceFormat = d3d11::GetDepthShaderResourceFormat(convertedFormat);
        mDepthStencilFormat = convertedFormat;
        mRenderTargetFormat = DXGI_FORMAT_UNKNOWN;
    }
    else
    {
        mTextureFormat = convertedFormat;
        mShaderResourceFormat = convertedFormat;
        mDepthStencilFormat = DXGI_FORMAT_UNKNOWN;
        mRenderTargetFormat = convertedFormat;
    }

    // if the width or height is not positive this should be treated as an incomplete texture
    // we handle that here by skipping the d3d texture creation
    if (width > 0 && height > 0)
    {
        // adjust size if needed for compressed textures
        gl::MakeValidSize(false, gl::IsCompressed(internalformat), &width, &height, &mLodOffset);

        ID3D11Device *device = mRenderer->getDevice();

        D3D11_TEXTURE2D_DESC desc;
        desc.Width = width;      // Compressed texture size constraints?
        desc.Height = height;
        if (mRenderer->getMajorShaderModel() <= 2 && (!gl::isPow2(width) || !gl::isPow2(height)))
            desc.MipLevels = 1;
        else
            desc.MipLevels = (levels > 0) ? levels + mLodOffset : 0;
        desc.ArraySize = 1;
        desc.Format = mTextureFormat;
        desc.SampleDesc.Count = 1;
        desc.SampleDesc.Quality = 0;
        desc.Usage = D3D11_USAGE_DEFAULT;
        desc.BindFlags = getBindFlags();
        desc.CPUAccessFlags = 0;
        desc.MiscFlags = 0;

        HRESULT result = device->CreateTexture2D(&desc, NULL, &mTexture);

        // this can happen from windows TDR
        if (d3d11::isDeviceLostError(result))
        {
            mRenderer->notifyDeviceLost();
            gl::error(GL_OUT_OF_MEMORY);
        }
        else if (FAILED(result))
        {
            ASSERT(result == E_OUTOFMEMORY);
            ERR("Creating image failed.");
            gl::error(GL_OUT_OF_MEMORY);
        }
        else
        {
            mTexture->GetDesc(&desc);
            mMipLevels = desc.MipLevels;
            mTextureWidth = desc.Width;
            mTextureHeight = desc.Height;
        }
    }
}

TextureStorage11_2D::~TextureStorage11_2D()
{
    if (mTexture)
    {
        mTexture->Release();
        mTexture = NULL;
    }

    if (mSRV)
    {
        mSRV->Release();
        mSRV = NULL;
    }

    for (unsigned int i = 0; i < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
    {
        delete mRenderTarget[i];
        mRenderTarget[i] = NULL;
    }
}

TextureStorage11_2D *TextureStorage11_2D::makeTextureStorage11_2D(TextureStorage *storage)
{
    ASSERT(HAS_DYNAMIC_TYPE(TextureStorage11_2D*, storage));
    return static_cast<TextureStorage11_2D*>(storage);
}

RenderTarget *TextureStorage11_2D::getRenderTarget(int level)
{
    if (level >= 0 && level < static_cast<int>(mMipLevels))
    {
        if (!mRenderTarget[level])
        {
            ID3D11Device *device = mRenderer->getDevice();
            HRESULT result;

            D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
            srvDesc.Format = mShaderResourceFormat;
            srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
            srvDesc.Texture2D.MostDetailedMip = level;
            srvDesc.Texture2D.MipLevels = (mRenderer->getMajorShaderModel() < 4) ? -1 : 1;

            ID3D11ShaderResourceView *srv;
            result = device->CreateShaderResourceView(mTexture, &srvDesc, &srv);

            if (result == E_OUTOFMEMORY)
            {
                return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
            }
            ASSERT(SUCCEEDED(result));

            if (mRenderTargetFormat != DXGI_FORMAT_UNKNOWN)
            {
                D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
                rtvDesc.Format = mRenderTargetFormat;
                rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
                rtvDesc.Texture2D.MipSlice = level;

                ID3D11RenderTargetView *rtv;
                result = device->CreateRenderTargetView(mTexture, &rtvDesc, &rtv);

                if (result == E_OUTOFMEMORY)
                {
                    srv->Release();
                    return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
                }
                ASSERT(SUCCEEDED(result));

                // RenderTarget11 expects to be the owner of the resources it is given but TextureStorage11
                // also needs to keep a reference to the texture.
                mTexture->AddRef();

                mRenderTarget[level] = new RenderTarget11(mRenderer, rtv, mTexture, srv,
                                                          std::max(mTextureWidth >> level, 1U),
                                                          std::max(mTextureHeight >> level, 1U));
            }
            else if (mDepthStencilFormat != DXGI_FORMAT_UNKNOWN)
            {
                D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
                dsvDesc.Format = mDepthStencilFormat;
                dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
                dsvDesc.Texture2D.MipSlice = level;
                dsvDesc.Flags = 0;

                ID3D11DepthStencilView *dsv;
                result = device->CreateDepthStencilView(mTexture, &dsvDesc, &dsv);

                if (result == E_OUTOFMEMORY)
                {
                    srv->Release();
                    return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
                }
                ASSERT(SUCCEEDED(result));

                // RenderTarget11 expects to be the owner of the resources it is given but TextureStorage11
                // also needs to keep a reference to the texture.
                mTexture->AddRef();

                mRenderTarget[level] = new RenderTarget11(mRenderer, dsv, mTexture, srv,
                                                          std::max(mTextureWidth >> level, 1U),
                                                          std::max(mTextureHeight >> level, 1U));
            }
            else
            {
                UNREACHABLE();
            }
        }

        return mRenderTarget[level];
    }
    else
    {
        return NULL;
    }
}

ID3D11ShaderResourceView *TextureStorage11_2D::getSRV()
{
    if (!mSRV)
    {
        ID3D11Device *device = mRenderer->getDevice();

        D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
        srvDesc.Format = mShaderResourceFormat;
        srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
        srvDesc.Texture2D.MipLevels = -1;//(mMipLevels == 0 ? -1 : mMipLevels); //mMipLevels is pretty much useless since it's always set to the max mips
        srvDesc.Texture2D.MostDetailedMip = 0;

        HRESULT result = device->CreateShaderResourceView(mTexture, &srvDesc, &mSRV);

        if (result == E_OUTOFMEMORY)
        {
            return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11ShaderResourceView*>(NULL));
        }
        ASSERT(SUCCEEDED(result));
    }

    return mSRV;
}

void TextureStorage11_2D::generateMipmap(int level)
{
    RenderTarget11 *source = RenderTarget11::makeRenderTarget11(getRenderTarget(level - 1));
    RenderTarget11 *dest = RenderTarget11::makeRenderTarget11(getRenderTarget(level));

    generateMipmapLayer(source, dest);
}

TextureStorage11_Cube::TextureStorage11_Cube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size)
    : TextureStorage11(renderer, GetTextureBindFlags(gl_d3d11::ConvertTextureFormat(internalformat), usage, forceRenderable))
{
    for (unsigned int i = 0; i < 6; i++)
    {
        for (unsigned int j = 0; j < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; j++)
        {
            mRenderTarget[i][j] = NULL;
        }
    }

    DXGI_FORMAT convertedFormat = gl_d3d11::ConvertTextureFormat(internalformat);
    if (d3d11::IsDepthStencilFormat(convertedFormat))
    {
        mTextureFormat = d3d11::GetDepthTextureFormat(convertedFormat);
        mShaderResourceFormat = d3d11::GetDepthShaderResourceFormat(convertedFormat);
        mDepthStencilFormat = convertedFormat;
        mRenderTargetFormat = DXGI_FORMAT_UNKNOWN;
    }
    else
    {
        mTextureFormat = convertedFormat;
        mShaderResourceFormat = convertedFormat;
        mDepthStencilFormat = DXGI_FORMAT_UNKNOWN;
        mRenderTargetFormat = convertedFormat;
    }

    // if the size is not positive this should be treated as an incomplete texture
    // we handle that here by skipping the d3d texture creation
    if (size > 0)
    {
        // adjust size if needed for compressed textures
        int height = size;
        gl::MakeValidSize(false, gl::IsCompressed(internalformat), &size, &height, &mLodOffset);

        ID3D11Device *device = mRenderer->getDevice();

        D3D11_TEXTURE2D_DESC desc;
        desc.Width = size;
        desc.Height = size;
        desc.MipLevels = (levels > 0) ? levels + mLodOffset : 0;
        desc.ArraySize = 6;
        desc.Format = mTextureFormat;
        desc.SampleDesc.Count = 1;
        desc.SampleDesc.Quality = 0;
        desc.Usage = D3D11_USAGE_DEFAULT;
        desc.BindFlags = getBindFlags();
        desc.CPUAccessFlags = 0;
        desc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;

        HRESULT result = device->CreateTexture2D(&desc, NULL, &mTexture);

        if (FAILED(result))
        {
            ASSERT(result == E_OUTOFMEMORY);
            ERR("Creating image failed.");
            gl::error(GL_OUT_OF_MEMORY);
        }
        else
        {
            mTexture->GetDesc(&desc);
            mMipLevels = desc.MipLevels;
            mTextureWidth = desc.Width;
            mTextureHeight = desc.Height;
        }
    }
}

TextureStorage11_Cube::~TextureStorage11_Cube()
{
    if (mTexture)
    {
        mTexture->Release();
        mTexture = NULL;
    }

    if (mSRV)
    {
        mSRV->Release();
        mSRV = NULL;
    }

    for (unsigned int i = 0; i < 6; i++)
    {
        for (unsigned int j = 0; j < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS; j++)
        {
            delete mRenderTarget[i][j];
            mRenderTarget[i][j] = NULL;
        }
    }
}

TextureStorage11_Cube *TextureStorage11_Cube::makeTextureStorage11_Cube(TextureStorage *storage)
{
    ASSERT(HAS_DYNAMIC_TYPE(TextureStorage11_Cube*, storage));
    return static_cast<TextureStorage11_Cube*>(storage);
}

RenderTarget *TextureStorage11_Cube::getRenderTarget(GLenum faceTarget, int level)
{
    unsigned int faceIdx = gl::TextureCubeMap::faceIndex(faceTarget);
    if (level >= 0 && level < static_cast<int>(mMipLevels))
    {
        if (!mRenderTarget[faceIdx][level])
        {
            ID3D11Device *device = mRenderer->getDevice();
            HRESULT result;

            D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
            srvDesc.Format = mShaderResourceFormat;
            srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
            srvDesc.Texture2DArray.MostDetailedMip = level;
            srvDesc.Texture2DArray.MipLevels = 1;
            srvDesc.Texture2DArray.FirstArraySlice = faceIdx;
            srvDesc.Texture2DArray.ArraySize = 1;

            ID3D11ShaderResourceView *srv;
            result = device->CreateShaderResourceView(mTexture, &srvDesc, &srv);

            if (result == E_OUTOFMEMORY)
            {
                return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
            }
            ASSERT(SUCCEEDED(result));

            if (mRenderTargetFormat != DXGI_FORMAT_UNKNOWN)
            {
                D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
                rtvDesc.Format = mRenderTargetFormat;
                rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
                rtvDesc.Texture2DArray.MipSlice = level;
                rtvDesc.Texture2DArray.FirstArraySlice = faceIdx;
                rtvDesc.Texture2DArray.ArraySize = 1;

                ID3D11RenderTargetView *rtv;
                result = device->CreateRenderTargetView(mTexture, &rtvDesc, &rtv);

                if (result == E_OUTOFMEMORY)
                {
                    srv->Release();
                    return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
                }
                ASSERT(SUCCEEDED(result));

                // RenderTarget11 expects to be the owner of the resources it is given but TextureStorage11
                // also needs to keep a reference to the texture.
                mTexture->AddRef();

                mRenderTarget[faceIdx][level] = new RenderTarget11(mRenderer, rtv, mTexture, srv,
                                                                   std::max(mTextureWidth >> level, 1U),
                                                                   std::max(mTextureHeight >> level, 1U));
            }
            else if (mDepthStencilFormat != DXGI_FORMAT_UNKNOWN)
            {
                D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
                dsvDesc.Format = mRenderTargetFormat;
                dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY;
                dsvDesc.Texture2DArray.MipSlice = level;
                dsvDesc.Texture2DArray.FirstArraySlice = faceIdx;
                dsvDesc.Texture2DArray.ArraySize = 1;

                ID3D11DepthStencilView *dsv;
                result = device->CreateDepthStencilView(mTexture, &dsvDesc, &dsv);

                if (result == E_OUTOFMEMORY)
                {
                    srv->Release();
                    return gl::error(GL_OUT_OF_MEMORY, static_cast<RenderTarget*>(NULL));
                }
                ASSERT(SUCCEEDED(result));

                // RenderTarget11 expects to be the owner of the resources it is given but TextureStorage11
                // also needs to keep a reference to the texture.
                mTexture->AddRef();

                mRenderTarget[faceIdx][level] = new RenderTarget11(mRenderer, dsv, mTexture, srv,
                                                                   std::max(mTextureWidth >> level, 1U),
                                                                   std::max(mTextureHeight >> level, 1U));
            }
            else
            {
                UNREACHABLE();
            }
        }

        return mRenderTarget[faceIdx][level];
    }
    else
    {
        return NULL;
    }
}

ID3D11ShaderResourceView *TextureStorage11_Cube::getSRV()
{
    if (!mSRV)
    {
        ID3D11Device *device = mRenderer->getDevice();

        D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
        srvDesc.Format = mShaderResourceFormat;
        srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
        srvDesc.TextureCube.MipLevels = (mMipLevels == 0 ? -1 : mMipLevels);
        srvDesc.TextureCube.MostDetailedMip = 0;

        HRESULT result = device->CreateShaderResourceView(mTexture, &srvDesc, &mSRV);

        if (result == E_OUTOFMEMORY)
        {
            return gl::error(GL_OUT_OF_MEMORY, static_cast<ID3D11ShaderResourceView*>(NULL));
        }
        ASSERT(SUCCEEDED(result));
    }

    return mSRV;
}

void TextureStorage11_Cube::generateMipmap(int face, int level)
{
    RenderTarget11 *source = RenderTarget11::makeRenderTarget11(getRenderTarget(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level - 1));
    RenderTarget11 *dest = RenderTarget11::makeRenderTarget11(getRenderTarget(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level));

    generateMipmapLayer(source, dest);
}

}


text:
module TurboReact
  module Rails
    VERSION = "0.9.0"
  end
end


text:
define([], function() {
  return {
    "PropertyPaneDescription": "Copy to OneDrive/Teams",
    "BasicGroupName": "Configuration",
    "SaveMetadataFieldLabel": "Save Metadata on copied mail",
    "SaveInfo": "You already saved this mail",
    "To": "to",
    "On": "on",
    "SaveLabel": "Save here",
    "SpinnerLabel": "Processing request",
    "SuccessMessage": "Success",
    "ErrorMessage": "Error occured"
  }
});


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using IEVin.PropertyChangedNotificator.Helper;

namespace IEVin.PropertyChangedNotificator
{
    public static class Notificator
    {
        static readonly Lazy<ModuleBuilder> s_builder = new Lazy<ModuleBuilder>(CreateModule);

        public static void Create<T>(T obj)
            where T : INotifyPropertyChanged
        {
            var type = GetTypeAndCheck(obj);
            if(type != typeof(T))
                return;

            var proxyType = TypeCache<T>.GetOrCreate(CreateProxyType);
            SetType(obj, proxyType);
        }

        static Type GetTypeAndCheck(object obj)
        {
            if(obj == null)
                throw new ArgumentNullException(nameof(obj));

            var type = obj.GetType();

            if(type.IsAbstract || type.IsSealed)
                throw new ArgumentException("Type сannot be abstract or sealed.");

            return type;
        }

        [DebuggerStepThrough]
        static void SetType(object obj, Type proxyType)
        {
            unsafe
            {
                var conv = new ObjectToStructConv { From = new ObjWrap { Value = obj } };
                conv.To.Value->MethodTable = proxyType.TypeHandle.Value;
            }
        }

        [DebuggerStepThrough]
        static Type CreateProxyType(Type type)
        {
            var tb = s_builder.Value.DefineType(type.FullName, type.Attributes, type);
            tb.AddInterfaceImplementation(typeof(INotifyPropertyChanged));

            var raiseMi = PropertyChangedNotificatorHelper.GetRaise(type);

            foreach(var q in GetPropertyNames(type))
            {
                // MethodInfo.GetCustomAttributes has error (ignore 'inherit = true' for properties). Attribute.GetCustomAttributes is correct.
                var attribs = Attribute.GetCustomAttributes(q, typeof(NotifyPropertyAttribute), inherit: true);
                if(!attribs.Any())
                    continue;

                var name = q.Name;
                var getter = q.GetGetMethod(true);
                var setter = q.GetSetMethod(true);

                if(getter == null || getter.IsPrivate || getter.IsAssembly)
                {
                    var msg = $"Getter property '{q.Name}' of type '{type.FullName}' must be public or protected.";
                    throw new InvalidOperationException(msg);
                }

                if(setter == null || setter.IsPrivate || setter.IsAssembly)
                {
                    var msg = $"Setter property '{q.Name}' of type '{type.FullName}' must be public or protected.";
                    throw new InvalidOperationException(msg);
                }

                if(!setter.IsVirtual)
                {
                    var msg = $"Setter property '{q.Name}' of type '{type.FullName}' must be virtual.";
                    throw new InvalidOperationException(msg);
                }

                double? precision;
                var equalsMi = PropertyChangedNotificatorHelper.GetEquals(getter.ReturnType, out precision);

                if(precision != null)
                {
                    precision = q.GetCustomAttributes(typeof(SetPrecisionAttribute), true)
                                 .Cast<SetPrecisionAttribute>()
                                 .Select(x => (double?)x.Precision)
                                 .FirstOrDefault() ?? precision;
                }

                var notifyNames = attribs.Cast<NotifyPropertyAttribute>()
                                         .Select(x => x.PropertyName ?? name);

                var newSetter = CreateSetMethod(tb, getter, setter, notifyNames, raiseMi, equalsMi, precision);
                tb.DefineMethodOverride(newSetter, setter);
            }

            return tb.CreateType();
        }

        [DebuggerStepThrough]
        static MethodBuilder CreateSetMethod(TypeBuilder tb, MethodInfo getMi, MethodInfo setMi,
                                             IEnumerable<string> names, MethodInfo raise, MethodInfo equals, double? eps)
        {
            var paramTypes = setMi.GetParameters()
                                  .Select(x => x.ParameterType)
                                  .ToArray();

            var mb = tb.DefineMethod(setMi.Name, setMi.Attributes, null, paramTypes);

            var il = mb.GetILGenerator();
            var label = il.DefineLabel();

            // get current value
            il.Emit(OpCodes.Ldarg_0);
            il.Emit(OpCodes.Call, getMi);

            // invoke equals
            il.Emit(OpCodes.Ldarg_1);
            if(eps != null)
                il.Emit(OpCodes.Ldc_R8, eps.Value);
            il.Emit(OpCodes.Call, equals);

            // jump if equals
            il.Emit(OpCodes.Brtrue_S, label);

            // set new value
            il.Emit(OpCodes.Ldarg_0);
            il.Emit(OpCodes.Ldarg_1);
            il.Emit(OpCodes.Call, setMi);

            // raise OnPropertyChanged events
            foreach(var q in names)
            {
                il.Emit(OpCodes.Ldarg_0);
                il.Emit(OpCodes.Ldstr, q);
                il.Emit(OpCodes.Call, raise);
            }

            // exit
            il.MarkLabel(label);
            il.Emit(OpCodes.Ret);

            return mb;
        }

        [DebuggerStepThrough]
        static IEnumerable<PropertyInfo> GetPropertyNames(Type type)
        {
            return type?.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty)
                   ?? Enumerable.Empty<PropertyInfo>();
        }

        [DebuggerStepThrough]
        static ModuleBuilder CreateModule()
        {
            var assemblyName = new AssemblyName($"NAImplementerAssembly_{Guid.NewGuid().ToString()}");

            return AppDomain.CurrentDomain
                            .DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run)
                            .DefineDynamicModule(assemblyName.Name);
        }
    }
}


text:
layout: zone
category: zones
title: "RS-3 - Residential Single-Unit District"
description: "Detached single family homes and two-flats."
zone_type_name: Residential
zone_type: "4"
maximum_building_height: "30 ft for detached house. None for schools and churches."
minimum_lot_area: "2,500 sq ft"
rear_yard_setback: "50 ft or 28% of lot depth, whichever is less."
front_yard_setback: "20ft, or 16% of lot depth, whichever is less. Alternatively, setback can be the average front yard depth of nearest 2 lots."
floor_area_ratio: "0.9"
zoning_code_section: "17-2-0102"
old_zoning_ordinance_code: "R3"
rear_yard_open_space: "225 sq ft per dwelling unit, or 6.5% of the lot area, which ever is greater."
on_site_open_space: "N/A"
district_title: "Residential Single-Unit District"
old_description: "Single family homes"
district_type_code: "RS-3"
juan_description: "Detached single family homes and two-flats."
side_setback: "Detached house: Combined width of side setbacks must equal 20% of lot width, with neither setback less than 2 feet or 8% of lot width (whichever is greater.)
Churches and schools: 12 feet or 50% of building height, whichever is greater."
lot_area_per_unit: "2,500 sq ft"
---


text:
title: April Plans
author: veronicab
layout: post
---

Three Sung Masses this month.

I've set myself a bit of a high bar with linking to sheet music, so I might not be able to have everything ready all at once, but it's a first step to put up the skeleton and keep building.

### 3 April: Passion Sunday

Low Mass - End of Daylight Savings!

* God of Mercy and Compassion again - [PDF](/pdf/hymns/GodofMercy.pdf)
* Vexilla Regis - [**sheet music: vexilla.pdf**](/pdf/chant/vexilla.pdf)
* Ave Verum - [A New Book of Old Hymns](https://newbookoldhymns.brandt.id.au/hymns/aveverum.html)
* Abroad the regal banners - [**sheet music: abroad.pdf**](/pdf/chant/abroad.pdf) - or a metrical tune [AbroadTheRegal.pdf](/pdf/hymns/AbroadTheRegal.pdf)

### 10 April: Palm Sunday

* Mass 17
* Credo 1
* Popule Meus - Victoria - or [O Crux Ave](https://www.ccwatershed.org/2017/03/04/o-crux-ave-partial-recording/) by David Friel - I purchased copies some years ago. That link goes to a partial recording for learning the middle part - roughly alto. It's mostly 3 parts for the chorus and splits into 4 for the final. The verses are psalm toned versions of the hymn Vexilla Regis.
* Lord Jesus Think on Me again - [PDF](/pdf/hymns/LordJesusThink.pdf)

### 17 April: Easter Sunday

* Mass 1
* Credo 1
* O Filii et Filiae
* Alleluia, sing to Jesus

### 24 April: Low Sunday

* Mass 1
* Credo 1
* Alleluia, canon by William Boyce
* Through the Red Sea


text:
<?php

namespace Sabre\VObject;

class ReaderTest extends \PHPUnit_Framework_TestCase {

    function testReadComponent() {

        $data = "BEGIN:VCALENDAR\r\nEND:VCALENDAR";

        $result = Reader::read($data);

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(0, count($result->children));

    }
    function testReadStream() {

        $data = "BEGIN:VCALENDAR\r\nEND:VCALENDAR";

        $stream = fopen('php://memory', 'r+');
        fwrite($stream, $data);
        rewind($stream);

        $result = Reader::read($stream);

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(0, count($result->children));

    }

    function testReadComponentUnixNewLine() {

        $data = "BEGIN:VCALENDAR\nEND:VCALENDAR";

        $result = Reader::read($data);

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(0, count($result->children));

    }

    function testReadComponentLineFold() {

        $data = "BEGIN:\r\n\tVCALENDAR\r\nE\r\n ND:VCALENDAR";

        $result = Reader::read($data);

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(0, count($result->children));

    }

    /**
     * @expectedException Sabre\VObject\ParseException
     */
    function testReadCorruptComponent() {

        $data = "BEGIN:VCALENDAR\r\nEND:FOO";

        $result = Reader::read($data);

    }

    /**
     * @expectedException Sabre\VObject\ParseException
     */
    function testReadCorruptSubComponent() {

        $data = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:FOO\r\nEND:VCALENDAR";

        $result = Reader::read($data);

    }

    function testReadProperty() {

        $data = "BEGIN:VCALENDAR\r\nSUMMARY:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->SUMMARY;
        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('SUMMARY', $result->name);
        $this->assertEquals('propValue', $result->getValue());

    }

    function testReadPropertyWithNewLine() {

        $data = "BEGIN:VCALENDAR\r\nSUMMARY:Line1\\nLine2\\NLine3\\\\Not the 4th line!\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->SUMMARY;
        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('SUMMARY', $result->name);
        $this->assertEquals("Line1\nLine2\nLine3\\Not the 4th line!", $result->getValue());

    }

    function testReadMappedProperty() {

        $data = "BEGIN:VCALENDAR\r\nDTSTART:20110529\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->DTSTART;
        $this->assertInstanceOf('Sabre\\VObject\\Property\\ICalendar\\DateTime', $result);
        $this->assertEquals('DTSTART', $result->name);
        $this->assertEquals('20110529', $result->getValue());

    }

    function testReadMappedPropertyGrouped() {

        $data = "BEGIN:VCALENDAR\r\nfoo.DTSTART:20110529\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->DTSTART;
        $this->assertInstanceOf('Sabre\\VObject\\Property\\ICalendar\\DateTime', $result);
        $this->assertEquals('DTSTART', $result->name);
        $this->assertEquals('20110529', $result->getValue());

    }

    /**
     * @expectedException Sabre\VObject\ParseException
     */
    function testReadBrokenLine() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;propValue";
        $result = Reader::read($data);

    }

    function testReadPropertyInComponent() {

        $data = array(
            "BEGIN:VCALENDAR",
            "PROPNAME:propValue",
            "END:VCALENDAR"
        );

        $result = Reader::read(implode("\r\n",$data));

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(1, count($result->children()));
        $this->assertInstanceOf('Sabre\\VObject\\Property', $result->children[0]);
        $this->assertEquals('PROPNAME', $result->children[0]->name);
        $this->assertEquals('propValue', $result->children[0]->getValue());

    }

    function testReadNestedComponent() {

        $data = array(
            "BEGIN:VCALENDAR",
            "BEGIN:VTIMEZONE",
            "BEGIN:DAYLIGHT",
            "END:DAYLIGHT",
            "END:VTIMEZONE",
            "END:VCALENDAR"
        );

        $result = Reader::read(implode("\r\n",$data));

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(1, count($result->children()));
        $this->assertInstanceOf('Sabre\\VObject\\Component', $result->children[0]);
        $this->assertEquals('VTIMEZONE', $result->children[0]->name);
        $this->assertEquals(1, count($result->children[0]->children()));
        $this->assertInstanceOf('Sabre\\VObject\\Component', $result->children[0]->children[0]);
        $this->assertEquals('DAYLIGHT', $result->children[0]->children[0]->name);

    }

    function testReadPropertyParameter() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue());

    }

    function testReadPropertyRepeatingParameter() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;N=1;N=2;N=3,4;N=\"5\",6;N=\"7,8\";N=9,10;N=^'11^':propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('N', $result->parameters['N']->name);
        $this->assertEquals('1,2,3,4,5,6,7,8,9,10,"11"', $result->parameters['N']->getValue());
        $this->assertEquals(array(1,2,3,4,5,6,"7,8",9,10,'"11"'), $result->parameters['N']->getParts());

    }

    function testReadPropertyRepeatingNamelessGuessedParameter() {
        $data = "BEGIN:VCALENDAR\r\nPROPNAME;WORK;VOICE;PREF:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('TYPE', $result->parameters['TYPE']->name);
        $this->assertEquals('WORK,VOICE,PREF', $result->parameters['TYPE']->getValue());
        $this->assertEquals(array('WORK', 'VOICE', 'PREF'), $result->parameters['TYPE']->getParts());

    }

    function testReadPropertyNoName() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PRODIGY:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('TYPE', $result->parameters['TYPE']->name);
        $this->assertTrue($result->parameters['TYPE']->noName);
        $this->assertEquals('PRODIGY', $result->parameters['TYPE']);

    }

    function testReadPropertyParameterExtraColon() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue:propValue:anotherrandomstring\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue:anotherrandomstring', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue());

    }

    function testReadProperty2Parameters() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue;PARAMNAME2=paramvalue2:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(2, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue());
        $this->assertEquals('PARAMNAME2', $result->parameters['PARAMNAME2']->name);
        $this->assertEquals('paramvalue2', $result->parameters['PARAMNAME2']->getValue());

    }

    function testReadPropertyParameterQuoted() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=\"paramvalue\":propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->PROPNAME;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue());

    }

    function testReadPropertyParameterNewLines() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue1^nvalue2^^nvalue3:propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $result = $result->propname;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());

        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals("paramvalue1\nvalue2^nvalue3", $result->parameters['PARAMNAME']->getValue());

    }

    function testReadPropertyParameterQuotedColon() {

        $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=\"param:value\":propValue\r\nEND:VCALENDAR";
        $result = Reader::read($data);
        $result = $result->propname;

        $this->assertInstanceOf('Sabre\\VObject\\Property', $result);
        $this->assertEquals('PROPNAME', $result->name);
        $this->assertEquals('propValue', $result->getValue());
        $this->assertEquals(1, count($result->parameters()));
        $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name);
        $this->assertEquals('param:value', $result->parameters['PARAMNAME']->getValue());

    }

    function testReadForgiving() {

        $data = array(
            "BEGIN:VCALENDAR",
            "X_PROP:propValue",
            "END:VCALENDAR"
        );

        $caught = false;
        try {
            $result = Reader::read(implode("\r\n",$data));
        } catch (ParseException $e) {
            $caught = true;
        }

        $this->assertEquals(true, $caught);

        $result = Reader::read(implode("\r\n",$data), Reader::OPTION_FORGIVING);

        $expected = implode("\r\n", array(
            "BEGIN:VCALENDAR",
            "X_PROP:propValue",
            "END:VCALENDAR",
            ""
        ));

        $this->assertEquals($expected, $result->serialize());

    }

    function testReadWithInvalidLine() {

        $data = array(
            "BEGIN:VCALENDAR",
            "DESCRIPTION:propValue",
            "Yes, we've actually seen a file with non-idented property values on multiple lines",
            "END:VCALENDAR"
        );

        $caught = false;
        try {
            $result = Reader::read(implode("\r\n",$data));
        } catch (ParseException $e) {
            $caught = true;
        }

        $this->assertEquals(true, $caught);

        $result = Reader::read(implode("\r\n",$data), Reader::OPTION_IGNORE_INVALID_LINES);

        $expected = implode("\r\n", array(
            "BEGIN:VCALENDAR",
            "DESCRIPTION:propValue",
            "END:VCALENDAR",
            ""
        ));

        $this->assertEquals($expected, $result->serialize());

    }

    /**
     * Reported as Issue 32.
     *
     * @expectedException \Sabre\VObject\ParseException
     */
    public function testReadIncompleteFile() {

        $input = <<<ICS
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
X-FUNAMBOL-FOLDER:DEFAULT_FOLDER
X-FUNAMBOL-ALLDAY:0
DTSTART:20111017T110000Z
DTEND:20111017T123000Z
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
CATEGORIES:
LOCATION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Netviewer Meeting
PRIORITY:1
STATUS:3
X-MICROSOFT-CDO-REPLYTIME:20111017T064200Z
SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Kopieren: test
CLASS:PUBLIC
AALARM:
RRULE:
X-FUNAMBOL-BILLINGINFO:
X-FUNAMBOL-COMPANIES:
X-FUNAMBOL-MILEAGE:
X-FUNAMBOL-NOAGING:0
ATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Heino' heino@test.com
ATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Markus' test@test.com
ATTENDEE;STATUS=NEEDS AC
ICS;

        Reader::read($input);

    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testReadBrokenInput() {

        Reader::read(false);

    }

    public function testReadBOM() {

        $data = chr(0xef) . chr(0xbb) . chr(0xbf) . "BEGIN:VCALENDAR\r\nEND:VCALENDAR";
        $result = Reader::read($data);

        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
        $this->assertEquals('VCALENDAR', $result->name);
        $this->assertEquals(0, count($result->children));

    }

}


text:
/* Adapted from https://github.com/json-path/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/internal/filter/ExpressionNode.java */

#import <Foundation/Foundation.h>

#import "SMJPredicate.h"

NS_ASSUME_NONNULL_BEGIN

/*
** SMJExpressionNode
*/
#pragma mark - SMJExpressionNode

@interface SMJExpressionNode : NSObject <SMJPredicate>

@end

NS_ASSUME_NONNULL_END


text:
<?php

/**
 * The template for displaying Search Results pages.
 *
 * Template name: Search results
 */

class Page_search_results extends MVC_controller {
  private $post;

  function __construct($param_string, $post_id) {
    $this->post = get_post();
    parent::__construct($param_string, $post_id);
  }

  function main() {
    $this->view('layouts/default', $this->get_data());
  }

  private function get_data() {
    $top_slug = $this->post->post_name;

    return array(
      'page' => 'pages/search_results/main',
      'template_class' => 'search-results',
      'cache_timeout' => 60 * 60 * 24, /* 1 day */
      'page_data' => array(
        'top_slug' => htmlspecialchars($top_slug),
        'dw_tag' => Taggr::get_current()
      )
    );
  }
}


text:
'''
Created on Dec 11, 2013

@author: gpratt
'''

from collections import defaultdict
import gzip
from optparse import OptionParser
import os

import numpy as np
import pandas as pd

def handle_seq(seq, barcode_df, result_dict):
    """

    seq - dna sequence to look for barcodes in
    barcode_df - pandas dataframe of barcodes, ids
    result_dict - dictionary where results are stored, not returned for speed

    counts number of barcodes in each location for each read

    """
    for i in range(len(seq)):
        for barcode in barcode_df.index:
            possible_match = seq[i: i + len(barcode)]
            if possible_match == barcode:
                #old style, default dicts are slow, could make into matrix
                if i not in result_dict[barcode]:
                    result_dict[barcode][i] = 0
                result_dict[barcode][i] += 1

def calculate_barcode_frequency(file_handle, barcodes):

    """

    fastq -- file handle to fastq test text file (for fast processing)
    barcodes -- csv file handle (or file) of barcode\tbarcode_id

    returns pandas dataframe of frequency of each barcode at each base

    """

    barcodes_df = pd.read_csv(barcodes,
                              sep="\t",
                              names= ["seq", "id"],
                              index_col=0)

    result_dict = defaultdict(dict)

    while True:
        file_handle.next() #name
        seq = file_handle.next()
        file_handle.next() #plus
        file_handle.next() #qual
        handle_seq(seq, barcodes, result_dict)

    data_frame = pd.DataFrame(result_dict).T
    data_frame[np.isnan(data_frame)] = 0
    data_frame.index.name = "barcode"
    data_frame.insert(0, "barcode_name", barcodes_df.id)

    return data_frame

if __name__ == '__main__':
    usage = """ calculates frequency of each barcode sequence across all reads for
    all barcodes """

    parser = OptionParser(usage)
    parser.add_option("-f", "--fastq", dest="fastq", help="fastq file to barcode seperate")
    parser.add_option("-b", "--barcodes", dest="barcodes", help="file of barcode / barcode id")
    parser.add_option("-o", "--out_file", dest="out_file")

    (options,args) = parser.parse_args()
    if os.path.splitext(options.fastq)[1] == ".gz":
        handle = gzip.open(options.fastq)
    else:
        handle = open(options.fastq)

    calculate_barcode_frequency(handle, options.barcodes).to_csv(options.out_file)


text:
(function() {
    'use strict';

    angular
        .module('jhipsterApp')
        .config(stateConfig);

    stateConfig.$inject = ['$stateProvider'];

    function stateConfig($stateProvider) {
        $stateProvider.state('requestReset', {
            parent: 'account',
            url: '/reset/request',
            data: {
                authorities: []
            },
            views: {
                'content@': {
                    templateUrl: 'app/account/reset/request/reset.request.html',
                    controller: 'RequestResetController',
                    controllerAs: 'vm'
                }
            },
            resolve: {
                translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {
                    $translatePartialLoader.addPart('reset');
                    return $translate.refresh();
                }]
            }
        });
    }
})();


text:
using System.Linq;
using Microsoft.Owin.Hosting;
using Mileage.Server.Infrastructure;
using Raven.Abstractions.Extensions;

namespace Mileage.Server.Hosts.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            var startOptions = new StartOptions();
            startOptions.Urls.AddRange(Config.Addresses.GetValue().Select(f => f.ToString()));

            using (WebApp.Start<Startup>(startOptions))
            {
                System.Console.WriteLine("Mileage Web-API started.");
                System.Console.WriteLine("Press <Enter> to close.");

                System.Console.ReadLine();
            }
        }
    }
}