text:
package org.cp.semaphores.tree;

import ch.aplu.turtle.Turtle;
import ch.aplu.turtle.TurtleFrame;
import org.cp.semaphores.fractal.path.FractalPath;

import javax.swing.*;
import java.awt.*;

/**
 * @author kornicameister
 * @version 0.0.1
 * @since 0.0.1
 */
public class TurtleFractalTree
        extends TurtleFrame
        implements FractalDrawable {

    private final boolean swapAngle;
    private       double  angle;
    private       int     step;
    private       Turtle  turtle;

    public TurtleFractalTree(final int step, final Integer angle, final boolean swapAngle) {
        super("Fractal", 3000, 3000);
        this.step = step;
        this.angle = angle;
        this.swapAngle = swapAngle;

        this.setVisible(true);

        this.initTurtle();
        this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);
    }

    private void initTurtle() {
        this.turtle = new Turtle(this, Color.BLACK);
        this.turtle.setAngleResolution(90);
        this.turtle.setHeading(90);
        this.turtle.hideTurtle();
        this.turtle.setPos(-500, -1000);
    }

    @Override
    public void updateDrawing(final FractalPath path) {
        for (FractalPath.FStep fStep : path) {
            switch (fStep) {
                case RIGHT_TURN:
                    this.turtle.right(this.angle);
                    break;
                case LEFT_TURN:
                    this.turtle.left(this.angle);
                    break;
                case LINE:
                case FORWARD:
                    this.turtle.fd(this.step);
                    break;
                case BACKWARD:
                    this.turtle.bk(this.step);
                    break;
            }
        }
        if (this.swapAngle) {
            this.angle *= -1;
        }
    }
}


text:
'use strict';

// add DOMPurify hook to sanitze attributes
DOMPurify.addHook('afterSanitizeAttributes', function(node) {
    // open all links in a new window
    if ('target' in node) {
        node.setAttribute('target', '_blank');
    }
});

// set listener for event from main window
window.onmessage = function(e) {
    var html = '';

    if (e.data.html) {
        // display html mail body
        html = e.data.html;
    } else if (e.data.text) {
        // diplay text mail body by with colored conversation nodes
        html = renderNodes(parseConversation(e.data.text));
    }

    // sanitize HTML content: https://github.com/cure53/DOMPurify
    if (e.data.removeImages) {
        // remove http leaks
        document.body.innerHTML = DOMPurify.sanitize(html, {
            FORBID_TAGS: ['style', 'svg', 'audio', 'video', 'math'],
            FORBID_ATTR: ['src']
        });
    } else {
        document.body.innerHTML = DOMPurify.sanitize(html);
    }

    attachClickHandlers();
};

/**
 * Send a message to the main window when email address is clicked
 */
function attachClickHandlers() {
    var elements = document.getElementsByTagName('a');
    for (var i = 0, len = elements.length; i < len; i++) {
        elements[i].onclick = handle;
    }

    function handle(e) {
        var text = e.target.textContent || e.target.innerText;
        if (checkEmailAddress(text)) {
            e.preventDefault();
            window.parentIFrame.sendMessage({
                type: 'email',
                address: text
            });
        }
    }

    function checkEmailAddress(text) {
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(text);
    }
}

/**
 * Parse email body and generate conversation nodes
 * @param  {Object} email The email object
 * @return {Node}       The root node of the conversion
 */
function parseConversation(textBody) {
    var nodes;

    function parseLines(body) {
        var lines = [];
        body.split('\n').forEach(parseLine);

        function parseLine(line) {
            var regex = /^>*/;
            var result = regex.exec(line);

            lines.push({
                text: line.replace(regex, '').trim(),
                level: (result && result.length > 0) ? result[0].length : 0
            });
        }

        return lines;
    }

    function buildTextNodes(lines) {
        var i, j, root, currentLevel, currentNode, levelDelta;

        root = new Node();
        currentLevel = 0;
        currentNode = root;

        // iterate over text lines
        for (i = 0; i < lines.length; i++) {
            levelDelta = lines[i].level - currentLevel;

            if (levelDelta === 0) {
                // we are at the desired node ... no traversal required
            } else if (levelDelta > 0) {
                // traverse to child node(s)
                for (j = 0; j < levelDelta; j++) {
                    var newChild = new Node(currentNode);
                    // create new child node
                    currentNode.children.push(newChild);
                    // go to last child node
                    currentNode = newChild;
                    // increase current level by one
                    currentLevel++;
                }
            } else {
                // traverse to parent(s)
                for (j = levelDelta; j < 0; j++) {
                    currentNode = currentNode.parent;
                    currentLevel--;
                }
            }

            // add text to the current node
            currentNode.addLine(lines[i].text);
        }

        return root;
    }

    function Node(parent) {
        this.parent = parent;
        this.children = [];
    }
    Node.prototype.addLine = function(lineText) {
        var c, l;

        c = this.children;
        l = c.length;

        // append text node to children if last child is not a text node
        if (l < 1 || typeof c[l - 1] !== 'string') {
            c[l] = '';
            l = c.length;
        }

        // append line to last child (add newline between lines)
        c[l - 1] += lineText + '\n';
    };

    function removeParentReference(node) {
        if (!node.children) {
            // this is a text leaf ... terminate recursion
            return;
        }

        // remove parent node to prevent infinite loop in JSON stringify
        delete node.parent;

        for (var i = 0; i < node.children.length; i++) {
            if (typeof node.children[i] === 'string') {
                // remove trailing newline in string
                node.children[i] = node.children[i].replace(/\n$/, '');
            } else {
                // I used recursion ...
                removeParentReference(node.children[i]);
            }
        }
    }

    nodes = buildTextNodes(parseLines(textBody.replace(/ >/g, '>')));
    removeParentReference(nodes);

    return nodes;
}

/**
 * Render the conversation nodes as markup. This is not injected directly into the DOM, but rather send to a sandboxed iframe to be rendered
 * @param  {Node} root The conversation root node
 * @return {Strin}      The conversation as markup
 */
function renderNodes(root) {
    var body = '';

    function render(node) {
        var i, html = '';
        if (!node.children) {
            // this is a text leaf
            var lines = node.split('\n');
            for (i = 0; i < lines.length; i++) {
                // replace all urls with anchors
                lines[i] = lines[i].replace(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g, createArchor);
                // wrap line into an element for easier styling
                html += '
' + lines[i] + '

';
            }
            return html;
        }

        for (i = 0; i < node.children.length; i++) {
            html += '
' + render(node.children[i]) + '
';
        }

        return html;
    }

    function createArchor(url) {
        return '' + url + '';
    }

    function isLineEmpty(line) {
        return line.replace(/>/g, '').trim().length === 0;
    }

    for (var j = 0; j < root.children.length; j++) {
        // start by rendering the root nodes children
        body += render(root.children[j]);
    }

    return '
' + body + '
';
}

redpajama_set_name: RedPajamaGithub


text:
	/////// //////////////////
	/////// PROJECT: MTA iLife - German Fun Reallife Gamemode
	/////// VERSION: 1.7.2
	/////// DEVELOPERS: See DEVELOPERS.md in the top folder
	/////// LICENSE: See LICENSE.md in the top folder
	/////// /////////////////
]]

-- Muss beizeiten nochmal komplett Neugeschrieben werden, in eine Singleton Managerklasse integrieren und die statischen Funktionsaufrufe entfernen

function trimTextIntoLines(text, maxLettersPerRow)
	local words 	= {}
    local i			= 1
    while (gettok(text,i, " ") ~= false) do
        words[i] = gettok(text, i , " ")
        i = i+1;
    end

    local count		= 0
    text 			= ""

    for index, value in pairs(words) do
        count = count + #value
        if (count > maxLettersPerRow) then
            text = text.."\n"..value.." "
            count = 0
        else
            text = text..value.." "
        end

    end
    return text
end

addEventHandler("onClientResourceStart", getRootElement(),
	function(startedResource)
		if (startedResource == getThisResource()) then
			billboardLarge = dxCreateShader("res/shader/texture.fx")
			dxSetShaderValue(billboardLarge,"Tex",dxCreateTexture("res/images/board.png"))

			engineApplyShaderToWorldTexture(billboardLarge,"eris_2")
			engineApplyShaderToWorldTexture(billboardLarge,"diderSachs01")
			engineApplyShaderToWorldTexture(billboardLarge,"cokopops_1")
			engineApplyShaderToWorldTexture(billboardLarge,"homies_1")
			engineApplyShaderToWorldTexture(billboardLarge,"homies_2")
			engineApplyShaderToWorldTexture(billboardLarge,"heat_01")
			engineApplyShaderToWorldTexture(billboardLarge,"heat_02")
			engineApplyShaderToWorldTexture(billboardLarge,"heat_03")
			engineApplyShaderToWorldTexture(billboardLarge,"heat_04")
			--engineApplyShaderToWorldTexture(billboardLarge,"ads003 copy")
			engineApplyShaderToWorldTexture(billboardLarge,"hardon_1")
			engineApplyShaderToWorldTexture(billboardLarge,"eris_1")
			engineApplyShaderToWorldTexture(billboardLarge,"prolaps01")
			engineApplyShaderToWorldTexture(billboardLarge,"bobo_3")
			engineApplyShaderToWorldTexture(billboardLarge,"bobo_2")
			engineApplyShaderToWorldTexture(billboardLarge,"bobo_1")
			engineApplyShaderToWorldTexture(billboardLarge,"eris_3")
			engineApplyShaderToWorldTexture(billboardLarge,"billbd1_lae")
			engineApplyShaderToWorldTexture(billboardLarge,"bobobillboard1")
			engineApplyShaderToWorldTexture(billboardLarge,"semi1dirty")
			engineApplyShaderToWorldTexture(billboardLarge,"semi2dirty")
			engineApplyShaderToWorldTexture(billboardLarge,"semi3dirty")
			engineApplyShaderToWorldTexture(billboardLarge,"downtsign12_la")
			engineApplyShaderToWorldTexture(billboardLarge,"prolaps02")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_sprunk_front2")
			engineApplyShaderToWorldTexture(billboardLarge,"zombiegeddon")
			engineApplyShaderToWorldTexture(billboardLarge,"victim_bboard")
			engineApplyShaderToWorldTexture(billboardLarge,"ws_starballs")
			engineApplyShaderToWorldTexture(billboardLarge,"sunbillb03")
			engineApplyShaderToWorldTexture(billboardLarge,"sunbillb10")
			engineApplyShaderToWorldTexture(billboardLarge,"dogbill01")
			engineApplyShaderToWorldTexture(billboardLarge,"base5_1")
			engineApplyShaderToWorldTexture(billboardLarge,"eris_5")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_bs_menu1")
			engineApplyShaderToWorldTexture(billboardLarge,"24hoursign1_lawn")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_sex_sign1")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_zip_1")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_pizza_men1")
			engineApplyShaderToWorldTexture(billboardLarge,"gun_xtra4")
			engineApplyShaderToWorldTexture(billboardLarge,"cj_bobo")
			engineApplyShaderToWorldTexture(billboardLarge,"rodesign02_la")

			--[[
			engineApplyShaderToWorldTexture(billboardLarge,"snpedtest1")
			engineApplyShaderToWorldTexture(billboardLarge,"shad_ped")
			engineApplyShaderToWorldTexture(billboardLarge,"newsvan92decal128")
			]]
			--heat_02,, cokopos_1, eris_2, homies_2, hardon_1, eris_1, diderSachs01, homies_2, , bobo_2
		end
	end
)

Ads = {}

CurrentAd = 1

addEvent("onClientRecieveAd", true)

