text:
#import "PgPDF.h"

@implementation PgPDF

float dpi = 72; // Only 72 dpi for now, but should look into ways to support higher resolution

// Output resolution for images
// Images of larger size than necessary will be resized to optimize the resulting PDF file size
float imageDpi = 150;

UIFont *currentFont = nil;

- (void) createDocument:(CDVInvokedUrlCommand*) command
{
	NSString* pdfFileName = [command.arguments objectAtIndex:0];

	UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil);

	if(currentFont == nil) { currentFont = [UIFont systemFontOfSize:12]; }

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:pdfFileName];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) addPage:(CDVInvokedUrlCommand*) command
{
	float width  = [[command.arguments objectAtIndex:0] floatValue] * dpi;
	float height = [[command.arguments objectAtIndex:1] floatValue] * dpi;

	UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, width, height), nil);

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) closeDocument:(CDVInvokedUrlCommand*) command {
	UIGraphicsEndPDFContext();

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) setStrokeColor:(CDVInvokedUrlCommand*) command
{
	int red     = [[command.arguments objectAtIndex:0] intValue];
	int green   = [[command.arguments objectAtIndex:1] intValue];
	int blue    = [[command.arguments objectAtIndex:2] intValue];
	float alpha = [[command.arguments objectAtIndex:3] floatValue];

	float redNorm = [self normalizeColorComponent:red];
	float greenNorm = [self normalizeColorComponent:green];
	float blueNorm = [self normalizeColorComponent:blue];

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
	CGFloat components[] = { redNorm, greenNorm, blueNorm, alpha };
	CGColorRef color = CGColorCreate(colorspace, components);
	CGContextSetStrokeColorWithColor(context, color);
	CGColorSpaceRelease(colorspace);
	CGColorRelease(color);

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (float) normalizeColorComponent:(int) colorComponent
{
	if(colorComponent < 0) { return 0; }
	if(colorComponent > 255) { return 1; }
	return colorComponent / 255.f;
}

- (void) setFillColor:(CDVInvokedUrlCommand*) command
{
	int red     = [[command.arguments objectAtIndex:0] intValue];
	int green   = [[command.arguments objectAtIndex:1] intValue];
	int blue    = [[command.arguments objectAtIndex:2] intValue];
	float alpha = [[command.arguments objectAtIndex:3] floatValue];

	float redNorm = red / 255.0;
	float greenNorm = green / 255.0;
	float blueNorm = blue / 255.0;

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
	CGFloat components[] = { redNorm, greenNorm, blueNorm, alpha };
	CGColorRef color = CGColorCreate(colorspace, components);
	CGContextSetFillColorWithColor(context, color);
	CGColorSpaceRelease(colorspace);
	CGColorRelease(color);

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) setTextFont:(CDVInvokedUrlCommand*) command
{
	NSString *fontName = [command.arguments objectAtIndex:0];

	currentFont = [UIFont fontWithName:fontName size:currentFont.pointSize];

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) setTextSize:(CDVInvokedUrlCommand*) command
{
	float pointSize = [[command.arguments objectAtIndex:0] floatValue];

	currentFont = [UIFont fontWithName:currentFont.fontName size:pointSize];

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) drawTextInBox:(CDVInvokedUrlCommand*) command
{
	NSString* text = [command.arguments objectAtIndex:0];
	float left = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float top  = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float width  = [[command.arguments objectAtIndex:3] floatValue] * dpi;
	float height = [[command.arguments objectAtIndex:4] floatValue] * dpi;
	NSString* alignment = [command.arguments objectAtIndex:5];

	enum NSTextAlignment textAlign = NSTextAlignmentLeft;
	if(alignment != (id)[NSNull null]) {
		if([alignment isEqualToString:@"center"]) { textAlign = NSTextAlignmentCenter; }
		if([alignment isEqualToString:@"right"]) { textAlign = NSTextAlignmentRight; }
	}

	CGRect stringRect = CGRectMake(left, top, width, height);

	[text drawInRect:stringRect withFont:currentFont lineBreakMode:NSLineBreakByTruncatingTail alignment:textAlign];

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void) drawLine:(CDVInvokedUrlCommand*) command
{
	float startX = [[command.arguments objectAtIndex:0] floatValue] * dpi;
	float startY = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float endX = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float endY = [[command.arguments objectAtIndex:3] floatValue] * dpi;
	float width = [[command.arguments objectAtIndex:4] floatValue]; // width in points, not inches
	NSString* capStyleString = [command.arguments objectAtIndex:5];

	enum CGLineCap capStyle = kCGLineCapButt;
	if(capStyleString != (id)[NSNull null]) {
		if([capStyleString isEqualToString:@"round"]) { capStyle = kCGLineCapRound; }
		if([capStyleString isEqualToString:@"square"]) { capStyle = kCGLineCapSquare; }
	}

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSetLineCap(context, capStyle);
	CGContextSetLineWidth(context, width);
	CGContextMoveToPoint(context, startX, startY);
	CGContextAddLineToPoint(context, endX, endY);
	CGContextStrokePath(context);
}

- (void) drawRect:(CDVInvokedUrlCommand*) command
{
	float left = [[command.arguments objectAtIndex:0] floatValue] * dpi;
	float top  = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float width  = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float height = [[command.arguments objectAtIndex:3] floatValue] * dpi;
	float lineWidth = [[command.arguments objectAtIndex:4] floatValue]; // width in points, not inches
	bool  isFilled  = [[command.arguments objectAtIndex:5] boolValue];
	NSString* cornerStyleString = [command.arguments objectAtIndex:6];

	enum CGLineJoin cornerStyle = kCGLineJoinMiter;
	if(cornerStyleString != (id)[NSNull null]) {
		if([cornerStyleString isEqualToString:@"bevel"]) { cornerStyle = kCGLineJoinRound; }
		if([cornerStyleString isEqualToString:@"round"]) { cornerStyle = kCGLineJoinRound; }
	}

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSetLineWidth(context, lineWidth);
	CGContextSetLineJoin(context, cornerStyle);

	CGRect rect = CGRectMake(left, top, width, height);
	if(isFilled) { CGContextFillRect(context, rect); }
	CGContextStrokeRect(context, rect);
}

- (void) drawRoundRect:(CDVInvokedUrlCommand*) command
{
	float left = [[command.arguments objectAtIndex:0] floatValue] * dpi;
	float top  = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float width  = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float height = [[command.arguments objectAtIndex:3] floatValue] * dpi;
	float radius = [[command.arguments objectAtIndex:4] floatValue] * dpi;
	float lineWidth = [[command.arguments objectAtIndex:5] floatValue]; // width in points, not inches
	bool  isFilled  = [[command.arguments objectAtIndex:6] boolValue];

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSetLineJoin(context, kCGLineJoinBevel);
	CGContextSetLineWidth(context, lineWidth);

	CGContextAddArc(context, left + radius, top + radius, radius, M_PI, 1.5 * M_PI, 0);
	CGContextAddArc(context, left + width - radius, top + radius, radius, 1.5 * M_PI, 2 * M_PI, 0);
	CGContextAddArc(context, left + width - radius, top + height - radius, radius, 0, M_PI / 2, 0);
	CGContextAddArc(context, left + radius, top + height - radius, radius, M_PI / 2, M_PI, 0);
	CGContextClosePath(context);
	CGContextStrokePath(context);
	if(isFilled) {
		CGContextAddArc(context, left + radius, top + radius, radius, M_PI, 1.5 * M_PI, 0);
		CGContextAddArc(context, left + width - radius, top + radius, radius, 1.5 * M_PI, 2 * M_PI, 0);
		CGContextAddArc(context, left + width - radius, top + height - radius, radius, 0, M_PI / 2, 0);
		CGContextAddArc(context, left + radius, top + height - radius, radius, M_PI / 2, M_PI, 0);
		CGContextClosePath(context);
		CGContextFillPath(context);
	}
}

- (void) drawEllipseInRect:(CDVInvokedUrlCommand*) command
{
	float left = [[command.arguments objectAtIndex:0] floatValue] * dpi;
	float top  = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float width  = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float height = [[command.arguments objectAtIndex:3] floatValue] * dpi;
	float lineWidth = [[command.arguments objectAtIndex:4] floatValue]; // width in points, not inches
	bool  isFilled  = [[command.arguments objectAtIndex:5] boolValue];

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGRect rect = CGRectMake(left, top, width, height);
	CGContextSetLineWidth(context, lineWidth);
	if(isFilled) { CGContextFillEllipseInRect(context, rect); }
	CGContextStrokeEllipseInRect(context, rect);
}

- (void) drawImage:(CDVInvokedUrlCommand*) command
{
	NSString* imagePath = [command.arguments objectAtIndex:0];
	float left = [[command.arguments objectAtIndex:1] floatValue] * dpi;
	float top  = [[command.arguments objectAtIndex:2] floatValue] * dpi;
	float widthInches  = [[command.arguments objectAtIndex:3] floatValue];
	float heightInches = [[command.arguments objectAtIndex:4] floatValue];

	UIImage* inputImage = [UIImage imageWithContentsOfFile:imagePath];
	float imageResolutionX = widthInches * imageDpi;
	float imageResolutionY = heightInches * imageDpi;
	if(inputImage.size.width > imageResolutionX && inputImage.size.height > imageResolutionY) {
		// if our input image is too big, resize it down to keep the PDF file
		// from being bigger than necessary
		CGSize newSize = CGSizeMake(imageResolutionX, imageResolutionY);
		UIGraphicsBeginImageContext(newSize);
		[inputImage drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
		inputImage = UIGraphicsGetImageFromCurrentImageContext();
		UIGraphicsEndImageContext();
	}

	float drawWidth  = widthInches * dpi;
	float drawHeight = heightInches * dpi;
	CGRect imageRect = CGRectMake(left, top, drawWidth, drawHeight);
	[inputImage drawInRect:imageRect];

	CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
	[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

@end


text:
namespace boost { namespace spirit { namespace karma
{
    ///////////////////////////////////////////////////////////////////////////
    // forwards
    ///////////////////////////////////////////////////////////////////////////
    struct sequence;
    struct alternative;
    struct kleene;
    struct plus;
    struct optional;
    struct list;

    struct main_meta_grammar;

    template <typename Expr, typename Enable>
    struct is_valid_expr;

    template <typename Expr, typename Enable>
    struct expr_transform;

    ///////////////////////////////////////////////////////////////////////////
    // operator meta-grammars
    ///////////////////////////////////////////////////////////////////////////
    struct sequence_meta_grammar
      : proto::or_<
            meta_grammar::binary_rule_flat<
                karma::domain, proto::tag::shift_left, sequence,
                main_meta_grammar
            >,
            meta_grammar::binary_rule_flat<
                karma::domain, proto::tag::plus, sequence,
                main_meta_grammar
            >
        >
    {
    };

    struct alternative_meta_grammar
      : meta_grammar::binary_rule_flat<
            karma::domain, proto::tag::bitwise_or, alternative,
            main_meta_grammar
        >
    {
    };

    struct repeat_meta_grammar
      : proto::or_<
            meta_grammar::unary_rule<
                karma::domain, proto::tag::dereference, kleene,
                main_meta_grammar
            >,
            meta_grammar::unary_rule<
                karma::domain, proto::tag::negate, optional,
                main_meta_grammar
            >,
            meta_grammar::unary_rule<
                karma::domain, proto::tag::unary_plus, plus,
                main_meta_grammar
            >,
            meta_grammar::binary_rule<
                karma::domain, proto::tag::modulus, list,
                main_meta_grammar, main_meta_grammar
            >
        >
    {
    };

    struct operator_meta_grammar
      : proto::or_<
            sequence_meta_grammar,
            alternative_meta_grammar,
            repeat_meta_grammar
        >
    {
    };

    ///////////////////////////////////////////////////////////////////////////
    //  These specializations non-intrusively hooks into the Karma meta-grammar.
    //  (see karma/meta_grammar.hpp)
    ///////////////////////////////////////////////////////////////////////////
    template <typename Expr>
    struct is_valid_expr<Expr
      , typename enable_if<proto::matches<Expr, operator_meta_grammar> >::type>
      : mpl::true_
    {
    };

    template <typename Expr>
    struct expr_transform<Expr
      , typename enable_if<proto::matches<Expr, operator_meta_grammar> >::type>
      : mpl::identity<operator_meta_grammar>
    {
    };

}}}

#endif

redpajama_set_name: RedPajamaGithub


text:
import mxnet as mx

from ray import air, tune, logger
from ray.tune.integration.mxnet import TuneCheckpointCallback, TuneReportCallback
from ray.tune.schedulers import ASHAScheduler

def train_mnist_mxnet(config, mnist, num_epochs=10):
    batch_size = config["batch_size"]
    train_iter = mx.io.NDArrayIter(
        mnist["train_data"], mnist["train_label"], batch_size, shuffle=True
    )
    val_iter = mx.io.NDArrayIter(mnist["test_data"], mnist["test_label"], batch_size)

    data = mx.sym.var("data")
    data = mx.sym.flatten(data=data)

    fc1 = mx.sym.FullyConnected(data=data, num_hidden=config["layer_1_size"])
    act1 = mx.sym.Activation(data=fc1, act_type="relu")

    fc2 = mx.sym.FullyConnected(data=act1, num_hidden=config["layer_2_size"])
    act2 = mx.sym.Activation(data=fc2, act_type="relu")

    # MNIST has 10 classes
    fc3 = mx.sym.FullyConnected(data=act2, num_hidden=10)
    # Softmax with cross entropy loss
    mlp = mx.sym.SoftmaxOutput(data=fc3, name="softmax")

    # create a trainable module on CPU
    mlp_model = mx.mod.Module(symbol=mlp, context=mx.cpu())
    mlp_model.fit(
        train_iter,
        eval_data=val_iter,
        optimizer="sgd",
        optimizer_params={"learning_rate": config["lr"]},
        eval_metric="acc",
        batch_end_callback=mx.callback.Speedometer(batch_size, 100),
        eval_end_callback=TuneReportCallback({"mean_accuracy": "accuracy"}),
        epoch_end_callback=TuneCheckpointCallback(filename="mxnet_cp", frequency=3),
        num_epoch=num_epochs,
    )

def tune_mnist_mxnet(num_samples=10, num_epochs=10):
    logger.info("Downloading MNIST data...")
    mnist_data = mx.test_utils.get_mnist()
    logger.info("Got MNIST data, starting Ray Tune.")

    config = {
        "layer_1_size": tune.choice([32, 64, 128]),
        "layer_2_size": tune.choice([64, 128, 256]),
        "lr": tune.loguniform(1e-3, 1e-1),
        "batch_size": tune.choice([32, 64, 128]),
    }

    scheduler = ASHAScheduler(max_t=num_epochs, grace_period=1, reduction_factor=2)

    tuner = tune.Tuner(
        tune.with_resources(
            tune.with_parameters(
                train_mnist_mxnet, mnist=mnist_data, num_epochs=num_epochs
            ),
            resources={
                "cpu": 1,
            },
        ),
        tune_config=tune.TuneConfig(
            metric="mean_accuracy",
            mode="max",
            num_samples=num_samples,
            scheduler=scheduler,
        ),
        param_space=config,
        run_config=air.RunConfig(
            name="tune_mnist_mxnet",
        ),
    )
    return tuner.fit()

if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--smoke-test", action="store_true", help="Finish quickly for testing"
    )
    parser.add_argument(
        "--server-address",
        type=str,
        default=None,
        required=False,
        help="The address of server to connect to if using Ray Client.",
    )
    args, _ = parser.parse_known_args()

    if args.server_address and not args.smoke_test:
        import ray

        ray.init(f"ray://{args.server_address}")

    if args.smoke_test:
        results = tune_mnist_mxnet(num_samples=1, num_epochs=1)
    else:
        results = tune_mnist_mxnet(num_samples=10, num_epochs=10)

    print("Best hyperparameters found were: ", results.get_best_result().config)


text:
class RenderProcessHost;
class RenderWidgetHost;
class SkBitmap;

namespace gfx {
class Rect;
}

namespace content {
class RenderProcessHost;
}

namespace skia {
class PlatformCanvas;
}

// Represents a backing store for the pixels in a RenderWidgetHost.
class CONTENT_EXPORT BackingStore {
 public:
  virtual ~BackingStore();

  RenderWidgetHost* render_widget_host() const { return render_widget_host_; }
  const gfx::Size& size() { return size_; }

  // The number of bytes that this backing store consumes. The default
  // implementation just assumes there's 32 bits per pixel over the current
  // size of the screen. Implementations may override this if they have more
  // information about the color depth.
  virtual size_t MemorySize();

  // Paints the bitmap from the renderer onto the backing store.  bitmap_rect
  // gives the location of bitmap, and copy_rects specifies the subregion(s) of
  // the backingstore to be painted from the bitmap.
  //
  // PaintToBackingStore does not need to guarantee that this has happened by
  // the time it returns, in which case it will set |scheduled_callback| to
  // true and will call |callback| when completed.
  virtual void PaintToBackingStore(
      content::RenderProcessHost* process,
      TransportDIB::Id bitmap,
      const gfx::Rect& bitmap_rect,
      const std::vector<gfx::Rect>& copy_rects,
      const base::Closure& completion_callback,
      bool* scheduled_completion_callback) = 0;

  // Extracts the gives subset of the backing store and copies it to the given
  // PlatformCanvas. The PlatformCanvas should not be initialized. This function
  // will call initialize() with the correct size. The return value indicates
  // success.
  virtual bool CopyFromBackingStore(const gfx::Rect& rect,
                                    skia::PlatformCanvas* output) = 0;

  // Scrolls the contents of clip_rect in the backing store by dx or dy (but dx
  // and dy cannot both be non-zero).
  virtual void ScrollBackingStore(int dx, int dy,
                                  const gfx::Rect& clip_rect,
                                  const gfx::Size& view_size) = 0;
 protected:
  // Can only be constructed via subclasses.
  BackingStore(RenderWidgetHost* widget, const gfx::Size& size);

 private:
  // The owner of this backing store.
  RenderWidgetHost* render_widget_host_;

  // The size of the backing store.
  gfx::Size size_;

  DISALLOW_COPY_AND_ASSIGN(BackingStore);
};

#endif  // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_


text:
package jetbrains.buildServer.nuget.feed.server.index.impl.transform;

import jetbrains.buildServer.nuget.feed.server.index.impl.NuGetPackageBuilder;
import jetbrains.buildServer.nuget.feed.server.index.impl.PackageTransformation;
import jetbrains.buildServer.serverSide.ProjectManager;
import jetbrains.buildServer.serverSide.auth.AuthUtil;
import jetbrains.buildServer.serverSide.auth.SecurityContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Eugene Petrenko (eugene.petrenko@gmail.com)
 *         Date: 18.01.12 20:30
 */
public class AccessCheckTransformation implements PackageTransformation {
  private final ProjectManager myProjects;
  private final SecurityContext myContext;

  public AccessCheckTransformation(@NotNull final ProjectManager projects,
                                   @NotNull final SecurityContext context) {
    myProjects = projects;
    myContext = context;
  }

  @Nullable
  private String safeFindProjectId(@NotNull final String buildTypeId) {
    try {
      return myProjects.findProjectId(buildTypeId);
    } catch (RuntimeException e) {
      return null;
    }
  }

  private boolean isAccessible(@Nullable final String buildTypeId) {
    if (buildTypeId == null) return false;
    //TODO: move it into BuildMetadataStorage instead.
    //check access to the entry
    final String projectId = safeFindProjectId(buildTypeId);
    //no project no chance
    if (projectId == null) return false;
    //check project access
    return AuthUtil.hasReadAccessTo(myContext.getAuthorityHolder(), projectId);
  }

  @NotNull
  public Status applyTransformation(@NotNull NuGetPackageBuilder builder) {
    return isAccessible(builder.getBuildTypeId()) ? Status.CONTINUE : Status.SKIP;
  }

  @NotNull
  public PackageTransformation createCopy() {
    return this;
  }
}


text:
- とりあえず改行コードは`\n`だけ考える。前処理で統一されるよう変換もできるはずなので。
- 各行の末尾にnewlineがあることが前提になっている。
- いくつかのタグでMarkdown仕様上では表記法が複数存在するが、省略しているものがある。
  - border: '-'のみ
  - list: '-'のみ
  - emphasis: '\*'のみ
- ブロックタブの一部でうまく改行を処理できない(致命的)
  - list
  - code
- インラインレベルのパースで「残りのstring全てのパース」というのをどう実装するかが難しい。
  - 基本的にnewlineで見れると思っていたけど、段落中でもnewlineを使用しているので判断の難しい場面が多い。
- 同じところを何回もパースしているのが無駄に感じる。

document  = paragraph, {(emptyLine, paragraph)}
paragraph = line, {line}
emptyLine = {spaces}, newline
line      = anyChar, {anyChar}, newline
newline   = "\n"
space     = " "
tab       = '\t'
spaces    = (space | tab)
anyChar   = (any character but newline)

head      = "#", {"#"}, anyChar, newline
border    = ("-", {spaces}, "-", {spaces}, "-"), {("-" | spaces)}, newline
list      = listItem, {listItem}
listVal   = {spaces}, (anyChar but "-"), {anyChar}
listItem  = {spaces}, "-", spaces, (listVal, newline), {(listVal, newline)}

### pandoc読みこなし

ドキュメント、ソースの参考にしているversionは`pandoc-1.17.2`。

- `Reader`と`Writer`というデータ型があり、それぞれinputとoutputのフォーマットに対応する。
- 各フォーマット, `Reader`, `Writer`単位でパッケージがわけられているのでわかりやすい。
- パースには`parsec`パッケージが使用されている。
- Markdownを読みHTMLを吐き出したい場合、(エラー処理を無視すれば)コード上は以下のようになる。
  - `read〜`関数は`ReaderOptions -> String -> Either PandocError Pandoc`と定義。
  - `write〜`関数は`WriterOptions -> Pandoc -> String`と定義。
    - なのでパース時のデータの捉え方は以下のようになる。
      - `Reader`を`read〜`関数から作り、パース結果を`Pandoc`データ型として持つ。
      - `Writer`を`write〜`関数から作り、`Pandoc`からフォーマット結果を`String`として出力する。
  - `def`は`Text.Pandoc.Options`で`def :: Default a => a`と定義。
    - `ReaderOptions`や`WriterOptions`のデフォルト値を表す。

```haskell
{-
公式のdocumentを元にしたコード。もともとは関数合成順が`writeHtml`と`handleError`で逆だったけれど、それでは型的に動かないはずでは。
-}
-- Convert markdown to HTML
readMarkdownToHtml :: String -> String
readMarkdownToHtml = writeHtmlString def . handleError . readMarkdown def
```

- `Pandoc`は特定のフォーマットに依存しないメタ的な文書構造を表すデータ型。
  - `data Pandoc = Pando Meta [Block]`で定義。
  - `Meta`は文書のメタデータを表すデータ型(タイトル、筆者etc)。
  - `Block`は段落というかHTMLのブロック要素に当たるものというか。下の定義を見た方が早いか。
  - `Inline`は文というかHTMLのインライン要素に当たるものというか。下の定義を見た方が早いか。

```haskell
-- | Block element.
data Block
    = Plain [Inline]           -- Plain text, not a paragraph
    | Para [Inline]            -- Paragraph
    | CodeBlock Attr String    -- Code block (literal) with attributes
    | RawBlock Format String   -- Raw block
    | BlockQuote [Block]       -- Block quote (list of blocks)
    | OrderedList ListAttributes [[Block]] -- Ordered list (attributes
                               -- and a list of items, each a list of blocks)
    | BulletList [[Block]]     -- Bullet list (list of items, each
                               -- a list of blocks)
    | DefinitionList [([Inline],[[Block]])]  -- Definition list
                               -- Each list item is a pair consisting of a
                               -- term (a list of inlines) and one or more
                               -- definitions (each a list of blocks)
    | Header Int Attr [Inline] -- Header - level (integer) and text (inlines)
    | HorizontalRule           -- Horizontal rule
    | Table [Inline] [Alignment] [Double] [TableCell] [[TableCell]]  -- Table,
                               -- with caption, column alignments (required),
                               -- relative column widths (0 = default),
                               -- column headers (each a list of blocks), and
                               -- rows (each a list of lists of blocks)
    | Div Attr [Block]         -- Generic block container with attributes
    | Null                     -- Nothing
    deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
```

```haskell
-- | Inline elements.
data Inline
    = Str String                 -- Text (string)
    | Emph [Inline]              -- Emphasized text (list of inlines)
    | Strong [Inline]            -- Strongly emphasized text (list of inlines)
    | Strikeout [Inline]         -- Strikeout text (list of inlines)
    | Superscript [Inline]       -- Superscripted text (list of inlines)
    | Subscript [Inline]         -- Subscripted text (list of inlines)
    | SmallCaps [Inline]         -- Small caps text (list of inlines)
    | Quoted QuoteType [Inline]  -- Quoted text (list of inlines)
    | Cite [Citation]  [Inline]  -- Citation (list of inlines)
    | Code Attr String           -- Inline code (literal)
    | Space                      -- Inter-word space
    | SoftBreak                  -- Soft line break
    | LineBreak                  -- Hard line break
    | Math MathType String       -- TeX math (literal)
    | RawInline Format String    -- Raw inline
    | Link Attr [Inline] Target  -- Hyperlink: alt text (list of inlines), target
    | Image Attr [Inline] Target -- Image:  alt text (list of inlines), target
    | Note [Block]               -- Footnote or endnote
    | Span Attr [Inline]         -- Generic inline container with attributes
    deriving (Show, Eq, Ord, Read, Typeable, Data, Generic)
```

- 入力データ内のnewlineは`\n`でなくてはならない。

#### Text.Pandoc.Readers.Markdown

- Markdownのパースを担当しているパッケージ。

以下のコード断片は他に言及が無ければText.Pandoc.Readers.Markdownパッケージからのもの。`memo:`と先頭につけているコメント文はオリジナルのコード上のものではなく自分で付加したもの。

Markdownのパーサを表すデータ型として`MarkdownParser`が定義されている。

```haskell
{- memo:
`MarkdownParser a` is an alias of parser consuming `String` and produce `a`(* -> *).
`ParserState` is defined in `Text.Pandoc.Parsing`
 -}
type MarkdownParser = Parser [Char] ParserState
```

```haskell
{- memo: From Text.Pandoc.Parsing -}
type Parser t s = Parsec t s
type ParserT = ParsecT
```

Markdown -> `Pandoc`データへの変換には`parseMarkdown`関数が使用される。`Pandoc`を構成する複数の`Block`データは`parseBlocks`関数で生成される。

```haskell
{- memo: alias 'B' means Text.Pandoc.Builder package -}
parseMarkdown :: MarkdownParser Pandoc
parseMarkdown = do
  -- markdown allows raw HTML
  updateState $ \state -> state { stateOptions =
                let oldOpts = stateOptions state in
                    oldOpts{ readerParseRaw = True } }
  optional titleBlock
  blocks <- parseBlocks
  st <- getState
  let meta = runF (stateMeta' st) st
  let Pandoc _ bs = B.doc $ runF blocks st
  eastAsianLineBreaks <- option False $
                    True <$ guardEnabled Ext_east_asian_line_breaks
  return $ (if eastAsianLineBreaks
               then bottomUp softBreakFilter
               else id) $ Pandoc meta bs

parseBlocks :: MarkdownParser (F Blocks)
parseBlocks = mconcat <$> manyTill block eof
```

`F`ってなんじゃいという感じなので以下の定義を確認。

```haskell
{- memo: From Text.Pandoc.Parsing -}
newtype F a = F { unF :: Reader ParserState a } deriving (Monad, Applicative, Functor)

runF :: F a -> ParserState -> a
runF = runReader . unF

instance Monoid a => Monoid (F a) where
  mempty = return mempty
  mappend = liftM2 mappend
  mconcat = liftM mconcat . sequence
```

```haskell
{- memo:
`tr` is a flag to output debug log if necessary.
`res` stores the result of parse blocks.
 -}
block :: MarkdownParser (F Blocks)
block = do
  tr <- getOption readerTrace
  pos <- getPosition
  res <- choice [ mempty <$ blanklines
               , codeBlockFenced
               , yamlMetaBlock
               -- note: bulletList needs to be before header because of
               -- the possibility of empty list items: -
               , bulletList
               , header
               , lhsCodeBlock
               , divHtml
               , htmlBlock
               , table
               , codeBlockIndented
               , guardEnabled Ext_latex_macros *> (macro >>= return . return)
               , rawTeXBlock
               , lineBlock
               , blockQuote
               , hrule
               , orderedList
               , definitionList
               , noteBlock
               , referenceKey
               , abbrevKey
               , para
               , plain
               ] <?> "block"
  when tr $ do
    st <- getState
    trace (printf "line %d: %s" (sourceLine pos)
           (take 60 $ show $ B.toList $ runF res st)) (return ())
  return res
```

Block要素のパース例として`header`(見出し。e.g. `<h3>`。Markdown上では`### Header3`のように表される)を見てみる。

```haskell
header :: MarkdownParser (F Blocks)
header = setextHeader <|> atxHeader <?> "header"

{- memo:
`withRaw` defined in Text.Pandoc.Parsing package receives `ParsecT` and return the result of parsing and raw input.
-}
atxHeader :: MarkdownParser (F Blocks)
atxHeader = try $ do
  level <- atxChar >>= many1 . char >>= return . length
  notFollowedBy $ guardEnabled Ext_fancy_lists >>
                  (char '.' <|> char ')') -- this would be a list
  skipSpaces
  (text, raw) <- withRaw $
          trimInlinesF . mconcat <$> many (notFollowedBy atxClosing >> inline)
  attr <- atxClosing
  attr' <- registerHeader attr (runF text defaultParserState)
  guardDisabled Ext_implicit_header_references
    <|> registerImplicitHeader raw attr'
  return $ B.headerWith attr' level <$> text

atxClosing :: MarkdownParser Attr
atxClosing = try $ do
  attr' <- option nullAttr
             (guardEnabled Ext_mmd_header_identifiers >> mmdHeaderIdentifier)
  skipMany . char =<< atxChar
  skipSpaces
  attr <- option attr'
             (guardEnabled Ext_header_attributes >> attributes)
  blanklines
  return attr
```

- 重要なのは`atxHeader`関数の`level`を取得している箇所と`(test, raw)`を取得している箇所。`level`には見出しのレベル、`text`には見出しの内容が入る。
- `axtHeader`関数内の`many (notFollowedBy atxClosing >> inline)`というのが自分の一番理解したいところ。ここで`Block`データを構成する`[Inlines]`のパースが行われている。`notFollowedBy p`でpのパースが失敗したとき、`notFollowedBy`としてのパースは成功する(このときinputは消費されない)ので、ここでは`axtClosing`のパースが失敗したとき、`inline`のパースが実行される。`atxClosing`のパースが成功するとき、これは恐らく`blanklines`のパースが成功するときであり、改行が見出しの末尾になるのはMarkdownから考えても正しい。
- `inline`のパースは`MarkdownParser (F Inlines)`を返す。`F a`の`mconcat`は`Text.Pandoc.Parsing`、`Inlines`のMonoid実装は`Text.Pandoc.Builder`で定義されており、`mconcat`でインライン要素同士をまとめるような動きになる(`Inlines`のMonoid実装はもう少しちゃんと見たい)。

```haskell
inline :: MarkdownParser (F Inlines)
inline = choice [ whitespace
                , bareURL
                , str
                , endline
                , code
                , strongOrEmph
                , note
                , cite
                , link
                , image
                , math
                , strikeout
                , subscript
                , superscript
                , inlineNote  -- after superscript because of ^[link](/foo)^
                , autoLink
                , spanHtml
                , rawHtmlInline
                , escapedChar
                , rawLaTeXInline'
                , exampleRef
                , smart
                , return . B.singleton <$> charRef
                , emoji
                , symbol
                , ltSign
                ] <?> "inline"
```

とりあえず一番イメージがしやすそうな`strongOrEmph`の実装を見てみる。Markdown上で`*this is emphasized*`、`**this is strong**`のようなinputのパースとなる。

```haskell
strongOrEmph :: MarkdownParser (F Inlines)
strongOrEmph =  enclosure '*' <|> enclosure '_'

{- memo: `<>`` is an infix synonym for `mappend`. -}
-- Parses material enclosed in *s, **s, _s, or __s.
-- Designed to avoid backtracking.
enclosure :: Char
          -> MarkdownParser (F Inlines)
enclosure c = do
  -- we can't start an enclosure with _ if after a string and
  -- the intraword_underscores extension is enabled:
  guardDisabled Ext_intraword_underscores
    <|> guard (c == '*')
    <|> (guard =<< notAfterString)
  cs <- many1 (char c)
  (return (B.str cs) <>) <$> whitespace
    <|> do
        case length cs of
             3  -> three c
             2  -> two   c mempty
             1  -> one   c mempty
             _  -> return (return $ B.str cs)
```

例のごとく細かいところには飛び込まず概要だけさらってみると、

- `cs <- many1 (char c)`で始まりの'\*'1つ以上をパースしている。
- `(return (B.str cs) <>) <$> whitespace`は残りがspace的なものだけならば'\*'をただの文字列として返して終了するということ。`whitespace`の実装は以下の通り。

```haskell
whitespace :: MarkdownParser (F Inlines)
whitespace = spaceChar >> return <$> (lb <|> regsp) <?> "whitespace"
  where lb = spaceChar >> skipMany spaceChar >> option B.space (endline >> return B.linebreak)
        regsp = skipMany spaceChar >> return B.space
```

- そうではない場合、パースに成功した'\*'の個数に応じた関数が呼ばれる。

```haskell
ender :: Char -> Int -> MarkdownParser ()
ender c n = try $ do
  count n (char c)
  guard (c == '*')
    <|> guardDisabled Ext_intraword_underscores
    <|> notFollowedBy alphaNum

-- Parse inlines til you hit one c or a sequence of two cs.
-- If one c, emit emph and then parse two.
-- If two cs, emit strong and then parse one.
-- Otherwise, emit ccc then the results.
three :: Char -> MarkdownParser (F Inlines)
three c = do
  contents <- mconcat <$> many (notFollowedBy (ender c 1) >> inline)
  (ender c 3 >> return ((B.strong . B.emph) <$> contents))
    <|> (ender c 2 >> one c (B.strong <$> contents))
    <|> (ender c 1 >> two c (B.emph <$> contents))
    <|> return (return (B.str [c,c,c]) <> contents)

-- Parse inlines til you hit two c's, and emit strong.
-- If you never do hit two cs, emit ** plus inlines parsed.
two :: Char -> F Inlines -> MarkdownParser (F Inlines)
two c prefix' = do
  contents <- mconcat <$> many (try $ notFollowedBy (ender c 2) >> inline)
  (ender c 2 >> return (B.strong <$> (prefix' <> contents)))
    <|> return (return (B.str [c,c]) <> (prefix' <> contents))

-- Parse inlines til you hit a c, and emit emph.
-- If you never hit a c, emit * plus inlines parsed.
one :: Char -> F Inlines -> MarkdownParser (F Inlines)
one c prefix' = do
  contents <- mconcat <$> many (  (notFollowedBy (ender c 1) >> inline)
                           <|> try (string [c,c] >>
                                    notFollowedBy (ender c 1) >>
                                    two c mempty) )
  (ender c 1 >> return (B.emph <$> (prefix' <> contents)))
    <|> return (return (B.str [c]) <> (prefix' <> contents))
```

- `one`, `two`, `three`と関数が分かれているのは`strong`と`em`の入れ子を処理するため。`strong`と`em`で入れ子を作るというのはあまり使用したことがないけれど、パース例としては以下のようになる。
  - `**foo*bar***`は`<p><strong>foo<em>bar</em></strong></p>`
  - `***foobar***`は`<p><strong><em>foobar</em></strong></p>`
- `strong`のみでの入れ子、`em`のみでの入れ子は逆にmozillaの資料にも明記されている([参考][1])。その場合Markdown的にどうすればいいのかは不明。少なくともpandocでは`\*`と`_`を使い分けて2階層までは書くことができる。
  - `__foo**bar**__`は`<p><strong>foo<strong>bar</strong></strong></p>`
  - ただ`**foo__bar__**`は`<p>**foo__bar__**</p>`となってしまう
    - [issue][2]に少し似たようなものがある。
- インライン要素なので末尾のパースに改行は使わない。

---

#### 補足

- `bottomUp`
  - `Text.Pandoc.Generic`で定義。
  - `Data.Generics`の`everywhere`, `mkT`を使用。
  - 一度`Pandoc`を作った上で、`Block`や`Inline`に何らかの変換を施したいときに使われているよう。
- `notFollowedBy :: (Stream s m t, Show a) => ParsecT s u m a -> ParsecT s u m ()`
  - `Text.Parsec`で定義。
  - ヘッダのパース中に`many (notFollowedBy atxClosing >> inline)`として使用されているが、その意味を最初捉え間違えていた。
  - `atxClosing`が後ろに続かない文字列をまとめて`inline`に渡すのではなく、`atxClosing`が続かないことを確認したら`inline`にあとは任せる挙動になる。その際、`notFollowedBy`によってinputが消費されることはない。
- ヘッダのパース時に使用される`atxClosing`とInlinesの`endline`の区別はどうなっている?
  - どちらも改行を対象にする。
  - ただヘッダのパースは`many (notFollowedBy atxClosing >> inline)`という定義なので、ヘッダのパース中に見つかる改行は全て`atxClosing`の処理対象となる。

#### 方針

- パーサを定義する関数は`manyTill (some parser) eof`
  - inputの終わりは`eof`で捉える。
- Document, Block, Inlineのような階層構造を意識する。
  - Documentは文書全体を表し、1つ以上のBlockから構成される。
  - Blockはパラグラフ(のようなもの)を表し、1つ以上のInlineから構成される。
  - Inlineは修飾付きの文章。
- 各Blockは異なるprefixを持つはずなので、それをパース開始の目印とする。postfixは必ず持つとは限らないが、少なくとも最後は改行とみなしてよいはず。

[1]: https://developer.mozilla.org/ja/docs/Web/HTML/Element/strong
[2]: https://github.com/jgm/pandoc/issues/2613


text:
<!DOCTYPE html>

<meta charset="UTF-8">
<link href="style.css" type="text/css" rel="stylesheet">
<title>MOVZX—Move with Zero-Extend </title>

MOVZX—Move with Zero-Extend

Opcode
Instruction
Op/En
64-Bit Mode
Compat/Leg Mode
Description

0F B6 /r
MOVZX r16, r/m8
RM
Valid
Valid
Move byte to word with zero-extension.

0F B6 /r
MOVZX r32, r/m8
RM
Valid
Valid
Move byte to doubleword, zero-extension.

REX.W + 0F B6 /r
MOVZX r64, r/m8*
RM
Valid
N.E.
Move byte to quadword, zero-extension.

0F B7 /r
MOVZX r32, r/m16
RM
Valid
Valid
Move word to doubleword, zero-extension.

REX.W + 0F B7 /r
MOVZX r64, r/m16
RM
Valid
N.E.
Move word to quadword, zero-extension.

NOTES:

*

In 64-bit mode, r/m8 can not be encoded to access the following byte registers if the REX prefix is used: AH, BH, CH, DH.

Instruction Operand Encoding

Op/En
Operand 1
Operand 2
Operand 3
Operand 4

RM
ModRM:reg (w)
ModRM:r/m (r)
NA
NA

Description

Copies the contents of the source operand (register or memory location) to the destination operand (register) and zero extends the value. The size of the converted value depends on the operand-size attribute.

In 64-bit mode, the instruction's default operation size is 32 bits. Use of the REX.R prefix permits access to addi-tional registers (R8-R15). Use of the REX.W prefix promotes operation to 64 bit operands. See the summary chart at the beginning of this section for encoding data and limits.

Operation

DEST ← ZeroExtend(SRC);

Flags Affected

None.

Protected Mode Exceptions

#GP(0)

If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.

If the DS, ES, FS, or GS register contains a NULL segment selector.

#SS(0)
If a memory operand effective address is outside the SS segment limit.

#PF(fault-code)
If a page fault occurs.

#AC(0)
If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.

#UD
If the LOCK prefix is used.

Real-Address Mode Exceptions

#GP
If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.

#SS
If a memory operand effective address is outside the SS segment limit.

#UD
If the LOCK prefix is used.

Virtual-8086 Mode Exceptions

#GP(0)
If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.

#SS(0)
If a memory operand effective address is outside the SS segment limit.

#PF(fault-code)
If a page fault occurs.

#AC(0)
If alignment checking is enabled and an unaligned memory reference is made.

#UD
If the LOCK prefix is used.

Compatibility Mode Exceptions

Same exceptions as in protected mode.

64-Bit Mode Exceptions

#SS(0)
If a memory address referencing the SS segment is in a non-canonical form.

#GP(0)
If the memory address is in a non-canonical form.

#PF(fault-code)
If a page fault occurs.

#AC(0)
If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.

#UD
If the LOCK prefix is used.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="047c7239-bd4f-4074-9c44-323f772dafbd" name="Default" comment="From Webstrom">
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\config1.js" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\fonts\icons.eot" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\fonts\icons.ttf" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\img\contributors\SiR-DanieL" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\img\contributors\manuelmitasch" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\img\contributors\shindakun" afterPath="" />
      <change type="DELETED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\core\client\assets\img\contributors\wjake" afterPath="" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/000.js" afterPath="$PROJECT_DIR$/core/server/data/import/000.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/001.js" afterPath="$PROJECT_DIR$/core/server/data/import/001.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/002.js" afterPath="$PROJECT_DIR$/core/server/data/import/002.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/003.js" afterPath="$PROJECT_DIR$/core/server/data/import/003.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/LICENSE" afterPath="$PROJECT_DIR$/LICENSE" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/LICENSE" afterPath="$PROJECT_DIR$/content/themes/casper/LICENSE" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/PRIVACY.md" afterPath="$PROJECT_DIR$/PRIVACY.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/apps/README.md" afterPath="$PROJECT_DIR$/content/apps/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/data/README.md" afterPath="$PROJECT_DIR$/content/data/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/images/README.md" afterPath="$PROJECT_DIR$/content/images/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/README.md" afterPath="$PROJECT_DIR$/content/themes/casper/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/accesstoken.js" afterPath="$PROJECT_DIR$/core/server/models/accesstoken.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/controllers/admin.js" afterPath="$PROJECT_DIR$/core/server/controllers/admin.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/routes/admin.js" afterPath="$PROJECT_DIR$/core/server/routes/admin.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/routes/api.js" afterPath="$PROJECT_DIR$/core/server/routes/api.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/app-field.js" afterPath="$PROJECT_DIR$/core/server/models/app-field.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/app-setting.js" afterPath="$PROJECT_DIR$/core/server/models/app-setting.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/app.js" afterPath="$PROJECT_DIR$/core/server/models/app.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/asset.js" afterPath="$PROJECT_DIR$/core/server/helpers/asset.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/middleware/auth-strategies.js" afterPath="$PROJECT_DIR$/core/server/middleware/auth-strategies.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/authentication.js" afterPath="$PROJECT_DIR$/core/server/api/authentication.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/author.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/author.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/author.js" afterPath="$PROJECT_DIR$/core/server/helpers/author.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/bad-request-error.js" afterPath="$PROJECT_DIR$/core/server/errors/bad-request-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/base.js" afterPath="$PROJECT_DIR$/core/server/models/base.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/storage/base.js" afterPath="$PROJECT_DIR$/core/server/storage/base.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/basetoken.js" afterPath="$PROJECT_DIR$/core/server/models/basetoken.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/body_class.js" afterPath="$PROJECT_DIR$/core/server/helpers/body_class.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/bower.json" afterPath="$PROJECT_DIR$/bower.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/assets/fonts/casper-icons.svg" afterPath="$PROJECT_DIR$/content/themes/casper/assets/fonts/casper-icons.svg" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/client.js" afterPath="$PROJECT_DIR$/core/server/models/client.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/migration/commands.js" afterPath="$PROJECT_DIR$/core/server/data/migration/commands.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/config.js" afterPath="$PROJECT_DIR$/config.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/configuration.js" afterPath="$PROJECT_DIR$/core/server/api/configuration.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/content.js" afterPath="$PROJECT_DIR$/core/server/helpers/content.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/data-import-error.js" afterPath="$PROJECT_DIR$/core/server/errors/data-import-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/date.js" afterPath="$PROJECT_DIR$/core/server/helpers/date.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/db.js" afterPath="$PROJECT_DIR$/core/server/api/db.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/default-settings.json" afterPath="$PROJECT_DIR$/core/server/data/default-settings.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/default.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/default.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/views/default.hbs" afterPath="$PROJECT_DIR$/core/server/views/default.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/dependencies.js" afterPath="$PROJECT_DIR$/core/server/apps/dependencies.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/utils/downzero.js" afterPath="$PROJECT_DIR$/core/server/utils/downzero.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/permissions/effective.js" afterPath="$PROJECT_DIR$/core/server/permissions/effective.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/email-error.js" afterPath="$PROJECT_DIR$/core/server/errors/email-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/encode.js" afterPath="$PROJECT_DIR$/core/server/helpers/encode.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/views/error.hbs" afterPath="$PROJECT_DIR$/core/server/views/error.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/excerpt.js" afterPath="$PROJECT_DIR$/core/server/helpers/excerpt.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/filters.js" afterPath="$PROJECT_DIR$/core/server/filters.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/fixtures/fixtures.json" afterPath="$PROJECT_DIR$/core/server/data/fixtures/fixtures.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/foreach.js" afterPath="$PROJECT_DIR$/core/server/helpers/foreach.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/controllers/frontend.js" afterPath="$PROJECT_DIR$/core/server/controllers/frontend.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/routes/frontend.js" afterPath="$PROJECT_DIR$/core/server/routes/frontend.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/middleware/ghost-busboy.js" afterPath="$PROJECT_DIR$/core/server/middleware/ghost-busboy.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/ghost-server.js" afterPath="$PROJECT_DIR$/core/server/ghost-server.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/ghost_foot.js" afterPath="$PROJECT_DIR$/core/server/helpers/ghost_foot.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/ghost_head.js" afterPath="$PROJECT_DIR$/core/server/helpers/ghost_head.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/ghost_script_tags.js" afterPath="$PROJECT_DIR$/core/server/helpers/ghost_script_tags.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/shared/lib/showdown/extensions/ghostgfm.js" afterPath="$PROJECT_DIR$/core/shared/lib/showdown/extensions/ghostgfm.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/shared/lib/showdown/extensions/ghostimagepreview.js" afterPath="$PROJECT_DIR$/core/shared/lib/showdown/extensions/ghostimagepreview.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/has.js" afterPath="$PROJECT_DIR$/core/server/helpers/has.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/index.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/index.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/index.js" afterPath="$PROJECT_DIR$/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/assets/js/index.js" afterPath="$PROJECT_DIR$/content/themes/casper/assets/js/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/index.js" afterPath="$PROJECT_DIR$/core/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/index.js" afterPath="$PROJECT_DIR$/core/server/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/index.js" afterPath="$PROJECT_DIR$/core/server/api/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/index.js" afterPath="$PROJECT_DIR$/core/server/apps/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/config/index.js" afterPath="$PROJECT_DIR$/core/server/config/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/export/index.js" afterPath="$PROJECT_DIR$/core/server/data/export/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/fixtures/index.js" afterPath="$PROJECT_DIR$/core/server/data/fixtures/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/fixtures/permissions/index.js" afterPath="$PROJECT_DIR$/core/server/data/fixtures/permissions/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/index.js" afterPath="$PROJECT_DIR$/core/server/data/import/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/migration/index.js" afterPath="$PROJECT_DIR$/core/server/data/migration/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/utils/index.js" afterPath="$PROJECT_DIR$/core/server/data/utils/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/utils/clients/index.js" afterPath="$PROJECT_DIR$/core/server/data/utils/clients/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/validation/index.js" afterPath="$PROJECT_DIR$/core/server/data/validation/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/versioning/index.js" afterPath="$PROJECT_DIR$/core/server/data/versioning/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/index.js" afterPath="$PROJECT_DIR$/core/server/errors/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/index.js" afterPath="$PROJECT_DIR$/core/server/helpers/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/middleware/index.js" afterPath="$PROJECT_DIR$/core/server/middleware/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/index.js" afterPath="$PROJECT_DIR$/core/server/models/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/permissions/index.js" afterPath="$PROJECT_DIR$/core/server/permissions/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/routes/index.js" afterPath="$PROJECT_DIR$/core/server/routes/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/storage/index.js" afterPath="$PROJECT_DIR$/core/server/storage/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/utils/index.js" afterPath="$PROJECT_DIR$/core/server/utils/index.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/internal-server-error.js" afterPath="$PROJECT_DIR$/core/server/errors/internal-server-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/invite-user.html" afterPath="$PROJECT_DIR$/core/server/email-templates/invite-user.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/raw/invite-user.html" afterPath="$PROJECT_DIR$/core/server/email-templates/raw/invite-user.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/is.js" afterPath="$PROJECT_DIR$/core/server/helpers/is.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/assets/js/jquery.fitvids.js" afterPath="$PROJECT_DIR$/content/themes/casper/assets/js/jquery.fitvids.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/loader.js" afterPath="$PROJECT_DIR$/core/server/apps/loader.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/storage/local-file-store.js" afterPath="$PROJECT_DIR$/core/server/storage/local-file-store.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/partials/loop.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/partials/loop.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/mail.js" afterPath="$PROJECT_DIR$/core/server/mail.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/mail.js" afterPath="$PROJECT_DIR$/core/server/api/mail.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/meta_description.js" afterPath="$PROJECT_DIR$/core/server/helpers/meta_description.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/meta_title.js" afterPath="$PROJECT_DIR$/core/server/helpers/meta_title.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/middleware/middleware.js" afterPath="$PROJECT_DIR$/core/server/middleware/middleware.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/utils/clients/mysql.js" afterPath="$PROJECT_DIR$/core/server/data/utils/clients/mysql.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/tpl/nav.hbs" afterPath="$PROJECT_DIR$/core/server/helpers/tpl/nav.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/no-permission-error.js" afterPath="$PROJECT_DIR$/core/server/errors/no-permission-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/not-found-error.js" afterPath="$PROJECT_DIR$/core/server/errors/not-found-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/notifications.js" afterPath="$PROJECT_DIR$/core/server/api/notifications.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/middleware/oauth.js" afterPath="$PROJECT_DIR$/core/server/middleware/oauth.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/permissions/object-type-model-map.js" afterPath="$PROJECT_DIR$/core/server/permissions/object-type-model-map.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/package.json" afterPath="$PROJECT_DIR$/content/themes/casper/package.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/page.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/page.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/page_url.js" afterPath="$PROJECT_DIR$/core/server/helpers/page_url.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/tpl/pagination.hbs" afterPath="$PROJECT_DIR$/core/server/helpers/tpl/pagination.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/pagination.js" afterPath="$PROJECT_DIR$/core/server/helpers/pagination.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/permission.js" afterPath="$PROJECT_DIR$/core/server/models/permission.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/permissions.js" afterPath="$PROJECT_DIR$/core/server/apps/permissions.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/fixtures/permissions/permissions.json" afterPath="$PROJECT_DIR$/core/server/data/fixtures/permissions/permissions.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/utils/clients/pg.js" afterPath="$PROJECT_DIR$/core/server/data/utils/clients/pg.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/utils/pipeline.js" afterPath="$PROJECT_DIR$/core/server/utils/pipeline.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/plural.js" afterPath="$PROJECT_DIR$/core/server/helpers/plural.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/post.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/post.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/post.js" afterPath="$PROJECT_DIR$/core/server/models/post.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/post_class.js" afterPath="$PROJECT_DIR$/core/server/helpers/post_class.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/posts.js" afterPath="$PROJECT_DIR$/core/server/api/posts.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/proxy.js" afterPath="$PROJECT_DIR$/core/server/apps/proxy.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/refreshtoken.js" afterPath="$PROJECT_DIR$/core/server/models/refreshtoken.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/request-too-large-error.js" afterPath="$PROJECT_DIR$/core/server/errors/request-too-large-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/require-tree.js" afterPath="$PROJECT_DIR$/core/server/require-tree.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/reset-password.html" afterPath="$PROJECT_DIR$/core/server/email-templates/reset-password.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/raw/reset-password.html" afterPath="$PROJECT_DIR$/core/server/email-templates/raw/reset-password.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/shared/robots.txt" afterPath="$PROJECT_DIR$/core/shared/robots.txt" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/role.js" afterPath="$PROJECT_DIR$/core/server/models/role.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/roles.js" afterPath="$PROJECT_DIR$/core/server/api/roles.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/apps/sandbox.js" afterPath="$PROJECT_DIR$/core/server/apps/sandbox.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/schema.js" afterPath="$PROJECT_DIR$/core/server/data/schema.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/assets/css/screen.css" afterPath="$PROJECT_DIR$/content/themes/casper/assets/css/screen.css" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/utils/sequence.js" afterPath="$PROJECT_DIR$/core/server/utils/sequence.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/settings.js" afterPath="$PROJECT_DIR$/core/server/api/settings.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/settings.js" afterPath="$PROJECT_DIR$/core/server/models/settings.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/slugs.js" afterPath="$PROJECT_DIR$/core/server/api/slugs.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/utils/clients/sqlite3.js" afterPath="$PROJECT_DIR$/core/server/data/utils/clients/sqlite3.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/utils/startup-check.js" afterPath="$PROJECT_DIR$/core/server/utils/startup-check.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/content/themes/casper/tag.hbs" afterPath="$PROJECT_DIR$/content/themes/casper/tag.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/tag.js" afterPath="$PROJECT_DIR$/core/server/models/tag.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/tags.js" afterPath="$PROJECT_DIR$/core/server/api/tags.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/tags.js" afterPath="$PROJECT_DIR$/core/server/helpers/tags.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/template.js" afterPath="$PROJECT_DIR$/core/server/helpers/template.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/test.html" afterPath="$PROJECT_DIR$/core/server/email-templates/test.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/raw/test.html" afterPath="$PROJECT_DIR$/core/server/email-templates/raw/test.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/themes.js" afterPath="$PROJECT_DIR$/core/server/api/themes.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/title.js" afterPath="$PROJECT_DIR$/core/server/helpers/title.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/unauthorized-error.js" afterPath="$PROJECT_DIR$/core/server/errors/unauthorized-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/unsupported-media-type-error.js" afterPath="$PROJECT_DIR$/core/server/errors/unsupported-media-type-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/update-check.js" afterPath="$PROJECT_DIR$/core/server/update-check.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/upload.js" afterPath="$PROJECT_DIR$/core/server/api/upload.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/config/url.js" afterPath="$PROJECT_DIR$/core/server/config/url.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/url.js" afterPath="$PROJECT_DIR$/core/server/helpers/url.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/views/user-error.hbs" afterPath="$PROJECT_DIR$/core/server/views/user-error.hbs" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/models/user.js" afterPath="$PROJECT_DIR$/core/server/models/user.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/users.js" afterPath="$PROJECT_DIR$/core/server/api/users.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/api/utils.js" afterPath="$PROJECT_DIR$/core/server/api/utils.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/data/import/utils.js" afterPath="$PROJECT_DIR$/core/server/data/import/utils.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/helpers/utils.js" afterPath="$PROJECT_DIR$/core/server/helpers/utils.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/errors/validation-error.js" afterPath="$PROJECT_DIR$/core/server/errors/validation-error.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/welcome.html" afterPath="$PROJECT_DIR$/core/server/email-templates/welcome.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/email-templates/raw/welcome.html" afterPath="$PROJECT_DIR$/core/server/email-templates/raw/welcome.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/server/xmlrpc.js" afterPath="$PROJECT_DIR$/core/server/xmlrpc.js" />
      <change type="MOVED" beforePath="D:\OneDrive\Works\VijayaMalla\MyTakeOnQuotes\Server.js" afterPath="$PROJECT_DIR$/server.js" />
    </list>
    <ignored path="MyTakeOnQuotes.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="MyTakeOnQuotes" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="Gruntfile.js" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/Gruntfile.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.5423729" vertical-offset="4709" max-vertical-offset="18156">
              <caret line="315" column="46" selection-start-line="315" selection-start-column="46" selection-end-line="315" selection-end-column="46" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="true" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/config.js" />
        <option value="$PROJECT_DIR$/server.js" />
        <option value="$PROJECT_DIR$/Gruntfile.js" />
      </list>
    </option>
  </component>
  <component name="JsGruntFileManager">
    <initial>false</initial>
  </component>
  <component name="ProjectFrameBounds">
    <option name="width" value="1920" />
    <option name="height" value="1160" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="MyTakeOnQuotes.azurewebsites.net" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="MyTakeOnQuotes.azurewebsites.net" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="MyTakeOnQuotes.azurewebsites.net" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.lastSelected" value="settings.github" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/.." />
    <property name="WebServerToolWindowFactoryState" value="false" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="scope" value="ALL" />
      <option name="testName" />
      <method />
    </configuration>
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="name" value="Dart" />
      <option name="saveOutputToFile" value="false" />
      <option name="showConsoleOnStdErr" value="false" />
      <option name="showConsoleOnStdOut" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="CucumberJavaScriptRunConfigurationType" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
      <setting name="configLocationType" value="CONFIG_FILE" />
      <setting name="settingsFile" value="" />
      <setting name="serverType" value="INTERNAL" />
      <setting name="preferredDebugBrowser" value="Chrome" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="047c7239-bd4f-4074-9c44-323f772dafbd" name="Default" comment="" />
      <created>1416514614790</created>
      <updated>1416514614790</updated>
    </task>
    <task id="LOCAL-00001" summary="From Webstrom">
      <created>1416515421806</created>
      <updated>1416515421806</updated>
    </task>
    <option name="localTasksCounter" value="2" />
    <servers />
  </component>
  <component name="TodoView" selected-index="4">
    <todo-panel id="selected-file">
      <are-packages-shown value="false" />
      <are-modules-shown value="false" />
      <flatten-packages value="false" />
      <is-autoscroll-to-source value="false" />
    </todo-panel>
    <todo-panel id="all">
      <are-packages-shown value="false" />
      <are-modules-shown value="false" />
      <flatten-packages value="false" />
      <is-autoscroll-to-source value="false" />
    </todo-panel>
    <todo-panel id="default-changelist">
      <are-packages-shown value="false" />
      <are-modules-shown value="false" />
      <flatten-packages value="false" />
      <is-autoscroll-to-source value="false" />
    </todo-panel>
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="0" width="1920" height="1160" extended-state="0" />
    <editor active="false" />
    <layout>
      <window_info id="Grunt" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32944608" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32944608" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32944608" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2496017" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32944608" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
    <MESSAGE value="From Webstrom" />
    <option name="LAST_COMMIT_MESSAGE" value="From Webstrom" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/.npmignore">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1005">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/server.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.02556391" vertical-offset="0" max-vertical-offset="665">
          <caret line="3" column="37" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
          <folding>
            <element signature="e#0#43#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/config.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.7669173" vertical-offset="0" max-vertical-offset="2397">
          <caret line="32" column="0" selection-start-line="32" selection-start-column="0" selection-end-line="32" selection-end-column="0" />
          <folding>
            <element signature="e#0#43#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/config.example.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.7413534" vertical-offset="0" max-vertical-offset="2380">
          <caret line="29" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="134" selection-end-column="0" />
          <folding>
            <element signature="n#!!doc" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Gruntfile.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.5423729" vertical-offset="4709" max-vertical-offset="18156">
          <caret line="315" column="46" selection-start-line="315" selection-start-column="46" selection-end-line="315" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Product\Generator;

use Sylius\Component\Product\Checker\ProductVariantsParityCheckerInterface;
use Sylius\Component\Product\Factory\ProductVariantFactoryInterface;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Product\Model\ProductVariantInterface;
use Sylius\Component\Resource\Exception\VariantWithNoOptionsValuesException;
use Webmozart\Assert\Assert;

final class ProductVariantGenerator implements ProductVariantGeneratorInterface
{
    /** @var ProductVariantFactoryInterface */
    private $productVariantFactory;

    /** @var CartesianSetBuilder */
    private $setBuilder;

    /** @var ProductVariantsParityCheckerInterface */
    private $variantsParityChecker;

    public function __construct(
        ProductVariantFactoryInterface $productVariantFactory,
        ProductVariantsParityCheckerInterface $variantsParityChecker
    ) {
        $this->productVariantFactory = $productVariantFactory;
        $this->setBuilder = new CartesianSetBuilder();
        $this->variantsParityChecker = $variantsParityChecker;
    }

    public function generate(ProductInterface $product): void
    {
        Assert::true($product->hasOptions(), 'Cannot generate variants for an object without options.');

        $optionSet = [];
        $optionMap = [];

        foreach ($product->getOptions() as $key => $option) {
            foreach ($option->getValues() as $value) {
                $optionSet[$key][] = $value->getCode();
                $optionMap[$value->getCode()] = $value;
            }
        }

        if (empty($optionSet)) {
            throw new VariantWithNoOptionsValuesException();
        }

        $permutations = $this->setBuilder->build($optionSet);

        foreach ($permutations as $permutation) {
            $variant = $this->createVariant($product, $optionMap, $permutation);

            if (!$this->variantsParityChecker->checkParity($variant, $product)) {
                $product->addVariant($variant);
            }
        }
    }

    private function createVariant(ProductInterface $product, array $optionMap, $permutation): ProductVariantInterface
    {
        /** @var ProductVariantInterface $variant */
        $variant = $this->productVariantFactory->createForProduct($product);
        $this->addOptionValue($variant, $optionMap, $permutation);

        return $variant;
    }

    private function addOptionValue(ProductVariantInterface $variant, array $optionMap, $permutation): void
    {
        if (!is_array($permutation)) {
            $variant->addOptionValue($optionMap[$permutation]);

            return;
        }

        foreach ($permutation as $code) {
            $variant->addOptionValue($optionMap[$code]);
        }
    }
}


text:
import { Component, OnInit } from '@angular/core';
import { ScheduleService } from './schedule.service';
import * as XLSX from 'xlsx';
import * as _ from 'lodash';
import * as moment from 'moment';
import { GoogleService } from '../share/google/google.service';
import { Observable } from 'rxjs/Observable';
import { LoadingService } from '../share/loading/loading.service';

type AOA = Array<Array<any>>;

@Component({
  selector: 'app-schedule',
  templateUrl: './schedule.component.html',
  styleUrls: ['./schedule.component.css']
})
export class ScheduleComponent implements OnInit {

  data: any;

  scheduleWB: XLSX.WorkBook;

  scheduleWS: XLSX.WorkSheet;

  weekTypes: any = [];

  currentWeekType: any = null;

  groupOptions: any = [];

  groupName: any;

  schedule: any;

  groups: any = [];

  teachers: any = [];

  itsLeft: string;

  ringsCall = ['8:30', '9:50', '10:10', '11:30', '11:50', '13:10', '13:40', '15:00', '15:20', '16:40', '17:00', '18:20'];

  selectedDay: number;

  constructor(private scheduleService: ScheduleService,
              private googleService: GoogleService,
              private loadingService: LoadingService) {
    const currentDay = new Date().getDay();
    if (currentDay === 0 || currentDay === 6) {
      this.selectedDay = 0;
    } else {
      this.selectedDay = currentDay - 1;
    }
  }

  ngOnInit() {
    this.scheduleService.getRawData()
      .subscribe((data) => {
        this.onFileChange({files: [data]});
      });
    this.itsLeft = '* min';
    const ringsCallDuration = _.map(this.ringsCall, val => moment.duration(val).asMinutes());

    Observable.interval(1000)
      .subscribe(() => {
        _.every(this.ringsCall, (val, index) => {
          const nTime = this.ringsCall[index + 1];
          if (this.scheduleService.isInTimeRange(val, nTime)) {
            const now = new Date();
            const nowInMinutes = moment.duration(now.getHours() + ':' + now.getMinutes());
            const leftInMinutes = ringsCallDuration[index + 1] - moment.duration(nowInMinutes).asMinutes();
            const hrLeft = leftInMinutes >= 60 ? Math.floor(leftInMinutes / 60) : 0;
            const minLeft = leftInMinutes >= 60 ? leftInMinutes % 60 : leftInMinutes;
            this.itsLeft = `${hrLeft ? hrLeft + ' hr ' : ''} ${minLeft} min`;
            return false;
          }
          return true;
        });
      });
    const initSub = Observable.interval(500)
      .subscribe(() => {
        if (this.googleService.isSheetsLoaded()) {
          initSub.unsubscribe();
          this.weekTypes = _.map(this.googleService.getSheets(), val => {
            return {label: val, value: val};
          });
          this.currentWeekType = JSON.parse(localStorage.getItem('currentWeekType')) || this.weekTypes[0];
          this.groupName = localStorage.getItem('groupName');
          if (this.groupName) {
            this.updateGroupData();
          }
          this.loadingService.hide();
        }
      });
  }

  isHidden(): boolean {
    return this.loadingService.isVisible();
  }

  onFileChange(evt: any) {
    /* if (evt.files.length !== 1) {
       throw new Error('Cannot use multiple files');
     }
     const reader: FileReader = new FileReader();
     reader.onload = (e: any) => {
       const bstr: string = e.target.result;
       this.scheduleWB = XLSX.read(bstr, {type: 'binary'});

       this.weekTypes = _.map(this.scheduleWB.SheetNames, val => {
         return {label: val, value: val};
       });
       this.currentWeekType = JSON.parse(localStorage.getItem('currentWeekType')) || this.weekTypes[0];
       this.groupName = localStorage.getItem('groupName');
       this.updateGroupData();
     };
     reader.readAsBinaryString(evt.files[0]);*/
  }

  getSelectedDay() {
    return this.scheduleService.dayOfWeek;
  }

  renderTable() {
    this.data = this.googleService.getSheet();
    const dataTransform = this.scheduleService.newTransform();
    this.groups = dataTransform.groups;
    this.teachers = dataTransform.teachers;
    this.groupOptions = _.map({...dataTransform.groups, ...dataTransform.teachers}, (val, key) => {
      return {
        label: key,
        value: key
      };
    });
    if (this.groupName) {
      this.renderSchedule();
    }
    this.loadingService.hide();
  }

  updateGroupData() {
    this.loadingService.show();
    localStorage.setItem('currentWeekType', JSON.stringify(this.currentWeekType.value || this.currentWeekType));
    this.googleService.setSheet(this.currentWeekType)
      .then(() => {
        this.renderTable();
      });
  }

  renderSchedule() {
    localStorage.setItem('groupName', this.groupName);
    this.schedule = this.groups[this.groupName] ? this.groups[this.groupName].schedule : this.teachers[this.groupName];
  }
}


text:
module common{

    export interface IView {
        open(): JQueryPromise<{}>;
        close(): JQueryPromise<{}>;
        intro(d?: JQueryDeferred<{}>): JQueryPromise<{}>;
        isOpen:boolean;
    }
}


text:
<?php

declare(strict_types=1);

namespace Incoming\Structure;

use ArrayIterator;
use ArrayObject;
use Incoming\Structure\Exception\ReadOnlyException;
use Incoming\Structure\Iterator\ReadOnlyIterator;
use InvalidArgumentException;
use Iterator;
use Traversable;

/**
 * A key => value, read-only map data-structure.
 */
class Map implements Structure
{

    /**
     * Properties
     */

    /**
     * The underlying decorated data structure.
     *
     * @var ArrayObject
     */
    private $decorated;

    /**
     * Methods
     */

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->decorated = new ArrayObject([], ArrayObject::ARRAY_AS_PROPS);
    }

    /**
     * Create from data in a Traversable instance.
     *
     * @param Traversable $data The data to create from.
     * @return static The resulting data-structure.
     * @throws InvalidArgumentException If the data contains non-scalar keys.
     */
    public static function fromTraversable(Traversable $data): self
    {
        $map = new static();

        foreach ($data as $key => $val) {
            if (!is_scalar($key)) {
                throw new InvalidArgumentException('Map keys must be scalar');
            }

            $map->decorated->offsetSet($key, $val);
        }

        return $map;
    }

    /**
     * Create from data in an array.
     *
     * @param array $data The data to create from.
     * @return static The resulting data-structure.
     */
    public static function fromArray(array $data): self
    {
        return static::fromTraversable(
            new ArrayIterator($data)
        );
    }

    /**
     * Check if a given key exists in the map.
     *
     * @param mixed $key The key to check for existence.
     * @return bool True if the key exists, false otherwise.
     */
    public function exists($key): bool
    {
        return $this->offsetExists($key);
    }

    /**
     * Get a value in the map by key.
     *
     * @param mixed $key The key to get the value for.
     * @param mixed $default_val The default value to return if the key does
     *  not exist.
     * @return mixed The resulting value.
     */
    public function get($key, $default_val = null)
    {
        if ($this->exists($key)) {
            return $this->offsetGet($key);
        }

        return $default_val;
    }

    /**
     * Check if the map is empty.
     *
     * @return bool True if the map is empty, false otherwise.
     */
    public function isEmpty(): bool
    {
        return ($this->count() === 0);
    }

    /**
     * Get an array list of all of the map's keys.
     *
     * @return array The list of the map's keys.
     */
    public function keys(): array
    {
        return array_keys(
            $this->toArray()
        );
    }

    /**
     * Get a representation of the map as an array.
     *
     * @return array The array representation of the map.
     */
    public function toArray(): array
    {
        return $this->decorated->getArrayCopy();
    }

    /**
     * Get the number of entries in the map.
     *
     * @return int The number of entries in the map.
     */
    public function count(): int
    {
        return count($this->decorated);
    }

    /**
     * Get an iterator instance over the underlying data.
     *
     * @return Iterator An iterator scoped to the map's data.
     */
    public function getIterator(): Iterator
    {
        return new ReadOnlyIterator(
            $this->decorated->getIterator()
        );
    }

    /**
     * Check whether an offset exists.
     *
     * @param mixed $offset The offset to check for.
     * @return bool True if the offset exists, false otherwise.
     */
    public function offsetExists($offset): bool
    {
        return $this->decorated->offsetExists($offset);
    }

    /**
     * Get the value at the given offset.
     *
     * @param mixed $offset The offset to get the value for.
     * @return mixed The resulting value.
     */
    public function offsetGet($offset)
    {
        return $this->decorated->offsetGet($offset);
    }

    /**
     * Set a value at the given offset.
     *
     * @internal
     *
     * @param mixed $offset The offset to set the value for.
     * @param mixed $value The value to set.
     * @throws ReadOnlyException External modification is not allowed.
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        throw ReadOnlyException::forAttribute($offset, $value);
    }

    /**
     * Remove the item at the given offset.
     *
     * @internal
     *
     * @param mixed $offset The offset to unset.
     * @throws ReadOnlyException External modification is not allowed.
     * @return void
     */
    public function offsetUnset($offset)
    {
        throw ReadOnlyException::forAttribute($offset);
    }

    /**
     * Magic "__isset" method.
     *
     * Allows access to the map's values via object property/field syntax.
     *
     * @param string $key The key to check for.
     * @return bool True if the key exists, false otherwise.
     */
    public function __isset(string $key): bool
    {
        return $this->exists($key);
    }

    /**
     * Magic "__get" method.
     *
     * Allows access to the map's values via object property/field syntax.
     *
     * @param string $key The key to get the value for.
     * @return mixed The resulting value.
     */
    public function __get(string $key)
    {
        return $this->get($key);
    }

    /**
     * Magic "__set" method.
     *
     * @internal
     *
     * @param string $key The key to set the value for.
     * @param mixed $value The value to set.
     * @throws ReadOnlyException External modification is not allowed.
     * @return void
     */
    public function __set(string $key, $value)
    {
        throw ReadOnlyException::forAttribute($key, $value);
    }

    /**
     * Magic "__unset" method.
     *
     * @internal
     *
     * @param string $key The key to unset.
     * @throws ReadOnlyException External modification is not allowed.
     * @return void
     */
    public function __unset(string $key)
    {
        throw ReadOnlyException::forAttribute($key);
    }
}


text:
using System.IO;
using Newtonsoft.Json;

namespace TerrificNet.Configuration
{
    static internal class TerrificNetHostConfigurationLoader
    {
        public static TerrificNetHostConfiguration LoadConfiguration(string path)
        {
            TerrificNetHostConfiguration configuration;
            using (var reader = new JsonTextReader(new StreamReader(path)))
            {
                configuration = new JsonSerializer().Deserialize<TerrificNetHostConfiguration>(reader);
            }

            foreach (var item in configuration.Applications)
            {
                item.Value.ApplicationName = item.Key;
            }

            return configuration;
        }
    }
}


text:
emulab-powervis Cookbook
========================

Install and configure powervis - the dashboard for interactive analysis and visualization of experiment power data on CloudLab.

powervis is developed by Dmitry Duplyakin (dmitry.duplyakin@colorado.edu) and hosted at: https://github.com/emulab/shiny-server

Requirements
------------

Requires emulab-shiny.

Attributes
----------

default['powervis']['repo'] points to the repo where powervis is hosted.

Usage
-----

default recipe should work as is (with the repo specified in attributes/default.rb)

Currently, this cookbook only works on x86 nodes (on aarch64 necessary packages are unavailable and need to be built from source).

Contributing
------------

To contribute, follow these steps:

1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github

License and Authors
-------------------

Authors: Dmitry Duplyakin (dmitry.duplyakin@colorado.edu)