#include "pch.h"
#include "rthsTypes.h"

namespace rths {

void GlobalSettings::enableDebugFlag(DebugFlag v)
{
    debug_flags = debug_flags | (uint32_t)v;
}

void GlobalSettings::disableDebugFlag(DebugFlag v)
{
    debug_flags = debug_flags & (~(uint32_t)v);
}

bool GlobalSettings::hasDebugFlag(DebugFlag v) const
{
    return (debug_flags & (uint32_t)v) != 0;
}

bool GlobalSettings::hasFlag(GlobalFlag v) const
{
    return (flags & (uint32_t)v) != 0;
}

GlobalSettings& GetGlobals()
{
    static GlobalSettings s_globals;
    return s_globals;
}

static std::vector<std::function<void()>> g_deferred_commands, g_deferred_commands_tmp;
static std::mutex g_mutex_deferred_commands;

template<class Body>
inline void DeferredCommandsLock(const Body& body)
{
    std::unique_lock<std::mutex> l(g_mutex_deferred_commands);
    body();
}

void AddDeferredCommand(const std::function<void()>& v)
{
    DeferredCommandsLock([&v]() {
        g_deferred_commands.push_back(v);
    });
}

void FlushDeferredCommands()
{
    DeferredCommandsLock([]() {
        g_deferred_commands.swap(g_deferred_commands_tmp);
    });
    for (auto& f : g_deferred_commands_tmp)
        f();
    g_deferred_commands_tmp.clear();
}

bool SkinData::valid() const
{
    return !bindposes.empty() && !bone_counts.empty() && !weights.empty();
}

void CallOnMeshDelete(MeshData *mesh);
void CallOnMeshInstanceDelete(MeshInstanceData *inst);
void CallOnRenderTargetDelete(RenderTargetData *rt);

MeshData::MeshData()
{
}

MeshData::~MeshData()
{
    CallOnMeshDelete(this);
}

void MeshData::release()
{
    ExternalRelease(this);
}

bool MeshData::valid() const
{
    return this && (
        (gpu_vertex_buffer != nullptr && gpu_index_buffer != nullptr) ||
        (cpu_vertex_buffer != nullptr && cpu_index_buffer != nullptr) );
}

bool MeshData::isRelocated() const
{
    return device_data && device_data->isRelocated();
}

MeshInstanceData::MeshInstanceData()
{
}

MeshInstanceData::~MeshInstanceData()
{
    CallOnMeshInstanceDelete(this);
}

void MeshInstanceData::release()
{
    ExternalRelease(this);
}

bool MeshInstanceData::valid() const
{
    return this && mesh->valid();
}

bool MeshInstanceData::isUpdated(UpdateFlag v) const
{
    return (update_flags & uint32_t(v)) != 0;
}

void MeshInstanceData::clearUpdateFlags()
{
    update_flags = 0;
}

void MeshInstanceData::markUpdated(UpdateFlag v)
{
    update_flags |= (uint32_t)v;
}

void MeshInstanceData::markUpdated()
{
    if (mesh) {
        markUpdated(UpdateFlag::Transform);
        if (mesh->skin.valid())
            markUpdated(UpdateFlag::Bones);
        if (!mesh->blendshapes.empty())
            markUpdated(UpdateFlag::Blendshape);
    }
}

bool MeshInstanceData::hasFlag(InstanceFlag v) const
{
    return (instance_flags & uint32_t(v)) != 0;
}

void MeshInstanceData::setTransform(const float4x4 &v)
{
    if (transform != v) {
        transform = v;
        markUpdated(UpdateFlag::Transform);
    }
}

void MeshInstanceData::setBones(const float4x4 *v, size_t n)
{
    if (bones.size() != n)
        markUpdated(UpdateFlag::Bones);

    if (n == 0) {
        bones.clear();
    }
    else {
        if (bones.size() == n && !std::equal(v, v + n, bones.data()))
            markUpdated(UpdateFlag::Bones);
        bones.assign(v, v + n);
    }
}

void MeshInstanceData::setBlendshapeWeights(const float *v, size_t n)
{
    if (blendshape_weights.size() != n)
        markUpdated(UpdateFlag::Blendshape);

    if (n == 0) {
        blendshape_weights.clear();
    }
    else {
        if (blendshape_weights.size() == n && !std::equal(v, v + n, blendshape_weights.data()))
            markUpdated(UpdateFlag::Blendshape);
        blendshape_weights.assign(v, v + n);
    }
}

void MeshInstanceData::setFlags(uint32_t v)
{
    if (instance_flags != v) {
        markUpdated(UpdateFlag::Flags);
        instance_flags = v;
    }
}

void MeshInstanceData::setLayer(uint32_t v)
{
    if (layer != v) {
        markUpdated(UpdateFlag::Flags);
        layer = v;
    }
}

RenderTargetData::RenderTargetData()
{
}

RenderTargetData::~RenderTargetData()
{
    CallOnRenderTargetDelete(this);
}

void RenderTargetData::release()
{
    ExternalRelease(this);
}

bool RenderTargetData::isRelocated() const
{
    return device_data && device_data->isRelocated();
}

} // namespace rths