addEventHandler("onClientRecieveAd", getRootElement(),
	function(tAds)
		Ads = tAds

		for k,v in ipairs(Ads) do
			v["Text"] = string.gsub(v["Text"], "\\oe", "ö")
			v["Text"] = string.gsub(v["Text"], "\\ae", "ä")
			v["Text"] = string.gsub(v["Text"], "\\ue", "ü")
			v["Text"] = string.gsub(v["Text"], "\\n", "\n")
			v["Text"] = string.gsub(v["Text"], "\\sz", "ß")
			v["Text"] = string.gsub(v["Text"], "\\Oe", "Ö")
			v["Text"] = string.gsub(v["Text"], "\\Ae", "Ä")
			v["Text"] = string.gsub(v["Text"], "\\Ue", "Ü")
			v["Name"] = string.gsub(v["Name"], "\\oe", "ö")
			v["Name"] = string.gsub(v["Name"], "\\ae", "ä")
			v["Name"] = string.gsub(v["Name"], "\\ue", "ü")
			v["Name"] = string.gsub(v["Name"], "\\n", "\n")
			v["Name"] = string.gsub(v["Name"], "\\sz", "ß")
			v["Name"] = string.gsub(v["Name"], "\\Oe", "Ö")
			v["Name"] = string.gsub(v["Name"], "\\Ae", "Ä")
			v["Name"] = string.gsub(v["Name"], "\\Ue", "Ü")
		end
	end
)

addEventHandler("onClientResourceStart", getRootElement(),
	function(startedResource)
		if (startedResource == getThisResource()) then
			triggerServerEvent("onClientRequestAds", getLocalPlayer(), getLocalPlayer())

			setTimer(
				function()
					triggerServerEvent("onClientRequestAds", getLocalPlayer(), getLocalPlayer())
				end
			,60000, 0)

			setTimer(
				function()
					if (#Ads > CurrentAd) then
						CurrentAd = CurrentAd+1
					else
						CurrentAd = 1
					end

					local sizex, sizey = 2, 2

					if(toboolean(config:getConfig("lowrammode"))) then
						sizex, sizey = 0.5, 0.5
					end

					local ta = dxCreateRenderTarget(550*sizex, 270*sizey)
					if(ta) then
						dxSetRenderTarget(ta, true)

						dxDrawImage(0,0, 550*sizex, 270*sizey,"res/images/board.png")
						if (Ads[CurrentAd]) then
							if (not(Ads[CurrentAd]["Telephone"])) then
								Ads[CurrentAd]["Telephone"] = "-"
							end
							dxDrawText(Ads[CurrentAd]["Name"] --[[.." (Tel. "..Ads[CurrentAd]["Telephone"]..")"]], 20*sizex, 0, 520*sizex, 60*sizey, tocolor(0, 0, 0), 2*sizex, "default-bold", "left", "center", true, true)
							dxDrawText(Ads[CurrentAd]["Text"], 20*sizex, 70*sizey, 520*sizex, 260*sizey, tocolor(0, 0, 0), 2*sizex, "default-bold", "left", "top", true, true)

							dxSetRenderTarget()

							dxSetShaderValue(billboardLarge,"Tex",ta)

						end

						destroyElement(ta)
					end
				end, 15000, 0
			)
		end
	end
)


text:
package org.epnoi.storage.graph.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.epnoi.storage.graph.domain.relationships.ContainedDocument;
import org.epnoi.storage.graph.domain.relationships.SimilarDomain;
import org.epnoi.storage.model.Domain;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.Index;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by cbadenes on 22/12/15.
 */
@NodeEntity(label = "Domain")
@Data
@EqualsAndHashCode(of={"uri"})
@ToString(of={"uri"})
public class DomainNode extends Domain {

    @GraphId
    private Long id;

    @Index(unique = true)
    private String uri;

    @Relationship(type = "SIMILAR_TO", direction="UNDIRECTED")
    private Set<SimilarDomain> domains = new HashSet<>();

    @Relationship(type = "CONTAINS", direction="OUTGOING")
    private Set<ContainedDocument> documents = new HashSet<>();

    public void addSimilarDomain(SimilarDomain similarDomain){
        domains.add(similarDomain);
    }

    public void addContainedDocument(ContainedDocument containedDocument){
        documents.add(containedDocument);
    }

}


text:
package herddb.mem;

import java.io.IOException;
import java.nio.file.Path;

import herddb.server.LocalNodeIdManager;

/**
 * In memory LocalNodeIdManager, for tests
 *
 * @author diego.salvi
 */
public class MemoryLocalNodeIdManager extends LocalNodeIdManager {

    public MemoryLocalNodeIdManager(Path dataPath) {
        super(dataPath);
    }

    @Override
    public void persistLocalNodeId(String nodeId) throws IOException {
        /* NOP */
    }

}


text:
package graceful

import (
	"context"
	"errors"
	"os"
	"os/signal"
	"sync"
	"syscall"
	"time"

	"code.gitea.io/gitea/modules/log"
	"code.gitea.io/gitea/modules/setting"
)

// Manager manages the graceful shutdown process
type Manager struct {
	isChild                bool
	forked                 bool
	lock                   *sync.RWMutex
	state                  state
	shutdownCtx            context.Context
	hammerCtx              context.Context
	terminateCtx           context.Context
	doneCtx                context.Context
	shutdownCtxCancel      context.CancelFunc
	hammerCtxCancel        context.CancelFunc
	terminateCtxCancel     context.CancelFunc
	doneCtxCancel          context.CancelFunc
	runningServerWaitGroup sync.WaitGroup
	createServerWaitGroup  sync.WaitGroup
	terminateWaitGroup     sync.WaitGroup

	toRunAtShutdown  []func()
	toRunAtHammer    []func()
	toRunAtTerminate []func()
}

func newGracefulManager(ctx context.Context) *Manager {
	manager := &Manager{
		isChild: len(os.Getenv(listenFDs)) > 0 && os.Getppid() > 1,
		lock:    &sync.RWMutex{},
	}
	manager.createServerWaitGroup.Add(numberOfServersToCreate)
	manager.start(ctx)
	return manager
}

func (g *Manager) start(ctx context.Context) {
	// Make contexts
	g.terminateCtx, g.terminateCtxCancel = context.WithCancel(ctx)
	g.shutdownCtx, g.shutdownCtxCancel = context.WithCancel(ctx)
	g.hammerCtx, g.hammerCtxCancel = context.WithCancel(ctx)
	g.doneCtx, g.doneCtxCancel = context.WithCancel(ctx)

	// Set the running state & handle signals
	g.setState(stateRunning)
	go g.handleSignals(ctx)

	// Handle clean up of unused provided listeners	and delayed start-up
	startupDone := make(chan struct{})
	go func() {
		defer close(startupDone)
		// Wait till we're done getting all of the listeners and then close
		// the unused ones
		g.createServerWaitGroup.Wait()
		// Ignore the error here there's not much we can do with it
		// They're logged in the CloseProvidedListeners function
		_ = CloseProvidedListeners()
	}()
	if setting.StartupTimeout > 0 {
		go func() {
			select {
			case <-startupDone:
				return
			case <-g.IsShutdown():
				func() {
					// When waitgroup counter goes negative it will panic - we don't care about this so we can just ignore it.
					defer func() {
						_ = recover()
					}()
					// Ensure that the createServerWaitGroup stops waiting
					for {
						g.createServerWaitGroup.Done()
					}
				}()
				return
			case <-time.After(setting.StartupTimeout):
				log.Error("Startup took too long! Shutting down")
				g.doShutdown()
			}
		}()
	}
}

func (g *Manager) handleSignals(ctx context.Context) {
	signalChannel := make(chan os.Signal, 1)

	signal.Notify(
		signalChannel,
		syscall.SIGHUP,
		syscall.SIGUSR1,
		syscall.SIGUSR2,
		syscall.SIGINT,
		syscall.SIGTERM,
		syscall.SIGTSTP,
	)

	pid := syscall.Getpid()
	for {
		select {
		case sig := <-signalChannel:
			switch sig {
			case syscall.SIGHUP:
				log.Info("PID: %d. Received SIGHUP. Attempting GracefulRestart...", pid)
				g.DoGracefulRestart()
			case syscall.SIGUSR1:
				log.Warn("PID %d. Received SIGUSR1. Releasing and reopening logs", pid)
				if err := log.ReleaseReopen(); err != nil {
					log.Error("Error whilst releasing and reopening logs: %v", err)
				}
			case syscall.SIGUSR2:
				log.Warn("PID %d. Received SIGUSR2. Hammering...", pid)
				g.DoImmediateHammer()
			case syscall.SIGINT:
				log.Warn("PID %d. Received SIGINT. Shutting down...", pid)
				g.DoGracefulShutdown()
			case syscall.SIGTERM:
				log.Warn("PID %d. Received SIGTERM. Shutting down...", pid)
				g.DoGracefulShutdown()
			case syscall.SIGTSTP:
				log.Info("PID %d. Received SIGTSTP.", pid)
			default:
				log.Info("PID %d. Received %v.", pid, sig)
			}
		case <-ctx.Done():
			log.Warn("PID: %d. Background context for manager closed - %v - Shutting down...", pid, ctx.Err())
			g.DoGracefulShutdown()
		}
	}
}

func (g *Manager) doFork() error {
	g.lock.Lock()
	if g.forked {
		g.lock.Unlock()
		return errors.New("another process already forked. Ignoring this one")
	}
	g.forked = true
	g.lock.Unlock()
	// We need to move the file logs to append pids
	setting.RestartLogsWithPIDSuffix()

	_, err := RestartProcess()

	return err
}

// DoGracefulRestart causes a graceful restart
func (g *Manager) DoGracefulRestart() {
	if setting.GracefulRestartable {
		log.Info("PID: %d. Forking...", os.Getpid())
		err := g.doFork()
		if err != nil && err.Error() != "another process already forked. Ignoring this one" {
			log.Error("Error whilst forking from PID: %d : %v", os.Getpid(), err)
		}
	} else {
		log.Info("PID: %d. Not set restartable. Shutting down...", os.Getpid())

		g.doShutdown()
	}
}

// DoImmediateHammer causes an immediate hammer
func (g *Manager) DoImmediateHammer() {
	g.doHammerTime(0 * time.Second)
}

// DoGracefulShutdown causes a graceful shutdown
func (g *Manager) DoGracefulShutdown() {
	g.doShutdown()
}

// RegisterServer registers the running of a listening server, in the case of unix this means that the parent process can now die.
// Any call to RegisterServer must be matched by a call to ServerDone
func (g *Manager) RegisterServer() {
	KillParent()
	g.runningServerWaitGroup.Add(1)
}


text:
import React from 'react';
import Utils from '../utils/utils';
import __reactComponentSetProps from '../runtime-helpers/react-component-set-props.js';

class F7FabBackdrop extends React.Component {
  constructor(props, context) {
    super(props, context);
  }

  render() {
    const self = this;
    const props = self.props;
    const {
      className,
      id,
      style
    } = props;
    const classes = Utils.classNames(className, 'fab-backdrop');
    return React.createElement('div', {
      id: id,
      style: style,
      className: classes
    });
  }

}

__reactComponentSetProps(F7FabBackdrop, {
  id: [String, Number],
  className: String,
  style: Object
});

F7FabBackdrop.displayName = 'f7-fab-backdrop';
export default F7FabBackdrop;


text:
<?php

define('SABRE_MYSQLDSN','mysql:host=127.0.0.1;dbname=sabredav');
define('SABRE_MYSQLUSER','root');
define('SABRE_MYSQLPASS','');

set_include_path(__DIR__ . '/../lib/' . PATH_SEPARATOR . __DIR__ . PATH_SEPARATOR . get_include_path());

include __DIR__ . '/../vendor/autoload.php';
include 'Sabre/TestUtil.php';
include 'Sabre/DAVServerTest.php';

date_default_timezone_set('UTC');

define("SABRE_TEMPDIR",dirname(__FILE__) . '/temp/');

// If sqlite is not available, this constant is used to skip the relevant
// tests
define('SABRE_HASSQLITE',in_array('sqlite',PDO::getAvailableDrivers()));
define('SABRE_HASMYSQL', in_array('mysql',PDO::getAvailableDrivers()) && defined('SABRE_MYSQLDSN') && defined('SABRE_MYSQLUSER') && defined('SABRE_MYSQLPASS'));

if (!file_exists(SABRE_TEMPDIR)) mkdir(SABRE_TEMPDIR);
if (file_exists('.sabredav')) unlink('.sabredav');


text:
UCLASS()
class UFlareScalingRule : public UDPICustomScalingRule
{
	GENERATED_BODY()

public:

	virtual float GetDPIScaleBasedOnSize(FIntPoint Size) const override;

};


text:
package predicates

import (
	"fmt"

	"k8s.io/api/core/v1"
)

var (
	// The predicateName tries to be consistent as the predicate name used in DefaultAlgorithmProvider defined in
	// defaults.go (which tend to be stable for backward compatibility)

	// NOTE: If you add a new predicate failure error for a predicate that can never
	// be made to pass by removing pods, or you change an existing predicate so that
	// it can never be made to pass by removing pods, you need to add the predicate
	// failure error in nodesWherePreemptionMightHelp() in scheduler/core/generic_scheduler.go
	ErrDiskConflict                          = newPredicateFailureError("NoDiskConflict")
	ErrVolumeZoneConflict                    = newPredicateFailureError("NoVolumeZoneConflict")
	ErrNodeSelectorNotMatch                  = newPredicateFailureError("MatchNodeSelector")
	ErrPodAffinityNotMatch                   = newPredicateFailureError("MatchInterPodAffinity")
	ErrPodAffinityRulesNotMatch              = newPredicateFailureError("PodAffinityRulesNotMatch")
	ErrPodAntiAffinityRulesNotMatch          = newPredicateFailureError("PodAntiAffinityRulesNotMatch")
	ErrExistingPodsAntiAffinityRulesNotMatch = newPredicateFailureError("ExistingPodsAntiAffinityRulesNotMatch")
	ErrTaintsTolerationsNotMatch             = newPredicateFailureError("PodToleratesNodeTaints")
	ErrPodNotMatchHostName                   = newPredicateFailureError("HostName")
	ErrPodNotFitsHostPorts                   = newPredicateFailureError("PodFitsHostPorts")
	ErrNodeLabelPresenceViolated             = newPredicateFailureError("CheckNodeLabelPresence")
	ErrServiceAffinityViolated               = newPredicateFailureError("CheckServiceAffinity")
	ErrMaxVolumeCountExceeded                = newPredicateFailureError("MaxVolumeCount")
	ErrNodeUnderMemoryPressure               = newPredicateFailureError("NodeUnderMemoryPressure")
	ErrNodeUnderDiskPressure                 = newPredicateFailureError("NodeUnderDiskPressure")
	ErrNodeOutOfDisk                         = newPredicateFailureError("NodeOutOfDisk")
	ErrNodeNotReady                          = newPredicateFailureError("NodeNotReady")
	ErrNodeNetworkUnavailable                = newPredicateFailureError("NodeNetworkUnavailable")
	ErrNodeUnschedulable                     = newPredicateFailureError("NodeUnschedulable")
	ErrNodeUnknownCondition                  = newPredicateFailureError("NodeUnknownCondition")
	ErrVolumeNodeConflict                    = newPredicateFailureError("VolumeNodeAffinityConflict")
	ErrVolumeBindConflict                    = newPredicateFailureError("VolumeBindingNoMatch")
	// ErrFakePredicate is used for test only. The fake predicates returning false also returns error
	// as ErrFakePredicate.
	ErrFakePredicate = newPredicateFailureError("FakePredicateError")
)

// InsufficientResourceError is an error type that indicates what kind of resource limit is
// hit and caused the unfitting failure.
type InsufficientResourceError struct {
	// resourceName is the name of the resource that is insufficient
	ResourceName v1.ResourceName
	requested    int64
	used         int64
	capacity     int64
}

func NewInsufficientResourceError(resourceName v1.ResourceName, requested, used, capacity int64) *InsufficientResourceError {
	return &InsufficientResourceError{
		ResourceName: resourceName,
		requested:    requested,
		used:         used,
		capacity:     capacity,
	}
}

func (e *InsufficientResourceError) Error() string {
	return fmt.Sprintf("Node didn't have enough resource: %s, requested: %d, used: %d, capacity: %d",
		e.ResourceName, e.requested, e.used, e.capacity)
}

func (e *InsufficientResourceError) GetReason() string {
	return fmt.Sprintf("Insufficient %v", e.ResourceName)
}

func (e *InsufficientResourceError) GetInsufficientAmount() int64 {
	return e.requested - (e.capacity - e.used)
}

type PredicateFailureError struct {
	PredicateName string
}

func newPredicateFailureError(predicateName string) *PredicateFailureError {
	return &PredicateFailureError{PredicateName: predicateName}
}

func (e *PredicateFailureError) Error() string {
	return fmt.Sprintf("Predicate %s failed", e.PredicateName)
}

func (e *PredicateFailureError) GetReason() string {
	return e.PredicateName
}

type FailureReason struct {
	reason string
}

func NewFailureReason(msg string) *FailureReason {
	return &FailureReason{reason: msg}
}

func (e *FailureReason) GetReason() string {
	return e.reason
}


text:
GitHub for Unity provides access to a git client to help users create their own tools to assist in their workflow.

Users can separate the user interface from the API by removing `GitHub.Unity.dll`. All other libraries are required by the API.

## Creating an instance of `GitClient`
```cs
var defaultEnvironment = new DefaultEnvironment();
defaultEnvironment.Initialize(null, NPath.Default, NPath.Default, NPath.Default, Application.dataPath.ToNPath());

var processEnvironment = new ProcessEnvironment(defaultEnvironment);
var processManager = new ProcessManager(defaultEnvironment, processEnvironment, TaskManager.Instance.Token);

var gitClient = new GitClient(defaultEnvironment, processManager, TaskManager.Instance.Token);
```

## Full Example
This example creates a window that has a single button which commits all changes.
```cs
using System;
using System.Globalization;
using GitHub.Unity;
using UnityEditor;
using UnityEngine;

public class CustomGitEditor : EditorWindow
{
    [MenuItem("Window/Custom Git")]
    public static void ShowWindow()
    {
        EditorWindow.GetWindow(typeof(CustomGitEditor));
    }

    [NonSerialized] private GitClient gitClient;

    public void OnEnable()
    {
        InitGitClient();
    }

    private void InitGitClient()
    {
        if (gitClient != null) return;

        Debug.Log("Init GitClient");

        var defaultEnvironment = new DefaultEnvironment();
        defaultEnvironment.Initialize(null, NPath.Default, NPath.Default,
            NPath.Default, Application.dataPath.ToNPath());

        var processEnvironment = new ProcessEnvironment(defaultEnvironment);
        var processManager = new ProcessManager(defaultEnvironment, processEnvironment, TaskManager.Instance.Token);

        gitClient = new GitClient(defaultEnvironment, processManager, TaskManager.Instance.Token);
    }

    void OnGUI()
    {
        GUILayout.Label("Custom Git Window", EditorStyles.boldLabel);

        if (GUILayout.Button("Commit Stuff"))
        {
            var message = DateTime.Now.ToString(CultureInfo.InvariantCulture);
            var body = string.Empty;

            gitClient.AddAll()
                .Then(gitClient.Commit(message, body))
                .Start();
        }
    }
}
```


text:
/// <reference path="../../Assets/Sizes/Size2d.ts" />
/// <reference path="../../Assets/Vectors/Vector2d.ts" />
/// <reference path="../../Bounds/BoundingRectangle.ts" />
/// <reference path="Shape.ts" />

module EndGate.Graphics {

    /**
    * Defines a drawable rectangle.
    */
    export class Rectangle extends Abstractions.Shape {
        public _type: string = "Rectangle";

        /**
        * Gets or sets the Size of the Rectangle.
        */
        public Size: Size2d;

        /**
        * Creates a new instance of the Rectangle object.
        * @param x Initial horizontal location of the Rectangle.
        * @param y Initial vertical location of the Rectangle.
        * @param width Initial width of the Rectangle.
        * @param height Initial height of the Rectangle.
        */
        constructor(x: number, y: number, width: number, height: number);
        /**
        * Creates a new instance of the Rectangle object with a specified color.
        * @param x Initial horizontal location of the Rectangle.
        * @param y Initial vertical location of the Rectangle.
        * @param width Initial width of the Rectangle.
        * @param height Initial height of the Rectangle.
        * @param color Initial color of the Rectangle.
        */
        constructor(x: number, y: number, width: number, height: number, color: string);
        constructor(x: number, y: number, width: number, height: number, color?: string) {
            super(new Vector2d(x, y), color);

            this.Size = new Size2d(width, height);
        }

        /**
        * The bounding area that represents where the Rectangle will draw.
        */
        public GetDrawBounds(): Bounds.Abstractions.Bounds2d {
            var bounds = new Bounds.BoundingRectangle(this.Position, this.Size);

            bounds.Rotation = this.Rotation;

            return bounds;
        }

        public _BuildPath(context: CanvasRenderingContext2D): void {
            context.rect(-this.Size.HalfWidth, -this.Size.HalfHeight, this.Size.Width, this.Size.Height);
        }
    }

}


text:
try:
    xrange          # Python 2
except NameError:
    xrange = range  # Python 3

class Solution:
    # @param {string} s
    # @return {integer}
    def calculate(self, s):
        operands, operators = [], []
        operand = ""
        for i in reversed(xrange(len(s))):
            if s[i].isdigit():
                operand += s[i]
                if i == 0 or not s[i-1].isdigit():
                    operands.append(int(operand[::-1]))
                    operand = ""
            elif s[i] == ')' or s[i] == '*' or s[i] == '/':
                operators.append(s[i])
            elif s[i] == '+' or s[i] == '-':
                while operators and \
                      (operators[-1] == '*' or operators[-1] == '/'):
                    self.compute(operands, operators)
                operators.append(s[i])
            elif s[i] == '(':
                while operators[-1] != ')':
                    self.compute(operands, operators)
                operators.pop()

        while operators:
            self.compute(operands, operators)

        return operands[-1]

    def compute(self, operands, operators):
        left, right = operands.pop(), operands.pop()
        op = operators.pop()
        if op == '+':
            operands.append(left + right)
        elif op == '-':
            operands.append(left - right)
        elif op == '*':
            operands.append(left * right)
        elif op == '/':
            operands.append(left / right)


text:
#define DEBUG 0

#include <iostream>
#include <sstream>
#include <fstream>
#include <iterator>
#include <string>
#include <algorithm>

#include <unistd.h>

#include <image.h>
#include <xmlwriter.h>
#include <jsonwriter.h>

#include <base64.h>

using namespace std;

unsigned int nextPow2(unsigned int n) {
    --n;
    n |= n >> 1;
    n |= n >> 2;
    n |= n >> 4;
    n |= n >> 8;
    n |= n >> 16;

    return ++n;
}

static void usage(const string& bin) {
    cerr << "Usage: " << bin << " <option(s)> SOURCES" << endl
         << "Options:" << endl
         << "\t-v\t\tShow verbose output" << endl
         << "\t-t\t\tTrim images" << endl
         << "\t-p\t\tMake output square and sidelength pow2" << endl
         << "\t-b\t\tDraw bounding boxes" << endl
         << "\t-o FILENAME\tOutput filename" << endl
         << "\t-f FORMAT\tOutput format" << endl;
}

int main(int argc, char **argv)
{
    if (argc <= 1) {
        usage(argv[0]);
        return 0;
    }

    bool VERBOSE = false;
    bool TRIM = false;
    bool POW2 = false;
    bool BOUNDS = false;
    string OUTPUT_NAME = string("output");
    int OUTPUT_FORMAT = 0;

    // Command line parsing
    opterr = 1;
    int c;

    while ((c = getopt(argc, argv, "vtbo:f:")) != -1) {
        switch(c) {
            case 'v':
                VERBOSE = true;
                break;
            case 't':
                TRIM = true;
                break;
            case 'b':
                BOUNDS = true;
                break;
            case 'o':
                OUTPUT_NAME = string(optarg);
                break;
            case 'f':
                cout << "Optarg at -f: " << optarg << endl;
                if (!strcmp("xml", optarg))
                    OUTPUT_FORMAT = 0;
                else if (!strcmp("plist", optarg))
                    OUTPUT_FORMAT = 1;
                else if (!strcmp("sprite", optarg))
                    OUTPUT_FORMAT = 2;
                else if (!strcmp("json", optarg))
                    OUTPUT_FORMAT = 3;
            default:
                break;
        }
    }

#if DEBUG
    cout << "Options:" << endl
         << "\tverbose: " << VERBOSE << endl
         << "\ttrim: " << TRIM << endl
         << "\toutput_name: " << OUTPUT_NAME << endl
         << "\toutput_format: " << OUTPUT_FORMAT << endl;
#endif

    // Iterate through arguments
    vector<image> input;
    for (int i = optind; i < argc; ++i) {
        string path(argv[i]);
        string filename = path.substr(path.find_last_of("/\\") + 1);

        if (VERBOSE) {
            cout << "Loading image: " << filename << endl;
        }

        image new_image(filename);
        new_image.read_file(argv[i]);

        if (new_image.size().width != 0
            && new_image.size().height != 0)
               input.push_back(new_image);
    }

    if (TRIM) {
        // Trim images
        cout << "Trimming..." << endl;
        for (image& current_image : input)
            current_image.trim();
    }

    if (BOUNDS) {
        // Draw bounding boxes
        cout << "Drawing bounds..." << endl;
        for (image& current_image : input)
            current_image.draw_bounds();
    }

    if (input.size() <= 1)
        cout << "More than 1 image required.";
    else {
        cout << "Merging..." << endl;

        sort(input.begin(), input.end(), image::compare_area);

        vector<Pos> free_anchors;
        vector<Pos> abs_anchors;

        free_anchors.push_back(Pos());

        for (unsigned int i = 0; i < input.size(); ++i) {
            // set next image anchor to current
            // smallest anchor point
            abs_anchors.push_back(free_anchors.front());

            // find new anchors
            Pos new_anchor_right(free_anchors.front().x
                                 + input.at(i).size().width,
                                 free_anchors.front().y);
            Pos new_anchor_bot(free_anchors.front().x,
                               free_anchors.front().y
                               + input.at(i).size().height);

            // still finding new anchors
            for (int j = 1; j < free_anchors.size(); ++j) {
                if ((free_anchors.at(j).x
                     >= free_anchors.front().x) &&
                    (free_anchors.at(j).x <= new_anchor_right.x)) {
                    new_anchor_right.y = min(new_anchor_right.y,
                                             free_anchors.at(j).y);
                    free_anchors.erase(free_anchors.begin() + j);
                    continue;
                }
                if ((free_anchors.at(j).y
                     >= free_anchors.front().y) &&
                    (free_anchors.at(j).y <= new_anchor_bot.y)) {
                    new_anchor_bot.x = min(new_anchor_bot.x,
                                           free_anchors.at(j).x);
                    free_anchors.erase(free_anchors.begin() + j);
                    continue;
                }
            }

            // remove first, add new anchors
            free_anchors.erase(free_anchors.begin());
            free_anchors.push_back(new_anchor_right);
            free_anchors.push_back(new_anchor_bot);

            // re-sort anchors
            sort(free_anchors.begin(), free_anchors.end(), Pos::compare);

        }

        int x = 0;

#if DEBUG
        for (Pos& current_anchor : abs_anchors)
            cout << ++x
                 << ": absolute anchor x: "
                 << current_anchor.x
                 << " y: "
                 << current_anchor.y
                 << " sum: "
                 << current_anchor.x + current_anchor.y
                 << endl;
#endif

        unsigned int side_length_x = 0;
        unsigned int side_length_y = 0;

        for (Pos& current_anchor : free_anchors) {
            side_length_x = max(side_length_x, current_anchor.x);
            side_length_y = max(side_length_y, current_anchor.y);
        }

        cout << "biggest side length x is "
             << side_length_x
             << endl;
        cout << "biggest side length y is "
             << side_length_y
             << endl;

        if (POW2) {
            unsigned int side_length = max(nextPow2(side_length_x), nextPow2(side_length_x));
            side_length_x = side_length_y = side_length;
            cout << "Pow2 side length is " << side_length << endl;
        }

        image output_image(OUTPUT_NAME + ".png");
        output_image.set_size(Size(side_length_x, side_length_y));

        if (VERBOSE)
            cout << "output image size is now "
                 << output_image.size().width << ", "
                 << output_image.size().height << endl;

        if (abs_anchors.size() != input.size()) {
            cout << "Count mismatch!" << endl;
            return -1;
        }

        for (int i = 0; i < abs_anchors.size(); ++i) {
            output_image.insert_image(abs_anchors.at(i), input.at(i));
            input.at(i).position(abs_anchors.at(i));
        }

        output_image.write_file();

        // encode output file to b64
        /*
        ifstream pngInput("output/output.png", ios::binary);
        string pngString((istreambuf_iterator<char>(pngInput)), istreambuf_iterator<char>());
        cout << "read output png into string. length is " << pngString.length() << endl;
        string encoded = base64_encode(reinterpret_cast<const unsigned char*>(pngString.c_str()), pngString.length());
        */

        /*
        string decoded = base64_decode(encoded);
        ofstream pngOutput("output/decodedout.png", ios::binary);
        pngOutput << decoded;
        pngOutput.close();
        */

        // TODO: option to choose format from command line
#if 0
        xmlwriter* plistWriter = new xmlwriter(DOCTYPE_PLIST);
        for (image& img : input) {
            plistWriter->append_image(img);
        }
        plistWriter->set_meta(output_image);
        plistWriter->write_xml("output/plistout.plist");

        xmlwriter* spriteWriter = new xmlwriter(DOCTYPE_JSON);
        for (image& img : input)
            spriteWriter->append_image(img);
        spriteWriter->set_meta(output_image);
        spriteWriter->set_data(encoded);
        spriteWriter->write_xml("output/spriteout.json");
#else
        jsonwriter* writer = new jsonwriter();
        for (image& img : input)
            writer->append_image(img);
        writer->set_meta(output_image);
        writer->write_file(OUTPUT_NAME + ".json");
#endif
    }

    return 0;
}


text:
module SerialPreference
  class Preferenzer
    PreferenceGroup = Struct.new(:name,:preferences)

    attr_reader :preference_groups, :current_group

    def initialize
      @preference_names_cache = HashWithIndifferentAccess.new
      @preference_groups = []
      @definition = false
      activate_group
    end

    def draw(&block)
      @defintion = true
      instance_exec(&block)
      @defintion = false
    end

    def respond_to?(name)
      [:string, :integer, :boolean, :float].include?(name) || @preference_names_cache[name].present? || super
    end

    def method_missing(name,*args,&block)
      if @defintion
        preference(name,args.extract_options!)
      else
        super
      end
    end

    [:string,:integer,:boolean,:float].each do |dt|
      define_method(dt) do |name,opts = {}|
        preference(name,opts.merge!(:data_type => dt))
      end
    end

    def preference(name,opts = {})
      Array(name).each do |n|
        push_preference SerialPreference::PreferenceDefinition.new(n.to_sym,opts)
      end
    end
    alias :pref :preference

    def preference_group(name,&block)
      activate_group(name)
      instance_exec(&block)
    end

    def all_preference_definitions
      @preference_names_cache.values
    end

    def all_preference_names
      @preference_names_cache.keys
    end

    def all_groups
      @preference_groups.map{|x|x.name}
    end

    def definition_for(name)
      @preference_names_cache[name]
    end

    private

    def activate_group(group_name = :base)
      @current_group = find_or_create_group(group_name)
    end

    def push_preference(preference)
      @preference_names_cache[preference.name] = preference
      @current_group.preferences.push(preference)
    end

    def find_or_create_group(name)
      find_group(name) || create_group(name)
    end

    def find_group(name)
      @preference_groups.find{|x|x.name == name}
    end

    def create_group(name = :base)
      PreferenceGroup.new(name,[]).tap do |pg|
        @preference_groups.push(pg)
      end
    end

  end
end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.insightfullogic</groupId>
    <artifactId>given-when-then-examples</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>given-when-then-examples</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.insightfullogic</groupId>
            <artifactId>lambda-behave</artifactId>
            <version>0.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


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

package com.azure.resourcemanager.compute.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** Code indicating the current status of the upgrade. */
public enum UpgradeState {
    /** Enum value RollingForward. */
    ROLLING_FORWARD("RollingForward"),

    /** Enum value Cancelled. */
    CANCELLED("Cancelled"),

    /** Enum value Completed. */
    COMPLETED("Completed"),

    /** Enum value Faulted. */
    FAULTED("Faulted");

    /** The actual serialized value for a UpgradeState instance. */
    private final String value;

    UpgradeState(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a UpgradeState instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed UpgradeState object, or null if unable to parse.
     */
    @JsonCreator
    public static UpgradeState fromString(String value) {
        if (value == null) {
            return null;
        }
        UpgradeState[] items = UpgradeState.values();
        for (UpgradeState item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    /** {@inheritDoc} */
    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}


text:
export const VERSION = 11;
export const ENDPOINT = 'www.woopra.com/track/';
export const XDM_PARAM_NAME = '__woopraid';
export const CAMPAIGN_KEYS = [
  'campaign',
  'content',
  'id',
  'medium',
  'source',
  'term'
];
export const SECOND_LEVEL_TLDS = [
  'com.au',
  'net.au',
  'org.au',
  'co.hu',
  'com.ru',
  'ac.za',
  'net.za',
  'com.za',
  'co.za',
  'co.uk',
  'org.uk',
  'me.uk',
  'net.uk'
];
export const RANDOM_STRING_CHARS =
  '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
export const MIN_PING_INTERVAL = 6_000;
export const MAX_PING_INTERVAL = 60_000;
export const URL_ID_REGEX = new RegExp(XDM_PARAM_NAME + '=([^&#]+)');

export const LIFECYCLE_ACTION = 'action';
export const LIFECYCLE_PAGE = 'page';

export const SCROLL_DEPTH = 'scroll depth';

export const ACTION_PV = 'pv';

export const IDPTNC = 'idptnc';

export const TARGET_BLANK = '_blank';

export const DATA_TRACKED_ATTRIBUTE = 'data-tracked';

export const ACTION_PROPERTY_PREFIX = 'ce_';
export const VISIT_PROPERTY_PREFIX = 'cs_';
export const VISITOR_PROPERTY_PREFIX = 'cv_';

export const ENDPOINT_TRACK = 'ce';
export const ENDPOINT_UPDATE = 'update';
export const ENDPOINT_IDENTIFY = 'identify';

export const PAGE_LIFECYCLE_STATE_ACTIVE = 'active';
export const PAGE_LIFECYCLE_STATE_PASSIVE = 'passive';
export const PAGE_LIFECYCLE_STATE_HIDDEN = 'hidden';
export const PAGE_LIFECYCLE_STATE_FROZEN = 'frozen';
export const PAGE_LIFECYCLE_STATE_TERMINATED = 'terminated';

export const EVENT_BEFOREUNLOAD = 'beforeunload';
export const EVENT_BLUR = 'blur';
export const EVENT_CLICK = 'click';
export const EVENT_DOWNLOAD = 'download';
export const EVENT_FOCUS = 'focus';
export const EVENT_FREEZE = 'freeze';
export const EVENT_LINK_CLICK = 'link';
export const EVENT_MOUSEDOWN = 'mousedown';
export const EVENT_MOUSEMOVE = 'mousemove';
export const EVENT_OUTGOING = 'outgoing';
export const EVENT_PAGEHIDE = 'pagehide';
export const EVENT_PAGESHOW = 'pageshow';
export const EVENT_RESUME = 'resume';
export const EVENT_SCROLL = 'scroll';
export const EVENT_STATECHANGE = 'statechange';
export const EVENT_UNLOAD = 'unload';
export const EVENT_VISIBILITYCHANGE = 'visibilitychange';

export const KEY_APP = 'app';
export const KEY_AUTO_DECORATE = 'auto_decorate';
export const KEY_BEACONS = 'beacons';
export const KEY_CAMPAIGN_ONCE = 'campaign_once';
export const KEY_CLICK_TRACKING_MATCHER_SELECTORS = 'click_tracking_matcher_selectors';
export const KEY_CLICK_PAUSE = 'click_pause';
export const KEY_CLICK_TRACKING = 'click_tracking';
export const KEY_CONTEXT = 'context';
export const KEY_COOKIE_DOMAIN = 'cookie_domain';
export const KEY_COOKIE_EXPIRE = 'cookie_expire';
export const KEY_COOKIE_NAME = 'cookie_name';
export const KEY_COOKIE_PATH = 'cookie_path';
export const KEY_CROSS_DOMAIN = 'cross_domain';
export const KEY_DOMAIN = 'domain';
export const KEY_DOWNLOAD_EXTENSIONS = 'download_extensions';
export const KEY_DOWNLOAD_PAUSE = 'download_pause';
export const KEY_DOWNLOAD_TRACKING = 'download_tracking';
export const KEY_FORM_PAUSE = 'form_pause';
export const KEY_HIDE_CAMPAIGN = 'hide_campaign';
export const KEY_HIDE_XDM_DATA = 'hide_xdm_data';
export const KEY_IDLE_THRESHOLD = 'idle_threshold';
export const KEY_IDLE_TIMEOUT = 'idle_timeout';
export const KEY_IGNORE_QUERY_URL = 'ignore_query_url';
export const KEY_IP = 'ip';
export const KEY_MAP_QUERY_PARAMS = 'map_query_params';
export const KEY_OUTGOING_IGNORE_SUBDOMAIN = 'outgoing_ignore_subdomain';
export const KEY_OUTGOING_PAUSE = 'outgoing_pause';
export const KEY_OUTGOING_TRACKING = 'outgoing_tracking';
export const KEY_PERSONALIZATION = 'personalization';
export const KEY_PING = 'ping';
export const KEY_PING_INTERVAL = 'ping_interval';
export const KEY_PROTOCOL = 'protocol';
export const KEY_SAVE_URL_HASH = 'save_url_hash';
export const KEY_THIRD_PARTY = 'third_party';
export const KEY_USE_COOKIES = 'use_cookies';

export const META_CANCELLED = 'cancelled';
export const META_DIRTY = 'dirty';
export const META_DURATION = 'duration';
export const META_EXPIRED = 'expired';
export const META_LEAVE = 'leave';
export const META_RETRACK = 'retrack';
export const META_SENT = 'sent';
export const META_TIMESTAMP = 'timestamp';

export const ACTION_PROPERTY_ALIASES = [
  [IDPTNC, IDPTNC],
  ['$duration', 'duration'],
  ['$domain', 'domain'],
  ['$app', 'app'],
  ['$timestamp', 'timestamp'],
  ['$action', 'event']
];

export const DEFAULT_DOWNLOAD_EXTENSIONS = [
  'avi',
  'css',
  'dmg',
  'doc',
  'eps',
  'exe',
  'js',
  'm4v',
  'mov',
  'mp3',
  'mp4',
  'msi',
  'pdf',
  'ppt',
  'rar',
  'svg',
  'txt',
  'vsd',
  'vxd',
  'wma',
  'wmv',
  'xls',
  'xlsx',
  'zip'
];

export const ELEMENT_MATCHER_LINK = ['a'];

export const ELEMENT_MATCHER_CLICK = [
  'a',
  'button',
  'input[type=button]',
  'input[type=submit]',
  '[role=button]',
];


text:
rdirsync
========

A synchronization library between a local directory and a remote directory written in Go using gRPC.

This library is under development and the APIs might change and break compatibility.

## License
MIT


text:
from django.test import TestCase

class DecoratorFromMiddlewareTests(TestCase):
    """
    Tests for view decorators created using
    ``django.utils.decorators.decorator_from_middleware``.
    """

    def test_process_view_middleware(self):
        """
        Test a middleware that implements process_view.
        """
        self.client.get('/utils/xview/')

    def test_callable_process_view_middleware(self):
        """
        Test a middleware that implements process_view, operating on a callable class.
        """
        self.client.get('/utils/class_xview/')


text:
"""
Tests for baremetal volume driver.
"""

import mox

from nova import flags
from nova import test
from nova import utils

from nova.virt.baremetal import volume_driver

FLAGS = flags.FLAGS

SHOW_OUTPUT = """Target 1: iqn.2010-10.org.openstack:volume-00000001
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 8
            Initiator: iqn.1993-08.org.debian:01:7780c6a16b4
            Connection: 0
                IP Address: 172.17.12.10
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 1074 MB, Block size: 512
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/nova-volumes/volume-00000001
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 2: iqn.2010-10.org.openstack:volume-00000002
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00020000
            SCSI SN: beaf20
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00020001
            SCSI SN: beaf21
            Size: 2147 MB, Block size: 512
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/nova-volumes/volume-00000002
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 1000001: iqn.2010-10.org.openstack.baremetal:1000001-dev.vdc
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     f42410000
            SCSI SN: beaf10000010
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     f42410001
            SCSI SN: beaf10000011
            Size: 1074 MB, Block size: 512
            Online: Yes
            Removable media: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/disk/by-path/ip-172.17.12.10:3260-iscsi-\
iqn.2010-10.org.openstack:volume-00000001-lun-1
            Backing store flags:
    Account information:
    ACL information:
        ALL
"""

class BaremetalVolumeTestCase(test.TestCase):

    def test_list_backingstore_path(self):
        self.stubs.Set(utils, 'execute', lambda *args,
                       **kwargs: (SHOW_OUTPUT, ''))
        l = volume_driver._list_backingstore_path()
        self.assertEqual(len(l), 3)
        self.assertIn('/dev/nova-volumes/volume-00000001', l)
        self.assertIn('/dev/nova-volumes/volume-00000002', l)
        self.assertIn('/dev/disk/by-path/ip-172.17.12.10:3260-iscsi-\
iqn.2010-10.org.openstack:volume-00000001-lun-1', l)


text:
from msrest.serialization import Model

class ApplicationAddOwnerParameters(Model):
    """Request parameters for adding a owner to an application.

    :param additional_properties: Unmatched properties from the message are
     deserialized this collection
    :type additional_properties: dict[str, object]
    :param url: A owner object URL, such as
     "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd",
     where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and
     "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user,
     application, servicePrincipal, group) to be added.
    :type url: str
    """

    _validation = {
        'url': {'required': True},
    }

    _attribute_map = {
        'additional_properties': {'key': '', 'type': '{object}'},
        'url': {'key': 'url', 'type': 'str'},
    }

    def __init__(self, url, additional_properties=None):
        super(ApplicationAddOwnerParameters, self).__init__()
        self.additional_properties = additional_properties
        self.url = url


text:
[![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename)
[![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master)
[![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename)

`require.main.filename` is great for figuring out the entry
point for the current application. This can be combined with a module like
[pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load
top-level configuration.

Unfortunately, `require.main.filename` sometimes fails when an application is
executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode).

`require-main-filename` is a shim that addresses this problem.

## Usage

```js
var main = require('require-main-filename')()
// use main as an alternative to require.main.filename.
```

## License

ISC


text:
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

class osallistun extends Component {
  constructor() {
    super()
    this.state = {
      loading: true,
      sessionId: '',
      data: { status: 0 }
    }
  }

  componentDidMount() {
    checkSessionStatus(this.state.sessionId).then(data => {
      if (data) {
        this.setState({
          loading: false,
          data: data
        })
      } else {
        this.setState({
          loading: false,
          data: {status: 0}
        })
      }

    })
  }

  render() {
    const loadingElement = <Text style={styles.instructions}>Loading</Text>
    let loading = this.state.loading ? loadingElement : null
    return (
      <View style={styles.container}>
        {loading}
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          {this.state.data.status}
        </Text>
      </View>
    );
  }
}

async function checkSessionStatus(sessionId) {
  try {
    let userUrlWithId = userUrl.replace('SESSIONID', sessionId)
    let data = await fetchDataFromApi(userUrlWithId)
    return data
  } catch(error) {
    console.error(error)
  }
}

async function fetchDataFromApi(url) {
  try {
    let response = await fetch(url);
    let responseJson = await response.json();
    return responseJson;
  } catch(error) {
    console.error(error);
  }
}

const baseUrl = 'https://osallistujat.com/api-1.0/',
      userBaseUrl = 'getUser.php',
      eventsBaseUrl = 'getEvents.php',
      loginUrl = '?loginData[username]=USERNAME&loginData[password]=PASSWORDSH1',
      sessionUrl = '?loginData[sessionId]=SESSIONID',
      userLoginUrl = baseUrl + userBaseUrl + loginUrl,
      userUrl = baseUrl + userBaseUrl + sessionUrl,
      eventsUrl = baseUrl + eventsBaseUrl + sessionUrl;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('osallistun', () => osallistun);


text:
--[[
Copyright 2016 Marek Vavrusa <mvavrusa@cloudflare.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
-- This is a tiny wrapper over libelf to extract load address
-- and offsets of dynamic symbols

local S = require('syscall')
local ffi = require('ffi')
ffi.cdef [[
/* Type for a 16-bit quantity.  */
typedef uint16_t Elf32_Half;
typedef uint16_t Elf64_Half;

/* Types for signed and unsigned 32-bit quantities.  */
typedef uint32_t Elf32_Word;
typedef int32_t  Elf32_Sword;
typedef uint32_t Elf64_Word;
typedef int32_t  Elf64_Sword;

/* Types for signed and unsigned 64-bit quantities.  */
typedef uint64_t Elf32_Xword;
typedef int64_t  Elf32_Sxword;
typedef uint64_t Elf64_Xword;
typedef int64_t  Elf64_Sxword;

/* Type of addresses.  */
typedef uint32_t Elf32_Addr;
typedef uint64_t Elf64_Addr;

/* Type of file offsets.  */
typedef uint32_t Elf32_Off;
typedef uint64_t Elf64_Off;

/* Type for section indices, which are 16-bit quantities.  */
typedef uint16_t Elf32_Section;
typedef uint16_t Elf64_Section;

/* Constants */
struct Elf_Cmd
{
  static const int READ              = 1;
  static const int RDWR              = 2;
  static const int WRITE             = 3;
  static const int CLR               = 4;
  static const int SET               = 5;
  static const int FDDONE            = 6;
  static const int FDREAD            = 7;
  static const int READ_MMAP         = 8;
  static const int RDWR_MMAP         = 9;
  static const int WRITE_MMAP        =10;
  static const int READ_MMAP_PRIVATE =11;
  static const int EMPTY             =12;
  static const int NUM               =13;
};

/* Descriptor for the ELF file.  */
typedef struct Elf Elf;
/* Descriptor for ELF file section.  */
typedef struct Elf_Scn Elf_Scn;
/* Container type for metatable */
struct Elf_object { int fd; Elf *elf; };
/* Program segment header.  */
typedef struct
{
  Elf64_Word    p_type;                 /* Segment type */
  Elf64_Word    p_flags;                /* Segment flags */
  Elf64_Off     p_offset;               /* Segment file offset */
  Elf64_Addr    p_vaddr;                /* Segment virtual address */
  Elf64_Addr    p_paddr;                /* Segment physical address */
  Elf64_Xword   p_filesz;               /* Segment size in file */
  Elf64_Xword   p_memsz;                /* Segment size in memory */
  Elf64_Xword   p_align;                /* Segment alignment */
} Elf64_Phdr;
typedef Elf64_Phdr GElf_Phdr;
/* Section header.  */
typedef struct
{
  Elf64_Word    sh_name;                /* Section name (string tbl index) */
  Elf64_Word    sh_type;                /* Section type */
  Elf64_Xword   sh_flags;               /* Section flags */
  Elf64_Addr    sh_addr;                /* Section virtual addr at execution */
  Elf64_Off     sh_offset;              /* Section file offset */
  Elf64_Xword   sh_size;                /* Section size in bytes */
  Elf64_Word    sh_link;                /* Link to another section */
  Elf64_Word    sh_info;                /* Additional section information */
  Elf64_Xword   sh_addralign;           /* Section alignment */
  Elf64_Xword   sh_entsize;             /* Entry size if section holds table */
} Elf64_Shdr;
typedef Elf64_Shdr GElf_Shdr;
/* Descriptor for data to be converted to or from memory format.  */
typedef struct
{
  void *d_buf;                  /* Pointer to the actual data.  */
  int d_type;                   /* Type of this piece of data.  */
  unsigned int d_version;       /* ELF version.  */
  size_t d_size;                /* Size in bytes.  */
  uint64_t d_off;               /* Offset into section.  */
  size_t d_align;               /* Alignment in section.  */
} Elf_Data;
/* Symbol table entry.  */
typedef struct
{
  Elf64_Word    st_name;                /* Symbol name (string tbl index) */
  unsigned char st_info;                /* Symbol type and binding */
  unsigned char st_other;               /* Symbol visibility */
  Elf64_Section st_shndx;               /* Section index */
  Elf64_Addr    st_value;               /* Symbol value */
  Elf64_Xword   st_size;                /* Symbol size */
} Elf64_Sym;
typedef Elf64_Sym GElf_Sym;

/* Coordinate ELF library and application versions.  */
unsigned int elf_version (unsigned int __version);
/* Return descriptor for ELF file to work according to CMD.  */
Elf *elf_begin (int __fildes, int __cmd, Elf *__ref);
/* Free resources allocated for ELF.  */
int elf_end (Elf *__elf);
/* Get the number of program headers in the ELF file.  If the file uses
   more headers than can be represented in the e_phnum field of the ELF
   header the information from the sh_info field in the zeroth section
   header is used.  */
int elf_getphdrnum (Elf *__elf, size_t *__dst);
/* Retrieve program header table entry.  */
GElf_Phdr *gelf_getphdr (Elf *__elf, int __ndx, GElf_Phdr *__dst);
/* Retrieve section header.  */
GElf_Shdr *gelf_getshdr (Elf_Scn *__scn, GElf_Shdr *__dst);
/* Retrieve symbol information from the symbol table at the given index.  */
GElf_Sym *gelf_getsym (Elf_Data *__data, int __ndx, GElf_Sym *__dst);
/* Get section with next section index.  */
Elf_Scn *elf_nextscn (Elf *__elf, Elf_Scn *__scn);
/* Get data from section while translating from file representation
   to memory representation.  */
Elf_Data *elf_getdata (Elf_Scn *__scn, Elf_Data *__data);
/* Return pointer to string at OFFSET in section INDEX.  */
char *elf_strptr (Elf *__elf, size_t __index, size_t __offset);
]]

local elf = ffi.load('elf')
local EV = { NONE=0, CURRENT=1, NUM=2 }
local PT = { NULL=0, LOAD=1, DYNAMIC=2, INTERP=3, NOTE=4, SHLIB=5, PHDR=6, TLS=7, NUM=8 }
local SHT = { NULL=0, PROGBITS=1, SYMTAB=2, STRTAB=3, RELA=4, HASH=5, DYNAMIC=6, NOTE=7,
              NOBITS=8, REL=9, SHLIB=10, DYNSYM=11, INIT_ARRAY=14, FINI_ARRAY=15, PREINIT_ARRAY=16,
              GROUP=17, SYMTAB_SHNDX=18, NUM=19 }
local ELF_C = ffi.new('struct Elf_Cmd')
local M = {}

-- Optional poor man's C++ demangler
local cpp_demangler = os.getenv('CPP_DEMANGLER')
if not cpp_demangler then
	for prefix in string.gmatch(os.getenv('PATH'), '[^;:]+') do
		if S.statfs(prefix..'/c++filt') then
			cpp_demangler = prefix..'/c++filt'
			break
		end
	end
end
local cpp_demangle = function (name) return name end
if cpp_demangler then
	cpp_demangle = function (name)
		local cmd = string.format('%s -p %s', cpp_demangler, name)
		local fp = assert(io.popen(cmd, 'r'))
		local output = fp:read('*all')
		fp:close()
		return output:match '^(.-)%s*$'
	end
end

-- Metatable for ELF object
ffi.metatype('struct Elf_object', {
	__gc = function (t) t:close() end,
	__index = {
		close = function (t)
			if t.elf ~= nil then
				elf.elf_end(t.elf)
				S.close(t.fd)
				t.elf = nil
			end
		end,
		-- Load library load address
		loadaddr = function(t)
			local phnum = ffi.new('size_t [1]')
			if elf.elf_getphdrnum(t.elf, phnum) == nil then
				return nil, 'cannot get phdrnum'
			end
			local header = ffi.new('GElf_Phdr [1]')
			for i = 0, tonumber(phnum[0])-1 do
				if elf.gelf_getphdr(t.elf, i, header) ~= nil
				   and header[0].p_type == PT.LOAD then
				   return header[0].p_vaddr
				end
			end
		end,
		-- Resolve symbol address
		resolve = function (t, k, pattern)
			local section = elf.elf_nextscn(t.elf, nil)
			while section ~= nil do
				local header = ffi.new('GElf_Shdr [1]')
				if elf.gelf_getshdr(section, header) ~= nil then
					if header[0].sh_type == SHT.SYMTAB or header[0].sh_type == SHT.DYNSYM then
						local data = elf.elf_getdata(section, nil)
						while data ~= nil do
							if data.d_size % header[0].sh_entsize > 0 then
								return nil, 'bad section header entity size'
							end
							local symcount = tonumber(data.d_size / header[0].sh_entsize)
							local sym = ffi.new('GElf_Sym [1]')
							for i = 0, symcount - 1 do
								if elf.gelf_getsym(data, i, sym) ~= nil then
									local name = elf.elf_strptr(t.elf, header[0].sh_link, sym[0].st_name)
									if name ~= nil then
										-- Demangle C++ symbols if necessary
										name = ffi.string(name)
										if name:sub(1,2) == '_Z' then
											name = cpp_demangle(name)
										end
										-- Match symbol name against pattern
										if pattern and string.match(name, k) or k == name then
											return sym[0]
										end
									end
								end
							end
							data = elf.elf_getdata(section, data)
						end
					end
				end
				section = elf.elf_nextscn(t.elf, section)
			end
		end,
	}
})

-- Open an ELF object
function M.open(path)
	if elf.elf_version(EV.CURRENT) == EV.NONE then
		return nil, 'bad version'
	end
	local fd, err = S.open(path, 'rdonly')
	if not fd then return nil, err end
	local pt = ffi.new('Elf *')
	pt = elf.elf_begin(fd:getfd(), ELF_C.READ, pt)
	if not pt then
		fd:close()
		return nil, 'cannot open elf object'
	end
	return ffi.new('struct Elf_object', fd:nogc():getfd(), pt)
end

return M


text:
<!doctype html>

        <meta charset="UTF-8" />
        <title>Phaser Tutorial 01 - Getting Started</title>

Getting started with Phaser

Part 4 - Choosing an Editor

You're going to need an editor in which to prepare your JavaScript code. There are many available, each with their own strengths and weaknesses. If you're an experienced developer you will probably already have your own preferred editor, in which case carry on to Part 5 of this guide. Otherwise here are some options for you:

Sublime Text

This is the editor the Phaser team use for building the framework and examples. It's even the editor this guide is being written in. Sublime should be considered as an extremely powerful text editor rather than an IDE. An IDE is an integrated development environment, that often bundles additional features such as built-in web servers, source control and code in-sight / completion. Sublime focuses on being an amazing editor first and foremost, and its multiple cursor and mini-map features are two of the most time saving we've ever come across in decades of development. Using a comprehensive Package system you can enhance it in multiple ways.

The full version costs $70 but is worth every penny and is available for Windows and OS X.

Sublime Text

WebStorm

JetBrains WebStorm is an extremely advanced fully development environment. It goes well beyond simple code editing and offers all of the high-level features you'd expect from a proper IDE include code-insight, npm built-in, code style/syntax reports, source control and a wealth of other features designed more for web developers than game developers. It's based on IntelliJ IDEA, a heavily Java based editor, which is both a good and bad thing. For a start the actual code editing experience is nothing like as smooth and freeform as with Sublime and OS integration is weak, but the power features can often make up for that. Having errors with your code spotted for you, before you've even tested your game can be really useful. And code-completion is great too, although obviously somewhat limited by the myriad ways JavaScript can be written.

The full version starts from $49 and is available for Windows and OS X. There are often deals to be found on the JetBrains site too.

JetBrains WebStorm

Visual Studio

This should only really be considered if you wish to write your game using TypeScript instead of JavaScript. Phaser has a TypeScript definitions file available, which allows you to use Microsofts new ES6 inspired lanauge to develop in. This gives you access to a statically typed language, with traditional class inheritance, interfaces and most of the OO style trappings you may be used to in other languages like AS3.

The full version varies in cost and Microsoft do great student details. Naturally it's only available for Windows.

Visual Studio

Brackets

Although primarily developed for building web site code, Brackets has really come into its own lately. It's a free open-source code editor and rans across Windows, OS X and Linux. It's actually written in JavaScript and is incredibly hackable, with new versions and extensions released every couple of weeks. It has a modern and dark UI, probably familiar to anyone who uses Adobe CS. It's well worth considering, especially if you're after a free editor.

Brackets is a multi-platform and free open-source product.

Brackets

Part 5: Downloading Phaser

Part 1: Introduction

Part 2: Installing a web server

Part 3: Run in the Cloud

Part 4: Choosing an Editor

Part 5: Downloading Phaser

Part 6: Hello World!

Part 7: The Phaser Examples

Part 8: Next Steps


text:
Test that the Hprose\Tags class works.
--SKIPIF--
<?php if (!extension_loaded("hprose")) print "skip"; ?>
--FILE--
<?php
echo HproseTags::TagInteger;
echo HproseTags::TagEnd;
?>
--EXPECT--
iz


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

            Odd

            Even

        Odd

            Even

            Odd

        Even

Odd

			As mentioned before, query returns an array of nodes that match the selector; this array is actually a dojo/NodeList and has methods for interacting with the nodes contained in it.

One

Two

Three

Four

Five

Six

	There are several extension modules that extend NodeLists by adding extra methods to them. Class and style helper methods are in the dojo/NodeList-dom module.

	<button class="hookUp">Click Me!</button>
	<button class="hookUp">Click Me!</button>
	<button class="hookUp">Click Me!</button>
	<button class="hookUp">Click Me!</button>


text:
class AddDataTypeToReportResponseAttribute < ActiveRecord::Migration[4.2]
  def change
    add_column :report_response_attributes, :data_type, :string
  end
end


text:
package cmd

import (
	"fmt"
	"os"
	"sort"
	"strings"
	"text/tabwriter"

	resources "github.com/GoogleCloudPlatform/terraform-validator/converters/google/resources"
	"github.com/spf13/cobra"
)

type listSupportedResourcesOptions struct{}

func newListSupportedResourcesCmd() *cobra.Command {
	o := listSupportedResourcesOptions{}

	cmd := &cobra.Command{
		Use:   "list-supported-resources",
		Short: "List supported terraform resources.",
		RunE: func(c *cobra.Command, args []string) error {
			return o.run()
		},
	}
	return cmd
}

func (o *listSupportedResourcesOptions) run() error {
	converters := resources.ResourceConverters()

	// Get a sorted list of terraform resources
	list := make([]string, 0, len(converters))
	for k := range converters {
		list = append(list, k)
	}
	sort.Strings(list)

	// go through and print
	w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
	for _, resource := range list {
		seenAssetTypes := make(map[string]bool)
		assetTypes := []string{}
		for _, resources := range converters[resource] {
			if _, exists := seenAssetTypes[resources.AssetType]; !exists {
				seenAssetTypes[resources.AssetType] = true
				assetTypes = append(assetTypes, resources.AssetType)
			}
		}
		sort.Strings(assetTypes)
		fmt.Fprintf(w, "%s\t%s\n", resource, strings.Join(assetTypes, ","))
	}
	w.Flush()

	return nil
}


text:
#nullable disable
using WizBot.Modules.Games.Services;
using WizBot.Services.Database.Models;
using System.Text;

namespace WizBot.Modules.Games;

public partial class Games
{
    [Group]
    public partial class PollCommands : WizBotModule<PollService>
    {
        private readonly DiscordSocketClient _client;

        public PollCommands(DiscordSocketClient client)
            => _client = client;

        [Cmd]
        [UserPerm(GuildPerm.ManageMessages)]
        [RequireContext(ContextType.Guild)]
        public async Task Poll([Leftover] string arg)
        {
            if (string.IsNullOrWhiteSpace(arg))
                return;

            var poll = _service.CreatePoll(ctx.Guild.Id, ctx.Channel.Id, arg);
            if (poll is null)
            {
                await ReplyErrorLocalizedAsync(strs.poll_invalid_input);
                return;
            }

            if (_service.StartPoll(poll))
            {
                await ctx.Channel.EmbedAsync(_eb.Create()
                                                .WithOkColor()
                                                .WithTitle(GetText(strs.poll_created(ctx.User.ToString())))
                                                .WithDescription(Format.Bold(poll.Question)
                                                                 + "\n\n"
                                                                 + string.Join("\n",
                                                                     poll.Answers.Select(x
                                                                         => $"`{x.Index + 1}.` {Format.Bold(x.Text)}"))));
            }
            else
                await ReplyErrorLocalizedAsync(strs.poll_already_running);
        }

        [Cmd]
        [UserPerm(GuildPerm.ManageMessages)]
        [RequireContext(ContextType.Guild)]
        public async Task PollStats()
        {
            if (!_service.ActivePolls.TryGetValue(ctx.Guild.Id, out var pr))
                return;

            await ctx.Channel.EmbedAsync(GetStats(pr.Poll, GetText(strs.current_poll_results)));
        }

        [Cmd]
        [UserPerm(GuildPerm.ManageMessages)]
        [RequireContext(ContextType.Guild)]
        public async Task Pollend()
        {
            Poll p;
            if ((p = _service.StopPoll(ctx.Guild.Id)) is null)
                return;

            var embed = GetStats(p, GetText(strs.poll_closed));
            await ctx.Channel.EmbedAsync(embed);
        }

        public IEmbedBuilder GetStats(Poll poll, string title)
        {
            var results = poll.Votes.GroupBy(kvp => kvp.VoteIndex).ToDictionary(x => x.Key, x => x.Sum(_ => 1));

            var totalVotesCast = results.Sum(x => x.Value);

            var eb = _eb.Create().WithTitle(title);

            var sb = new StringBuilder().AppendLine(Format.Bold(poll.Question)).AppendLine();

            var stats = poll.Answers.Select(x =>
                            {
                                results.TryGetValue(x.Index, out var votes);

                                return (x.Index, votes, x.Text);
                            })
                            .OrderByDescending(x => x.votes)
                            .ToArray();

            for (var i = 0; i < stats.Length; i++)
            {
                var (index, votes, text) = stats[i];
                sb.AppendLine(GetText(strs.poll_result(index + 1, Format.Bold(text), Format.Bold(votes.ToString()))));
            }

            return eb.WithDescription(sb.ToString())
                     .WithFooter(GetText(strs.x_votes_cast(totalVotesCast)))
                     .WithOkColor();
        }
    }
}


text:
require 'rubygems'
require 'bundler'

begin
  Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
  $stderr.puts e.message
  $stderr.puts "Run `bundle install` to install missing gems"
  exit e.status_code
end
require 'minitest/unit'
#require 'minitest/pride'

require 'fileutils'
require 'open3'

$LOAD_PATH.unshift '/Users/andrew/dev/command_test/lib'
require 'command_test'

$LOAD_PATH.unshift '/Users/andrew/dev/fakefs/lib'
require 'fakefs/safe'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'scripts'))
require 'rbvm'

# Silence log
$shellout = File.open("/dev/null", "w")

class MiniTest::Unit::TestCase

  TEST_RUBIES = %w(ruby-1.8.7-p330 ruby-1.9.2-p136 rbx-1.2.4-20110705 jruby-1.6.0)
  #TEST_RUBIES = %w(rbx-1.2.4-20110705)

  SRC_DIR = File.dirname(File.expand_path(File.dirname(__FILE__)))
  TEST_DIR = SRC_DIR

  ENV.delete_if do |key, value|
    key.start_with?("rbvm_")
  end
  %w(RUBYOPT BUNDLE_GEMFILE BUNDLE_BIN_PATH GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC).each do |var|
    ENV.delete(var)
  end
  ENV['rbvm_path'] = TEST_DIR
  ENV['rbvm_gemset_separator'] = '@'

  FakeFS.activate!

  attr_accessor :rbvm

  def setup
    %w(db.yml alias md5 known).each do |file|
      FakeFS::FileSystem.clone(File.join TEST_DIR, 'config', file)
    end
    FakeFS::FileSystem.clone(File.join TEST_DIR, 'gemsets', 'default.gems')

    %w(archives bin config contrib environments examples gems help internal_ruby lib log man patches rubies scripts src tmp user wrappers).each do |dir|
      FileUtils.mkdir_p File.join(TEST_DIR, dir)
    end

    %w(jruby-bin-1.6.0.tar.gz jruby-src-1.6.0.tar.gz rubinius-1.2.2-20110222.tar.gz rubinius-1.2.4-20110705.tar.gz ruby-1.8.7-p330.tar.bz2 ruby-1.9.2-p136.tar.bz2 ruby-1.9.2-p290.tar.bz2 rubygems-1.6.2.tgz rubygems-1.8.10.tgz).each do |file|
      FileUtils.touch File.join(TEST_DIR, 'archives', file)
    end

    %w(jruby-1.6.0 rbx-1.2.2-20110222 rbx-1.2.4-20110705 ruby-1.8.7-p330 ruby-1.9.2-p136 ruby-1.9.2-p290).each do |dir|
      FileUtils.mkdir_p File.join(TEST_DIR, 'src', dir)
      FileUtils.mkdir_p File.join(TEST_DIR, 'rubies', dir)
      FileUtils.mkdir_p File.join(TEST_DIR, 'gems', dir)
    end
    FileUtils.mkdir_p File.join(TEST_DIR, 'src', 'rubygems-1.8.10')

    %w(LICENCE VERSION).each do |file|
      FileUtils.touch File.join(TEST_DIR, file)
    end

    Rbvm.reload!

    @interpreter = "ruby"
    @version = "1.9.2"
    @patchlevel = "136"
    @rbvm = Rbvm.new("#{@interpreter}-#{@version}-p#{@patchlevel}")
    return
  end

  def teardown
    FakeFS::FileSystem.clear
  end

  def capture_3io
    require 'stringio'

    orig_shellout, orig_stderr, orig_envout         = $shellout, $stderr, $envout
    captured_shellout, captured_stderr, captured_envout = StringIO.new, StringIO.new, StringIO.new
    $shellout, $stderr, $envout                 = captured_shellout, captured_stderr, captured_envout

    yield

    return captured_shellout.string, captured_stderr.string, captured_envout.string
  ensure
    $shellout = orig_shellout
    $stderr = orig_stderr
    $envout = orig_envout
  end

  def archive
    return File.join(TEST_DIR, "archives", @rbvm.archive_name)
  end
end

MiniTest::Unit.autorun


text:
package auth

import (
	"errors"
	"net/http"

	"github.com/motki/motkid/http/session"
	"github.com/motki/motkid/log"
	"github.com/motki/motkid/model"
)

const (
	formLoginCsrfTokenKey = "__motki_form_csrf_token"
	formLoginSessionKey   = "__motki_form_session_id"
)

// CSRFTokenFromSession attempts to retrieve the generated form login CSRF
// token from the user's session storage.
func CSRFTokenFromSession(s *session.Session) (string, bool) {
	return s.String(formLoginCsrfTokenKey)
}

// FormLoginAuthenticator is an authenticator using database-backed users and form logins.
type FormLoginAuthenticator struct {
	loginURL string

	model  *model.Manager
	logger log.Logger
}

// NewFormLoginAuthenticator creates a new authenticator for use with form logins.
func NewFormLoginAuthenticator(m *model.Manager, logger log.Logger, loginURL string) Authenticator {
	logger.Debugf("auth: init form_login authentication")
	logger.Debugf("auth: login URL: %s", loginURL)
	return &FormLoginAuthenticator{
		loginURL: loginURL,
		model:    m,
		logger:   logger,
	}
}

// BeginAuthentication starts the authentication process.
//
// This function generates a CSRF token and redirects the user to the login form.
func (p *FormLoginAuthenticator) BeginAuthentication(s *session.Session, w http.ResponseWriter, req *http.Request) {
	s.NewCSRF(formLoginCsrfTokenKey)
	http.Redirect(w, req, p.loginURL, 302)
}

// FinishAuthentication completes the authentication process.
//
// This function verifies the submitted information against what is stored in the database.
// If the verification passes, an authenticated user session is started.
func (p *FormLoginAuthenticator) FinishAuthentication(s *session.Session, req *http.Request) (*Session, error) {
	if !s.CheckCSRF(formLoginCsrfTokenKey, req.FormValue("_token")) {
		return nil, errors.New("received csrf token did not match expected")
	}
	username := req.FormValue("username")
	password := req.FormValue("password")
	u, key, err := p.model.AuthenticateUser(username, password)
	if err != nil {
		return nil, err
	}
	s.Set(formLoginSessionKey, key)
	s.Set(AuthenticatedUserSessionKey, u.UserID)
	return &Session{
		Session: s,
		user:    u,
	}, nil
}

// VerifyAuthentication checks for an existing authentication in the current session.
//
// This function checks the given session for authentication information and a valid user session.
// If the user session is valid, an authenticated user session is continued.
func (p *FormLoginAuthenticator) VerifyAuthentication(s *session.Session) (*Session, bool) {
	if sid, ok := s.String(formLoginSessionKey); ok {
		u, err := p.model.GetUserBySessionKey(sid)
		if err == nil {
			return &Session{s, u}, true
		}
		p.logger.Warnf("session contains authenticated session key, but couldn't load session: %s", err.Error())
	}
	return nil, false
}


text:
package com.intellij.build;

import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

@ApiStatus.Experimental
public interface BuildWorkspaceConfiguration {
  boolean isShowFirstErrorInEditor();

  static @NotNull BuildWorkspaceConfiguration getInstance(@NotNull Project project) {
    return project.getService(BuildWorkspaceConfiguration.class);
  }
}


text:
{-# LANGUAGE RecordWildCards #-}
module Plot.Gauss where

import Types

import PatternRecogn.Gauss.Utils
import PatternRecogn.Utils
import PatternRecogn.Lina as Lina
import PatternRecogn.Gauss.Types

import Graphics.Rendering.Chart.Easy as Chart hiding( Matrix, Vector )
import Graphics.Rendering.Chart.Backend.Diagrams as Chart

-- plot 1-dim data and estimated propability measure (gaussian)
plotProjected :: FilePath -> Vector -> Classes -> ErrT IO ()
plotProjected path dots params =
	do
		_ <- lift $ Chart.renderableToFile def path $ Chart.toRenderable diagram
		return ()
	where
		diagram :: EC (Layout Double Double) ()
		diagram =
			do
				layout_title .= path
				Chart.plot $ points "data points" $
					map (\x -> (x, 0)) $
					Lina.toList dots
				Chart.plot $ line "estimated distribution" $
					concat $ map (\Class{..} -> gaussLine (vecToVal class_min) (matToVal class_cov)) $
					params

vecToVal :: Vector -> R
vecToVal =
	f
	.
	Lina.toList
	where
		f [x] = x
		f _ = error "error converting to vector to scalar!"

matToVal :: Matrix -> R
matToVal =
	f
	.
	Lina.toLists
	where
		f [[x]] = x
		f _ = error "error converting to vector to scalar!"

gaussLine :: R -> R -> [[(R,R)]]
gaussLine center cov =
	return $
	map (\x -> (x, mahalanobis (scalar center) (scalar cov) (scalar x))) $
	map (
		\x -> (center - width / 2) + (x * width / count)
	) $
	[0..count]
	where
		count = 100 :: Num a => a
		width = 30 * cov

plot :: FilePath -> Matrix -> Classes -> ErrT IO ()
plot path dots params =
	do
		_ <- lift $ Chart.renderableToFile def path $ Chart.toRenderable diagram
		return ()
	where
		diagram :: EC (Layout Double Double) ()
		diagram =
			do
				layout_title .= path
				Chart.plot $ points "data points" $
					map vecToTuple2 $
					Lina.toRows dots
				Chart.plot $
					line "classes" $
						map (
							\Class{..} ->
								map vecToTuple2 $
								lineFromGauss class_min class_cov
						)
						params

lineFromGauss :: Vector -> Matrix -> [Vector]
lineFromGauss center cov =
	toRows $
	(+ asRow center) $ -- shift to center
	(<> cov) $ 			-- multiply with covariance matrix
	circleDots
	where
		circleDots =
			cmap cos anglesMat
			|||
			cmap sin anglesMat
		anglesMat =
			((count :: Int)><1) angles
		angles = (/(2*pi)) <$> ([0..(count-1)] :: [Double])
		count :: Num a => a
		count = 100

{-
vectorField :: String -> [((R,R),(R,R))] -> EC (Layout R R) (Plot R R)
vectorField title vectors =
	fmap plotVectorField $ liftEC $
	do
		c <- takeColor
		plot_vectors_values .= vectors
		plot_vectors_style . vector_line_style . line_color .= c
		plot_vectors_style . vector_head_style . point_color .= c
		plot_vectors_title .= title
		----plot_vectors_grid .= grid
-}


text: export { LinkComponent as LinkTo } from '@ember/-internals/glimmer';


text:
/**
 * @namespace Phaser.Input.Gamepad.Events
 */

module.exports = {

    BUTTON_DOWN: require('./BUTTON_DOWN_EVENT'),
    BUTTON_UP: require('./BUTTON_UP_EVENT'),
    CONNECTED: require('./CONNECTED_EVENT'),
    DISCONNECTED: require('./DISCONNECTED_EVENT'),
    GAMEPAD_BUTTON_DOWN: require('./GAMEPAD_BUTTON_DOWN_EVENT'),
    GAMEPAD_BUTTON_UP: require('./GAMEPAD_BUTTON_UP_EVENT')

};


text:
package afirsraftgarrier.demoandroid.androidapi.view;

import afirsraftgarrier.demoandroid.R;

import android.app.Activity;
import android.os.Bundle;

/**
 * A gallery of the different styles of buttons.
 */
public class PointerShapes extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pointer_types);
    }
}


text:
Explore and share. Highly-configurable directory listing made with nodejs.

![Screenshot](https://raw.githubusercontent.com/soyuka/explorer/master/screen.png)

## Requirements

- nodejs (> 0.11 with harmony support)

### Installing nodejs with [nvm](https://github.com/creationix/nvm)

```bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
nvm install 0.12 #nvm ls-remote to see available versions
nvm alias default 0.12
```

## Install

### As a pm2 module

```bash
npm i pm2 -g
pm2 install xplorer
```
Go to IP:4859, login with `admin:admin` Don't forget to change the password.

With pm2 configuration file is located in `~/.config/explorer`

You may want to create your own HTTPS certs or disable it ([see below](#certs)).

### Manual
Download, unpack, configure, launch :

```bash
curl -L https://github.com/soyuka/explorer/archive/v2.0.12.tar.gz | tar xz
cd explorer-2.0.12
cp config.example.yml config.yml #copy default configuration
cp users.default data/users #copy default database
npm rebuild
node --harmony index.js #see below to run as a daemon
```

#### Mirror

```bash
curl -L http://lab.wareziens.net/soyuka/explorer/repository/archive.tar.gz?ref=v2.0.12 | tar xz
```

Check `IP:4859`, login with `admin:admin`. Don't forget to change the password!

## Run

Installed as a pm2 module explorer will already be daemonized.

### Daemonize with pm2
```bash
npm i pm2 -g
pm2 start --node-args="--harmony" --name explorer index.js
```

With iojs you can run:
```
pm2 --next-gen-js --name explorer start index.js
```

Or with babel-node:

```
npm i pm2 babel-node -g
pm2 --interpreter babel-node --name explorer start index.js
```

## Configuration

```yaml
---
search:
  # Available: pt, ack, find, mdfind, custom, native
  method: 'native'
  # Custom search command (${search} will be replaced by the string)
  command: "pt --nocolor --nogroup -l -i '${search}' ." # not used by native
  max_depth: 10 # Default 10
  concurrency: 100 # Default 100 (only used with native search)
  # String match score (only used with native search)
  maxScore: 0.5
pagination:
  # Maximum number of items per page
  limit: 10 # Default 100
# Be carefull with this next section as it will have an impact on performances
tree:
  # When calculating directory size we stop at the max_depth
  max_depth: 10 #Default 10
  concurrency: 100 #Default 100
remove:
  # 'mv' will move files to a trash directory
  # 'rm' will delete files
  # empty to disable deletion
  method: 'mv' #default is to move
  path: './trash'
archive:
  keep: false # set to true to keep archives
  path: './tmp'
upload:
  path: './upload'
  concurrency: 10
  maxSize: '50mb' # default to 50mb see https://github.com/expressjs/body-parser#limit
  maxCount: 10 # max number of files
# note that path values will be overridden by the user path if set
# path will be created if non-existant
database: './data/users' # don't touch if you don't know what you're doing
app_root: '/' # app root for client ressources
session_secret: 'Some string here' #Change this
port: 4859
https:
  port: 6859
  enabled: true #default option!
  key: './certs/key.pem' #change those are dummies
  cert: './certs/cert.pem'
dev: false # more verbose error (stack)
```

The `config.yml` will be searched in:
- `~/.config/explorer/config.yml`
- `./config/explorer/config.yml` (relative to the script directory!)

To reload the configuration you'll need to restart the script `pm2 restart xplorer`!

## HTTP(S)

### Nginx

```nginx
upstream explorer {
  server localhost:4859 #port can be changed in the config.yml
}

server {
  listen 80;

  location / { #if you want to change this, change `app_root` in the config.yml
    proxy_pass http://explorer/
  }
}
```

### Certs

You can either change the paths in the `config.yml`, or replace those located in your configuration path (see [Configuration](#configuration)).

### Rss

By calling your tree url or a search path (`localhost:4859/search?search=*.mkv&key=my-key`), set the `Accept` header to `application/rss+xml`:

```bash
http GET localhost:4859/?key=get-your-key-from-settings Accept:application/rss+xml
```

## Update

[From 1.x to 2.x see configuration migration](https://github.com/soyuka/explorer/blob/master/Migration.md).

### As a pm2 module

```
pm2 install xplorer
```

### From tarball

```
cd /path/to/your/explorer
curl -L https://github.com/soyuka/explorer/archive/v1.0.6.tar.gz | tar xz --strip-components 1
npm rebuild
```

## Development

1. Clone
2. Follow the [manual installation](https://github.com/soyuka/explorer#manual) to copy default files
3. Launch

The easiest is to compile with babel for ES6 compatibility, for example:
```bash
DEBUG="explorer:*, explorer:routes:*" babel-node index.js
```

Sass is compiled with gulp, for example:
```
gulp watch
```

To get stack traces from errors use `dev: true` in your configuration file.

### Tests

Tests are using their own configuration file `test/fixtures/config.yml`:

```bash
mocha --compilers js:babel/register
```

### Api docs

Generated with [apidocjs](http://apidocjs.com) ([available here](http://soyuka.github.io/explorer/#api-Admin-createUser)):

`apidoc -i routes -o doc/api`

## Performances

We use Bluebird with concurrency, for your information you may speed things up:

```
$ sync && echo 3 > /proc/sys/vm/drop_caches
$ node test.js 1
reading files 35ms
$ sync && echo 3 > /proc/sys/vm/drop_caches
$ node test.js Infinity
reading files: 9ms
```

[See bluebird docs](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-concurrency)

## Why?

I did this because I could not find a light file explorer. It had to be simple, easy to install and fast.
I tried [pydio](https://pyd.io) but it's heavy and long to install. I also tried [h5ai](http://larsjung.de/h5ai/) but it does not have user support and has a lot of client-side javascript. I also have the feeling that it's slow.
Explorer was built with [only 2 client javascript lines](https://github.com/soyuka/explorer/blob/master/views/index.haml#L60). It's fun to see how hard it seems, nowadays, to avoid using javascript for apps that don't require it.

KISS.


text:
import { Column, Entity, PrimaryGeneratedColumn } from "../../../../../src"
import { Index } from "../../../../../src/decorator/Index"

@Entity()
export class Post {
    @PrimaryGeneratedColumn()
    id: number

    @Index({ fulltext: true })
    @Column()
    default: string

    @Index({ fulltext: true, parser: "ngram" })
    @Column()
    ngram: string
}