{'repo_name': 'unity3d-jp/RaytracedHardShadow', 'stars': '150', 'repo_language': 'C++', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': -3918812674368768775, 'source_dataset': 'data'}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

Searching...

No Matches

{'repo_name': 'xuhongv/StudyInEsp8266', 'stars': '444', 'repo_language': 'Assembly', 'file_name': 'eagle.S', 'mime_type': 'text/plain', 'hash': 2303146082387255186, 'source_dataset': 'data'}


/*******************************************************************************
 * MIT License
 *
 * Copyright (c) 2020 Raymond Buckley
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 ******************************************************************************/
package com.ray3k.skincomposer;

import com.badlogic.gdx.Graphics;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeBitmapFontData;
import com.badlogic.gdx.utils.Array;

import java.io.File;
import java.util.List;

public interface DesktopWorker {
    void texturePack(Array<FileHandle> handles, FileHandle localFile, FileHandle targetFile, FileHandle settingsFile);
    void packFontImages(Array<FileHandle> files, FileHandle saveFile);
    void sizeWindowToFit(int maxWidth, int maxHeight, int displayBorder, Graphics graphics);
    void centerWindow(Graphics graphics);
    void addFilesDroppedListener(FilesDroppedListener filesDroppedListener);
    void removeFilesDroppedListener(FilesDroppedListener filesDroppedListener);
    void setCloseListener(CloseListener closeListener);
    void attachLogListener();
    List<File> openMultipleDialog(String title, String defaultPath, String[] filterPatterns, String filterDescription);
    File openDialog(String title, String defaultPath, String[] filterPatterns, String filterDescription);
    File saveDialog(String title, String defaultPath, String[] filterPatterns, String filterDescription);
    char getKeyName(int keyCode);
    void writeFont(FreeTypeBitmapFontData data, Array<PixmapPacker.Page> pages, FileHandle target);
}

{'repo_name': 'raeleus/skin-composer', 'stars': '220', 'repo_language': 'Java', 'file_name': 'skin-composer-installer-ui.json', 'mime_type': 'text/plain', 'hash': -1277240176687593542, 'source_dataset': 'data'}


<!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">
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.10-dev">
<meta name="Forrest-skin-name" content="pelt">
<title>Running Apache™ FOP</title>
<link type="text/css" href="../skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
<link type="text/css" href="../skin/profile.css" rel="stylesheet">

<link rel="shortcut icon" href="../favicon.ico">

<form action="http://www.google.com/search" method="get" class="roundtopsmall">
<input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">
                    <input name="Search" value="Search" type="submit">
</form>

Home

Version 1.0

Version 1.1

FOP Trunk

Development

The Apache Software Foundation > Apache XML Graphics Project

Apache™ FOP Trunk (dev)

About

Upgrading

Using Apache™ FOP

Ant Task

Build

Configure

Embed

Run

Servlets

Features

Accessibility

Complex Scripts

Events

Extensions

Fonts

Graphics

Hyphenation

Intermediate Format

Metadata

Output Targets

PDF/A

PDF/X

PDF Encryption

        XML

        PDF

Font size:
	           <input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button">
	           <input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button">
	           <input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button">

Running Apache™ FOP

System Requirements

Installation

Instructions

Problems

Starting FOP as a Standalone Application

Using the fop script or batch file

Writing your own script

Running with java's -jar option

FOP's dynamical classpath construction

Using Xalan to Check XSL-FO Input

Memory Usage

Problems

System Requirements

The following software must be installed:

          Java 1.4.x or later Runtime Environment.

              Many JREs >=1.4 contain older JAXP implementations (which often contain bugs). It's
              usually a good idea to replace them with a current implementation.

          Apache™ FOP. The FOP distribution includes all libraries that you will
          need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
          libraries include the following:

Apache XML Graphics Commons, an shared library for Batik and FOP.

Apache Batik, an SVG library.

Apache Commons Logging, a logger abstraction kit.

Apache Commons IO, a library with I/O utilities.

Apache Excalibur/Avalon Framework, for XML configuration handling.

The following software is optional, depending on your needs:

          Graphics libraries. Generally, FOP contains direct support for the most important
          bitmap image formats (including PNG, JPEG and GIF). See
          FOP: Graphics Formats for details.

          PDF encryption. See FOP: PDF Encryption for details.

In addition, the following system requirements apply:

          If you will be using FOP to process SVG, you must do so in a graphical environment.
          See FOP: Graphics (Batik) for details.

Installation

Instructions

          Basic FOP installation consists of first unzipping the .gz file that is the
          distribution medium, then unarchiving the resulting .tar file in a
          directory/folder that is convenient on your system. Please consult your operating system
          documentation or Zip application software documentation for instructions specific to your
          site.

Problems

          Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
          and unarchive their distribution media. This is a legacy of older Mac operating systems,
          which had a 31-character pathname limit. Several Mac OSX users have recommended that
          Mac OSX users use the shell command tar -xzf instead.

Starting FOP as a Standalone Application

Using the fop script or batch file

        The usual and recommended practice for starting FOP from the command line is to run the
        batch file fop.bat (Windows) or the shell script fop (Unix/Linux).
        These scripts require that the environment variable JAVA_HOME be
        set to a path pointing to the appropriate Java installation on your system. Macintosh OSX
        includes a Java environment as part of its distribution. We are told by Mac OSX users that
        the path to use in this case is /Library/Java/Home. Caveat:
        We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
        Java requirements, the two will inevitably not match on some systems. Please see
        Java on Mac OSX FAQ for information as
        it becomes available.

USAGE
Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
 [OPTIONS]
  -version          print FOP version and exit
  -d                debug mode
  -x                dump configuration settings
  -q                quiet mode
  -c cfg.xml        use additional configuration file cfg.xml
  -l lang           the language to use for user information
  -nocs             disable complex script features
  -r                relaxed/less strict validation (where available)
  -dpi xxx          target resolution in dots per inch (dpi) where xxx is a number
  -s                for area tree XML, down to block areas only
  -v                run in verbose mode (currently simply print FOP version and continue)

  -o [password]     PDF file will be encrypted with option owner password
  -u [password]     PDF file will be encrypted with option user password
  -noprint          PDF file will be encrypted without printing permission
  -nocopy           PDF file will be encrypted without copy content permission
  -noedit           PDF file will be encrypted without edit content permission
  -noannotations    PDF file will be encrypted without edit annotation permission
  -nofillinforms    PDF file will be encrypted without fill in forms permission
  -noaccesscontent  PDF file will be encrypted without extract text and graphics permission
  -noassembledoc    PDF file will be encrypted without assemble the document permission
  -noprinthq        PDF file will be encrypted without print high quality permission
  -a                enables accessibility features (Tagged PDF etc., default off)
  -pdfprofile prof  PDF file will be generated with the specified profile
                    (Examples for prof: PDF/A-1b or PDF/X-3:2003)

  -conserve         enable memory-conservation policy (trades memory-consumption for disk I/O)
                    (Note: currently only influences whether the area tree is serialized.)

  -cache            specifies a file/directory path location
  -flush            flushes the current font cache file

 [INPUT]
  infile            xsl:fo input file (the same as the next)
                    (use '-' for infile to pipe input from stdin)
  -fo  infile       xsl:fo input file
  -xml infile       xml input file, must be used together with -xsl
  -atin infile      area tree input file
  -ifin infile      intermediate format input file
  -imagein infile   image input file (piping through stdin not supported)
  -xsl stylesheet   xslt stylesheet

  -param name value <value> to use for parameter <name> in xslt stylesheet
                    (repeat '-param name value' for each parameter)

  -catalog          use catalog resolver for input XML and XSLT files
 [OUTPUT]
  outfile           input will be rendered as PDF into outfile
                    (use '-' for outfile to pipe output to stdout)
  -pdf outfile      input will be rendered as PDF (outfile req'd)
  -pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF
                    (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
  -awt              input will be displayed on screen
  -rtf outfile      input will be rendered as RTF (outfile req'd)
  -pcl outfile      input will be rendered as PCL (outfile req'd)
  -ps outfile       input will be rendered as PostScript (outfile req'd)
  -afp outfile      input will be rendered as AFP (outfile req'd)
  -tiff outfile     input will be rendered as TIFF (outfile req'd)
  -png outfile      input will be rendered as PNG (outfile req'd)
  -txt outfile      input will be rendered as plain text (outfile req'd)
  -at [mime] out    representation of area tree as XML (outfile req'd)
                    specify optional mime output to allow the AT to be converted
                    to final format later
  -if [mime] out    representation of document in intermediate format XML (outfile req'd)
                    specify optional mime output to allow the IF to be converted
                    to final format later
  -print            input file will be rendered and sent to the printer
                    see options with "-print help"
  -out mime outfile input will be rendered using the given MIME type
                    (outfile req'd) Example: "-out application/pdf D:\out.pdf"
                    (Tip: "-out list" prints the list of supported MIME types)
  -svg outfile      input will be rendered as an SVG slides file (outfile req'd)
                    Experimental feature - requires additional fop-sandbox.jar.

  -foout outfile    input will only be XSL transformed. The intermediate
                    XSL-FO file is saved and no rendering is performed.
                    (Only available if you use -xml and -xsl parameters)

 [Examples]
  fop foo.fo foo.pdf
  fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
  fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
  fop -xml foo.xml -xsl foo.xsl -foout foo.fo
  fop -xml - -xsl foo.xsl -pdf -
  fop foo.fo -mif foo.mif
  fop foo.fo -rtf foo.rtf
  fop foo.fo -print
  fop foo.fo -awt

        PDF encryption is only available if FOP was compiled with encryption support
        and if compatible encryption support is available at run time.
        Currently, only the JCE is supported. Check the Details.

Writing your own script

FOP's entry point for your own scripts is the class
org.apache.fop.cli.Main. The general pattern for the
        command line is: java -classpath <CLASSPATH>
        org.apache.fop.cli.Main <arguments>. The arguments
        consist of the options and infile and outfile specifications
        as shown above for the standard scripts. You may wish to review
        the standard scripts to make sure that
        you get your environment properly configured.

Running with java's -jar option

        As an alternative to the start scripts you can run java
        -jar path/to/build/fop.jar <arguments>, relying on
        FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
        you must put fop-hyph.jar in the lib
        directory.

You can also run java -jar path/to/fop.jar
      <arguments>, relying on the Class-Path
      entry in the manifest file. This works if you put
      fop.jar and all jar files from the lib
      directory in a single directory. If you use hyphenation, you
      must also put fop-hyph.jar in that directory.

In both cases the arguments consist of the options and
        infile and outfile specifications as shown above for the
        standard scripts.

FOP's dynamical classpath construction

If FOP is started without a proper classpath, it tries to
          add its dependencies dynamically. If the system property
          fop.home contains the name of a directory, then
          FOP uses that directory as the base directory for its
          search. Otherwise the current working directory is the base
          directory. If the base directory is called build,
          then its parent directory becomes the base directory.

FOP expects to find fop.jar in the
          build subdirectory of the base directory, and
          adds it to the classpath. Subsequently FOP adds all
          jar files in the lib directory to the
          classpath. The lib directory is either the lib
          subdirectory of the base directory, or, if that does not
          exist, the base directory itself.

If the system property fop.optional.lib
          contains the name of a directory, then all jar
          files in that directory are also added to the classpath. See
          the methods getJARList and
          checkDependencies in
          org.apache.fop.cli.Main.

Using Xalan to Check XSL-FO Input

        FOP sessions that use -xml and -xsl input instead of -fo input are actually
        controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
        the XSL-FO to PDF (or another FOP output format).
        Although FOP controls both of these processes, the first is included merely as
        a convenience and for performance reasons.
        Only the second is part of FOP's core processing.
        If a user has a problem running FOP, it is important to determine which of these
        two processes is causing the problem.
        If the problem is in the first process, the user's stylesheet is likely the cause.
        The FOP development team does not have resources to help with stylesheet issues,
        although we have included links to some useful
        Specifications and
        Books/Articles.
        If the problem is in the second process, FOP may have a bug or an unimplemented
        feature that does require attention from the FOP development team.

Note

The user is always responsible to provide correct XSL-FO code to FOP.

        In the case of using -xml and -xsl input, although the user is responsible for
        the XSL-FO code that is FOP's input, it is not visible to the user. To make the
        intermediate FO file visible, the FOP distribution includes the "-foout" option
        which causes FOP to run only the first (transformation) step, and write the
        results to a file. (See also the Xalan command-line below)

Note

        When asking for help on the FOP mailing lists, never attach XML and
        XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
        resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
        correct before sending it.

        The -foout option works the same way as if you would call the
        Xalan command-line:

java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile

        Note that there are some subtle differences between the FOP and Xalan command-lines.

Memory Usage

        FOP can consume quite a bit of memory, even though this has been continually improved.
        This is partly inherent to the formatting process and partly caused by implementation choices.
        All FO processors currently on the market have memory problems with certain layouts.

        If you are running out of memory when using FOP, here are some ideas that may help:

          Increase memory available to the JVM. See
          the -Xmx option
          for more information.

Warning

            It is usually unwise to increase the memory allocated to the JVM beyond the amount of
            physical RAM, as this will generally cause significantly slower performance.

          Avoid forward references.
          Forward references are references to some later part of a document.
          Examples include page number citations which refer to pages which follow the citation,
          tables of contents at the beginning of a document, and page numbering schemes that
          include the total number of pages in the document
          ("page N of TOTAL").
          Forward references cause all subsequent pages to be held in memory until the reference
          can be resolved, i.e. until the page with the referenced element is encountered.
          Forward references may be required by the task, but if you are getting a memory
          overflow, at least consider the possibility of eliminating them.
          A table of contents could be replaced by PDF bookmarks instead or moved to the end of
          the document (reshuffle the paper could after printing).

          Avoid large images, especially if they are scaled down.
          If they need to be scaled, scale them in another application upstream from FOP.
          For many image formats, memory consumption is driven mainly by the size of the image
          file itself, not its dimensions (width*height), so increasing the compression rate
          may help.

          Use multiple page sequences.
          FOP starts rendering after the end of a page sequence is encountered.
          While the actual rendering is done page-by-page, some additional memory is
          freed after the page sequence has been rendered.
          This can be substantial if the page sequence contains lots of FO elements.

Problems

If you have problems running FOP, please see the "How to get Help" page.

          version 1308679

        Copyright ©
         1999-2012 The Apache Software Foundation. Licensed under Apache License 2.0

    Apache, Apache FOP, the Apache feather logo, and the Apache FOP
    logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

{'repo_name': 'sebastianbergmann/phpunit-documentation', 'stars': '187', 'repo_language': 'HTML', 'file_name': 'index.html', 'mime_type': 'text/html', 'hash': -7050312436039541453, 'source_dataset': 'data'}


// Copyright 2009 the Sputnik authors.  All rights reserved.
/**
 * The "this" token can not be used as identifier
 *
 * @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.18.js
 * @description Checking if execution of "this=1" fails
 * @negative
 */

this = 1;

{'repo_name': 'nilproject/NiL.JS', 'stars': '210', 'repo_language': 'JavaScript', 'file_name': 'generators.js', 'mime_type': 'text/plain', 'hash': 3109673093772176166, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: f0a89c940320ca917a00a59645a1e7db
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'sebastianstarke/AI4Animation', 'stars': '3141', 'repo_language': 'C++', 'file_name': 'ProjectVersion.txt', 'mime_type': 'text/plain', 'hash': -6991114588474735215, 'source_dataset': 'data'}


@file:JvmName("Events")

package org.frice.event

import java.awt.event.MouseEvent
import javafx.scene.input.MouseEvent as JfxMouseEvent

const val MOUSE_CLICKED = 0x00
const val MOUSE_RELEASED = 0x01
const val MOUSE_MOVED = 0x02
const val MOUSE_PRESSED = 0x03

/**
 * Created by ice1000 on 2016/8/13.
 * @author ice1000
 * @since v0.1
 */
data class OnMouseEvent(
	val x: Double,
	val y: Double,
	val screenX: Double,
	val screenY: Double,
	val isAltDown: Boolean,
	val isCtrlDown: Boolean,
	val isShiftDown: Boolean,
	val isMetaDown: Boolean,
	val type: Int)

fun swingMouse(e: MouseEvent, type: Int) = OnMouseEvent(
	e.x.toDouble(),
	e.y.toDouble(),
	e.xOnScreen.toDouble(),
	e.yOnScreen.toDouble(),
	e.isAltDown,
	e.isControlDown,
	e.isShiftDown,
	e.isMetaDown,
	type)

fun fxMouse(it: JfxMouseEvent, type: Int) = OnMouseEvent(
	it.x,
	it.y,
	it.screenX,
	it.screenY,
	it.isAltDown,
	it.isControlDown,
	it.isShiftDown,
	it.isMetaDown,
	type)

{'repo_name': 'icela/FriceEngine', 'stars': '316', 'repo_language': 'Kotlin', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -8807761534590196716, 'source_dataset': 'data'}


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

namespace DeviceMonitor.Properties {
    using System;

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

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

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

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

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

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

{'repo_name': 'rstropek/Samples', 'stars': '216', 'repo_language': 'JavaScript', 'file_name': 'AssemblyInfo.cs', 'mime_type': 'text/plain', 'hash': -1203528793547875199, 'source_dataset': 'data'}


//===-- MachineSink.cpp - Sinking for machine instructions ----------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This pass moves instructions into successor blocks when possible, so that
// they aren't executed on paths where their results aren't needed.
//
// This pass is not intended to be a replacement or a complete alternative
// for an LLVM-IR-level sinking pass. It is only designed to sink simple
// constructs that are not exposed before lowering and instruction selection.
//
//===----------------------------------------------------------------------===//

#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
using namespace llvm;

#define DEBUG_TYPE "machine-sink"

static cl::opt<bool>
SplitEdges("machine-sink-split",
           cl::desc("Split critical edges during machine sinking"),
           cl::init(true), cl::Hidden);

static cl::opt<bool>
UseBlockFreqInfo("machine-sink-bfi",
           cl::desc("Use block frequency info to find successors to sink"),
           cl::init(true), cl::Hidden);

STATISTIC(NumSunk,      "Number of machine instructions sunk");
STATISTIC(NumSplit,     "Number of critical edges split");
STATISTIC(NumCoalesces, "Number of copies coalesced");

namespace {
  class MachineSinking : public MachineFunctionPass {
    const TargetInstrInfo *TII;
    const TargetRegisterInfo *TRI;
    MachineRegisterInfo  *MRI;     // Machine register information
    MachineDominatorTree *DT;      // Machine dominator tree
    MachinePostDominatorTree *PDT; // Machine post dominator tree
    MachineLoopInfo *LI;
    const MachineBlockFrequencyInfo *MBFI;
    AliasAnalysis *AA;

    // Remember which edges have been considered for breaking.
    SmallSet<std::pair<MachineBasicBlock*,MachineBasicBlock*>, 8>
    CEBCandidates;
    // Remember which edges we are about to split.
    // This is different from CEBCandidates since those edges
    // will be split.
    SetVector<std::pair<MachineBasicBlock*,MachineBasicBlock*> > ToSplit;

  public:
    static char ID; // Pass identification
    MachineSinking() : MachineFunctionPass(ID) {
      initializeMachineSinkingPass(*PassRegistry::getPassRegistry());
    }

    bool runOnMachineFunction(MachineFunction &MF) override;

    void getAnalysisUsage(AnalysisUsage &AU) const override {
      AU.setPreservesCFG();
      MachineFunctionPass::getAnalysisUsage(AU);
      AU.addRequired<AliasAnalysis>();
      AU.addRequired<MachineDominatorTree>();
      AU.addRequired<MachinePostDominatorTree>();
      AU.addRequired<MachineLoopInfo>();
      AU.addPreserved<MachineDominatorTree>();
      AU.addPreserved<MachinePostDominatorTree>();
      AU.addPreserved<MachineLoopInfo>();
      if (UseBlockFreqInfo)
        AU.addRequired<MachineBlockFrequencyInfo>();
    }

    void releaseMemory() override {
      CEBCandidates.clear();
    }

  private:
    bool ProcessBlock(MachineBasicBlock &MBB);
    bool isWorthBreakingCriticalEdge(MachineInstr *MI,
                                     MachineBasicBlock *From,
                                     MachineBasicBlock *To);
    /// \brief Postpone the splitting of the given critical
    /// edge (\p From, \p To).
    ///
    /// We do not split the edges on the fly. Indeed, this invalidates
    /// the dominance information and thus triggers a lot of updates
    /// of that information underneath.
    /// Instead, we postpone all the splits after each iteration of
    /// the main loop. That way, the information is at least valid
    /// for the lifetime of an iteration.
    ///
    /// \return True if the edge is marked as toSplit, false otherwise.
    /// False can be returned if, for instance, this is not profitable.
    bool PostponeSplitCriticalEdge(MachineInstr *MI,
                                   MachineBasicBlock *From,
                                   MachineBasicBlock *To,
                                   bool BreakPHIEdge);
    bool SinkInstruction(MachineInstr *MI, bool &SawStore);
    bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB,
                                 MachineBasicBlock *DefMBB,
                                 bool &BreakPHIEdge, bool &LocalUse) const;
    MachineBasicBlock *FindSuccToSinkTo(MachineInstr *MI, MachineBasicBlock *MBB,
               bool &BreakPHIEdge);
    bool isProfitableToSinkTo(unsigned Reg, MachineInstr *MI,
                              MachineBasicBlock *MBB,
                              MachineBasicBlock *SuccToSinkTo);

    bool PerformTrivialForwardCoalescing(MachineInstr *MI,
                                         MachineBasicBlock *MBB);
  };
} // end anonymous namespace

char MachineSinking::ID = 0;
char &llvm::MachineSinkingID = MachineSinking::ID;
INITIALIZE_PASS_BEGIN(MachineSinking, "machine-sink",
                "Machine code sinking", false, false)
INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
INITIALIZE_PASS_END(MachineSinking, "machine-sink",
                "Machine code sinking", false, false)

bool MachineSinking::PerformTrivialForwardCoalescing(MachineInstr *MI,
                                                     MachineBasicBlock *MBB) {
  if (!MI->isCopy())
    return false;

  unsigned SrcReg = MI->getOperand(1).getReg();
  unsigned DstReg = MI->getOperand(0).getReg();
  if (!TargetRegisterInfo::isVirtualRegister(SrcReg) ||
      !TargetRegisterInfo::isVirtualRegister(DstReg) ||
      !MRI->hasOneNonDBGUse(SrcReg))
    return false;

  const TargetRegisterClass *SRC = MRI->getRegClass(SrcReg);
  const TargetRegisterClass *DRC = MRI->getRegClass(DstReg);
  if (SRC != DRC)
    return false;

  MachineInstr *DefMI = MRI->getVRegDef(SrcReg);
  if (DefMI->isCopyLike())
    return false;
  DEBUG(dbgs() << "Coalescing: " << *DefMI);
  DEBUG(dbgs() << "*** to: " << *MI);
  MRI->replaceRegWith(DstReg, SrcReg);
  MI->eraseFromParent();

  // Conservatively, clear any kill flags, since it's possible that they are no
  // longer correct.
  MRI->clearKillFlags(SrcReg);

  ++NumCoalesces;
  return true;
}

/// AllUsesDominatedByBlock - Return true if all uses of the specified register
/// occur in blocks dominated by the specified block. If any use is in the
/// definition block, then return false since it is never legal to move def
/// after uses.
bool
MachineSinking::AllUsesDominatedByBlock(unsigned Reg,
                                        MachineBasicBlock *MBB,
                                        MachineBasicBlock *DefMBB,
                                        bool &BreakPHIEdge,
                                        bool &LocalUse) const {
  assert(TargetRegisterInfo::isVirtualRegister(Reg) &&
         "Only makes sense for vregs");

  // Ignore debug uses because debug info doesn't affect the code.
  if (MRI->use_nodbg_empty(Reg))
    return true;

  // BreakPHIEdge is true if all the uses are in the successor MBB being sunken
  // into and they are all PHI nodes. In this case, machine-sink must break
  // the critical edge first. e.g.
  //
  // BB#1: derived from LLVM BB %bb4.preheader
  //   Predecessors according to CFG: BB#0
  //     ...
  //     %reg16385<def> = DEC64_32r %reg16437, %EFLAGS<imp-def,dead>
  //     ...
  //     JE_4 <BB#37>, %EFLAGS<imp-use>
  //   Successors according to CFG: BB#37 BB#2
  //
  // BB#2: derived from LLVM BB %bb.nph
  //   Predecessors according to CFG: BB#0 BB#1
  //     %reg16386<def> = PHI %reg16434, <BB#0>, %reg16385, <BB#1>
  BreakPHIEdge = true;
  for (MachineOperand &MO : MRI->use_nodbg_operands(Reg)) {
    MachineInstr *UseInst = MO.getParent();
    unsigned OpNo = &MO - &UseInst->getOperand(0);
    MachineBasicBlock *UseBlock = UseInst->getParent();
    if (!(UseBlock == MBB && UseInst->isPHI() &&
          UseInst->getOperand(OpNo+1).getMBB() == DefMBB)) {
      BreakPHIEdge = false;
      break;
    }
  }
  if (BreakPHIEdge)
    return true;

  for (MachineOperand &MO : MRI->use_nodbg_operands(Reg)) {
    // Determine the block of the use.
    MachineInstr *UseInst = MO.getParent();
    unsigned OpNo = &MO - &UseInst->getOperand(0);
    MachineBasicBlock *UseBlock = UseInst->getParent();
    if (UseInst->isPHI()) {
      // PHI nodes use the operand in the predecessor block, not the block with
      // the PHI.
      UseBlock = UseInst->getOperand(OpNo+1).getMBB();
    } else if (UseBlock == DefMBB) {
      LocalUse = true;
      return false;
    }

    // Check that it dominates.
    if (!DT->dominates(MBB, UseBlock))
      return false;
  }

  return true;
}

bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
  if (skipOptnoneFunction(*MF.getFunction()))
    return false;

  DEBUG(dbgs() << "******** Machine Sinking ********\n");

  TII = MF.getSubtarget().getInstrInfo();
  TRI = MF.getSubtarget().getRegisterInfo();
  MRI = &MF.getRegInfo();
  DT = &getAnalysis<MachineDominatorTree>();
  PDT = &getAnalysis<MachinePostDominatorTree>();
  LI = &getAnalysis<MachineLoopInfo>();
  MBFI = UseBlockFreqInfo ? &getAnalysis<MachineBlockFrequencyInfo>() : nullptr;
  AA = &getAnalysis<AliasAnalysis>();

  bool EverMadeChange = false;

  while (1) {
    bool MadeChange = false;

    // Process all basic blocks.
    CEBCandidates.clear();
    ToSplit.clear();
    for (MachineFunction::iterator I = MF.begin(), E = MF.end();
         I != E; ++I)
      MadeChange |= ProcessBlock(*I);

    // If we have anything we marked as toSplit, split it now.
    for (auto &Pair : ToSplit) {
      auto NewSucc = Pair.first->SplitCriticalEdge(Pair.second, this);
      if (NewSucc != nullptr) {
        DEBUG(dbgs() << " *** Splitting critical edge:"
              " BB#" << Pair.first->getNumber()
              << " -- BB#" << NewSucc->getNumber()
              << " -- BB#" << Pair.second->getNumber() << '\n');
        MadeChange = true;
        ++NumSplit;
      } else
        DEBUG(dbgs() << " *** Not legal to break critical edge\n");
    }
    // If this iteration over the code changed anything, keep iterating.
    if (!MadeChange) break;
    EverMadeChange = true;
  }
  return EverMadeChange;
}

bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {
  // Can't sink anything out of a block that has less than two successors.
  if (MBB.succ_size() <= 1 || MBB.empty()) return false;

  // Don't bother sinking code out of unreachable blocks. In addition to being
  // unprofitable, it can also lead to infinite looping, because in an
  // unreachable loop there may be nowhere to stop.
  if (!DT->isReachableFromEntry(&MBB)) return false;

  bool MadeChange = false;

  // Walk the basic block bottom-up.  Remember if we saw a store.
  MachineBasicBlock::iterator I = MBB.end();
  --I;
  bool ProcessedBegin, SawStore = false;
  do {
    MachineInstr *MI = I;  // The instruction to sink.

    // Predecrement I (if it's not begin) so that it isn't invalidated by
    // sinking.
    ProcessedBegin = I == MBB.begin();
    if (!ProcessedBegin)
      --I;

    if (MI->isDebugValue())
      continue;

    bool Joined = PerformTrivialForwardCoalescing(MI, &MBB);
    if (Joined) {
      MadeChange = true;
      continue;
    }

    if (SinkInstruction(MI, SawStore))
      ++NumSunk, MadeChange = true;

    // If we just processed the first instruction in the block, we're done.
  } while (!ProcessedBegin);

  return MadeChange;
}

bool MachineSinking::isWorthBreakingCriticalEdge(MachineInstr *MI,
                                                 MachineBasicBlock *From,
                                                 MachineBasicBlock *To) {
  // FIXME: Need much better heuristics.

  // If the pass has already considered breaking this edge (during this pass
  // through the function), then let's go ahead and break it. This means
  // sinking multiple "cheap" instructions into the same block.
  if (!CEBCandidates.insert(std::make_pair(From, To)).second)
    return true;

  if (!MI->isCopy() && !TII->isAsCheapAsAMove(MI))
    return true;

  // MI is cheap, we probably don't want to break the critical edge for it.
  // However, if this would allow some definitions of its source operands
  // to be sunk then it's probably worth it.
  for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
    const MachineOperand &MO = MI->getOperand(i);
    if (!MO.isReg() || !MO.isUse())
      continue;
    unsigned Reg = MO.getReg();
    if (Reg == 0)
      continue;

    // We don't move live definitions of physical registers,
    // so sinking their uses won't enable any opportunities.
    if (TargetRegisterInfo::isPhysicalRegister(Reg))
      continue;

    // If this instruction is the only user of a virtual register,
    // check if breaking the edge will enable sinking
    // both this instruction and the defining instruction.
    if (MRI->hasOneNonDBGUse(Reg)) {
      // If the definition resides in same MBB,
      // claim it's likely we can sink these together.
      // If definition resides elsewhere, we aren't
      // blocking it from being sunk so don't break the edge.
      MachineInstr *DefMI = MRI->getVRegDef(Reg);
      if (DefMI->getParent() == MI->getParent())
        return true;
    }
  }

  return false;
}

bool MachineSinking::PostponeSplitCriticalEdge(MachineInstr *MI,
                                               MachineBasicBlock *FromBB,
                                               MachineBasicBlock *ToBB,
                                               bool BreakPHIEdge) {
  if (!isWorthBreakingCriticalEdge(MI, FromBB, ToBB))
    return false;

  // Avoid breaking back edge. From == To means backedge for single BB loop.
  if (!SplitEdges || FromBB == ToBB)
    return false;

  // Check for backedges of more "complex" loops.
  if (LI->getLoopFor(FromBB) == LI->getLoopFor(ToBB) &&
      LI->isLoopHeader(ToBB))
    return false;

  // It's not always legal to break critical edges and sink the computation
  // to the edge.
  //
  // BB#1:
  // v1024
  // Beq BB#3
  // <fallthrough>
  // BB#2:
  // ... no uses of v1024
  // <fallthrough>
  // BB#3:
  // ...
  //       = v1024
  //
  // If BB#1 -> BB#3 edge is broken and computation of v1024 is inserted:
  //
  // BB#1:
  // ...
  // Bne BB#2
  // BB#4:
  // v1024 =
  // B BB#3
  // BB#2:
  // ... no uses of v1024
  // <fallthrough>
  // BB#3:
  // ...
  //       = v1024
  //
  // This is incorrect since v1024 is not computed along the BB#1->BB#2->BB#3
  // flow. We need to ensure the new basic block where the computation is
  // sunk to dominates all the uses.
  // It's only legal to break critical edge and sink the computation to the
  // new block if all the predecessors of "To", except for "From", are
  // not dominated by "From". Given SSA property, this means these
  // predecessors are dominated by "To".
  //
  // There is no need to do this check if all the uses are PHI nodes. PHI
  // sources are only defined on the specific predecessor edges.
  if (!BreakPHIEdge) {
    for (MachineBasicBlock::pred_iterator PI = ToBB->pred_begin(),
           E = ToBB->pred_end(); PI != E; ++PI) {
      if (*PI == FromBB)
        continue;
      if (!DT->dominates(ToBB, *PI))
        return false;
    }
  }

  ToSplit.insert(std::make_pair(FromBB, ToBB));

  return true;
}

static bool AvoidsSinking(MachineInstr *MI, MachineRegisterInfo *MRI) {
  return MI->isInsertSubreg() || MI->isSubregToReg() || MI->isRegSequence();
}

/// collectDebgValues - Scan instructions following MI and collect any
/// matching DBG_VALUEs.
static void collectDebugValues(MachineInstr *MI,
                               SmallVectorImpl<MachineInstr *> &DbgValues) {
  DbgValues.clear();
  if (!MI->getOperand(0).isReg())
    return;

  MachineBasicBlock::iterator DI = MI; ++DI;
  for (MachineBasicBlock::iterator DE = MI->getParent()->end();
       DI != DE; ++DI) {
    if (!DI->isDebugValue())
      return;
    if (DI->getOperand(0).isReg() &&
        DI->getOperand(0).getReg() == MI->getOperand(0).getReg())
      DbgValues.push_back(DI);
  }
}

/// isProfitableToSinkTo - Return true if it is profitable to sink MI.
bool MachineSinking::isProfitableToSinkTo(unsigned Reg, MachineInstr *MI,
                                          MachineBasicBlock *MBB,
                                          MachineBasicBlock *SuccToSinkTo) {
  assert (MI && "Invalid MachineInstr!");
  assert (SuccToSinkTo && "Invalid SinkTo Candidate BB");

  if (MBB == SuccToSinkTo)
    return false;

  // It is profitable if SuccToSinkTo does not post dominate current block.
  if (!PDT->dominates(SuccToSinkTo, MBB))
    return true;

  // It is profitable to sink an instruction from a deeper loop to a shallower
  // loop, even if the latter post-dominates the former (PR21115).
  if (LI->getLoopDepth(MBB) > LI->getLoopDepth(SuccToSinkTo))
    return true;

  // Check if only use in post dominated block is PHI instruction.
  bool NonPHIUse = false;
  for (MachineInstr &UseInst : MRI->use_nodbg_instructions(Reg)) {
    MachineBasicBlock *UseBlock = UseInst.getParent();
    if (UseBlock == SuccToSinkTo && !UseInst.isPHI())
      NonPHIUse = true;
  }
  if (!NonPHIUse)
    return true;

  // If SuccToSinkTo post dominates then also it may be profitable if MI
  // can further profitably sinked into another block in next round.
  bool BreakPHIEdge = false;
  // FIXME - If finding successor is compile time expensive then cache results.
  if (MachineBasicBlock *MBB2 = FindSuccToSinkTo(MI, SuccToSinkTo, BreakPHIEdge))
    return isProfitableToSinkTo(Reg, MI, SuccToSinkTo, MBB2);

  // If SuccToSinkTo is final destination and it is a post dominator of current
  // block then it is not profitable to sink MI into SuccToSinkTo block.
  return false;
}

/// FindSuccToSinkTo - Find a successor to sink this instruction to.
MachineBasicBlock *MachineSinking::FindSuccToSinkTo(MachineInstr *MI,
                                   MachineBasicBlock *MBB,
                                   bool &BreakPHIEdge) {

  assert (MI && "Invalid MachineInstr!");
  assert (MBB && "Invalid MachineBasicBlock!");

  // Loop over all the operands of the specified instruction.  If there is
  // anything we can't handle, bail out.

  // SuccToSinkTo - This is the successor to sink this instruction to, once we
  // decide.
  MachineBasicBlock *SuccToSinkTo = nullptr;
  for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
    const MachineOperand &MO = MI->getOperand(i);
    if (!MO.isReg()) continue;  // Ignore non-register operands.

    unsigned Reg = MO.getReg();
    if (Reg == 0) continue;

    if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
      if (MO.isUse()) {
        // If the physreg has no defs anywhere, it's just an ambient register
        // and we can freely move its uses. Alternatively, if it's allocatable,
        // it could get allocated to something with a def during allocation.
        if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
          return nullptr;
      } else if (!MO.isDead()) {
        // A def that isn't dead. We can't move it.
        return nullptr;
      }
    } else {
      // Virtual register uses are always safe to sink.
      if (MO.isUse()) continue;

      // If it's not safe to move defs of the register class, then abort.
      if (!TII->isSafeToMoveRegClassDefs(MRI->getRegClass(Reg)))
        return nullptr;

      // Virtual register defs can only be sunk if all their uses are in blocks
      // dominated by one of the successors.
      if (SuccToSinkTo) {
        // If a previous operand picked a block to sink to, then this operand
        // must be sinkable to the same block.
        bool LocalUse = false;
        if (!AllUsesDominatedByBlock(Reg, SuccToSinkTo, MBB,
                                     BreakPHIEdge, LocalUse))
          return nullptr;

        continue;
      }

      // Otherwise, we should look at all the successors and decide which one
      // we should sink to. If we have reliable block frequency information
      // (frequency != 0) available, give successors with smaller frequencies
      // higher priority, otherwise prioritize smaller loop depths.
      SmallVector<MachineBasicBlock*, 4> Succs(MBB->succ_begin(),
                                               MBB->succ_end());

      // Handle cases where sinking can happen but where the sink point isn't a
      // successor. For example:
      //
      //   x = computation
      //   if () {} else {}
      //   use x
      //
      const std::vector<MachineDomTreeNode *> &Children =
        DT->getNode(MBB)->getChildren();
      for (const auto &DTChild : Children)
        // DomTree children of MBB that have MBB as immediate dominator are added.
        if (DTChild->getIDom()->getBlock() == MI->getParent() &&
            // Skip MBBs already added to the Succs vector above.
            !MBB->isSuccessor(DTChild->getBlock()))
          Succs.push_back(DTChild->getBlock());

      // Sort Successors according to their loop depth or block frequency info.
      std::stable_sort(
          Succs.begin(), Succs.end(),
          [this](const MachineBasicBlock *L, const MachineBasicBlock *R) {
            uint64_t LHSFreq = MBFI ? MBFI->getBlockFreq(L).getFrequency() : 0;
            uint64_t RHSFreq = MBFI ? MBFI->getBlockFreq(R).getFrequency() : 0;
            bool HasBlockFreq = LHSFreq != 0 && RHSFreq != 0;
            return HasBlockFreq ? LHSFreq < RHSFreq
                                : LI->getLoopDepth(L) < LI->getLoopDepth(R);
          });
      for (SmallVectorImpl<MachineBasicBlock *>::iterator SI = Succs.begin(),
             E = Succs.end(); SI != E; ++SI) {
        MachineBasicBlock *SuccBlock = *SI;
        bool LocalUse = false;
        if (AllUsesDominatedByBlock(Reg, SuccBlock, MBB,
                                    BreakPHIEdge, LocalUse)) {
          SuccToSinkTo = SuccBlock;
          break;
        }
        if (LocalUse)
          // Def is used locally, it's never safe to move this def.
          return nullptr;
      }

      // If we couldn't find a block to sink to, ignore this instruction.
      if (!SuccToSinkTo)
        return nullptr;
      if (!isProfitableToSinkTo(Reg, MI, MBB, SuccToSinkTo))
        return nullptr;
    }
  }

  // It is not possible to sink an instruction into its own block.  This can
  // happen with loops.
  if (MBB == SuccToSinkTo)
    return nullptr;

  // It's not safe to sink instructions to EH landing pad. Control flow into
  // landing pad is implicitly defined.
  if (SuccToSinkTo && SuccToSinkTo->isLandingPad())
    return nullptr;

  return SuccToSinkTo;
}

/// SinkInstruction - Determine whether it is safe to sink the specified machine
/// instruction out of its current block into a successor.
bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) {
  // Don't sink insert_subreg, subreg_to_reg, reg_sequence. These are meant to
  // be close to the source to make it easier to coalesce.
  if (AvoidsSinking(MI, MRI))
    return false;

  // Check if it's safe to move the instruction.
  if (!MI->isSafeToMove(TII, AA, SawStore))
    return false;

  // FIXME: This should include support for sinking instructions within the
  // block they are currently in to shorten the live ranges.  We often get
  // instructions sunk into the top of a large block, but it would be better to
  // also sink them down before their first use in the block.  This xform has to
  // be careful not to *increase* register pressure though, e.g. sinking
  // "x = y + z" down if it kills y and z would increase the live ranges of y
  // and z and only shrink the live range of x.

  bool BreakPHIEdge = false;
  MachineBasicBlock *ParentBlock = MI->getParent();
  MachineBasicBlock *SuccToSinkTo = FindSuccToSinkTo(MI, ParentBlock, BreakPHIEdge);

  // If there are no outputs, it must have side-effects.
  if (!SuccToSinkTo)
    return false;

  // If the instruction to move defines a dead physical register which is live
  // when leaving the basic block, don't move it because it could turn into a
  // "zombie" define of that preg. E.g., EFLAGS. (<rdar://problem/8030636>)
  for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) {
    const MachineOperand &MO = MI->getOperand(I);
    if (!MO.isReg()) continue;
    unsigned Reg = MO.getReg();
    if (Reg == 0 || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue;
    if (SuccToSinkTo->isLiveIn(Reg))
      return false;
  }

  DEBUG(dbgs() << "Sink instr " << *MI << "\tinto block " << *SuccToSinkTo);

  // If the block has multiple predecessors, this is a critical edge.
  // Decide if we can sink along it or need to break the edge.
  if (SuccToSinkTo->pred_size() > 1) {
    // We cannot sink a load across a critical edge - there may be stores in
    // other code paths.
    bool TryBreak = false;
    bool store = true;
    if (!MI->isSafeToMove(TII, AA, store)) {
      DEBUG(dbgs() << " *** NOTE: Won't sink load along critical edge.\n");
      TryBreak = true;
    }

    // We don't want to sink across a critical edge if we don't dominate the
    // successor. We could be introducing calculations to new code paths.
    if (!TryBreak && !DT->dominates(ParentBlock, SuccToSinkTo)) {
      DEBUG(dbgs() << " *** NOTE: Critical edge found\n");
      TryBreak = true;
    }

    // Don't sink instructions into a loop.
    if (!TryBreak && LI->isLoopHeader(SuccToSinkTo)) {
      DEBUG(dbgs() << " *** NOTE: Loop header found\n");
      TryBreak = true;
    }

    // Otherwise we are OK with sinking along a critical edge.
    if (!TryBreak)
      DEBUG(dbgs() << "Sinking along critical edge.\n");
    else {
      // Mark this edge as to be split.
      // If the edge can actually be split, the next iteration of the main loop
      // will sink MI in the newly created block.
      bool Status =
        PostponeSplitCriticalEdge(MI, ParentBlock, SuccToSinkTo, BreakPHIEdge);
      if (!Status)
        DEBUG(dbgs() << " *** PUNTING: Not legal or profitable to "
              "break critical edge\n");
      // The instruction will not be sunk this time.
      return false;
    }
  }

  if (BreakPHIEdge) {
    // BreakPHIEdge is true if all the uses are in the successor MBB being
    // sunken into and they are all PHI nodes. In this case, machine-sink must
    // break the critical edge first.
    bool Status = PostponeSplitCriticalEdge(MI, ParentBlock,
                                            SuccToSinkTo, BreakPHIEdge);
    if (!Status)
      DEBUG(dbgs() << " *** PUNTING: Not legal or profitable to "
            "break critical edge\n");
    // The instruction will not be sunk this time.
    return false;
  }

  // Determine where to insert into. Skip phi nodes.
  MachineBasicBlock::iterator InsertPos = SuccToSinkTo->begin();
  while (InsertPos != SuccToSinkTo->end() && InsertPos->isPHI())
    ++InsertPos;

  // collect matching debug values.
  SmallVector<MachineInstr *, 2> DbgValuesToSink;
  collectDebugValues(MI, DbgValuesToSink);

  // Move the instruction.
  SuccToSinkTo->splice(InsertPos, ParentBlock, MI,
                       ++MachineBasicBlock::iterator(MI));

  // Move debug values.
  for (SmallVectorImpl<MachineInstr *>::iterator DBI = DbgValuesToSink.begin(),
         DBE = DbgValuesToSink.end(); DBI != DBE; ++DBI) {
    MachineInstr *DbgMI = *DBI;
    SuccToSinkTo->splice(InsertPos, ParentBlock,  DbgMI,
                         ++MachineBasicBlock::iterator(DbgMI));
  }

  // Conservatively, clear any kill flags, since it's possible that they are no
  // longer correct.
  MI->clearKillInfo();

  return true;
}

{'repo_name': 'KhronosGroup/SPIRV-LLVM', 'stars': '264', 'repo_language': 'C++', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': -1629086128409527998, 'source_dataset': 'data'}


from django.conf.urls import url
from .views import (home, add_search, add ,single_show, episode_swt, season_swt, search, update_show, update_show_rating, recommended, update_all_continuing, delete_show)
urlpatterns = [
    url(r'^(?P<view_type>|all||)$', home),
    url(r'^update_all_shows', update_all_continuing),
    url(r'^update_show', update_show),
    url(r'^delete_show', delete_show),
    url(r'^update_rating', update_show_rating),
    url(r'^recommended', recommended),
    url(r'^add_search', add_search),
    url(r'^add', add),
    url(r'^search', search, name='search'),
    url(r'^show/(?P<show_slug>[a-zA-Z0-9-]*$)', single_show),
    url(r'^episode_swt', episode_swt),
    url(r'^season_swt', season_swt),
]

{'repo_name': 'guptachetan1997/Episodes', 'stars': '147', 'repo_language': 'Python', 'file_name': 'settings.py', 'mime_type': 'text/plain', 'hash': 4040168339707639033, 'source_dataset': 'data'}


<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
<body>
<m:ms><m:mfenced/></m:ms>
</body>
</html>

{'repo_name': 'ricardoquesada/Spidermonkey', 'stars': '201', 'repo_language': 'C++', 'file_name': 'panelUI.css', 'mime_type': 'text/plain', 'hash': 5071477463713564474, 'source_dataset': 'data'}


/*
   Copyright The containerd Authors.

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

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

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package cgroups

// Hierarchy enables both unified and split hierarchy for cgroups
type Hierarchy func() ([]Subsystem, error)

{'repo_name': 'containerd/cgroups', 'stars': '461', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 58616966887607351, 'source_dataset': 'data'}


/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/waf-regional/WAFRegional_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/waf-regional/model/SubscribedRuleGroupSummary.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace WAFRegional
{
namespace Model
{
  class AWS_WAFREGIONAL_API ListSubscribedRuleGroupsResult
  {
  public:
    ListSubscribedRuleGroupsResult();
    ListSubscribedRuleGroupsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListSubscribedRuleGroupsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline const Aws::String& GetNextMarker() const{ return m_nextMarker; }

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline void SetNextMarker(const Aws::String& value) { m_nextMarker = value; }

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline void SetNextMarker(Aws::String&& value) { m_nextMarker = std::move(value); }

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline void SetNextMarker(const char* value) { m_nextMarker.assign(value); }

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline ListSubscribedRuleGroupsResult& WithNextMarker(const Aws::String& value) { SetNextMarker(value); return *this;}

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline ListSubscribedRuleGroupsResult& WithNextMarker(Aws::String&& value) { SetNextMarker(std::move(value)); return *this;}

    /**
     *
If you have more objects than the number that you specified for
     * Limit in the request, the response includes a
     * NextMarker value. To list more objects, submit another
     * ListSubscribedRuleGroups request, and specify the
     * NextMarker value from the response in the NextMarker
     * value in the next request.

     */
    inline ListSubscribedRuleGroupsResult& WithNextMarker(const char* value) { SetNextMarker(value); return *this;}

    /**
     *
An array of RuleGroup objects.

     */
    inline const Aws::Vector<SubscribedRuleGroupSummary>& GetRuleGroups() const{ return m_ruleGroups; }

    /**
     *
An array of RuleGroup objects.

     */
    inline void SetRuleGroups(const Aws::Vector<SubscribedRuleGroupSummary>& value) { m_ruleGroups = value; }

    /**
     *
An array of RuleGroup objects.

     */
    inline void SetRuleGroups(Aws::Vector<SubscribedRuleGroupSummary>&& value) { m_ruleGroups = std::move(value); }

    /**
     *
An array of RuleGroup objects.

     */
    inline ListSubscribedRuleGroupsResult& WithRuleGroups(const Aws::Vector<SubscribedRuleGroupSummary>& value) { SetRuleGroups(value); return *this;}

    /**
     *
An array of RuleGroup objects.

     */
    inline ListSubscribedRuleGroupsResult& WithRuleGroups(Aws::Vector<SubscribedRuleGroupSummary>&& value) { SetRuleGroups(std::move(value)); return *this;}

    /**
     *
An array of RuleGroup objects.

     */
    inline ListSubscribedRuleGroupsResult& AddRuleGroups(const SubscribedRuleGroupSummary& value) { m_ruleGroups.push_back(value); return *this; }

    /**
     *
An array of RuleGroup objects.

     */
    inline ListSubscribedRuleGroupsResult& AddRuleGroups(SubscribedRuleGroupSummary&& value) { m_ruleGroups.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_nextMarker;

    Aws::Vector<SubscribedRuleGroupSummary> m_ruleGroups;
  };

} // namespace Model
} // namespace WAFRegional
} // namespace Aws

{'repo_name': 'aws/aws-sdk-cpp', 'stars': '1060', 'repo_language': 'C++', 'file_name': 'RunTests.cpp', 'mime_type': 'text/x-c', 'hash': 4919439826012897482, 'source_dataset': 'data'}


/*
 * Copyright (c) 2014 Glen Fernandes
 *
 * Distributed under the Boost Software License, Version 1.0. (See
 * accompanying file LICENSE_1_0.txt or copy at
 * http://www.boost.org/LICENSE_1_0.txt)
 */

#ifndef BOOST_UTILITY_ENABLE_IF_HPP
#define BOOST_UTILITY_ENABLE_IF_HPP

// The header file at this path is deprecated;
// use boost/core/enable_if.hpp instead.

#include <boost/core/enable_if.hpp>

#endif

{'repo_name': 'sunlight3d/react_native_v0.49', 'stars': '218', 'repo_language': 'Objective-C', 'file_name': 'profiles_settings.xml', 'mime_type': 'text/plain', 'hash': 966271255551782212, 'source_dataset': 'data'}


// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_
#define COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_

#include <stdint.h>

#include <string>
#include <vector>

#include "base/macros.h"
#include "components/mus/common/types.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "mojo/public/cpp/bindings/array.h"
#include "ui/gfx/geometry/mojo/geometry.mojom.h"

namespace mus {

namespace ws {

enum ChangeType {
  CHANGE_TYPE_EMBED,
  CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED,
  CHANGE_TYPE_UNEMBED,
  CHANGE_TYPE_LOST_CAPTURE,
  // TODO(sky): nuke NODE.
  CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW,
  CHANGE_TYPE_NODE_BOUNDS_CHANGED,
  CHANGE_TYPE_NODE_HIERARCHY_CHANGED,
  CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT,
  CHANGE_TYPE_NODE_REORDERED,
  CHANGE_TYPE_NODE_VISIBILITY_CHANGED,
  CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED,
  CHANGE_TYPE_NODE_DELETED,
  CHANGE_TYPE_INPUT_EVENT,
  CHANGE_TYPE_EVENT_OBSERVED,
  CHANGE_TYPE_PROPERTY_CHANGED,
  CHANGE_TYPE_FOCUSED,
  CHANGE_TYPE_CURSOR_CHANGED,
  CHANGE_TYPE_ON_CHANGE_COMPLETED,
  CHANGE_TYPE_ON_TOP_LEVEL_CREATED,
  CHANGE_TYPE_OPACITY,
};

// TODO(sky): consider nuking and converting directly to WindowData.
struct TestWindow {
  TestWindow();
  TestWindow(const TestWindow& other);
  ~TestWindow();

  // Returns a string description of this.
  std::string ToString() const;

  // Returns a string description that includes visible and drawn.
  std::string ToString2() const;

  Id parent_id;
  Id window_id;
  bool visible;
  std::map<std::string, std::vector<uint8_t>> properties;
};

// Tracks a call to WindowTreeClient. See the individual functions for the
// fields that are used.
struct Change {
  Change();
  Change(const Change& other);
  ~Change();

  ChangeType type;
  ClientSpecificId client_id;
  std::vector<TestWindow> windows;
  Id window_id;
  Id window_id2;
  Id window_id3;
  gfx::Rect bounds;
  gfx::Rect bounds2;
  int32_t event_action;
  uint32_t event_observer_id;
  mojo::String embed_url;
  mojom::OrderDirection direction;
  bool bool_value;
  float float_value;
  std::string property_key;
  std::string property_value;
  int32_t cursor_id;
  uint32_t change_id;
};

// Converts Changes to string descriptions.
std::vector<std::string> ChangesToDescription1(
    const std::vector<Change>& changes);

// Convenience for returning the description of the first item in |changes|.
// Returns an empty string if |changes| has something other than one entry.
std::string SingleChangeToDescription(const std::vector<Change>& changes);
std::string SingleChangeToDescription2(const std::vector<Change>& changes);

// Convenience for returning the description of the first item in |windows|.
// Returns an empty string if |windows| has something other than one entry.
std::string SingleWindowDescription(const std::vector<TestWindow>& windows);

// Returns a string description of |changes[0].windows|. Returns an empty string
// if change.size() != 1.
std::string ChangeWindowDescription(const std::vector<Change>& changes);

// Converts WindowDatas to TestWindows.
void WindowDatasToTestWindows(const mojo::Array<mojom::WindowDataPtr>& data,
                              std::vector<TestWindow>* test_windows);

// TestChangeTracker is used to record WindowTreeClient functions. It notifies
// a delegate any time a change is added.
class TestChangeTracker {
 public:
  // Used to notify the delegate when a change is added. A change corresponds to
  // a single WindowTreeClient function.
  class Delegate {
   public:
    virtual void OnChangeAdded() = 0;

   protected:
    virtual ~Delegate() {}
  };

  TestChangeTracker();
  ~TestChangeTracker();

  void set_delegate(Delegate* delegate) { delegate_ = delegate; }

  std::vector<Change>* changes() { return &changes_; }

  // Each of these functions generate a Change. There is one per
  // WindowTreeClient function.
  void OnEmbed(ClientSpecificId client_id,
               mojom::WindowDataPtr root,
               bool drawn);
  void OnEmbeddedAppDisconnected(Id window_id);
  void OnUnembed(Id window_id);
  void OnLostCapture(Id window_id);
  void OnTransientWindowAdded(Id window_id, Id transient_window_id);
  void OnTransientWindowRemoved(Id window_id, Id transient_window_id);
  void OnWindowBoundsChanged(Id window_id,
                             const gfx::Rect& old_bounds,
                             const gfx::Rect& new_bounds);
  void OnWindowHierarchyChanged(Id window_id,
                                Id old_parent_id,
                                Id new_parent_id,
                                mojo::Array<mojom::WindowDataPtr> windows);
  void OnWindowReordered(Id window_id,
                         Id relative_window_id,
                         mojom::OrderDirection direction);
  void OnWindowDeleted(Id window_id);
  void OnWindowVisibilityChanged(Id window_id, bool visible);
  void OnWindowOpacityChanged(Id window_id, float opacity);
  void OnWindowParentDrawnStateChanged(Id window_id, bool drawn);
  void OnWindowInputEvent(Id window_id,
                          const ui::Event& event,
                          uint32_t event_observer_id);
  void OnEventObserved(const ui::Event& event, uint32_t event_observer_id);
  void OnWindowSharedPropertyChanged(Id window_id,
                                     mojo::String name,
                                     mojo::Array<uint8_t> data);
  void OnWindowFocused(Id window_id);
  void OnWindowPredefinedCursorChanged(Id window_id, mojom::Cursor cursor_id);
  void OnChangeCompleted(uint32_t change_id, bool success);
  void OnTopLevelCreated(uint32_t change_id,
                         mojom::WindowDataPtr window_data,
                         bool drawn);

 private:
  void AddChange(const Change& change);

  Delegate* delegate_;
  std::vector<Change> changes_;

  DISALLOW_COPY_AND_ASSIGN(TestChangeTracker);
};

}  // namespace ws

}  // namespace mus

#endif  // COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_

{'repo_name': 'crosswalk-project/chromium-crosswalk', 'stars': '146', 'repo_language': 'None', 'file_name': 'keyboard_utils.js', 'mime_type': 'text/plain', 'hash': 6240331817002426442, 'source_dataset': 'data'}


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>OrangeHRM Quick Start Guide</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Welcome to OrangeHRM Quick Start Guide!

Below you can find links to our web site where installation prerequisites and installation process are explained. Make sure you are connected to the Internet to follow these links. If you find any problem, feel free to post it at our forum.

Installing OrangeHRM  in Windows

Prerequisites for installing in Windows

Installing steps for Windows (Using EXE)

Installing steps for Windows (Using Web installer)

Installing OrangeHRM  in Linux

Prerequisites for installing in Linux

Installing steps for Linux

OrangeHRM Mobile App

{'repo_name': 'orangehrm/orangehrm', 'stars': '216', 'repo_language': 'PHP', 'file_name': 'AttendanceDao.yml', 'mime_type': 'text/plain', 'hash': 3212332287554026883, 'source_dataset': 'data'}


package mapper

import (
	"errors"
	"fmt"

	"github.com/sirupsen/logrus"
	"k8s.io/apimachinery/pkg/util/sets"
	"sigs.k8s.io/aws-iam-authenticator/pkg/config"
)

const (
	// Deprecated: use ModeMountedFile instead
	ModeFile string = "File"
	// Deprecated: use ModeEKSConfigMap instead
	ModeConfigMap string = "ConfigMap"

	ModeMountedFile string = "MountedFile"

	ModeEKSConfigMap string = "EKSConfigMap"

	ModeCRD string = "CRD"
)

var (
	ValidBackendModeChoices      = []string{ModeFile, ModeConfigMap, ModeMountedFile, ModeEKSConfigMap, ModeCRD}
	DeprecatedBackendModeChoices = map[string]string{
		ModeFile:      ModeMountedFile,
		ModeConfigMap: ModeEKSConfigMap,
	}
	BackendModeChoices = []string{ModeMountedFile, ModeEKSConfigMap, ModeCRD}
)

var ErrNotMapped = errors.New("ARN is not mapped")

type Mapper interface {
	Name() string
	// Start must be non-blocking
	Start(stopCh <-chan struct{}) error
	Map(canonicalARN string) (*config.IdentityMapping, error)
	IsAccountAllowed(accountID string) bool
}

func ValidateBackendMode(modes []string) []error {
	var errs []error

	validModes := sets.NewString(ValidBackendModeChoices...)
	for _, mode := range modes {
		if !validModes.Has(mode) {
			errs = append(errs, fmt.Errorf("backend-mode %q is not a valid mode", mode))
		}
	}

	for _, mode := range modes {
		if replacementMode, ok := DeprecatedBackendModeChoices[mode]; ok {
			logrus.Warningf("warning: backend-mode %q is deprecated, use %q instead", mode, replacementMode)
		}
	}

	if len(modes) != sets.NewString(modes...).Len() {
		errs = append(errs, fmt.Errorf("backend-mode %q has duplicates", modes))
	}

	if len(modes) == 0 {
		errs = append(errs, fmt.Errorf("at least one backend-mode must be specified"))
	}

	return errs
}

{'repo_name': 'kubernetes-sigs/aws-iam-authenticator', 'stars': '1446', 'repo_language': 'Go', 'file_name': 'server.go', 'mime_type': 'text/plain', 'hash': 6564114226601147929, 'source_dataset': 'data'}


# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import unittest

from webkitpy.layout_tests.models.test_results import TestResult

class TestResultsTest(unittest.TestCase):
    def test_defaults(self):
        result = TestResult("foo")
        self.assertEqual(result.test_name, 'foo')
        self.assertEqual(result.failures, [])
        self.assertEqual(result.test_run_time, 0)

    def test_loads(self):
        result = TestResult(test_name='foo',
                            failures=[],
                            test_run_time=1.1)
        s = result.dumps()
        new_result = TestResult.loads(s)
        self.assertIsInstance(new_result, TestResult)

        self.assertEqual(new_result, result)

        # Also check that != is implemented.
        self.assertFalse(new_result != result)

{'repo_name': 'mceSystems/node-jsc', 'stars': '178', 'repo_language': 'JavaScript', 'file_name': 'dnt_helper.js', 'mime_type': 'text/plain', 'hash': -2374623783158141844, 'source_dataset': 'data'}


<!DOCTYPE html>
<html>
    <head>
        <title>{{ title }}</title>
    </head>
    <body>
        {{ customVariable }}
    </body>
</html>

{'repo_name': 'CouscousPHP/Couscous', 'stars': '779', 'repo_language': 'PHP', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': -6616677458892505507, 'source_dataset': 'data'}


{-# LANGUAGE MultiParamTypeClasses #-}
module Reflex.Dom.Class ( module Reflex.Dom.Class
                        , module Foreign.JavaScript.TH
                        , module Web.KeyCode
                        ) where

import Control.Lens
import Reflex.Class
import Web.KeyCode

import Foreign.JavaScript.TH
import Reflex.PerformEvent.Class
import Reflex.PostBuild.Class

-- | Previously an alias for 'Data.Map.singleton', but now generalised to 'At'
(=:) :: (At m, Monoid m) => Index m -> IxValue m -> m
k =: a = at k ?~ a $ mempty
infixr 7 =: -- Ought to bind tighter than <>, which is infixr 6

{-# DEPRECATED keycodeEnter "Instead of `x == keycodeEnter`, use `keyCodeLookup x == Enter`" #-}
keycodeEnter :: Int
keycodeEnter = 13

{-# DEPRECATED keycodeEscape "Instead of `x == keycodeEscape`, use `keyCodeLookup x == Escape`" #-}
keycodeEscape :: Int
keycodeEscape = 27

{-# INLINABLE holdOnStartup #-}
holdOnStartup :: (PostBuild t m, PerformEvent t m, MonadHold t m) => a -> Performable m a -> m (Behavior t a)
holdOnStartup a0 ma = do
  hold a0 =<< performEvent . (ma <$) =<< getPostBuild

{'repo_name': 'reflex-frp/reflex-dom', 'stars': '284', 'repo_language': 'Haskell', 'file_name': 'default.nix', 'mime_type': 'text/plain', 'hash': 913653890206456294, 'source_dataset': 'data'}


using Sandbox.Game.Entities.Cube;
using Sandbox.Game.Gui;
using Sandbox.Graphics.GUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VRage;
using VRage.Utils;
using Sandbox.ModAPI;
using Sandbox.ModAPI.Interfaces.Terminal;

namespace Sandbox.Game.Screens.Terminal.Controls
{
    public class MyTerminalControlLabel<TBlock> : MyTerminalControl<TBlock>, IMyTerminalControlLabel
        where TBlock : MyTerminalBlock
    {
        public MyStringId Label;
        MyGuiControlLabel m_label;
        public MyTerminalControlLabel(MyStringId label)
            : base("Label")
        {
            Label = label;
        }

        protected override MyGuiControlBase CreateGui()
        {
            m_label = new MyGuiControlLabel();
            return new MyGuiControlBlockProperty(MyTexts.GetString(Label), null, m_label, MyGuiControlBlockPropertyLayoutEnum.Horizontal);
        }

        /// <summary>
        /// Implement IMyTerminalControlLabel for Mods
        /// </summary>
        MyStringId IMyTerminalControlLabel.Label
        {
            get
            {
                return Label;
            }

            set
            {
                Label = value;
            }
        }
    }
}

{'repo_name': 'KeenSoftwareHouse/SpaceEngineers', 'stars': '2743', 'repo_language': 'C#', 'file_name': 'System.Data.SQLite.xml', 'mime_type': 'text/xml', 'hash': 6010592641444198040, 'source_dataset': 'data'}


/******************************************************************************
 * bipartition.h
 * *
 * Source of KaHIP -- Karlsruhe High Quality Partitioning.
 * Christian Schulz <christian.schulz.phone@gmail.com>
 *****************************************************************************/

#ifndef BIPARTITION_7I4IR31Y
#define BIPARTITION_7I4IR31Y

#include "initial_partitioner.h"

class bipartition : public initial_partitioner {
        public:
                bipartition();
                virtual ~bipartition();

                void initial_partition( const PartitionConfig & config,
                                        const unsigned int seed,
                                        graph_access & G,
                                        int* partition_map);

                void initial_partition( const PartitionConfig & config,
                                const unsigned int seed,
                                graph_access & G,
                                int* xadj,
                                int* adjncy,
                                int* vwgt,
                                int* adjwgt,
                                int* partition_map);

        private:
                void grow_regions_bfs(const PartitionConfig & config, graph_access & G);
                void grow_regions_fm(const PartitionConfig & config, graph_access & G);
                NodeID find_start_node( const PartitionConfig & config, graph_access & G);
                void post_fm(const PartitionConfig & config, graph_access & G);
                inline Gain compute_gain( graph_access & G, NodeID node, PartitionID targeting_partition);

};

inline Gain bipartition::compute_gain( graph_access & G, NodeID node, PartitionID targeting_partition) {
        //compute how connected is the target to the current partition
        Gain gain = 0;
        forall_out_edges(G, e, node) {
                NodeID target = G.getEdgeTarget(e);
                if( G.getPartitionIndex(target) == targeting_partition) {
                        gain += G.getEdgeWeight(e);
                } else {
                        gain -= G.getEdgeWeight(e);
                }
        } endfor

        return gain;
}

#endif /* end of include guard: BIPARTITION_7I4IR31Y */

{'repo_name': 'KaHIP/KaHIP', 'stars': '133', 'repo_language': 'C++', 'file_name': 'FindGurobi.cmake', 'mime_type': 'text/plain', 'hash': 4829588503517211202, 'source_dataset': 'data'}